@wujie-shell/core 1.0.0 → 2.0.1
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.
- package/README.md +36 -5
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -0
- package/dist/src/agents/bundled-agents.mjs +1 -0
- package/dist/src/chat/media-archive.mjs +1 -0
- package/dist/src/chat/queue.mjs +1 -0
- package/dist/src/common/diagnostics.mjs +1 -0
- package/dist/src/common/logging.mjs +1 -0
- package/dist/src/common/runtime-logger.mjs +1 -0
- package/dist/src/common/user-events.mjs +1 -0
- package/dist/src/common/utils.mjs +1 -0
- package/dist/src/config/controller.mjs +1 -0
- package/dist/src/connectors/config-utils.mjs +1 -0
- package/dist/src/connectors/constants.mjs +1 -0
- package/dist/src/connectors/controller.mjs +1 -0
- package/dist/src/connectors/kdocs-cli.mjs +1 -0
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -0
- package/dist/src/files/handlers.mjs +1 -0
- package/dist/src/gateway/controller.mjs +1 -0
- package/dist/src/gateway/ws-client.mjs +1 -0
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -0
- package/dist/src/log-reporting/report-logs.mjs +1 -0
- package/dist/src/models/handlers.mjs +1 -0
- package/dist/src/preferences/store.mjs +1 -0
- package/dist/src/runtime/index.mjs +1 -0
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -0
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -0
- package/dist/src/runtime/plugin-sync.mjs +1 -0
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -0
- package/dist/src/skills/import.mjs +1 -0
- package/dist/src/skills/market.mjs +1 -0
- package/dist/src/terminal/manager.mjs +1 -0
- package/package.json +5 -5
- package/dist/src/bundled-agent-skills.mjs +0 -1
- package/dist/src/bundled-agents.mjs +0 -1
- package/dist/src/config-controller.mjs +0 -1
- package/dist/src/gateway-controller.mjs +0 -1
- package/dist/src/gateway-ws.mjs +0 -1
- package/dist/src/logging.mjs +0 -1
- package/dist/src/plugin-sync.mjs +0 -1
- package/dist/src/runtime-logger.mjs +0 -1
- package/dist/src/runtime.mjs +0 -1
- package/dist/src/utils.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x1a9b2e,_0x2c1896){const _0x2b7244=_0xc852,_0xad95d9=_0x1a9b2e();while(!![]){try{const _0x1e627a=parseInt(_0x2b7244(0x22f))/0x1*(-parseInt(_0x2b7244(0x27b))/0x2)+-parseInt(_0x2b7244(0x181))/0x3*(parseInt(_0x2b7244(0xce))/0x4)+parseInt(_0x2b7244(0x2a8))/0x5+-parseInt(_0x2b7244(0x129))/0x6*(parseInt(_0x2b7244(0x1c4))/0x7)+parseInt(_0x2b7244(0x105))/0x8*(-parseInt(_0x2b7244(0xdf))/0x9)+-parseInt(_0x2b7244(0x182))/0xa+parseInt(_0x2b7244(0x233))/0xb;if(_0x1e627a===_0x2c1896)break;else _0xad95d9['push'](_0xad95d9['shift']());}catch(_0x99b8e3){_0xad95d9['push'](_0xad95d9['shift']());}}}(_0x88a4,0xd2388));import{spawn}from'node:child_process';function _0xc852(_0x382915,_0x2ffdea){_0x382915=_0x382915-0xc3;const _0x88a483=_0x88a4();let _0xc852a1=_0x88a483[_0x382915];return _0xc852a1;}import{randomUUID}from'node:crypto';import{mkdir,readFile,readdir,rm,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import{asRecord,asStringArray,dedupeStrings,getTrimmedString}from'../common/utils.mjs';import{DEFAULT_FEISHU_REGISTRATION_ENV,DEFAULT_FEISHU_REGISTRATION_INTERVAL_MS,DEFAULT_FEISHU_REGISTRATION_TIMEOUT_MS,DINGTALK_DOC_MCP_SERVER_NAME,FEISHU_DOC_CONNECTOR_PLUGIN_ID,FEISHU_REGISTRATION_ENV_URLS,KDOCS_SKILL_ID,NETEASE_MAIL_CONNECTOR_PLUGIN_ID,QQBOT_PLUGIN_ID,QQ_MAIL_CONNECTOR_PLUGIN_ID,TENCENT_DOCS_SKILL_ID,TENCENT_DOCS_TOKEN_ENV,TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,WECOM_PLUGIN_ID,WECHAT_PLUGIN_ID}from'./constants.mjs';import{applyFeishuChannelConfig,createConnectorPluginEntry,createDingtalkDocMcpServerConfig,normalizeFeishuDmPolicy,normalizeFeishuGroupPolicy,readOpenClawMcpServersFromConfig,writeOpenClawMcpServersToConfig}from'./config-utils.mjs';const KDOCS_CLI_STEP_TIMEOUT_MS=0x2bf20,KDOCS_CLI_AUTH_POLL_INTERVAL_MS=0x5dc,FEISHU_DOC_CLI_STEP_TIMEOUT_MS=0xa*0x3c*0x3e8;function safeString(_0x1af5a0){const _0x724253=_0xc852;return typeof _0x1af5a0===_0x724253(0x21f)?_0x1af5a0[_0x724253(0x13f)]():'';}function findDingtalkDocMcpServer(_0x31eb14){const _0xe36a94=_0xc852,_0x14f8e1=asRecord(_0x31eb14[DINGTALK_DOC_MCP_SERVER_NAME]);if(Object[_0xe36a94(0x1fa)](_0x14f8e1)[_0xe36a94(0x116)]>0x0)return _0x14f8e1;for(const [_0x8961a2,_0x49b6e3]of Object[_0xe36a94(0x281)](_0x31eb14)){const _0x4dec14=asRecord(_0x49b6e3),_0x2a0e72=getTrimmedString(_0x8961a2)[_0xe36a94(0x154)+_0xe36a94(0x1ae)](),_0x35148a=getTrimmedString(_0x4dec14['url'])['toLowerC'+_0xe36a94(0x1ae)]();if(_0x2a0e72[_0xe36a94(0x1ac)](_0xe36a94(0x26e))||_0x2a0e72[_0xe36a94(0x1ac)](_0xe36a94(0x158))||_0x2a0e72[_0xe36a94(0x1ac)]('钉钉')||_0x35148a['includes'](_0xe36a94(0x26e))||_0x35148a[_0xe36a94(0x1ac)]('dingding'))return _0x4dec14;}return{};}function _0x88a4(){const _0x405602=['now','正在验证飞书授权','Connecto','sage','ion\x20id\x20i','code,请重试','onMode','omplete','json','timeoutM','\x20plugin\x20','transpor','gin\x20dele','ill\x20','slow_dow','ctor\x20del','ector\x20de','EXPIRED','/page/sc','replace','飞书机器人','search:d','ocr','_id','ccess','deleteMc','http:','oc\x20CLI\x20s','output','function','auth','poll','lugin\x20de','飞书\x20CLI\x20执','\x20或\x20devic','et\x20auth.','--app-se','includes','usTimer','ase','rcode','groupAll','p\x20URL','lient','验证超时','eCode','complete','tration\x20','飞书绑定失败:','identity','Entry','Feishu\x20d','企微助手\x20Bot','WujieAI','expired_','skill','qq_mail','boolean','igSnapsh','ted','权状态验证超时','231gORFha','ill\x20enab','n\x20respon','ill\x20conn','onfig','企微助手\x20Sec','\x20is\x20requ','id\x20is\x20re','exists','plugins','openclaw','--device','权状态不符合用户','apiKey','se.','interval','uired','当前飞书开放平台','返回授权\x20URL','hint','wujie.ai','export','delete','wechat-l','spawn','logged\x20i','docs\x20ski','kdocs','tus','netease\x20','process','tion_uri','bind','Channel\x20','\x20connect','login\x20--','onfig\x20up','hannel\x20c','nfig\x20del','rvalMs','search','tatus','oc\x20conne','ector','usStarte','setSkill','botId','already\x20','飞书\x20CLI\x20应','onfigPat','lePath','nector\x20p','xOf','open','keys','appSecre','login','deleteSk','ation_pe','--channe','HTTPS_PR','ode','data','feishu_d','deviceCo','gin\x20upda','连接成功','clear','ecret','SUCCESS','identiti','status','飞书应用创建超时','正在打开飞书用户','error_de','appId','ll\x20conne','cliAppId','appExpir','quired','金山文档授权状态','cret','feishu-d','appDevic','accountN','\x20in\x20begi','map','then','金山文档登录启动','ion\x20not\x20','resolveS','string','<empty>','失,无法初始化','docs-cli','ated','elConfig','docs,dri','streamab','onfig\x20de','prototyp','...(','response','li_user','r-log','金山文档','entry','1681127HSsYQc','create','kdocs-cl','secret','47743311jObVOe','update',',请先完成\x20kd','setChann','wecom\x20ch','verify','飞书\x20CLI\x20用','eamableH','required','\x20channel','nodeExec','飞书开放平台应用','ttp\x20URL\x20','allowFro','Login\x20su','账号\x20is\x20re','mail','spawn\x20op','tencent\x20','https_pr','persistC','ready','失败,请确认\x20k','account','push','\x20已安装','飞书\x20CLI\x20连','scanned','env','cliHostC','\x20exited\x20','微信连接插件,请','errorMes','rlencode','ion_url','Data','的新版客户端','QR_READY','client_s','websocke','山文档授权','catch','pollInte','ope-auth','.json',',请重新连接','groupPol','disabled','nConfig','valid','授权码\x20is\x20r','qqbot\x20ch','enclaw\x20c','feishu\x20d','二维码已过期,请','flow_id','projectR','dAt','eted','dingtalk','egistrat','飞书应用已创建,','\x20not\x20sup','led','rver','com','d\x20auth','mcp','access_d','values','ing','begin','2YLXkOr','QQ机器人\x20Ap','lark-cli','with\x20cod','imap.163','飞书绑定失败','entries','1.0.0','supporte','正在检查飞书\x20C','HTTP\x20','stdout','ion_uri','--no-wai','owFrom','red','QQ\x20邮箱','验证失败','cliAppSe','accounts','oxy','channelI','n?flow_i','ecret\x20应用','nding','error','ired','wechat','orizatio','expired','name','verifyTi','purpose','feishu','check','ion_flow','logout','connecti','timeout','doc_conn','env:\x20','\x22\x20not\x20fo','channel','行失败','Agent','6779415pazSin','企微助手','钉钉文档\x20Str','rnal','--scope','飞书应用创建失败','slides,b','ocs-cli\x20','close','illEntry','fig','ot\x20found','Unsuppor','skills','client_i','scriptio','join','enabled','ternally','1/app/re','imap.qq.','r\x20plugin','find','get','hu\x20regis','完成应用创建','kill','ationUri','annel\x20co','授权状态','share','timer','_doc','d_auth_m','is\x20requi','Personal','金山文档尚未授权','cess','set','imap.exm','\x20chars)','executab','ession\x20i','_complet','mableHtt','smtp.exm','当前客户端未内置','ation_ur','channels','正在验证金山文档','availabl','ion\x20sess','HTTP_PRO','Local\x20lo','4OIvXmj','n\x20update','zationCo','appPollI','请在浏览器完成金','kdocs\x20sk','utf8','登录成功','QQ助手','飞书机器人\x20Ap','message','飞书\x20CLI\x20未','\x20device_','init','正在进入用户授权','dmPolicy','\x20doc\x20mcp','9KFFAcJ','tencent_','ocs:read','operty','POST','slice','\x20config\x20','Invalid\x20','deleteCh','i:keycha','config','setMcpSe','appTimer','ion_uri_','飞书\x20CLI\x20授','igRaw','onnector','ame','腾讯文档','ll\x20updat','connecto','--versio','plugin','once','n\x20not\x20fo','ion/x-ww','netease_','user','wechat-s','openExte','飞书用户身份',',sheets,','allow','Scan\x20suc','docs','setPlugi','权状态验证失败',':authori','7477912VZkFXR','assign','annelCon','腾讯企业邮箱','ctor\x20plu','https:','ession\x20n','max','金山文档已连接','腾讯文档\x20Key','无需重复连接','filter','ERROR','expire_i','onFailur','client','文档\x20Strea','length','mail\x20con','call','tionUriC','all_prox','thorizat','gin\x20save','user_inf','isArray','Failed','e_code:\x20','toString','pluginId','.com','code','stringif','match','ethods','--domain','135840ocGZdK','飞书用户身份授权','已扫描','已连接过','回应用创建页面或','Error','Current\x20','utable','用绑定失败','authStat','icy','qqbot','stdin','protocol','port\x20cli','请在飞书开放平台','url','support@','leted','appPollC','pending','object','trim','clientSe','qq\x20mail\x20','--force-','环境不支持创建\x20','le-http','or\x20plugi','end','--brand','ve,markd','scope_au','wechat-q','authoriz','.opencla','ntervalM','fresh','import','\x20deleted','open_id','重新生成','parse','toLowerC','wecom','d\x20is\x20req','phase','dingding','own,wiki','mer','oc-cli','lastInde','接失败','-weixin','full','feishu\x20c','equired','pSecret\x20','nfig\x20upd','用户已取消飞书机','ent_secr','\x20updated','headers','test','und','e\x20or\x20dev','found','feishu_c','otRaw','deleted','安装包含微信插件','exmail\x20c','environm','Kdocs\x20CL','r\x20\x22','sessionI','163\x20邮箱','applicat','expiresA','enied','/oauth/v','tateDir','I\x20sessio','ogin','pServer','pID\x20is\x20r','read','verifica','3852375uzSxcj','1880090hhFEpO','stderr','device_c','connecte','footer'];_0x88a4=function(){return _0x405602;};return _0x88a4();}function createFeishuRegistrationClient(){const _0xae7516=_0xc852,_0x39a7e6=FEISHU_REGISTRATION_ENV_URLS[DEFAULT_FEISHU_REGISTRATION_ENV];if(!_0x39a7e6)throw new Error(_0xae7516(0x2b4)+'ted\x20Feis'+_0xae7516(0x2c0)+_0xae7516(0x1b6)+_0xae7516(0x2a3)+DEFAULT_FEISHU_REGISTRATION_ENV);return{'baseUrl':_0x39a7e6,'headers':{'Content-Type':_0xae7516(0x176)+_0xae7516(0xf8)+'w-form-u'+_0xae7516(0x254)+'d'},'timeoutMs':DEFAULT_FEISHU_REGISTRATION_TIMEOUT_MS};}async function postFeishuRegistration(_0x28748a,_0x4932da){const _0x2578bf=_0xc852,_0x39f8e4=await fetch(_0x28748a['baseUrl']+(_0x2578bf(0x179)+_0x2578bf(0x2bb)+'gistrati'+'on'),{'method':_0x2578bf(0xe3),'headers':_0x28748a[_0x2578bf(0x167)],'body':new URLSearchParams(_0x4932da)[_0x2578bf(0x121)](),'signal':AbortSignal[_0x2578bf(0x2a1)](_0x28748a[_0x2578bf(0x190)+'s'])}),_0x3ea338=await _0x39f8e4[_0x2578bf(0x18f)]()[_0x2578bf(0x25c)](()=>({}));if(!_0x39f8e4['ok']){const _0x4ec993=new Error(_0x2578bf(0x285)+_0x39f8e4[_0x2578bf(0x20b)]);_0x4ec993['response'+_0x2578bf(0x256)]=_0x3ea338;throw _0x4ec993;}return asRecord(_0x3ea338);}async function initFeishuRegistration(_0x4c1c0f){const _0x22e10e=_0xc852;return postFeishuRegistration(_0x4c1c0f,{'action':_0x22e10e(0xdb)});}async function beginFeishuRegistration(_0x4032b4){const _0x4df7b8=_0xc852;return postFeishuRegistration(_0x4032b4,{'action':_0x4df7b8(0x27a),'archetype':_0x4df7b8(0x2cb)+_0x4df7b8(0x2a7),'auth_method':_0x4df7b8(0x259)+_0x4df7b8(0x208),'request_user_info':_0x4df7b8(0x151)});}async function pollFeishuRegistration(_0x5c3fa5,_0x23d55c){const _0x38386d=_0xc852;try{return await postFeishuRegistration(_0x5c3fa5,{'action':_0x38386d(0x1a6),'device_code':_0x23d55c});}catch(_0x456d7c){if(_0x456d7c?.[_0x38386d(0x22a)+_0x38386d(0x256)]&&typeof _0x456d7c[_0x38386d(0x22a)+_0x38386d(0x256)]===_0x38386d(0x13e))return asRecord(_0x456d7c[_0x38386d(0x22a)+_0x38386d(0x256)]);throw _0x456d7c;}}function extractFeishuRegistrationAuthorizationUri(_0x2f3937){const _0x462120=_0xc852,_0x532fd7=getTrimmedString(_0x2f3937[_0x462120(0x14b)+_0x462120(0xc7)+'i_comple'+'te'])||getTrimmedString(_0x2f3937[_0x462120(0x14b)+_0x462120(0xc7)+'i'])||getTrimmedString(_0x2f3937['scope_au'+'thorizat'+_0x462120(0xec)+_0x462120(0x1b5)])||getTrimmedString(_0x2f3937[_0x462120(0x149)+'thorizat'+_0x462120(0x287)])||getTrimmedString(_0x2f3937[_0x462120(0x149)+'thorizat'+_0x462120(0x255)])||getTrimmedString(_0x2f3937[_0x462120(0x14b)+_0x462120(0xc7)+'l']);if(_0x532fd7)return _0x532fd7;const _0x4f114a=getTrimmedString(_0x2f3937[_0x462120(0x26a)])||getTrimmedString(_0x2f3937[_0x462120(0x149)+_0x462120(0x11b)+_0x462120(0x29e)+_0x462120(0x19e)]);return _0x4f114a?FEISHU_REGISTRATION_ENV_URLS[DEFAULT_FEISHU_REGISTRATION_ENV]+(_0x462120(0x199)+_0x462120(0x25e)+_0x462120(0x297)+_0x462120(0x291)+'d=')+encodeURIComponent(_0x4f114a):null;}function serializeFeishuRegistrationSession(_0x29706e){const _0x551e14=_0xc852;return{'sessionId':_0x29706e[_0x551e14(0x174)+'d'],'verificationUriComplete':_0x29706e[_0x551e14(0x180)+_0x551e14(0x119)+_0x551e14(0x18e)],'expiresAt':new Date(_0x29706e[_0x551e14(0x177)+'t'])['toISOStr'+_0x551e14(0x279)](),'pollIntervalMs':_0x29706e[_0x551e14(0x25d)+_0x551e14(0x1eb)],'status':_0x29706e[_0x551e14(0x20b)],'errorMessage':_0x29706e[_0x551e14(0x253)+_0x551e14(0x18a)],'purpose':_0x29706e[_0x551e14(0x29b)],'authorizationUri':_0x29706e[_0x551e14(0x14b)+'ationUri']};}function extractFirstUrl(_0x24d742){const _0x9e64e4=_0xc852,_0x38db3f=_0x24d742[_0x9e64e4(0x126)](/https?:\/\/[^\s"'<>]+/i);return _0x38db3f?_0x38db3f[0x0]:null;}function isKdocsAuthStatusReady(_0x360247){const _0x205185=_0xc852,_0x10c744=_0x360247[_0x205185(0x154)+'ase']();if(/not\s+login|not\s+logged|unauth|未登录|未认证|未授权|失败/[_0x205185(0x168)](_0x10c744))return![];return/login|logged|auth|valid|success|已登录|已认证|已授权|有效|成功/['test'](_0x10c744);}function parseFeishuDocCliJson(_0x7f764a){const _0x883177=_0xc852,_0x442f2d=_0x7f764a['trim']();if(!_0x442f2d)return{};try{return asRecord(JSON['parse'](_0x442f2d));}catch{for(let _0x3fc034=_0x442f2d['indexOf']('{');_0x3fc034>=0x0;_0x3fc034=_0x442f2d['indexOf']('{',_0x3fc034+0x1)){for(let _0x5da312=_0x442f2d[_0x883177(0x15c)+_0x883177(0x1f8)]('}');_0x5da312>_0x3fc034;_0x5da312=_0x442f2d[_0x883177(0x15c)+_0x883177(0x1f8)]('}',_0x5da312-0x1)){try{return asRecord(JSON[_0x883177(0x153)](_0x442f2d['slice'](_0x3fc034,_0x5da312+0x1)));}catch{}}}return{};}}function summarizeCliOutput(_0x4c8b2b){const _0x2d8c39=_0xc852,_0x226e53=_0x4c8b2b[_0x2d8c39(0x13f)]();if(!_0x226e53)return _0x2d8c39(0x220);return _0x226e53['length']>0x320?_0x226e53[_0x2d8c39(0xe4)](0x0,0x320)+_0x2d8c39(0x229)+_0x226e53[_0x2d8c39(0x116)]+_0x2d8c39(0x2d0):_0x226e53;}function extractFeishuDocCliError(_0x47f497,_0x1d6536){const _0x54af6a=_0xc852,_0x155cc5=parseFeishuDocCliJson(_0x47f497),_0x55ea2e=asRecord(_0x155cc5[_0x54af6a(0x294)]),_0x514ad3=getTrimmedString(_0x55ea2e[_0x54af6a(0xd8)]),_0x45f318=getTrimmedString(_0x55ea2e[_0x54af6a(0x1d7)]);if(_0x514ad3&&_0x45f318)return _0x514ad3+'\x0a'+_0x45f318;if(_0x514ad3)return _0x514ad3;return _0x47f497[_0x54af6a(0x13f)]()||_0x1d6536;}function getFeishuDocCliFailureMessage(_0x1691bb,_0x565e25,_0xe75012){const _0x599b07=_0xc852,_0x146834=_0x565e25['trim']()['split']('\x0a')['slice'](-0x8)[_0x599b07(0x2b8)]('\x0a')[_0x599b07(0x13f)](),_0x373a0a=_0x1691bb==='create'?_0x599b07(0x23e)+'创建失败':_0x1691bb===_0x599b07(0x1e4)?_0x599b07(0x1f4)+_0x599b07(0x131):_0x1691bb===_0x599b07(0x1a5)?_0x599b07(0x239)+'户授权失败':_0x599b07(0xed)+_0x599b07(0x103);return _0x146834?_0x373a0a+':\x20'+_0x146834:_0x373a0a+':\x20'+_0xe75012;}function ensureFeishuDocCliUserStatus(_0x4fc19e){const _0x253640=_0xc852,_0x5ee904=parseFeishuDocCliJson(_0x4fc19e),_0x32f0a6=asRecord(_0x5ee904[_0x253640(0x20a)+'es']),_0xa3320c=asRecord(_0x32f0a6[_0x253640(0xfa)]),_0x5a47ab=getTrimmedString(_0x5ee904[_0x253640(0x1b8)]),_0x2ce87c=getTrimmedString(_0x5ee904['tokenSta'+_0x253640(0x1e0)])||getTrimmedString(_0xa3320c['tokenSta'+_0x253640(0x1e0)]),_0x3cd402=getTrimmedString(_0xa3320c[_0x253640(0x20b)]),_0x54ab8b=_0xa3320c[_0x253640(0xca)+'e']===!![];if(_0x5a47ab!==_0x253640(0xfa)||_0x3cd402&&_0x3cd402!==_0x253640(0x248)||Object[_0x253640(0x1fa)](_0xa3320c)[_0x253640(0x116)]>0x0&&!_0x54ab8b||_0x2ce87c!==_0x253640(0x264)&&_0x2ce87c!=='needs_re'+_0x253640(0x14e))throw new Error(_0x253640(0xed)+_0x253640(0x1d0)+'身份要求:\x20'+_0x4fc19e[_0x253640(0x13f)]());}function createKdocsCliStatus(_0x5e1fe2){const _0xbceb7f=_0xc852;return{'sessionId':_0x5e1fe2['sessionI'+'d'],'status':_0x5e1fe2[_0xbceb7f(0x20b)],'phase':_0x5e1fe2[_0xbceb7f(0x157)],'url':_0x5e1fe2[_0xbceb7f(0x139)],'message':_0x5e1fe2[_0xbceb7f(0xd8)],'errorMessage':_0x5e1fe2[_0xbceb7f(0x253)+_0xbceb7f(0x18a)]};}function createFeishuDocCliStatus(_0x1aedc5){const _0x27e91f=_0xc852;return{'sessionId':_0x1aedc5[_0x27e91f(0x174)+'d'],'status':_0x1aedc5[_0x27e91f(0x20b)],'phase':_0x1aedc5[_0x27e91f(0x157)],'url':_0x1aedc5['url'],'message':_0x1aedc5[_0x27e91f(0xd8)],'errorMessage':_0x1aedc5[_0x27e91f(0x253)+_0x27e91f(0x18a)]};}export function createConnectorController({shellConfig:_0x482635,configController:_0x3aad17,broadcast:_0x3868f8,shell:_0x54639c,getRuntimeSpawnContext:_0x38e3ab,openClawConfigHandlers:openClawConfigHandlers={},resolveRuntimeKdocsCliCommand:_0x4245cc,resolveRuntimeLarkCliCommand:_0x3c9e36}){const _0x35ea73=_0xc852,_0x7c6eef=new Map(),_0x931e4c=new Map(),_0x3c1879=new Map();let _0x2ba560=null;const _0x2d7664=()=>_0x3aad17['readConf'+_0x35ea73(0xee)]();async function _0x17ccc5(_0x8bed95,_0x30c1bb){const _0x6e5239=_0x35ea73;if(typeof openClawConfigHandlers['update']==='function')return openClawConfigHandlers[_0x6e5239(0x234)](_0x132011=>{const _0x4ca5d4=_0x6e5239;for(const _0x2073fd of Object[_0x4ca5d4(0x1fa)](_0x132011)){!Object[_0x4ca5d4(0x228)+'e']['hasOwnPr'+_0x4ca5d4(0xe2)][_0x4ca5d4(0x118)](_0x8bed95,_0x2073fd)&&delete _0x132011[_0x2073fd];}Object[_0x4ca5d4(0x106)](_0x132011,_0x8bed95);},_0x30c1bb);return typeof _0x3aad17[_0x6e5239(0x247)+_0x6e5239(0x1c8)]==='function'?await _0x3aad17[_0x6e5239(0x247)+_0x6e5239(0x1c8)](_0x8bed95,_0x30c1bb):(_0x3aad17['markConf'+'igWriteH'+'andledIn'+_0x6e5239(0x2ba)]?.(),await _0x3aad17['writeCon'+_0x6e5239(0x2b2)](_0x8bed95,_0x30c1bb)),{'ok':!![]};}function _0x326b6e(){const _0x44ebf9=_0x35ea73;return join(_0x3aad17[_0x44ebf9(0x21e)+_0x44ebf9(0x17a)](),_0x44ebf9(0x216)+_0x44ebf9(0x15b));}function _0x12b48f(){const _0xb99771=_0x35ea73;return join(_0x326b6e(),_0xb99771(0x14c)+'w',_0xb99771(0x1ce)+'.json');}async function _0x403451(_0x1bcbed={}){const _0x1e8aa5=_0x35ea73;return _0x38e3ab(_0x482635[_0x1e8aa5(0x26b)+'oot'],_0x1bcbed);}async function _0x24f352(_0x1e3d5f,_0x531bc8){const _0x2acc13=_0x35ea73,{env:_0x57d5f9,runtime:_0x38a115}=await _0x403451({'FORCE_COLOR':'0','HOME':homedir()}),_0x2aa2fe=await _0x4245cc(_0x38a115);return _0x3868f8(_0x2acc13(0xf3)+_0x2acc13(0x22c),{'connector':_0x2acc13(0x1df),'phase':'spawn','message':'kdocs-cl'+'i\x20'+_0x1e3d5f['join']('\x20')}),new Promise((_0x12819c,_0x388042)=>{const _0xc99c69=_0x2acc13,_0x5e5375=spawn(_0x2aa2fe[_0xc99c69(0x2d1)+_0xc99c69(0x1f6)],_0x1e3d5f,{'cwd':homedir(),'env':_0x57d5f9});let _0x5c5ed7='';const _0x18c737=_0x1f3a24=>{const _0x2b0bfa=_0xc99c69,_0x1a9498=_0x1f3a24[_0x2b0bfa(0x121)]('utf8');_0x5c5ed7+=_0x1a9498,_0x3868f8('connecto'+_0x2b0bfa(0x22c),{'connector':_0x2b0bfa(0x1df),'phase':_0x2b0bfa(0x1a3),'message':_0x1a9498});};_0x5e5375[_0xc99c69(0x286)]['on'](_0xc99c69(0x202),_0x18c737),_0x5e5375[_0xc99c69(0x183)]['on'](_0xc99c69(0x202),_0x18c737),_0x5e5375[_0xc99c69(0xf6)](_0xc99c69(0x294),_0x388042),_0x5e5375['once'](_0xc99c69(0x2b0),_0xf1d5df=>_0x12819c({'code':_0xf1d5df,'output':_0x5c5ed7}));if(typeof _0x531bc8==='string')_0x5e5375[_0xc99c69(0x135)][_0xc99c69(0x146)](_0x531bc8);else _0x5e5375[_0xc99c69(0x135)][_0xc99c69(0x146)]();});}async function _0x3d41b8(){const _0x2b169f=_0x35ea73,_0x17287c=await _0x2d7664(),_0x3e3157=asRecord(_0x17287c[_0x2b169f(0x2b5)]),_0xa4576a=asRecord(_0x3e3157[_0x2b169f(0x281)]),_0x18837a={...asRecord(_0xa4576a[KDOCS_SKILL_ID]),'enabled':!![]};if(typeof openClawConfigHandlers[_0x2b169f(0x1f1)+_0x2b169f(0x1b9)]===_0x2b169f(0x1a4)){await openClawConfigHandlers[_0x2b169f(0x1f1)+_0x2b169f(0x1b9)]({'skillId':KDOCS_SKILL_ID,'entry':_0x18837a,'reason':_0x2b169f(0xd3)+_0x2b169f(0x1c5)+_0x2b169f(0x272)});return;}_0xa4576a[KDOCS_SKILL_ID]=_0x18837a,_0x3e3157['entries']=_0xa4576a,_0x17287c[_0x2b169f(0x2b5)]=_0x3e3157,await _0x17ccc5(_0x17287c,_0x2b169f(0xd3)+'ill\x20enab'+'led');}async function _0x5a187c(_0x8c4b27){const _0x3054d3=_0x35ea73,_0x4a6298=await _0x2d7664(),_0x2f2027=asRecord(_0x4a6298[_0x3054d3(0x2b5)]),_0x3a4717=asRecord(_0x2f2027[_0x3054d3(0x281)]),_0x4ed209={...asRecord(_0x3a4717[KDOCS_SKILL_ID]),'enabled':Boolean(_0x8c4b27)};if(typeof openClawConfigHandlers[_0x3054d3(0x1f1)+'Entry']===_0x3054d3(0x1a4)){await openClawConfigHandlers[_0x3054d3(0x1f1)+_0x3054d3(0x1b9)]({'skillId':KDOCS_SKILL_ID,'entry':_0x4ed209,'reason':_0x3054d3(0xd3)+'ill\x20'+(_0x8c4b27?_0x3054d3(0x2b9):_0x3054d3(0x262))});return;}_0x3a4717[KDOCS_SKILL_ID]=_0x4ed209,_0x2f2027[_0x3054d3(0x281)]=_0x3a4717,_0x4a6298['skills']=_0x2f2027,await _0x17ccc5(_0x4a6298,_0x3054d3(0xd3)+_0x3054d3(0x194)+(_0x8c4b27?'enabled':_0x3054d3(0x262)));}async function _0x397015(){const _0x4cc2e9=_0x35ea73;if(typeof openClawConfigHandlers[_0x4cc2e9(0x1fd)+'illEntry']==='function'){await openClawConfigHandlers[_0x4cc2e9(0x1fd)+_0x4cc2e9(0x2b1)]({'skillId':KDOCS_SKILL_ID,'reason':_0x4cc2e9(0xd3)+'ill\x20conn'+_0x4cc2e9(0x197)+_0x4cc2e9(0x13b)});return;}const _0x122607=await _0x2d7664(),_0x397ed2=asRecord(_0x122607[_0x4cc2e9(0x2b5)]),_0x365a11=asRecord(_0x397ed2['entries']);delete _0x365a11[KDOCS_SKILL_ID],_0x397ed2['entries']=_0x365a11,_0x122607[_0x4cc2e9(0x2b5)]=_0x397ed2,await _0x17ccc5(_0x122607,_0x4cc2e9(0xd3)+_0x4cc2e9(0x1c7)+_0x4cc2e9(0x197)+'leted');}async function _0x4bff87(){const _0x23bf37=_0x35ea73;if(!await _0x5c6e4b())throw new Error(_0x23bf37(0x2cc)+_0x23bf37(0x235)+_0x23bf37(0x2af)+'连接');return await _0x3d41b8(),{'ok':!![]};}async function _0x5c6e4b(){const _0x46e10f=_0x35ea73,_0x4f8626=await _0x24f352(['auth',_0x46e10f(0x20b)])[_0x46e10f(0x25c)](()=>({'code':null,'output':''}));return _0x4f8626[_0x46e10f(0x124)]===0x0&&isKdocsAuthStatusReady(_0x4f8626[_0x46e10f(0x1a3)]);}async function _0x232720({appId:_0x8f522b,appSecret:_0xc20c21,userInfo:userInfo=null}){const _0x2673c2=_0x35ea73,_0xbdf7d4=await _0x2d7664();applyFeishuChannelConfig(_0xbdf7d4,{'appId':_0x8f522b,'appSecret':_0xc20c21,'userInfo':userInfo});const _0x5b41ea=asRecord(_0xbdf7d4[_0x2673c2(0xc8)]);if(typeof openClawConfigHandlers['setChann'+_0x2673c2(0x224)]===_0x2673c2(0x1a4))return openClawConfigHandlers[_0x2673c2(0x236)+'elConfig']({'channelId':_0x2673c2(0x29c),'channel':asRecord(_0x5b41ea['feishu']),'pluginId':_0x2673c2(0x29c),'pluginEnabled':!![],'reason':_0x2673c2(0x160)+_0x2673c2(0x1e9)+_0x2673c2(0x1e8)+'dated'});await _0x17ccc5(_0xbdf7d4,'feishu\x20c'+_0x2673c2(0x1e9)+_0x2673c2(0x1e8)+'dated');}async function _0x4e5b4e({appId:_0x3e0c63,appSecret:_0x24be88,userInfo:userInfo=null,configPath:_0x476b38}){const _0x5678b9=_0x35ea73,_0x472c66=getTrimmedString(userInfo?.['openId']),_0x10e89c={'channels':{'feishu':{'enabled':![],'appId':_0x3e0c63,'appSecret':_0x24be88,'domain':_0x5678b9(0x29c),'connectionMode':_0x5678b9(0x25a)+'t','requireMention':!![],'dmPolicy':_0x472c66?'allowlis'+'t':_0x5678b9(0x262),'groupPolicy':_0x5678b9(0x262),'streaming':!![],'allowFrom':_0x472c66?[_0x472c66]:[],'groupAllowFrom':[]}},'plugins':{'entries':{},'allow':[]},'tools':{'profile':_0x5678b9(0x15f)}};await mkdir(dirname(_0x476b38),{'recursive':!![]}),await writeFile(_0x476b38,JSON[_0x5678b9(0x125)+'y'](_0x10e89c,null,0x2)+'\x0a',_0x5678b9(0xd4));}async function _0x3d6a66(_0x3109b8={}){const _0x31e1ba=_0x35ea73,_0x439e77=safeString(_0x3109b8[_0x31e1ba(0x20f)]),_0x351692=safeString(_0x3109b8['appSecre'+'t']);if(!_0x439e77)throw new Error('飞书机器人\x20Ap'+_0x31e1ba(0x17e)+_0x31e1ba(0x161));if(!_0x351692)throw new Error(_0x31e1ba(0xd7)+_0x31e1ba(0x162)+_0x31e1ba(0x2ca)+'red');return await _0x232720({'appId':_0x439e77,'appSecret':_0x351692,'userInfo':null}),{'ok':!![]};}async function _0x44013a(_0x7cb8f1={}){const _0x23ebd7=_0x35ea73,_0x12d972=safeString(_0x7cb8f1[_0x23ebd7(0x20f)]),_0xc7a0ea=safeString(_0x7cb8f1[_0x23ebd7(0x140)+'cret']);if(!_0x12d972)throw new Error(_0x23ebd7(0x27c)+_0x23ebd7(0x17e)+'equired');if(!_0xc7a0ea)throw new Error('QQ机器人\x20Ap'+'pSecret\x20'+_0x23ebd7(0x2ca)+_0x23ebd7(0x28a));const _0xd292da=await _0x2d7664(),_0x5ddc50=asRecord(_0xd292da[_0x23ebd7(0xc8)]),_0x170f26=asRecord(_0x5ddc50[_0x23ebd7(0x134)]),_0x2bd8d2={'enabled':typeof _0x170f26['enabled']===_0x23ebd7(0x1c0)?_0x170f26[_0x23ebd7(0x2b9)]:!![],'allowFrom':['*'],'appId':_0x12d972,'clientSecret':_0xc7a0ea};if(typeof openClawConfigHandlers['setChann'+_0x23ebd7(0x224)]===_0x23ebd7(0x1a4))return openClawConfigHandlers['setChann'+_0x23ebd7(0x224)]({'channelId':_0x23ebd7(0x134),'channel':_0x2bd8d2,'pluginId':QQBOT_PLUGIN_ID,'pluginEnabled':!![],'reason':'qqbot\x20ch'+'annel\x20co'+'nfig\x20upd'+_0x23ebd7(0x223)});_0x5ddc50[_0x23ebd7(0x134)]=_0x2bd8d2,_0xd292da[_0x23ebd7(0xc8)]=_0x5ddc50;const _0x5029f1=asRecord(_0xd292da['plugins']),_0x56216b=asRecord(_0x5029f1[_0x23ebd7(0x281)]);return _0x56216b[QQBOT_PLUGIN_ID]={...asRecord(_0x56216b[QQBOT_PLUGIN_ID]),'enabled':!![]},_0x5029f1[_0x23ebd7(0x281)]=_0x56216b,_0x5029f1['allow']=dedupeStrings([...asStringArray(_0x5029f1[_0x23ebd7(0xff)]),QQBOT_PLUGIN_ID]),_0xd292da[_0x23ebd7(0x1cd)]=_0x5029f1,await _0x17ccc5(_0xd292da,_0x23ebd7(0x266)+_0x23ebd7(0x2c4)+_0x23ebd7(0x163)+_0x23ebd7(0x223)),{'ok':!![]};}async function _0x155db7(_0x9589c1={}){const _0xb768b7=_0x35ea73,_0x58b3bf=safeString(_0x9589c1[_0xb768b7(0x1f2)]),_0xb2740=safeString(_0x9589c1[_0xb768b7(0x232)]);if(!_0x58b3bf)throw new Error(_0xb768b7(0x1bb)+'ID\x20is\x20re'+_0xb768b7(0x213));if(!_0xb2740)throw new Error(_0xb768b7(0x1c9)+'ret\x20is\x20r'+'equired');const _0x37bc17=await _0x2d7664(),_0x3940d9=asRecord(_0x37bc17[_0xb768b7(0xc8)]),_0x3dbb4a=asRecord(_0x3940d9[_0xb768b7(0x155)]),_0x3eaae4={..._0x3dbb4a,'enabled':typeof _0x3dbb4a['enabled']===_0xb768b7(0x1c0)?_0x3dbb4a['enabled']:!![],'name':getTrimmedString(_0x3dbb4a[_0xb768b7(0x299)])||'企微助手','connectionMode':getTrimmedString(_0x3dbb4a[_0xb768b7(0x2a0)+_0xb768b7(0x18d)])||_0xb768b7(0x25a)+'t','dmPolicy':normalizeFeishuDmPolicy(_0x3dbb4a[_0xb768b7(0xdd)])??_0xb768b7(0x1f9),'groupPolicy':normalizeFeishuGroupPolicy(_0x3dbb4a[_0xb768b7(0x261)+_0xb768b7(0x133)])??'open','allowFrom':asStringArray(_0x3dbb4a[_0xb768b7(0x240)+'m']),'groupAllowFrom':asStringArray(_0x3dbb4a[_0xb768b7(0x1b0)+_0xb768b7(0x289)]),'botId':_0x58b3bf,'secret':_0xb2740};if(typeof openClawConfigHandlers[_0xb768b7(0x236)+_0xb768b7(0x224)]===_0xb768b7(0x1a4))return openClawConfigHandlers[_0xb768b7(0x236)+_0xb768b7(0x224)]({'channelId':'wecom','channel':_0x3eaae4,'pluginId':WECOM_PLUGIN_ID,'pluginEnabled':!![],'reason':_0xb768b7(0x237)+_0xb768b7(0x2c4)+_0xb768b7(0x163)+_0xb768b7(0x223)});_0x3940d9[_0xb768b7(0x155)]=_0x3eaae4,_0x37bc17[_0xb768b7(0xc8)]=_0x3940d9;const _0x30f7e0=asRecord(_0x37bc17[_0xb768b7(0x1cd)]),_0x364e48=asRecord(_0x30f7e0['entries']);return _0x364e48[WECOM_PLUGIN_ID]={...asRecord(_0x364e48[WECOM_PLUGIN_ID]),'enabled':!![]},_0x30f7e0[_0xb768b7(0x281)]=_0x364e48,_0x30f7e0['allow']=dedupeStrings([...asStringArray(_0x30f7e0[_0xb768b7(0xff)]),WECOM_PLUGIN_ID]),_0x37bc17[_0xb768b7(0x1cd)]=_0x30f7e0,await _0x17ccc5(_0x37bc17,_0xb768b7(0x237)+'annel\x20co'+'nfig\x20upd'+'ated'),{'ok':!![]};}async function _0xa38c5c(_0x16f836,_0x1ca8de,_0x3f68e2,_0x5148cd){const _0x147e09=_0x35ea73,_0x23607f=safeString(_0x1ca8de[_0x147e09(0x24a)]),_0x22c0b2=String(_0x1ca8de[_0x147e09(0x14b)+'ationCod'+'e']||'')[_0x147e09(0x19a)](/\s+/g,'');if(!_0x23607f)throw new Error(_0x5148cd+(_0x147e09(0x242)+'quired'));if(!_0x22c0b2)throw new Error(_0x5148cd+(_0x147e09(0x265)+_0x147e09(0x161)));const _0x172c27=await _0x2d7664(),_0x1d80a8=asRecord(_0x172c27['plugins']),_0x1b83d7=asRecord(_0x1d80a8[_0x147e09(0x281)]),_0x3a34c8=createConnectorPluginEntry(_0x16f836,_0x1b83d7[_0x16f836],!![],{'account':_0x23607f,'authorizationCode':_0x22c0b2,..._0x3f68e2});if(typeof openClawConfigHandlers[_0x147e09(0x102)+_0x147e09(0x263)]==='function')return openClawConfigHandlers[_0x147e09(0x102)+'nConfig']({'pluginId':_0x16f836,'enabled':!![],'config':asRecord(_0x3a34c8[_0x147e09(0xe9)]),'reason':_0x16f836+(_0x147e09(0x1e6)+'or\x20plugi'+'n\x20update'+'d')});return _0x1b83d7[_0x16f836]=_0x3a34c8,_0x1d80a8['entries']=_0x1b83d7,_0x1d80a8[_0x147e09(0xff)]=dedupeStrings([...asStringArray(_0x1d80a8[_0x147e09(0xff)]),_0x16f836]),_0x172c27[_0x147e09(0x1cd)]=_0x1d80a8,await _0x17ccc5(_0x172c27,_0x16f836+(_0x147e09(0x1e6)+_0x147e09(0x145)+_0x147e09(0xcf)+'d')),{'ok':!![]};}const _0x3f87f7=_0x3c269c=>_0xa38c5c(QQ_MAIL_CONNECTOR_PLUGIN_ID,_0x3c269c,{'imapHost':_0x35ea73(0x2bc)+_0x35ea73(0x274),'imapPort':0x3e1,'smtpHost':'smtp.qq.'+_0x35ea73(0x274),'smtpPort':0x1d1,'secure':!![]},_0x35ea73(0x28b)),_0x3832f8=_0x480b6e=>_0xa38c5c(NETEASE_MAIL_CONNECTOR_PLUGIN_ID,_0x480b6e,{'imapHost':_0x35ea73(0x27f)+_0x35ea73(0x123),'imapPort':0x3e1,'smtpHost':'smtp.163'+_0x35ea73(0x123),'smtpPort':0x1d1,'imapClientName':_0x35ea73(0x1bc),'imapClientVersion':_0x35ea73(0x282),'imapClientVendor':_0x35ea73(0x1bc),'imapClientSupportEmail':_0x35ea73(0x13a)+_0x35ea73(0x1d8),'secure':!![]},_0x35ea73(0x175)),_0x8ce02f=_0x305d0f=>_0xa38c5c(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,_0x305d0f,{'imapHost':_0x35ea73(0x2cf)+'ail.qq.c'+'om','imapPort':0x3e1,'smtpHost':_0x35ea73(0xc5)+'ail.qq.c'+'om','smtpPort':0x1d1,'secure':!![]},_0x35ea73(0x108));async function _0x5994a2(_0x4eee41={}){const _0x2c9ba6=_0x35ea73,_0x9ab875=safeString(_0x4eee41[_0x2c9ba6(0x218)+_0x2c9ba6(0xf0)])||_0x2c9ba6(0xfd),_0x3d9980=await _0x2d7664(),_0x4997e1=asRecord(_0x3d9980[_0x2c9ba6(0x1cd)]),_0x386db5=asRecord(_0x4997e1[_0x2c9ba6(0x281)]),_0xcb94f=createConnectorPluginEntry(FEISHU_DOC_CONNECTOR_PLUGIN_ID,_0x386db5[FEISHU_DOC_CONNECTOR_PLUGIN_ID],!![],{'authMode':_0x2c9ba6(0xfa),'accountName':_0x9ab875});if(typeof openClawConfigHandlers['setPlugi'+'nConfig']===_0x2c9ba6(0x1a4))return openClawConfigHandlers[_0x2c9ba6(0x102)+_0x2c9ba6(0x263)]({'pluginId':FEISHU_DOC_CONNECTOR_PLUGIN_ID,'enabled':!![],'config':asRecord(_0xcb94f['config']),'reason':'feishu\x20d'+_0x2c9ba6(0x1ee)+_0x2c9ba6(0x109)+_0x2c9ba6(0x205)+_0x2c9ba6(0x1c2)});return _0x386db5[FEISHU_DOC_CONNECTOR_PLUGIN_ID]=_0xcb94f,_0x4997e1['entries']=_0x386db5,_0x4997e1['allow']=dedupeStrings([...asStringArray(_0x4997e1[_0x2c9ba6(0xff)]),FEISHU_DOC_CONNECTOR_PLUGIN_ID]),_0x3d9980['plugins']=_0x4997e1,await _0x17ccc5(_0x3d9980,_0x2c9ba6(0x268)+'oc\x20conne'+_0x2c9ba6(0x109)+_0x2c9ba6(0x205)+_0x2c9ba6(0x1c2)),{'ok':!![]};}async function _0x241ec7(_0x1e0713={}){const _0x30dcf7=_0x35ea73,_0x4f594b=safeString(_0x1e0713[_0x30dcf7(0x1d1)]);if(!_0x4f594b)throw new Error(_0x30dcf7(0x10e)+_0x30dcf7(0x1ca)+_0x30dcf7(0x295));const _0x2d8d46=await _0x2d7664(),_0x5ba587=asRecord(_0x2d8d46['skills']),_0x8c5e49=asRecord(_0x5ba587['entries']),_0x47d5c9=asRecord(_0x8c5e49[TENCENT_DOCS_SKILL_ID]),_0x559591={..._0x47d5c9,'enabled':!![],'env':{...asRecord(_0x47d5c9[_0x30dcf7(0x24f)]),[TENCENT_DOCS_TOKEN_ENV]:_0x4f594b}};if(typeof openClawConfigHandlers[_0x30dcf7(0x1f1)+'Entry']==='function')return openClawConfigHandlers['setSkill'+_0x30dcf7(0x1b9)]({'skillId':TENCENT_DOCS_SKILL_ID,'entry':_0x559591,'reason':_0x30dcf7(0x245)+_0x30dcf7(0x1de)+_0x30dcf7(0xf2)+'ed'});return _0x8c5e49[TENCENT_DOCS_SKILL_ID]=_0x559591,_0x5ba587[_0x30dcf7(0x281)]=_0x8c5e49,_0x2d8d46[_0x30dcf7(0x2b5)]=_0x5ba587,await _0x17ccc5(_0x2d8d46,'tencent\x20'+_0x30dcf7(0x1de)+_0x30dcf7(0xf2)+'ed'),{'ok':!![]};}async function _0x5c77bf(_0x1eff4c={}){const _0x2096db=_0x35ea73,_0x3f90a9=safeString(_0x1eff4c[_0x2096db(0x139)]);if(!_0x3f90a9)throw new Error(_0x2096db(0x2aa)+_0x2096db(0x23a)+_0x2096db(0x23f)+'is\x20requi'+_0x2096db(0x28a));try{const _0x28542d=new URL(_0x3f90a9);if(![_0x2096db(0x1a1),_0x2096db(0x10a)][_0x2096db(0x1ac)](_0x28542d[_0x2096db(0x136)]))throw new Error(_0x2096db(0xe6)+'protocol');}catch{throw new Error('请输入有效的钉钉'+_0x2096db(0x115)+_0x2096db(0xc4)+_0x2096db(0x1b1));}if(typeof openClawConfigHandlers['setMcpSe'+'rver']===_0x2096db(0x1a4))return openClawConfigHandlers[_0x2096db(0xea)+_0x2096db(0x273)]({'serverName':DINGTALK_DOC_MCP_SERVER_NAME,'server':createDingtalkDocMcpServerConfig(_0x3f90a9),'reason':_0x2096db(0x26e)+_0x2096db(0xde)+_0x2096db(0x166)});const _0x30aab3=await _0x2d7664(),_0x808bff=readOpenClawMcpServersFromConfig(_0x30aab3);return _0x808bff[DINGTALK_DOC_MCP_SERVER_NAME]=createDingtalkDocMcpServerConfig(_0x3f90a9),writeOpenClawMcpServersToConfig(_0x30aab3,_0x808bff),await _0x17ccc5(_0x30aab3,_0x2096db(0x26e)+_0x2096db(0xde)+'\x20updated'),{'ok':!![]};}async function _0x508e02(){const _0x2ab55b=_0x35ea73,_0x17c764=await _0x2d7664(),_0xd07083=asRecord(_0x17c764['plugins']),_0x535e2e=asRecord(_0xd07083[_0x2ab55b(0x281)]),_0x41bc74=asRecord(_0x17c764[_0x2ab55b(0x2b5)]),_0x352319=asRecord(_0x41bc74[_0x2ab55b(0x281)]),_0x25bcc9={},_0x56ed7b=_0x2f112d=>{const _0x321b14=_0x2ab55b,_0x176fa8=asRecord(_0x535e2e[_0x2f112d]);return{'entry':_0x176fa8,'config':asRecord(_0x176fa8[_0x321b14(0xe9)])};},_0xff18c2=(_0x4082c4,_0x5b5cc9,_0x149c16)=>{const _0x17fec1=_0x2ab55b,{entry:_0x496916,config:_0x328cad}=_0x56ed7b(_0x5b5cc9),_0x45afae=getTrimmedString(_0x328cad[_0x17fec1(0x24a)]);if(!_0x45afae)return;_0x25bcc9[_0x4082c4]={'provider':_0x4082c4,'sourceType':_0x17fec1(0xf5),'adapter':_0x5b5cc9,'enabled':_0x496916[_0x17fec1(0x2b9)]!==![]&&_0x328cad[_0x17fec1(0x2b9)]!==![],'account':_0x45afae,'credentialRef':_0x5b5cc9+(_0x17fec1(0x104)+_0x17fec1(0xd0)+'de'),'name':_0x149c16};};_0xff18c2(_0x2ab55b(0x1bf),QQ_MAIL_CONNECTOR_PLUGIN_ID,_0x2ab55b(0x28b)),_0xff18c2('netease_'+_0x2ab55b(0x243),NETEASE_MAIL_CONNECTOR_PLUGIN_ID,_0x2ab55b(0x175)),_0xff18c2(_0x2ab55b(0xe0)+'exmail',TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,'腾讯企业邮箱');const _0x10431b=_0x56ed7b(FEISHU_DOC_CONNECTOR_PLUGIN_ID),_0x420a21=getTrimmedString(_0x10431b['config'][_0x2ab55b(0x218)+_0x2ab55b(0xf0)]);_0x420a21&&(_0x25bcc9[_0x2ab55b(0x29c)]={'provider':_0x2ab55b(0x29c),'sourceType':_0x2ab55b(0x27d),'adapter':_0x2ab55b(0x16c)+_0x2ab55b(0x22b),'enabled':_0x10431b[_0x2ab55b(0x22e)][_0x2ab55b(0x2b9)]!==![]&&_0x10431b[_0x2ab55b(0xe9)][_0x2ab55b(0x2b9)]!==![],'authMode':_0x2ab55b(0xfa),'accountName':_0x420a21,'account':_0x420a21,'credentialRef':FEISHU_DOC_CONNECTOR_PLUGIN_ID+':user','capabilities':['latest',_0x2ab55b(0x1ec),_0x2ab55b(0x230),_0x2ab55b(0x17f),'update',_0x2ab55b(0x1da),_0x2ab55b(0x1d9)]});const _0x2e1d2e=asRecord(_0x352319[TENCENT_DOCS_SKILL_ID]),_0x4122fd=asRecord(_0x2e1d2e['env']),_0x417b76=getTrimmedString(_0x4122fd[TENCENT_DOCS_TOKEN_ENV]);_0x417b76&&(_0x25bcc9[_0x2ab55b(0xe0)+'docs']={'provider':_0x2ab55b(0xe0)+'docs','sourceType':_0x2ab55b(0x1be),'adapter':TENCENT_DOCS_SKILL_ID,'enabled':_0x2e1d2e[_0x2ab55b(0x2b9)]!==![],'account':_0x2ab55b(0xf1),'credentialRef':TENCENT_DOCS_SKILL_ID+':'+TENCENT_DOCS_TOKEN_ENV,'capabilities':[_0x2ab55b(0x230),'read','update',_0x2ab55b(0x1da),_0x2ab55b(0x14f),'export',_0x2ab55b(0x19d)]});const _0x4292ba=asRecord(_0x352319[KDOCS_SKILL_ID]);Object['keys'](_0x4292ba)[_0x2ab55b(0x116)]>0x0&&await _0x5c6e4b()&&(_0x25bcc9[_0x2ab55b(0x1df)]={'provider':'kdocs','sourceType':_0x2ab55b(0x1be),'adapter':KDOCS_SKILL_ID,'enabled':_0x4292ba[_0x2ab55b(0x2b9)]!==![],'account':_0x2ab55b(0x22d),'credentialRef':_0x2ab55b(0x231)+_0x2ab55b(0xe8)+'in','capabilities':[_0x2ab55b(0x230),_0x2ab55b(0x17f),_0x2ab55b(0x234),_0x2ab55b(0x1ec),_0x2ab55b(0x2c6),_0x2ab55b(0x14f),_0x2ab55b(0x1d9)]});const _0x1d9d0a=readOpenClawMcpServersFromConfig(_0x17c764),_0x2c38f4=findDingtalkDocMcpServer(_0x1d9d0a),_0x433fad=getTrimmedString(_0x2c38f4[_0x2ab55b(0x139)]);return _0x433fad&&(_0x25bcc9[_0x2ab55b(0x26e)+'_doc']={'provider':_0x2ab55b(0x26e)+_0x2ab55b(0x2c8),'sourceType':_0x2ab55b(0x276),'adapter':DINGTALK_DOC_MCP_SERVER_NAME,'enabled':_0x2c38f4[_0x2ab55b(0x2b9)]!==![],'url':_0x433fad,'transport':getTrimmedString(_0x2c38f4[_0x2ab55b(0x192)+'t'])||_0x2ab55b(0x226)+_0x2ab55b(0x144)}),_0x25bcc9;}async function _0x158514(){const _0x25410b=_0x35ea73,_0xa03cb0=await _0x3aad17['readConf'+_0x25410b(0x1c1)+_0x25410b(0x16d)]();return{..._0xa03cb0,'connectors':{...asRecord(_0xa03cb0[_0x25410b(0xf3)+'rs']),...await _0x508e02()}};}function _0x4538e9(_0x2b9b37){const _0xe670e6=_0x35ea73;if(!_0x2b9b37[_0xe670e6(0x29a)+_0xe670e6(0x15a)])return;clearTimeout(_0x2b9b37['verifyTi'+'mer']),_0x2b9b37[_0xe670e6(0x29a)+_0xe670e6(0x15a)]=null;}function _0x3f2539(_0x3d283c,_0x14f76c=KDOCS_CLI_AUTH_POLL_INTERVAL_MS){const _0x55d3c8=_0x35ea73;if(_0x3d283c[_0x55d3c8(0x20b)]!==_0x55d3c8(0x13d))return;_0x4538e9(_0x3d283c),_0x3d283c['verifyTi'+_0x55d3c8(0x15a)]=setTimeout(()=>void _0x5cd4cb(_0x3d283c),_0x14f76c);}async function _0x5cd4cb(_0x535f6d){const _0x3679b6=_0x35ea73;if(_0x535f6d[_0x3679b6(0x20b)]!==_0x3679b6(0x13d))return;_0x535f6d[_0x3679b6(0x157)]=_0x3679b6(0x238),_0x535f6d[_0x3679b6(0xd8)]=_0x3679b6(0xc9)+_0x3679b6(0x2c5);try{const _0x680f33=await _0x24f352([_0x3679b6(0x1a5),_0x3679b6(0x20b)]);_0x535f6d['output']=_0x680f33['output'];if(_0x680f33['code']===0x0&&isKdocsAuthStatusReady(_0x680f33[_0x3679b6(0x1a3)])){_0x4538e9(_0x535f6d),await _0x3d41b8(),_0x535f6d[_0x3679b6(0x157)]=_0x3679b6(0x1b5)+'d',_0x535f6d['status']=_0x3679b6(0x1b5)+'d',_0x535f6d['message']=_0x3679b6(0x10d);return;}if(Date['now']()-_0x535f6d['startedA'+'t']>KDOCS_CLI_STEP_TIMEOUT_MS){_0x535f6d['status']=_0x3679b6(0x294),_0x535f6d[_0x3679b6(0x253)+_0x3679b6(0x18a)]='金山文档授权状态'+_0x3679b6(0x1b3);return;}_0x3f2539(_0x535f6d);}catch(_0x17d3f6){if(Date[_0x3679b6(0x187)]()-_0x535f6d['startedA'+'t']>KDOCS_CLI_STEP_TIMEOUT_MS){_0x535f6d[_0x3679b6(0x20b)]=_0x3679b6(0x294),_0x535f6d[_0x3679b6(0x253)+'sage']=_0x17d3f6 instanceof Error?_0x17d3f6[_0x3679b6(0xd8)]:_0x3679b6(0x214)+_0x3679b6(0x28c);return;}_0x3f2539(_0x535f6d);}}async function _0x4fb3c5(){const _0x17c410=_0x35ea73,_0x496f14=randomUUID(),_0x32c849={'sessionId':_0x496f14,'status':'pending','phase':_0x17c410(0x29d),'url':null,'message':'正在启动金山文档'+'登录','errorMessage':null,'output':'','process':null,'verifyTimer':null,'startedAt':Date['now']()};return _0x7c6eef[_0x17c410(0x2ce)](_0x496f14,_0x32c849),void _0x403451({'FORCE_COLOR':'0','HOME':homedir()})['then'](async({env:_0xd1e26f,runtime:_0x78bf8d})=>{const _0x1f4c92=_0x17c410,_0x13fca6=await _0x4245cc(_0x78bf8d);_0x3868f8(_0x1f4c92(0xf3)+_0x1f4c92(0x22c),{'connector':_0x1f4c92(0x1df),'phase':_0x1f4c92(0x1dc),'message':_0x1f4c92(0x231)+'i\x20auth\x20l'+_0x1f4c92(0x17c)});const _0x5cdc7e=spawn(_0x13fca6['executab'+_0x1f4c92(0x1f6)],[_0x1f4c92(0x1a5),'login'],{'cwd':homedir(),'env':_0xd1e26f});_0x32c849[_0x1f4c92(0x1e2)]=_0x5cdc7e;const _0x27e9fe=setTimeout(()=>{const _0x51c086=_0x1f4c92;if(_0x32c849['status']!==_0x51c086(0x13d))return;_0x5cdc7e['kill'](),_0x32c849[_0x51c086(0x20b)]='error',_0x32c849[_0x51c086(0x253)+'sage']=_0x51c086(0x21c)+'超时',_0x32c849[_0x51c086(0x1e2)]=null;},KDOCS_CLI_STEP_TIMEOUT_MS),_0x1803bb=_0x2ccd8f=>{const _0xab816b=_0x1f4c92,_0x1ca8bb=_0x2ccd8f['toString'](_0xab816b(0xd4));_0x32c849[_0xab816b(0x1a3)]+=_0x1ca8bb,_0x3868f8(_0xab816b(0xf3)+_0xab816b(0x22c),{'connector':_0xab816b(0x1df),'phase':_0xab816b(0x1a3),'message':_0x1ca8bb});const _0x5e663b=extractFirstUrl(_0x32c849['output']);_0x5e663b&&!_0x32c849[_0xab816b(0x139)]&&(_0x32c849[_0xab816b(0x139)]=_0x5e663b,_0x32c849['phase']=_0xab816b(0x1a5),_0x32c849['message']=_0xab816b(0xd2)+_0xab816b(0x25b),_0x3f2539(_0x32c849,0x1f4),void _0x54639c[_0xab816b(0xfc)+_0xab816b(0x2ab)](_0x5e663b)[_0xab816b(0x25c)](()=>{}));};_0x5cdc7e['stdout']['on'](_0x1f4c92(0x202),_0x1803bb),_0x5cdc7e[_0x1f4c92(0x183)]['on'](_0x1f4c92(0x202),_0x1803bb),_0x5cdc7e['stdin'][_0x1f4c92(0x146)](),_0x5cdc7e['once'](_0x1f4c92(0x294),_0x386486=>{const _0x594575=_0x1f4c92;clearTimeout(_0x27e9fe),_0x32c849[_0x594575(0x20b)]=_0x594575(0x294),_0x32c849[_0x594575(0x253)+_0x594575(0x18a)]=_0x386486 instanceof Error?_0x386486[_0x594575(0xd8)]:'金山文档登录启动'+_0x594575(0x249)+_0x594575(0x222)+_0x594575(0x24c),_0x32c849['process']=null,_0x3868f8(_0x594575(0xf3)+_0x594575(0x22c),{'connector':_0x594575(0x1df),'phase':'error','message':_0x32c849[_0x594575(0x253)+'sage']});}),_0x5cdc7e[_0x1f4c92(0xf6)](_0x1f4c92(0x2b0),_0x263174=>{const _0x43be4a=_0x1f4c92;clearTimeout(_0x27e9fe),_0x32c849['process']=null;if(_0x32c849[_0x43be4a(0x20b)]!==_0x43be4a(0x13d))return;const _0x2e3a6e=extractFirstUrl(_0x32c849[_0x43be4a(0x1a3)]);if(_0x2e3a6e&&!_0x32c849[_0x43be4a(0x139)]){_0x32c849['url']=_0x2e3a6e,_0x32c849['phase']=_0x43be4a(0x1a5),_0x32c849[_0x43be4a(0xd8)]=_0x43be4a(0xd2)+_0x43be4a(0x25b),_0x3f2539(_0x32c849,0x1f4);return;}if(_0x263174!==0x0){_0x32c849['status']=_0x43be4a(0x294),_0x32c849[_0x43be4a(0x253)+'sage']=_0x32c849[_0x43be4a(0x1a3)]['trim']()||_0x43be4a(0x21c)+'失败,请确认\x20k'+_0x43be4a(0x222)+'\x20已安装',_0x3868f8(_0x43be4a(0xf3)+'r-log',{'connector':_0x43be4a(0x1df),'phase':_0x43be4a(0x294),'message':_0x32c849[_0x43be4a(0x253)+_0x43be4a(0x18a)]});return;}_0x32c849[_0x43be4a(0x157)]=_0x43be4a(0x238),_0x32c849[_0x43be4a(0xd8)]=_0x43be4a(0xc9)+'授权状态',_0x3f2539(_0x32c849,0x1f4);});})['catch'](_0x3e52bf=>{const _0x2b01e7=_0x17c410;_0x32c849[_0x2b01e7(0x20b)]=_0x2b01e7(0x294),_0x32c849[_0x2b01e7(0x253)+_0x2b01e7(0x18a)]=_0x3e52bf instanceof Error?_0x3e52bf[_0x2b01e7(0xd8)]:_0x2b01e7(0x21c)+'失败,请确认\x20k'+'docs-cli'+_0x2b01e7(0x24c),_0x3868f8('connecto'+'r-log',{'connector':_0x2b01e7(0x1df),'phase':_0x2b01e7(0x294),'message':_0x32c849['errorMes'+_0x2b01e7(0x18a)]});}),createKdocsCliStatus(_0x32c849);}function _0x3fa367(_0x34de23={}){const _0x3bb26c=_0x35ea73,_0x13cf52=safeString(_0x34de23[_0x3bb26c(0x174)+'d']);if(!_0x13cf52)throw new Error(_0x3bb26c(0x172)+_0x3bb26c(0x17b)+'n\x20id\x20is\x20'+_0x3bb26c(0x23b));const _0x4ee358=_0x7c6eef[_0x3bb26c(0x2bf)](_0x13cf52);if(!_0x4ee358)throw new Error(_0x3bb26c(0x172)+_0x3bb26c(0x17b)+_0x3bb26c(0xf7)+_0x3bb26c(0x169));return createKdocsCliStatus(_0x4ee358);}function _0x2b223d(_0x18f13b={}){const _0x251607=_0x35ea73,_0x2b9f4e=safeString(_0x18f13b[_0x251607(0x174)+'d']);if(!_0x2b9f4e)return{'ok':!![]};const _0x54edd9=_0x7c6eef[_0x251607(0x2bf)](_0x2b9f4e);if(!_0x54edd9)return{'ok':!![]};return _0x4538e9(_0x54edd9),_0x54edd9['process']?.[_0x251607(0x2c2)](),_0x7c6eef[_0x251607(0x1da)](_0x2b9f4e),{'ok':!![]};}function _0x23a31f(_0x152c2a){const _0x34d8d9=_0x35ea73;if(!_0x152c2a[_0x34d8d9(0x2c7)])return;clearTimeout(_0x152c2a[_0x34d8d9(0x2c7)]),_0x152c2a[_0x34d8d9(0x2c7)]=null;}function _0x3c2725(_0x39b4ef){const _0x11aaaf=_0x35ea73,_0x3d4aa8=_0x931e4c['get'](_0x39b4ef);if(!_0x3d4aa8||_0x3d4aa8[_0x11aaaf(0x20b)]!==_0x11aaaf(0x13d))return;_0x23a31f(_0x3d4aa8),_0x3d4aa8['timer']=setTimeout(()=>void _0x24fe64(_0x39b4ef),_0x3d4aa8['pollInte'+'rvalMs']);}async function _0x24fe64(_0x237520){const _0x1de433=_0x35ea73,_0x3e3d4a=_0x931e4c['get'](_0x237520);if(!_0x3e3d4a||_0x3e3d4a['status']!==_0x1de433(0x13d))return;if(Date[_0x1de433(0x187)]()>=_0x3e3d4a['expiresA'+'t']){_0x3e3d4a[_0x1de433(0x20b)]='expired',_0x3e3d4a[_0x1de433(0x253)+'sage']=_0x1de433(0x269)+'重新生成',_0x23a31f(_0x3e3d4a);return;}try{const _0x5a634b=await pollFeishuRegistration(_0x3e3d4a[_0x1de433(0x114)],_0x3e3d4a[_0x1de433(0x204)+'de']),_0x1d807c=getTrimmedString(_0x5a634b[_0x1de433(0x2b6)+'d']),_0x526996=getTrimmedString(_0x5a634b[_0x1de433(0x259)+_0x1de433(0x208)]),_0x2fa121=getTrimmedString(_0x5a634b[_0x1de433(0x294)]),_0x95dc37=extractFeishuRegistrationAuthorizationUri(_0x5a634b)||_0x3e3d4a[_0x1de433(0x14b)+_0x1de433(0x2c3)];if(_0x95dc37!==_0x3e3d4a[_0x1de433(0x14b)+'ationUri'])_0x3e3d4a[_0x1de433(0x14b)+_0x1de433(0x2c3)]=_0x95dc37;if(_0x1d807c&&_0x526996){const _0x1bc59f=asRecord(_0x5a634b['user_inf'+'o']);await _0x232720({'appId':_0x1d807c,'appSecret':_0x526996,'userInfo':{'openId':getTrimmedString(_0x1bc59f[_0x1de433(0x151)])||null}}),_0x3e3d4a['status']=_0x1de433(0x1b5)+'d',_0x3e3d4a[_0x1de433(0x253)+_0x1de433(0x18a)]=null,_0x23a31f(_0x3e3d4a);return;}if(!_0x2fa121||_0x2fa121===_0x1de433(0x14b)+_0x1de433(0x1fe)+_0x1de433(0x293)){_0x3c2725(_0x237520);return;}if(_0x2fa121==='slow_dow'+'n'){_0x3e3d4a[_0x1de433(0x25d)+'rvalMs']+=0x1388,_0x3c2725(_0x237520);return;}if(_0x2fa121===_0x1de433(0x1bd)+'token'){_0x3e3d4a['status']=_0x1de433(0x298),_0x3e3d4a[_0x1de433(0x253)+_0x1de433(0x18a)]=_0x1de433(0x269)+_0x1de433(0x152),_0x23a31f(_0x3e3d4a);return;}_0x3e3d4a['status']='error',_0x3e3d4a[_0x1de433(0x253)+'sage']=getTrimmedString(_0x5a634b[_0x1de433(0x20e)+_0x1de433(0x2b7)+'n'])||(_0x2fa121===_0x1de433(0x277)+_0x1de433(0x178)?_0x1de433(0x164)+'器人绑定':_0x1de433(0x1b7)+_0x2fa121),_0x23a31f(_0x3e3d4a);}catch(_0x120599){_0x3e3d4a[_0x1de433(0x20b)]=_0x1de433(0x294),_0x3e3d4a[_0x1de433(0x253)+_0x1de433(0x18a)]=_0x120599 instanceof Error?_0x120599['message']:_0x1de433(0x280),_0x23a31f(_0x3e3d4a);}}async function _0x118d1b(_0x37942a={}){const _0xd57d8a=_0x35ea73,_0x363cd0=_0x37942a[_0xd57d8a(0x29b)]===_0xd57d8a(0x2a2)+_0xd57d8a(0x1ef)?_0xd57d8a(0x2a2)+_0xd57d8a(0x1ef):_0xd57d8a(0x2a5),_0x8639bb=createFeishuRegistrationClient(),_0x57cf04=await initFeishuRegistration(_0x8639bb),_0x3172c3=Array['isArray'](_0x57cf04[_0xd57d8a(0x283)+_0xd57d8a(0x2c9)+'ethods'])?_0x57cf04[_0xd57d8a(0x283)+_0xd57d8a(0x2c9)+_0xd57d8a(0x127)]['map'](getTrimmedString)[_0xd57d8a(0x110)](Boolean):[];if(!_0x3172c3[_0xd57d8a(0x1ac)](_0xd57d8a(0x259)+_0xd57d8a(0x208)))throw new Error(_0xd57d8a(0x12f)+_0xd57d8a(0x171)+'ent\x20does'+_0xd57d8a(0x271)+_0xd57d8a(0x137)+_0xd57d8a(0x165)+_0xd57d8a(0x1aa));const _0x3a1c43=await beginFeishuRegistration(_0x8639bb),_0x1a357a=getTrimmedString(_0x3a1c43[_0xd57d8a(0x180)+_0xd57d8a(0x1e3)+_0xd57d8a(0xc3)+'e']),_0x4de81e=extractFeishuRegistrationAuthorizationUri(_0x3a1c43),_0x5a1498=getTrimmedString(_0x3a1c43[_0xd57d8a(0x184)+_0xd57d8a(0x201)]),_0x2b8f78=Number(_0x3a1c43[_0xd57d8a(0x112)+'n'])||0x258,_0x350fbd=Number(_0x3a1c43[_0xd57d8a(0x1d3)])||0x5;if(!_0x1a357a||!_0x5a1498)throw new Error('Missing\x20'+_0xd57d8a(0x180)+_0xd57d8a(0x1e3)+_0xd57d8a(0xc3)+_0xd57d8a(0x16a)+'ice_code'+_0xd57d8a(0x219)+_0xd57d8a(0x1c6)+_0xd57d8a(0x1d2));const _0x783913=randomUUID(),_0x4c1ece={'sessionId':_0x783913,'purpose':_0x363cd0,'client':_0x8639bb,'deviceCode':_0x5a1498,'verificationUriComplete':_0x1a357a,'authorizationUri':_0x4de81e,'expiresAt':Date['now']()+_0x2b8f78*0x3e8,'pollIntervalMs':Math[_0xd57d8a(0x10c)](_0x350fbd*0x3e8,DEFAULT_FEISHU_REGISTRATION_INTERVAL_MS),'status':'pending','errorMessage':null,'timer':null};return _0x931e4c['set'](_0x783913,_0x4c1ece),_0x3c2725(_0x783913),serializeFeishuRegistrationSession(_0x4c1ece);}function _0x5c9efe(_0x47f1f1={}){const _0x36849e=_0x35ea73,_0x3ae93d=safeString(_0x47f1f1['sessionI'+'d']);if(!_0x3ae93d)throw new Error('Feishu\x20r'+_0x36849e(0x26f)+_0x36849e(0xcb)+_0x36849e(0x18b)+'s\x20requir'+'ed');const _0x621eea=_0x931e4c[_0x36849e(0x2bf)](_0x3ae93d);if(!_0x621eea)throw new Error('Feishu\x20r'+_0x36849e(0x26f)+_0x36849e(0xcb)+_0x36849e(0x21d)+_0x36849e(0x16b));return serializeFeishuRegistrationSession(_0x621eea);}function _0x586312(_0x27461d={}){const _0x213544=_0x35ea73,_0x56cbf8=safeString(_0x27461d[_0x213544(0x174)+'d']);if(!_0x56cbf8)return{'ok':!![]};const _0x3d82cd=_0x931e4c[_0x213544(0x2bf)](_0x56cbf8);if(!_0x3d82cd)return{'ok':!![]};return _0x23a31f(_0x3d82cd),_0x931e4c[_0x213544(0x1da)](_0x56cbf8),{'ok':!![]};}async function _0x11824c(_0x5118f1,_0x130496){const _0x26fa3e=_0x35ea73,_0x3e2213=_0x326b6e(),{env:_0x160e8e,runtime:_0x512f98}=await _0x403451({'FORCE_COLOR':'0','HOME':homedir(),'LARK_CLI_NO_PROXY':'1','OPENCLAW_HOME':_0x3e2213,'OPENCLAW_CONFIG_PATH':_0x5118f1[_0x26fa3e(0x250)+_0x26fa3e(0x1f5)+'h']});await mkdir(_0x3e2213,{'recursive':!![]});const _0x47a7a5=await _0x3c9e36(_0x512f98);for(const _0x452168 of[_0x26fa3e(0xcc)+'XY',_0x26fa3e(0x200)+'OXY','ALL_PROX'+'Y','http_pro'+'xy',_0x26fa3e(0x246)+_0x26fa3e(0x28f),_0x26fa3e(0x11a)+'y']){delete _0x160e8e[_0x452168];}return new Promise((_0xc6ba6c,_0x98845b)=>{const _0x57f814=_0x26fa3e;_0x3868f8(_0x57f814(0xf3)+_0x57f814(0x22c),{'connector':_0x57f814(0x203)+'oc','phase':_0x57f814(0x1dc),'message':_0x57f814(0x27d)+'\x20'+_0x130496['join']('\x20')});const _0x413cac=spawn(_0x47a7a5[_0x57f814(0x23d)+_0x57f814(0x130)],[_0x47a7a5['scriptPa'+'th'],..._0x130496],{'cwd':_0x3e2213,'env':_0x160e8e});let _0x45542f=![];_0x413cac[_0x57f814(0xf6)](_0x57f814(0x1dc),()=>{_0x45542f=!![],_0xc6ba6c(_0x413cac);}),_0x413cac[_0x57f814(0xf6)](_0x57f814(0x294),_0x3f0418=>{if(_0x45542f)return;_0x98845b(_0x3f0418);});});}function _0x3ef61f(_0x2bf284,_0x17d2fb,_0x49831e){const _0xcfe691=_0x35ea73;_0x2bf284[_0xcfe691(0x157)]=_0x49831e['phase'],_0x2bf284['message']=_0x49831e[_0xcfe691(0xd8)];if(_0x49831e[_0xcfe691(0x157)]!==_0xcfe691(0x238))_0x2bf284[_0xcfe691(0x139)]=null;_0x2bf284[_0xcfe691(0x1a3)]='',void _0x11824c(_0x2bf284,_0x17d2fb)[_0xcfe691(0x21b)](_0x1ba732=>{const _0x18d66e=_0xcfe691;_0x2bf284[_0x18d66e(0x1e2)]=_0x1ba732;const _0x4ec918=setTimeout(()=>{const _0x14d399=_0x18d66e;if(_0x2bf284[_0x14d399(0x20b)]!==_0x14d399(0x13d))return;_0x1ba732[_0x14d399(0x2c2)](),_0x2bf284[_0x14d399(0x20b)]=_0x14d399(0x294),_0x2bf284[_0x14d399(0x253)+'sage']=_0x49831e[_0x14d399(0xd8)]+'超时',_0x2bf284[_0x14d399(0x1e2)]=null;},FEISHU_DOC_CLI_STEP_TIMEOUT_MS),_0x1bc754=_0x5c527d=>{const _0x1a8746=_0x18d66e,_0x579059=_0x5c527d[_0x1a8746(0x121)](_0x1a8746(0xd4));_0x2bf284[_0x1a8746(0x1a3)]+=_0x579059,_0x3868f8('connecto'+_0x1a8746(0x22c),{'connector':_0x1a8746(0x203)+'oc','phase':_0x49831e[_0x1a8746(0x157)],'message':_0x579059});};_0x1ba732[_0x18d66e(0x286)]['on'](_0x18d66e(0x202),_0x1bc754),_0x1ba732['stderr']['on'](_0x18d66e(0x202),_0x1bc754);if(typeof _0x49831e[_0x18d66e(0x135)]===_0x18d66e(0x21f))_0x1ba732[_0x18d66e(0x135)][_0x18d66e(0x146)](_0x49831e[_0x18d66e(0x135)]);else _0x1ba732[_0x18d66e(0x135)][_0x18d66e(0x146)]();_0x1ba732['on'](_0x18d66e(0x294),_0x4ff51d=>{const _0x5c6d05=_0x18d66e;clearTimeout(_0x4ec918),_0x2bf284[_0x5c6d05(0x20b)]=_0x5c6d05(0x294),_0x2bf284[_0x5c6d05(0x253)+_0x5c6d05(0x18a)]=_0x4ff51d instanceof Error?_0x4ff51d['message']:'飞书\x20CLI\x20执'+_0x5c6d05(0x2a6),_0x2bf284[_0x5c6d05(0x1e2)]=null,_0x3868f8('connecto'+'r-log',{'connector':_0x5c6d05(0x203)+'oc','phase':_0x5c6d05(0x294),'message':_0x2bf284['errorMes'+_0x5c6d05(0x18a)]});}),_0x1ba732['on'](_0x18d66e(0x2b0),_0x30d92e=>{const _0x160d4d=_0x18d66e;clearTimeout(_0x4ec918),_0x2bf284[_0x160d4d(0x1e2)]=null;if(_0x2bf284[_0x160d4d(0x20b)]!==_0x160d4d(0x13d))return;if(_0x30d92e!==0x0){if(_0x49831e[_0x160d4d(0x113)+'e']){void Promise['resolve'](_0x49831e[_0x160d4d(0x113)+'e'](_0x30d92e,_0x2bf284['output']))[_0x160d4d(0x25c)](_0x1d33f8=>{const _0x45d783=_0x160d4d;_0x2bf284[_0x45d783(0x20b)]=_0x45d783(0x294),_0x2bf284[_0x45d783(0x253)+'sage']=_0x1d33f8 instanceof Error?_0x1d33f8['message']:'飞书\x20CLI\x20连'+_0x45d783(0x15d);});return;}_0x2bf284[_0x160d4d(0x20b)]='error',_0x2bf284[_0x160d4d(0x253)+_0x160d4d(0x18a)]=getFeishuDocCliFailureMessage(_0x49831e[_0x160d4d(0x157)],extractFeishuDocCliError(_0x2bf284[_0x160d4d(0x1a3)],_0x160d4d(0x27d)+'\x20'+_0x17d2fb[_0x160d4d(0x2b8)]('\x20')+('\x20exited\x20'+_0x160d4d(0x27e)+'e\x20')+_0x30d92e),'lark-cli'+'\x20'+_0x17d2fb['join']('\x20')+(_0x160d4d(0x251)+_0x160d4d(0x27e)+'e\x20')+_0x30d92e),_0x3868f8(_0x160d4d(0xf3)+_0x160d4d(0x22c),{'connector':'feishu_d'+'oc','phase':_0x160d4d(0x294),'message':_0x2bf284[_0x160d4d(0x253)+'sage']});return;}void Promise['resolve'](_0x49831e['onSucces'+'s']())[_0x160d4d(0x25c)](_0x569a57=>{const _0x128b3e=_0x160d4d;_0x2bf284[_0x128b3e(0x20b)]=_0x128b3e(0x294),_0x2bf284[_0x128b3e(0x253)+_0x128b3e(0x18a)]=_0x569a57 instanceof Error?_0x569a57[_0x128b3e(0xd8)]:_0x128b3e(0x24d)+_0x128b3e(0x15d);});});})[_0xcfe691(0x25c)](_0x5783aa=>{const _0x29ad62=_0xcfe691;_0x2bf284['status']='error',_0x2bf284[_0x29ad62(0x253)+'sage']=_0x5783aa instanceof Error?_0x5783aa['message']:_0x29ad62(0x1a8)+'行失败',_0x2bf284[_0x29ad62(0x1e2)]=null,_0x3868f8(_0x29ad62(0xf3)+'r-log',{'connector':_0x29ad62(0x203)+'oc','phase':_0x29ad62(0x294),'message':_0x2bf284[_0x29ad62(0x253)+_0x29ad62(0x18a)]});});}function _0x210adf(_0x4dc044){const _0x190948=_0x35ea73;if(!_0x4dc044[_0x190948(0xeb)])return;clearTimeout(_0x4dc044[_0x190948(0xeb)]),_0x4dc044[_0x190948(0xeb)]=null;}function _0x38127b(_0x385d81){const _0xdcd6ef=_0x35ea73;if(!_0x385d81['authStat'+_0xdcd6ef(0x1ad)])return;clearTimeout(_0x385d81[_0xdcd6ef(0x132)+_0xdcd6ef(0x1ad)]),_0x385d81[_0xdcd6ef(0x132)+_0xdcd6ef(0x1ad)]=null;}function _0x24ee37(_0x5dbd23,_0x3fa5c8=0x7d0){const _0x3f8d0f=_0x35ea73;if(_0x5dbd23[_0x3f8d0f(0x20b)]!==_0x3f8d0f(0x13d))return;_0x38127b(_0x5dbd23),_0x5dbd23[_0x3f8d0f(0x132)+_0x3f8d0f(0x1ad)]=setTimeout(()=>{const _0xaa6353=_0x3f8d0f;_0x3ef61f(_0x5dbd23,[_0xaa6353(0x1a5),_0xaa6353(0x20b)],{'phase':_0xaa6353(0x238),'message':_0xaa6353(0x188)+'状态','onFailure':(_0x36b230,_0x1ba869)=>{const _0x5abc22=_0xaa6353;if(Date['now']()-_0x5dbd23[_0x5abc22(0x132)+'usStarte'+'dAt']>FEISHU_DOC_CLI_STEP_TIMEOUT_MS){_0x5dbd23[_0x5abc22(0x20b)]=_0x5abc22(0x294),_0x5dbd23[_0x5abc22(0x253)+_0x5abc22(0x18a)]=getFeishuDocCliFailureMessage(_0x5abc22(0x238),extractFeishuDocCliError(_0x1ba869,_0x5abc22(0xed)+_0x5abc22(0x1c3)),'飞书\x20CLI\x20授'+'权状态验证超时');return;}_0x24ee37(_0x5dbd23);},'onSuccess':()=>{const _0x4ac239=_0xaa6353;try{ensureFeishuDocCliUserStatus(_0x5dbd23['output']);}catch(_0x1a9e82){if(Date['now']()-_0x5dbd23[_0x4ac239(0x132)+_0x4ac239(0x1f0)+_0x4ac239(0x26c)]>FEISHU_DOC_CLI_STEP_TIMEOUT_MS){_0x5dbd23[_0x4ac239(0x20b)]='error',_0x5dbd23['errorMes'+_0x4ac239(0x18a)]=_0x1a9e82 instanceof Error?_0x1a9e82['message']:_0x4ac239(0xed)+_0x4ac239(0x103);return;}_0x24ee37(_0x5dbd23);return;}return _0x38127b(_0x5dbd23),_0x3c5607(_0x5dbd23);}});},_0x3fa5c8);}function _0x23247d(_0x46a7d2){const _0x43e98b=_0x35ea73;if(!_0x46a7d2[_0x43e98b(0x211)]||!_0x46a7d2[_0x43e98b(0x28d)+_0x43e98b(0x215)]){_0x46a7d2['status']='error',_0x46a7d2[_0x43e98b(0x253)+_0x43e98b(0x18a)]='飞书文档\x20CLI'+'\x20专用应用凭据缺'+_0x43e98b(0x221);return;}const _0x424315=_0x46a7d2['cliAppId'],_0x56f56e=_0x46a7d2[_0x43e98b(0x28d)+'cret'];_0x3ef61f(_0x46a7d2,[_0x43e98b(0xf4)+'n'],{'phase':_0x43e98b(0x1e4),'message':_0x43e98b(0x284)+'LI','onSuccess':()=>{const _0x4dfb4b=_0x43e98b;_0x3ef61f(_0x46a7d2,[_0x4dfb4b(0xe9),_0x4dfb4b(0xdb),_0x4dfb4b(0x142)+_0x4dfb4b(0xdb),'--app-id',_0x424315,_0x4dfb4b(0x1ab)+'cret-std'+'in',_0x4dfb4b(0x147),_0x4dfb4b(0x29c)],{'phase':_0x4dfb4b(0x1e4),'message':'正在初始化飞书\x20'+'CLI\x20用户身份'+'应用','stdin':_0x56f56e,'onSuccess':()=>{const _0x2aa65e=_0x4dfb4b;_0x3ef61f(_0x46a7d2,['auth',_0x2aa65e(0x1fc),_0x2aa65e(0x128),_0x2aa65e(0x225)+_0x2aa65e(0x148)+_0x2aa65e(0x159)+_0x2aa65e(0xfe)+_0x2aa65e(0x2ae)+_0x2aa65e(0x1ae),_0x2aa65e(0x2ac),_0x2aa65e(0x19c)+_0x2aa65e(0xe1),_0x2aa65e(0x288)+'t'],{'phase':_0x2aa65e(0x1a5),'message':_0x2aa65e(0x20d)+'授权页','onSuccess':()=>{const _0x4d3c4c=_0x2aa65e,_0x358c59=parseFeishuDocCliJson(_0x46a7d2[_0x4d3c4c(0x1a3)]),_0x7f7fd1=getTrimmedString(_0x358c59['verifica'+_0x4d3c4c(0x1e3)+_0x4d3c4c(0xc3)+'e'])||getTrimmedString(_0x358c59[_0x4d3c4c(0x180)+'tion_url'])||getTrimmedString(_0x358c59['verifica'+'tion_uri']),_0x2f3ef8=getTrimmedString(_0x358c59[_0x4d3c4c(0x184)+_0x4d3c4c(0x201)]);if(!_0x7f7fd1||!_0x2f3ef8){_0x46a7d2[_0x4d3c4c(0x20b)]=_0x4d3c4c(0x294),_0x46a7d2[_0x4d3c4c(0x253)+_0x4d3c4c(0x18a)]=_0x4d3c4c(0xd9)+_0x4d3c4c(0x1d6)+_0x4d3c4c(0x1a9)+_0x4d3c4c(0x120)+summarizeCliOutput(_0x46a7d2['output']);return;}_0x46a7d2[_0x4d3c4c(0x139)]=_0x7f7fd1,_0x46a7d2[_0x4d3c4c(0x204)+'de']=_0x2f3ef8,void _0x54639c['openExte'+_0x4d3c4c(0x2ab)](_0x7f7fd1)[_0x4d3c4c(0x25c)](()=>{}),_0x3ef61f(_0x46a7d2,[_0x4d3c4c(0x1a5),_0x4d3c4c(0x1fc),_0x4d3c4c(0x1cf)+'-code',_0x2f3ef8],{'phase':'verify','message':'等待飞书用户授权'+'完成','onSuccess':()=>{const _0x492926=_0x4d3c4c;_0x46a7d2['authStat'+_0x492926(0x1f0)+_0x492926(0x26c)]=Date['now'](),_0x24ee37(_0x46a7d2,0x1f4);}});}});}});}});}function _0xd4adee(_0x5bd528){const _0x276c01=_0x35ea73;if(_0x5bd528[_0x276c01(0x20b)]!==_0x276c01(0x13d))return;_0x210adf(_0x5bd528),_0x5bd528[_0x276c01(0xeb)]=setTimeout(()=>void _0x55e28f(_0x5bd528),_0x5bd528['appPollI'+'ntervalM'+'s']);}async function _0x55e28f(_0x2c09c2){const _0x476480=_0x35ea73;if(_0x2c09c2[_0x476480(0x20b)]!==_0x476480(0x13d)||_0x2c09c2[_0x476480(0x157)]!==_0x476480(0x230)||!_0x2c09c2[_0x476480(0x13c)+_0x476480(0x1b2)]||!_0x2c09c2['appDevic'+_0x476480(0x1b4)])return;if(Date[_0x476480(0x187)]()>=_0x2c09c2[_0x476480(0x212)+'esAt']){_0x2c09c2[_0x476480(0x20b)]=_0x476480(0x294),_0x2c09c2[_0x476480(0x253)+'sage']=_0x476480(0x20c)+_0x476480(0x260),_0x210adf(_0x2c09c2);return;}try{const _0x4c40a2=await pollFeishuRegistration(_0x2c09c2[_0x476480(0x13c)+_0x476480(0x1b2)],_0x2c09c2[_0x476480(0x217)+_0x476480(0x1b4)]),_0x26d6df=getTrimmedString(_0x4c40a2[_0x476480(0x2b6)+'d']),_0x2b8ce3=getTrimmedString(_0x4c40a2['client_s'+'ecret']),_0x3c4c3a=getTrimmedString(_0x4c40a2[_0x476480(0x294)]);if(_0x26d6df&&_0x2b8ce3){const _0x56c04a=asRecord(_0x4c40a2[_0x476480(0x11d)+'o']);await _0x4e5b4e({'appId':_0x26d6df,'appSecret':_0x2b8ce3,'userInfo':{'openId':getTrimmedString(_0x56c04a[_0x476480(0x151)])||null},'configPath':_0x2c09c2['cliHostC'+'onfigPat'+'h']}),_0x2c09c2[_0x476480(0x211)]=_0x26d6df,_0x2c09c2[_0x476480(0x28d)+_0x476480(0x215)]=_0x2b8ce3,_0x210adf(_0x2c09c2),_0x2c09c2['message']=_0x476480(0x270)+_0x476480(0xdc),_0x23247d(_0x2c09c2);return;}if(!_0x3c4c3a||_0x3c4c3a==='authoriz'+_0x476480(0x1fe)+_0x476480(0x293)){_0xd4adee(_0x2c09c2);return;}if(_0x3c4c3a===_0x476480(0x195)+'n'){_0x2c09c2[_0x476480(0xd1)+_0x476480(0x14d)+'s']+=0x1388,_0xd4adee(_0x2c09c2);return;}_0x2c09c2[_0x476480(0x20b)]=_0x476480(0x294),_0x2c09c2['errorMes'+_0x476480(0x18a)]=getTrimmedString(_0x4c40a2['error_de'+_0x476480(0x2b7)+'n'])||_0x476480(0x2ad)+':'+_0x3c4c3a,_0x210adf(_0x2c09c2);}catch(_0x20bed4){_0x2c09c2[_0x476480(0x20b)]='error',_0x2c09c2[_0x476480(0x253)+'sage']=_0x20bed4 instanceof Error?_0x20bed4['message']:_0x476480(0x2ad),_0x210adf(_0x2c09c2);}}async function _0x3c5607(_0x38e991){const _0xbe49ed=_0x35ea73;await _0x5994a2({'accountName':_0xbe49ed(0xfd)}),_0x38e991[_0xbe49ed(0x20b)]=_0xbe49ed(0x1b5)+'d',_0x38e991[_0xbe49ed(0x157)]=_0xbe49ed(0x1b5)+'d',_0x38e991[_0xbe49ed(0xd8)]=_0xbe49ed(0x12a)+'完成',_0x38e991[_0xbe49ed(0x253)+_0xbe49ed(0x18a)]=null;}async function _0x5598f8(){const _0x580292=_0x35ea73,_0x1b0922=createFeishuRegistrationClient(),_0x1ecb5=await initFeishuRegistration(_0x1b0922),_0x2feffa=Array[_0x580292(0x11e)](_0x1ecb5[_0x580292(0x283)+_0x580292(0x2c9)+'ethods'])?_0x1ecb5[_0x580292(0x283)+_0x580292(0x2c9)+'ethods'][_0x580292(0x21a)](getTrimmedString)['filter'](Boolean):[];if(!_0x2feffa[_0x580292(0x1ac)](_0x580292(0x259)+_0x580292(0x208)))throw new Error(_0x580292(0x1d5)+_0x580292(0x143)+_0x580292(0x259)+_0x580292(0x292));const _0x4fce5e=await beginFeishuRegistration(_0x1b0922),_0x20edce=getTrimmedString(_0x4fce5e[_0x580292(0x180)+_0x580292(0x1e3)+_0x580292(0xc3)+'e']),_0x33cff0=getTrimmedString(_0x4fce5e['device_c'+'ode']),_0x5ea9f3=Number(_0x4fce5e[_0x580292(0x112)+'n'])||0x258,_0x3e87ef=Number(_0x4fce5e['interval'])||0x5;if(!_0x20edce||!_0x33cff0)throw new Error('飞书开放平台未返'+_0x580292(0x12d)+_0x580292(0xda)+_0x580292(0x18c));const _0x3ce5d6=randomUUID(),_0x532d6f={'sessionId':_0x3ce5d6,'status':'pending','phase':_0x580292(0x230),'url':_0x20edce,'appDeviceCode':_0x33cff0,'appPollClient':_0x1b0922,'appPollIntervalMs':Math[_0x580292(0x10c)](_0x3e87ef*0x3e8,DEFAULT_FEISHU_REGISTRATION_INTERVAL_MS),'appExpiresAt':Date[_0x580292(0x187)]()+_0x5ea9f3*0x3e8,'appTimer':null,'authStatusTimer':null,'authStatusStartedAt':0x0,'deviceCode':null,'message':_0x580292(0x138)+_0x580292(0x2c1),'errorMessage':null,'process':null,'output':'','cliHostConfigPath':_0x12b48f(),'cliAppId':null,'cliAppSecret':null};return _0x3c1879['set'](_0x3ce5d6,_0x532d6f),_0xd4adee(_0x532d6f),createFeishuDocCliStatus(_0x532d6f);}function _0x3eba42(_0xf00660={}){const _0x104d5f=_0x35ea73,_0x47d763=safeString(_0xf00660['sessionI'+'d']);if(!_0x47d763)throw new Error(_0x104d5f(0x1ba)+_0x104d5f(0x1a2)+_0x104d5f(0x2d2)+_0x104d5f(0x156)+'uired');const _0x434d12=_0x3c1879['get'](_0x47d763);if(!_0x434d12)throw new Error(_0x104d5f(0x1ba)+_0x104d5f(0x1a2)+_0x104d5f(0x10b)+_0x104d5f(0x2b3));return createFeishuDocCliStatus(_0x434d12);}function _0xfef56c(_0x3053c4={}){const _0x129df7=_0x35ea73,_0x49e247=safeString(_0x3053c4[_0x129df7(0x174)+'d']);if(!_0x49e247)return{'ok':!![]};const _0x1ff9c5=_0x3c1879[_0x129df7(0x2bf)](_0x49e247);if(!_0x1ff9c5)return{'ok':!![]};return _0x210adf(_0x1ff9c5),_0x38127b(_0x1ff9c5),_0x1ff9c5[_0x129df7(0x1e2)]?.['kill'](),_0x3c1879['delete'](_0x49e247),{'ok':!![]};}function _0x717cf6(_0x43151b={}){const _0x1eb5cb=_0x35ea73,_0xfac975=safeString(_0x43151b[_0x1eb5cb(0x174)+'d']);if(!_0xfac975)throw new Error('Feishu\x20d'+_0x1eb5cb(0x1a2)+_0x1eb5cb(0x2d2)+_0x1eb5cb(0x156)+_0x1eb5cb(0x1d4));const _0x53e9fb=_0x3c1879[_0x1eb5cb(0x2bf)](_0xfac975);if(!_0x53e9fb)throw new Error(_0x1eb5cb(0x1ba)+_0x1eb5cb(0x1a2)+_0x1eb5cb(0x10b)+'ot\x20found');if(_0x53e9fb['status']===_0x1eb5cb(0x294))throw new Error(_0x53e9fb[_0x1eb5cb(0x253)+_0x1eb5cb(0x18a)]||_0x1eb5cb(0x24d)+_0x1eb5cb(0x15d));return{'ok':!![]};}async function _0x36b046(_0x170877){const _0xe63a78=_0x35ea73,_0x7f3a95=asRecord(_0x170877[_0xe63a78(0x1cd)]),_0x3f2914=asRecord(_0x7f3a95[_0xe63a78(0x281)]),_0x37b0f9=asStringArray(_0x7f3a95[_0xe63a78(0xff)]),_0xd6d044=asRecord(_0x3f2914[WECHAT_PLUGIN_ID]),_0x6646de=_0xd6d044[_0xe63a78(0x2b9)]===!![]||_0x37b0f9[_0xe63a78(0x1ac)](WECHAT_PLUGIN_ID),_0xd8a2da=join(_0x3aad17[_0xe63a78(0x21e)+_0xe63a78(0x17a)](),WECHAT_PLUGIN_ID),_0x122895=join(_0xd8a2da,_0xe63a78(0x28e)+_0xe63a78(0x25f));let _0x3ca592=![];try{const _0x32b4c4=(await readFile(_0x122895,_0xe63a78(0xd4)))[_0xe63a78(0x13f)]();if(_0x32b4c4){const _0x37d3c8=JSON[_0xe63a78(0x153)](_0x32b4c4);_0x3ca592=Array[_0xe63a78(0x11e)](_0x37d3c8)?_0x37d3c8[_0xe63a78(0x116)]>0x0:Object[_0xe63a78(0x1fa)](asRecord(_0x37d3c8))['length']>0x0;}}catch{}if(!_0x3ca592)try{_0x3ca592=(await readdir(join(_0xd8a2da,_0xe63a78(0x28e))))[_0xe63a78(0x116)]>0x0;}catch{}return{'exists':_0x6646de||_0x3ca592,'enabled':_0x6646de,'connected':_0x6646de&&_0x3ca592};}async function _0x130961(){const _0x1d8f76=_0x35ea73,_0x3ac3e9=await _0x2d7664(),_0x51de23=asRecord(_0x3ac3e9['channels']),_0x279524=[],_0x4a2f3d=await _0x36b046(_0x3ac3e9);_0x4a2f3d[_0x1d8f76(0x1cc)]&&_0x279524[_0x1d8f76(0x24b)]({'id':WECHAT_PLUGIN_ID,'type':_0x1d8f76(0x296),'name':'微信','enabled':_0x4a2f3d[_0x1d8f76(0x2b9)],'connected':_0x4a2f3d[_0x1d8f76(0x185)+'d']});const _0x2f9fc9=asRecord(_0x51de23[_0x1d8f76(0x134)]),_0xd20dd7=getTrimmedString(_0x2f9fc9[_0x1d8f76(0x20f)]),_0x14544e=getTrimmedString(_0x2f9fc9[_0x1d8f76(0x140)+_0x1d8f76(0x215)]);_0xd20dd7&&_0x14544e&&_0x279524[_0x1d8f76(0x24b)]({'id':_0x1d8f76(0x134),'type':'qqbot','name':_0x1d8f76(0xd6),'enabled':_0x2f9fc9[_0x1d8f76(0x2b9)]!==![],'appId':_0xd20dd7,'clientSecret':_0x14544e});const _0x361a47=asRecord(_0x51de23['wecom']),_0x1cae71=getTrimmedString(_0x361a47[_0x1d8f76(0x1f2)]),_0xb064a1=getTrimmedString(_0x361a47[_0x1d8f76(0x232)]);_0x1cae71&&_0xb064a1&&_0x279524[_0x1d8f76(0x24b)]({'id':_0x1d8f76(0x155),'type':_0x1d8f76(0x155),'name':_0x1d8f76(0x2a9),'enabled':_0x361a47['enabled']!==![],'botId':_0x1cae71,'secret':_0xb064a1});const _0x2023d8=asRecord(_0x51de23[_0x1d8f76(0x29c)]),_0x2a790d=getTrimmedString(_0x2023d8[_0x1d8f76(0x20f)]),_0x19612a=getTrimmedString(_0x2023d8[_0x1d8f76(0x1fb)+'t']);return _0x2a790d&&_0x19612a&&getTrimmedString(_0x2023d8['managedB'+'y'])!==FEISHU_DOC_CONNECTOR_PLUGIN_ID&&_0x279524['push']({'id':_0x1d8f76(0x29c),'type':_0x1d8f76(0x29c),'name':_0x1d8f76(0x19b),'enabled':_0x2023d8[_0x1d8f76(0x2b9)]!==![],'appId':_0x2a790d,'appSecret':_0x19612a}),_0x279524;}async function _0x2cbb9a(_0x2f0244){const _0x2f59a7=_0x35ea73;if(typeof openClawConfigHandlers[_0x2f59a7(0x102)+_0x2f59a7(0x263)]===_0x2f59a7(0x1a4))return openClawConfigHandlers[_0x2f59a7(0x102)+_0x2f59a7(0x263)]({'pluginId':WECHAT_PLUGIN_ID,'enabled':Boolean(_0x2f0244),'reason':WECHAT_PLUGIN_ID+_0x2f59a7(0x191)+(_0x2f0244?_0x2f59a7(0x2b9):_0x2f59a7(0x262))});const _0x47de9e=await _0x2d7664(),_0x585a35=asRecord(_0x47de9e[_0x2f59a7(0x1cd)]),_0x414b73=asRecord(_0x585a35[_0x2f59a7(0x281)]);return _0x414b73[WECHAT_PLUGIN_ID]={...asRecord(_0x414b73[WECHAT_PLUGIN_ID]),'enabled':Boolean(_0x2f0244)},_0x585a35[_0x2f59a7(0x281)]=_0x414b73,_0x585a35['allow']=_0x2f0244?dedupeStrings([...asStringArray(_0x585a35[_0x2f59a7(0xff)]),WECHAT_PLUGIN_ID]):asStringArray(_0x585a35[_0x2f59a7(0xff)])[_0x2f59a7(0x110)](_0x5a1b52=>_0x5a1b52!==WECHAT_PLUGIN_ID),_0x47de9e[_0x2f59a7(0x1cd)]=_0x585a35,await _0x17ccc5(_0x47de9e,WECHAT_PLUGIN_ID+'\x20plugin\x20'+(_0x2f0244?_0x2f59a7(0x2b9):'disabled')),{'ok':!![]};}async function _0x1a2fad(_0x3accb4={}){const _0x4f5306=_0x35ea73,_0x3565d0=safeString(_0x3accb4[_0x4f5306(0x290)+'d']||_0x3accb4['id']);if(!_0x3565d0)throw new Error('Channel\x20'+_0x4f5306(0x1cb)+_0x4f5306(0x213));const _0x54fa4f=await _0x2d7664(),_0x30632c=asRecord(_0x54fa4f['channels']),_0x3174fc=asRecord(_0x54fa4f[_0x4f5306(0x1cd)]),_0x24b58c=asRecord(_0x3174fc[_0x4f5306(0x281)]),_0x199d12=_0xc205a3=>{const _0x2bf77f=_0x4f5306;_0x24b58c[_0xc205a3]=createConnectorPluginEntry(_0xc205a3,_0x24b58c[_0xc205a3],![],{}),_0x3174fc[_0x2bf77f(0xff)]=asStringArray(_0x3174fc[_0x2bf77f(0xff)])[_0x2bf77f(0x110)](_0x6f87d0=>_0x6f87d0!==_0xc205a3),_0x3174fc['entries']=_0x24b58c,_0x54fa4f[_0x2bf77f(0x1cd)]=_0x3174fc;};if(_0x3565d0===_0x4f5306(0x203)+'oc')return _0x199d12(FEISHU_DOC_CONNECTOR_PLUGIN_ID),getTrimmedString(asRecord(_0x30632c['feishu'])['managedB'+'y'])===FEISHU_DOC_CONNECTOR_PLUGIN_ID&&(delete _0x30632c[_0x4f5306(0x29c)],_0x54fa4f['channels']=_0x30632c),await rm(_0x326b6e(),{'recursive':!![],'force':!![]})[_0x4f5306(0x25c)](()=>{}),_0x17ccc5(_0x54fa4f,_0x4f5306(0x268)+_0x4f5306(0x1ee)+_0x4f5306(0x109)+_0x4f5306(0x193)+_0x4f5306(0x1c2));if(_0x3565d0===_0x4f5306(0x1bf)){if(typeof openClawConfigHandlers[_0x4f5306(0x102)+_0x4f5306(0x263)]===_0x4f5306(0x1a4))return openClawConfigHandlers[_0x4f5306(0x102)+_0x4f5306(0x263)]({'pluginId':QQ_MAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':_0x4f5306(0x141)+'connecto'+_0x4f5306(0x2bd)+'\x20deleted'});return _0x199d12(QQ_MAIL_CONNECTOR_PLUGIN_ID),_0x17ccc5(_0x54fa4f,_0x4f5306(0x141)+_0x4f5306(0xf3)+_0x4f5306(0x2bd)+_0x4f5306(0x150));}if(_0x3565d0===_0x4f5306(0xf9)+_0x4f5306(0x243)){if(typeof openClawConfigHandlers[_0x4f5306(0x102)+'nConfig']===_0x4f5306(0x1a4))return openClawConfigHandlers['setPlugi'+'nConfig']({'pluginId':NETEASE_MAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':_0x4f5306(0x1e1)+_0x4f5306(0x117)+_0x4f5306(0x1f7)+_0x4f5306(0x1a7)+_0x4f5306(0x13b)});return _0x199d12(NETEASE_MAIL_CONNECTOR_PLUGIN_ID),_0x17ccc5(_0x54fa4f,_0x4f5306(0x1e1)+_0x4f5306(0x117)+'nector\x20p'+'lugin\x20de'+_0x4f5306(0x13b));}if(_0x3565d0===_0x4f5306(0xe0)+'exmail'){if(typeof openClawConfigHandlers['setPlugi'+_0x4f5306(0x263)]==='function')return openClawConfigHandlers['setPlugi'+_0x4f5306(0x263)]({'pluginId':TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':_0x4f5306(0x245)+_0x4f5306(0x170)+_0x4f5306(0xef)+_0x4f5306(0x191)+_0x4f5306(0x16e)});return _0x199d12(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID),_0x17ccc5(_0x54fa4f,'tencent\x20'+_0x4f5306(0x170)+'onnector'+_0x4f5306(0x191)+'deleted');}if(_0x3565d0===_0x4f5306(0xe0)+'docs'){if(typeof openClawConfigHandlers[_0x4f5306(0x1fd)+'illEntry']===_0x4f5306(0x1a4))return openClawConfigHandlers[_0x4f5306(0x1fd)+_0x4f5306(0x2b1)]({'skillId':TENCENT_DOCS_SKILL_ID,'reason':_0x4f5306(0x245)+_0x4f5306(0x1de)+_0x4f5306(0x210)+'ctor\x20del'+_0x4f5306(0x26d)});const _0x2864c5=asRecord(_0x54fa4f[_0x4f5306(0x2b5)]),_0xc6a21=asRecord(_0x2864c5[_0x4f5306(0x281)]);return delete _0xc6a21[TENCENT_DOCS_SKILL_ID],_0x2864c5[_0x4f5306(0x281)]=_0xc6a21,_0x54fa4f['skills']=_0x2864c5,_0x17ccc5(_0x54fa4f,_0x4f5306(0x245)+_0x4f5306(0x1de)+_0x4f5306(0x210)+_0x4f5306(0x196)+_0x4f5306(0x26d));}if(_0x3565d0===_0x4f5306(0x1df))return await _0x24f352([_0x4f5306(0x1a5),_0x4f5306(0x29f)])[_0x4f5306(0x25c)](()=>({'code':null,'output':''})),await _0x397015(),{'ok':!![]};if(_0x3565d0==='dingtalk'+_0x4f5306(0x2c8)){if(typeof openClawConfigHandlers[_0x4f5306(0x1a0)+_0x4f5306(0x17d)]===_0x4f5306(0x1a4))return openClawConfigHandlers['deleteMc'+_0x4f5306(0x17d)]({'serverName':DINGTALK_DOC_MCP_SERVER_NAME,'reason':_0x4f5306(0x26e)+'\x20doc\x20mcp'+'\x20deleted'});const _0x3e6ac8=readOpenClawMcpServersFromConfig(_0x54fa4f);return delete _0x3e6ac8[DINGTALK_DOC_MCP_SERVER_NAME],writeOpenClawMcpServersToConfig(_0x54fa4f,_0x3e6ac8),_0x17ccc5(_0x54fa4f,_0x4f5306(0x26e)+_0x4f5306(0xde)+_0x4f5306(0x150));}if(_0x3565d0===WECHAT_PLUGIN_ID||_0x3565d0===_0x4f5306(0x1ce)+_0x4f5306(0x15e)){_0x24b58c[WECHAT_PLUGIN_ID]={...asRecord(_0x24b58c[WECHAT_PLUGIN_ID]),'enabled':![]},_0x3174fc[_0x4f5306(0x281)]=_0x24b58c,_0x3174fc['allow']=asStringArray(_0x3174fc['allow'])[_0x4f5306(0x110)](_0x27ba0d=>_0x27ba0d!==WECHAT_PLUGIN_ID&&_0x27ba0d!=='openclaw'+'-weixin'),_0x54fa4f[_0x4f5306(0x1cd)]=_0x3174fc;const _0x20c9aa=join(_0x3aad17[_0x4f5306(0x21e)+_0x4f5306(0x17a)](),WECHAT_PLUGIN_ID);return await rm(join(_0x20c9aa,_0x4f5306(0x28e)+'.json'),{'force':!![]})['catch'](()=>{}),await rm(join(_0x20c9aa,_0x4f5306(0x28e)),{'recursive':!![],'force':!![]})[_0x4f5306(0x25c)](()=>{}),_0x17ccc5(_0x54fa4f,_0x3565d0+(_0x4f5306(0x23c)+_0x4f5306(0xe5)+_0x4f5306(0x16e)));}if(_0x3565d0===_0x4f5306(0x29c)){if(typeof openClawConfigHandlers[_0x4f5306(0xe7)+'annelCon'+'fig']===_0x4f5306(0x1a4))return openClawConfigHandlers['deleteCh'+_0x4f5306(0x107)+'fig']({'channelId':_0x4f5306(0x29c),'pluginId':_0x4f5306(0x29c),'reason':_0x4f5306(0x160)+_0x4f5306(0x1e9)+_0x4f5306(0x227)+_0x4f5306(0x13b)});return delete _0x30632c['feishu'],_0x54fa4f[_0x4f5306(0xc8)]=_0x30632c,_0x24b58c[_0x4f5306(0x29c)]={...asRecord(_0x24b58c[_0x4f5306(0x29c)]),'enabled':![]},_0x3174fc[_0x4f5306(0x281)]=_0x24b58c,_0x3174fc['allow']=asStringArray(_0x3174fc['allow'])[_0x4f5306(0x110)](_0x2328e=>_0x2328e!==_0x4f5306(0x29c)),_0x54fa4f[_0x4f5306(0x1cd)]=_0x3174fc,_0x17ccc5(_0x54fa4f,_0x4f5306(0x160)+_0x4f5306(0x1e9)+_0x4f5306(0x227)+_0x4f5306(0x13b));}if(_0x3565d0==='qqbot'){if(typeof openClawConfigHandlers[_0x4f5306(0xe7)+_0x4f5306(0x107)+'fig']===_0x4f5306(0x1a4))return openClawConfigHandlers['deleteCh'+'annelCon'+_0x4f5306(0x2b2)]({'channelId':'qqbot','pluginId':QQBOT_PLUGIN_ID,'reason':_0x4f5306(0x266)+'annel\x20co'+_0x4f5306(0x1ea)+_0x4f5306(0x26d)});delete _0x30632c[_0x4f5306(0x134)],_0x24b58c[QQBOT_PLUGIN_ID]={...asRecord(_0x24b58c[QQBOT_PLUGIN_ID]),'enabled':![]},_0x3174fc[_0x4f5306(0xff)]=asStringArray(_0x3174fc[_0x4f5306(0xff)])['filter'](_0x5725ac=>_0x5725ac!==QQBOT_PLUGIN_ID);}if(_0x3565d0===_0x4f5306(0x155)){if(typeof openClawConfigHandlers[_0x4f5306(0xe7)+_0x4f5306(0x107)+_0x4f5306(0x2b2)]===_0x4f5306(0x1a4))return openClawConfigHandlers[_0x4f5306(0xe7)+_0x4f5306(0x107)+'fig']({'channelId':'wecom','pluginId':WECOM_PLUGIN_ID,'reason':_0x4f5306(0x237)+_0x4f5306(0x2c4)+_0x4f5306(0x1ea)+_0x4f5306(0x26d)});delete _0x30632c['wecom'],_0x24b58c[WECOM_PLUGIN_ID]={...asRecord(_0x24b58c[WECOM_PLUGIN_ID]),'enabled':![]},_0x3174fc['allow']=asStringArray(_0x3174fc[_0x4f5306(0xff)])[_0x4f5306(0x110)](_0x2f4471=>_0x2f4471!==WECOM_PLUGIN_ID);}return _0x54fa4f[_0x4f5306(0xc8)]=_0x30632c,_0x3174fc[_0x4f5306(0x281)]=_0x24b58c,_0x54fa4f[_0x4f5306(0x1cd)]=_0x3174fc,_0x17ccc5(_0x54fa4f,_0x3565d0+(_0x4f5306(0x23c)+'\x20config\x20'+_0x4f5306(0x16e)));}async function _0x3e3003(_0x7bbf81={}){const _0x85d2af=_0x35ea73,_0x4de48e=safeString(_0x7bbf81[_0x85d2af(0x290)+'d']||_0x7bbf81['id']);if(!_0x4de48e)throw new Error(_0x85d2af(0x1e5)+_0x85d2af(0x1cb)+_0x85d2af(0x213));const _0x37aaf2=_0x7bbf81[_0x85d2af(0x2b9)]===!![],_0x4f1df6=await _0x2d7664(),_0x3b0f2a=asRecord(_0x4f1df6[_0x85d2af(0x1cd)]),_0x13fbd3=asRecord(_0x3b0f2a[_0x85d2af(0x281)]),_0x5bab0a=_0x49c149=>{const _0x1ad550=_0x85d2af;_0x13fbd3[_0x49c149]=createConnectorPluginEntry(_0x49c149,_0x13fbd3[_0x49c149],_0x37aaf2,{},{'preserveExistingConfig':!![]}),_0x3b0f2a['allow']=_0x37aaf2?dedupeStrings([...asStringArray(_0x3b0f2a[_0x1ad550(0xff)]),_0x49c149]):asStringArray(_0x3b0f2a[_0x1ad550(0xff)])[_0x1ad550(0x110)](_0x25042a=>_0x25042a!==_0x49c149),_0x3b0f2a[_0x1ad550(0x281)]=_0x13fbd3,_0x4f1df6[_0x1ad550(0x1cd)]=_0x3b0f2a;};if(_0x4de48e==='feishu_d'+'oc'){const _0x17d595=asRecord(_0x13fbd3[FEISHU_DOC_CONNECTOR_PLUGIN_ID]);if(Object[_0x85d2af(0x1fa)](_0x17d595)[_0x85d2af(0x116)]===0x0)throw new Error(_0x85d2af(0x189)+'r\x20\x22'+_0x4de48e+('\x22\x20not\x20fo'+_0x85d2af(0x169)));if(typeof openClawConfigHandlers['setPlugi'+_0x85d2af(0x263)]===_0x85d2af(0x1a4))return openClawConfigHandlers[_0x85d2af(0x102)+_0x85d2af(0x263)]({'pluginId':FEISHU_DOC_CONNECTOR_PLUGIN_ID,'enabled':_0x37aaf2,'reason':_0x4de48e+(_0x85d2af(0x23c)+_0x85d2af(0xe5))+(_0x37aaf2?_0x85d2af(0x2b9):_0x85d2af(0x262))});_0x5bab0a(FEISHU_DOC_CONNECTOR_PLUGIN_ID);}else{if(_0x4de48e===_0x85d2af(0x1bf)){if(typeof openClawConfigHandlers[_0x85d2af(0x102)+_0x85d2af(0x263)]==='function')return openClawConfigHandlers['setPlugi'+_0x85d2af(0x263)]({'pluginId':QQ_MAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x37aaf2,'reason':_0x4de48e+(_0x85d2af(0x23c)+_0x85d2af(0xe5))+(_0x37aaf2?_0x85d2af(0x2b9):_0x85d2af(0x262))});_0x5bab0a(QQ_MAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x4de48e===_0x85d2af(0xf9)+'mail'){if(typeof openClawConfigHandlers[_0x85d2af(0x102)+'nConfig']===_0x85d2af(0x1a4))return openClawConfigHandlers['setPlugi'+_0x85d2af(0x263)]({'pluginId':NETEASE_MAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x37aaf2,'reason':_0x4de48e+(_0x85d2af(0x23c)+_0x85d2af(0xe5))+(_0x37aaf2?_0x85d2af(0x2b9):_0x85d2af(0x262))});_0x5bab0a(NETEASE_MAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x4de48e===_0x85d2af(0xe0)+'exmail'){if(typeof openClawConfigHandlers[_0x85d2af(0x102)+_0x85d2af(0x263)]===_0x85d2af(0x1a4))return openClawConfigHandlers[_0x85d2af(0x102)+_0x85d2af(0x263)]({'pluginId':TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x37aaf2,'reason':_0x4de48e+(_0x85d2af(0x23c)+_0x85d2af(0xe5))+(_0x37aaf2?'enabled':_0x85d2af(0x262))});_0x5bab0a(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x4de48e===_0x85d2af(0xe0)+_0x85d2af(0x101)){const _0x5e4b5f=asRecord(_0x4f1df6['skills']),_0x48075d=asRecord(_0x5e4b5f[_0x85d2af(0x281)]),_0x33ab24=asRecord(_0x48075d[TENCENT_DOCS_SKILL_ID]);if(typeof openClawConfigHandlers[_0x85d2af(0x1f1)+'Entry']===_0x85d2af(0x1a4))return openClawConfigHandlers['setSkill'+_0x85d2af(0x1b9)]({'skillId':TENCENT_DOCS_SKILL_ID,'entry':{..._0x33ab24,'enabled':_0x37aaf2},'reason':_0x4de48e+(_0x85d2af(0x23c)+_0x85d2af(0xe5))+(_0x37aaf2?_0x85d2af(0x2b9):'disabled')});_0x48075d[TENCENT_DOCS_SKILL_ID]={..._0x33ab24,'enabled':_0x37aaf2},_0x5e4b5f[_0x85d2af(0x281)]=_0x48075d,_0x4f1df6[_0x85d2af(0x2b5)]=_0x5e4b5f;}else{if(_0x4de48e==='kdocs'){if(_0x37aaf2&&!await _0x5c6e4b())throw new Error(_0x85d2af(0x2cc)+',请先连接');return await _0x5a187c(_0x37aaf2),{'ok':!![]};}else{if(_0x4de48e===_0x85d2af(0x26e)+_0x85d2af(0x2c8)){const _0x55ef5c=readOpenClawMcpServersFromConfig(_0x4f1df6),_0x33ce1d=findDingtalkDocMcpServer(_0x55ef5c);if(!getTrimmedString(_0x33ce1d['url']))throw new Error(_0x85d2af(0x189)+_0x85d2af(0x173)+_0x4de48e+(_0x85d2af(0x2a4)+'und'));_0x55ef5c[DINGTALK_DOC_MCP_SERVER_NAME]=createDingtalkDocMcpServerConfig(_0x33ce1d[_0x85d2af(0x139)],{'enabled':_0x37aaf2}),writeOpenClawMcpServersToConfig(_0x4f1df6,_0x55ef5c);}else{const _0x585504=asRecord(_0x4f1df6[_0x85d2af(0xc8)]),_0x21820e=asRecord(_0x585504[_0x4de48e]);if(Object[_0x85d2af(0x1fa)](_0x21820e)['length']===0x0)throw new Error('Channel\x20'+'\x22'+_0x4de48e+(_0x85d2af(0x2a4)+'und'));_0x21820e[_0x85d2af(0x2b9)]=_0x37aaf2;let _0x4e08cd=null;_0x4de48e===_0x85d2af(0x29c)&&(_0x4e08cd='feishu',_0x37aaf2&&(_0x21820e['streamin'+'g']=!![],delete _0x21820e[_0x85d2af(0x186)]));if(_0x4de48e===_0x85d2af(0x134))_0x4e08cd=QQBOT_PLUGIN_ID;if(_0x4de48e===_0x85d2af(0x155))_0x4e08cd=WECOM_PLUGIN_ID;if(_0x4e08cd&&typeof openClawConfigHandlers[_0x85d2af(0x236)+_0x85d2af(0x224)]==='function')return openClawConfigHandlers[_0x85d2af(0x236)+_0x85d2af(0x224)]({'channelId':_0x4de48e,'channel':_0x21820e,'pluginId':_0x4e08cd,'pluginEnabled':_0x37aaf2,'reason':_0x4de48e+(_0x85d2af(0x23c)+_0x85d2af(0xe5))+(_0x37aaf2?'enabled':_0x85d2af(0x262))});_0x585504[_0x4de48e]=_0x21820e,_0x4f1df6['channels']=_0x585504;if(_0x4de48e===_0x85d2af(0x29c))_0x5bab0a('feishu');if(_0x4de48e===_0x85d2af(0x134))_0x5bab0a(QQBOT_PLUGIN_ID);if(_0x4de48e===_0x85d2af(0x155))_0x5bab0a(WECOM_PLUGIN_ID);}}}}}}}return _0x17ccc5(_0x4f1df6,_0x4de48e+(_0x85d2af(0x23c)+_0x85d2af(0xe5))+(_0x37aaf2?_0x85d2af(0x2b9):_0x85d2af(0x262)));}async function _0x5ce5a8({gatewayPort:_0x52701b,gatewayToken:_0x1f26bd}={}){const _0x176550=_0x35ea73;_0x2ba560&&(_0x2ba560[_0x176550(0x2c2)](),_0x2ba560=null);const {cwd:_0xb9c786,env:_0x407151,runtime:_0x261de9}=await _0x403451({'FORCE_COLOR':'0',..._0x52701b?{'OPENCLAW_GATEWAY_PORT':String(_0x52701b)}:{},..._0x1f26bd?{'OPENCLAW_GATEWAY_TOKEN':_0x1f26bd}:{}}),_0x1b2fa3=_0x261de9['plugins'][_0x176550(0x2be)](_0x591603=>_0x591603[_0x176550(0x122)]===WECHAT_PLUGIN_ID);if(!_0x1b2fa3){const _0x2e69f9=_0x176550(0xc6)+_0x176550(0x252)+_0x176550(0x16f)+_0x176550(0x257);return _0x3868f8(_0x176550(0xfb)+'tatus',_0x176550(0x111)),_0x3868f8('wechat-l'+'og',_0x2e69f9),{'ok':![],'error':_0x2e69f9};}await _0x2cbb9a(!![]),_0x3868f8('wechat-l'+'og',_0x176550(0x244)+_0x176550(0x267)+'hannels\x20'+_0x176550(0x1e7)+'channel\x20'+_0x1b2fa3[_0x176550(0x122)]),_0x2ba560=spawn(_0x261de9[_0x176550(0x23d)+_0x176550(0x130)],[_0x261de9[_0x176550(0x1ce)+'Bin'],_0x176550(0xc8),'login',_0x176550(0x1ff)+'l',_0x1b2fa3[_0x176550(0x122)]],{'cwd':_0xb9c786,'env':_0x407151});let _0x12a37a='',_0x4d06ee=![],_0xc4d1e9=![];const _0x50942f=_0x5c1c7e=>{const _0xb0fb4e=_0x176550,_0x169de4=_0x5c1c7e[_0xb0fb4e(0x121)]();_0x12a37a+=_0x169de4;if(!_0x4d06ee){const _0x2af294=_0x12a37a['match'](/(https:\/\/(?:[a-zA-Z0-9-]+\.)*weixin\.qq\.com\S+)/i);_0x2af294?.[0x1]&&(_0x4d06ee=!![],_0x3868f8(_0xb0fb4e(0x14a)+_0xb0fb4e(0x1af),_0x2af294[0x1]),_0x3868f8('wechat-s'+_0xb0fb4e(0x1ed),_0xb0fb4e(0x258)));}if(_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0x12b))||_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0x100)+_0xb0fb4e(0x2cd))||_0x169de4['includes'](_0xb0fb4e(0x24e)))_0x3868f8(_0xb0fb4e(0xfb)+_0xb0fb4e(0x1ed),'SCANNED');else{if(_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0xd5))||_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0x206))||_0x169de4[_0xb0fb4e(0x1ac)]('扫码成功')||_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0x1dd)+'n')||_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0x241)+_0xb0fb4e(0x19f))||_0x169de4[_0xb0fb4e(0x1ac)]('启动成功')||_0x169de4['includes'](_0xb0fb4e(0x12c))||_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0x10f))||_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0x1f3)+_0xb0fb4e(0x185)+'d')||_0x169de4[_0xb0fb4e(0x1ac)](_0xb0fb4e(0xcd)+_0xb0fb4e(0x11c)+_0xb0fb4e(0x275)))_0xc4d1e9=!![],_0x3868f8('wechat-s'+_0xb0fb4e(0x1ed),_0xb0fb4e(0x209)),setTimeout(()=>{_0x2ba560&&(_0x2ba560['kill'](),_0x2ba560=null);},0xbb8);else{if(_0x169de4['includes']('过期')||_0x169de4['includes']('expired'))_0x3868f8(_0xb0fb4e(0xfb)+_0xb0fb4e(0x1ed),_0xb0fb4e(0x198));else(_0x169de4['includes']('失败')||_0x169de4['includes'](_0xb0fb4e(0x11f))||_0x169de4['includes'](_0xb0fb4e(0x12e)))&&_0x3868f8(_0xb0fb4e(0xfb)+_0xb0fb4e(0x1ed),_0xb0fb4e(0x111));}}_0x3868f8(_0xb0fb4e(0x1db)+'og',_0x169de4);};return _0x2ba560['stdout']?.['on']('data',_0x50942f),_0x2ba560[_0x176550(0x183)]?.['on'](_0x176550(0x202),_0x50942f),_0x2ba560['on'](_0x176550(0x294),_0xdcd8b9=>{const _0x2d54b7=_0x176550;_0x2ba560=null,_0x3868f8('wechat-s'+_0x2d54b7(0x1ed),_0x2d54b7(0x111)),_0x3868f8(_0x2d54b7(0x1db)+'og','Spawn\x20er'+'ror:\x20'+_0xdcd8b9[_0x2d54b7(0xd8)]);}),_0x2ba560['on'](_0x176550(0x2b0),_0x1abbb4=>{const _0x460ddc=_0x176550;_0x2ba560=null,_0xc4d1e9?_0x2cbb9a(!![])['catch'](()=>{}):(_0x2cbb9a(![])[_0x460ddc(0x25c)](()=>{}),_0x3868f8(_0x460ddc(0xfb)+'tatus',_0x1abbb4===0x0?'CLOSED':_0x460ddc(0x111)));}),{'ok':!![]};}function _0x2c64bf(){const _0x54545f=_0x35ea73;return _0x2ba560&&(_0x2ba560[_0x54545f(0x2c2)](),_0x2ba560=null),{'ok':!![]};}function _0x3999eb(){const _0x43a731=_0x35ea73;for(const _0x275729 of _0x7c6eef[_0x43a731(0x278)]()){_0x4538e9(_0x275729),_0x275729[_0x43a731(0x1e2)]?.[_0x43a731(0x2c2)]();}_0x7c6eef[_0x43a731(0x207)]();for(const _0x508c4e of _0x931e4c[_0x43a731(0x278)]()){_0x23a31f(_0x508c4e);}_0x931e4c['clear']();for(const _0xfbe566 of _0x3c1879[_0x43a731(0x278)]()){_0x210adf(_0xfbe566),_0x38127b(_0xfbe566),_0xfbe566[_0x43a731(0x1e2)]?.[_0x43a731(0x2c2)]();}_0x3c1879[_0x43a731(0x207)](),_0x2ba560&&(_0x2ba560['kill'](),_0x2ba560=null);}return{'saveFeishuChannelConfig':_0x3d6a66,'saveQqbotChannelConfig':_0x44013a,'saveWecomChannelConfig':_0x155db7,'saveQqMailConnectorConfig':_0x3f87f7,'saveNetEaseMailConnectorConfig':_0x3832f8,'saveTencentExmailConnectorConfig':_0x8ce02f,'saveFeishuDocConnectorConfig':_0x5994a2,'saveTencentDocsConnectorConfig':_0x241ec7,'saveKdocsConnectorConfig':_0x4bff87,'saveDingtalkDocConnectorConfig':_0x5c77bf,'readConfigSnapshot':_0x158514,'startKdocsCliConnectSession':_0x4fb3c5,'getKdocsCliConnectStatus':_0x3fa367,'cancelKdocsCliConnectSession':_0x2b223d,'startFeishuDocCliConnectSession':_0x5598f8,'getFeishuDocCliConnectStatus':_0x3eba42,'cancelFeishuDocCliConnectSession':_0xfef56c,'completeFeishuDocCliConnectSession':_0x717cf6,'startFeishuRegistrationSession':_0x118d1b,'getFeishuRegistrationStatus':_0x5c9efe,'cancelFeishuRegistrationSession':_0x586312,'listImChannelConfigs':_0x130961,'deleteImChannelConfig':_0x1a2fad,'setImChannelEnabled':_0x3e3003,'startWechatChannelSession':_0x5ce5a8,'cancelWechatChannelSession':_0x2c64bf,'dispose':_0x3999eb};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x27601c=_0xcf8c;(function(_0x3efa8c,_0x17c05a){const _0x49a0a5=_0xcf8c,_0x8e3e8c=_0x3efa8c();while(!![]){try{const _0x1dbb34=-parseInt(_0x49a0a5(0xbe))/0x1+-parseInt(_0x49a0a5(0xcf))/0x2+parseInt(_0x49a0a5(0xc7))/0x3+parseInt(_0x49a0a5(0xfc))/0x4+-parseInt(_0x49a0a5(0x10e))/0x5+-parseInt(_0x49a0a5(0xea))/0x6*(parseInt(_0x49a0a5(0xf0))/0x7)+parseInt(_0x49a0a5(0xc3))/0x8;if(_0x1dbb34===_0x17c05a)break;else _0x8e3e8c['push'](_0x8e3e8c['shift']());}catch(_0x303478){_0x8e3e8c['push'](_0x8e3e8c['shift']());}}}(_0x24c6,0x6d321));import{existsSync,readdirSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rm,writeFile}from'node:fs/promises';function _0x24c6(){const _0x3af4e4=['windows','node:chi','om\x20','platform','runtimeL','tar','resume','6LfvKMq','i\x20binary','ct-','\x20failed\x20','match','li-extra','6129557jPuiGo','ogger','map','ignore','m\x20OpenCl','https://','kill','skill\x20ve','e\x20kdocs\x20','runtimeR','pid','openclaw','1668656MXbpUJ','info','SIGTERM','led','.zip','ll\x20prepa','statusCo','rsion\x20fr','label','.kdocs-c','stderr','pipe','sing\x20fro','.cache','oot','re\x22\x20to\x20r','ory','Unable\x20t','3379630muglSE','/pro','.source','env','version','ld_proce','toString','amd64','href','filter','timeoutM','isFile','wujie-sh','now','o\x20resolv','.\x20Run\x20\x22w','ujie-she','kdocs-cl','-xzf','ebuild\x20t','headers','isDirect','data','877155PVTHSl','i\x20alread','extract\x20','\x20timed\x20o','SKILL.md','20312560bhzmpe','.tar.gz','i.exe','stdout','617133HuLTch','time]\x20do','wpsai.wp','i\x20is\x20mis','arch','win32','/release','cwd','571896pVVxqj','\x20not\x20fou','i\x20versio','x64','ut\x20after','me.','ell-runt','download','close','catch','location','name','log','tools','skillhub','error','WorkingD','Bundled\x20','utf8','ime\x0a'];_0x24c6=function(){return _0x3af4e4;};return _0x24c6();}function _0xcf8c(_0x76a471,_0x3672d7){_0x76a471=_0x76a471-0xa9;const _0x24c6fc=_0x24c6();let _0xcf8c98=_0x24c6fc[_0x76a471];return _0xcf8c98;}import{dirname,join}from'node:path';import{get}from'node:https';import{pipeline}from'node:stream/promises';const KDOCS_CLI_CDN_BASE=(process.env.KDOCS_CLI_CDN??_0x27601c(0xf5)+_0x27601c(0xc9)+'scdn.cn/'+_0x27601c(0xdd)+_0x27601c(0x10f))['replace'](/\/$/,''),DOWNLOAD_TIMEOUT_MS=0xf*0x3c*0x3e8;async function runProcess(_0x3d5f1b,_0x4fd802,_0x2ee40b={}){const _0x4e234e=_0x27601c,{spawn:_0x3dcb52}=await import(_0x4e234e(0xe4)+_0x4e234e(0xac)+'ss'),_0x38c0df=_0x2ee40b[_0x4e234e(0x104)]||[_0x3d5f1b,..._0x4fd802]['join']('\x20'),_0x3ddb8a=_0x2ee40b[_0x4e234e(0xb1)+'s']??DOWNLOAD_TIMEOUT_MS;return await new Promise((_0x2fba92,_0x4fdc1f)=>{const _0x565689=_0x4e234e,_0x4fd93=_0x3dcb52(_0x3d5f1b,_0x4fd802,{'cwd':_0x2ee40b[_0x565689(0xce)],'env':_0x2ee40b[_0x565689(0xaa)],'stdio':[_0x565689(0xf3),_0x565689(0x107),_0x565689(0x107)]});let _0x7c602a='',_0x1f0ef0='';const _0x3c0d37=setTimeout(()=>{const _0x24a35c=_0x565689;_0x4fd93[_0x24a35c(0xf6)](_0x24a35c(0xfe)),_0x4fdc1f(new Error(_0x38c0df+(_0x24a35c(0xc1)+_0x24a35c(0xd3)+'\x20')+_0x3ddb8a+'ms'));},_0x3ddb8a);_0x4fd93[_0x565689(0xc6)]['on'](_0x565689(0xbd),_0x18f5a6=>{const _0x591828=_0x565689;_0x7c602a+=_0x18f5a6[_0x591828(0xad)]();}),_0x4fd93[_0x565689(0x106)]['on']('data',_0x73c3ae=>{const _0x4bad9d=_0x565689;_0x1f0ef0+=_0x73c3ae[_0x4bad9d(0xad)]();}),_0x4fd93['on'](_0x565689(0xde),_0xbcc332=>{clearTimeout(_0x3c0d37),_0x4fdc1f(_0xbcc332);}),_0x4fd93['on'](_0x565689(0xd7),_0x37d320=>{clearTimeout(_0x3c0d37);if(_0x37d320===0x0)_0x2fba92({'stdout':_0x7c602a,'stderr':_0x1f0ef0,'code':_0x37d320});else _0x4fdc1f(new Error(_0x38c0df+('\x20failed\x20'+'with\x20cod'+'e\x20')+_0x37d320+':\x20'+(_0x1f0ef0||_0x7c602a)));});});}async function downloadFile(_0x7ccf3b,_0x4a44fc){await mkdir(dirname(_0x4a44fc),{'recursive':!![]});const _0x1641b2=await new Promise((_0x2b71c6,_0x3d51e6)=>{const _0x10522a=_0xcf8c,_0x12c078=get(_0x7ccf3b,_0x389ea3=>{const _0x3580ed=_0xcf8c;if([0x12d,0x12e,0x12f,0x133,0x134]['includes'](_0x389ea3['statusCo'+'de']||0x0)&&_0x389ea3[_0x3580ed(0xbb)]['location']){_0x389ea3[_0x3580ed(0xe9)](),downloadFile(new URL(_0x389ea3[_0x3580ed(0xbb)][_0x3580ed(0xd9)],_0x7ccf3b)[_0x3580ed(0xaf)],_0x4a44fc)['then'](()=>_0x2b71c6(null))[_0x3580ed(0xd8)](_0x3d51e6);return;}if((_0x389ea3[_0x3580ed(0x102)+'de']||0x0)>=0x190){_0x389ea3[_0x3580ed(0xe9)](),_0x3d51e6(new Error(_0x3580ed(0xd6)+_0x3580ed(0xed)+_0x389ea3[_0x3580ed(0x102)+'de']+':\x20'+_0x7ccf3b));return;}_0x2b71c6(_0x389ea3);});_0x12c078['on'](_0x10522a(0xde),_0x3d51e6);});if(!_0x1641b2)return;await pipeline(_0x1641b2,createWriteStream(_0x4a44fc));}async function findRuntimeKdocsCliBin(_0x52da33){const _0x4f7cf5=_0x27601c,_0x3d7976=join(_0x52da33['openclaw'+_0x4f7cf5(0xdf)+'ir'],_0x4f7cf5(0xdc),_0x4f7cf5(0xb8)+'i'),_0x47d914=join(_0x3d7976,process['platform']===_0x4f7cf5(0xcc)?_0x4f7cf5(0xb8)+_0x4f7cf5(0xc5):_0x4f7cf5(0xb8)+'i');return{'installDir':_0x3d7976,'binPath':existsSync(_0x47d914)?_0x47d914:null};}export async function resolveRuntimeKdocsCliCommand(_0x14110b){const _0x34da02=_0x27601c,{installDir:_0x5b9cba,binPath:_0x592cdf}=await findRuntimeKdocsCliBin(_0x14110b);if(!_0x592cdf||!existsSync(_0x592cdf))throw new Error(_0x34da02(0xe0)+_0x34da02(0xb8)+_0x34da02(0xca)+_0x34da02(0x108)+_0x34da02(0xf4)+'aw\x20runti'+'me:\x20'+_0x5b9cba+(_0x34da02(0xb6)+_0x34da02(0xb7)+_0x34da02(0x101)+_0x34da02(0x10b)+_0x34da02(0xba)+'he\x20runti'+_0x34da02(0xd4)));return{'executablePath':_0x592cdf,'installDir':_0x5b9cba};}function toKdocsCliPlatform(_0xd1cf26){const _0xea774c=_0x27601c;if(_0xd1cf26===_0xea774c(0xcc))return _0xea774c(0xe3);return _0xd1cf26;}function toKdocsCliArch(_0x266b3c){const _0x3202c2=_0x27601c;if(_0x266b3c===_0x3202c2(0xd2))return _0x3202c2(0xae);return _0x266b3c;}async function resolveKdocsSkillVersion(_0x373d63){const _0x549a93=_0x27601c,_0x405c5f=_0x373d63[_0x549a93(0xfb)]['skillsDi'+'r'],_0x1655bf=existsSync(_0x405c5f)?(await readdir(_0x405c5f,{'withFileTypes':!![]}))[_0x549a93(0xb0)](_0x439e9d=>_0x439e9d[_0x549a93(0xbc)+_0x549a93(0x10c)]())[_0x549a93(0xf2)](_0x17374a=>join(_0x405c5f,_0x17374a[_0x549a93(0xda)],_0x549a93(0xc2))):[];for(const _0x1dbe52 of _0x1655bf){if(!existsSync(_0x1dbe52))continue;const _0x22a5bc=await readFile(_0x1dbe52,_0x549a93(0xe1));if(!/^name:\s*kdocs\s*$/m['test'](_0x22a5bc))continue;const _0x125c49=_0x22a5bc[_0x549a93(0xee)](/^version:\s*"?([^"\s]+)"?\s*$/m);if(_0x125c49?.[0x1])return _0x125c49[0x1];}throw new Error(_0x549a93(0x10d)+_0x549a93(0xb5)+_0x549a93(0xf8)+_0x549a93(0xf7)+_0x549a93(0x103)+_0x549a93(0xe5)+_0x405c5f);}function findFileByName(_0x2298e4,_0x341b55){const _0x230472=_0x27601c;if(!existsSync(_0x2298e4))return null;for(const _0x4f8f29 of readdirSync(_0x2298e4,{'withFileTypes':!![]})){const _0x283430=join(_0x2298e4,_0x4f8f29[_0x230472(0xda)]);if(_0x4f8f29[_0x230472(0xbc)+_0x230472(0x10c)]()){const _0x395217=findFileByName(_0x283430,_0x341b55);if(_0x395217)return _0x395217;continue;}if(_0x4f8f29[_0x230472(0xb2)]()&&_0x4f8f29[_0x230472(0xda)]===_0x341b55)return _0x283430;}return null;}export async function installKdocsCliBinary(_0x46828b,_0x935845,_0xfba7e4={}){const _0x464590=_0x27601c,_0xc069ce=await resolveKdocsSkillVersion(_0x46828b),_0x43bff4=toKdocsCliPlatform(process[_0x464590(0xe6)]),_0x21b1d0=toKdocsCliArch(process[_0x464590(0xcb)]),_0x278c37=process[_0x464590(0xe6)]===_0x464590(0xcc)?_0x464590(0xb8)+_0x464590(0xc5):_0x464590(0xb8)+'i',_0x35454b=join(_0x935845[_0x464590(0xfb)+_0x464590(0xdf)+'ir'],_0x464590(0xdc),_0x464590(0xb8)+'i'),_0xc435e5=join(_0x35454b,_0x278c37);if(existsSync(_0xc435e5))try{const _0x6837a7=(await runProcess(_0xc435e5,[_0x464590(0xab)],{'label':_0x464590(0xb8)+_0x464590(0xd1)+'n','timeoutMs':0x7530}))[_0x464590(0xc6)]['trim']();if(_0x6837a7===_0xc069ce){_0xfba7e4[_0x464590(0xe7)+_0x464590(0xf1)]?.[_0x464590(0xfd)]('kdocs-cl'+_0x464590(0xbf)+'y\x20instal'+_0x464590(0xff),{'version':_0xc069ce,'installDir':_0x35454b});return;}}catch{}const _0x5220ba=_0x43bff4==='windows'?_0x464590(0x100):_0x464590(0xc4),_0x3e76df=_0x464590(0xb8)+'i-'+_0xc069ce+'-'+_0x43bff4+'-'+_0x21b1d0+_0x5220ba,_0x3e4523=join(_0x935845[_0x464590(0xf9)+_0x464590(0x10a)],_0x464590(0x109)),_0x5145b9=join(_0x3e4523,_0x3e76df),_0x58cfcc=join(_0x935845[_0x464590(0xf9)+_0x464590(0x10a)],_0x464590(0x105)+_0x464590(0xef)+_0x464590(0xec)+process[_0x464590(0xfa)]+'-'+Date[_0x464590(0xb4)]()),_0xec2dbc=KDOCS_CLI_CDN_BASE+'/v'+_0xc069ce+(_0x464590(0xcd)+'s/')+_0x3e76df;await mkdir(_0x3e4523,{'recursive':!![]});!existsSync(_0x5145b9)&&(console[_0x464590(0xdb)]('[wujie-s'+'hell:run'+_0x464590(0xc8)+'wnloadin'+'g\x20'+_0xec2dbc),await downloadFile(_0xec2dbc,_0x5145b9));await rm(_0x58cfcc,{'recursive':!![],'force':!![]}),await mkdir(_0x58cfcc,{'recursive':!![]});_0x5145b9['endsWith']('.zip')?await runProcess('unzip',['-q',_0x5145b9,'-d',_0x58cfcc],{'label':_0x464590(0xc0)+_0x3e76df}):await runProcess(_0x464590(0xe8),[_0x464590(0xb9),_0x5145b9,'-C',_0x58cfcc],{'label':_0x464590(0xc0)+_0x3e76df});const _0x5565c7=findFileByName(_0x58cfcc,_0x278c37);if(!_0x5565c7)throw new Error('kdocs-cl'+_0x464590(0xeb)+_0x464590(0xd0)+'nd\x20in\x20ar'+'chive:\x20'+_0x3e76df);await rm(_0x35454b,{'recursive':!![],'force':!![]}),await mkdir(_0x35454b,{'recursive':!![]}),await cp(_0x5565c7,_0xc435e5);if(process[_0x464590(0xe6)]!==_0x464590(0xcc))await chmod(_0xc435e5,0x1ed);await writeFile(join(_0x35454b,_0x464590(0xa9)),_0x464590(0xb3)+_0x464590(0xd5)+_0x464590(0xe2),_0x464590(0xe1)),await rm(_0x58cfcc,{'recursive':!![],'force':!![]}),_0xfba7e4[_0x464590(0xe7)+_0x464590(0xf1)]?.[_0x464590(0xfd)]('kdocs-cl'+'i\x20instal'+'led',{'version':_0xc069ce,'installDir':_0x35454b,'binPath':_0xc435e5});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x50da97=_0x2d4e;(function(_0x2dfd55,_0x4f7492){const _0x54b2d=_0x2d4e,_0x279e91=_0x2dfd55();while(!![]){try{const _0x441045=parseInt(_0x54b2d(0x209))/0x1+-parseInt(_0x54b2d(0x1c7))/0x2+-parseInt(_0x54b2d(0x1f4))/0x3*(parseInt(_0x54b2d(0x1cd))/0x4)+-parseInt(_0x54b2d(0xbc))/0x5+parseInt(_0x54b2d(0x170))/0x6*(parseInt(_0x54b2d(0x1e4))/0x7)+-parseInt(_0x54b2d(0xc1))/0x8+-parseInt(_0x54b2d(0x220))/0x9*(-parseInt(_0x54b2d(0x157))/0xa);if(_0x441045===_0x4f7492)break;else _0x279e91['push'](_0x279e91['shift']());}catch(_0x4be041){_0x279e91['push'](_0x279e91['shift']());}}}(_0x4d1e,0xd322c));import _0x69fb71 from'electron';import{fileURLToPath}from'node:url';import{dirname,join,resolve}from'node:path';import{existsSync}from'node:fs';import{readFile,readdir,stat,writeFile}from'node:fs/promises';import{spawn}from'node:child_process';import{loadShellConfig}from'@wujie-shell/config';import{createConfigController}from'../config-controller.mjs';import{createGatewayController}from'../gateway-controller.mjs';import{createShellLogger,exportLogsArchive,summarizeError,summarizePayload,summarizeText,toHomePath}from'../logging.mjs';import{resolveRuntimeRoot}from'../runtime.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,_0x50da97(0xdc)+'mjs'),{app,BrowserWindow,dialog,globalShortcut,ipcMain,shell}=_0x69fb71,DEVTOOLS_ACCELERATOR='CommandO'+_0x50da97(0x212)+_0x50da97(0xe3);let mainWindow=null,shellConfig=null,configController=null,gatewayController=null,bootError=null,mainLogger=null,ipcLogger=null,filesLogger=null,rendererLogger=null;function getMode(){const _0x1a0dcc=_0x50da97;return process.env.VITE_DEV_SERVER_URL?_0x1a0dcc(0x16c):_0x1a0dcc(0x1e1);}function _0x4d1e(){const _0x29617e=['logs\x20dir','one','now','indexOf',':set-pin','est\x20star','edWindow','ent','cron:upd','ory','from','iled\x20to\x20','apiKey','fromWebC','-logs','eam','getURL','ist','uit:\x20sto','list','selected','name','ipc','rocess-g','limit','g_conten','ile\x20writ','sessions','ame','-shortcu','ot\x20start','info','ad-binar','cron:rem','-info','tp\x20','trim','dels','setPinne','inimize','ot\x20faile','\x20log','redConte','l\x20prepar',':pinned-','node','dow\x20load','ion','cwd','main','will-qui','files:wr','\x20process','ignore','utf8','\x20not\x20con','error','\x20a\x20provi','paths','loadURL','agents-u','#f8fafc','isDestro','[wujie-s',':runtime','\x20complet',':create','getAllWi','dist','content','toLowerC','defaults','tLogs',':answer-','cron:run','agents','pened','settings','nfo','uncaught','senderFr','log','ell:even','openDire','irectory','chat:str','update','nts','skills:d','sidebar','1330qTQOsf','ase','writeSha','Bearer\x20','productN','eam-even','model-id','\x20main\x20bo','temperat','stop','logs','getFocus','map','messages','file\x20wri','lose','n-direct','open','dataDir','length','ectory','dev','ntext','runOnce','tory','6GIUtcg','handle','ximize','message','files:se','ustom-mo','temp','primary','efault','dKeys','ory\x20open','webConte','pping\x20ga','skills:s','api.open','way\x20is\x20n','hiddenIn','quit','stion','object','ModelId','provider','lect-dir','path','runtimeI','projectR','\x20excepti','d\x20reject','openDevT','session-','loadFile','st-direc','director','window:o','orted','renderer','pdated','logs:exp','stopped\x20','Exceptio','ell\x20boot','ll-close','pinnedKe','gateway-','Terminal','chat','model','preventD','platform','ectory\x20o','timeoutM','install','catch','yed','recursiv','byteLeng','i-window','ure','read','app:info',':delete','\x20gone','ocess-go','stream','then','filter','models','maxToken','file\x20rea','cron:cre','skills:i','sender','openPath','updated','kUserQue','delete','slice','setName','ask-user','getPath','wujie-sh','ion/json','ile\x20read','status','ndows','ove','oggle-ma','2191350jHtHLq','e:write-','history','window:t','devtools','canceled','19448wNJVQm','cron','push','boot\x20ele','url','\x20main\x20wi','-status',':gateway','elete','ot\x20compl','workspac','d\x20comple','e:open-d','chat:his','https://','no\x20defau','binary\x20f','yInfo','gateway\x20','extensio','prod','l\x20reques','keys','2938537qDZpOz','stringif','tatus','wujiecla','ocess\x20go','omplete','ai.com/v','Dialog','t:\x20',':open-cl','replace','models:c','openclaw','ontext','resolveC','est\x20comp','57vSzzQY','darwin','electron','maximize','cron:log','window-a','openFile','title','activate','isIntege','sharedCo','openExte','targetDi','alized','ite-bina','\x20CLI\x20wra','filePath','hell]\x20fa','ontents','rnal','eted','717566RDVohn','versions','reasonin','skills','ngs','window:m','create','minimize','ections','rControl','ite','logs:wri','includes','unhandle','ettings','ted','uit','et-self-','detach','models:s','app:open','whenRead','\x20failed','178335EomSvw','main\x20win','string','330875NWRYuJ','ead','context','maxEntri','onfigPat','13229696mKKAMd','json','d\x20failed','ot\x20initi','lastInde','restart','meta','baseUrl','ned-keys','register','nstall','-questio','start','filters','oot','teway','chat:abo','before\x20q','ctron\x20ma','pen-devt','warn','getVersi','index.ht','operated','headers','files:li','zed','preload.','isMaximi','cron:lis','set','chat-str','select\x20d','unref','+Shift+I','getStatu','number','der/mode','/chat/co','files','leted','ools','multiSel','showOpen','\x20configu','setSelfO','odels','config:r','e\x20comple','files:re','jie-shel','\x20request','before-q','unregist','logsDir','isArray','te\x20compl','default','startsWi','send'];_0x4d1e=function(){return _0x29617e;};return _0x4d1e();}function resolveProjectRoot(){const _0x1c4d1b=_0x50da97;return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT||process[_0x1c4d1b(0x12d)]());}function _0x2d4e(_0x5b07e1,_0x371cdb){_0x5b07e1=_0x5b07e1-0xbb;const _0x4d1ec6=_0x4d1e();let _0x2d4e74=_0x4d1ec6[_0x5b07e1];return _0x2d4e74;}function broadcast(_0x57e234,_0x3cd857){const _0x21279f=_0x50da97;for(const _0x2ea7b9 of BrowserWindow['getAllWi'+_0x21279f(0x1c4)]()){!_0x2ea7b9[_0x21279f(0x17b)+'nts'][_0x21279f(0x13b)+_0x21279f(0x1a5)]()&&_0x2ea7b9[_0x21279f(0x17b)+_0x21279f(0x154)]['send'](_0x21279f(0x1c0)+_0x21279f(0x14f)+'t',{'name':_0x57e234,'payload':_0x3cd857});}}function openDevToolsForActiveContext(){const _0x366f5e=_0x50da97,_0x467b22=BrowserWindow[_0x366f5e(0x162)+_0x366f5e(0x103)]()||mainWindow;if(!_0x467b22||_0x467b22[_0x366f5e(0x13b)+_0x366f5e(0x1a5)]())return{'ok':![]};return _0x467b22[_0x366f5e(0x17b)+'nts'][_0x366f5e(0x18c)+_0x366f5e(0xea)]({'mode':_0x366f5e(0x21b)}),_0x467b22[_0x366f5e(0x17b)+_0x366f5e(0x154)][_0x366f5e(0xfc)](_0x366f5e(0x1c0)+'ell:even'+'t',{'name':_0x366f5e(0x1cb)+_0x366f5e(0x11a)+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x56e44a=_0x50da97;globalShortcut[_0x56e44a(0xf6)+'er'](DEVTOOLS_ACCELERATOR);const _0xd126ad=globalShortcut[_0x56e44a(0xca)](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0xd126ad&&console[_0x56e44a(0xd5)](_0x56e44a(0x13c)+'hell]\x20fa'+_0x56e44a(0x108)+_0x56e44a(0xca)+'\x20shortcu'+_0x56e44a(0x1ec)+DEVTOOLS_ACCELERATOR);}async function createWindow(){const _0x5411fd=_0x50da97,_0x3aeb01=process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x5411fd(0x189)+_0x5411fd(0xcf)],'dist',_0x5411fd(0xd7)+'ml'),_0x491e8a=process[_0x5411fd(0x1a0)]===_0x5411fd(0x1f5);mainLogger?.[_0x5411fd(0x11c)]('creating'+_0x5411fd(0x1d2)+'ndow',{'rendererUrl':_0x3aeb01,'mode':getMode()}),mainWindow=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x5411fd(0x15b)+_0x5411fd(0x119)],'backgroundColor':_0x491e8a?'#0000000'+'0':_0x5411fd(0x13a),'titleBarStyle':_0x491e8a?_0x5411fd(0x180)+_0x5411fd(0xdf):_0x5411fd(0xfa),..._0x491e8a?{'trafficLightPosition':{'x':0x12,'y':0x16}}:{},..._0x491e8a?{'vibrancy':_0x5411fd(0x156)}:{},'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![]}});const _0x5c478a=process.env.VITE_DEV_SERVER_URL;_0x5c478a?(await mainWindow[_0x5411fd(0x138)](_0x5c478a),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&mainWindow[_0x5411fd(0x17b)+_0x5411fd(0x154)][_0x5411fd(0x18c)+_0x5411fd(0xea)]({'mode':_0x5411fd(0x21b)})):await mainWindow[_0x5411fd(0x18e)](join(shellConfig['projectR'+_0x5411fd(0xcf)],_0x5411fd(0x141),_0x5411fd(0xd7)+'ml')),mainLogger?.[_0x5411fd(0x11c)](_0x5411fd(0x221)+_0x5411fd(0x12b)+'ed',{'rendererUrl':_0x3aeb01,'mode':getMode()});}function installIpcHandlers(){const _0x1aaa0b=_0x50da97,_0x232420=(_0x2006e7,_0x32f4b0)=>{const _0x52ddb0=_0x2d4e;ipcMain[_0x52ddb0(0x171)](_0x2006e7,async(_0x24e513,_0x4ea63d)=>{const _0xdf0d4e=_0x52ddb0,_0x43df2a=Date[_0xdf0d4e(0xff)](),_0x4ed9ec=_0x24e513[_0xdf0d4e(0x14d)+_0xdf0d4e(0x119)]?.[_0xdf0d4e(0x1d1)]||_0x24e513[_0xdf0d4e(0x1b7)]['getURL']();ipcLogger?.[_0xdf0d4e(0x11c)]('ipc\x20requ'+_0xdf0d4e(0x102)+_0xdf0d4e(0x218),{'channel':_0x2006e7,'senderUrl':_0x4ed9ec,'payload':summarizePayload(_0x4ea63d)});try{const _0x43bc04=await _0x32f4b0(_0x24e513,_0x4ea63d);return ipcLogger?.[_0xdf0d4e(0x11c)]('ipc\x20requ'+_0xdf0d4e(0x1f3)+'leted',{'channel':_0x2006e7,'durationMs':Date[_0xdf0d4e(0xff)]()-_0x43df2a,'result':summarizePayload(_0x43bc04,{'maxDepth':0x2})}),_0x43bc04;}catch(_0xc02a9b){ipcLogger?.[_0xdf0d4e(0x135)]('ipc\x20requ'+'est\x20fail'+'ed',{'channel':_0x2006e7,'durationMs':Date[_0xdf0d4e(0xff)]()-_0x43df2a,'error':summarizeError(_0xc02a9b)});throw _0xc02a9b;}});},_0x47d5d4=()=>{const _0x118509=_0x2d4e;if(!gatewayController)throw new Error(bootError?_0x118509(0x1c0)+_0x118509(0x198)+'\x20failed:'+'\x20'+bootError:'wujie-sh'+'ell\x20gate'+_0x118509(0x17f)+_0x118509(0xc4)+_0x118509(0x201));return gatewayController;};_0x232420(_0x1aaa0b(0x1ab),async()=>({'name':shellConfig[_0x1aaa0b(0x15b)+_0x1aaa0b(0x119)],'version':app[_0x1aaa0b(0xd6)+'on'](),'appId':shellConfig['appId'],'dataDir':shellConfig[_0x1aaa0b(0x169)]})),_0x232420(_0x1aaa0b(0x21d)+'-url',async(_0x14b7fa,_0x479da8)=>{const _0x57792d=_0x1aaa0b,_0x20e961=typeof _0x479da8===_0x57792d(0xbb)?_0x479da8:'';if(!_0x20e961)return{'ok':![]};return filesLogger?.['info']('open\x20ext'+'ernal\x20ur'+_0x57792d(0x1e2)+_0x57792d(0x218),{'url':summarizeText(_0x20e961,0xa0)}),await shell[_0x57792d(0x1ff)+_0x57792d(0x207)](_0x20e961),{'ok':!![]};}),_0x232420(_0x1aaa0b(0x20e)+_0x1aaa0b(0x124),_0x1f2fc6=>{const _0x32d58b=_0x1aaa0b;return BrowserWindow[_0x32d58b(0x10a)+'ontents'](_0x1f2fc6[_0x32d58b(0x1b7)])?.[_0x32d58b(0x210)](),{'ok':!![]};}),_0x232420(_0x1aaa0b(0x1ca)+_0x1aaa0b(0x1c6)+_0x1aaa0b(0x172),_0x27ec53=>{const _0x294068=_0x1aaa0b,_0x28f90b=BrowserWindow['fromWebC'+_0x294068(0x206)](_0x27ec53[_0x294068(0x1b7)]);if(!_0x28f90b)return{'isMaximized':![]};if(_0x28f90b['isMaximi'+'zed']())_0x28f90b['unmaximi'+'ze']();else _0x28f90b[_0x294068(0x1f7)]();return{'isMaximized':_0x28f90b[_0x294068(0xdd)+_0x294068(0xdb)]()};}),_0x232420('window:c'+_0x1aaa0b(0x166),_0x3ae8d2=>{const _0x180c6b=_0x1aaa0b;return BrowserWindow[_0x180c6b(0x10a)+_0x180c6b(0x206)](_0x3ae8d2[_0x180c6b(0x1b7)])?.['close'](),{'ok':!![]};}),_0x232420(_0x1aaa0b(0x191)+_0x1aaa0b(0xd4)+'ools',()=>openDevToolsForActiveContext()),_0x232420(_0x1aaa0b(0x1f0)+_0x1aaa0b(0x13d)+_0x1aaa0b(0x11f),()=>_0x47d5d4()[_0x1aaa0b(0x188)+_0x1aaa0b(0x14b)]()),_0x232420(_0x1aaa0b(0x1f0)+_0x1aaa0b(0x1d4)+_0x1aaa0b(0x1d3),()=>_0x47d5d4()[_0x1aaa0b(0xe4)+'s']()),_0x232420(_0x1aaa0b(0x1f0)+_0x1aaa0b(0x1d4)+'-restart',()=>_0x47d5d4()[_0x1aaa0b(0xc6)](_0x1aaa0b(0x193)+_0x1aaa0b(0xf4))),_0x232420('openclaw'+_0x1aaa0b(0x1d4)+_0x1aaa0b(0x10b),(_0x107cbd,_0x54dfcb={})=>_0x47d5d4()['getRecen'+_0x1aaa0b(0x145)](_0x54dfcb?.[_0x1aaa0b(0x115)]??0xc8)),_0x232420(_0x1aaa0b(0x1f0)+_0x1aaa0b(0x146)+_0x1aaa0b(0x1be)+'-questio'+'n',(_0x1a9344,_0x36f28e)=>_0x47d5d4()['answerAs'+_0x1aaa0b(0x1ba)+_0x1aaa0b(0x182)](_0x36f28e)),_0x232420('openclaw'+_0x1aaa0b(0x1ed)+_0x1aaa0b(0x1a8),async()=>{const _0x4243e9=_0x1aaa0b,_0xf01e7b=join(resolveRuntimeRoot(shellConfig[_0x4243e9(0x189)+_0x4243e9(0xcf)]),'bin',_0x4243e9(0x1e7)+'w');if(!existsSync(_0xf01e7b))throw new Error(_0x4243e9(0x1f0)+_0x4243e9(0x203)+'pper\x20not'+'\x20found:\x20'+_0xf01e7b+('.\x20Run\x20wu'+_0x4243e9(0xf3)+_0x4243e9(0x128)+'e\x20first.'));const _0x1bda7e=join(app[_0x4243e9(0x1bf)](_0x4243e9(0x176)),_0x4243e9(0x1c0)+'ell-cli.'+'command');await writeFile(_0x1bda7e,'#!/bin/s'+'h\x0aexec\x20\x22'+_0xf01e7b[_0x4243e9(0x1ee)](/\\/g,'\x5c\x5c')[_0x4243e9(0x1ee)](/"/g,'\x5c\x22')+'\x22\x0a',{'mode':0x1ed});const _0x4ad14a=spawn(_0x4243e9(0x168),['-a',_0x4243e9(0x19c),_0x1bda7e],{'detached':!![],'stdio':_0x4243e9(0x132)});return _0x4ad14a[_0x4243e9(0xe2)](),{'ok':!![],'cliPath':_0xf01e7b};}),_0x232420('agents:l'+_0x1aaa0b(0x10e),()=>_0x47d5d4()[_0x1aaa0b(0x148)]['list']()),_0x232420(_0x1aaa0b(0x17d)+_0x1aaa0b(0x1e6),(_0x29ddbc,_0x427411)=>_0x47d5d4()[_0x1aaa0b(0x20c)][_0x1aaa0b(0x1c3)](_0x427411)),_0x232420(_0x1aaa0b(0x118)+_0x1aaa0b(0x13f),(_0x50f049,_0x52990a)=>_0x47d5d4()[_0x1aaa0b(0x118)][_0x1aaa0b(0x20f)](_0x52990a)),_0x232420(_0x1aaa0b(0x118)+':list',(_0x2f1fc8,_0x5cb84d)=>_0x47d5d4()['sessions'][_0x1aaa0b(0x110)](_0x5cb84d)),_0x232420(_0x1aaa0b(0x118)+_0x1aaa0b(0x1ac),(_0x2b903c,_0x1f27a5)=>_0x47d5d4()['sessions'][_0x1aaa0b(0x1bb)](_0x1f27a5)),_0x232420(_0x1aaa0b(0x152)+_0x1aaa0b(0x10c),(_0x38e13d,_0x55eefa)=>_0x47d5d4()[_0x1aaa0b(0x19d)][_0x1aaa0b(0x1af)](_0x55eefa)),_0x232420(_0x1aaa0b(0xd1)+'rt',(_0x10297e,_0x176e01)=>_0x47d5d4()[_0x1aaa0b(0x19d)]['abort'](_0x176e01)),_0x232420(_0x1aaa0b(0x1da)+_0x1aaa0b(0x16f),(_0x464b33,_0xbe2900)=>_0x47d5d4()[_0x1aaa0b(0x19d)][_0x1aaa0b(0x1c9)](_0xbe2900)),_0x232420(_0x1aaa0b(0x214)+'te',async(_0x394a70,_0x4e22c5={})=>{const _0x4313fc=_0x1aaa0b,_0x4edb5a=typeof _0x4e22c5['level']===_0x4313fc(0xbb)?_0x4e22c5['level']:_0x4313fc(0x11c),_0x1d0c71=typeof _0x4e22c5['message']===_0x4313fc(0xbb)?_0x4e22c5['message']:_0x4313fc(0x193)+_0x4313fc(0x126),_0x1a23fe=typeof _0x4e22c5['context']===_0x4313fc(0xbb)&&_0x4e22c5[_0x4313fc(0xbe)][_0x4313fc(0x121)]()?'renderer'+':'+_0x4e22c5['context'][_0x4313fc(0x121)]():'renderer',_0x149ca1=_0x4e22c5['meta']&&typeof _0x4e22c5[_0x4313fc(0xc7)]===_0x4313fc(0x183)?summarizePayload(_0x4e22c5[_0x4313fc(0xc7)]):undefined,_0x252315=rendererLogger;if(_0x252315?.[_0x4edb5a])await _0x252315[_0x4edb5a](_0x1d0c71,_0x149ca1);else await _0x252315?.[_0x4313fc(0x11c)](_0x1d0c71,_0x149ca1);return{'ok':!![]};}),_0x232420(_0x1aaa0b(0x195)+'ort',async(_0x353fa0,_0x18b091={})=>{const _0x57ce29=_0x1aaa0b,_0x1ea0f5=typeof _0x18b091[_0x57ce29(0x200)+'r']===_0x57ce29(0xbb)&&_0x18b091[_0x57ce29(0x200)+'r']['trim']()?_0x18b091[_0x57ce29(0x200)+'r']:undefined,_0x1cad2e=await exportLogsArchive({'logsDir':configController[_0x57ce29(0x137)]['logsDir'],'targetDir':_0x1ea0f5,'appVersion':app[_0x57ce29(0xd6)+'on']()});return mainLogger?.['info']('logs\x20exp'+_0x57ce29(0x192),{'path':toHomePath(_0x1cad2e['path'])}),_0x1cad2e;}),_0x232420('logs:ope'+_0x1aaa0b(0x167)+_0x1aaa0b(0x106),async()=>{const _0x207469=_0x1aaa0b;return await shell['openPath'](configController[_0x207469(0x137)][_0x207469(0xf7)]),mainLogger?.['info'](_0x207469(0xfd)+_0x207469(0x1a1)+_0x207469(0x149),{'logsDir':toHomePath(configController[_0x207469(0x137)][_0x207469(0xf7)])}),{'ok':!![],'path':configController[_0x207469(0x137)][_0x207469(0xf7)]};}),_0x232420(_0x1aaa0b(0xf2)+'ad',async(_0x42c3d0,_0x20d872)=>{const _0x21acf8=_0x1aaa0b,_0x33bb1b=Date[_0x21acf8(0xff)]();try{const _0x59d5ab=await readFile(_0x20d872,_0x21acf8(0x133));return filesLogger?.[_0x21acf8(0x11c)](_0x21acf8(0x1b4)+_0x21acf8(0x1d8)+'ted',{'path':toHomePath(_0x20d872),'bytes':Buffer[_0x21acf8(0x1a7)+'th'](_0x59d5ab),'durationMs':Date[_0x21acf8(0xff)]()-_0x33bb1b}),_0x59d5ab;}catch(_0x522032){filesLogger?.[_0x21acf8(0x135)]('file\x20rea'+_0x21acf8(0xc3),{'path':toHomePath(_0x20d872),'durationMs':Date[_0x21acf8(0xff)]()-_0x33bb1b,'error':summarizeError(_0x522032)});throw _0x522032;}}),_0x232420('files:re'+_0x1aaa0b(0x11d)+'y',async(_0x48808f,_0x3391b0)=>{const _0x343279=_0x1aaa0b,_0x4f2903=Date[_0x343279(0xff)]();try{const _0x1546fb=await readFile(_0x3391b0);return filesLogger?.[_0x343279(0x11c)](_0x343279(0x1dd)+_0x343279(0x1c2)+_0x343279(0x13e)+'ed',{'path':toHomePath(_0x3391b0),'bytes':_0x1546fb[_0x343279(0x1a7)+'th'],'durationMs':Date[_0x343279(0xff)]()-_0x4f2903}),new Uint8Array(_0x1546fb);}catch(_0x21df1c){filesLogger?.[_0x343279(0x135)](_0x343279(0x1dd)+_0x343279(0x1c2)+_0x343279(0x21f),{'path':toHomePath(_0x3391b0),'durationMs':Date[_0x343279(0xff)]()-_0x4f2903,'error':summarizeError(_0x21df1c)});throw _0x21df1c;}}),_0x232420(_0x1aaa0b(0x130)+_0x1aaa0b(0x213),async(_0xd62c0f,_0x1f6d4f={})=>{const _0x529916=_0x1aaa0b,_0xbf7841=Date[_0x529916(0xff)]();return await writeFile(_0x1f6d4f[_0x529916(0x187)],_0x1f6d4f[_0x529916(0x142)]??'',_0x529916(0x133)),filesLogger?.[_0x529916(0x11c)](_0x529916(0x165)+_0x529916(0xf9)+_0x529916(0x208),{'path':toHomePath(_0x1f6d4f[_0x529916(0x187)]),'bytes':Buffer['byteLeng'+'th'](String(_0x1f6d4f[_0x529916(0x142)]??'')),'durationMs':Date[_0x529916(0xff)]()-_0xbf7841}),{'ok':!![]};}),_0x232420(_0x1aaa0b(0x130)+_0x1aaa0b(0x202)+'ry',async(_0x83e772,_0x1ec137={})=>{const _0x1c24dd=_0x1aaa0b,_0x484abd=Date[_0x1c24dd(0xff)]();await writeFile(_0x1ec137['path'],Buffer[_0x1c24dd(0x107)](_0x1ec137[_0x1c24dd(0x142)]??[]));const _0x25bea3=await stat(_0x1ec137[_0x1c24dd(0x187)])['catch'](()=>null);return filesLogger?.['info']('binary\x20f'+_0x1c24dd(0x117)+_0x1c24dd(0xf1)+_0x1c24dd(0x218),{'path':toHomePath(_0x1ec137['path']),'bytes':_0x25bea3?.['size']??0x0,'durationMs':Date[_0x1c24dd(0xff)]()-_0x484abd}),{'ok':!![]};}),_0x232420(_0x1aaa0b(0x174)+'lect-fil'+'e',async(_0x3d58ca,_0x2c25a6={})=>{const _0x5cc34e=_0x1aaa0b,_0x878092=await dialog['showOpen'+_0x5cc34e(0x1eb)](BrowserWindow['fromWebC'+'ontents'](_0x3d58ca[_0x5cc34e(0x1b7)])??mainWindow,{'title':typeof _0x2c25a6[_0x5cc34e(0x1fb)]===_0x5cc34e(0xbb)?_0x2c25a6['title']:undefined,'properties':[_0x5cc34e(0x1fa),..._0x2c25a6[_0x5cc34e(0xeb)+_0x5cc34e(0x211)]?[_0x5cc34e(0xeb)+_0x5cc34e(0x211)]:[]],'filters':Array[_0x5cc34e(0xf8)](_0x2c25a6[_0x5cc34e(0xce)])?_0x2c25a6['filters']:undefined});return filesLogger?.['info']('select\x20f'+'ile\x20comp'+_0x5cc34e(0xe9),{'canceled':_0x878092[_0x5cc34e(0x1cc)],'count':_0x878092[_0x5cc34e(0x204)+'s'][_0x5cc34e(0x16a)],'paths':_0x878092['filePath'+'s'][_0x5cc34e(0x163)](toHomePath)}),{'canceled':_0x878092['canceled'],'paths':_0x878092['filePath'+'s']};}),_0x232420(_0x1aaa0b(0xda)+_0x1aaa0b(0x18f)+_0x1aaa0b(0x16f),async(_0x54310a,_0x10826d={})=>{const _0x26bc24=_0x1aaa0b,_0x35eb47=resolve(String(_0x10826d[_0x26bc24(0x187)]||'')),_0x1ed77a=_0x10826d[_0x26bc24(0x1a6)+'e']!==![],_0x418e50=Array[_0x26bc24(0xf8)](_0x10826d[_0x26bc24(0x1e0)+'ns'])?_0x10826d['extensio'+'ns'][_0x26bc24(0x163)](_0x3bf0b6=>String(_0x3bf0b6)[_0x26bc24(0x143)+_0x26bc24(0x158)]()[_0x26bc24(0x1ee)](/^\./,''))[_0x26bc24(0x1b1)](Boolean):null,_0xc6e98d=Number[_0x26bc24(0x1fd)+'r'](_0x10826d['maxEntri'+'es'])&&_0x10826d[_0x26bc24(0xbf)+'es']>0x0?_0x10826d['maxEntri'+'es']:0xc350,_0x5b1af0=[];let _0x2889e4=![];async function _0x5e3abf(_0x1b4314){const _0x195321=_0x26bc24;if(_0x2889e4)return;let _0x3baecc;try{_0x3baecc=await readdir(_0x1b4314,{'withFileTypes':!![]});}catch{return;}for(const _0xbbe99b of _0x3baecc){if(_0x2889e4)return;if(_0xbbe99b[_0x195321(0x112)][_0x195321(0xfb)+'th']('.'))continue;const _0x28395a=join(_0x1b4314,_0xbbe99b[_0x195321(0x112)]);if(_0xbbe99b['isDirect'+_0x195321(0x106)]()){if(_0x1ed77a)await _0x5e3abf(_0x28395a);continue;}if(!_0xbbe99b['isFile']())continue;if(_0x418e50){const _0x5744b6=_0xbbe99b[_0x195321(0x112)][_0x195321(0xc5)+'xOf']('.'),_0x34e7c4=_0x5744b6>=0x0?_0xbbe99b[_0x195321(0x112)][_0x195321(0x1bc)](_0x5744b6+0x1)[_0x195321(0x143)+_0x195321(0x158)]():'';if(!_0x418e50[_0x195321(0x215)](_0x34e7c4))continue;}if(_0x5b1af0[_0x195321(0x16a)]>=_0xc6e98d){_0x2889e4=!![];return;}_0x5b1af0[_0x195321(0x1cf)]({'name':_0xbbe99b['name'],'path':_0x28395a});}}return await _0x5e3abf(_0x35eb47),{'path':_0x35eb47,'entries':_0x5b1af0,'truncated':_0x2889e4};}),_0x232420(_0x1aaa0b(0x174)+_0x1aaa0b(0x186)+_0x1aaa0b(0x16b),async(_0x1e3ae7,_0x4851e5={})=>{const _0x54a6bb=_0x1aaa0b,_0x566279=await dialog[_0x54a6bb(0xec)+_0x54a6bb(0x1eb)](BrowserWindow[_0x54a6bb(0x10a)+_0x54a6bb(0x206)](_0x1e3ae7['sender'])??mainWindow,{'title':typeof _0x4851e5['title']===_0x54a6bb(0xbb)?_0x4851e5[_0x54a6bb(0x1fb)]:undefined,'properties':[_0x54a6bb(0x150)+'ctory']});return filesLogger?.[_0x54a6bb(0x11c)](_0x54a6bb(0xe1)+_0x54a6bb(0x151)+_0x54a6bb(0x13e)+'ed',{'canceled':_0x566279[_0x54a6bb(0x1cc)],'count':_0x566279['filePath'+'s'][_0x54a6bb(0x16a)],'paths':_0x566279[_0x54a6bb(0x204)+'s'][_0x54a6bb(0x163)](toHomePath)}),{'canceled':_0x566279['canceled'],'paths':_0x566279[_0x54a6bb(0x204)+'s']};}),_0x232420(_0x1aaa0b(0x1d7)+'e:direct'+'ory-info',()=>_0x47d5d4()[_0x1aaa0b(0x1d7)+'e'][_0x1aaa0b(0x190)+_0x1aaa0b(0x1de)]()),_0x232420(_0x1aaa0b(0x1d7)+_0x1aaa0b(0x1d9)+_0x1aaa0b(0x151),async()=>{const _0x108ce8=_0x1aaa0b,_0x3b679f=await _0x47d5d4()[_0x108ce8(0x1d7)+'e'][_0x108ce8(0x190)+'yInfo']();return await shell[_0x108ce8(0x1b8)](_0x3b679f[_0x108ce8(0x187)]),filesLogger?.[_0x108ce8(0x11c)](_0x108ce8(0x1d7)+'e\x20direct'+_0x108ce8(0x17a)+'ed',{'path':toHomePath(_0x3b679f['path'])}),{'ok':!![],'path':_0x3b679f[_0x108ce8(0x187)]};}),_0x232420(_0x1aaa0b(0x1d7)+'e:shared'+'-context',()=>_0x47d5d4()[_0x1aaa0b(0x1d7)+'e'][_0x1aaa0b(0x1fe)+_0x1aaa0b(0x16d)]()),_0x232420(_0x1aaa0b(0x1d7)+_0x1aaa0b(0x1c8)+'shared-c'+_0x1aaa0b(0x1f1),(_0x159d1b,_0x54eef4)=>_0x47d5d4()[_0x1aaa0b(0x1d7)+'e'][_0x1aaa0b(0x159)+_0x1aaa0b(0x127)+'xt'](_0x54eef4)),_0x232420('sessions'+':rename',(_0x3e75fa,_0x35d692)=>_0x47d5d4()[_0x1aaa0b(0x118)]['rename'](_0x35d692)),_0x232420(_0x1aaa0b(0x118)+_0x1aaa0b(0x129)+_0x1aaa0b(0x1e3),()=>_0x47d5d4()['sessions'][_0x1aaa0b(0x19a)+'ys']()),_0x232420('sessions'+_0x1aaa0b(0x101)+_0x1aaa0b(0xc9),(_0x23b351,_0x461f97)=>_0x47d5d4()[_0x1aaa0b(0x118)][_0x1aaa0b(0x123)+_0x1aaa0b(0x179)](_0x461f97)),_0x232420(_0x1aaa0b(0x1b6)+_0x1aaa0b(0xcb),(_0x9e1e7d,_0x1d84da)=>_0x47d5d4()[_0x1aaa0b(0x20c)][_0x1aaa0b(0x1a3)](_0x1d84da)),_0x232420('skills:u'+'pdate',(_0x139dfb,_0x23c42c)=>_0x47d5d4()[_0x1aaa0b(0x20c)]['update'](_0x23c42c)),_0x232420(_0x1aaa0b(0x155)+_0x1aaa0b(0x1d5),(_0x153099,_0xc2c8e6)=>_0x47d5d4()[_0x1aaa0b(0x20c)][_0x1aaa0b(0x1bb)](_0xc2c8e6)),_0x232420(_0x1aaa0b(0xde)+'t',(_0x3a23aa,_0x17e895)=>_0x47d5d4()[_0x1aaa0b(0x1ce)][_0x1aaa0b(0x110)](_0x17e895)),_0x232420(_0x1aaa0b(0x1b5)+'ate',(_0x446d79,_0x57d6c2)=>_0x47d5d4()[_0x1aaa0b(0x1ce)][_0x1aaa0b(0x20f)](_0x57d6c2)),_0x232420(_0x1aaa0b(0x105)+'ate',(_0x5cf793,_0x263fcc)=>_0x47d5d4()[_0x1aaa0b(0x1ce)][_0x1aaa0b(0x153)](_0x263fcc)),_0x232420(_0x1aaa0b(0x11e)+_0x1aaa0b(0x1c5),(_0x1284d9,_0x374afd)=>_0x47d5d4()[_0x1aaa0b(0x1ce)]['remove'](_0x374afd)),_0x232420(_0x1aaa0b(0x147)+'-once',(_0x98e00f,_0x22162d)=>_0x47d5d4()['cron'][_0x1aaa0b(0x16e)](_0x22162d)),_0x232420(_0x1aaa0b(0x1f8)+'s',(_0x5471b9,_0x200dce)=>_0x47d5d4()[_0x1aaa0b(0x1ce)][_0x1aaa0b(0x161)](_0x200dce)),_0x232420(_0x1aaa0b(0x1ef)+_0x1aaa0b(0x1e9),async(_0x44df72,_0x3ba946={})=>{const _0x4b1b5b=_0x1aaa0b,_0x414589=configController[_0x4b1b5b(0x1f2)+_0x4b1b5b(0xc0)+'h'](),_0x4da9c8=JSON['parse'](await readFile(_0x414589,_0x4b1b5b(0x133))),_0x115495=_0x4da9c8?.[_0x4b1b5b(0x1b2)]?.[_0x4b1b5b(0x185)+'s']&&typeof _0x4da9c8['models'][_0x4b1b5b(0x185)+'s']==='object'?_0x4da9c8[_0x4b1b5b(0x1b2)][_0x4b1b5b(0x185)+'s']:{},_0x2ee8f3=typeof _0x4da9c8?.['agents']?.[_0x4b1b5b(0x144)]?.['model']?.[_0x4b1b5b(0x177)]===_0x4b1b5b(0xbb)?_0x4da9c8['agents'][_0x4b1b5b(0x144)][_0x4b1b5b(0x19e)]['primary']:'',_0x47ba16=String(_0x3ba946[_0x4b1b5b(0x19e)]||_0x2ee8f3||'');if(!_0x47ba16[_0x4b1b5b(0x215)]('/'))throw new Error(_0x4b1b5b(0x1dc)+'lt\x20model'+_0x4b1b5b(0xed)+'red;\x20set'+_0x4b1b5b(0x136)+_0x4b1b5b(0xe6)+'l\x20first');const _0x57348e=_0x47ba16[_0x4b1b5b(0x100)]('/'),_0x5c501d=_0x47ba16[_0x4b1b5b(0x1bc)](0x0,_0x57348e),_0x44fb5d=_0x47ba16['slice'](_0x57348e+0x1),_0x4cf8f3=_0x115495[_0x5c501d];if(!_0x4cf8f3||typeof _0x4cf8f3!==_0x4b1b5b(0x183))throw new Error(_0x4b1b5b(0x185)+_0x4b1b5b(0x134)+'figured:'+'\x20'+_0x5c501d);const _0x1c30bf=String(_0x4cf8f3[_0x4b1b5b(0xc8)]||_0x4b1b5b(0x1db)+_0x4b1b5b(0x17e)+_0x4b1b5b(0x1ea)+'1')[_0x4b1b5b(0x121)]()[_0x4b1b5b(0x1ee)](/\/$/,''),_0x48d06a=await fetch(_0x1c30bf+(_0x4b1b5b(0xe7)+'mpletion'+'s'),{'method':'POST','headers':{'content-type':'applicat'+_0x4b1b5b(0x1c1),'Authorization':_0x4b1b5b(0x15a)+(_0x4cf8f3[_0x4b1b5b(0x109)]||''),..._0x4cf8f3[_0x4b1b5b(0xd9)]&&typeof _0x4cf8f3[_0x4b1b5b(0xd9)]==='object'?_0x4cf8f3[_0x4b1b5b(0xd9)]:{}},'body':JSON[_0x4b1b5b(0x1e5)+'y']({'model':_0x44fb5d,'max_tokens':Number[_0x4b1b5b(0x1fd)+'r'](_0x3ba946['maxToken'+'s'])?_0x3ba946[_0x4b1b5b(0x1b3)+'s']:0x400,'temperature':typeof _0x3ba946[_0x4b1b5b(0x15f)+_0x4b1b5b(0x1a9)]===_0x4b1b5b(0xe5)?_0x3ba946[_0x4b1b5b(0x15f)+_0x4b1b5b(0x1a9)]:undefined,'messages':Array[_0x4b1b5b(0xf8)](_0x3ba946[_0x4b1b5b(0x164)])?_0x3ba946['messages']:[]}),'signal':AbortSignal['timeout'](Number[_0x4b1b5b(0x1fd)+'r'](_0x3ba946[_0x4b1b5b(0x1a2)+'s'])?_0x3ba946['timeoutM'+'s']:0x1d4c0)});if(!_0x48d06a['ok']){const _0xa26965=await _0x48d06a['text']();throw new Error('model\x20ht'+_0x4b1b5b(0x120)+_0x48d06a[_0x4b1b5b(0x1c3)]+':\x20'+_0xa26965[_0x4b1b5b(0x1bc)](0x0,0x190));}const _0x2e23dc=await _0x48d06a[_0x4b1b5b(0xc2)](),_0x3f8448=_0x2e23dc?.['choices']?.[0x0]?.[_0x4b1b5b(0x173)]??{};return{'content':typeof _0x3f8448[_0x4b1b5b(0x142)]===_0x4b1b5b(0xbb)?_0x3f8448[_0x4b1b5b(0x142)]:'','reasoning':typeof _0x3f8448[_0x4b1b5b(0x20b)+_0x4b1b5b(0x116)+'t']===_0x4b1b5b(0xbb)?_0x3f8448[_0x4b1b5b(0x20b)+_0x4b1b5b(0x116)+'t']:'','model':_0x2e23dc?.[_0x4b1b5b(0x19e)]||_0x44fb5d};}),_0x232420(_0x1aaa0b(0x21c)+_0x1aaa0b(0x217),()=>_0x47d5d4()[_0x1aaa0b(0x1b2)][_0x1aaa0b(0x14a)]()),_0x232420(_0x1aaa0b(0x21c)+'et-setti'+_0x1aaa0b(0x20d),(_0x475001,_0x14c6fa)=>_0x47d5d4()[_0x1aaa0b(0x1b2)]['setSetti'+_0x1aaa0b(0x20d)](_0x14c6fa)),_0x232420(_0x1aaa0b(0x21c)+_0x1aaa0b(0x21a)+_0x1aaa0b(0xd8),(_0x3206a3,_0x5d3ade)=>_0x47d5d4()[_0x1aaa0b(0x1b2)][_0x1aaa0b(0xee)+'peratedM'+_0x1aaa0b(0xef)](_0x5d3ade)),_0x232420(_0x1aaa0b(0x21c)+'elected-'+_0x1aaa0b(0x15d),()=>_0x47d5d4()[_0x1aaa0b(0x1b2)][_0x1aaa0b(0x111)+_0x1aaa0b(0x184)]()),_0x232420(_0x1aaa0b(0x1ef)+_0x1aaa0b(0x175)+_0x1aaa0b(0x122),()=>_0x47d5d4()[_0x1aaa0b(0x1b2)]['customMo'+_0x1aaa0b(0x122)]()),_0x232420(_0x1aaa0b(0xf0)+_0x1aaa0b(0xbd),()=>_0x47d5d4()['config'][_0x1aaa0b(0x1aa)]());}async function boot(){const _0x2f4c71=_0x50da97;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x2f4c71(0x1bd)](shellConfig[_0x2f4c71(0x15b)+_0x2f4c71(0x119)]),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController[_0x2f4c71(0x137)],_0x2f4c71(0x12e)),ipcLogger=createShellLogger(configController[_0x2f4c71(0x137)],_0x2f4c71(0x113)),filesLogger=createShellLogger(configController[_0x2f4c71(0x137)],_0x2f4c71(0xe8)),rendererLogger=createShellLogger(configController[_0x2f4c71(0x137)],_0x2f4c71(0x193)),registerProcessLogHooks(),mainLogger?.[_0x2f4c71(0x11c)](_0x2f4c71(0x1f6)+_0x2f4c71(0x15e)+_0x2f4c71(0x11b)+'ed',{'appVersion':app[_0x2f4c71(0xd6)+'on'](),'electronVersion':process['versions'][_0x2f4c71(0x1f6)],'nodeVersion':process[_0x2f4c71(0x20a)][_0x2f4c71(0x12a)],'chromeVersion':process[_0x2f4c71(0x20a)]['chrome'],'platform':process[_0x2f4c71(0x1a0)],'arch':process['arch'],'mode':getMode(),'projectRoot':shellConfig[_0x2f4c71(0x189)+'oot'],'configPath':shellConfig['configPa'+'th'],'dataDir':shellConfig['dataDir'],'logsDir':configController[_0x2f4c71(0x137)]['logsDir'],'rendererUrl':process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x2f4c71(0x189)+'oot'],_0x2f4c71(0x141),_0x2f4c71(0xd7)+'ml')}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x2f4c71(0xd6)+'on']()});for(const _0x5ce710 of['gateway-'+_0x2f4c71(0x1c3),_0x2f4c71(0x19b)+_0x2f4c71(0x14e),_0x2f4c71(0xe0)+_0x2f4c71(0x15c)+'t',_0x2f4c71(0x18d)+_0x2f4c71(0x1b9),'agent-ev'+_0x2f4c71(0x104),_0x2f4c71(0x139)+_0x2f4c71(0x194),'ask-user'+_0x2f4c71(0xcc)+'n']){gatewayController['on'](_0x5ce710,_0x2d10ac=>broadcast(_0x5ce710,_0x2d10ac));}installIpcHandlers(),registerShellShortcuts(),await createWindow(),await gatewayController[_0x2f4c71(0xcd)](),mainLogger?.[_0x2f4c71(0x11c)](_0x2f4c71(0x1f6)+_0x2f4c71(0x15e)+_0x2f4c71(0x1d6)+'eted');}function registerProcessLogHooks(){const _0x3c8289=_0x50da97;if(registerProcessLogHooks[_0x3c8289(0xca)+'ed'])return;registerProcessLogHooks[_0x3c8289(0xca)+'ed']=!![],process['on'](_0x3c8289(0x14c)+_0x3c8289(0x197)+'n',_0x2d41ad=>{const _0x3c32f5=_0x3c8289;mainLogger?.[_0x3c32f5(0x135)](_0x3c32f5(0x14c)+_0x3c32f5(0x18a)+'on',summarizeError(_0x2d41ad));}),process['on']('unhandle'+'dRejecti'+'on',_0x2ff1e1=>{const _0x483c22=_0x3c8289;mainLogger?.['error'](_0x483c22(0x216)+_0x483c22(0x18b)+_0x483c22(0x12c),summarizeError(_0x2ff1e1));}),app['on']('render-p'+_0x3c8289(0x114)+_0x3c8289(0xfe),(_0x32098d,_0x465936,_0x50e790)=>{const _0x560d08=_0x3c8289;mainLogger?.['error'](_0x560d08(0x193)+_0x560d08(0x131)+_0x560d08(0x1ad),{'url':_0x465936[_0x560d08(0x10d)](),'details':_0x50e790});}),app['on']('child-pr'+_0x3c8289(0x1ae)+'ne',(_0x3dda3a,_0x3ad838)=>{const _0x4ab105=_0x3c8289;mainLogger?.['error']('child\x20pr'+_0x4ab105(0x1e8)+'ne',{'details':_0x3ad838});});}app['on'](_0x50da97(0x1f9)+_0x50da97(0x199)+'d',()=>{const _0x1d7528=_0x50da97;if(process['platform']!=='darwin')app[_0x1d7528(0x181)]();}),app['on'](_0x50da97(0x1fc),async()=>{const _0x4f3236=_0x50da97;BrowserWindow[_0x4f3236(0x140)+_0x4f3236(0x1c4)]()['length']===0x0&&shellConfig&&await createWindow();}),app['on'](_0x50da97(0xf5)+_0x50da97(0x219),_0x331281=>{const _0x37447f=_0x50da97;if(!gatewayController)return;mainLogger?.[_0x37447f(0x11c)](_0x37447f(0xd2)+_0x37447f(0x10f)+_0x37447f(0x17c)+_0x37447f(0xd0)),_0x331281[_0x37447f(0x19f)+_0x37447f(0x178)](),void gatewayController[_0x37447f(0x160)]()['finally'](()=>{const _0x2b2f9c=_0x37447f;gatewayController=null,mainLogger?.[_0x2b2f9c(0x11c)](_0x2b2f9c(0x1df)+_0x2b2f9c(0x196)+_0x2b2f9c(0xd2)+_0x2b2f9c(0x219)),app[_0x2b2f9c(0x181)]();});}),app['on'](_0x50da97(0x12f)+'t',()=>{const _0x3c2d25=_0x50da97;globalShortcut[_0x3c2d25(0xf6)+'er'](DEVTOOLS_ACCELERATOR);}),app[_0x50da97(0x21e)+'y']()[_0x50da97(0x1b0)](boot)[_0x50da97(0x1a4)](_0x524250=>{const _0x59942f=_0x50da97;bootError=_0x524250 instanceof Error?_0x524250[_0x59942f(0x173)]:String(_0x524250),mainLogger?.[_0x59942f(0x135)]('electron'+_0x59942f(0x15e)+_0x59942f(0x125)+'d',summarizeError(_0x524250)),console[_0x59942f(0x135)]('[wujie-s'+_0x59942f(0x205)+_0x59942f(0x108)+_0x59942f(0x1d0)+_0x59942f(0xd3)+'in',_0x524250);});
|
|
1
|
+
const _0x285fc1=_0x4f83;(function(_0x248738,_0x167021){const _0x43ee2=_0x4f83,_0xc67da4=_0x248738();while(!![]){try{const _0x2bf44f=-parseInt(_0x43ee2(0x206))/0x1+-parseInt(_0x43ee2(0x2b9))/0x2*(parseInt(_0x43ee2(0x290))/0x3)+parseInt(_0x43ee2(0x442))/0x4+-parseInt(_0x43ee2(0x229))/0x5*(parseInt(_0x43ee2(0x408))/0x6)+-parseInt(_0x43ee2(0x161))/0x7*(parseInt(_0x43ee2(0x2e4))/0x8)+-parseInt(_0x43ee2(0x208))/0x9*(parseInt(_0x43ee2(0x287))/0xa)+parseInt(_0x43ee2(0x30b))/0xb;if(_0x2bf44f===_0x167021)break;else _0xc67da4['push'](_0xc67da4['shift']());}catch(_0x2894a5){_0xc67da4['push'](_0xc67da4['shift']());}}}(_0x4c7f,0xb278b));import _0x3d539c from'electron';import{fileURLToPath,pathToFileURL}from'node:url';import{dirname,join,resolve,sep}from'node:path';import{createReadStream,existsSync,statSync}from'node:fs';import{readFile,readdir,stat,writeFile}from'node:fs/promises';import{spawn}from'node:child_process';import{Readable}from'node:stream';import{loadShellConfig}from'@wujie-shell/config';import{createConfigController}from'../config/controller.mjs';import{createGatewayController}from'../gateway/controller.mjs';import{deleteManagedSkill,importSkillZip,updateManagedSkillConfig}from'../skills/import.mjs';import{deleteMarketSkillRegistryEntry,importMarketSkillZip}from'../skills/market.mjs';import{createAgentSessionsMapStore}from'../sessions/agent-sessions-map-store.mjs';import{createTerminalManager}from'../terminal/manager.mjs';function _0x4f83(_0x1e28f0,_0x3efb67){_0x1e28f0=_0x1e28f0-0x144;const _0x4c7f46=_0x4c7f();let _0x4f8356=_0x4c7f46[_0x1e28f0];return _0x4f8356;}import{createShellLogger,exportLogsArchive,summarizeError,summarizePayload,summarizeText,toHomePath}from'../common/logging.mjs';import{createDiagnosticsWriter,diagnosticEventFromError}from'../common/diagnostics.mjs';import{createUserEventWriter}from'../common/user-events.mjs';import{createConnectorController}from'../connectors/controller.mjs';import{resolveRuntimeKdocsCliCommand}from'../connectors/kdocs-cli.mjs';import{createGeneratedFilesStore}from'../files/generated-files-store.mjs';import{registerFileHandlers}from'../files/handlers.mjs';import{registerProductLogHandlers}from'../log-reporting/handlers.mjs';import{resolveWujieApiEndpoint}from'../log-reporting/report-logs.mjs';import{extractModelMessageContent,registerModelHandlers}from'../models/handlers.mjs';import{createPreferencesStore}from'../preferences/store.mjs';import{loadRuntimeInfo,prepareRuntime,resolveRuntimeRoot,getRuntimeSpawnContext,resolveRuntimeLarkCliCommand,runClawOnce}from'../runtime/index.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,_0x285fc1(0x1f0)+_0x285fc1(0x3ff)),{app,BrowserWindow,clipboard,dialog,globalShortcut,ipcMain,protocol,shell}=_0x3d539c,DEVTOOLS_ACCELERATOR=_0x285fc1(0x1e7)+'rControl'+_0x285fc1(0x175),CLAWSPACE_PROTOCOL_SCHEME=_0x285fc1(0x447)+'e',DEBUG_STDOUT=process.env.WUJIE_SHELL_DEBUG==='1'||process.env.VITE_DEV_SERVER_URL||process.env.NODE_ENV!==_0x285fc1(0x36e)+'on',LOCAL_FILE_MIME_TYPES=new Map([[_0x285fc1(0x21a),_0x285fc1(0x25e)+_0x285fc1(0x331)+_0x285fc1(0x382)+'8'],['.md',_0x285fc1(0x16e)+_0x285fc1(0x28a)+'harset=u'+_0x285fc1(0x1f9)],['.jpg',_0x285fc1(0x15f)+'eg'],[_0x285fc1(0x1a2),'image/jp'+'eg'],[_0x285fc1(0x285),_0x285fc1(0x22d)+'g'],[_0x285fc1(0x233),_0x285fc1(0x1f3)+'f'],['.bmp',_0x285fc1(0x1e1)+'p'],['.svg',_0x285fc1(0x2e8)+_0x285fc1(0x26c)],[_0x285fc1(0x41e),_0x285fc1(0x3d3)+'bp'],[_0x285fc1(0x234),_0x285fc1(0x1a8)+'4'],[_0x285fc1(0x252),_0x285fc1(0x318)+_0x285fc1(0x29f)],['.avi',_0x285fc1(0x346)+_0x285fc1(0x1ab)],[_0x285fc1(0x365),_0x285fc1(0x346)+'matroska'],[_0x285fc1(0x366),_0x285fc1(0x28b)+'bm'],['.mp3','audio/mp'+'eg'],[_0x285fc1(0x43c),_0x285fc1(0x384)+'v'],['.m4a',_0x285fc1(0x2ba)+'4'],[_0x285fc1(0x230),_0x285fc1(0x18d)+'c'],['.ogg',_0x285fc1(0x30e)+'g'],[_0x285fc1(0x3fa),_0x285fc1(0x2c7)+'ac']]);protocol[_0x285fc1(0x3c0)+_0x285fc1(0x276)+'sPrivile'+_0x285fc1(0x2a7)]([{'scheme':CLAWSPACE_PROTOCOL_SCHEME,'privileges':{'secure':!![],'standard':!![],'supportFetchAPI':!![],'corsEnabled':!![]}}]);let mainWindow=null,shellConfig=null,configController=null,gatewayController=null,bootError=null,mainLogger=null,ipcLogger=null,filesLogger=null,rendererLogger=null,terminalManager=null,connectorController=null,productRuntime=null,productRuntimeHooks={},diagnosticsWriter=null,userEventWriter=null,isQuitting=![];function attachGatewayBroadcastHandlers(_0x5e3596){const _0x4541ee=_0x285fc1;for(const _0x3449fa of[_0x4541ee(0x3b8)+_0x4541ee(0x1fe),_0x4541ee(0x3b8)+_0x4541ee(0x395),_0x4541ee(0x177)+'eam-even'+'t','session-'+_0x4541ee(0x1e2),'agent-ev'+_0x4541ee(0x379),_0x4541ee(0x19a)+'pdated',_0x4541ee(0x431)+'-questio'+'n']){_0x5e3596['on'](_0x3449fa,_0xad6fb=>broadcast(_0x3449fa,_0xad6fb));}}async function ensureGatewayControllerStarted(){const _0x1f9d26=_0x285fc1;if(gatewayController)return gatewayController;if(!shellConfig||!configController)throw new Error(bootError?'wujie-sh'+_0x1f9d26(0x27c)+'\x20failed:'+'\x20'+bootError:_0x1f9d26(0x385)+_0x1f9d26(0x3f4)+'way\x20is\x20n'+_0x1f9d26(0x3e9)+_0x1f9d26(0x411));return mainLogger?.[_0x1f9d26(0x18b)](_0x1f9d26(0x232)+_0x1f9d26(0x362)+'er\x20missi'+_0x1f9d26(0x281)+_0x1f9d26(0x247)),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x1f9d26(0x1c4)+'on'](),'productRuntimeHooks':productRuntimeHooks,'userEventWriter':userEventWriter}),attachGatewayBroadcastHandlers(gatewayController),await gatewayController[_0x1f9d26(0x31c)](),gatewayController;}function getMode(){const _0x20f6a7=_0x285fc1;return process.env.VITE_DEV_SERVER_URL?_0x20f6a7(0x2d8):_0x20f6a7(0x267);}function getShellAppUpdateState(){const _0x5ce971=_0x285fc1;return{'supported':![],'channel':_0x5ce971(0x3b4),'phase':_0x5ce971(0x27e)+_0x5ce971(0x167),'currentVersion':app[_0x5ce971(0x1c4)+'on'](),'remoteVersion':null,'comparisonResult':_0x5ce971(0x342),'hasUpdate':![],'availableVersion':null,'downloadedVersion':null,'releaseName':null,'releaseDate':null,'releaseNotes':null,'downloadPercent':null,'bytesPerSecond':null,'transferredBytes':null,'totalBytes':null,'hasPendingPackage':![],'pendingPackageName':null,'pendingPackageBytes':null,'checkedAt':null,'message':_0x5ce971(0x329)+_0x5ce971(0x228),'error':null,'errorCode':null};}function isGatewayNotInitializedError(_0x299f05){const _0x5a41ff=_0x285fc1;return _0x299f05 instanceof Error&&_0x299f05[_0x5a41ff(0x42b)]==='wujie-sh'+_0x5a41ff(0x3f4)+_0x5a41ff(0x1c5)+_0x5a41ff(0x3e9)+'alized';}function resolveProjectRoot(){const _0x362bba=_0x285fc1;if(process.env.WUJIE_SHELL_PROJECT_ROOT)return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT);if(app[_0x362bba(0x324)+'ed']&&process['resource'+_0x362bba(0x439)])return join(process[_0x362bba(0x409)+_0x362bba(0x439)],'app.asar');return resolve(process[_0x362bba(0x174)]());}function getLocalFileMimeType(_0x9f3394){const _0x48c33d=_0x285fc1;return LOCAL_FILE_MIME_TYPES[_0x48c33d(0x35d)](_0x9f3394[_0x48c33d(0x297)](_0x9f3394['lastInde'+_0x48c33d(0x23a)]('.'))[_0x48c33d(0x3cc)+'ase']())||_0x48c33d(0x1ea)+_0x48c33d(0x3f5)+_0x48c33d(0x24c);}function parseSingleRangeHeader(_0x1696da,_0x145f00){const _0x1d81a4=_0x285fc1,_0x5c878a=/^bytes=(\d*)-(\d*)$/i['exec'](_0x1696da[_0x1d81a4(0x22e)]());if(!_0x5c878a)return null;const [,_0x1188c3,_0x3f073d]=_0x5c878a;if(!_0x1188c3&&!_0x3f073d)return null;if(!_0x1188c3){const _0x17839a=Number[_0x1d81a4(0x363)](_0x3f073d,0xa);if(!Number[_0x1d81a4(0x334)](_0x17839a)||_0x17839a<=0x0)return null;const _0x38ff47=Math[_0x1d81a4(0x25a)](_0x145f00-_0x17839a,0x0);return{'start':_0x38ff47,'end':_0x145f00-0x1};}const _0x22858b=Number[_0x1d81a4(0x363)](_0x1188c3,0xa);if(!Number[_0x1d81a4(0x334)](_0x22858b)||_0x22858b<0x0||_0x22858b>=_0x145f00)return null;const _0x15a1ea=_0x3f073d?Number[_0x1d81a4(0x363)](_0x3f073d,0xa):_0x145f00-0x1;if(!Number[_0x1d81a4(0x334)](_0x15a1ea)||_0x15a1ea<_0x22858b)return null;return{'start':_0x22858b,'end':Math[_0x1d81a4(0x2c0)](_0x15a1ea,_0x145f00-0x1)};}function decodeClawspacePath(_0x3292dd){const _0x5ac211=_0x285fc1;try{const _0x13165c=new URL(_0x3292dd);if(_0x13165c[_0x5ac211(0x2b5)]!==CLAWSPACE_PROTOCOL_SCHEME+':')return null;if(_0x13165c[_0x5ac211(0x37c)]!=='local')return null;const _0x32ccef=decodeURIComponent(_0x13165c[_0x5ac211(0x424)]);if(!_0x32ccef)return null;if(/^\/[A-Za-z]:\//[_0x5ac211(0x291)](_0x32ccef))return _0x32ccef[_0x5ac211(0x297)](0x1);return _0x32ccef;}catch{return null;}}function createClawspaceHeaders(_0x2e2597={}){const _0x294679=_0x285fc1;return new Headers({'access-control-allow-origin':'*','access-control-allow-methods':_0x294679(0x298)+'D,\x20OPTIO'+'NS','access-control-allow-headers':_0x294679(0x38a)+'ontent-t'+_0x294679(0x21b),'access-control-expose-headers':_0x294679(0x389)+_0x294679(0x27b)+_0x294679(0x389)+_0x294679(0x299)+_0x294679(0x36b)+_0x294679(0x426),..._0x2e2597});}function createLocalFileResponse(_0xd7ec98,_0x3bb885){const _0x16330f=_0x285fc1,_0x5a2aa2=statSync(_0x3bb885);if(!_0x5a2aa2[_0x16330f(0x3ef)]())return new Response(_0x16330f(0x2ef)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':'text/pla'+_0x16330f(0x331)+'set=utf-'+'8'})});const _0x5f0008=getLocalFileMimeType(_0x3bb885),_0x1242de=createClawspaceHeaders({'content-type':_0x5f0008,'accept-ranges':_0x16330f(0x178),'cache-control':_0x16330f(0x2bc)});if(_0xd7ec98[_0x16330f(0x2bb)]===_0x16330f(0x356))return _0x1242de[_0x16330f(0x1d2)](_0x16330f(0x389)+'length',String(_0x5a2aa2['size'])),new Response(null,{'status':0xc8,'headers':_0x1242de});const _0x2a011a=_0xd7ec98[_0x16330f(0x155)]['get'](_0x16330f(0x28e));if(!_0x2a011a)return _0x1242de['set']('content-'+_0x16330f(0x3b3),String(_0x5a2aa2[_0x16330f(0x20a)])),new Response(Readable[_0x16330f(0x3fb)](createReadStream(_0x3bb885)),{'status':0xc8,'headers':_0x1242de});const _0x4c7158=parseSingleRangeHeader(_0x2a011a,_0x5a2aa2[_0x16330f(0x20a)]);if(!_0x4c7158)return new Response(null,{'status':0x1a0,'headers':createClawspaceHeaders({...Object[_0x16330f(0x28f)+_0x16330f(0x3e8)](_0x1242de['entries']()),'content-range':_0x16330f(0x387)+_0x5a2aa2['size']})});const {start:_0xa97678,end:_0xbbc014}=_0x4c7158,_0x1ed3d9=_0xbbc014-_0xa97678+0x1,_0x32c50d=new Headers(_0x1242de);return _0x32c50d[_0x16330f(0x1d2)](_0x16330f(0x389)+_0x16330f(0x3b3),String(_0x1ed3d9)),_0x32c50d[_0x16330f(0x1d2)]('content-'+_0x16330f(0x28e),_0x16330f(0x3c9)+_0xa97678+'-'+_0xbbc014+'/'+_0x5a2aa2[_0x16330f(0x20a)]),new Response(Readable[_0x16330f(0x3fb)](createReadStream(_0x3bb885,{'start':_0xa97678,'end':_0xbbc014})),{'status':0xce,'headers':_0x32c50d});}function installClawspaceProtocolHandler(){const _0x439c41=_0x285fc1;protocol[_0x439c41(0x1fd)](CLAWSPACE_PROTOCOL_SCHEME,_0x3f0c68=>{const _0x4ca948=_0x439c41;if(_0x3f0c68[_0x4ca948(0x2bb)]===_0x4ca948(0x1d6))return new Response(null,{'status':0xcc,'headers':createClawspaceHeaders()});const _0x45d924=decodeClawspacePath(_0x3f0c68[_0x4ca948(0x24e)]);if(!_0x45d924)return new Response(_0x4ca948(0x43f)+_0x4ca948(0x447)+_0x4ca948(0x154),{'status':0x190,'headers':createClawspaceHeaders({'content-type':_0x4ca948(0x25e)+_0x4ca948(0x331)+'set=utf-'+'8'})});if(!existsSync(_0x45d924))return new Response('Not\x20foun'+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x4ca948(0x25e)+'in;\x20char'+_0x4ca948(0x382)+'8'})});return createLocalFileResponse(_0x3f0c68,_0x45d924);});}function broadcast(_0x282c9c,_0x1cd5ee){const _0x312a6a=_0x285fc1;DEBUG_STDOUT&&console[_0x312a6a(0x24a)]('[wujie-s'+_0x312a6a(0x2fa)+_0x312a6a(0x239),_0x282c9c,summarizePayload(_0x1cd5ee,{'maxDepth':0x2}));for(const _0x2f0e96 of BrowserWindow[_0x312a6a(0x1f8)+_0x312a6a(0x2d7)]()){!_0x2f0e96[_0x312a6a(0x1cb)+_0x312a6a(0x14c)][_0x312a6a(0x427)+_0x312a6a(0x149)]()&&_0x2f0e96[_0x312a6a(0x1cb)+_0x312a6a(0x14c)][_0x312a6a(0x393)]('wujie-sh'+_0x312a6a(0x1dc)+'t',{'name':_0x282c9c,'payload':_0x1cd5ee});}}async function loadProductRuntime(){const _0x2997cc=_0x285fc1,_0x401074=[join(shellConfig[_0x2997cc(0x2e9)+'oot'],_0x2997cc(0x1df)+'ntime','index.mj'+'s'),join(app[_0x2997cc(0x2f1)+'th'](),_0x2997cc(0x1df)+_0x2997cc(0x26f),_0x2997cc(0x3d5)+'s')],_0x8cd9e3=_0x401074[_0x2997cc(0x25c)](_0x3f744a=>existsSync(_0x3f744a));if(!_0x8cd9e3)return mainLogger?.[_0x2997cc(0x24a)](_0x2997cc(0x2d0)+_0x2997cc(0x1b9)+_0x2997cc(0x3f6)+_0x2997cc(0x25f)+'und',{'runtimeCandidates':_0x401074}),{};try{const _0x547bb1=await import(pathToFileURL(_0x8cd9e3)[_0x2997cc(0x296)]);return mainLogger?.[_0x2997cc(0x24a)](_0x2997cc(0x2d0)+_0x2997cc(0x1b9)+_0x2997cc(0x3f6)+_0x2997cc(0x41a),{'runtimePath':_0x8cd9e3}),_0x547bb1;}catch(_0x362212){mainLogger?.['error'](_0x2997cc(0x2d0)+_0x2997cc(0x1b9)+_0x2997cc(0x3f6)+'n\x20failed'+'\x20to\x20load',{'runtimePath':_0x8cd9e3,'error':summarizeError(_0x362212)});throw _0x362212;}}function openDevToolsForActiveContext(){const _0x2db7f0=_0x285fc1,_0x2dbbe8=BrowserWindow[_0x2db7f0(0x1bf)+_0x2db7f0(0x30c)]()||mainWindow;if(!_0x2dbbe8||_0x2dbbe8[_0x2db7f0(0x427)+_0x2db7f0(0x149)]())return{'ok':![]};return _0x2dbbe8[_0x2db7f0(0x1cb)+_0x2db7f0(0x14c)][_0x2db7f0(0x1b1)+_0x2db7f0(0x1ee)]({'mode':'detach'}),_0x2dbbe8[_0x2db7f0(0x1cb)+_0x2db7f0(0x14c)][_0x2db7f0(0x393)](_0x2db7f0(0x385)+_0x2db7f0(0x1dc)+'t',{'name':_0x2db7f0(0x204)+_0x2db7f0(0x1a9)+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x7e1dc9=_0x285fc1;globalShortcut[_0x7e1dc9(0x1b0)+'er'](DEVTOOLS_ACCELERATOR);const _0x27db92=globalShortcut[_0x7e1dc9(0x3c0)](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0x27db92&&console[_0x7e1dc9(0x18b)](_0x7e1dc9(0x295)+_0x7e1dc9(0x31a)+_0x7e1dc9(0x2e6)+_0x7e1dc9(0x3c0)+_0x7e1dc9(0x1be)+_0x7e1dc9(0x2d2)+DEVTOOLS_ACCELERATOR);}async function getRuntimeResourceStatus(){const _0x4251e8=_0x285fc1;try{const _0xedc834=await loadRuntimeInfo(shellConfig['projectR'+_0x4251e8(0x196)]),_0x5276ab=_0xedc834['manifest']||{};return{'ok':!![],'runtimeRoot':_0xedc834[_0x4251e8(0x359)+'oot'],'openclawVersion':_0xedc834[_0x4251e8(0x397)+_0x4251e8(0x1e5)],'generatedAt':_0x5276ab['generate'+_0x4251e8(0x23b)]||null,'pluginCount':Array[_0x4251e8(0x2f3)](_0x5276ab[_0x4251e8(0x37b)])?_0x5276ab[_0x4251e8(0x37b)][_0x4251e8(0x3b3)]:0x0,'plugins':Array[_0x4251e8(0x2f3)](_0x5276ab[_0x4251e8(0x37b)])?_0x5276ab[_0x4251e8(0x37b)]:[],'agents':_0x5276ab[_0x4251e8(0x437)]||null,'skills':_0x5276ab['skills']||null,'wrapper':_0x5276ab[_0x4251e8(0x200)+_0x4251e8(0x2ec)]||null,'product':_0x5276ab[_0x4251e8(0x2a2)]||null};}catch(_0x1755ca){return{'ok':![],'runtimeRoot':resolveRuntimeRoot(shellConfig?.['projectR'+_0x4251e8(0x196)]||resolveProjectRoot()),'error':_0x1755ca instanceof Error?_0x1755ca[_0x4251e8(0x42b)]:String(_0x1755ca)};}}async function createWindow(){const _0x4fc185=_0x285fc1,_0x3f148f=process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x4fc185(0x2e9)+_0x4fc185(0x196)],_0x4fc185(0x3f2),_0x4fc185(0x3dd)+'ml'),_0x568288=process[_0x4fc185(0x2de)]===_0x4fc185(0x271);mainLogger?.[_0x4fc185(0x24a)]('creating'+_0x4fc185(0x37a)+'ndow',{'rendererUrl':_0x3f148f,'mode':getMode()}),mainWindow=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig['productN'+_0x4fc185(0x3bd)],'backgroundColor':_0x568288?'#0000000'+'0':'#f8fafc','titleBarStyle':_0x568288?_0x4fc185(0x33f):_0x4fc185(0x29b),..._0x568288?{'titleBarOverlay':!![],'trafficLightPosition':{'x':0x10,'y':0xc}}:{},..._0x568288?{'vibrancy':_0x4fc185(0x3ba)}:{},'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![]}}),mainWindow[_0x4fc185(0x1cb)+_0x4fc185(0x14c)]['on'](_0x4fc185(0x301)+_0x4fc185(0x38e)+'nt',_0x5861b1=>{const _0x133063=_0x4fc185,_0x4de044=_0x5861b1[_0x133063(0x372)];if(!_0x4de044||_0x4de044['type']!=='keyDown')return;const _0x4c8a6d=String(_0x4de044[_0x133063(0x269)]||'')[_0x133063(0x3cc)+_0x133063(0x231)](),_0x4a56fa=_0x4c8a6d==='r',_0x342f6a=process['platform']===_0x133063(0x271)?_0x4de044[_0x133063(0x2f7)]===!![]:_0x4de044[_0x133063(0x2a6)]===!![];if(!_0x4a56fa||!_0x342f6a)return;_0x5861b1['preventD'+'efault'](),broadcast(_0x133063(0x188)+_0x133063(0x3ce),{'type':_0x133063(0x322)+'on','action':'reload'});});const _0x7b59f3=process.env.VITE_DEV_SERVER_URL;_0x7b59f3?(await mainWindow['loadURL'](_0x7b59f3),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&mainWindow['webConte'+_0x4fc185(0x14c)]['openDevT'+_0x4fc185(0x1ee)]({'mode':_0x4fc185(0x2fb)})):await mainWindow[_0x4fc185(0x170)](join(shellConfig[_0x4fc185(0x2e9)+'oot'],'dist',_0x4fc185(0x3dd)+'ml')),mainLogger?.[_0x4fc185(0x24a)]('main\x20win'+_0x4fc185(0x399)+'ed',{'rendererUrl':_0x3f148f,'mode':getMode()});}function installIpcHandlers(){const _0x5b77f8=_0x285fc1,_0x4ada6c=(_0x51e09c,_0x58b4ff)=>{const _0x255a95=_0x4f83;ipcMain[_0x255a95(0x1fd)](_0x51e09c,async(_0x334b95,_0x5302d0)=>{const _0xc47325=_0x255a95,_0x2d66b8=Date['now'](),_0x52066f=_0x334b95[_0xc47325(0x1b6)+_0xc47325(0x3bd)]?.['url']||_0x334b95[_0xc47325(0x35e)]['getURL']();ipcLogger?.['info']('ipc\x20requ'+_0xc47325(0x19c)+_0xc47325(0x167),{'channel':_0x51e09c,'senderUrl':_0x52066f,'payload':summarizePayload(_0x5302d0)});DEBUG_STDOUT&&console[_0xc47325(0x24a)](_0xc47325(0x295)+_0xc47325(0x2ff)+']',_0x51e09c,_0xc47325(0x3be),summarizePayload(_0x5302d0));try{let _0x328261;try{_0x328261=await _0x58b4ff(_0x334b95,_0x5302d0);}catch(_0x890871){if(!isGatewayNotInitializedError(_0x890871))throw _0x890871;await ensureGatewayControllerStarted(),_0x328261=await _0x58b4ff(_0x334b95,_0x5302d0);}const _0x1760c6=Date[_0xc47325(0x274)]()-_0x2d66b8;return ipcLogger?.[_0xc47325(0x24a)](_0xc47325(0x43e)+_0xc47325(0x243)+_0xc47325(0x286),{'channel':_0x51e09c,'durationMs':_0x1760c6,'result':summarizePayload(_0x328261,{'maxDepth':0x2})}),await userEventWriter?.['fromIpc']({'channel':_0x51e09c,'payload':_0x5302d0,'result':_0x328261,'durationMs':_0x1760c6,'status':_0xc47325(0x3f3)+'d'}),DEBUG_STDOUT&&console[_0xc47325(0x24a)](_0xc47325(0x295)+_0xc47325(0x2ff)+']',_0x51e09c,_0xc47325(0x3eb)+'d',summarizePayload(_0x328261,{'maxDepth':0x2})),_0x328261;}catch(_0x260252){const _0x17b2ab=Date[_0xc47325(0x274)]()-_0x2d66b8;ipcLogger?.['error']('ipc\x20requ'+_0xc47325(0x340)+'ed',{'channel':_0x51e09c,'durationMs':_0x17b2ab,'error':summarizeError(_0x260252)}),await userEventWriter?.[_0xc47325(0x249)]({'channel':_0x51e09c,'payload':_0x5302d0,'error':_0x260252,'durationMs':_0x17b2ab,'status':_0xc47325(0x403)}),await diagnosticsWriter?.[_0xc47325(0x355)+'ncident'](diagnosticEventFromError(_0x260252,{'category':_0xc47325(0x425),'event':_0xc47325(0x1a6)+_0xc47325(0x3c8)+'ed','message':_0xc47325(0x3d8)+'est\x20fail'+_0xc47325(0x3d2)+_0x51e09c,'durationMs':_0x17b2ab,'meta':{'channel':_0x51e09c,'senderUrl':_0x52066f,'payload':summarizePayload(_0x5302d0)}}));DEBUG_STDOUT&&console[_0xc47325(0x157)]('[wujie-s'+'hell:ipc'+']',_0x51e09c,'failed',summarizeError(_0x260252));throw _0x260252;}});},_0x1a10ee=()=>{const _0x32355c=_0x4f83;if(!gatewayController)throw new Error(bootError?_0x32355c(0x385)+'ell\x20boot'+_0x32355c(0x14b)+'\x20'+bootError:_0x32355c(0x385)+_0x32355c(0x3f4)+_0x32355c(0x1c5)+_0x32355c(0x3e9)+_0x32355c(0x411));return gatewayController;},_0x19558e=()=>{const _0x4e022d=_0x4f83;if(typeof productRuntime[_0x4e022d(0x3c0)+_0x4e022d(0x1c6)+_0x4e022d(0x31f)+_0x4e022d(0x36f)]!==_0x4e022d(0x23c))return;const _0x3f98b2=productRuntime[_0x4e022d(0x3c0)+_0x4e022d(0x1c6)+_0x4e022d(0x31f)+'ndlers']({'app':app,'BrowserWindow':BrowserWindow,'broadcast':broadcast,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'dialog':dialog,'exportLogsArchive':exportLogsArchive,'filesLogger':filesLogger,'getRuntimeSpawnContext':getRuntimeSpawnContext,'handle':_0x4ada6c,'mainLogger':mainLogger,'mainWindow':mainWindow,'rendererLogger':rendererLogger,'requireGateway':_0x1a10ee,'sep':sep,'openClawConfigHandlers':{'update':(..._0x4934b5)=>configController['updateOp'+_0x4e022d(0x1d7)+_0x4e022d(0x1af)](..._0x4934b5),'setPluginConfig':_0x165075=>configController[_0x4e022d(0x2b3)+_0x4e022d(0x367)+_0x4e022d(0x18a)](_0x165075),'setChannelConfig':_0x3375b9=>configController[_0x4e022d(0x2b3)+'lawChann'+'elConfig'](_0x3375b9),'deleteChannelConfig':_0x43540d=>configController[_0x4e022d(0x3c4)+_0x4e022d(0x1aa)+_0x4e022d(0x1ae)+'fig'](_0x43540d),'setSkillEntry':_0x24aea3=>configController[_0x4e022d(0x2b3)+_0x4e022d(0x209)+_0x4e022d(0x396)](_0x24aea3),'deleteSkillEntry':_0x54ee04=>configController[_0x4e022d(0x3c4)+_0x4e022d(0x38b)+_0x4e022d(0x19b)](_0x54ee04),'setMcpServer':_0x37196f=>configController['setOpenC'+'lawMcpSe'+_0x4e022d(0x309)](_0x37196f),'deleteMcpServer':_0x27ebc0=>configController['deleteOp'+_0x4e022d(0x2b6)+'pServer'](_0x27ebc0)},'shell':shell,'shellConfig':shellConfig,'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand,'summarizePayload':summarizePayload,'summarizeText':summarizeText,'toHomePath':toHomePath,'writeMutableConfig':_0xe25fa9})||{};Object['assign'](productRuntimeHooks,_0x3f98b2);};_0x4ada6c(_0x5b77f8(0x3a9),async()=>({'name':shellConfig[_0x5b77f8(0x42d)+_0x5b77f8(0x3bd)],'version':app[_0x5b77f8(0x1c4)+'on'](),'appId':shellConfig[_0x5b77f8(0x259)],'dataDir':shellConfig[_0x5b77f8(0x3a3)]})),_0x4ada6c(_0x5b77f8(0x1d4)+'-url',async(_0x48c932,_0x3ee932)=>{const _0x5b6e35=_0x5b77f8,_0x42bb27=typeof _0x3ee932===_0x5b6e35(0x2fc)?_0x3ee932:'';if(!_0x42bb27)return{'ok':![]};return filesLogger?.[_0x5b6e35(0x24a)](_0x5b6e35(0x1c3)+_0x5b6e35(0x152)+'l\x20reques'+'ted',{'url':summarizeText(_0x42bb27,0xa0)}),await shell[_0x5b6e35(0x1ce)+_0x5b6e35(0x2e5)](_0x42bb27),{'ok':!![]};});const _0xe25fa9=async(_0x32bad5,_0x30658f)=>{const _0x7e8013=_0x5b77f8;return configController[_0x7e8013(0x2f0)+'igWriteH'+_0x7e8013(0x44b)+'ternally'](),await configController[_0x7e8013(0x1c1)+'fig'](_0x32bad5,_0x30658f),{'ok':!![]};};_0x19558e(),_0x4ada6c(_0x5b77f8(0x3c3)+_0x5b77f8(0x320)+'p',async(_0x4637d3,_0x324a3c)=>importMarketSkillZip({'payload':_0x324a3c,'importSkillZip':_0x450c9f=>importSkillZip({..._0x450c9f,'app':app,'dialog':dialog,'dialogWindow':BrowserWindow['fromWebC'+_0x5b77f8(0x308)](_0x4637d3[_0x5b77f8(0x35e)])||mainWindow,'configController':configController}),'configController':configController})),_0x4ada6c(_0x5b77f8(0x343)+_0x5b77f8(0x21c),(_0x1d35f8,_0x5c7350)=>updateManagedSkillConfig({'payload':_0x5c7350,'configController':configController})),_0x4ada6c(_0x5b77f8(0x2ee)+'elete',(_0x300f60,_0x14c9c3)=>deleteMarketSkillRegistryEntry({'payload':_0x14c9c3,'deleteManagedSkill':_0x14146a=>deleteManagedSkill({..._0x14146a,'gateway':_0x1a10ee(),'configController':configController}),'configController':configController}));const _0xc72161=createGeneratedFilesStore({'stateDir':configController[_0x5b77f8(0x16c)+_0x5b77f8(0x339)]()});_0x4ada6c(_0x5b77f8(0x2fd)+_0x5b77f8(0x227)+_0x5b77f8(0x423),async()=>_0xc72161[_0x5b77f8(0x218)]()),_0x4ada6c('app:gene'+'rated-fi'+'les:upse'+'rt',async(_0x29c65e,_0x4fa8dd={})=>_0xc72161['upsert'](_0x4fa8dd)),_0x4ada6c(_0x5b77f8(0x2fd)+_0x5b77f8(0x227)+_0x5b77f8(0x3f1),async(_0xce6efb,_0x1050c0)=>_0xc72161['hide'](String(_0x1050c0||''))),_0x4ada6c(_0x5b77f8(0x2fd)+_0x5b77f8(0x227)+'les:hide'+_0x5b77f8(0x448)+_0x5b77f8(0x3df),async(_0x1f2e79,_0x2e5900)=>_0xc72161['hideBySe'+'ssion'](String(_0x2e5900||''))),_0x4ada6c(_0x5b77f8(0x2fd)+'rated-fi'+_0x5b77f8(0x436)+'te',async(_0x7ff892,_0x439c76)=>_0xc72161[_0x5b77f8(0x347)+'le'](String(_0x439c76||''))),_0x4ada6c(_0x5b77f8(0x2fd)+'rated-fi'+_0x5b77f8(0x436)+_0x5b77f8(0x2b4)+'e',async(_0x3172e1,_0x1cff23=[])=>_0xc72161[_0x5b77f8(0x38c)+_0x5b77f8(0x2ac)](_0x1cff23)),_0x4ada6c('app:gene'+_0x5b77f8(0x227)+_0x5b77f8(0x31e)+'al',async(_0x25fbf8,_0x38875a)=>{const _0xf88a1=_0x5b77f8,_0x9c77ee=await shell[_0xf88a1(0x3d7)](String(_0x38875a||''));return{'ok':!_0x9c77ee,'error':_0x9c77ee||undefined};}),_0x4ada6c(_0x5b77f8(0x26e)+'s:list',async()=>_0xc72161[_0x5b77f8(0x218)]()),_0x4ada6c('artifact'+_0x5b77f8(0x158),async(_0xe0ff36,_0x226c54={})=>_0xc72161['upsert'](_0x226c54)),_0x4ada6c(_0x5b77f8(0x26e)+_0x5b77f8(0x441),async(_0x5f5297,_0x10e785={})=>_0xc72161[_0x5b77f8(0x404)](String(_0x10e785['id']||_0x10e785||''))),_0x4ada6c(_0x5b77f8(0x26e)+_0x5b77f8(0x39b),async(_0x572795,_0x596671={})=>_0xc72161[_0x5b77f8(0x347)+'le'](String(_0x596671['id']||_0x596671||''))),_0x4ada6c(_0x5b77f8(0x26e)+_0x5b77f8(0x39b)+_0x5b77f8(0x1b7),async(_0x510fb4,_0x463b6b={})=>_0xc72161['deletedS'+_0x5b77f8(0x2ac)](_0x463b6b[_0x5b77f8(0x381)]||_0x463b6b)),_0x4ada6c('artifact'+'s:reveal',async(_0x39a157,_0x37a788={})=>{const _0x566d26=_0x5b77f8,_0x3578fc=typeof _0x37a788==='string'?_0x37a788:_0x37a788[_0x566d26(0x2a1)]||_0x37a788[_0x566d26(0x357)],_0x1d0c8a=await shell[_0x566d26(0x3d7)](String(_0x3578fc||''));return{'ok':!_0x1d0c8a,'error':_0x1d0c8a||undefined};});const _0x31c396=createPreferencesStore({'stateDir':configController[_0x5b77f8(0x16c)+_0x5b77f8(0x339)](),'storeFile':'product-'+_0x5b77f8(0x2f8)+_0x5b77f8(0x302)});_0x4ada6c(_0x5b77f8(0x168)+_0x5b77f8(0x153)+'se',async()=>_0x31c396['get'](_0x5b77f8(0x378)+_0x5b77f8(0x303)+'se',![])),_0x4ada6c(_0x5b77f8(0x168)+_0x5b77f8(0x2cb)+'se',async(_0x2ba28b,_0x58586a)=>_0x31c396[_0x5b77f8(0x1d2)]('closeToT'+_0x5b77f8(0x303)+'se',_0x58586a===!![])),registerFileHandlers({'app':app,'filesLogger':filesLogger,'handle':_0x4ada6c,'sep':sep,'toHomePath':toHomePath}),registerProductLogHandlers({'app':app,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'exportLogsArchive':exportLogsArchive,'handle':_0x4ada6c,'mainLogger':mainLogger,'rendererLogger':rendererLogger,'summarizeText':summarizeText,'toHomePath':toHomePath}),registerModelHandlers({'handle':_0x4ada6c,'modelHandlers':{'saveCustomModel':_0x2d071f=>_0x1a10ee()['models'][_0x5b77f8(0x2eb)+_0x5b77f8(0x434)](_0x2d071f),'deleteCustomModel':_0x36eb8e=>_0x1a10ee()['models'][_0x5b77f8(0x17e)+'stomMode'+'l'](_0x36eb8e)}}),connectorController=createConnectorController({'shellConfig':shellConfig,'configController':configController,'broadcast':broadcast,'shell':shell,'getRuntimeSpawnContext':getRuntimeSpawnContext,'openClawConfigHandlers':{'update':(..._0x449333)=>configController[_0x5b77f8(0x443)+_0x5b77f8(0x1d7)+_0x5b77f8(0x1af)](..._0x449333),'setPluginConfig':_0x2ad962=>configController[_0x5b77f8(0x2b3)+'lawPlugi'+'nConfig'](_0x2ad962),'setChannelConfig':_0x285bb0=>configController[_0x5b77f8(0x2b3)+_0x5b77f8(0x383)+_0x5b77f8(0x446)](_0x285bb0),'deleteChannelConfig':_0x3eb478=>configController[_0x5b77f8(0x3c4)+_0x5b77f8(0x1aa)+_0x5b77f8(0x1ae)+_0x5b77f8(0x246)](_0x3eb478),'setSkillEntry':_0x24ca26=>configController['setOpenC'+'lawSkill'+_0x5b77f8(0x396)](_0x24ca26),'deleteSkillEntry':_0x115473=>configController[_0x5b77f8(0x3c4)+'enClawSk'+_0x5b77f8(0x19b)](_0x115473),'setMcpServer':_0x1f0e93=>configController[_0x5b77f8(0x2b3)+_0x5b77f8(0x416)+_0x5b77f8(0x309)](_0x1f0e93),'deleteMcpServer':_0x5eb931=>configController[_0x5b77f8(0x3c4)+_0x5b77f8(0x2b6)+'pServer'](_0x5eb931)},'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand}),_0x4ada6c(_0x5b77f8(0x2e2)+_0x5b77f8(0x36a)+_0x5b77f8(0x307),async()=>connectorController[_0x5b77f8(0x183)+_0x5b77f8(0x1ae)+_0x5b77f8(0x3d6)]()),_0x4ada6c(_0x5b77f8(0x2e2)+_0x5b77f8(0x36a)+_0x5b77f8(0x2f5)+'e',async(_0x34f84b,_0x18166b={})=>connectorController['deleteIm'+_0x5b77f8(0x1b5)+_0x5b77f8(0x3e2)](_0x18166b)),_0x4ada6c(_0x5b77f8(0x2e2)+_0x5b77f8(0x36a)+_0x5b77f8(0x2d6)+'nabled',async(_0x1d414c,_0x3f23bc={})=>connectorController[_0x5b77f8(0x2d5)+'nnelEnab'+_0x5b77f8(0x388)](_0x3f23bc)),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x1a4),async(_0xc4dac3,_0xb64e00={})=>{const _0x311805=_0x5b77f8,_0xe4967d=String(_0xb64e00[_0x311805(0x1c2)+'d']||_0xb64e00['payload']?.[_0x311805(0x1c2)+'d']||_0xb64e00[_0x311805(0x2a0)]?.['id']||'');if(!_0xe4967d)throw new Error('channelI'+'d\x20is\x20req'+_0x311805(0x205));const _0x3d68ac=_0xb64e00[_0x311805(0x2a0)]||_0xb64e00,_0x59ec85={'feishu':connectorController['saveFeis'+'huChanne'+_0x311805(0x1ff)],'qqbot':connectorController[_0x311805(0x180)+_0x311805(0x202)+_0x311805(0x1db)],'wecom':connectorController[_0x311805(0x44a)+_0x311805(0x253)+_0x311805(0x1db)],'qq_mail':connectorController['saveQqMa'+_0x311805(0x17b)+_0x311805(0x151)+'g'],'netease_mail':connectorController['saveNetE'+_0x311805(0x42a)+'onnector'+'Config'],'tencent_exmail':connectorController[_0x311805(0x2b0)+_0x311805(0x2f4)+_0x311805(0x33d)+_0x311805(0x215)],'feishu_doc':connectorController[_0x311805(0x184)+_0x311805(0x1e3)+'nectorCo'+_0x311805(0x1af)],'tencent_docs':connectorController[_0x311805(0x2b0)+_0x311805(0x18f)+_0x311805(0x14a)+_0x311805(0x1db)],'kdocs':connectorController[_0x311805(0x224)+_0x311805(0x264)+_0x311805(0x215)],'dingtalk_doc':connectorController[_0x311805(0x270)+_0x311805(0x1cd)+_0x311805(0x14a)+_0x311805(0x1db)]},_0xd9fce6=_0x59ec85[_0xe4967d];if(!_0xd9fce6)throw new Error(_0x311805(0x3c7)+_0x311805(0x23e)+'ector:\x20'+_0xe4967d);return _0xd9fce6(_0x3d68ac);}),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+':save-fe'+_0x5b77f8(0x40a)+_0x5b77f8(0x344),async(_0x50edf3,_0x208afd={})=>connectorController[_0x5b77f8(0x184)+_0x5b77f8(0x1bb)+_0x5b77f8(0x1ff)](_0x208afd)),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x2ae)+'bot-chan'+'nel',async(_0x483a1c,_0x3f351d={})=>connectorController[_0x5b77f8(0x180)+_0x5b77f8(0x202)+_0x5b77f8(0x1db)](_0x3f351d)),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x354)+_0x5b77f8(0x1d9)+_0x5b77f8(0x256),async(_0x18175c,_0x3d0f42={})=>connectorController[_0x5b77f8(0x44a)+'mChannel'+'Config'](_0x3d0f42)),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x2ae)+_0x5b77f8(0x43a),async(_0x10be9a,_0xe769c0={})=>connectorController['saveQqMa'+_0x5b77f8(0x17b)+_0x5b77f8(0x151)+'g'](_0xe769c0)),_0x4ada6c('config:c'+_0x5b77f8(0x14a)+_0x5b77f8(0x36c)+'tease-ma'+'il',async(_0xcbef9e,_0x194923={})=>connectorController[_0x5b77f8(0x341)+_0x5b77f8(0x42a)+_0x5b77f8(0x14a)+_0x5b77f8(0x1db)](_0x194923)),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x2da)+_0x5b77f8(0x3fc)+_0x5b77f8(0x147),async(_0x426437,_0x2fe0cd={})=>connectorController[_0x5b77f8(0x2b0)+_0x5b77f8(0x2f4)+_0x5b77f8(0x33d)+_0x5b77f8(0x215)](_0x2fe0cd)),_0x4ada6c('config:c'+_0x5b77f8(0x14a)+_0x5b77f8(0x1a0)+'ishu-doc',async(_0x5c7d86,_0x38b408={})=>connectorController['saveFeis'+_0x5b77f8(0x1e3)+_0x5b77f8(0x16f)+_0x5b77f8(0x1af)](_0x38b408)),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x2da)+'ncent-do'+'cs',async(_0x5f4b49,_0x7650f3={})=>connectorController[_0x5b77f8(0x2b0)+_0x5b77f8(0x18f)+_0x5b77f8(0x14a)+_0x5b77f8(0x1db)](_0x7650f3)),_0x4ada6c('config:c'+_0x5b77f8(0x14a)+':save-kd'+_0x5b77f8(0x1c8),async(_0x14b2a6,_0x407514={})=>connectorController['saveKdoc'+_0x5b77f8(0x264)+_0x5b77f8(0x215)](_0x407514)),_0x4ada6c('config:c'+'onnector'+_0x5b77f8(0x3b1)+_0x5b77f8(0x3de)+'oc',async(_0x54463e,_0x2d2299={})=>connectorController[_0x5b77f8(0x270)+'talkDocC'+_0x5b77f8(0x14a)+_0x5b77f8(0x1db)](_0x2d2299)),_0x4ada6c(_0x5b77f8(0x3ad)+'onnector'+_0x5b77f8(0x3cd)+':start',async(_0x30aa5d,_0x2a6c9c={})=>{const _0x3ed830=_0x5b77f8,_0x17f105=String(_0x2a6c9c[_0x3ed830(0x1c2)+'d']||_0x2a6c9c[_0x3ed830(0x280)]||'');if(_0x17f105===_0x3ed830(0x369))return connectorController['startKdo'+_0x3ed830(0x244)+_0x3ed830(0x418)+_0x3ed830(0x3df)]();if(_0x17f105===_0x3ed830(0x421)+'oc')return connectorController[_0x3ed830(0x3b2)+'shuDocCl'+'iConnect'+_0x3ed830(0x191)]();if(_0x17f105===_0x3ed830(0x294))return connectorController[_0x3ed830(0x3b2)+_0x3ed830(0x2cf)+'trationS'+_0x3ed830(0x32d)](_0x2a6c9c);if(_0x17f105===_0x3ed830(0x397)+_0x3ed830(0x39c)||_0x17f105===_0x3ed830(0x392))return connectorController[_0x3ed830(0x400)+_0x3ed830(0x3ec)+_0x3ed830(0x1fa)+'n']({'gatewayPort':_0x1a10ee()[_0x3ed830(0x391)+_0x3ed830(0x300)](),'gatewayToken':_0x1a10ee()[_0x3ed830(0x3da)+_0x3ed830(0x1dd)]()});throw new Error(_0x3ed830(0x3c7)+_0x3ed830(0x23e)+'ector\x20se'+'ssion:\x20'+(_0x17f105||'unknown'));}),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x3cd)+_0x5b77f8(0x258),async(_0x45410f,_0x55eeb5={})=>{const _0x5d5689=_0x5b77f8,_0x262619=String(_0x55eeb5[_0x5d5689(0x1c2)+'d']||_0x55eeb5[_0x5d5689(0x280)]||'');if(_0x262619==='kdocs')return connectorController[_0x5d5689(0x3fd)+_0x5d5689(0x440)+'ctStatus'](_0x55eeb5);if(_0x262619===_0x5d5689(0x421)+'oc')return connectorController[_0x5d5689(0x3a0)+_0x5d5689(0x42f)+'onnectSt'+_0x5d5689(0x398)](_0x55eeb5);if(_0x262619===_0x5d5689(0x294))return connectorController[_0x5d5689(0x3a0)+_0x5d5689(0x2ab)+_0x5d5689(0x235)+_0x5d5689(0x35a)](_0x55eeb5);throw new Error('Unsuppor'+_0x5d5689(0x23e)+_0x5d5689(0x2c2)+'ssion:\x20'+(_0x262619||'unknown'));}),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x3cd)+_0x5b77f8(0x3a2),async(_0x4308db,_0x35c2e9={})=>{const _0x121aeb=_0x5b77f8,_0x4da2f4=String(_0x35c2e9[_0x121aeb(0x1c2)+'d']||_0x35c2e9[_0x121aeb(0x280)]||'');if(_0x4da2f4===_0x121aeb(0x369))return connectorController['cancelKd'+_0x121aeb(0x429)+_0x121aeb(0x414)+'sion'](_0x35c2e9);if(_0x4da2f4===_0x121aeb(0x421)+'oc')return connectorController[_0x121aeb(0x3ca)+_0x121aeb(0x37e)+_0x121aeb(0x189)+_0x121aeb(0x25d)](_0x35c2e9);if(_0x4da2f4===_0x121aeb(0x294))return connectorController['cancelFe'+_0x121aeb(0x3bb)+_0x121aeb(0x181)+_0x121aeb(0x191)](_0x35c2e9);if(_0x4da2f4===_0x121aeb(0x397)+'-weixin'||_0x4da2f4===_0x121aeb(0x392))return connectorController[_0x121aeb(0x19f)+_0x121aeb(0x3ab)+_0x121aeb(0x272)+'on']();return{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x3ad)+_0x5b77f8(0x14a)+_0x5b77f8(0x3cd)+_0x5b77f8(0x2ce)+'e',async(_0x1c863b,_0x43794a={})=>{const _0x3c3e22=_0x5b77f8,_0x40ec5f=String(_0x43794a[_0x3c3e22(0x1c2)+'d']||_0x43794a['type']||'');if(_0x40ec5f===_0x3c3e22(0x421)+'oc')return connectorController[_0x3c3e22(0x3eb)+_0x3c3e22(0x279)+_0x3c3e22(0x33e)+_0x3c3e22(0x254)+'on'](_0x43794a);throw new Error(_0x3c3e22(0x3c7)+'ted\x20conn'+_0x3c3e22(0x2c2)+_0x3c3e22(0x353)+(_0x40ec5f||'unknown'));}),_0x4ada6c(_0x5b77f8(0x2c6)+'ead',()=>connectorController[_0x5b77f8(0x192)+_0x5b77f8(0x171)+'ot']());const _0x556b48=_0x1650df=>{const _0x288981=_0x5b77f8,_0x239b1c=_0x1650df[_0x288981(0x437)]&&typeof _0x1650df[_0x288981(0x437)]===_0x288981(0x1ca)?_0x1650df[_0x288981(0x437)]:{};return Array[_0x288981(0x2f3)](_0x239b1c['list'])?_0x239b1c[_0x288981(0x218)]:[];},_0x197095=_0x4468ce=>{const _0x5c0642=_0x5b77f8,_0x51a9a9=typeof _0x4468ce===_0x5c0642(0x2fc)?_0x4468ce[_0x5c0642(0x22e)]():'',_0x3a1eae=_0x51a9a9[_0x5c0642(0x333)](/^agent:([^:]+):/);return _0x3a1eae?.[0x1]||'';},_0x1d0c8d=(_0x24f749={},_0xd3b41=[])=>{const _0x2e4356=_0x5b77f8,_0x4bcec6=Array[_0x2e4356(0x2f3)](_0x24f749[_0x2e4356(0x437)])?_0x24f749[_0x2e4356(0x437)]:Array[_0x2e4356(0x2f3)](_0x24f749[_0x2e4356(0x218)])?_0x24f749[_0x2e4356(0x218)]:[],_0x1e5bc3=Array['isArray'](_0xd3b41)?_0xd3b41:[];return _0x4bcec6[_0x2e4356(0x349)](_0x2821d3=>{const _0x2d2d5b=_0x2e4356,_0x343132=String(_0x2821d3?.['id']||_0x2821d3?.['agentId']||'')[_0x2d2d5b(0x22e)]();return{'agent':_0x2821d3,'sessions':_0x343132?_0x1e5bc3['filter'](_0x420d3d=>{const _0x316a7d=_0x2d2d5b,_0x1410c5=String(_0x420d3d?.[_0x316a7d(0x34a)]||_0x420d3d?.[_0x316a7d(0x28d)]||_0x420d3d?.[_0x316a7d(0x422)]?.['id']||_0x197095(_0x420d3d?.[_0x316a7d(0x269)])||'')[_0x316a7d(0x22e)]();return _0x1410c5?_0x1410c5===_0x343132:_0x343132===_0x316a7d(0x1e9);}):[]};});};_0x4ada6c(_0x5b77f8(0x311)+_0x5b77f8(0x32c)+_0x5b77f8(0x2ac),async()=>getShellAppUpdateState()),_0x4ada6c('app:upda'+_0x5b77f8(0x1e6),async()=>getShellAppUpdateState()),_0x4ada6c(_0x5b77f8(0x311)+_0x5b77f8(0x1de)+_0x5b77f8(0x251),async()=>getShellAppUpdateState()),_0x4ada6c(_0x5b77f8(0x311)+'te:quit-'+'and-inst'+_0x5b77f8(0x2b8),async()=>({'ok':![],'reason':'no-updat'+'e'})),_0x4ada6c(_0x5b77f8(0x160)+':choose',async(_0x203b0b,_0x10ae51={})=>{const _0x5cc1d5=_0x5b77f8,_0x5de6ce=await dialog['showOpen'+_0x5cc1d5(0x41d)](BrowserWindow[_0x5cc1d5(0x380)+'ontents'](_0x203b0b[_0x5cc1d5(0x35e)])??mainWindow,{'properties':[_0x5cc1d5(0x304),..._0x10ae51?.[_0x5cc1d5(0x3d1)]!==0x1?[_0x5cc1d5(0x316)+_0x5cc1d5(0x2ca)]:[]],'filters':_0x10ae51?.[_0x5cc1d5(0x23f)+_0x5cc1d5(0x28c)+'s']?[{'name':_0x5cc1d5(0x374),'extensions':_0x10ae51[_0x5cc1d5(0x23f)+_0x5cc1d5(0x28c)+'s']}]:undefined});return _0x5de6ce['filePath'+'s']['map'](_0x2f0989=>({'path':_0x2f0989,'name':_0x2f0989[_0x5cc1d5(0x30f)](/[\\/]/)[_0x5cc1d5(0x214)]()||_0x2f0989}));}),_0x4ada6c('app:file'+':downloa'+_0x5b77f8(0x317),async(_0x31cea2,_0x10be97={})=>{const _0x48e319=_0x5b77f8,_0x3b474c=String(_0x10be97[_0x48e319(0x2cd)+'th']||'');if(!_0x3b474c)return{'success':![],'error':'sourcePa'+'th\x20is\x20re'+'quired'};const _0x376ebb=await dialog[_0x48e319(0x323)+_0x48e319(0x41d)](mainWindow,{'defaultPath':_0x10be97['defaultF'+_0x48e319(0x222)]||_0x3b474c[_0x48e319(0x30f)](/[\\/]/)['pop']()});if(_0x376ebb[_0x48e319(0x16a)]||!_0x376ebb[_0x48e319(0x2a8)])return{'success':![],'canceled':!![]};const {copyFile:_0x582625}=await import(_0x48e319(0x190)+'promises');return await _0x582625(_0x3b474c,_0x376ebb['filePath']),{'success':!![],'filePath':_0x376ebb['filePath']};}),_0x4ada6c(_0x5b77f8(0x3ae)+_0x5b77f8(0x39e)+_0x5b77f8(0x273),async(_0x22fc80,_0x3c8e09)=>{const _0x3d9e94=_0x5b77f8;return clipboard[_0x3d9e94(0x3e4)+'t'](String(_0x3c8e09??'')),{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x3ea)+_0x5b77f8(0x1ec)+'rt',async()=>{const _0x57a26a=_0x5b77f8;return app[_0x57a26a(0x402)](),app['quit'](),{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x335)+'s-maximi'+_0x5b77f8(0x1d1),_0x3b11c9=>Boolean(BrowserWindow[_0x5b77f8(0x380)+_0x5b77f8(0x308)](_0x3b11c9[_0x5b77f8(0x35e)])?.[_0x5b77f8(0x415)+_0x5b77f8(0x1d1)]())),_0x4ada6c('app:star'+_0x5b77f8(0x3ed),async(_0x48b4f0,_0x39f7b0)=>{const _0x1bb5e1=_0x5b77f8;return app[_0x1bb5e1(0x432)+_0x1bb5e1(0x410)+_0x1bb5e1(0x37d)]({'openAtLogin':_0x39f7b0===!![]}),{'ok':!![],'enabled':_0x39f7b0===!![]};}),_0x4ada6c(_0x5b77f8(0x237)+_0x5b77f8(0x1ef),async()=>app[_0x5b77f8(0x321)+_0x5b77f8(0x410)+_0x5b77f8(0x37d)]()[_0x5b77f8(0x3cf)+_0x5b77f8(0x3d4)]),_0x4ada6c(_0x5b77f8(0x160)+':choose-'+_0x5b77f8(0x328),async _0x182663=>{const _0xd8bec2=_0x5b77f8,_0x1f585b=await dialog['showOpen'+_0xd8bec2(0x41d)](BrowserWindow['fromWebC'+_0xd8bec2(0x308)](_0x182663[_0xd8bec2(0x35e)])??mainWindow,{'properties':[_0xd8bec2(0x3ee)+'ctory']});return _0x1f585b[_0xd8bec2(0x2a8)+'s'][0x0]||'';}),_0x4ada6c('app:syst'+_0x5b77f8(0x34c)+_0x5b77f8(0x328),async(_0x9bd6a9,_0x511917)=>{const _0x291fe9=await shell['openPath'](String(_0x511917||''));return _0x291fe9||'';}),_0x4ada6c(_0x5b77f8(0x397)+_0x5b77f8(0x3c1)+_0x5b77f8(0x21e),async()=>_0x1a10ee()[_0x5b77f8(0x3da)+_0x5b77f8(0x1dd)]()),_0x4ada6c('openclaw'+_0x5b77f8(0x3c1)+_0x5b77f8(0x1d3),async()=>_0x1a10ee()[_0x5b77f8(0x391)+_0x5b77f8(0x300)]()),_0x4ada6c(_0x5b77f8(0x397)+':run-onc'+'e',async(_0x162fa5,_0x18682f=[])=>{const _0x5e9aea=_0x5b77f8,_0x16413f=await runClawOnce(shellConfig[_0x5e9aea(0x2e9)+_0x5e9aea(0x196)],Array['isArray'](_0x18682f)?_0x18682f:[]);return{'ok':_0x16413f[_0x5e9aea(0x15e)]===0x0,..._0x16413f};}),_0x4ada6c(_0x5b77f8(0x17a)+_0x5b77f8(0x312),async(_0x47626f,_0x59566a={})=>_0x1a10ee()[_0x5b77f8(0x17a)][_0x5b77f8(0x260)]({..._0x59566a,'parentSessionKey':_0x59566a['parentSe'+_0x5b77f8(0x412)]||_0x59566a['sessionK'+'ey']}));const _0x655f00=createAgentSessionsMapStore({'stateDir':configController[_0x5b77f8(0x16c)+_0x5b77f8(0x339)]()});_0x4ada6c(_0x5b77f8(0x17a)+':agent-m'+_0x5b77f8(0x159),async(_0x27bd2c,_0x461b39={})=>_0x655f00[_0x5b77f8(0x35d)](_0x461b39)),_0x4ada6c(_0x5b77f8(0x17a)+':agent-m'+_0x5b77f8(0x2d4)+'t',async(_0x22de8f,_0x19f773={})=>_0x655f00[_0x5b77f8(0x22b)](_0x19f773)),_0x4ada6c(_0x5b77f8(0x2c3)+_0x5b77f8(0x1a1),async(_0x211e6f,_0x405480={})=>{const _0x3d6dac=_0x5b77f8,_0x7e9c19=await readMutableConfig(),_0x412dd2=_0x7e9c19[_0x3d6dac(0x437)]&&typeof _0x7e9c19['agents']===_0x3d6dac(0x1ca)?_0x7e9c19[_0x3d6dac(0x437)]:{},_0x427363=_0x556b48(_0x7e9c19),_0x5e32e5=String(_0x405480['id']||_0x405480[_0x3d6dac(0x217)]||_0x3d6dac(0x156)+Date['now']())['trim']()[_0x3d6dac(0x1e4)](/\s+/g,'-'),_0x3c4b79={'id':_0x5e32e5,'name':String(_0x405480[_0x3d6dac(0x217)]||_0x5e32e5),..._0x405480[_0x3d6dac(0x34d)+'e']?{'workspace':String(_0x405480[_0x3d6dac(0x34d)+'e'])}:{},..._0x405480[_0x3d6dac(0x43d)]?{'model':_0x405480[_0x3d6dac(0x43d)]}:{},..._0x405480[_0x3d6dac(0x1ac)]?{'emoji':_0x405480['emoji']}:{},..._0x405480['avatar']?{'avatar':_0x405480[_0x3d6dac(0x18c)]}:{},...Array[_0x3d6dac(0x2f3)](_0x405480['skills'])?{'skills':_0x405480[_0x3d6dac(0x216)]}:{}};if(_0x427363['some'](_0x5609d5=>_0x5609d5?.['id']===_0x5e32e5))throw new Error(_0x3d6dac(0x1b2)+_0x3d6dac(0x1d0)+_0x3d6dac(0x358));return _0x412dd2[_0x3d6dac(0x218)]=[..._0x427363,_0x3c4b79],_0x7e9c19['agents']=_0x412dd2,await _0xe25fa9(_0x7e9c19,_0x3d6dac(0x16b)+_0x3d6dac(0x2e0)),{'ok':!![],'agent':_0x3c4b79};}),_0x4ada6c('agents:u'+_0x5b77f8(0x21c),async(_0x41b4d0,_0x91f511={})=>{const _0x1f06a5=_0x5b77f8,_0x1bde13=String(_0x91f511['id']||_0x91f511[_0x1f06a5(0x34a)]||'')[_0x1f06a5(0x22e)]();if(!_0x1bde13)throw new Error(_0x1f06a5(0x262)+_0x1f06a5(0x377)+_0x1f06a5(0x240));const _0x54296a=await readMutableConfig(),_0x59b82c=_0x54296a['agents']&&typeof _0x54296a['agents']===_0x1f06a5(0x1ca)?_0x54296a[_0x1f06a5(0x437)]:{},_0x8fe6f0=_0x556b48(_0x54296a),_0xc4cf80=_0x8fe6f0[_0x1f06a5(0x349)](_0x543570=>_0x543570?.['id']===_0x1bde13?{..._0x543570,..._0x91f511,'id':_0x1bde13}:_0x543570);return _0x59b82c['list']=_0xc4cf80,_0x54296a[_0x1f06a5(0x437)]=_0x59b82c,await _0xe25fa9(_0x54296a,'agent\x20up'+_0x1f06a5(0x2bf)),{'ok':!![],'agent':_0xc4cf80[_0x1f06a5(0x25c)](_0x393b64=>_0x393b64?.['id']===_0x1bde13)||null};}),_0x4ada6c(_0x5b77f8(0x176)+_0x5b77f8(0x293),async(_0x265002,_0x6b3d2d={})=>{const _0x2e0191=_0x5b77f8,_0x271601=String(_0x6b3d2d['id']||_0x6b3d2d['agentId']||'')[_0x2e0191(0x22e)]();if(!_0x271601)throw new Error(_0x2e0191(0x262)+_0x2e0191(0x377)+_0x2e0191(0x240));const _0x5a625b=await readMutableConfig(),_0x2176ec=_0x5a625b[_0x2e0191(0x437)]&&typeof _0x5a625b[_0x2e0191(0x437)]===_0x2e0191(0x1ca)?_0x5a625b[_0x2e0191(0x437)]:{};return _0x2176ec[_0x2e0191(0x218)]=_0x556b48(_0x5a625b)[_0x2e0191(0x22c)](_0x1f506d=>_0x1f506d?.['id']!==_0x271601),_0x5a625b[_0x2e0191(0x437)]=_0x2176ec,await _0xe25fa9(_0x5a625b,_0x2e0191(0x19e)+_0x2e0191(0x286)),{'ok':!![],'agentId':_0x271601};}),_0x4ada6c(_0x5b77f8(0x430)+_0x5b77f8(0x24b)+'ions-lis'+'t',async(_0x1bb6d3,_0x2962c1={})=>{const _0x39a3d1=_0x5b77f8,[_0x2c4e82,_0x2ea687]=await Promise[_0x39a3d1(0x2b8)]([_0x1a10ee()[_0x39a3d1(0x437)][_0x39a3d1(0x218)](),_0x1a10ee()[_0x39a3d1(0x17a)]['list'](_0x2962c1)[_0x39a3d1(0x337)](()=>({'sessions':[]}))]),_0x35a838=Array[_0x39a3d1(0x2f3)](_0x2ea687['sessions'])?_0x2ea687['sessions']:[];return{..._0x2c4e82,'sessions':_0x35a838,'groups':Array[_0x39a3d1(0x2f3)](_0x2c4e82[_0x39a3d1(0x3e1)])?_0x2c4e82[_0x39a3d1(0x3e1)]:_0x1d0c8d(_0x2c4e82,_0x35a838)};}),terminalManager=createTerminalManager({'cwd':join(configController[_0x5b77f8(0x16c)+_0x5b77f8(0x339)](),'workspac'+'e'),'emitData':_0x41fcaf=>broadcast(_0x5b77f8(0x32e)+_0x5b77f8(0x146),_0x41fcaf),'emitExit':_0x9e3cc=>broadcast(_0x5b77f8(0x32e)+_0x5b77f8(0x1a7),_0x9e3cc)}),_0x4ada6c(_0x5b77f8(0x32e)+_0x5b77f8(0x438),async(_0x3ff6b8,_0x2a0bb9={})=>terminalManager[_0x5b77f8(0x260)](_0x2a0bb9)),_0x4ada6c(_0x5b77f8(0x32e)+_0x5b77f8(0x194),async(_0x3aa178,_0x2b75a6={})=>terminalManager['input'](_0x2b75a6)),_0x4ada6c('terminal'+_0x5b77f8(0x144),async(_0x5c9cee,_0x278632={})=>terminalManager['resize'](_0x278632)),_0x4ada6c('terminal'+_0x5b77f8(0x212),async(_0x5ac67c,_0x49f1d2={})=>terminalManager[_0x5b77f8(0x2c5)](_0x49f1d2)),_0x4ada6c('plugins:'+'list',async()=>{const _0x3327a8=_0x5b77f8,_0x44380c=gatewayController?.[_0x3327a8(0x1f7)+_0x3327a8(0x1fc)]?.()||{};return _0x44380c[_0x3327a8(0x37b)]||[];}),_0x4ada6c(_0x5b77f8(0x2e1)+_0x5b77f8(0x1f1)+'ig',async(_0x334562,_0x522556={})=>{const _0x2244b3=String(_0x522556['pluginId']||_0x522556['id']||''),_0x238fcf=await readMutableConfig(),_0x3f5a90=_0x238fcf['plugins']?.['entries']||{};return _0x2244b3?_0x3f5a90[_0x2244b3]||null:_0x3f5a90;}),_0x4ada6c(_0x5b77f8(0x2e1)+_0x5b77f8(0x288)+'onfig',async(_0xbe4488,_0x10f2db={})=>{const _0x3b68d3=_0x5b77f8,_0x33e1c9=String(_0x10f2db[_0x3b68d3(0x1ad)]||_0x10f2db['id']||'');if(!_0x33e1c9)throw new Error(_0x3b68d3(0x1ad)+_0x3b68d3(0x377)+_0x3b68d3(0x240));const _0x4a5ab8=await readMutableConfig(),_0x1c7a76=_0x4a5ab8[_0x3b68d3(0x37b)]&&typeof _0x4a5ab8['plugins']===_0x3b68d3(0x1ca)?_0x4a5ab8[_0x3b68d3(0x37b)]:{},_0x4d4251=_0x1c7a76[_0x3b68d3(0x419)]&&typeof _0x1c7a76['entries']===_0x3b68d3(0x1ca)?_0x1c7a76[_0x3b68d3(0x419)]:{};return _0x4d4251[_0x33e1c9]={..._0x4d4251[_0x33e1c9]||{},..._0x10f2db[_0x3b68d3(0x306)]||_0x10f2db[_0x3b68d3(0x43b)]||{}},_0x1c7a76['entries']=_0x4d4251,_0x4a5ab8['plugins']=_0x1c7a76,_0xe25fa9(_0x4a5ab8,_0x3b68d3(0x15c)+_0x3b68d3(0x278)+_0x3b68d3(0x2bf));}),_0x4ada6c('plugins:'+_0x5b77f8(0x2f6),async(_0x22f182,_0x261ddf={})=>{const _0x5c80b1=_0x5b77f8,_0x241499=String(_0x261ddf['pluginId']||_0x261ddf['id']||'');if(!_0x241499)throw new Error('pluginId'+_0x5c80b1(0x377)+_0x5c80b1(0x240));const _0x35b45a=await readMutableConfig(),_0x59529b=_0x35b45a['plugins']&&typeof _0x35b45a[_0x5c80b1(0x37b)]===_0x5c80b1(0x1ca)?_0x35b45a[_0x5c80b1(0x37b)]:{},_0x3ace27=_0x59529b[_0x5c80b1(0x419)]&&typeof _0x59529b[_0x5c80b1(0x419)]===_0x5c80b1(0x1ca)?_0x59529b['entries']:{};return _0x3ace27[_0x241499]={..._0x3ace27[_0x241499]||{},'enabled':!![]},_0x59529b[_0x5c80b1(0x419)]=_0x3ace27,_0x35b45a[_0x5c80b1(0x37b)]=_0x59529b,_0xe25fa9(_0x35b45a,_0x5c80b1(0x3e3)+_0x5c80b1(0x22f));}),_0x4ada6c(_0x5b77f8(0x2e1)+_0x5b77f8(0x3e0),async(_0x26eba0,_0x149115={})=>{const _0x3db3e9=_0x5b77f8,_0x56eea7=String(_0x149115[_0x3db3e9(0x1ad)]||_0x149115['id']||'');if(!_0x56eea7)throw new Error(_0x3db3e9(0x1ad)+_0x3db3e9(0x377)+_0x3db3e9(0x240));const _0x2dc471=await readMutableConfig(),_0x4cc0e7=_0x2dc471[_0x3db3e9(0x37b)]&&typeof _0x2dc471[_0x3db3e9(0x37b)]==='object'?_0x2dc471[_0x3db3e9(0x37b)]:{},_0x17e08e=_0x4cc0e7[_0x3db3e9(0x419)]&&typeof _0x4cc0e7[_0x3db3e9(0x419)]===_0x3db3e9(0x1ca)?_0x4cc0e7[_0x3db3e9(0x419)]:{};return _0x17e08e[_0x56eea7]={..._0x17e08e[_0x56eea7]||{},'enabled':![]},_0x4cc0e7[_0x3db3e9(0x419)]=_0x17e08e,_0x2dc471[_0x3db3e9(0x37b)]=_0x4cc0e7,_0xe25fa9(_0x2dc471,_0x3db3e9(0x2d9)+_0x3db3e9(0x2d1));}),_0x4ada6c('plugins:'+'status',async(_0x18133f,_0xc4eabb={})=>({'plugins':await((async()=>{const _0x1edd6a=_0x5b77f8,_0x95ce51=gatewayController?.['runtimeI'+_0x1edd6a(0x1fc)]?.()||{};if(!_0xc4eabb?.['pluginId']&&!_0xc4eabb?.['id'])return _0x95ce51['plugins']||[];const _0x411eb6=String(_0xc4eabb[_0x1edd6a(0x1ad)]||_0xc4eabb['id']||'');return(_0x95ce51[_0x1edd6a(0x37b)]||[])['filter'](_0x35b0d4=>_0x35b0d4['pluginId']===_0x411eb6);})())})),_0x4ada6c(_0x5b77f8(0x33a)+_0x5b77f8(0x2a5),async(_0x41222f,_0x4f02b9)=>({'ok':!![],'payload':_0x4f02b9})),_0x4ada6c(_0x5b77f8(0x173)+_0x5b77f8(0x20f)+'e',async(_0x1d2e76,_0x4ca4c1)=>{const _0x55fa9c=_0x5b77f8;return broadcast(_0x55fa9c(0x188)+'mand',_0x4ca4c1),{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x283)+_0x5b77f8(0x444)+'nt-state',async()=>{const _0xba3e47=_0x5b77f8;return broadcast('tabs-age'+_0xba3e47(0x1f6)+_0xba3e47(0x257),{}),{'ok':!![]};}),_0x4ada6c('tabs:ref'+_0x5b77f8(0x186)+_0x5b77f8(0x1f6),async(_0x387fd3,_0x20d7ba={})=>{const _0x2daaa3=_0x5b77f8;return broadcast('tabs-age'+_0x2daaa3(0x1f6)+_0x2daaa3(0x371)+_0x2daaa3(0x257),_0x20d7ba),{'ok':!![]};}),_0x4ada6c('window:m'+_0x5b77f8(0x292),_0x5c9f89=>{const _0x1bde0e=_0x5b77f8;return BrowserWindow[_0x1bde0e(0x380)+_0x1bde0e(0x308)](_0x5c9f89[_0x1bde0e(0x35e)])?.[_0x1bde0e(0x42e)](),{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x319)+'oggle-ma'+_0x5b77f8(0x348),_0x582609=>{const _0x394fc5=_0x5b77f8,_0x4a3a98=BrowserWindow[_0x394fc5(0x380)+_0x394fc5(0x308)](_0x582609['sender']);if(!_0x4a3a98)return{'isMaximized':![]};if(_0x4a3a98['isMaximi'+_0x394fc5(0x1d1)]())_0x4a3a98[_0x394fc5(0x29a)+'ze']();else _0x4a3a98[_0x394fc5(0x179)]();return{'isMaximized':_0x4a3a98[_0x394fc5(0x415)+'zed']()};}),_0x4ada6c('window:c'+_0x5b77f8(0x3a1),_0x1a1ebf=>{const _0x4fbb35=_0x5b77f8;return BrowserWindow[_0x4fbb35(0x380)+_0x4fbb35(0x308)](_0x1a1ebf[_0x4fbb35(0x35e)])?.[_0x4fbb35(0x2c5)](),{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x406)+_0x5b77f8(0x373)+_0x5b77f8(0x1ee),()=>openDevToolsForActiveContext()),_0x4ada6c(_0x5b77f8(0x397)+_0x5b77f8(0x327)+_0x5b77f8(0x2dc),()=>_0x1a10ee()[_0x5b77f8(0x1f7)+'nfo']()),_0x4ada6c(_0x5b77f8(0x397)+_0x5b77f8(0x3c1)+_0x5b77f8(0x1bc),async()=>(await ensureGatewayControllerStarted())['getStatu'+'s']()),_0x4ada6c('openclaw'+_0x5b77f8(0x3c1)+'-restart',()=>_0x1a10ee()[_0x5b77f8(0x1d5)](_0x5b77f8(0x23d)+'\x20request')),_0x4ada6c('openclaw'+':loading'+_0x5b77f8(0x35c)+_0x5b77f8(0x30d),async()=>({'loadingLifeCycle':'ready','message':'','updatedAt':new Date()[_0x5b77f8(0x261)+_0x5b77f8(0x211)]()})),_0x4ada6c(_0x5b77f8(0x397)+_0x5b77f8(0x3c1)+'-logs',(_0xf6a708,_0x1f05fc={})=>_0x1a10ee()[_0x5b77f8(0x162)+_0x5b77f8(0x31d)](_0x1f05fc?.[_0x5b77f8(0x3d1)]??0xc8)),_0x4ada6c(_0x5b77f8(0x397)+_0x5b77f8(0x360)+'ask-user'+_0x5b77f8(0x263)+'n',(_0x5bf500,_0x365fa6)=>_0x1a10ee()[_0x5b77f8(0x26d)+'kUserQue'+_0x5b77f8(0x38d)](_0x365fa6)),_0x4ada6c(_0x5b77f8(0x397)+_0x5b77f8(0x1f2)+'i-window',async()=>{const _0x350b30=_0x5b77f8,_0x4edde2=join(resolveRuntimeRoot(shellConfig[_0x350b30(0x2e9)+_0x350b30(0x196)]),'bin',_0x350b30(0x200)+'w');if(!existsSync(_0x4edde2))throw new Error(_0x350b30(0x397)+_0x350b30(0x2f9)+_0x350b30(0x14d)+_0x350b30(0x3f8)+_0x4edde2+(_0x350b30(0x25b)+_0x350b30(0x2a9)+_0x350b30(0x1ed)+_0x350b30(0x1b4)));const _0x309b22=join(app['getPath'](_0x350b30(0x195)),_0x350b30(0x385)+_0x350b30(0x17c)+_0x350b30(0x2cc));await writeFile(_0x309b22,'#!/bin/s'+_0x350b30(0x336)+_0x4edde2[_0x350b30(0x1e4)](/\\/g,'\x5c\x5c')['replace'](/"/g,'\x5c\x22')+'\x22\x0a',{'mode':0x1ed});const _0x49958f=spawn(_0x350b30(0x166),['-a','Terminal',_0x309b22],{'detached':!![],'stdio':'ignore'});return _0x49958f[_0x350b30(0x26b)](),{'ok':!![],'cliPath':_0x4edde2};}),_0x4ada6c(_0x5b77f8(0x3d9)+_0x5b77f8(0x2ad),()=>_0x1a10ee()[_0x5b77f8(0x437)]['list']()),_0x4ada6c(_0x5b77f8(0x182)+'tatus',(_0x47c79e,_0x27dccb)=>_0x1a10ee()[_0x5b77f8(0x216)][_0x5b77f8(0x1fe)](_0x27dccb)),_0x4ada6c(_0x5b77f8(0x17a)+_0x5b77f8(0x438),(_0xee17df,_0x3a6ed9)=>_0x1a10ee()[_0x5b77f8(0x17a)][_0x5b77f8(0x260)](_0x3a6ed9)),_0x4ada6c(_0x5b77f8(0x17a)+_0x5b77f8(0x40f),(_0x5a34a1,_0x571b61)=>_0x1a10ee()[_0x5b77f8(0x17a)][_0x5b77f8(0x218)](_0x571b61)),_0x4ada6c(_0x5b77f8(0x17a)+_0x5b77f8(0x40b),(_0x18aec8,_0x4f6a18)=>_0x1a10ee()[_0x5b77f8(0x17a)][_0x5b77f8(0x164)](_0x4f6a18)),_0x4ada6c(_0x5b77f8(0x19d)+_0x5b77f8(0x22a),(_0x3a2e29,_0x1ddbbf)=>_0x1a10ee()['chat']['stream'](_0x1ddbbf)),_0x4ada6c('chat:abo'+'rt',(_0xb78499,_0x33696b)=>_0x1a10ee()[_0x5b77f8(0x1d8)][_0x5b77f8(0x27d)](_0x33696b)),_0x4ada6c(_0x5b77f8(0x361)+_0x5b77f8(0x1f5),(_0x73118a,_0x9b2afe)=>_0x1a10ee()[_0x5b77f8(0x1d8)][_0x5b77f8(0x2be)](_0x9b2afe)),_0x4ada6c(_0x5b77f8(0x17f)+'te',async(_0x535294,_0x582072={})=>{const _0x3ec6cd=_0x5b77f8,_0x33e916=typeof _0x582072['level']===_0x3ec6cd(0x2fc)?_0x582072[_0x3ec6cd(0x3b6)]:_0x3ec6cd(0x24a),_0x2a7cb9=typeof _0x582072['message']===_0x3ec6cd(0x2fc)?_0x582072['message']:_0x3ec6cd(0x23d)+_0x3ec6cd(0x1bd),_0x5ac657=typeof _0x582072[_0x3ec6cd(0x213)]===_0x3ec6cd(0x2fc)&&_0x582072[_0x3ec6cd(0x213)][_0x3ec6cd(0x22e)]()?_0x3ec6cd(0x23d)+':'+_0x582072['context'][_0x3ec6cd(0x22e)]():_0x3ec6cd(0x23d),_0x4bd725=_0x582072['meta']&&typeof _0x582072[_0x3ec6cd(0x2f7)]===_0x3ec6cd(0x1ca)?{...summarizePayload(_0x582072[_0x3ec6cd(0x2f7)]),'context':_0x5ac657}:{'context':_0x5ac657},_0x3a5bff=rendererLogger;if(_0x3a5bff?.[_0x33e916])await _0x3a5bff[_0x33e916](_0x2a7cb9,_0x4bd725);else await _0x3a5bff?.['info'](_0x2a7cb9,_0x4bd725);if(_0x582072[_0x3ec6cd(0x3b5)+'ic']===!![]||_0x5ac657===_0x3ec6cd(0x23d)+_0x3ec6cd(0x255)+_0x3ec6cd(0x2b2)){const _0x26072b=_0x582072[_0x3ec6cd(0x16d)]&&typeof _0x582072[_0x3ec6cd(0x16d)]==='object'?_0x582072[_0x3ec6cd(0x16d)]:_0x582072[_0x3ec6cd(0x2f7)]?.[_0x3ec6cd(0x16d)]&&typeof _0x582072[_0x3ec6cd(0x2f7)][_0x3ec6cd(0x16d)]==='object'?_0x582072[_0x3ec6cd(0x2f7)][_0x3ec6cd(0x16d)]:{'level':_0x33e916,'category':'renderer','event':_0x5ac657,'message':_0x2a7cb9,'meta':_0x582072[_0x3ec6cd(0x2f7)]};await diagnosticsWriter?.[_0x3ec6cd(0x428)+'nt'](_0x26072b,{'captureIncident':String(_0x26072b[_0x3ec6cd(0x3b6)]||_0x33e916)['toLowerC'+_0x3ec6cd(0x231)]()===_0x3ec6cd(0x157)||_0x582072[_0x3ec6cd(0x355)+_0x3ec6cd(0x2fe)]===!![]});}return{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x449)+_0x5b77f8(0x300),async(_0x4ed19a,_0x22b2a1={})=>{const _0x4a0d6a=_0x5b77f8,_0x403b7c=typeof _0x22b2a1[_0x4a0d6a(0x3cb)+'r']===_0x4a0d6a(0x2fc)&&_0x22b2a1[_0x4a0d6a(0x3cb)+'r'][_0x4a0d6a(0x22e)]()?_0x22b2a1[_0x4a0d6a(0x3cb)+'r']:undefined,_0x4b0867=await exportLogsArchive({'logsDir':configController[_0x4a0d6a(0x381)][_0x4a0d6a(0x3b7)],'targetDir':_0x403b7c,'appVersion':app['getVersi'+'on']()});return mainLogger?.[_0x4a0d6a(0x24a)](_0x4a0d6a(0x390)+_0x4a0d6a(0x433),{'path':toHomePath(_0x4b0867['path'])}),_0x4b0867;}),_0x4ada6c('logs:ope'+_0x5b77f8(0x350)+_0x5b77f8(0x185),async()=>{const _0x3b2acc=_0x5b77f8;return await shell[_0x3b2acc(0x3d7)](configController[_0x3b2acc(0x381)]['logsDir']),mainLogger?.[_0x3b2acc(0x24a)](_0x3b2acc(0x1cc)+'ectory\x20o'+'pened',{'logsDir':toHomePath(configController[_0x3b2acc(0x381)][_0x3b2acc(0x3b7)])}),{'ok':!![],'path':configController[_0x3b2acc(0x381)][_0x3b2acc(0x3b7)]};}),_0x4ada6c(_0x5b77f8(0x265)+'t',async()=>{const _0x5dad05=_0x5b77f8,_0x25115d=await readdir(configController[_0x5dad05(0x381)][_0x5dad05(0x3b7)],{'recursive':!![]})['catch'](()=>[]);return _0x25115d;}),_0x4ada6c(_0x5b77f8(0x3ac)+'d',async(_0x49bc1f,_0x2b627f={})=>{const _0x3e7466=_0x5b77f8,_0x2258b3=String(_0x2b627f[_0x3e7466(0x2a1)]||'');if(!_0x2258b3)throw new Error('path\x20is\x20'+_0x3e7466(0x282));return readFile(_0x2258b3,'utf8');}),_0x4ada6c('files:re'+'ad',async(_0x482f23,_0x3b6e36)=>{const _0x5be14f=_0x5b77f8,_0x2bcab7=Date['now']();try{const _0x5d680d=await readFile(_0x3b6e36,_0x5be14f(0x3d0));return filesLogger?.[_0x5be14f(0x24a)]('file\x20rea'+_0x5be14f(0x330)+'ted',{'path':toHomePath(_0x3b6e36),'bytes':Buffer[_0x5be14f(0x35f)+'th'](_0x5d680d),'durationMs':Date[_0x5be14f(0x274)]()-_0x2bcab7}),_0x5d680d;}catch(_0x3d4ed9){filesLogger?.['error']('file\x20rea'+'d\x20failed',{'path':toHomePath(_0x3b6e36),'durationMs':Date[_0x5be14f(0x274)]()-_0x2bcab7,'error':summarizeError(_0x3d4ed9)});throw _0x3d4ed9;}}),_0x4ada6c(_0x5b77f8(0x3c2)+_0x5b77f8(0x1c9)+'y',async(_0x17a0d0,_0x270a7b)=>{const _0x31e98a=_0x5b77f8,_0x416676=Date['now']();try{const _0x3b75ed=await readFile(_0x270a7b);return filesLogger?.[_0x31e98a(0x24a)](_0x31e98a(0x2df)+_0x31e98a(0x435)+_0x31e98a(0x27a)+'ed',{'path':toHomePath(_0x270a7b),'bytes':_0x3b75ed[_0x31e98a(0x35f)+'th'],'durationMs':Date[_0x31e98a(0x274)]()-_0x416676}),new Uint8Array(_0x3b75ed);}catch(_0x34d232){filesLogger?.['error']('binary\x20f'+_0x31e98a(0x435)+'\x20failed',{'path':toHomePath(_0x270a7b),'durationMs':Date[_0x31e98a(0x274)]()-_0x416676,'error':summarizeError(_0x34d232)});throw _0x34d232;}}),_0x4ada6c(_0x5b77f8(0x29e)+_0x5b77f8(0x273),async(_0x5c847b,_0x33ae27={})=>{const _0x3de408=_0x5b77f8,_0x337f9c=Date[_0x3de408(0x274)]();return await writeFile(_0x33ae27[_0x3de408(0x2a1)],_0x33ae27[_0x3de408(0x24f)]??'',_0x3de408(0x3d0)),filesLogger?.['info'](_0x3de408(0x2b1)+_0x3de408(0x3a5)+'eted',{'path':toHomePath(_0x33ae27[_0x3de408(0x2a1)]),'bytes':Buffer[_0x3de408(0x35f)+'th'](String(_0x33ae27[_0x3de408(0x24f)]??'')),'durationMs':Date[_0x3de408(0x274)]()-_0x337f9c}),{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x29e)+_0x5b77f8(0x24d)+'ry',async(_0x3fec2d,_0x45991b={})=>{const _0x1da8f2=_0x5b77f8,_0x4f534e=Date['now']();await writeFile(_0x45991b[_0x1da8f2(0x2a1)],Buffer[_0x1da8f2(0x1e0)](_0x45991b[_0x1da8f2(0x24f)]??[]));const _0x1d4809=await stat(_0x45991b[_0x1da8f2(0x2a1)])['catch'](()=>null);return filesLogger?.['info'](_0x1da8f2(0x2df)+_0x1da8f2(0x2a3)+_0x1da8f2(0x29d)+_0x1da8f2(0x167),{'path':toHomePath(_0x45991b[_0x1da8f2(0x2a1)]),'bytes':_0x1d4809?.['size']??0x0,'durationMs':Date[_0x1da8f2(0x274)]()-_0x4f534e}),{'ok':!![]};}),_0x4ada6c(_0x5b77f8(0x1a5)+'lect-fil'+'e',async(_0x1a5cb1,_0x291dd3={})=>{const _0x4d4645=_0x5b77f8,_0x15c350=await dialog['showOpen'+_0x4d4645(0x41d)](BrowserWindow[_0x4d4645(0x380)+'ontents'](_0x1a5cb1['sender'])??mainWindow,{'title':typeof _0x291dd3[_0x4d4645(0x1ba)]===_0x4d4645(0x2fc)?_0x291dd3[_0x4d4645(0x1ba)]:undefined,'properties':[_0x4d4645(0x304),..._0x291dd3[_0x4d4645(0x316)+_0x4d4645(0x2ca)]?[_0x4d4645(0x316)+_0x4d4645(0x2ca)]:[]],'filters':Array['isArray'](_0x291dd3['filters'])?_0x291dd3['filters']:undefined});return filesLogger?.['info'](_0x4d4645(0x250)+_0x4d4645(0x32b)+_0x4d4645(0x286),{'canceled':_0x15c350['canceled'],'count':_0x15c350[_0x4d4645(0x2a8)+'s']['length'],'paths':_0x15c350[_0x4d4645(0x2a8)+'s'][_0x4d4645(0x349)](toHomePath)}),{'canceled':_0x15c350[_0x4d4645(0x16a)],'paths':_0x15c350[_0x4d4645(0x2a8)+'s']};}),_0x4ada6c(_0x5b77f8(0x266)+'st-direc'+_0x5b77f8(0x1f5),async(_0x1bd11f,_0x2cbaf9={})=>{const _0x2bcbc1=_0x5b77f8,_0x3dee06=resolve(String(_0x2cbaf9['path']||'')),_0x3588c3=_0x2cbaf9[_0x2bcbc1(0x40c)+'e']!==![],_0x589e4a=Array[_0x2bcbc1(0x2f3)](_0x2cbaf9[_0x2bcbc1(0x3f6)+'ns'])?_0x2cbaf9[_0x2bcbc1(0x3f6)+'ns'][_0x2bcbc1(0x349)](_0x2c629b=>String(_0x2c629b)[_0x2bcbc1(0x3cc)+'ase']()[_0x2bcbc1(0x1e4)](/^\./,''))[_0x2bcbc1(0x22c)](Boolean):null,_0x500c32=Number[_0x2bcbc1(0x193)+'r'](_0x2cbaf9[_0x2bcbc1(0x219)+'es'])&&_0x2cbaf9[_0x2bcbc1(0x219)+'es']>0x0?_0x2cbaf9['maxEntri'+'es']:0xc350,_0x38bb68=[];let _0xe71cd6=![];async function _0x591b2c(_0x7b27b7){const _0x5ae8b0=_0x2bcbc1;if(_0xe71cd6)return;let _0x36939e;try{_0x36939e=await readdir(_0x7b27b7,{'withFileTypes':!![]});}catch{return;}for(const _0x14268b of _0x36939e){if(_0xe71cd6)return;if(_0x14268b[_0x5ae8b0(0x217)][_0x5ae8b0(0x236)+'th']('.'))continue;const _0x40de85=join(_0x7b27b7,_0x14268b['name']);if(_0x14268b['isDirect'+_0x5ae8b0(0x185)]()){if(_0x3588c3)await _0x591b2c(_0x40de85);continue;}if(!_0x14268b[_0x5ae8b0(0x3ef)]())continue;if(_0x589e4a){const _0x402f5f=_0x14268b[_0x5ae8b0(0x217)]['lastInde'+'xOf']('.'),_0x377340=_0x402f5f>=0x0?_0x14268b[_0x5ae8b0(0x217)]['slice'](_0x402f5f+0x1)[_0x5ae8b0(0x3cc)+_0x5ae8b0(0x231)]():'';if(!_0x589e4a[_0x5ae8b0(0x17d)](_0x377340))continue;}if(_0x38bb68[_0x5ae8b0(0x3b3)]>=_0x500c32){_0xe71cd6=!![];return;}_0x38bb68[_0x5ae8b0(0x40e)]({'name':_0x14268b[_0x5ae8b0(0x217)],'path':_0x40de85});}}return await _0x591b2c(_0x3dee06),{'path':_0x3dee06,'entries':_0x38bb68,'truncated':_0xe71cd6};}),_0x4ada6c(_0x5b77f8(0x1a5)+_0x5b77f8(0x163)+_0x5b77f8(0x368),async(_0x149fc3,_0x2fab13={})=>{const _0xe5c232=_0x5b77f8,_0x407eb2=await dialog[_0xe5c232(0x1e8)+_0xe5c232(0x41d)](BrowserWindow[_0xe5c232(0x380)+_0xe5c232(0x308)](_0x149fc3[_0xe5c232(0x35e)])??mainWindow,{'title':typeof _0x2fab13[_0xe5c232(0x1ba)]===_0xe5c232(0x2fc)?_0x2fab13[_0xe5c232(0x1ba)]:undefined,'properties':[_0xe5c232(0x3ee)+_0xe5c232(0x31b)]});return filesLogger?.['info']('select\x20d'+'irectory'+_0xe5c232(0x27a)+'ed',{'canceled':_0x407eb2['canceled'],'count':_0x407eb2['filePath'+'s'][_0xe5c232(0x3b3)],'paths':_0x407eb2[_0xe5c232(0x2a8)+'s'][_0xe5c232(0x349)](toHomePath)}),{'canceled':_0x407eb2['canceled'],'paths':_0x407eb2[_0xe5c232(0x2a8)+'s']};}),_0x4ada6c(_0x5b77f8(0x34d)+_0x5b77f8(0x1fb)+_0x5b77f8(0x1a3),()=>_0x1a10ee()[_0x5b77f8(0x34d)+'e'][_0x5b77f8(0x325)+_0x5b77f8(0x20b)]()),_0x4ada6c('workspac'+_0x5b77f8(0x289)+_0x5b77f8(0x1eb),async()=>{const _0x1e0b63=_0x5b77f8,_0x2c3221=await _0x1a10ee()[_0x1e0b63(0x34d)+'e'][_0x1e0b63(0x325)+'yInfo']();return await shell['openPath'](_0x2c3221[_0x1e0b63(0x2a1)]),filesLogger?.['info'](_0x1e0b63(0x34d)+'e\x20direct'+_0x1e0b63(0x226)+'ed',{'path':toHomePath(_0x2c3221['path'])}),{'ok':!![],'path':_0x2c3221[_0x1e0b63(0x2a1)]};}),_0x4ada6c(_0x5b77f8(0x34d)+_0x5b77f8(0x40d)+_0x5b77f8(0x14e),()=>_0x1a10ee()[_0x5b77f8(0x34d)+'e'][_0x5b77f8(0x34e)+_0x5b77f8(0x326)]()),_0x4ada6c(_0x5b77f8(0x34d)+_0x5b77f8(0x15b)+_0x5b77f8(0x3a7)+_0x5b77f8(0x2c9),(_0x106dd0,_0x1cbef4)=>_0x1a10ee()['workspac'+'e'][_0x5b77f8(0x2aa)+_0x5b77f8(0x1cf)+'xt'](_0x1cbef4)),_0x4ada6c(_0x5b77f8(0x17a)+_0x5b77f8(0x417),(_0x36e5a3,_0x375c8e)=>_0x1a10ee()[_0x5b77f8(0x17a)][_0x5b77f8(0x3f7)](_0x375c8e)),_0x4ada6c('sessions'+_0x5b77f8(0x277)+_0x5b77f8(0x15d),()=>_0x1a10ee()['sessions']['pinnedKe'+'ys']()),_0x4ada6c(_0x5b77f8(0x17a)+_0x5b77f8(0x3b9)+'ned-keys',(_0x47f2f3,_0xdd9f7)=>_0x1a10ee()['sessions']['setPinne'+_0x5b77f8(0x20c)](_0xdd9f7)),_0x4ada6c('skills:i'+_0x5b77f8(0x165),(_0x4f63d0,_0xeae55c)=>_0x1a10ee()[_0x5b77f8(0x216)][_0x5b77f8(0x3f0)](_0xeae55c)),_0x4ada6c('cron:lis'+'t',(_0x40c3e8,_0x15b4c5)=>_0x1a10ee()[_0x5b77f8(0x41b)][_0x5b77f8(0x218)](_0x15b4c5)),_0x4ada6c(_0x5b77f8(0x3c6)+_0x5b77f8(0x2c4),(_0xd16301,_0x4b21d9)=>_0x1a10ee()[_0x5b77f8(0x41b)]['create'](_0x4b21d9)),_0x4ada6c(_0x5b77f8(0x32a)+_0x5b77f8(0x2c4),(_0x5a83e2,_0x38c05c)=>_0x1a10ee()['cron'][_0x5b77f8(0x248)](_0x38c05c)),_0x4ada6c(_0x5b77f8(0x1c0)+_0x5b77f8(0x33b),(_0x3b7897,_0x3e1710)=>_0x1a10ee()[_0x5b77f8(0x41b)]['remove'](_0x3e1710)),_0x4ada6c(_0x5b77f8(0x39d)+_0x5b77f8(0x21f),(_0x398a96,_0x26093e)=>_0x1a10ee()[_0x5b77f8(0x41b)][_0x5b77f8(0x3e5)](_0x26093e)),_0x4ada6c(_0x5b77f8(0x150)+'s',(_0x18858f,_0x580cd5)=>_0x1a10ee()['cron'][_0x5b77f8(0x2db)](_0x580cd5)),_0x4ada6c(_0x5b77f8(0x3e7)+'omplete',async(_0x5a9921,_0x15b4af={})=>{const _0x44359d=_0x5b77f8,_0x59d96c=configController['resolveC'+_0x44359d(0x3db)+'h'](),_0x17bb10=JSON[_0x44359d(0x3e6)](await readFile(_0x59d96c,_0x44359d(0x3d0))),_0x503d14=_0x17bb10?.['models']?.[_0x44359d(0x2a4)+'s']&&typeof _0x17bb10[_0x44359d(0x34b)][_0x44359d(0x2a4)+'s']===_0x44359d(0x1ca)?_0x17bb10[_0x44359d(0x34b)]['provider'+'s']:{},_0x2ffec7=typeof _0x17bb10?.[_0x44359d(0x437)]?.[_0x44359d(0x1b3)]?.['model']?.[_0x44359d(0x352)]===_0x44359d(0x2fc)?_0x17bb10[_0x44359d(0x437)]['defaults'][_0x44359d(0x43d)][_0x44359d(0x352)]:'',_0x447da0=String(_0x15b4af['model']||_0x2ffec7||'');if(!_0x447da0['includes']('/'))throw new Error('no\x20defau'+_0x44359d(0x370)+_0x44359d(0x2ea)+_0x44359d(0x386)+_0x44359d(0x38f)+_0x44359d(0x198)+_0x44359d(0x3fe));const _0x2db6b9=_0x447da0[_0x44359d(0x376)]('/'),_0x2faec0=_0x447da0[_0x44359d(0x297)](0x0,_0x2db6b9),_0x167f65=_0x447da0['slice'](_0x2db6b9+0x1),_0x5af46b=_0x503d14[_0x2faec0];if(!_0x5af46b||typeof _0x5af46b!==_0x44359d(0x1ca))throw new Error('provider'+_0x44359d(0x39a)+_0x44359d(0x26a)+'\x20'+_0x2faec0);const _0x51456d=String(_0x5af46b[_0x44359d(0x2f2)]||_0x44359d(0x220)+_0x44359d(0x2b7)+_0x44359d(0x2af)+'1')[_0x44359d(0x22e)]()[_0x44359d(0x1e4)](/\/$/,''),_0x7a7a83=await fetch(_0x51456d+(_0x44359d(0x39f)+_0x44359d(0x34f)+'s'),{'method':_0x44359d(0x15a),'headers':{'content-type':_0x44359d(0x1ea)+_0x44359d(0x1b8),'Authorization':'Bearer\x20'+(_0x5af46b[_0x44359d(0x32f)]||''),..._0x5af46b[_0x44359d(0x155)]&&typeof _0x5af46b['headers']===_0x44359d(0x1ca)?_0x5af46b[_0x44359d(0x155)]:{}},'body':JSON[_0x44359d(0x1c7)+'y']({'model':_0x167f65,'max_tokens':Number[_0x44359d(0x193)+'r'](_0x15b4af[_0x44359d(0x42c)+'s'])?_0x15b4af[_0x44359d(0x42c)+'s']:0x400,'temperature':typeof _0x15b4af[_0x44359d(0x172)+_0x44359d(0x3bf)]===_0x44359d(0x20e)?_0x15b4af[_0x44359d(0x172)+_0x44359d(0x3bf)]:undefined,'messages':Array[_0x44359d(0x2f3)](_0x15b4af[_0x44359d(0x238)])?_0x15b4af[_0x44359d(0x238)]:[]}),'signal':AbortSignal[_0x44359d(0x29c)](Number[_0x44359d(0x193)+'r'](_0x15b4af['timeoutM'+'s'])?_0x15b4af[_0x44359d(0x187)+'s']:0x1d4c0)});if(!_0x7a7a83['ok']){const _0x5c9bca=await _0x7a7a83[_0x44359d(0x14f)]();throw new Error(_0x44359d(0x225)+'tp\x20'+_0x7a7a83['status']+':\x20'+_0x5c9bca[_0x44359d(0x297)](0x0,0x190));}const _0x5c6d04=await _0x7a7a83[_0x44359d(0x199)](),_0x23127c=_0x5c6d04?.[_0x44359d(0x223)]?.[0x0]?.['message']??{};return{'content':extractModelMessageContent(_0x23127c['content']),'reasoning':typeof _0x23127c[_0x44359d(0x37f)+_0x44359d(0x21d)+'t']==='string'?_0x23127c[_0x44359d(0x37f)+_0x44359d(0x21d)+'t']:'','model':_0x5c6d04?.[_0x44359d(0x43d)]||_0x167f65};}),_0x4ada6c(_0x5b77f8(0x338)+'ettings',()=>_0x1a10ee()[_0x5b77f8(0x34b)][_0x5b77f8(0x2e3)]()),_0x4ada6c(_0x5b77f8(0x338)+_0x5b77f8(0x2e7)+_0x5b77f8(0x3dc),(_0x5252ad,_0x8c6909)=>_0x1a10ee()[_0x5b77f8(0x34b)][_0x5b77f8(0x221)+_0x5b77f8(0x3dc)](_0x8c6909)),_0x4ada6c(_0x5b77f8(0x338)+'et-self-'+'operated',(_0x330450,_0x58f411)=>_0x1a10ee()[_0x5b77f8(0x34b)]['setSelfO'+_0x5b77f8(0x394)+_0x5b77f8(0x314)](_0x58f411)),_0x4ada6c(_0x5b77f8(0x338)+_0x5b77f8(0x207)+_0x5b77f8(0x169),()=>_0x1a10ee()[_0x5b77f8(0x34b)][_0x5b77f8(0x1f4)+_0x5b77f8(0x30a)]()),_0x4ada6c(_0x5b77f8(0x3e7)+'ustom-mo'+'dels',()=>_0x1a10ee()['models'][_0x5b77f8(0x18e)+_0x5b77f8(0x203)]()),_0x4ada6c(_0x5b77f8(0x3b0)+_0x5b77f8(0x241)+_0x5b77f8(0x332)+'ources',async()=>{const _0x2236c2=_0x5b77f8,_0x67db47=await prepareRuntime(shellConfig,{'syncOnly':!![]});return await configController[_0x2236c2(0x275)+_0x2236c2(0x268)+'ns'](),{'ok':!![],'syncedAt':new Date()[_0x2236c2(0x261)+_0x2236c2(0x211)](),'manifest':_0x67db47,'status':await getRuntimeResourceStatus()};}),_0x4ada6c(_0x5b77f8(0x3b0)+_0x5b77f8(0x409)+_0x5b77f8(0x1bc),async()=>getRuntimeResourceStatus());}function _0x4c7f(){const _0x130996=['map','agentId','models','em:open-','workspac','sharedCo','mpletion','n-direct','migrateP','primary','ssion:\x20',':save-we','captureI','HEAD','uri','ists','runtimeR','tus','\x20process','-life-cy','get','sender','byteLeng',':answer-','chat:his','controll','parseInt','dispose','.mkv','.webm','lawPlugi','ectory','kdocs','m-channe','ccept-ra',':save-ne','pping\x20ga','producti','ndlers','lt\x20model','-refresh','input','pen-devt','Custom','ot\x20start','indexOf','\x20is\x20requ','closeToT','ent','\x20main\x20wi','plugins','hostname','ings','ishuDocC','reasonin','fromWebC','paths','set=utf-','lawChann','audio/wa','wujie-sh','red;\x20set','bytes\x20*/','led','content-','range,\x20c','enClawSk','deletedS','stion','nput-eve','\x20a\x20provi','logs\x20exp','gatewayP','wechat','send','peratedM','log','Entry','openclaw','atus','dow\x20load','\x20not\x20con','s:delete','-weixin','cron:run','board:wr','/chat/co','getFeish','lose',':cancel','dataDir','ctron\x20ma','te\x20compl','finally','shared-c','dRejecti','app:info','one','chatChan','logs:rea','config:c','app:clip','preventD','runtime:',':save-di','startFei','length','latest','diagnost','level','logsDir','gateway-',':set-pin','sidebar','ishuRegi','roductCo','ame','started','ure','register',':gateway','files:re','skills:i','deleteOp','arch','cron:cre','Unsuppor','est_fail','bytes\x20','cancelFe','targetDi','toLowerC','-session','mand','openAtLo','utf8','limit','ed:\x20','image/we','gin','index.mj','figs','openPath','IPC\x20requ','agents:l','gatewayT','onfigPat','ngs','index.ht','ngtalk-d','ion','disable','groups','onfig','plugin\x20e','writeTex','runOnce','parse','models:c','ies','ot\x20initi','app:syst','complete','hatChann','tup:set','openDire','isFile','install','les:hide','dist','succeede','ell\x20gate','ion/octe','extensio','rename','\x20found:\x20','uncaught','.flac','toWeb','ncent-ex','getKdocs','l\x20first','mjs','startWec','before\x20q','relaunch','failed','hide','eted','window:o','unhandle','732PmLtHk','resource','ishu-cha',':delete','recursiv','e:shared','push',':list','ItemSett','alized','ssionKey','before-q','nnectSes','isMaximi','lawMcpSe',':rename','nectSess','entries','n\x20loaded','cron','d\x20reject','Dialog','.webp','ocess\x20go','\x20main\x20bo','feishu_d','agent','les:list','pathname','ipc','nges','isDestro','writeEve','ocsCliCo','aseMailC','message','maxToken','productN','minimize','uDocCliC','agents:w','ask-user','setLogin','orted','omModel','ile\x20read','les:dele','agents',':create','sPath','-mail','patch','.wav','model','ipc\x20requ','Invalid\x20','CliConne','s:hide','5406260ImXzqT','updateOp','uest-age','setName','elConfig','clawspac','-by-sess','logs:exp','saveWeco','andledIn',':resize','files','-data','mail','uit','yed','onnector','\x20failed:','nts','pper\x20not','-context','text','cron:log','torConfi','ernal\x20ur',':get-clo','e\x20url','headers','agent-','error','s:upsert','ap:get','POST','e:write-','plugin\x20c','keys','code','image/jp','app:file','43939ceBNuc','getRecen','lect-dir','delete','nstall','open','ted','app:tray','model-id','canceled','agent\x20cr','resolveS','record','text/mar','nectorCo','loadFile','igSnapsh','temperat','tabs:pos','cwd','+Shift+I','agents:d','chat-str','bytes','maximize','sessions','ilConnec','ell-cli.','includes','deleteCu','logs:wri','saveQqbo','stration','skills:s','listImCh','saveFeis','ory','resh-age','timeoutM','tabs-com','liConnec','nConfig','warn','avatar','audio/aa','customMo','entDocsC','node:fs/','Session','readConf','isIntege',':input','temp','oot','electron','der/mode','json','agents-u','illEntry','est\x20star','chat:str','agent\x20de','cancelWe',':save-fe','reate','.jpeg','ory-info',':save','files:se','ipc_requ','-exit','video/mp','-shortcu','enClawCh','msvideo','emoji','pluginId','annelCon','nfig','unregist','openDevT','agent\x20al','defaults','e\x20first.','ChannelC','senderFr','d-state','ion/json','runtime\x20','title','huChanne','-status','\x20log','\x20shortcu','getFocus','cron:rem','writeCon','channelI','open\x20ext','getVersi','way\x20is\x20n','ProductR','stringif','ocs','ad-binar','object','webConte','logs\x20dir','talkDocC','openExte','redConte','ready\x20ex','zed','set','-port','app:open','restart','OPTIONS','enClawCo','chat','com-chan','ll-close','Config','ell:even','oken','te:downl','shell-ru','from','image/bm','updated','huDocCon','replace','Version','te:check','CommandO','showOpen','main','applicat','irectory','em:resta','l\x20prepar','ools','tup:get','preload.','get-conf',':open-cl','image/gi','selected','tory','nt-state','runtimeI','getAllWi','tf-8','elSessio','e:direct','nfo','handle','status','lConfig','wujiecla','child\x20pr','tChannel','dels','devtools','uired','794278pQcAMz','elected-','9GewTSP','lawSkill','size','yInfo','dKeys','window-a','number','t-messag','chrome','ing',':close','context','pop','orConfig','skills','name','list','maxEntri','.txt','ype','pdate','g_conten','-token','-once','https://','setSetti','ileName','choices','saveKdoc','model\x20ht','ory\x20open','rated-fi','接入自动更新','56655wDoFLD','eam','upsert','filter','image/pn','trim','nabled','.aac','ase','gateway\x20','.gif','.mp4','ationSta','startsWi','app:star','messages','nt]','xOf','dAt','function','renderer','ted\x20conn','customNa','ired','sync-bun','uit:\x20sto','est\x20comp','csCliCon','rocess-g','fig','eating','update','fromIpc','info','ith-sess','t-stream','ite-bina','url','content','select\x20f','oad','.mov','mChannel','ectSessi',':diagnos','nel','-request',':status','appId','max','.\x20Run\x20wu','find','tSession','text/pla','n\x20not\x20fo','create','toISOStr','agent\x20id','-questio','sConnect','logs:lis','files:li','prod','imePlugi','key','figured:','unref','g+xml','answerAs','artifact','ntime','saveDing','darwin','nelSessi','ite','now','syncRunt','SchemesA',':pinned-','onfig\x20up','FeishuDo','\x20complet','length,\x20','ell\x20boot','abort','unsuppor','stop','type','ng;\x20recr','required','tabs:req','Exceptio','.png','leted','7814080wVSbcQ','update-c','e:open-d','kdown;\x20c','video/we','meFilter','agent_id','range','fromEntr','519UObjVU','test','inimize','elete','feishu','[wujie-s','href','slice','GET,\x20HEA','range,\x20a','unmaximi','default','timeout','e\x20comple','files:wr','icktime','payload','path','product','ile\x20writ','provider','igate','control','ged','filePath','jie-shel','writeSha','uRegistr','tate','ist',':save-qq','ai.com/v','saveTenc','file\x20wri','tic','setOpenC','ted-stat','protocol','enClawMc','api.open','all','10890VdbRgM','audio/mp','method','no-store','versions','history','dated','min','stopped\x20','ector\x20se','agents:c','ate','close','config:r','audio/fl','ocess-go','ontext','ections',':set-clo','command','sourcePa',':complet','shuRegis','product\x20','isabled','t:\x20','quit','ap:upser','setImCha','ls:set-e','ndows','dev','plugin\x20d',':save-te','logs','-info','getURL','platform','binary\x20f','eated','plugins:','config:i','settings','1200lcTOdh','rnal','iled\x20to\x20','et-setti','image/sv','projectR','\x20configu','saveCust','wBin','\x20gone','skills:d','Not\x20foun','markConf','getAppPa','baseUrl','isArray','entExmai','ls:delet','enable','meta','preferen','\x20CLI\x20wra','hell:eve','detach','string','app:gene','ncident','hell:ipc','ort','before-i','ces.json','rayOnClo','openFile','configPa','config','ls:list','ontents','rver','ModelId','46431627cyfPxi','edWindow','cle','audio/og','split','node','app:upda',':fork','\x20excepti','odels','activate','multiSel','d-local','video/qu','window:t','hell]\x20fa','ctory','start','tLogs','les:reve','untimeHa','mport-zi','getLogin','navigati','showSave','isPackag','director','ntext',':runtime','folder','Shell\x20暂未','cron:upd','ile\x20comp','te:get-s','ession','terminal','apiKey','d\x20comple','in;\x20char','dled-res','match','isFinite','window:i','h\x0aexec\x20\x22','catch','models:s','tateDir','tabs:nav','ove','will-qui','lConnect','cCliConn','hidden','est\x20fail','saveNetE','unknown','skills:u','nnel','ot\x20compl','video/x-','deleteFi','ximize'];_0x4c7f=function(){return _0x130996;};return _0x4c7f();}async function boot(){const _0x3ccdaa=_0x285fc1;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x3ccdaa(0x445)](shellConfig[_0x3ccdaa(0x42d)+_0x3ccdaa(0x3bd)]),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController[_0x3ccdaa(0x381)],_0x3ccdaa(0x1e9)),ipcLogger=createShellLogger(configController[_0x3ccdaa(0x381)],_0x3ccdaa(0x425)),filesLogger=createShellLogger(configController[_0x3ccdaa(0x381)],_0x3ccdaa(0x145)),rendererLogger=createShellLogger(configController[_0x3ccdaa(0x381)],_0x3ccdaa(0x23d)),productRuntime=await loadProductRuntime();const _0xfa1b12=resolveWujieApiEndpoint();diagnosticsWriter=createDiagnosticsWriter({'logsDir':configController[_0x3ccdaa(0x381)][_0x3ccdaa(0x3b7)],'appContext':{'productName':shellConfig[_0x3ccdaa(0x42d)+_0x3ccdaa(0x3bd)],'appId':shellConfig['appId'],'appVersion':app[_0x3ccdaa(0x1c4)+'on'](),'platform':process[_0x3ccdaa(0x2de)],'arch':process['arch'],..._0xfa1b12?{'apiEndpoint':_0xfa1b12}:{}}}),userEventWriter=createUserEventWriter({'logsDir':configController['paths']['logsDir'],'diagnosticsWriter':diagnosticsWriter}),registerProcessLogHooks(),mainLogger?.[_0x3ccdaa(0x24a)](_0x3ccdaa(0x197)+_0x3ccdaa(0x420)+_0x3ccdaa(0x375)+'ed',{'appVersion':app[_0x3ccdaa(0x1c4)+'on'](),'electronVersion':process[_0x3ccdaa(0x2bd)][_0x3ccdaa(0x197)],'nodeVersion':process['versions'][_0x3ccdaa(0x310)],'chromeVersion':process[_0x3ccdaa(0x2bd)][_0x3ccdaa(0x210)],'platform':process[_0x3ccdaa(0x2de)],'arch':process[_0x3ccdaa(0x3c5)],'mode':getMode(),'projectRoot':shellConfig[_0x3ccdaa(0x2e9)+'oot'],'configPath':shellConfig[_0x3ccdaa(0x305)+'th'],'dataDir':shellConfig[_0x3ccdaa(0x3a3)],'logsDir':configController[_0x3ccdaa(0x381)]['logsDir'],'rendererUrl':process.env.VITE_DEV_SERVER_URL||join(shellConfig['projectR'+_0x3ccdaa(0x196)],_0x3ccdaa(0x3f2),_0x3ccdaa(0x3dd)+'ml')}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x3ccdaa(0x1c4)+'on'](),'productRuntimeHooks':productRuntimeHooks,'userEventWriter':userEventWriter}),typeof productRuntime[_0x3ccdaa(0x351)+_0x3ccdaa(0x3bc)+_0x3ccdaa(0x1af)]===_0x3ccdaa(0x23c)&&await productRuntime[_0x3ccdaa(0x351)+_0x3ccdaa(0x3bc)+_0x3ccdaa(0x1af)]({'configController':configController,'mainLogger':mainLogger}),attachGatewayBroadcastHandlers(gatewayController),installIpcHandlers(),installClawspaceProtocolHandler(),registerShellShortcuts(),await createWindow(),await gatewayController[_0x3ccdaa(0x31c)](),mainLogger?.['info'](_0x3ccdaa(0x197)+'\x20main\x20bo'+_0x3ccdaa(0x345)+_0x3ccdaa(0x405));}function registerProcessLogHooks(){const _0x1252ec=_0x285fc1;if(registerProcessLogHooks['register'+'ed'])return;registerProcessLogHooks[_0x1252ec(0x3c0)+'ed']=!![],process['on'](_0x1252ec(0x3f9)+_0x1252ec(0x284)+'n',_0x5e4393=>{const _0x4d897c=_0x1252ec;mainLogger?.[_0x4d897c(0x157)]('uncaught'+_0x4d897c(0x313)+'on',summarizeError(_0x5e4393));}),process['on'](_0x1252ec(0x407)+_0x1252ec(0x3a8)+'on',_0x48326a=>{const _0x27b55c=_0x1252ec;mainLogger?.[_0x27b55c(0x157)](_0x27b55c(0x407)+_0x27b55c(0x41c)+_0x27b55c(0x3df),summarizeError(_0x48326a));}),app['on']('render-p'+_0x1252ec(0x245)+_0x1252ec(0x3aa),(_0x5c512d,_0x46d004,_0x4f34a4)=>{const _0x40e840=_0x1252ec;mainLogger?.['error'](_0x40e840(0x23d)+_0x40e840(0x35b)+_0x40e840(0x2ed),{'url':_0x46d004[_0x40e840(0x2dd)](),'details':_0x4f34a4});}),app['on']('child-pr'+_0x1252ec(0x2c8)+'ne',(_0x317b1c,_0x2c4b16)=>{const _0x5eece1=_0x1252ec;mainLogger?.[_0x5eece1(0x157)](_0x5eece1(0x201)+_0x5eece1(0x41f)+'ne',{'details':_0x2c4b16});});}app['on'](_0x285fc1(0x20d)+_0x285fc1(0x1da)+'d',()=>{const _0x3ebc17=_0x285fc1;if(process[_0x3ebc17(0x2de)]!==_0x3ebc17(0x271))app[_0x3ebc17(0x2d3)]();}),app['on'](_0x285fc1(0x315),async()=>{const _0x7c13c2=_0x285fc1;if(isQuitting){app['quit']();return;}BrowserWindow[_0x7c13c2(0x1f8)+_0x7c13c2(0x2d7)]()['length']===0x0&&shellConfig&&await createWindow();}),app['on'](_0x285fc1(0x413)+_0x285fc1(0x148),_0x1930bf=>{const _0x58d0a1=_0x285fc1;isQuitting=!![],terminalManager?.[_0x58d0a1(0x364)](),terminalManager=null,productRuntimeHooks?.[_0x58d0a1(0x364)]?.();for(const _0xc4c814 of Object['keys'](productRuntimeHooks))delete productRuntimeHooks[_0xc4c814];if(!gatewayController)return;mainLogger?.['info'](_0x58d0a1(0x401)+_0x58d0a1(0x242)+_0x58d0a1(0x36d)+'teway'),_0x1930bf[_0x58d0a1(0x3af)+'efault'](),void gatewayController[_0x58d0a1(0x27f)]()[_0x58d0a1(0x3a6)](()=>{const _0x4ef177=_0x58d0a1;gatewayController=null,mainLogger?.['info'](_0x4ef177(0x232)+_0x4ef177(0x2c1)+_0x4ef177(0x401)+_0x4ef177(0x148)),app['quit']();});}),app['on'](_0x285fc1(0x33c)+'t',()=>{const _0x2efe6c=_0x285fc1;globalShortcut[_0x2efe6c(0x1b0)+'er'](DEVTOOLS_ACCELERATOR);}),app['whenRead'+'y']()['then'](boot)[_0x285fc1(0x337)](_0x29b904=>{const _0x40c1bf=_0x285fc1;bootError=_0x29b904 instanceof Error?_0x29b904[_0x40c1bf(0x42b)]:String(_0x29b904),mainLogger?.[_0x40c1bf(0x157)](_0x40c1bf(0x197)+_0x40c1bf(0x420)+'ot\x20faile'+'d',summarizeError(_0x29b904)),console[_0x40c1bf(0x157)]('[wujie-s'+'hell]\x20fa'+'iled\x20to\x20'+'boot\x20ele'+_0x40c1bf(0x3a4)+'in',_0x29b904);});
|