@wujie-shell/core 2.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.
Files changed (53) hide show
  1. package/README.md +30 -0
  2. package/dist/bin/wujie-shell.mjs +1 -1
  3. package/dist/src/agents/bundled-agent-skills.mjs +1 -0
  4. package/dist/src/agents/bundled-agents.mjs +1 -0
  5. package/dist/src/chat/media-archive.mjs +1 -0
  6. package/dist/src/chat/queue.mjs +1 -0
  7. package/dist/src/common/diagnostics.mjs +1 -0
  8. package/dist/src/common/logging.mjs +1 -0
  9. package/dist/src/common/runtime-logger.mjs +1 -0
  10. package/dist/src/common/user-events.mjs +1 -0
  11. package/dist/src/common/utils.mjs +1 -0
  12. package/dist/src/config/controller.mjs +1 -0
  13. package/dist/src/connectors/config-utils.mjs +1 -1
  14. package/dist/src/connectors/constants.mjs +1 -1
  15. package/dist/src/connectors/controller.mjs +1 -0
  16. package/dist/src/connectors/kdocs-cli.mjs +1 -0
  17. package/dist/src/electron/main.mjs +1 -1
  18. package/dist/src/electron/preload.mjs +1 -1
  19. package/dist/src/files/generated-files-store.mjs +1 -0
  20. package/dist/src/files/handlers.mjs +1 -0
  21. package/dist/src/gateway/controller.mjs +1 -0
  22. package/dist/src/gateway/ws-client.mjs +1 -0
  23. package/dist/src/index.mjs +1 -1
  24. package/dist/src/log-reporting/handlers.mjs +1 -0
  25. package/dist/src/log-reporting/report-logs.mjs +1 -0
  26. package/dist/src/models/handlers.mjs +1 -0
  27. package/dist/src/preferences/store.mjs +1 -0
  28. package/dist/src/runtime/index.mjs +1 -0
  29. package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -0
  30. package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -0
  31. package/dist/src/runtime/plugin-sync.mjs +1 -0
  32. package/dist/src/sessions/agent-sessions-map-store.mjs +1 -0
  33. package/dist/src/skills/import.mjs +1 -0
  34. package/dist/src/skills/market.mjs +1 -0
  35. package/dist/src/terminal/manager.mjs +1 -0
  36. package/package.json +5 -5
  37. package/dist/src/agent-sessions-map-store.mjs +0 -1
  38. package/dist/src/bundled-agent-skills.mjs +0 -1
  39. package/dist/src/bundled-agents.mjs +0 -1
  40. package/dist/src/config-controller.mjs +0 -1
  41. package/dist/src/connectors/connector-controller.mjs +0 -1
  42. package/dist/src/gateway-controller.mjs +0 -1
  43. package/dist/src/gateway-ws.mjs +0 -1
  44. package/dist/src/generated-files-store.mjs +0 -1
  45. package/dist/src/logging.mjs +0 -1
  46. package/dist/src/openclaw-config-compat.mjs +0 -1
  47. package/dist/src/plugin-sync.mjs +0 -1
  48. package/dist/src/product-preferences-store.mjs +0 -1
  49. package/dist/src/runtime-logger.mjs +0 -1
  50. package/dist/src/runtime.mjs +0 -1
  51. package/dist/src/skill-import.mjs +0 -1
  52. package/dist/src/terminal-manager.mjs +0 -1
  53. 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});}