@wujie-shell/core 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -1
- package/dist/src/agents/bundled-agents.mjs +1 -1
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/user-events.mjs +1 -1
- package/dist/src/common/utils.mjs +1 -1
- package/dist/src/config/controller.mjs +1 -1
- package/dist/src/connectors/config-utils.mjs +1 -1
- package/dist/src/connectors/constants.mjs +1 -1
- package/dist/src/connectors/controller.mjs +1 -1
- package/dist/src/connectors/kdocs-cli.mjs +1 -1
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/ws-client.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -1
- package/dist/src/log-reporting/report-logs.mjs +1 -1
- package/dist/src/models/handlers.mjs +1 -1
- package/dist/src/preferences/store.mjs +1 -1
- package/dist/src/runtime/index.mjs +1 -1
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/skills/import.mjs +1 -1
- package/dist/src/skills/market.mjs +1 -1
- package/dist/src/terminal/manager.mjs +1 -1
- package/dist/src/updates/controller.mjs +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x52fe09,_0x1061fe){const _0x23ea29=_0x5b67,_0x44f0f3=_0x52fe09();while(!![]){try{const _0x2dd34e=parseInt(_0x23ea29(0x291))/0x1*(-parseInt(_0x23ea29(0x294))/0x2)+-parseInt(_0x23ea29(0x28e))/0x3+-parseInt(_0x23ea29(0x180))/0x4*(-parseInt(_0x23ea29(0x2e1))/0x5)+parseInt(_0x23ea29(0x2fd))/0x6*(parseInt(_0x23ea29(0x161))/0x7)+parseInt(_0x23ea29(0x1e5))/0x8+-parseInt(_0x23ea29(0x2cb))/0x9*(parseInt(_0x23ea29(0x282))/0xa)+parseInt(_0x23ea29(0x17e))/0xb*(-parseInt(_0x23ea29(0x31a))/0xc);if(_0x2dd34e===_0x1061fe)break;else _0x44f0f3['push'](_0x44f0f3['shift']());}catch(_0xa38f31){_0x44f0f3['push'](_0x44f0f3['shift']());}}}(_0x1e26,0x23527));import{spawn}from'node:child_process';import{randomUUID}from'node:crypto';import{mkdir,readFile,readdir,rm,writeFile}from'node:fs/promises';import{homedir}from'node:os';function _0x5b67(_0x4ccb49,_0x3e19b3){_0x4ccb49=_0x4ccb49-0x152;const _0x1e26af=_0x1e26();let _0x5b67b5=_0x1e26af[_0x4ccb49];return _0x5b67b5;}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(_0x26f466){const _0x2514bd=_0x5b67;return typeof _0x26f466===_0x2514bd(0x267)?_0x26f466[_0x2514bd(0x186)]():'';}function findDingtalkDocMcpServer(_0x2e58de){const _0x29647a=_0x5b67,_0x38657b=asRecord(_0x2e58de[DINGTALK_DOC_MCP_SERVER_NAME]);if(Object['keys'](_0x38657b)['length']>0x0)return _0x38657b;for(const [_0x4baaa1,_0x392805]of Object['entries'](_0x2e58de)){const _0x1c2abe=asRecord(_0x392805),_0x27af99=getTrimmedString(_0x4baaa1)[_0x29647a(0x2d3)+_0x29647a(0x31c)](),_0x3159f3=getTrimmedString(_0x1c2abe[_0x29647a(0x273)])[_0x29647a(0x2d3)+_0x29647a(0x31c)]();if(_0x27af99[_0x29647a(0x274)](_0x29647a(0x1c6))||_0x27af99[_0x29647a(0x274)]('dingding')||_0x27af99['includes']('钉钉')||_0x3159f3[_0x29647a(0x274)](_0x29647a(0x1c6))||_0x3159f3[_0x29647a(0x274)](_0x29647a(0x25e)))return _0x1c2abe;}return{};}function createFeishuRegistrationClient(){const _0x4f21e3=_0x5b67,_0x20197a=FEISHU_REGISTRATION_ENV_URLS[DEFAULT_FEISHU_REGISTRATION_ENV];if(!_0x20197a)throw new Error(_0x4f21e3(0x189)+'ted\x20Feis'+'hu\x20regis'+_0x4f21e3(0x175)+_0x4f21e3(0x21c)+DEFAULT_FEISHU_REGISTRATION_ENV);return{'baseUrl':_0x20197a,'headers':{'Content-Type':_0x4f21e3(0x16e)+'ion/x-ww'+_0x4f21e3(0x2d2)+_0x4f21e3(0x1c5)+'d'},'timeoutMs':DEFAULT_FEISHU_REGISTRATION_TIMEOUT_MS};}async function postFeishuRegistration(_0x5c68d1,_0xf821e9){const _0x3411a8=_0x5b67,_0x36125a=await fetch(_0x5c68d1['baseUrl']+(_0x3411a8(0x331)+_0x3411a8(0x227)+_0x3411a8(0x24d)+'on'),{'method':_0x3411a8(0x1f3),'headers':_0x5c68d1[_0x3411a8(0x25f)],'body':new URLSearchParams(_0xf821e9)[_0x3411a8(0x18d)](),'signal':AbortSignal[_0x3411a8(0x178)](_0x5c68d1[_0x3411a8(0x2f7)+'s'])}),_0x20421a=await _0x36125a[_0x3411a8(0x27e)]()[_0x3411a8(0x249)](()=>({}));if(!_0x36125a['ok']){const _0x37f8f6=new Error('HTTP\x20'+_0x36125a[_0x3411a8(0x2cf)]);_0x37f8f6[_0x3411a8(0x1be)+'Data']=_0x20421a;throw _0x37f8f6;}return asRecord(_0x20421a);}function _0x1e26(){const _0x53d350=['fresh','enied','pollInte','search','function','oc\x20CLI\x20s','启动成功','stdin','client_i','\x20connect','mcp','WujieAI',',请先连接','all_prox','授权码\x20is\x20r','https:','name','feishu','feishu\x20c','tokenSta','verifyTi','read','请在浏览器完成金','eCode','\x20专用应用凭据缺','飞书应用已创建,','i\x20auth\x20l','access_d','ready','catch','wecom','ctor\x20del','full','gistrati','setPlugi','--force-','请输入有效的钉钉','otRaw','EXPIRED','onfig\x20de','dated','--app-id','smtp.qq.','扫码成功','check',',请先完成\x20kd','ion_uri_','1.0.0','mer','ERROR','dingding','headers','already\x20','--domain','cliAppSe','orizatio','正在验证金山文档','data','once','string','leted','map','with\x20cod','tateDir','led','authoriz','docs-cli','open_id','\x20config\x20','wechat-l','client','url','includes','find','ecret','red','end','wujie.ai','器人绑定','deleteSk','QR_READY','ill\x20conn','json','<empty>','金山文档已连接','\x20plugin\x20','10abuJhH','channelI','企微助手\x20Bot','Channel\x20','exmail','p\x20URL','ail.qq.c','正在初始化飞书\x20','complete','飞书\x20CLI\x20执','ill\x20','ted','253431qbNsZP','lient','\x20已安装','2PaIMrS','失败,请确认\x20k','身份要求:\x20','27938biBOcl','smtp.exm','openExte','error_de','entries','http:','environm','is\x20requi','Agent','n\x20not\x20fo','token','tionUriC','HTTPS_PR','kdocs','--no-wai','dmPolicy','HTTP_PRO','id\x20is\x20re','ired','enabled','连接成功','connecti','等待飞书用户授权','qqbot','\x20doc\x20mcp','appPollC','pSecret\x20','device_c','now','-weixin','QQ\x20邮箱','验证超时','sage','mail','channel','boolean','s\x20requir','stdout','ion_uri','et\x20auth.','hint','update','ttp\x20URL\x20','slice','found','n\x20respon','init','bind','scanned','resolveS','rver','entry','ccess','apiKey','protocol','146592LFeUWt','已连接过','managedB','prototyp','status','d\x20is\x20req','begin','w-form-u','toLowerC','connecto','ethods','kill','onMode','poll','cret-std','spawn','gin\x20upda','r-log','authStat','object','cess','tion_uri','2325AEUQzP','.com','esAt','utf8','wechat-s','latest','ror:\x20','qqbot\x20ch','setMcpSe','annelCon','quired','飞书\x20CLI\x20授','飞书\x20CLI\x20应','ID\x20is\x20re','重新生成','CLI\x20用户身份','errorMes','当前客户端未内置','client_s','timer','完成应用创建','/page/sc','timeoutM','le-http','rcode','e_code:\x20','飞书\x20CLI\x20未','onfig\x20up','1380lbSVHc','ion_url','ationUri','wechat-q','e\x20or\x20dev','netease_','kdocs\x20sk','dAt','feishu\x20d','ector','n\x20update','share','飞书机器人','message','operty','expire_i','ll\x20updat','websocke','gin\x20save','Kdocs\x20CL','接失败','plugins','port\x20cli',':user','nConfig','r\x20plugin','delete','deleteMc','writeCon','41952SACYUV','footer','ase','r\x20\x22','export','cliAppId','ation_pe','channel\x20','ret\x20is\x20r','appTimer','uired','appId','Local\x20lo','open','usStarte','onnector','channels','match','ector\x20de','钉钉文档\x20Str','金山文档尚未授权','und','飞书机器人\x20Ap','/oauth/v','onSucces','login','oc-cli','com','clientSe','fig','Connecto','openId','登录成功','se.','startedA','无需重复连接','expired_','exists','ot\x20found','lePath','max','usTimer','lugin\x20de','code','deleteCh','scope_au','filter','deviceCo','expired','Invalid\x20','I\x20sessio','accounts','i:keycha','search:d','purpose','netease\x20','已扫描','Data','授权页','env','andledIn','\x20chars)','transpor','error','accountN','飞书开放平台未返','hasOwnPr','connecte','xOf','close','parse','pID\x20is\x20r','77LvbQuk','nfig\x20del','imap.qq.','verify','请在飞书开放平台','igRaw','plugin','验证失败','返回授权\x20URL','values','user_inf','needs_re','ice_code','applicat','Failed','nding','kdocs-cl','pending','山文档授权','ation_ur','tration\x20','-code','onfig','timeout','get','qq\x20mail\x20','lark-cli','SCANNED','账号\x20is\x20re','11NeVleR','docs','1300HJPuvG','keys','verifica','allow','环境不支持创建\x20','mableHtt','trim','exmail\x20c','d_auth_m','Unsuppor','腾讯文档','igSnapsh','腾讯文档\x20Key','toString','secret','or\x20plugi','equired','hannel\x20c','scriptPa','valid','set','join','isArray','\x22\x20not\x20fo','annel\x20co','ion\x20not\x20','ession\x20i','feishu_c','_id','required','Feishu\x20r','cliHostC','ve,markd','Bin','_complet','botId','Feishu\x20d','ated','eted','_doc','Entry','tencent_','pluginId','test','call','disabled','appDevic','\x20channel','qq_mail','markConf','--channe','create','stderr','rvalMs','飞书用户身份','tion_url','Spawn\x20er','cret','onfigPat','skills','--app-se','setChann','response','executab','tatus',',请重新连接','ession\x20n',',sheets,','illEntry','rlencode','dingtalk','\x20not\x20sup','account','toISOStr','的新版客户端','flow_id','skill','onFailur','\x20updated','push','assign','金山文档授权状态','飞书用户身份授权','ill\x20enab','output','正在验证飞书授权','ll\x20conne','ALL_PROX','then','appExpir','login\x20--','163\x20邮箱','groupAll','wecom\x20ch','resolve','user','appPollI','ctor\x20plu','mail\x20con','http_pro','tencent\x20','985784vdjqSo','正在检查飞书\x20C','thorizat','权状态验证超时','飞书应用创建失败','Current\x20','n?flow_i','elConfig','zationCo','sessionI','.json','企微助手\x20Sec','rnal','imap.163','POST','gin\x20dele','nfig\x20upd','docs\x20ski','ode','split','length','nodeExec','wechat','enclaw\x20c','ion\x20sess','openclaw','logout','doc_conn','ntervalM','二维码已过期,请','金山文档登录启动','deleted','interval','飞书应用创建超时','supporte','lastInde','\x20deleted','availabl','飞书\x20CLI\x20连','support@','oxy','logged\x20i','nector\x20p','行失败','权状态验证失败','feishu_d','li_user','正在进入用户授权','icy','setSkill','expiresA','https_pr','auth','process','企微助手','env:\x20','权状态不符合用户','slow_dow','clear','config','--brand','igWriteH','腾讯企业邮箱','ocs-cli\x20','omplete','indexOf','1/app/re','oc\x20conne','\x20is\x20requ','phase','用户已取消飞书机'];_0x1e26=function(){return _0x53d350;};return _0x1e26();}async function initFeishuRegistration(_0x209021){const _0x34bd4a=_0x5b67;return postFeishuRegistration(_0x209021,{'action':_0x34bd4a(0x2c2)});}async function beginFeishuRegistration(_0x4402ce){const _0x1856dd=_0x5b67;return postFeishuRegistration(_0x4402ce,{'action':_0x1856dd(0x2d1),'archetype':'Personal'+_0x1856dd(0x29c),'auth_method':_0x1856dd(0x2f3)+'ecret','request_user_info':_0x1856dd(0x26f)});}async function pollFeishuRegistration(_0x33d69f,_0x15a4a7){const _0xe21f46=_0x5b67;try{return await postFeishuRegistration(_0x33d69f,{'action':_0xe21f46(0x2d8),'device_code':_0x15a4a7});}catch(_0x1e0031){if(_0x1e0031?.[_0xe21f46(0x1be)+_0xe21f46(0x152)]&&typeof _0x1e0031[_0xe21f46(0x1be)+_0xe21f46(0x152)]===_0xe21f46(0x2de))return asRecord(_0x1e0031[_0xe21f46(0x1be)+_0xe21f46(0x152)]);throw _0x1e0031;}}function extractFeishuRegistrationAuthorizationUri(_0x24d0e0){const _0x592479=_0x5b67,_0x244ee0=getTrimmedString(_0x24d0e0[_0x592479(0x26d)+'ation_ur'+'i_comple'+'te'])||getTrimmedString(_0x24d0e0['authoriz'+'ation_ur'+'i'])||getTrimmedString(_0x24d0e0[_0x592479(0x347)+_0x592479(0x1e7)+_0x592479(0x25a)+_0x592479(0x28a)])||getTrimmedString(_0x24d0e0[_0x592479(0x347)+_0x592479(0x1e7)+_0x592479(0x2ba)])||getTrimmedString(_0x24d0e0['scope_au'+_0x592479(0x1e7)+_0x592479(0x2fe)])||getTrimmedString(_0x24d0e0['authoriz'+_0x592479(0x174)+'l']);if(_0x244ee0)return _0x244ee0;const _0x267268=getTrimmedString(_0x24d0e0[_0x592479(0x1cb)])||getTrimmedString(_0x24d0e0[_0x592479(0x347)+_0x592479(0x1e7)+'ion_flow'+_0x592479(0x19c)]);return _0x267268?FEISHU_REGISTRATION_ENV_URLS[DEFAULT_FEISHU_REGISTRATION_ENV]+(_0x592479(0x2f6)+'ope-auth'+_0x592479(0x263)+_0x592479(0x1eb)+'d=')+encodeURIComponent(_0x267268):null;}function serializeFeishuRegistrationSession(_0x922498){const _0x52105b=_0x5b67;return{'sessionId':_0x922498[_0x52105b(0x1ee)+'d'],'verificationUriComplete':_0x922498[_0x52105b(0x182)+_0x52105b(0x29f)+_0x52105b(0x225)],'expiresAt':new Date(_0x922498[_0x52105b(0x217)+'t'])[_0x52105b(0x1c9)+'ing'](),'pollIntervalMs':_0x922498[_0x52105b(0x22e)+'rvalMs'],'status':_0x922498['status'],'errorMessage':_0x922498[_0x52105b(0x2f1)+'sage'],'purpose':_0x922498[_0x52105b(0x350)],'authorizationUri':_0x922498['authoriz'+'ationUri']};}function extractFirstUrl(_0x330c8e){const _0x31fc6e=_0x5b67,_0x120cd8=_0x330c8e[_0x31fc6e(0x32b)](/https?:\/\/[^\s"'<>]+/i);return _0x120cd8?_0x120cd8[0x0]:null;}function isKdocsAuthStatusReady(_0x1b19d2){const _0x2e4204=_0x5b67,_0x3050dd=_0x1b19d2[_0x2e4204(0x2d3)+_0x2e4204(0x31c)]();if(/not\s+login|not\s+logged|unauth|未登录|未认证|未授权|失败/[_0x2e4204(0x1ab)](_0x3050dd))return![];return/login|logged|auth|valid|success|已登录|已认证|已授权|有效|成功/[_0x2e4204(0x1ab)](_0x3050dd);}function parseFeishuDocCliJson(_0x4e403d){const _0x500274=_0x5b67,_0xcc9337=_0x4e403d[_0x500274(0x186)]();if(!_0xcc9337)return{};try{return asRecord(JSON[_0x500274(0x15f)](_0xcc9337));}catch{for(let _0x19de11=_0xcc9337['indexOf']('{');_0x19de11>=0x0;_0x19de11=_0xcc9337[_0x500274(0x226)]('{',_0x19de11+0x1)){for(let _0x3a2053=_0xcc9337[_0x500274(0x208)+_0x500274(0x15d)]('}');_0x3a2053>_0x19de11;_0x3a2053=_0xcc9337[_0x500274(0x208)+_0x500274(0x15d)]('}',_0x3a2053-0x1)){try{return asRecord(JSON[_0x500274(0x15f)](_0xcc9337[_0x500274(0x2bf)](_0x19de11,_0x3a2053+0x1)));}catch{}}}return{};}}function summarizeCliOutput(_0x290688){const _0x5c7e1f=_0x5b67,_0x3b65fc=_0x290688['trim']();if(!_0x3b65fc)return _0x5c7e1f(0x27f);return _0x3b65fc['length']>0x320?_0x3b65fc[_0x5c7e1f(0x2bf)](0x0,0x320)+'...('+_0x3b65fc[_0x5c7e1f(0x1f9)]+_0x5c7e1f(0x156):_0x3b65fc;}function extractFeishuDocCliError(_0x3caf17,_0x442812){const _0x468e35=_0x5b67,_0x17ae34=parseFeishuDocCliJson(_0x3caf17),_0x5aa508=asRecord(_0x17ae34[_0x468e35(0x158)]),_0x29e0ef=getTrimmedString(_0x5aa508['message']),_0x1da21a=getTrimmedString(_0x5aa508[_0x468e35(0x2bc)]);if(_0x29e0ef&&_0x1da21a)return _0x29e0ef+'\x0a'+_0x1da21a;if(_0x29e0ef)return _0x29e0ef;return _0x3caf17[_0x468e35(0x186)]()||_0x442812;}function getFeishuDocCliFailureMessage(_0x3e6acf,_0x277956,_0x417108){const _0x1b5adf=_0x5b67,_0x476396=_0x277956[_0x1b5adf(0x186)]()[_0x1b5adf(0x1f8)]('\x0a')[_0x1b5adf(0x2bf)](-0x8)[_0x1b5adf(0x195)]('\x0a')['trim'](),_0x555661=_0x3e6acf==='create'?'飞书开放平台应用'+'创建失败':_0x3e6acf===_0x1b5adf(0x2c3)?_0x1b5adf(0x2ed)+'用绑定失败':_0x3e6acf===_0x1b5adf(0x219)?'飞书\x20CLI\x20用'+'户授权失败':_0x1b5adf(0x2ec)+'权状态验证失败';return _0x476396?_0x555661+':\x20'+_0x476396:_0x555661+':\x20'+_0x417108;}function ensureFeishuDocCliUserStatus(_0x135c7a){const _0x1e76bc=_0x5b67,_0x53279e=parseFeishuDocCliJson(_0x135c7a),_0xc51d9b=asRecord(_0x53279e['identiti'+'es']),_0x3ff86c=asRecord(_0xc51d9b[_0x1e76bc(0x1df)]),_0x4815b0=getTrimmedString(_0x53279e['identity']),_0x397d8f=getTrimmedString(_0x53279e[_0x1e76bc(0x23f)+'tus'])||getTrimmedString(_0x3ff86c[_0x1e76bc(0x23f)+'tus']),_0x37e401=getTrimmedString(_0x3ff86c[_0x1e76bc(0x2cf)]),_0xf2f5bd=_0x3ff86c[_0x1e76bc(0x20a)+'e']===!![];if(_0x4815b0!==_0x1e76bc(0x1df)||_0x37e401&&_0x37e401!==_0x1e76bc(0x248)||Object[_0x1e76bc(0x181)](_0x3ff86c)[_0x1e76bc(0x1f9)]>0x0&&!_0xf2f5bd||_0x397d8f!==_0x1e76bc(0x193)&&_0x397d8f!==_0x1e76bc(0x16c)+_0x1e76bc(0x22c))throw new Error(_0x1e76bc(0x2ec)+_0x1e76bc(0x21d)+_0x1e76bc(0x293)+_0x135c7a[_0x1e76bc(0x186)]());}function createKdocsCliStatus(_0x3c34c5){const _0x20abea=_0x5b67;return{'sessionId':_0x3c34c5['sessionI'+'d'],'status':_0x3c34c5[_0x20abea(0x2cf)],'phase':_0x3c34c5[_0x20abea(0x22a)],'url':_0x3c34c5['url'],'message':_0x3c34c5[_0x20abea(0x30a)],'errorMessage':_0x3c34c5[_0x20abea(0x2f1)+_0x20abea(0x2b4)]};}function createFeishuDocCliStatus(_0x29288c){const _0x6157c5=_0x5b67;return{'sessionId':_0x29288c[_0x6157c5(0x1ee)+'d'],'status':_0x29288c[_0x6157c5(0x2cf)],'phase':_0x29288c[_0x6157c5(0x22a)],'url':_0x29288c[_0x6157c5(0x273)],'message':_0x29288c['message'],'errorMessage':_0x29288c[_0x6157c5(0x2f1)+_0x6157c5(0x2b4)]};}export function createConnectorController({shellConfig:_0x18e04e,configController:_0x412d46,broadcast:_0x123727,shell:_0x486fb4,getRuntimeSpawnContext:_0x580328,openClawConfigHandlers:openClawConfigHandlers={},resolveRuntimeKdocsCliCommand:_0x3e29a0,resolveRuntimeLarkCliCommand:_0x3e47f3}){const _0x24a899=_0x5b67,_0x233939=new Map(),_0x5e533b=new Map(),_0x1157d5=new Map();let _0x10fd36=null;const _0x2822e1=()=>_0x412d46['readConf'+_0x24a899(0x166)]();async function _0x3fe752(_0x446126,_0x14b277){const _0x3d6993=_0x24a899;if(typeof openClawConfigHandlers['update']===_0x3d6993(0x230))return openClawConfigHandlers[_0x3d6993(0x2bd)](_0x107ea5=>{const _0x5cfdde=_0x3d6993;for(const _0x2a8c69 of Object[_0x5cfdde(0x181)](_0x107ea5)){!Object[_0x5cfdde(0x2ce)+'e'][_0x5cfdde(0x15b)+_0x5cfdde(0x30b)][_0x5cfdde(0x1ac)](_0x446126,_0x2a8c69)&&delete _0x107ea5[_0x2a8c69];}Object[_0x5cfdde(0x1d0)](_0x107ea5,_0x446126);},_0x14b277);return typeof _0x412d46['persistC'+_0x3d6993(0x177)]===_0x3d6993(0x230)?await _0x412d46['persistC'+_0x3d6993(0x177)](_0x446126,_0x14b277):(_0x412d46[_0x3d6993(0x1b1)+_0x3d6993(0x222)+_0x3d6993(0x155)+'ternally']?.(),await _0x412d46[_0x3d6993(0x319)+_0x3d6993(0x337)](_0x446126,_0x14b277)),{'ok':!![]};}function _0x1288c2(){const _0x4f3204=_0x24a899;return join(_0x412d46[_0x4f3204(0x2c5)+_0x4f3204(0x26b)](),'feishu-d'+_0x4f3204(0x334));}function _0x112860(){const _0x2aa6c4=_0x24a899;return join(_0x1288c2(),'.opencla'+'w',_0x2aa6c4(0x1fe)+_0x2aa6c4(0x1ef));}async function _0x584b8f(_0x3bc36e={}){return _0x580328(_0x18e04e['projectR'+'oot'],_0x3bc36e);}async function _0x2fbaca(_0x3c16fe,_0x5447da){const _0x5411d6=_0x24a899,{env:_0xf29f66,runtime:_0x52457c}=await _0x584b8f({'FORCE_COLOR':'0','HOME':homedir()}),_0x310226=await _0x3e29a0(_0x52457c);return _0x123727(_0x5411d6(0x2d4)+_0x5411d6(0x2dc),{'connector':_0x5411d6(0x2a1),'phase':_0x5411d6(0x2da),'message':_0x5411d6(0x171)+'i\x20'+_0x3c16fe['join']('\x20')}),new Promise((_0x276631,_0x196c15)=>{const _0x5034f2=_0x5411d6,_0x2d8602=spawn(_0x310226[_0x5034f2(0x1bf)+_0x5034f2(0x341)],_0x3c16fe,{'cwd':homedir(),'env':_0xf29f66});let _0x1b9485='';const _0x5203d4=_0x3e0181=>{const _0x3bc71a=_0x5034f2,_0x2dc5a4=_0x3e0181[_0x3bc71a(0x18d)](_0x3bc71a(0x2e4));_0x1b9485+=_0x2dc5a4,_0x123727(_0x3bc71a(0x2d4)+_0x3bc71a(0x2dc),{'connector':_0x3bc71a(0x2a1),'phase':_0x3bc71a(0x1d4),'message':_0x2dc5a4});};_0x2d8602['stdout']['on'](_0x5034f2(0x265),_0x5203d4),_0x2d8602[_0x5034f2(0x1b4)]['on'](_0x5034f2(0x265),_0x5203d4),_0x2d8602[_0x5034f2(0x266)](_0x5034f2(0x158),_0x196c15),_0x2d8602[_0x5034f2(0x266)](_0x5034f2(0x15e),_0x41240c=>_0x276631({'code':_0x41240c,'output':_0x1b9485}));if(typeof _0x5447da===_0x5034f2(0x267))_0x2d8602[_0x5034f2(0x233)][_0x5034f2(0x278)](_0x5447da);else _0x2d8602[_0x5034f2(0x233)][_0x5034f2(0x278)]();});}async function _0xad0bd2(){const _0x43e7a1=_0x24a899,_0x365af8=await _0x2822e1(),_0x157c3d=asRecord(_0x365af8[_0x43e7a1(0x1bb)]),_0x311784=asRecord(_0x157c3d[_0x43e7a1(0x298)]),_0x58e0c2={...asRecord(_0x311784[KDOCS_SKILL_ID]),'enabled':!![]};if(typeof openClawConfigHandlers['setSkill'+_0x43e7a1(0x1a8)]===_0x43e7a1(0x230)){await openClawConfigHandlers[_0x43e7a1(0x216)+_0x43e7a1(0x1a8)]({'skillId':KDOCS_SKILL_ID,'entry':_0x58e0c2,'reason':'kdocs\x20sk'+_0x43e7a1(0x1d3)+_0x43e7a1(0x26c)});return;}_0x311784[KDOCS_SKILL_ID]=_0x58e0c2,_0x157c3d['entries']=_0x311784,_0x365af8[_0x43e7a1(0x1bb)]=_0x157c3d,await _0x3fe752(_0x365af8,_0x43e7a1(0x303)+'ill\x20enab'+_0x43e7a1(0x26c));}async function _0x68acac(_0x352bc9){const _0x2040a1=_0x24a899,_0x5a964b=await _0x2822e1(),_0x1288b3=asRecord(_0x5a964b['skills']),_0x44131e=asRecord(_0x1288b3[_0x2040a1(0x298)]),_0x5f57e9={...asRecord(_0x44131e[KDOCS_SKILL_ID]),'enabled':Boolean(_0x352bc9)};if(typeof openClawConfigHandlers[_0x2040a1(0x216)+'Entry']===_0x2040a1(0x230)){await openClawConfigHandlers[_0x2040a1(0x216)+_0x2040a1(0x1a8)]({'skillId':KDOCS_SKILL_ID,'entry':_0x5f57e9,'reason':'kdocs\x20sk'+'ill\x20'+(_0x352bc9?_0x2040a1(0x2a7):_0x2040a1(0x1ad))});return;}_0x44131e[KDOCS_SKILL_ID]=_0x5f57e9,_0x1288b3[_0x2040a1(0x298)]=_0x44131e,_0x5a964b[_0x2040a1(0x1bb)]=_0x1288b3,await _0x3fe752(_0x5a964b,_0x2040a1(0x303)+_0x2040a1(0x28c)+(_0x352bc9?_0x2040a1(0x2a7):_0x2040a1(0x1ad)));}async function _0x1a0ffd(){const _0x46df8d=_0x24a899;if(typeof openClawConfigHandlers['deleteSk'+_0x46df8d(0x1c4)]===_0x46df8d(0x230)){await openClawConfigHandlers[_0x46df8d(0x27b)+_0x46df8d(0x1c4)]({'skillId':KDOCS_SKILL_ID,'reason':'kdocs\x20sk'+'ill\x20conn'+_0x46df8d(0x32c)+_0x46df8d(0x268)});return;}const _0x3493ed=await _0x2822e1(),_0x11e67e=asRecord(_0x3493ed['skills']),_0x5419be=asRecord(_0x11e67e[_0x46df8d(0x298)]);delete _0x5419be[KDOCS_SKILL_ID],_0x11e67e[_0x46df8d(0x298)]=_0x5419be,_0x3493ed['skills']=_0x11e67e,await _0x3fe752(_0x3493ed,_0x46df8d(0x303)+_0x46df8d(0x27d)+_0x46df8d(0x32c)+_0x46df8d(0x268));}async function _0x2e6b44(){const _0x11eecf=_0x24a899;if(!await _0x28ce23())throw new Error(_0x11eecf(0x32e)+_0x11eecf(0x259)+_0x11eecf(0x224)+'连接');return await _0xad0bd2(),{'ok':!![]};}async function _0x28ce23(){const _0x29f1ea=_0x24a899,_0x2a43b7=await _0x2fbaca([_0x29f1ea(0x219),_0x29f1ea(0x2cf)])['catch'](()=>({'code':null,'output':''}));return _0x2a43b7[_0x29f1ea(0x345)]===0x0&&isKdocsAuthStatusReady(_0x2a43b7[_0x29f1ea(0x1d4)]);}async function _0x515416({appId:_0x302946,appSecret:_0x157393,userInfo:userInfo=null}){const _0x457d89=_0x24a899,_0xbcc3bd=await _0x2822e1();applyFeishuChannelConfig(_0xbcc3bd,{'appId':_0x302946,'appSecret':_0x157393,'userInfo':userInfo});const _0x3ca643=asRecord(_0xbcc3bd[_0x457d89(0x32a)]);if(typeof openClawConfigHandlers[_0x457d89(0x1bd)+_0x457d89(0x1ec)]===_0x457d89(0x230))return openClawConfigHandlers[_0x457d89(0x1bd)+_0x457d89(0x1ec)]({'channelId':_0x457d89(0x23d),'channel':asRecord(_0x3ca643[_0x457d89(0x23d)]),'pluginId':_0x457d89(0x23d),'pluginEnabled':!![],'reason':_0x457d89(0x23e)+'hannel\x20c'+'onfig\x20up'+'dated'});await _0x3fe752(_0xbcc3bd,'feishu\x20c'+_0x457d89(0x191)+_0x457d89(0x2fc)+_0x457d89(0x254));}async function _0x217a1e({appId:_0x15303b,appSecret:_0x392382,userInfo:userInfo=null,configPath:_0xc14547}){const _0x20d418=_0x24a899,_0x133d9a=getTrimmedString(userInfo?.[_0x20d418(0x339)]),_0x3d9653={'channels':{'feishu':{'enabled':![],'appId':_0x15303b,'appSecret':_0x392382,'domain':'feishu','connectionMode':_0x20d418(0x30e)+'t','requireMention':!![],'dmPolicy':_0x133d9a?'allowlis'+'t':'disabled','groupPolicy':_0x20d418(0x1ad),'streaming':!![],'allowFrom':_0x133d9a?[_0x133d9a]:[],'groupAllowFrom':[]}},'plugins':{'entries':{},'allow':[]},'tools':{'profile':_0x20d418(0x24c)}};await mkdir(dirname(_0xc14547),{'recursive':!![]}),await writeFile(_0xc14547,JSON['stringif'+'y'](_0x3d9653,null,0x2)+'\x0a',_0x20d418(0x2e4));}async function _0x3a99fc(_0x94186c={}){const _0x53297c=_0x24a899,_0x3118e8=safeString(_0x94186c[_0x53297c(0x325)]),_0x383ef5=safeString(_0x94186c['appSecre'+'t']);if(!_0x3118e8)throw new Error(_0x53297c(0x330)+_0x53297c(0x160)+'equired');if(!_0x383ef5)throw new Error(_0x53297c(0x330)+_0x53297c(0x2ae)+_0x53297c(0x29b)+_0x53297c(0x277));return await _0x515416({'appId':_0x3118e8,'appSecret':_0x383ef5,'userInfo':null}),{'ok':!![]};}async function _0x311af6(_0x1c9d8a={}){const _0x8ef5e=_0x24a899,_0x31ef3b=safeString(_0x1c9d8a['appId']),_0x506432=safeString(_0x1c9d8a['clientSe'+_0x8ef5e(0x1b9)]);if(!_0x31ef3b)throw new Error('QQ机器人\x20Ap'+_0x8ef5e(0x160)+_0x8ef5e(0x190));if(!_0x506432)throw new Error('QQ机器人\x20Ap'+_0x8ef5e(0x2ae)+_0x8ef5e(0x29b)+_0x8ef5e(0x277));const _0x461c2f=await _0x2822e1(),_0x533c8d=asRecord(_0x461c2f[_0x8ef5e(0x32a)]),_0x14ba09=asRecord(_0x533c8d[_0x8ef5e(0x2ab)]),_0x2cd4b5={'enabled':typeof _0x14ba09['enabled']==='boolean'?_0x14ba09[_0x8ef5e(0x2a7)]:!![],'allowFrom':['*'],'appId':_0x31ef3b,'clientSecret':_0x506432};if(typeof openClawConfigHandlers['setChann'+_0x8ef5e(0x1ec)]==='function')return openClawConfigHandlers[_0x8ef5e(0x1bd)+'elConfig']({'channelId':_0x8ef5e(0x2ab),'channel':_0x2cd4b5,'pluginId':QQBOT_PLUGIN_ID,'pluginEnabled':!![],'reason':_0x8ef5e(0x2e8)+_0x8ef5e(0x198)+'nfig\x20upd'+'ated'});_0x533c8d['qqbot']=_0x2cd4b5,_0x461c2f['channels']=_0x533c8d;const _0x5d69a5=asRecord(_0x461c2f[_0x8ef5e(0x312)]),_0x24ccec=asRecord(_0x5d69a5[_0x8ef5e(0x298)]);return _0x24ccec[QQBOT_PLUGIN_ID]={...asRecord(_0x24ccec[QQBOT_PLUGIN_ID]),'enabled':!![]},_0x5d69a5[_0x8ef5e(0x298)]=_0x24ccec,_0x5d69a5[_0x8ef5e(0x183)]=dedupeStrings([...asStringArray(_0x5d69a5[_0x8ef5e(0x183)]),QQBOT_PLUGIN_ID]),_0x461c2f[_0x8ef5e(0x312)]=_0x5d69a5,await _0x3fe752(_0x461c2f,_0x8ef5e(0x2e8)+_0x8ef5e(0x198)+_0x8ef5e(0x1f5)+_0x8ef5e(0x1a5)),{'ok':!![]};}async function _0x53d4e6(_0x51d209={}){const _0x5a7144=_0x24a899,_0x3619de=safeString(_0x51d209[_0x5a7144(0x1a3)]),_0xf968f6=safeString(_0x51d209[_0x5a7144(0x18e)]);if(!_0x3619de)throw new Error(_0x5a7144(0x284)+_0x5a7144(0x2ee)+_0x5a7144(0x2eb));if(!_0xf968f6)throw new Error(_0x5a7144(0x1f0)+_0x5a7144(0x322)+_0x5a7144(0x190));const _0x731aa5=await _0x2822e1(),_0x2d0970=asRecord(_0x731aa5[_0x5a7144(0x32a)]),_0x4658df=asRecord(_0x2d0970[_0x5a7144(0x24a)]),_0x5349e1={..._0x4658df,'enabled':typeof _0x4658df['enabled']===_0x5a7144(0x2b7)?_0x4658df['enabled']:!![],'name':getTrimmedString(_0x4658df[_0x5a7144(0x23c)])||_0x5a7144(0x21b),'connectionMode':getTrimmedString(_0x4658df[_0x5a7144(0x2a9)+_0x5a7144(0x2d7)])||_0x5a7144(0x30e)+'t','dmPolicy':normalizeFeishuDmPolicy(_0x4658df[_0x5a7144(0x2a3)])??_0x5a7144(0x327),'groupPolicy':normalizeFeishuGroupPolicy(_0x4658df['groupPol'+_0x5a7144(0x215)])??'open','allowFrom':asStringArray(_0x4658df['allowFro'+'m']),'groupAllowFrom':asStringArray(_0x4658df[_0x5a7144(0x1dc)+'owFrom']),'botId':_0x3619de,'secret':_0xf968f6};if(typeof openClawConfigHandlers[_0x5a7144(0x1bd)+_0x5a7144(0x1ec)]===_0x5a7144(0x230))return openClawConfigHandlers[_0x5a7144(0x1bd)+_0x5a7144(0x1ec)]({'channelId':'wecom','channel':_0x5349e1,'pluginId':WECOM_PLUGIN_ID,'pluginEnabled':!![],'reason':_0x5a7144(0x1dd)+_0x5a7144(0x198)+_0x5a7144(0x1f5)+_0x5a7144(0x1a5)});_0x2d0970['wecom']=_0x5349e1,_0x731aa5[_0x5a7144(0x32a)]=_0x2d0970;const _0x4847ec=asRecord(_0x731aa5[_0x5a7144(0x312)]),_0x1b7c1e=asRecord(_0x4847ec[_0x5a7144(0x298)]);return _0x1b7c1e[WECOM_PLUGIN_ID]={...asRecord(_0x1b7c1e[WECOM_PLUGIN_ID]),'enabled':!![]},_0x4847ec[_0x5a7144(0x298)]=_0x1b7c1e,_0x4847ec[_0x5a7144(0x183)]=dedupeStrings([...asStringArray(_0x4847ec[_0x5a7144(0x183)]),WECOM_PLUGIN_ID]),_0x731aa5[_0x5a7144(0x312)]=_0x4847ec,await _0x3fe752(_0x731aa5,'wecom\x20ch'+'annel\x20co'+_0x5a7144(0x1f5)+_0x5a7144(0x1a5)),{'ok':!![]};}async function _0x3562d3(_0x21243e,_0x25c5a4,_0x46e299,_0x560504){const _0x467b95=_0x24a899,_0xd79549=safeString(_0x25c5a4[_0x467b95(0x1c8)]),_0x4e28b5=String(_0x25c5a4[_0x467b95(0x26d)+'ationCod'+'e']||'')['replace'](/\s+/g,'');if(!_0xd79549)throw new Error(_0x560504+(_0x467b95(0x17d)+'quired'));if(!_0x4e28b5)throw new Error(_0x560504+(_0x467b95(0x23a)+'equired'));const _0x37786d=await _0x2822e1(),_0x409e7e=asRecord(_0x37786d[_0x467b95(0x312)]),_0x76f0fc=asRecord(_0x409e7e[_0x467b95(0x298)]),_0x1528af=createConnectorPluginEntry(_0x21243e,_0x76f0fc[_0x21243e],!![],{'account':_0xd79549,'authorizationCode':_0x4e28b5,..._0x46e299});if(typeof openClawConfigHandlers[_0x467b95(0x24e)+_0x467b95(0x315)]===_0x467b95(0x230))return openClawConfigHandlers[_0x467b95(0x24e)+_0x467b95(0x315)]({'pluginId':_0x21243e,'enabled':!![],'config':asRecord(_0x1528af['config']),'reason':_0x21243e+(_0x467b95(0x235)+_0x467b95(0x18f)+'n\x20update'+'d')});return _0x76f0fc[_0x21243e]=_0x1528af,_0x409e7e[_0x467b95(0x298)]=_0x76f0fc,_0x409e7e[_0x467b95(0x183)]=dedupeStrings([...asStringArray(_0x409e7e[_0x467b95(0x183)]),_0x21243e]),_0x37786d['plugins']=_0x409e7e,await _0x3fe752(_0x37786d,_0x21243e+('\x20connect'+_0x467b95(0x18f)+_0x467b95(0x307)+'d')),{'ok':!![]};}const _0x2f179d=_0x3beada=>_0x3562d3(QQ_MAIL_CONNECTOR_PLUGIN_ID,_0x3beada,{'imapHost':_0x24a899(0x163)+_0x24a899(0x335),'imapPort':0x3e1,'smtpHost':_0x24a899(0x256)+'com','smtpPort':0x1d1,'secure':!![]},_0x24a899(0x2b2)),_0x4fda1e=_0x2f48d4=>_0x3562d3(NETEASE_MAIL_CONNECTOR_PLUGIN_ID,_0x2f48d4,{'imapHost':_0x24a899(0x1f2)+_0x24a899(0x2e2),'imapPort':0x3e1,'smtpHost':'smtp.163'+_0x24a899(0x2e2),'smtpPort':0x1d1,'imapClientName':_0x24a899(0x237),'imapClientVersion':_0x24a899(0x25b),'imapClientVendor':_0x24a899(0x237),'imapClientSupportEmail':_0x24a899(0x20c)+_0x24a899(0x279),'secure':!![]},_0x24a899(0x1db)),_0x231841=_0x3e75c2=>_0x3562d3(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,_0x3e75c2,{'imapHost':'imap.exm'+_0x24a899(0x288)+'om','imapPort':0x3e1,'smtpHost':_0x24a899(0x295)+_0x24a899(0x288)+'om','smtpPort':0x1d1,'secure':!![]},_0x24a899(0x223));async function _0x4fde7e(_0x26fdfa={}){const _0x5575ae=_0x24a899,_0x176e2a=safeString(_0x26fdfa[_0x5575ae(0x159)+'ame'])||_0x5575ae(0x1b6),_0x17c931=await _0x2822e1(),_0x59124f=asRecord(_0x17c931['plugins']),_0x5bcbf2=asRecord(_0x59124f[_0x5575ae(0x298)]),_0xab28ec=createConnectorPluginEntry(FEISHU_DOC_CONNECTOR_PLUGIN_ID,_0x5bcbf2[FEISHU_DOC_CONNECTOR_PLUGIN_ID],!![],{'authMode':_0x5575ae(0x1df),'accountName':_0x176e2a});if(typeof openClawConfigHandlers['setPlugi'+_0x5575ae(0x315)]==='function')return openClawConfigHandlers[_0x5575ae(0x24e)+_0x5575ae(0x315)]({'pluginId':FEISHU_DOC_CONNECTOR_PLUGIN_ID,'enabled':!![],'config':asRecord(_0xab28ec['config']),'reason':_0x5575ae(0x305)+'oc\x20conne'+'ctor\x20plu'+_0x5575ae(0x2db)+_0x5575ae(0x28d)});return _0x5bcbf2[FEISHU_DOC_CONNECTOR_PLUGIN_ID]=_0xab28ec,_0x59124f[_0x5575ae(0x298)]=_0x5bcbf2,_0x59124f[_0x5575ae(0x183)]=dedupeStrings([...asStringArray(_0x59124f[_0x5575ae(0x183)]),FEISHU_DOC_CONNECTOR_PLUGIN_ID]),_0x17c931['plugins']=_0x59124f,await _0x3fe752(_0x17c931,'feishu\x20d'+'oc\x20conne'+_0x5575ae(0x1e1)+_0x5575ae(0x2db)+_0x5575ae(0x28d)),{'ok':!![]};}async function _0x1dc7c8(_0x5e4b0e={}){const _0x5d70e2=_0x24a899,_0x20a724=safeString(_0x5e4b0e[_0x5d70e2(0x2c9)]);if(!_0x20a724)throw new Error(_0x5d70e2(0x18c)+_0x5d70e2(0x229)+_0x5d70e2(0x2a6));const _0x4176d0=await _0x2822e1(),_0x47abcf=asRecord(_0x4176d0[_0x5d70e2(0x1bb)]),_0x3f3251=asRecord(_0x47abcf['entries']),_0x55af99=asRecord(_0x3f3251[TENCENT_DOCS_SKILL_ID]),_0x44a3c2={..._0x55af99,'enabled':!![],'env':{...asRecord(_0x55af99[_0x5d70e2(0x154)]),[TENCENT_DOCS_TOKEN_ENV]:_0x20a724}};if(typeof openClawConfigHandlers[_0x5d70e2(0x216)+_0x5d70e2(0x1a8)]===_0x5d70e2(0x230))return openClawConfigHandlers[_0x5d70e2(0x216)+_0x5d70e2(0x1a8)]({'skillId':TENCENT_DOCS_SKILL_ID,'entry':_0x44a3c2,'reason':'tencent\x20'+'docs\x20ski'+'ll\x20updat'+'ed'});return _0x3f3251[TENCENT_DOCS_SKILL_ID]=_0x44a3c2,_0x47abcf[_0x5d70e2(0x298)]=_0x3f3251,_0x4176d0[_0x5d70e2(0x1bb)]=_0x47abcf,await _0x3fe752(_0x4176d0,_0x5d70e2(0x1e4)+_0x5d70e2(0x1f6)+_0x5d70e2(0x30d)+'ed'),{'ok':!![]};}async function _0x3603d3(_0x2fbdb1={}){const _0x1b22f7=_0x24a899,_0x446ac3=safeString(_0x2fbdb1[_0x1b22f7(0x273)]);if(!_0x446ac3)throw new Error(_0x1b22f7(0x32d)+'eamableH'+_0x1b22f7(0x2be)+_0x1b22f7(0x29b)+_0x1b22f7(0x277));try{const _0xd4f71d=new URL(_0x446ac3);if(![_0x1b22f7(0x299),_0x1b22f7(0x23b)][_0x1b22f7(0x274)](_0xd4f71d[_0x1b22f7(0x2ca)]))throw new Error(_0x1b22f7(0x34b)+_0x1b22f7(0x2ca));}catch{throw new Error(_0x1b22f7(0x250)+'文档\x20Strea'+_0x1b22f7(0x185)+_0x1b22f7(0x287));}if(typeof openClawConfigHandlers[_0x1b22f7(0x2e9)+_0x1b22f7(0x2c6)]===_0x1b22f7(0x230))return openClawConfigHandlers[_0x1b22f7(0x2e9)+_0x1b22f7(0x2c6)]({'serverName':DINGTALK_DOC_MCP_SERVER_NAME,'server':createDingtalkDocMcpServerConfig(_0x446ac3),'reason':_0x1b22f7(0x1c6)+_0x1b22f7(0x2ac)+'\x20updated'});const _0x500343=await _0x2822e1(),_0x1f0757=readOpenClawMcpServersFromConfig(_0x500343);return _0x1f0757[DINGTALK_DOC_MCP_SERVER_NAME]=createDingtalkDocMcpServerConfig(_0x446ac3),writeOpenClawMcpServersToConfig(_0x500343,_0x1f0757),await _0x3fe752(_0x500343,_0x1b22f7(0x1c6)+_0x1b22f7(0x2ac)+_0x1b22f7(0x1ce)),{'ok':!![]};}async function _0x2f3f6f(){const _0x4ccfd1=_0x24a899,_0x240eb3=await _0x2822e1(),_0x19be1c=asRecord(_0x240eb3[_0x4ccfd1(0x312)]),_0x44e563=asRecord(_0x19be1c[_0x4ccfd1(0x298)]),_0x365005=asRecord(_0x240eb3[_0x4ccfd1(0x1bb)]),_0x4684d7=asRecord(_0x365005[_0x4ccfd1(0x298)]),_0x4c6440={},_0x392588=_0x4e15b4=>{const _0xe7029=_0x4ccfd1,_0x3fe3c5=asRecord(_0x44e563[_0x4e15b4]);return{'entry':_0x3fe3c5,'config':asRecord(_0x3fe3c5[_0xe7029(0x220)])};},_0x9b6976=(_0x38e94f,_0x46dfb8,_0x494ef2)=>{const _0xf4bbdf=_0x4ccfd1,{entry:_0x37c124,config:_0x44dea0}=_0x392588(_0x46dfb8),_0x4c2b25=getTrimmedString(_0x44dea0[_0xf4bbdf(0x1c8)]);if(!_0x4c2b25)return;_0x4c6440[_0x38e94f]={'provider':_0x38e94f,'sourceType':_0xf4bbdf(0x167),'adapter':_0x46dfb8,'enabled':_0x37c124[_0xf4bbdf(0x2a7)]!==![]&&_0x44dea0[_0xf4bbdf(0x2a7)]!==![],'account':_0x4c2b25,'credentialRef':_0x46dfb8+(':authori'+_0xf4bbdf(0x1ed)+'de'),'name':_0x494ef2};};_0x9b6976(_0x4ccfd1(0x1b0),QQ_MAIL_CONNECTOR_PLUGIN_ID,'QQ\x20邮箱'),_0x9b6976(_0x4ccfd1(0x302)+'mail',NETEASE_MAIL_CONNECTOR_PLUGIN_ID,_0x4ccfd1(0x1db)),_0x9b6976('tencent_'+_0x4ccfd1(0x286),TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,_0x4ccfd1(0x223));const _0x5806ca=_0x392588(FEISHU_DOC_CONNECTOR_PLUGIN_ID),_0x4f376f=getTrimmedString(_0x5806ca[_0x4ccfd1(0x220)]['accountN'+'ame']);_0x4f376f&&(_0x4c6440[_0x4ccfd1(0x23d)]={'provider':_0x4ccfd1(0x23d),'sourceType':_0x4ccfd1(0x17b),'adapter':_0x4ccfd1(0x19b)+_0x4ccfd1(0x213),'enabled':_0x5806ca[_0x4ccfd1(0x2c7)][_0x4ccfd1(0x2a7)]!==![]&&_0x5806ca[_0x4ccfd1(0x220)][_0x4ccfd1(0x2a7)]!==![],'authMode':_0x4ccfd1(0x1df),'accountName':_0x4f376f,'account':_0x4f376f,'credentialRef':FEISHU_DOC_CONNECTOR_PLUGIN_ID+_0x4ccfd1(0x314),'capabilities':[_0x4ccfd1(0x2e6),_0x4ccfd1(0x22f),_0x4ccfd1(0x1b3),_0x4ccfd1(0x241),_0x4ccfd1(0x2bd),'delete',_0x4ccfd1(0x31e)]});const _0x3e9174=asRecord(_0x4684d7[TENCENT_DOCS_SKILL_ID]),_0x1e2a1d=asRecord(_0x3e9174['env']),_0x4d9968=getTrimmedString(_0x1e2a1d[TENCENT_DOCS_TOKEN_ENV]);_0x4d9968&&(_0x4c6440[_0x4ccfd1(0x1a9)+_0x4ccfd1(0x17f)]={'provider':_0x4ccfd1(0x1a9)+_0x4ccfd1(0x17f),'sourceType':_0x4ccfd1(0x1cc),'adapter':TENCENT_DOCS_SKILL_ID,'enabled':_0x3e9174[_0x4ccfd1(0x2a7)]!==![],'account':_0x4ccfd1(0x18a),'credentialRef':TENCENT_DOCS_SKILL_ID+':'+TENCENT_DOCS_TOKEN_ENV,'capabilities':[_0x4ccfd1(0x1b3),'read',_0x4ccfd1(0x2bd),_0x4ccfd1(0x317),'import',_0x4ccfd1(0x31e),'ocr']});const _0x1e7a1d=asRecord(_0x4684d7[KDOCS_SKILL_ID]);Object['keys'](_0x1e7a1d)[_0x4ccfd1(0x1f9)]>0x0&&await _0x28ce23()&&(_0x4c6440['kdocs']={'provider':_0x4ccfd1(0x2a1),'sourceType':_0x4ccfd1(0x1cc),'adapter':KDOCS_SKILL_ID,'enabled':_0x1e7a1d['enabled']!==![],'account':'金山文档','credentialRef':_0x4ccfd1(0x171)+_0x4ccfd1(0x34e)+'in','capabilities':['create',_0x4ccfd1(0x241),_0x4ccfd1(0x2bd),_0x4ccfd1(0x22f),_0x4ccfd1(0x308),'import','export']});const _0x557e34=readOpenClawMcpServersFromConfig(_0x240eb3),_0x3aa0a6=findDingtalkDocMcpServer(_0x557e34),_0x23099d=getTrimmedString(_0x3aa0a6[_0x4ccfd1(0x273)]);return _0x23099d&&(_0x4c6440[_0x4ccfd1(0x1c6)+_0x4ccfd1(0x1a7)]={'provider':_0x4ccfd1(0x1c6)+_0x4ccfd1(0x1a7),'sourceType':_0x4ccfd1(0x236),'adapter':DINGTALK_DOC_MCP_SERVER_NAME,'enabled':_0x3aa0a6['enabled']!==![],'url':_0x23099d,'transport':getTrimmedString(_0x3aa0a6[_0x4ccfd1(0x157)+'t'])||'streamab'+_0x4ccfd1(0x2f8)}),_0x4c6440;}async function _0x404ef6(){const _0x2ef23b=_0x24a899,_0x313709=await _0x412d46['readConf'+_0x2ef23b(0x18b)+_0x2ef23b(0x251)]();return{..._0x313709,'connectors':{...asRecord(_0x313709['connecto'+'rs']),...await _0x2f3f6f()}};}function _0x1026ae(_0x4cc1eb){const _0x11d1f3=_0x24a899;if(!_0x4cc1eb[_0x11d1f3(0x240)+_0x11d1f3(0x25c)])return;clearTimeout(_0x4cc1eb[_0x11d1f3(0x240)+_0x11d1f3(0x25c)]),_0x4cc1eb[_0x11d1f3(0x240)+_0x11d1f3(0x25c)]=null;}function _0xb5fb2f(_0x350e75,_0x133de1=KDOCS_CLI_AUTH_POLL_INTERVAL_MS){const _0xb22744=_0x24a899;if(_0x350e75['status']!=='pending')return;_0x1026ae(_0x350e75),_0x350e75[_0xb22744(0x240)+_0xb22744(0x25c)]=setTimeout(()=>void _0x3297f3(_0x350e75),_0x133de1);}async function _0x3297f3(_0x4c8e47){const _0x286878=_0x24a899;if(_0x4c8e47[_0x286878(0x2cf)]!==_0x286878(0x172))return;_0x4c8e47[_0x286878(0x22a)]=_0x286878(0x164),_0x4c8e47[_0x286878(0x30a)]=_0x286878(0x264)+'授权状态';try{const _0x3d4862=await _0x2fbaca(['auth',_0x286878(0x2cf)]);_0x4c8e47[_0x286878(0x1d4)]=_0x3d4862[_0x286878(0x1d4)];if(_0x3d4862[_0x286878(0x345)]===0x0&&isKdocsAuthStatusReady(_0x3d4862[_0x286878(0x1d4)])){_0x1026ae(_0x4c8e47),await _0xad0bd2(),_0x4c8e47[_0x286878(0x22a)]='complete'+'d',_0x4c8e47[_0x286878(0x2cf)]=_0x286878(0x28a)+'d',_0x4c8e47['message']=_0x286878(0x280);return;}if(Date['now']()-_0x4c8e47[_0x286878(0x33c)+'t']>KDOCS_CLI_STEP_TIMEOUT_MS){_0x4c8e47[_0x286878(0x2cf)]='error',_0x4c8e47[_0x286878(0x2f1)+_0x286878(0x2b4)]=_0x286878(0x1d1)+_0x286878(0x2b3);return;}_0xb5fb2f(_0x4c8e47);}catch(_0x579a49){if(Date[_0x286878(0x2b0)]()-_0x4c8e47['startedA'+'t']>KDOCS_CLI_STEP_TIMEOUT_MS){_0x4c8e47[_0x286878(0x2cf)]=_0x286878(0x158),_0x4c8e47[_0x286878(0x2f1)+_0x286878(0x2b4)]=_0x579a49 instanceof Error?_0x579a49[_0x286878(0x30a)]:'金山文档授权状态'+_0x286878(0x168);return;}_0xb5fb2f(_0x4c8e47);}}async function _0x2b3ba9(){const _0x301116=_0x24a899,_0x30d724=randomUUID(),_0x2d3b38={'sessionId':_0x30d724,'status':'pending','phase':_0x301116(0x258),'url':null,'message':'正在启动金山文档'+'登录','errorMessage':null,'output':'','process':null,'verifyTimer':null,'startedAt':Date[_0x301116(0x2b0)]()};return _0x233939['set'](_0x30d724,_0x2d3b38),void _0x584b8f({'FORCE_COLOR':'0','HOME':homedir()})[_0x301116(0x1d8)](async({env:_0x1eba4c,runtime:_0x44c239})=>{const _0x883cbb=_0x301116,_0x219d6a=await _0x3e29a0(_0x44c239);_0x123727('connecto'+'r-log',{'connector':_0x883cbb(0x2a1),'phase':_0x883cbb(0x2da),'message':_0x883cbb(0x171)+_0x883cbb(0x246)+'ogin'});const _0x1d80a2=spawn(_0x219d6a['executab'+_0x883cbb(0x341)],[_0x883cbb(0x219),_0x883cbb(0x333)],{'cwd':homedir(),'env':_0x1eba4c});_0x2d3b38['process']=_0x1d80a2;const _0xf805=setTimeout(()=>{const _0x491aca=_0x883cbb;if(_0x2d3b38['status']!=='pending')return;_0x1d80a2[_0x491aca(0x2d6)](),_0x2d3b38[_0x491aca(0x2cf)]=_0x491aca(0x158),_0x2d3b38[_0x491aca(0x2f1)+_0x491aca(0x2b4)]=_0x491aca(0x203)+'超时',_0x2d3b38['process']=null;},KDOCS_CLI_STEP_TIMEOUT_MS),_0x538227=_0x632d6b=>{const _0x1cf3fd=_0x883cbb,_0x55bb3f=_0x632d6b[_0x1cf3fd(0x18d)](_0x1cf3fd(0x2e4));_0x2d3b38[_0x1cf3fd(0x1d4)]+=_0x55bb3f,_0x123727(_0x1cf3fd(0x2d4)+_0x1cf3fd(0x2dc),{'connector':_0x1cf3fd(0x2a1),'phase':'output','message':_0x55bb3f});const _0x2272d0=extractFirstUrl(_0x2d3b38[_0x1cf3fd(0x1d4)]);_0x2272d0&&!_0x2d3b38[_0x1cf3fd(0x273)]&&(_0x2d3b38['url']=_0x2272d0,_0x2d3b38[_0x1cf3fd(0x22a)]=_0x1cf3fd(0x219),_0x2d3b38[_0x1cf3fd(0x30a)]=_0x1cf3fd(0x242)+_0x1cf3fd(0x173),_0xb5fb2f(_0x2d3b38,0x1f4),void _0x486fb4[_0x1cf3fd(0x296)+'rnal'](_0x2272d0)[_0x1cf3fd(0x249)](()=>{}));};_0x1d80a2[_0x883cbb(0x2b9)]['on'](_0x883cbb(0x265),_0x538227),_0x1d80a2['stderr']['on'](_0x883cbb(0x265),_0x538227),_0x1d80a2[_0x883cbb(0x233)]['end'](),_0x1d80a2[_0x883cbb(0x266)](_0x883cbb(0x158),_0x41e32d=>{const _0x209fa1=_0x883cbb;clearTimeout(_0xf805),_0x2d3b38[_0x209fa1(0x2cf)]=_0x209fa1(0x158),_0x2d3b38[_0x209fa1(0x2f1)+_0x209fa1(0x2b4)]=_0x41e32d instanceof Error?_0x41e32d[_0x209fa1(0x30a)]:_0x209fa1(0x203)+_0x209fa1(0x292)+_0x209fa1(0x26e)+_0x209fa1(0x290),_0x2d3b38[_0x209fa1(0x21a)]=null,_0x123727(_0x209fa1(0x2d4)+'r-log',{'connector':_0x209fa1(0x2a1),'phase':'error','message':_0x2d3b38['errorMes'+_0x209fa1(0x2b4)]});}),_0x1d80a2[_0x883cbb(0x266)](_0x883cbb(0x15e),_0x9d2a0f=>{const _0x52b65f=_0x883cbb;clearTimeout(_0xf805),_0x2d3b38[_0x52b65f(0x21a)]=null;if(_0x2d3b38['status']!==_0x52b65f(0x172))return;const _0x4b67b4=extractFirstUrl(_0x2d3b38[_0x52b65f(0x1d4)]);if(_0x4b67b4&&!_0x2d3b38[_0x52b65f(0x273)]){_0x2d3b38[_0x52b65f(0x273)]=_0x4b67b4,_0x2d3b38['phase']='auth',_0x2d3b38[_0x52b65f(0x30a)]=_0x52b65f(0x242)+_0x52b65f(0x173),_0xb5fb2f(_0x2d3b38,0x1f4);return;}if(_0x9d2a0f!==0x0){_0x2d3b38['status']=_0x52b65f(0x158),_0x2d3b38['errorMes'+'sage']=_0x2d3b38[_0x52b65f(0x1d4)][_0x52b65f(0x186)]()||'金山文档登录启动'+_0x52b65f(0x292)+_0x52b65f(0x26e)+_0x52b65f(0x290),_0x123727(_0x52b65f(0x2d4)+_0x52b65f(0x2dc),{'connector':_0x52b65f(0x2a1),'phase':_0x52b65f(0x158),'message':_0x2d3b38[_0x52b65f(0x2f1)+_0x52b65f(0x2b4)]});return;}_0x2d3b38[_0x52b65f(0x22a)]='verify',_0x2d3b38[_0x52b65f(0x30a)]='正在验证金山文档'+'授权状态',_0xb5fb2f(_0x2d3b38,0x1f4);});})[_0x301116(0x249)](_0x5b871d=>{const _0x28055c=_0x301116;_0x2d3b38[_0x28055c(0x2cf)]=_0x28055c(0x158),_0x2d3b38['errorMes'+_0x28055c(0x2b4)]=_0x5b871d instanceof Error?_0x5b871d['message']:_0x28055c(0x203)+_0x28055c(0x292)+_0x28055c(0x26e)+_0x28055c(0x290),_0x123727(_0x28055c(0x2d4)+'r-log',{'connector':_0x28055c(0x2a1),'phase':_0x28055c(0x158),'message':_0x2d3b38[_0x28055c(0x2f1)+_0x28055c(0x2b4)]});}),createKdocsCliStatus(_0x2d3b38);}function _0xc233bb(_0xd05f4f={}){const _0x358ad5=_0x24a899,_0x153215=safeString(_0xd05f4f[_0x358ad5(0x1ee)+'d']);if(!_0x153215)throw new Error(_0x358ad5(0x310)+_0x358ad5(0x34c)+'n\x20id\x20is\x20'+_0x358ad5(0x19d));const _0x3bb179=_0x233939['get'](_0x153215);if(!_0x3bb179)throw new Error(_0x358ad5(0x310)+_0x358ad5(0x34c)+_0x358ad5(0x29d)+'und');return createKdocsCliStatus(_0x3bb179);}function _0x220bef(_0x28543d={}){const _0x143117=_0x24a899,_0x595654=safeString(_0x28543d[_0x143117(0x1ee)+'d']);if(!_0x595654)return{'ok':!![]};const _0x3b7d1a=_0x233939['get'](_0x595654);if(!_0x3b7d1a)return{'ok':!![]};return _0x1026ae(_0x3b7d1a),_0x3b7d1a[_0x143117(0x21a)]?.['kill'](),_0x233939['delete'](_0x595654),{'ok':!![]};}function _0x2c1018(_0x2dfacc){const _0x3decb6=_0x24a899;if(!_0x2dfacc[_0x3decb6(0x2f4)])return;clearTimeout(_0x2dfacc[_0x3decb6(0x2f4)]),_0x2dfacc[_0x3decb6(0x2f4)]=null;}function _0x59f376(_0x544a2c){const _0x482f30=_0x24a899,_0x41eed7=_0x5e533b[_0x482f30(0x179)](_0x544a2c);if(!_0x41eed7||_0x41eed7[_0x482f30(0x2cf)]!==_0x482f30(0x172))return;_0x2c1018(_0x41eed7),_0x41eed7[_0x482f30(0x2f4)]=setTimeout(()=>void _0xf8c4a8(_0x544a2c),_0x41eed7['pollInte'+_0x482f30(0x1b5)]);}async function _0xf8c4a8(_0x2a58f1){const _0x1265c5=_0x24a899,_0x2c85f7=_0x5e533b[_0x1265c5(0x179)](_0x2a58f1);if(!_0x2c85f7||_0x2c85f7[_0x1265c5(0x2cf)]!==_0x1265c5(0x172))return;if(Date[_0x1265c5(0x2b0)]()>=_0x2c85f7['expiresA'+'t']){_0x2c85f7[_0x1265c5(0x2cf)]=_0x1265c5(0x34a),_0x2c85f7[_0x1265c5(0x2f1)+'sage']=_0x1265c5(0x202)+_0x1265c5(0x2ef),_0x2c1018(_0x2c85f7);return;}try{const _0xc74fb9=await pollFeishuRegistration(_0x2c85f7[_0x1265c5(0x272)],_0x2c85f7['deviceCo'+'de']),_0x228919=getTrimmedString(_0xc74fb9[_0x1265c5(0x234)+'d']),_0x58e135=getTrimmedString(_0xc74fb9[_0x1265c5(0x2f3)+'ecret']),_0x3ba9d1=getTrimmedString(_0xc74fb9['error']),_0x5ae1bf=extractFeishuRegistrationAuthorizationUri(_0xc74fb9)||_0x2c85f7[_0x1265c5(0x26d)+'ationUri'];if(_0x5ae1bf!==_0x2c85f7[_0x1265c5(0x26d)+_0x1265c5(0x2ff)])_0x2c85f7[_0x1265c5(0x26d)+_0x1265c5(0x2ff)]=_0x5ae1bf;if(_0x228919&&_0x58e135){const _0xb9b1c1=asRecord(_0xc74fb9[_0x1265c5(0x16b)+'o']);await _0x515416({'appId':_0x228919,'appSecret':_0x58e135,'userInfo':{'openId':getTrimmedString(_0xb9b1c1[_0x1265c5(0x26f)])||null}}),_0x2c85f7[_0x1265c5(0x2cf)]=_0x1265c5(0x28a)+'d',_0x2c85f7[_0x1265c5(0x2f1)+_0x1265c5(0x2b4)]=null,_0x2c1018(_0x2c85f7);return;}if(!_0x3ba9d1||_0x3ba9d1===_0x1265c5(0x26d)+'ation_pe'+_0x1265c5(0x170)){_0x59f376(_0x2a58f1);return;}if(_0x3ba9d1===_0x1265c5(0x21e)+'n'){_0x2c85f7[_0x1265c5(0x22e)+'rvalMs']+=0x1388,_0x59f376(_0x2a58f1);return;}if(_0x3ba9d1===_0x1265c5(0x33e)+_0x1265c5(0x29e)){_0x2c85f7[_0x1265c5(0x2cf)]='expired',_0x2c85f7[_0x1265c5(0x2f1)+_0x1265c5(0x2b4)]=_0x1265c5(0x202)+'重新生成',_0x2c1018(_0x2c85f7);return;}_0x2c85f7['status']=_0x1265c5(0x158),_0x2c85f7[_0x1265c5(0x2f1)+'sage']=getTrimmedString(_0xc74fb9[_0x1265c5(0x297)+'scriptio'+'n'])||(_0x3ba9d1===_0x1265c5(0x247)+_0x1265c5(0x22d)?_0x1265c5(0x22b)+_0x1265c5(0x27a):'飞书绑定失败:'+_0x3ba9d1),_0x2c1018(_0x2c85f7);}catch(_0x1a4f5d){_0x2c85f7[_0x1265c5(0x2cf)]=_0x1265c5(0x158),_0x2c85f7[_0x1265c5(0x2f1)+_0x1265c5(0x2b4)]=_0x1a4f5d instanceof Error?_0x1a4f5d['message']:'飞书绑定失败',_0x2c1018(_0x2c85f7);}}async function _0x4c0ac7(_0x589bb3={}){const _0x2c3623=_0x24a899,_0x2f204b=_0x589bb3[_0x2c3623(0x350)]===_0x2c3623(0x200)+'ector'?_0x2c3623(0x200)+_0x2c3623(0x306):_0x2c3623(0x2b6),_0x189229=createFeishuRegistrationClient(),_0x4e2747=await initFeishuRegistration(_0x189229),_0x427bba=Array[_0x2c3623(0x196)](_0x4e2747[_0x2c3623(0x207)+'d_auth_m'+'ethods'])?_0x4e2747['supporte'+'d_auth_m'+_0x2c3623(0x2d5)]['map'](getTrimmedString)['filter'](Boolean):[];if(!_0x427bba[_0x2c3623(0x274)](_0x2c3623(0x2f3)+_0x2c3623(0x276)))throw new Error(_0x2c3623(0x1ea)+_0x2c3623(0x29a)+'ent\x20does'+_0x2c3623(0x1c7)+_0x2c3623(0x313)+'ent_secr'+_0x2c3623(0x2bb));const _0x2349c9=await beginFeishuRegistration(_0x189229),_0x49031e=getTrimmedString(_0x2349c9[_0x2c3623(0x182)+_0x2c3623(0x2e0)+_0x2c3623(0x1a2)+'e']),_0x639e63=extractFeishuRegistrationAuthorizationUri(_0x2349c9),_0x17d4c5=getTrimmedString(_0x2349c9['device_c'+_0x2c3623(0x1f7)]),_0x114057=Number(_0x2349c9[_0x2c3623(0x30c)+'n'])||0x258,_0x406418=Number(_0x2349c9[_0x2c3623(0x205)])||0x5;if(!_0x49031e||!_0x17d4c5)throw new Error('Missing\x20'+_0x2c3623(0x182)+_0x2c3623(0x2e0)+_0x2c3623(0x1a2)+_0x2c3623(0x301)+_0x2c3623(0x16d)+'\x20in\x20begi'+_0x2c3623(0x2c1)+_0x2c3623(0x33b));const _0x54fd51=randomUUID(),_0x3b9cb4={'sessionId':_0x54fd51,'purpose':_0x2f204b,'client':_0x189229,'deviceCode':_0x17d4c5,'verificationUriComplete':_0x49031e,'authorizationUri':_0x639e63,'expiresAt':Date[_0x2c3623(0x2b0)]()+_0x114057*0x3e8,'pollIntervalMs':Math[_0x2c3623(0x342)](_0x406418*0x3e8,DEFAULT_FEISHU_REGISTRATION_INTERVAL_MS),'status':_0x2c3623(0x172),'errorMessage':null,'timer':null};return _0x5e533b[_0x2c3623(0x194)](_0x54fd51,_0x3b9cb4),_0x59f376(_0x54fd51),serializeFeishuRegistrationSession(_0x3b9cb4);}function _0x2fe6d5(_0x258fbe={}){const _0x2ea0ca=_0x24a899,_0x170387=safeString(_0x258fbe['sessionI'+'d']);if(!_0x170387)throw new Error(_0x2ea0ca(0x19e)+'egistrat'+_0x2ea0ca(0x1fd)+'ion\x20id\x20i'+_0x2ea0ca(0x2b8)+'ed');const _0x5e6b9f=_0x5e533b[_0x2ea0ca(0x179)](_0x170387);if(!_0x5e6b9f)throw new Error('Feishu\x20r'+'egistrat'+_0x2ea0ca(0x1fd)+_0x2ea0ca(0x199)+_0x2ea0ca(0x2c0));return serializeFeishuRegistrationSession(_0x5e6b9f);}function _0x2474f2(_0x326ad9={}){const _0x1e2c94=_0x24a899,_0x410329=safeString(_0x326ad9[_0x1e2c94(0x1ee)+'d']);if(!_0x410329)return{'ok':!![]};const _0x16246c=_0x5e533b[_0x1e2c94(0x179)](_0x410329);if(!_0x16246c)return{'ok':!![]};return _0x2c1018(_0x16246c),_0x5e533b[_0x1e2c94(0x317)](_0x410329),{'ok':!![]};}async function _0x5eb400(_0x48a53b,_0x36f7ad){const _0x405b3e=_0x24a899,_0x35f76c=_0x1288c2(),{env:_0x115469,runtime:_0x22ba5}=await _0x584b8f({'FORCE_COLOR':'0','HOME':homedir(),'LARK_CLI_NO_PROXY':'1','OPENCLAW_HOME':_0x35f76c,'OPENCLAW_CONFIG_PATH':_0x48a53b[_0x405b3e(0x19f)+_0x405b3e(0x1ba)+'h']});await mkdir(_0x35f76c,{'recursive':!![]});const _0x69f0a=await _0x3e47f3(_0x22ba5);for(const _0x47aad4 of[_0x405b3e(0x2a4)+'XY',_0x405b3e(0x2a0)+'OXY',_0x405b3e(0x1d7)+'Y',_0x405b3e(0x1e3)+'xy',_0x405b3e(0x218)+_0x405b3e(0x20d),_0x405b3e(0x239)+'y']){delete _0x115469[_0x47aad4];}return new Promise((_0x545809,_0x5302c1)=>{const _0x1d9461=_0x405b3e;_0x123727(_0x1d9461(0x2d4)+'r-log',{'connector':'feishu_d'+'oc','phase':_0x1d9461(0x2da),'message':_0x1d9461(0x17b)+'\x20'+_0x36f7ad[_0x1d9461(0x195)]('\x20')});const _0x292fe9=spawn(_0x69f0a[_0x1d9461(0x1fa)+'utable'],[_0x69f0a[_0x1d9461(0x192)+'th'],..._0x36f7ad],{'cwd':_0x35f76c,'env':_0x115469});let _0x46388e=![];_0x292fe9['once']('spawn',()=>{_0x46388e=!![],_0x545809(_0x292fe9);}),_0x292fe9[_0x1d9461(0x266)](_0x1d9461(0x158),_0xe41115=>{if(_0x46388e)return;_0x5302c1(_0xe41115);});});}function _0x51f3bd(_0xdefeeb,_0x15618a,_0x3ea61e){const _0x797658=_0x24a899;_0xdefeeb[_0x797658(0x22a)]=_0x3ea61e[_0x797658(0x22a)],_0xdefeeb[_0x797658(0x30a)]=_0x3ea61e['message'];if(_0x3ea61e['phase']!==_0x797658(0x164))_0xdefeeb['url']=null;_0xdefeeb[_0x797658(0x1d4)]='',void _0x5eb400(_0xdefeeb,_0x15618a)[_0x797658(0x1d8)](_0x43f539=>{const _0x30ec63=_0x797658;_0xdefeeb[_0x30ec63(0x21a)]=_0x43f539;const _0x30f02f=setTimeout(()=>{const _0x67625f=_0x30ec63;if(_0xdefeeb['status']!==_0x67625f(0x172))return;_0x43f539[_0x67625f(0x2d6)](),_0xdefeeb[_0x67625f(0x2cf)]=_0x67625f(0x158),_0xdefeeb[_0x67625f(0x2f1)+_0x67625f(0x2b4)]=_0x3ea61e['message']+'超时',_0xdefeeb[_0x67625f(0x21a)]=null;},FEISHU_DOC_CLI_STEP_TIMEOUT_MS),_0x2c7a62=_0x2255f9=>{const _0x20bba0=_0x30ec63,_0x2de0f1=_0x2255f9['toString'](_0x20bba0(0x2e4));_0xdefeeb['output']+=_0x2de0f1,_0x123727(_0x20bba0(0x2d4)+_0x20bba0(0x2dc),{'connector':'feishu_d'+'oc','phase':_0x3ea61e[_0x20bba0(0x22a)],'message':_0x2de0f1});};_0x43f539['stdout']['on'](_0x30ec63(0x265),_0x2c7a62),_0x43f539[_0x30ec63(0x1b4)]['on'](_0x30ec63(0x265),_0x2c7a62);if(typeof _0x3ea61e['stdin']==='string')_0x43f539[_0x30ec63(0x233)][_0x30ec63(0x278)](_0x3ea61e['stdin']);else _0x43f539[_0x30ec63(0x233)]['end']();_0x43f539['on'](_0x30ec63(0x158),_0x5df17c=>{const _0x4b5c07=_0x30ec63;clearTimeout(_0x30f02f),_0xdefeeb[_0x4b5c07(0x2cf)]='error',_0xdefeeb['errorMes'+_0x4b5c07(0x2b4)]=_0x5df17c instanceof Error?_0x5df17c['message']:_0x4b5c07(0x28b)+_0x4b5c07(0x210),_0xdefeeb['process']=null,_0x123727(_0x4b5c07(0x2d4)+_0x4b5c07(0x2dc),{'connector':_0x4b5c07(0x212)+'oc','phase':'error','message':_0xdefeeb[_0x4b5c07(0x2f1)+_0x4b5c07(0x2b4)]});}),_0x43f539['on']('close',_0x22d3ac=>{const _0xded051=_0x30ec63;clearTimeout(_0x30f02f),_0xdefeeb[_0xded051(0x21a)]=null;if(_0xdefeeb[_0xded051(0x2cf)]!==_0xded051(0x172))return;if(_0x22d3ac!==0x0){if(_0x3ea61e['onFailur'+'e']){void Promise['resolve'](_0x3ea61e[_0xded051(0x1cd)+'e'](_0x22d3ac,_0xdefeeb[_0xded051(0x1d4)]))[_0xded051(0x249)](_0x57f5a6=>{const _0x1f3891=_0xded051;_0xdefeeb[_0x1f3891(0x2cf)]='error',_0xdefeeb['errorMes'+_0x1f3891(0x2b4)]=_0x57f5a6 instanceof Error?_0x57f5a6[_0x1f3891(0x30a)]:_0x1f3891(0x20b)+_0x1f3891(0x311);});return;}_0xdefeeb[_0xded051(0x2cf)]='error',_0xdefeeb[_0xded051(0x2f1)+_0xded051(0x2b4)]=getFeishuDocCliFailureMessage(_0x3ea61e[_0xded051(0x22a)],extractFeishuDocCliError(_0xdefeeb['output'],_0xded051(0x17b)+'\x20'+_0x15618a['join']('\x20')+('\x20exited\x20'+_0xded051(0x26a)+'e\x20')+_0x22d3ac),'lark-cli'+'\x20'+_0x15618a['join']('\x20')+('\x20exited\x20'+'with\x20cod'+'e\x20')+_0x22d3ac),_0x123727(_0xded051(0x2d4)+_0xded051(0x2dc),{'connector':_0xded051(0x212)+'oc','phase':_0xded051(0x158),'message':_0xdefeeb[_0xded051(0x2f1)+'sage']});return;}void Promise[_0xded051(0x1de)](_0x3ea61e[_0xded051(0x332)+'s']())[_0xded051(0x249)](_0x264908=>{const _0x1b03de=_0xded051;_0xdefeeb[_0x1b03de(0x2cf)]=_0x1b03de(0x158),_0xdefeeb[_0x1b03de(0x2f1)+_0x1b03de(0x2b4)]=_0x264908 instanceof Error?_0x264908['message']:_0x1b03de(0x20b)+_0x1b03de(0x311);});});})['catch'](_0x3fd8e1=>{const _0x2b92af=_0x797658;_0xdefeeb[_0x2b92af(0x2cf)]=_0x2b92af(0x158),_0xdefeeb['errorMes'+_0x2b92af(0x2b4)]=_0x3fd8e1 instanceof Error?_0x3fd8e1[_0x2b92af(0x30a)]:'飞书\x20CLI\x20执'+_0x2b92af(0x210),_0xdefeeb['process']=null,_0x123727(_0x2b92af(0x2d4)+_0x2b92af(0x2dc),{'connector':_0x2b92af(0x212)+'oc','phase':'error','message':_0xdefeeb[_0x2b92af(0x2f1)+_0x2b92af(0x2b4)]});});}function _0x8ad4db(_0x292f75){const _0x33d99a=_0x24a899;if(!_0x292f75[_0x33d99a(0x323)])return;clearTimeout(_0x292f75[_0x33d99a(0x323)]),_0x292f75[_0x33d99a(0x323)]=null;}function _0x530fd0(_0xc2f4b){const _0x55daba=_0x24a899;if(!_0xc2f4b[_0x55daba(0x2dd)+'usTimer'])return;clearTimeout(_0xc2f4b[_0x55daba(0x2dd)+_0x55daba(0x343)]),_0xc2f4b[_0x55daba(0x2dd)+_0x55daba(0x343)]=null;}function _0x27200f(_0x28cac5,_0x3c06a1=0x7d0){const _0x5e16e3=_0x24a899;if(_0x28cac5[_0x5e16e3(0x2cf)]!=='pending')return;_0x530fd0(_0x28cac5),_0x28cac5[_0x5e16e3(0x2dd)+_0x5e16e3(0x343)]=setTimeout(()=>{const _0x2ff326=_0x5e16e3;_0x51f3bd(_0x28cac5,['auth',_0x2ff326(0x2cf)],{'phase':'verify','message':_0x2ff326(0x1d5)+'状态','onFailure':(_0x12f2e9,_0x4c7260)=>{const _0xaeacf6=_0x2ff326;if(Date[_0xaeacf6(0x2b0)]()-_0x28cac5[_0xaeacf6(0x2dd)+_0xaeacf6(0x328)+'dAt']>FEISHU_DOC_CLI_STEP_TIMEOUT_MS){_0x28cac5[_0xaeacf6(0x2cf)]=_0xaeacf6(0x158),_0x28cac5['errorMes'+_0xaeacf6(0x2b4)]=getFeishuDocCliFailureMessage(_0xaeacf6(0x164),extractFeishuDocCliError(_0x4c7260,_0xaeacf6(0x2ec)+_0xaeacf6(0x1e8)),_0xaeacf6(0x2ec)+_0xaeacf6(0x1e8));return;}_0x27200f(_0x28cac5);},'onSuccess':()=>{const _0x5919f1=_0x2ff326;try{ensureFeishuDocCliUserStatus(_0x28cac5[_0x5919f1(0x1d4)]);}catch(_0x450369){if(Date[_0x5919f1(0x2b0)]()-_0x28cac5['authStat'+_0x5919f1(0x328)+_0x5919f1(0x304)]>FEISHU_DOC_CLI_STEP_TIMEOUT_MS){_0x28cac5[_0x5919f1(0x2cf)]='error',_0x28cac5[_0x5919f1(0x2f1)+_0x5919f1(0x2b4)]=_0x450369 instanceof Error?_0x450369[_0x5919f1(0x30a)]:_0x5919f1(0x2ec)+_0x5919f1(0x211);return;}_0x27200f(_0x28cac5);return;}return _0x530fd0(_0x28cac5),_0x4d8717(_0x28cac5);}});},_0x3c06a1);}function _0x7b928a(_0xe0f413){const _0x2895de=_0x24a899;if(!_0xe0f413[_0x2895de(0x31f)]||!_0xe0f413[_0x2895de(0x262)+_0x2895de(0x1b9)]){_0xe0f413[_0x2895de(0x2cf)]=_0x2895de(0x158),_0xe0f413[_0x2895de(0x2f1)+'sage']='飞书文档\x20CLI'+_0x2895de(0x244)+'失,无法初始化';return;}const _0x5da9b5=_0xe0f413[_0x2895de(0x31f)],_0x4d1868=_0xe0f413[_0x2895de(0x262)+_0x2895de(0x1b9)];_0x51f3bd(_0xe0f413,['--versio'+'n'],{'phase':_0x2895de(0x2c3),'message':_0x2895de(0x1e6)+'LI','onSuccess':()=>{const _0x257a93=_0x2895de;_0x51f3bd(_0xe0f413,[_0x257a93(0x220),_0x257a93(0x2c2),_0x257a93(0x24f)+_0x257a93(0x2c2),_0x257a93(0x255),_0x5da9b5,_0x257a93(0x1bc)+_0x257a93(0x2d9)+'in',_0x257a93(0x221),_0x257a93(0x23d)],{'phase':_0x257a93(0x2c3),'message':_0x257a93(0x289)+_0x257a93(0x2f0)+'应用','stdin':_0x4d1868,'onSuccess':()=>{const _0x352ae6=_0x257a93;_0x51f3bd(_0xe0f413,[_0x352ae6(0x219),_0x352ae6(0x333),_0x352ae6(0x261),'docs,dri'+_0x352ae6(0x1a0)+'own,wiki'+_0x352ae6(0x1c3)+'slides,b'+_0x352ae6(0x31c),'--scope',_0x352ae6(0x34f)+'ocs:read',_0x352ae6(0x2a2)+'t'],{'phase':_0x352ae6(0x219),'message':'正在打开飞书用户'+_0x352ae6(0x153),'onSuccess':()=>{const _0x17b595=_0x352ae6,_0x2800b2=parseFeishuDocCliJson(_0xe0f413[_0x17b595(0x1d4)]),_0x59cca5=getTrimmedString(_0x2800b2[_0x17b595(0x182)+_0x17b595(0x2e0)+_0x17b595(0x1a2)+'e'])||getTrimmedString(_0x2800b2[_0x17b595(0x182)+_0x17b595(0x1b7)])||getTrimmedString(_0x2800b2[_0x17b595(0x182)+_0x17b595(0x2e0)]),_0xfb1854=getTrimmedString(_0x2800b2[_0x17b595(0x2af)+_0x17b595(0x1f7)]);if(!_0x59cca5||!_0xfb1854){_0xe0f413[_0x17b595(0x2cf)]=_0x17b595(0x158),_0xe0f413[_0x17b595(0x2f1)+_0x17b595(0x2b4)]=_0x17b595(0x2fb)+_0x17b595(0x169)+'\x20或\x20devic'+_0x17b595(0x2fa)+summarizeCliOutput(_0xe0f413[_0x17b595(0x1d4)]);return;}_0xe0f413[_0x17b595(0x273)]=_0x59cca5,_0xe0f413[_0x17b595(0x349)+'de']=_0xfb1854,void _0x486fb4[_0x17b595(0x296)+_0x17b595(0x1f1)](_0x59cca5)[_0x17b595(0x249)](()=>{}),_0x51f3bd(_0xe0f413,['auth',_0x17b595(0x333),'--device'+_0x17b595(0x176),_0xfb1854],{'phase':_0x17b595(0x164),'message':_0x17b595(0x2aa)+'完成','onSuccess':()=>{const _0x29cf66=_0x17b595;_0xe0f413[_0x29cf66(0x2dd)+_0x29cf66(0x328)+'dAt']=Date[_0x29cf66(0x2b0)](),_0x27200f(_0xe0f413,0x1f4);}});}});}});}});}function _0x93507d(_0x1e6a84){const _0x1e2b14=_0x24a899;if(_0x1e6a84['status']!==_0x1e2b14(0x172))return;_0x8ad4db(_0x1e6a84),_0x1e6a84[_0x1e2b14(0x323)]=setTimeout(()=>void _0x21de16(_0x1e6a84),_0x1e6a84[_0x1e2b14(0x1e0)+_0x1e2b14(0x201)+'s']);}async function _0x21de16(_0x58752e){const _0x1c09d7=_0x24a899;if(_0x58752e['status']!=='pending'||_0x58752e['phase']!=='create'||!_0x58752e['appPollC'+'lient']||!_0x58752e[_0x1c09d7(0x1ae)+_0x1c09d7(0x243)])return;if(Date[_0x1c09d7(0x2b0)]()>=_0x58752e[_0x1c09d7(0x1d9)+_0x1c09d7(0x2e3)]){_0x58752e[_0x1c09d7(0x2cf)]=_0x1c09d7(0x158),_0x58752e[_0x1c09d7(0x2f1)+'sage']=_0x1c09d7(0x206)+_0x1c09d7(0x1c1),_0x8ad4db(_0x58752e);return;}try{const _0x4f813d=await pollFeishuRegistration(_0x58752e[_0x1c09d7(0x2ad)+_0x1c09d7(0x28f)],_0x58752e[_0x1c09d7(0x1ae)+'eCode']),_0x16bab4=getTrimmedString(_0x4f813d[_0x1c09d7(0x234)+'d']),_0x186967=getTrimmedString(_0x4f813d['client_s'+_0x1c09d7(0x276)]),_0x57834e=getTrimmedString(_0x4f813d['error']);if(_0x16bab4&&_0x186967){const _0x119c08=asRecord(_0x4f813d['user_inf'+'o']);await _0x217a1e({'appId':_0x16bab4,'appSecret':_0x186967,'userInfo':{'openId':getTrimmedString(_0x119c08[_0x1c09d7(0x26f)])||null},'configPath':_0x58752e['cliHostC'+'onfigPat'+'h']}),_0x58752e[_0x1c09d7(0x31f)]=_0x16bab4,_0x58752e[_0x1c09d7(0x262)+_0x1c09d7(0x1b9)]=_0x186967,_0x8ad4db(_0x58752e),_0x58752e[_0x1c09d7(0x30a)]=_0x1c09d7(0x245)+_0x1c09d7(0x214),_0x7b928a(_0x58752e);return;}if(!_0x57834e||_0x57834e===_0x1c09d7(0x26d)+_0x1c09d7(0x320)+_0x1c09d7(0x170)){_0x93507d(_0x58752e);return;}if(_0x57834e===_0x1c09d7(0x21e)+'n'){_0x58752e[_0x1c09d7(0x1e0)+_0x1c09d7(0x201)+'s']+=0x1388,_0x93507d(_0x58752e);return;}_0x58752e[_0x1c09d7(0x2cf)]=_0x1c09d7(0x158),_0x58752e[_0x1c09d7(0x2f1)+_0x1c09d7(0x2b4)]=getTrimmedString(_0x4f813d['error_de'+'scriptio'+'n'])||_0x1c09d7(0x1e9)+':'+_0x57834e,_0x8ad4db(_0x58752e);}catch(_0x2c8277){_0x58752e[_0x1c09d7(0x2cf)]=_0x1c09d7(0x158),_0x58752e['errorMes'+_0x1c09d7(0x2b4)]=_0x2c8277 instanceof Error?_0x2c8277['message']:_0x1c09d7(0x1e9),_0x8ad4db(_0x58752e);}}async function _0x4d8717(_0x462adb){const _0x53280c=_0x24a899;await _0x4fde7e({'accountName':_0x53280c(0x1b6)}),_0x462adb['status']=_0x53280c(0x28a)+'d',_0x462adb[_0x53280c(0x22a)]=_0x53280c(0x28a)+'d',_0x462adb[_0x53280c(0x30a)]=_0x53280c(0x1d2)+'完成',_0x462adb[_0x53280c(0x2f1)+_0x53280c(0x2b4)]=null;}async function _0x2691d0(){const _0x40517a=_0x24a899,_0x558f91=createFeishuRegistrationClient(),_0x2875c6=await initFeishuRegistration(_0x558f91),_0x4728f0=Array[_0x40517a(0x196)](_0x2875c6['supporte'+_0x40517a(0x188)+_0x40517a(0x2d5)])?_0x2875c6['supporte'+_0x40517a(0x188)+_0x40517a(0x2d5)][_0x40517a(0x269)](getTrimmedString)[_0x40517a(0x348)](Boolean):[];if(!_0x4728f0['includes'](_0x40517a(0x2f3)+'ecret'))throw new Error('当前飞书开放平台'+_0x40517a(0x184)+_0x40517a(0x2f3)+'ecret\x20应用');const _0x1a9349=await beginFeishuRegistration(_0x558f91),_0x2e3fa0=getTrimmedString(_0x1a9349[_0x40517a(0x182)+_0x40517a(0x2e0)+_0x40517a(0x1a2)+'e']),_0x487947=getTrimmedString(_0x1a9349[_0x40517a(0x2af)+_0x40517a(0x1f7)]),_0x730e63=Number(_0x1a9349['expire_i'+'n'])||0x258,_0xe63718=Number(_0x1a9349[_0x40517a(0x205)])||0x5;if(!_0x2e3fa0||!_0x487947)throw new Error(_0x40517a(0x15a)+'回应用创建页面或'+'\x20device_'+'code,请重试');const _0x2c8aff=randomUUID(),_0x3c35a4={'sessionId':_0x2c8aff,'status':_0x40517a(0x172),'phase':_0x40517a(0x1b3),'url':_0x2e3fa0,'appDeviceCode':_0x487947,'appPollClient':_0x558f91,'appPollIntervalMs':Math[_0x40517a(0x342)](_0xe63718*0x3e8,DEFAULT_FEISHU_REGISTRATION_INTERVAL_MS),'appExpiresAt':Date[_0x40517a(0x2b0)]()+_0x730e63*0x3e8,'appTimer':null,'authStatusTimer':null,'authStatusStartedAt':0x0,'deviceCode':null,'message':_0x40517a(0x165)+_0x40517a(0x2f5),'errorMessage':null,'process':null,'output':'','cliHostConfigPath':_0x112860(),'cliAppId':null,'cliAppSecret':null};return _0x1157d5[_0x40517a(0x194)](_0x2c8aff,_0x3c35a4),_0x93507d(_0x3c35a4),createFeishuDocCliStatus(_0x3c35a4);}function _0x1f6720(_0x448e7d={}){const _0x4657ce=_0x24a899,_0xf4c949=safeString(_0x448e7d['sessionI'+'d']);if(!_0xf4c949)throw new Error(_0x4657ce(0x1a4)+_0x4657ce(0x231)+_0x4657ce(0x19a)+_0x4657ce(0x2d0)+_0x4657ce(0x324));const _0x5ec704=_0x1157d5['get'](_0xf4c949);if(!_0x5ec704)throw new Error(_0x4657ce(0x1a4)+_0x4657ce(0x231)+_0x4657ce(0x1c2)+'ot\x20found');return createFeishuDocCliStatus(_0x5ec704);}function _0x4939c(_0x496cc7={}){const _0x210aa4=_0x24a899,_0x32a405=safeString(_0x496cc7[_0x210aa4(0x1ee)+'d']);if(!_0x32a405)return{'ok':!![]};const _0x2d2c89=_0x1157d5[_0x210aa4(0x179)](_0x32a405);if(!_0x2d2c89)return{'ok':!![]};return _0x8ad4db(_0x2d2c89),_0x530fd0(_0x2d2c89),_0x2d2c89[_0x210aa4(0x21a)]?.['kill'](),_0x1157d5['delete'](_0x32a405),{'ok':!![]};}function _0x5ff8aa(_0x2628a7={}){const _0x4c9aa7=_0x24a899,_0x1d5f14=safeString(_0x2628a7['sessionI'+'d']);if(!_0x1d5f14)throw new Error('Feishu\x20d'+_0x4c9aa7(0x231)+_0x4c9aa7(0x19a)+_0x4c9aa7(0x2d0)+'uired');const _0x198b3a=_0x1157d5[_0x4c9aa7(0x179)](_0x1d5f14);if(!_0x198b3a)throw new Error(_0x4c9aa7(0x1a4)+'oc\x20CLI\x20s'+_0x4c9aa7(0x1c2)+_0x4c9aa7(0x340));if(_0x198b3a[_0x4c9aa7(0x2cf)]===_0x4c9aa7(0x158))throw new Error(_0x198b3a[_0x4c9aa7(0x2f1)+'sage']||'飞书\x20CLI\x20连'+'接失败');return{'ok':!![]};}async function _0x3e5afe(_0x3c8c6b){const _0x4eebea=_0x24a899,_0x58df34=asRecord(_0x3c8c6b['plugins']),_0x25a579=asRecord(_0x58df34[_0x4eebea(0x298)]),_0x32a68f=asStringArray(_0x58df34['allow']),_0x1dea81=asRecord(_0x25a579[WECHAT_PLUGIN_ID]),_0x4806e5=_0x1dea81[_0x4eebea(0x2a7)]===!![]||_0x32a68f[_0x4eebea(0x274)](WECHAT_PLUGIN_ID),_0x307a57=join(_0x412d46[_0x4eebea(0x2c5)+_0x4eebea(0x26b)](),WECHAT_PLUGIN_ID),_0x1e36bd=join(_0x307a57,'accounts'+_0x4eebea(0x1ef));let _0x2e4f7f=![];try{const _0x665264=(await readFile(_0x1e36bd,_0x4eebea(0x2e4)))[_0x4eebea(0x186)]();if(_0x665264){const _0x37260e=JSON[_0x4eebea(0x15f)](_0x665264);_0x2e4f7f=Array[_0x4eebea(0x196)](_0x37260e)?_0x37260e['length']>0x0:Object[_0x4eebea(0x181)](asRecord(_0x37260e))[_0x4eebea(0x1f9)]>0x0;}}catch{}if(!_0x2e4f7f)try{_0x2e4f7f=(await readdir(join(_0x307a57,'accounts')))[_0x4eebea(0x1f9)]>0x0;}catch{}return{'exists':_0x4806e5||_0x2e4f7f,'enabled':_0x4806e5,'connected':_0x4806e5&&_0x2e4f7f};}async function _0x409144(){const _0x34fc3e=_0x24a899,_0x564aa1=await _0x2822e1(),_0xf4faa0=asRecord(_0x564aa1['channels']),_0x33db9f=[],_0x16583b=await _0x3e5afe(_0x564aa1);_0x16583b[_0x34fc3e(0x33f)]&&_0x33db9f['push']({'id':WECHAT_PLUGIN_ID,'type':_0x34fc3e(0x1fb),'name':'微信','enabled':_0x16583b[_0x34fc3e(0x2a7)],'connected':_0x16583b[_0x34fc3e(0x15c)+'d']});const _0x29dbb0=asRecord(_0xf4faa0['qqbot']),_0x2647a6=getTrimmedString(_0x29dbb0['appId']),_0xf87ce0=getTrimmedString(_0x29dbb0[_0x34fc3e(0x336)+_0x34fc3e(0x1b9)]);_0x2647a6&&_0xf87ce0&&_0x33db9f[_0x34fc3e(0x1cf)]({'id':_0x34fc3e(0x2ab),'type':_0x34fc3e(0x2ab),'name':'QQ助手','enabled':_0x29dbb0[_0x34fc3e(0x2a7)]!==![],'appId':_0x2647a6,'clientSecret':_0xf87ce0});const _0x1a311a=asRecord(_0xf4faa0[_0x34fc3e(0x24a)]),_0x113a8b=getTrimmedString(_0x1a311a[_0x34fc3e(0x1a3)]),_0xfb3cf4=getTrimmedString(_0x1a311a[_0x34fc3e(0x18e)]);_0x113a8b&&_0xfb3cf4&&_0x33db9f[_0x34fc3e(0x1cf)]({'id':_0x34fc3e(0x24a),'type':_0x34fc3e(0x24a),'name':_0x34fc3e(0x21b),'enabled':_0x1a311a[_0x34fc3e(0x2a7)]!==![],'botId':_0x113a8b,'secret':_0xfb3cf4});const _0x30cf5d=asRecord(_0xf4faa0[_0x34fc3e(0x23d)]),_0x1cbc60=getTrimmedString(_0x30cf5d[_0x34fc3e(0x325)]),_0x5a7257=getTrimmedString(_0x30cf5d['appSecre'+'t']);return _0x1cbc60&&_0x5a7257&&getTrimmedString(_0x30cf5d['managedB'+'y'])!==FEISHU_DOC_CONNECTOR_PLUGIN_ID&&_0x33db9f[_0x34fc3e(0x1cf)]({'id':'feishu','type':_0x34fc3e(0x23d),'name':_0x34fc3e(0x309),'enabled':_0x30cf5d[_0x34fc3e(0x2a7)]!==![],'appId':_0x1cbc60,'appSecret':_0x5a7257}),_0x33db9f;}async function _0x110d66(_0x709709){const _0x1fb01b=_0x24a899;if(typeof openClawConfigHandlers[_0x1fb01b(0x24e)+'nConfig']==='function')return openClawConfigHandlers[_0x1fb01b(0x24e)+'nConfig']({'pluginId':WECHAT_PLUGIN_ID,'enabled':Boolean(_0x709709),'reason':WECHAT_PLUGIN_ID+_0x1fb01b(0x281)+(_0x709709?_0x1fb01b(0x2a7):'disabled')});const _0x1be272=await _0x2822e1(),_0x27dce2=asRecord(_0x1be272['plugins']),_0x55ddc0=asRecord(_0x27dce2[_0x1fb01b(0x298)]);return _0x55ddc0[WECHAT_PLUGIN_ID]={...asRecord(_0x55ddc0[WECHAT_PLUGIN_ID]),'enabled':Boolean(_0x709709)},_0x27dce2[_0x1fb01b(0x298)]=_0x55ddc0,_0x27dce2['allow']=_0x709709?dedupeStrings([...asStringArray(_0x27dce2[_0x1fb01b(0x183)]),WECHAT_PLUGIN_ID]):asStringArray(_0x27dce2['allow'])[_0x1fb01b(0x348)](_0x45efe2=>_0x45efe2!==WECHAT_PLUGIN_ID),_0x1be272[_0x1fb01b(0x312)]=_0x27dce2,await _0x3fe752(_0x1be272,WECHAT_PLUGIN_ID+_0x1fb01b(0x281)+(_0x709709?_0x1fb01b(0x2a7):_0x1fb01b(0x1ad))),{'ok':!![]};}async function _0x2d19b1(_0xce3f07={}){const _0x252685=_0x24a899,_0x3199b4=safeString(_0xce3f07['channelI'+'d']||_0xce3f07['id']);if(!_0x3199b4)throw new Error(_0x252685(0x285)+'id\x20is\x20re'+'quired');const _0x5cfd37=await _0x2822e1(),_0x589675=asRecord(_0x5cfd37[_0x252685(0x32a)]),_0x5de844=asRecord(_0x5cfd37[_0x252685(0x312)]),_0x4daa91=asRecord(_0x5de844['entries']),_0x459232=_0x1ed1e0=>{const _0x18968c=_0x252685;_0x4daa91[_0x1ed1e0]=createConnectorPluginEntry(_0x1ed1e0,_0x4daa91[_0x1ed1e0],![],{}),_0x5de844['allow']=asStringArray(_0x5de844[_0x18968c(0x183)])[_0x18968c(0x348)](_0x4f661c=>_0x4f661c!==_0x1ed1e0),_0x5de844[_0x18968c(0x298)]=_0x4daa91,_0x5cfd37[_0x18968c(0x312)]=_0x5de844;};if(_0x3199b4==='feishu_d'+'oc')return _0x459232(FEISHU_DOC_CONNECTOR_PLUGIN_ID),getTrimmedString(asRecord(_0x589675['feishu'])[_0x252685(0x2cd)+'y'])===FEISHU_DOC_CONNECTOR_PLUGIN_ID&&(delete _0x589675['feishu'],_0x5cfd37['channels']=_0x589675),await rm(_0x1288c2(),{'recursive':!![],'force':!![]})['catch'](()=>{}),_0x3fe752(_0x5cfd37,_0x252685(0x305)+_0x252685(0x228)+_0x252685(0x1e1)+_0x252685(0x1f4)+'ted');if(_0x3199b4===_0x252685(0x1b0)){if(typeof openClawConfigHandlers[_0x252685(0x24e)+_0x252685(0x315)]===_0x252685(0x230))return openClawConfigHandlers['setPlugi'+_0x252685(0x315)]({'pluginId':QQ_MAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':'qq\x20mail\x20'+_0x252685(0x2d4)+_0x252685(0x316)+_0x252685(0x209)});return _0x459232(QQ_MAIL_CONNECTOR_PLUGIN_ID),_0x3fe752(_0x5cfd37,_0x252685(0x17a)+'connecto'+_0x252685(0x316)+'\x20deleted');}if(_0x3199b4===_0x252685(0x302)+_0x252685(0x2b5)){if(typeof openClawConfigHandlers[_0x252685(0x24e)+_0x252685(0x315)]===_0x252685(0x230))return openClawConfigHandlers[_0x252685(0x24e)+_0x252685(0x315)]({'pluginId':NETEASE_MAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':_0x252685(0x351)+_0x252685(0x1e2)+_0x252685(0x20f)+_0x252685(0x344)+_0x252685(0x268)});return _0x459232(NETEASE_MAIL_CONNECTOR_PLUGIN_ID),_0x3fe752(_0x5cfd37,_0x252685(0x351)+_0x252685(0x1e2)+'nector\x20p'+'lugin\x20de'+_0x252685(0x268));}if(_0x3199b4===_0x252685(0x1a9)+'exmail'){if(typeof openClawConfigHandlers[_0x252685(0x24e)+_0x252685(0x315)]===_0x252685(0x230))return openClawConfigHandlers[_0x252685(0x24e)+_0x252685(0x315)]({'pluginId':TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':'tencent\x20'+_0x252685(0x187)+_0x252685(0x329)+_0x252685(0x281)+'deleted'});return _0x459232(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID),_0x3fe752(_0x5cfd37,_0x252685(0x1e4)+_0x252685(0x187)+_0x252685(0x329)+_0x252685(0x281)+_0x252685(0x204));}if(_0x3199b4==='tencent_'+_0x252685(0x17f)){if(typeof openClawConfigHandlers['deleteSk'+_0x252685(0x1c4)]==='function')return openClawConfigHandlers[_0x252685(0x27b)+_0x252685(0x1c4)]({'skillId':TENCENT_DOCS_SKILL_ID,'reason':'tencent\x20'+_0x252685(0x1f6)+_0x252685(0x1d6)+_0x252685(0x24b)+'eted'});const _0x25a9d6=asRecord(_0x5cfd37['skills']),_0x2b04ef=asRecord(_0x25a9d6[_0x252685(0x298)]);return delete _0x2b04ef[TENCENT_DOCS_SKILL_ID],_0x25a9d6[_0x252685(0x298)]=_0x2b04ef,_0x5cfd37[_0x252685(0x1bb)]=_0x25a9d6,_0x3fe752(_0x5cfd37,_0x252685(0x1e4)+_0x252685(0x1f6)+_0x252685(0x1d6)+'ctor\x20del'+_0x252685(0x1a6));}if(_0x3199b4===_0x252685(0x2a1))return await _0x2fbaca(['auth',_0x252685(0x1ff)])[_0x252685(0x249)](()=>({'code':null,'output':''})),await _0x1a0ffd(),{'ok':!![]};if(_0x3199b4===_0x252685(0x1c6)+_0x252685(0x1a7)){if(typeof openClawConfigHandlers['deleteMc'+'pServer']===_0x252685(0x230))return openClawConfigHandlers[_0x252685(0x318)+'pServer']({'serverName':DINGTALK_DOC_MCP_SERVER_NAME,'reason':_0x252685(0x1c6)+_0x252685(0x2ac)+_0x252685(0x209)});const _0x489d58=readOpenClawMcpServersFromConfig(_0x5cfd37);return delete _0x489d58[DINGTALK_DOC_MCP_SERVER_NAME],writeOpenClawMcpServersToConfig(_0x5cfd37,_0x489d58),_0x3fe752(_0x5cfd37,'dingtalk'+'\x20doc\x20mcp'+_0x252685(0x209));}if(_0x3199b4===WECHAT_PLUGIN_ID||_0x3199b4===_0x252685(0x1fe)+_0x252685(0x2b1)){_0x4daa91[WECHAT_PLUGIN_ID]={...asRecord(_0x4daa91[WECHAT_PLUGIN_ID]),'enabled':![]},_0x5de844[_0x252685(0x298)]=_0x4daa91,_0x5de844[_0x252685(0x183)]=asStringArray(_0x5de844[_0x252685(0x183)])[_0x252685(0x348)](_0x58542a=>_0x58542a!==WECHAT_PLUGIN_ID&&_0x58542a!==_0x252685(0x1fe)+_0x252685(0x2b1)),_0x5cfd37[_0x252685(0x312)]=_0x5de844;const _0x1a7820=join(_0x412d46[_0x252685(0x2c5)+_0x252685(0x26b)](),WECHAT_PLUGIN_ID);return await rm(join(_0x1a7820,_0x252685(0x34d)+_0x252685(0x1ef)),{'force':!![]})['catch'](()=>{}),await rm(join(_0x1a7820,'accounts'),{'recursive':!![],'force':!![]})[_0x252685(0x249)](()=>{}),_0x3fe752(_0x5cfd37,_0x3199b4+(_0x252685(0x1af)+_0x252685(0x270)+'deleted'));}if(_0x3199b4==='feishu'){if(typeof openClawConfigHandlers[_0x252685(0x346)+_0x252685(0x2ea)+_0x252685(0x337)]==='function')return openClawConfigHandlers[_0x252685(0x346)+_0x252685(0x2ea)+_0x252685(0x337)]({'channelId':_0x252685(0x23d),'pluginId':_0x252685(0x23d),'reason':_0x252685(0x23e)+_0x252685(0x191)+'onfig\x20de'+_0x252685(0x268)});return delete _0x589675[_0x252685(0x23d)],_0x5cfd37['channels']=_0x589675,_0x4daa91[_0x252685(0x23d)]={...asRecord(_0x4daa91[_0x252685(0x23d)]),'enabled':![]},_0x5de844[_0x252685(0x298)]=_0x4daa91,_0x5de844[_0x252685(0x183)]=asStringArray(_0x5de844[_0x252685(0x183)])[_0x252685(0x348)](_0x38838c=>_0x38838c!==_0x252685(0x23d)),_0x5cfd37[_0x252685(0x312)]=_0x5de844,_0x3fe752(_0x5cfd37,_0x252685(0x23e)+_0x252685(0x191)+_0x252685(0x253)+_0x252685(0x268));}if(_0x3199b4===_0x252685(0x2ab)){if(typeof openClawConfigHandlers[_0x252685(0x346)+_0x252685(0x2ea)+_0x252685(0x337)]===_0x252685(0x230))return openClawConfigHandlers[_0x252685(0x346)+'annelCon'+'fig']({'channelId':_0x252685(0x2ab),'pluginId':QQBOT_PLUGIN_ID,'reason':_0x252685(0x2e8)+'annel\x20co'+_0x252685(0x162)+_0x252685(0x1a6)});delete _0x589675['qqbot'],_0x4daa91[QQBOT_PLUGIN_ID]={...asRecord(_0x4daa91[QQBOT_PLUGIN_ID]),'enabled':![]},_0x5de844['allow']=asStringArray(_0x5de844[_0x252685(0x183)])[_0x252685(0x348)](_0xf82751=>_0xf82751!==QQBOT_PLUGIN_ID);}if(_0x3199b4===_0x252685(0x24a)){if(typeof openClawConfigHandlers[_0x252685(0x346)+_0x252685(0x2ea)+_0x252685(0x337)]===_0x252685(0x230))return openClawConfigHandlers['deleteCh'+_0x252685(0x2ea)+_0x252685(0x337)]({'channelId':_0x252685(0x24a),'pluginId':WECOM_PLUGIN_ID,'reason':_0x252685(0x1dd)+_0x252685(0x198)+_0x252685(0x162)+'eted'});delete _0x589675[_0x252685(0x24a)],_0x4daa91[WECOM_PLUGIN_ID]={...asRecord(_0x4daa91[WECOM_PLUGIN_ID]),'enabled':![]},_0x5de844[_0x252685(0x183)]=asStringArray(_0x5de844[_0x252685(0x183)])[_0x252685(0x348)](_0x3513ea=>_0x3513ea!==WECOM_PLUGIN_ID);}return _0x5cfd37[_0x252685(0x32a)]=_0x589675,_0x5de844[_0x252685(0x298)]=_0x4daa91,_0x5cfd37[_0x252685(0x312)]=_0x5de844,_0x3fe752(_0x5cfd37,_0x3199b4+(_0x252685(0x1af)+_0x252685(0x270)+_0x252685(0x204)));}async function _0x398c5f(_0x526246={}){const _0x2f62e2=_0x24a899,_0x4b4e6b=safeString(_0x526246[_0x2f62e2(0x283)+'d']||_0x526246['id']);if(!_0x4b4e6b)throw new Error(_0x2f62e2(0x285)+_0x2f62e2(0x2a5)+'quired');const _0x3116d1=_0x526246[_0x2f62e2(0x2a7)]===!![],_0x5b35b1=await _0x2822e1(),_0x180dca=asRecord(_0x5b35b1[_0x2f62e2(0x312)]),_0x174892=asRecord(_0x180dca[_0x2f62e2(0x298)]),_0x52ad92=_0x4ad035=>{const _0x45dc0e=_0x2f62e2;_0x174892[_0x4ad035]=createConnectorPluginEntry(_0x4ad035,_0x174892[_0x4ad035],_0x3116d1,{},{'preserveExistingConfig':!![]}),_0x180dca['allow']=_0x3116d1?dedupeStrings([...asStringArray(_0x180dca[_0x45dc0e(0x183)]),_0x4ad035]):asStringArray(_0x180dca[_0x45dc0e(0x183)])[_0x45dc0e(0x348)](_0x1c1ea4=>_0x1c1ea4!==_0x4ad035),_0x180dca['entries']=_0x174892,_0x5b35b1[_0x45dc0e(0x312)]=_0x180dca;};if(_0x4b4e6b==='feishu_d'+'oc'){const _0x4cb647=asRecord(_0x174892[FEISHU_DOC_CONNECTOR_PLUGIN_ID]);if(Object[_0x2f62e2(0x181)](_0x4cb647)['length']===0x0)throw new Error(_0x2f62e2(0x338)+'r\x20\x22'+_0x4b4e6b+('\x22\x20not\x20fo'+'und'));if(typeof openClawConfigHandlers[_0x2f62e2(0x24e)+_0x2f62e2(0x315)]===_0x2f62e2(0x230))return openClawConfigHandlers['setPlugi'+_0x2f62e2(0x315)]({'pluginId':FEISHU_DOC_CONNECTOR_PLUGIN_ID,'enabled':_0x3116d1,'reason':_0x4b4e6b+(_0x2f62e2(0x1af)+'\x20config\x20')+(_0x3116d1?'enabled':'disabled')});_0x52ad92(FEISHU_DOC_CONNECTOR_PLUGIN_ID);}else{if(_0x4b4e6b===_0x2f62e2(0x1b0)){if(typeof openClawConfigHandlers[_0x2f62e2(0x24e)+_0x2f62e2(0x315)]===_0x2f62e2(0x230))return openClawConfigHandlers[_0x2f62e2(0x24e)+_0x2f62e2(0x315)]({'pluginId':QQ_MAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x3116d1,'reason':_0x4b4e6b+(_0x2f62e2(0x1af)+'\x20config\x20')+(_0x3116d1?_0x2f62e2(0x2a7):_0x2f62e2(0x1ad))});_0x52ad92(QQ_MAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x4b4e6b===_0x2f62e2(0x302)+_0x2f62e2(0x2b5)){if(typeof openClawConfigHandlers['setPlugi'+_0x2f62e2(0x315)]===_0x2f62e2(0x230))return openClawConfigHandlers[_0x2f62e2(0x24e)+'nConfig']({'pluginId':NETEASE_MAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x3116d1,'reason':_0x4b4e6b+(_0x2f62e2(0x1af)+_0x2f62e2(0x270))+(_0x3116d1?_0x2f62e2(0x2a7):_0x2f62e2(0x1ad))});_0x52ad92(NETEASE_MAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x4b4e6b==='tencent_'+_0x2f62e2(0x286)){if(typeof openClawConfigHandlers[_0x2f62e2(0x24e)+_0x2f62e2(0x315)]==='function')return openClawConfigHandlers[_0x2f62e2(0x24e)+_0x2f62e2(0x315)]({'pluginId':TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x3116d1,'reason':_0x4b4e6b+(_0x2f62e2(0x1af)+_0x2f62e2(0x270))+(_0x3116d1?'enabled':_0x2f62e2(0x1ad))});_0x52ad92(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x4b4e6b===_0x2f62e2(0x1a9)+_0x2f62e2(0x17f)){const _0x29e6da=asRecord(_0x5b35b1[_0x2f62e2(0x1bb)]),_0x51dba0=asRecord(_0x29e6da[_0x2f62e2(0x298)]),_0x185540=asRecord(_0x51dba0[TENCENT_DOCS_SKILL_ID]);if(typeof openClawConfigHandlers[_0x2f62e2(0x216)+_0x2f62e2(0x1a8)]===_0x2f62e2(0x230))return openClawConfigHandlers[_0x2f62e2(0x216)+_0x2f62e2(0x1a8)]({'skillId':TENCENT_DOCS_SKILL_ID,'entry':{..._0x185540,'enabled':_0x3116d1},'reason':_0x4b4e6b+(_0x2f62e2(0x1af)+'\x20config\x20')+(_0x3116d1?_0x2f62e2(0x2a7):_0x2f62e2(0x1ad))});_0x51dba0[TENCENT_DOCS_SKILL_ID]={..._0x185540,'enabled':_0x3116d1},_0x29e6da[_0x2f62e2(0x298)]=_0x51dba0,_0x5b35b1[_0x2f62e2(0x1bb)]=_0x29e6da;}else{if(_0x4b4e6b===_0x2f62e2(0x2a1)){if(_0x3116d1&&!await _0x28ce23())throw new Error(_0x2f62e2(0x32e)+_0x2f62e2(0x238));return await _0x68acac(_0x3116d1),{'ok':!![]};}else{if(_0x4b4e6b==='dingtalk'+_0x2f62e2(0x1a7)){const _0x5e3428=readOpenClawMcpServersFromConfig(_0x5b35b1),_0x44a738=findDingtalkDocMcpServer(_0x5e3428);if(!getTrimmedString(_0x44a738['url']))throw new Error(_0x2f62e2(0x338)+_0x2f62e2(0x31d)+_0x4b4e6b+(_0x2f62e2(0x197)+_0x2f62e2(0x32f)));_0x5e3428[DINGTALK_DOC_MCP_SERVER_NAME]=createDingtalkDocMcpServerConfig(_0x44a738[_0x2f62e2(0x273)],{'enabled':_0x3116d1}),writeOpenClawMcpServersToConfig(_0x5b35b1,_0x5e3428);}else{const _0x199957=asRecord(_0x5b35b1[_0x2f62e2(0x32a)]),_0x226931=asRecord(_0x199957[_0x4b4e6b]);if(Object[_0x2f62e2(0x181)](_0x226931)[_0x2f62e2(0x1f9)]===0x0)throw new Error(_0x2f62e2(0x285)+'\x22'+_0x4b4e6b+(_0x2f62e2(0x197)+_0x2f62e2(0x32f)));_0x226931['enabled']=_0x3116d1;let _0x73aa3d=null;_0x4b4e6b===_0x2f62e2(0x23d)&&(_0x73aa3d=_0x2f62e2(0x23d),_0x3116d1&&(_0x226931['streamin'+'g']=!![],delete _0x226931[_0x2f62e2(0x31b)]));if(_0x4b4e6b===_0x2f62e2(0x2ab))_0x73aa3d=QQBOT_PLUGIN_ID;if(_0x4b4e6b==='wecom')_0x73aa3d=WECOM_PLUGIN_ID;if(_0x73aa3d&&typeof openClawConfigHandlers['setChann'+_0x2f62e2(0x1ec)]===_0x2f62e2(0x230))return openClawConfigHandlers['setChann'+_0x2f62e2(0x1ec)]({'channelId':_0x4b4e6b,'channel':_0x226931,'pluginId':_0x73aa3d,'pluginEnabled':_0x3116d1,'reason':_0x4b4e6b+(_0x2f62e2(0x1af)+_0x2f62e2(0x270))+(_0x3116d1?_0x2f62e2(0x2a7):'disabled')});_0x199957[_0x4b4e6b]=_0x226931,_0x5b35b1['channels']=_0x199957;if(_0x4b4e6b===_0x2f62e2(0x23d))_0x52ad92('feishu');if(_0x4b4e6b===_0x2f62e2(0x2ab))_0x52ad92(QQBOT_PLUGIN_ID);if(_0x4b4e6b===_0x2f62e2(0x24a))_0x52ad92(WECOM_PLUGIN_ID);}}}}}}}return _0x3fe752(_0x5b35b1,_0x4b4e6b+(_0x2f62e2(0x1af)+_0x2f62e2(0x270))+(_0x3116d1?_0x2f62e2(0x2a7):_0x2f62e2(0x1ad)));}async function _0x274c15({gatewayPort:_0x365ac6,gatewayToken:_0x1dbbbe}={}){const _0x16fc21=_0x24a899;_0x10fd36&&(_0x10fd36[_0x16fc21(0x2d6)](),_0x10fd36=null);const {cwd:_0x1170fa,env:_0x1996dd,runtime:_0xbc88fc}=await _0x584b8f({'FORCE_COLOR':'0',..._0x365ac6?{'OPENCLAW_GATEWAY_PORT':String(_0x365ac6)}:{},..._0x1dbbbe?{'OPENCLAW_GATEWAY_TOKEN':_0x1dbbbe}:{}}),_0x5bc4cd=_0xbc88fc[_0x16fc21(0x312)][_0x16fc21(0x275)](_0x5ae1f3=>_0x5ae1f3[_0x16fc21(0x1aa)]===WECHAT_PLUGIN_ID);if(!_0x5bc4cd){const _0x47e3ec=_0x16fc21(0x2f2)+'微信连接插件,请'+'安装包含微信插件'+_0x16fc21(0x1ca);return _0x123727('wechat-s'+_0x16fc21(0x1c0),'ERROR'),_0x123727(_0x16fc21(0x271)+'og',_0x47e3ec),{'ok':![],'error':_0x47e3ec};}await _0x110d66(!![]),_0x123727(_0x16fc21(0x271)+'og','spawn\x20op'+_0x16fc21(0x1fc)+'hannels\x20'+_0x16fc21(0x1da)+_0x16fc21(0x321)+_0x5bc4cd[_0x16fc21(0x1aa)]),_0x10fd36=spawn(_0xbc88fc[_0x16fc21(0x1fa)+'utable'],[_0xbc88fc[_0x16fc21(0x1fe)+_0x16fc21(0x1a1)],'channels',_0x16fc21(0x333),_0x16fc21(0x1b2)+'l',_0x5bc4cd['pluginId']],{'cwd':_0x1170fa,'env':_0x1996dd});let _0xb891b6='',_0x133955=![],_0x1c534f=![];const _0x55e78b=_0x438ff0=>{const _0x2d62fe=_0x16fc21,_0x591410=_0x438ff0[_0x2d62fe(0x18d)]();_0xb891b6+=_0x591410;if(!_0x133955){const _0x3d32f1=_0xb891b6[_0x2d62fe(0x32b)](/(https:\/\/(?:[a-zA-Z0-9-]+\.)*weixin\.qq\.com\S+)/i);_0x3d32f1?.[0x1]&&(_0x133955=!![],_0x123727(_0x2d62fe(0x300)+_0x2d62fe(0x2f9),_0x3d32f1[0x1]),_0x123727('wechat-s'+'tatus',_0x2d62fe(0x27c)));}if(_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x352))||_0x591410[_0x2d62fe(0x274)]('Scan\x20suc'+_0x2d62fe(0x2df))||_0x591410['includes'](_0x2d62fe(0x2c4)))_0x123727(_0x2d62fe(0x2e5)+_0x2d62fe(0x1c0),_0x2d62fe(0x17c));else{if(_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x33a))||_0x591410['includes'](_0x2d62fe(0x2a8))||_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x257))||_0x591410['includes'](_0x2d62fe(0x20e)+'n')||_0x591410[_0x2d62fe(0x274)]('Login\x20su'+_0x2d62fe(0x2c8))||_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x232))||_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x2cc))||_0x591410['includes'](_0x2d62fe(0x33d))||_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x260)+_0x2d62fe(0x15c)+'d')||_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x326)+_0x2d62fe(0x30f)+'d\x20auth'))_0x1c534f=!![],_0x123727(_0x2d62fe(0x2e5)+_0x2d62fe(0x1c0),'SUCCESS'),setTimeout(()=>{const _0x3f98bd=_0x2d62fe;_0x10fd36&&(_0x10fd36[_0x3f98bd(0x2d6)](),_0x10fd36=null);},0xbb8);else{if(_0x591410['includes']('过期')||_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x34a)))_0x123727(_0x2d62fe(0x2e5)+_0x2d62fe(0x1c0),_0x2d62fe(0x252));else(_0x591410['includes']('失败')||_0x591410[_0x2d62fe(0x274)](_0x2d62fe(0x16f))||_0x591410[_0x2d62fe(0x274)]('Error'))&&_0x123727('wechat-s'+_0x2d62fe(0x1c0),_0x2d62fe(0x25d));}}_0x123727('wechat-l'+'og',_0x591410);};return _0x10fd36[_0x16fc21(0x2b9)]?.['on'](_0x16fc21(0x265),_0x55e78b),_0x10fd36[_0x16fc21(0x1b4)]?.['on'](_0x16fc21(0x265),_0x55e78b),_0x10fd36['on']('error',_0x41c2a9=>{const _0x1b1642=_0x16fc21;_0x10fd36=null,_0x123727('wechat-s'+_0x1b1642(0x1c0),_0x1b1642(0x25d)),_0x123727('wechat-l'+'og',_0x1b1642(0x1b8)+_0x1b1642(0x2e7)+_0x41c2a9[_0x1b1642(0x30a)]);}),_0x10fd36['on'](_0x16fc21(0x15e),_0x3784a5=>{const _0x41506a=_0x16fc21;_0x10fd36=null,_0x1c534f?_0x110d66(!![])[_0x41506a(0x249)](()=>{}):(_0x110d66(![])[_0x41506a(0x249)](()=>{}),_0x123727(_0x41506a(0x2e5)+_0x41506a(0x1c0),_0x3784a5===0x0?'CLOSED':_0x41506a(0x25d)));}),{'ok':!![]};}function _0x363459(){const _0x1dd325=_0x24a899;return _0x10fd36&&(_0x10fd36[_0x1dd325(0x2d6)](),_0x10fd36=null),{'ok':!![]};}function _0xaafe85(){const _0x4496dc=_0x24a899;for(const _0x19dc4c of _0x233939[_0x4496dc(0x16a)]()){_0x1026ae(_0x19dc4c),_0x19dc4c[_0x4496dc(0x21a)]?.[_0x4496dc(0x2d6)]();}_0x233939[_0x4496dc(0x21f)]();for(const _0x36881b of _0x5e533b[_0x4496dc(0x16a)]()){_0x2c1018(_0x36881b);}_0x5e533b[_0x4496dc(0x21f)]();for(const _0x2cfc3a of _0x1157d5[_0x4496dc(0x16a)]()){_0x8ad4db(_0x2cfc3a),_0x530fd0(_0x2cfc3a),_0x2cfc3a[_0x4496dc(0x21a)]?.[_0x4496dc(0x2d6)]();}_0x1157d5['clear'](),_0x10fd36&&(_0x10fd36[_0x4496dc(0x2d6)](),_0x10fd36=null);}return{'saveFeishuChannelConfig':_0x3a99fc,'saveQqbotChannelConfig':_0x311af6,'saveWecomChannelConfig':_0x53d4e6,'saveQqMailConnectorConfig':_0x2f179d,'saveNetEaseMailConnectorConfig':_0x4fda1e,'saveTencentExmailConnectorConfig':_0x231841,'saveFeishuDocConnectorConfig':_0x4fde7e,'saveTencentDocsConnectorConfig':_0x1dc7c8,'saveKdocsConnectorConfig':_0x2e6b44,'saveDingtalkDocConnectorConfig':_0x3603d3,'readConfigSnapshot':_0x404ef6,'startKdocsCliConnectSession':_0x2b3ba9,'getKdocsCliConnectStatus':_0xc233bb,'cancelKdocsCliConnectSession':_0x220bef,'startFeishuDocCliConnectSession':_0x2691d0,'getFeishuDocCliConnectStatus':_0x1f6720,'cancelFeishuDocCliConnectSession':_0x4939c,'completeFeishuDocCliConnectSession':_0x5ff8aa,'startFeishuRegistrationSession':_0x4c0ac7,'getFeishuRegistrationStatus':_0x2fe6d5,'cancelFeishuRegistrationSession':_0x2474f2,'listImChannelConfigs':_0x409144,'deleteImChannelConfig':_0x2d19b1,'setImChannelEnabled':_0x398c5f,'startWechatChannelSession':_0x274c15,'cancelWechatChannelSession':_0x363459,'dispose':_0xaafe85};}
|
|
1
|
+
(function(_0xfcd4d1,_0xd596a0){const _0x58d991=_0x575e,_0x5ab446=_0xfcd4d1();while(!![]){try{const _0xb9d623=-parseInt(_0x58d991(0x296))/0x1*(-parseInt(_0x58d991(0x334))/0x2)+-parseInt(_0x58d991(0x232))/0x3+parseInt(_0x58d991(0x350))/0x4*(-parseInt(_0x58d991(0x2e4))/0x5)+parseInt(_0x58d991(0x311))/0x6*(-parseInt(_0x58d991(0x3c7))/0x7)+-parseInt(_0x58d991(0x37f))/0x8*(-parseInt(_0x58d991(0x207))/0x9)+parseInt(_0x58d991(0x264))/0xa+-parseInt(_0x58d991(0x238))/0xb*(-parseInt(_0x58d991(0x3b4))/0xc);if(_0xb9d623===_0xd596a0)break;else _0x5ab446['push'](_0x5ab446['shift']());}catch(_0x4a665d){_0x5ab446['push'](_0x5ab446['shift']());}}}(_0x1502,0xde5f4));import{spawn}from'node:child_process';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(_0x2f1300){const _0x5661c9=_0x575e;return typeof _0x2f1300===_0x5661c9(0x2e8)?_0x2f1300[_0x5661c9(0x324)]():'';}function findDingtalkDocMcpServer(_0x42d8af){const _0x2c8592=_0x575e,_0x587609=asRecord(_0x42d8af[DINGTALK_DOC_MCP_SERVER_NAME]);if(Object[_0x2c8592(0x361)](_0x587609)[_0x2c8592(0x3a7)]>0x0)return _0x587609;for(const [_0x5a3c20,_0x3c60d0]of Object['entries'](_0x42d8af)){const _0x1c1165=asRecord(_0x3c60d0),_0x2bb8c9=getTrimmedString(_0x5a3c20)['toLowerC'+_0x2c8592(0x260)](),_0x597866=getTrimmedString(_0x1c1165[_0x2c8592(0x38a)])[_0x2c8592(0x3d1)+_0x2c8592(0x260)]();if(_0x2bb8c9[_0x2c8592(0x383)](_0x2c8592(0x379))||_0x2bb8c9[_0x2c8592(0x383)](_0x2c8592(0x24a))||_0x2bb8c9[_0x2c8592(0x383)]('钉钉')||_0x597866[_0x2c8592(0x383)](_0x2c8592(0x379))||_0x597866[_0x2c8592(0x383)](_0x2c8592(0x24a)))return _0x1c1165;}return{};}function createFeishuRegistrationClient(){const _0x4fd963=_0x575e,_0x4fc1bf=FEISHU_REGISTRATION_ENV_URLS[DEFAULT_FEISHU_REGISTRATION_ENV];if(!_0x4fc1bf)throw new Error(_0x4fd963(0x1d3)+_0x4fd963(0x290)+_0x4fd963(0x307)+_0x4fd963(0x1f9)+_0x4fd963(0x2d1)+DEFAULT_FEISHU_REGISTRATION_ENV);return{'baseUrl':_0x4fc1bf,'headers':{'Content-Type':_0x4fd963(0x396)+'ion/x-ww'+_0x4fd963(0x302)+_0x4fd963(0x33b)+'d'},'timeoutMs':DEFAULT_FEISHU_REGISTRATION_TIMEOUT_MS};}async function postFeishuRegistration(_0x57ca4a,_0x15bd6b){const _0x9212c4=_0x575e,_0xded570=await fetch(_0x57ca4a[_0x9212c4(0x297)]+(_0x9212c4(0x1d4)+'1/app/re'+_0x9212c4(0x1e0)+'on'),{'method':_0x9212c4(0x242),'headers':_0x57ca4a[_0x9212c4(0x3be)],'body':new URLSearchParams(_0x15bd6b)['toString'](),'signal':AbortSignal['timeout'](_0x57ca4a[_0x9212c4(0x21a)+'s'])}),_0x377f63=await _0xded570['json']()['catch'](()=>({}));if(!_0xded570['ok']){const _0x1f3a3d=new Error(_0x9212c4(0x2fb)+_0xded570[_0x9212c4(0x1ee)]);_0x1f3a3d['response'+_0x9212c4(0x310)]=_0x377f63;throw _0x1f3a3d;}return asRecord(_0x377f63);}function _0x575e(_0x10d258,_0x1024f8){_0x10d258=_0x10d258-0x1cf;const _0x150220=_0x1502();let _0x575edc=_0x150220[_0x10d258];return _0x575edc;}async function initFeishuRegistration(_0x3757c2){const _0x42c9b5=_0x575e;return postFeishuRegistration(_0x3757c2,{'action':_0x42c9b5(0x1ec)});}async function beginFeishuRegistration(_0x5bee14){const _0x1ae5ab=_0x575e;return postFeishuRegistration(_0x5bee14,{'action':_0x1ae5ab(0x35f),'archetype':_0x1ae5ab(0x2ac)+'Agent','auth_method':_0x1ae5ab(0x2e1)+_0x1ae5ab(0x269),'request_user_info':_0x1ae5ab(0x314)});}async function pollFeishuRegistration(_0x528e94,_0x37ae7d){const _0x5bce26=_0x575e;try{return await postFeishuRegistration(_0x528e94,{'action':_0x5bce26(0x204),'device_code':_0x37ae7d});}catch(_0x1f6a4e){if(_0x1f6a4e?.[_0x5bce26(0x21b)+_0x5bce26(0x310)]&&typeof _0x1f6a4e[_0x5bce26(0x21b)+_0x5bce26(0x310)]===_0x5bce26(0x2a7))return asRecord(_0x1f6a4e[_0x5bce26(0x21b)+_0x5bce26(0x310)]);throw _0x1f6a4e;}}function extractFeishuRegistrationAuthorizationUri(_0x415dfd){const _0x5da631=_0x575e,_0x34d154=getTrimmedString(_0x415dfd['authoriz'+_0x5da631(0x3bf)+'i_comple'+'te'])||getTrimmedString(_0x415dfd[_0x5da631(0x226)+_0x5da631(0x3bf)+'i'])||getTrimmedString(_0x415dfd[_0x5da631(0x34f)+'thorizat'+'ion_uri_'+_0x5da631(0x201)])||getTrimmedString(_0x415dfd[_0x5da631(0x34f)+_0x5da631(0x1d1)+_0x5da631(0x299)])||getTrimmedString(_0x415dfd[_0x5da631(0x34f)+_0x5da631(0x1d1)+_0x5da631(0x22d)])||getTrimmedString(_0x415dfd[_0x5da631(0x226)+_0x5da631(0x3bf)+'l']);if(_0x34d154)return _0x34d154;const _0x1b9307=getTrimmedString(_0x415dfd[_0x5da631(0x341)])||getTrimmedString(_0x415dfd[_0x5da631(0x34f)+_0x5da631(0x1d1)+_0x5da631(0x270)+'_id']);return _0x1b9307?FEISHU_REGISTRATION_ENV_URLS[DEFAULT_FEISHU_REGISTRATION_ENV]+(_0x5da631(0x332)+'ope-auth'+'orizatio'+_0x5da631(0x37e)+'d=')+encodeURIComponent(_0x1b9307):null;}function serializeFeishuRegistrationSession(_0x3b2681){const _0x1af0a3=_0x575e;return{'sessionId':_0x3b2681[_0x1af0a3(0x30f)+'d'],'verificationUriComplete':_0x3b2681['verifica'+_0x1af0a3(0x23a)+_0x1af0a3(0x3a5)],'expiresAt':new Date(_0x3b2681[_0x1af0a3(0x2e2)+'t'])['toISOStr'+'ing'](),'pollIntervalMs':_0x3b2681[_0x1af0a3(0x27b)+_0x1af0a3(0x38c)],'status':_0x3b2681[_0x1af0a3(0x1ee)],'errorMessage':_0x3b2681[_0x1af0a3(0x262)+_0x1af0a3(0x3c2)],'purpose':_0x3b2681['purpose'],'authorizationUri':_0x3b2681[_0x1af0a3(0x226)+_0x1af0a3(0x212)]};}function _0x1502(){const _0x513cab=['完成应用创建','entry','_doc','QQ\x20邮箱','token','HTTP\x20','catch','replace','markConf','请输入有效的钉钉','Feishu\x20d','onMode','w-form-u','\x20connect','QQ机器人\x20Ap','openExte','feishu_d','hu\x20regis','fresh','zationCo','latest','allowlis','kdocs\x20sk','connecti','purpose','sessionI','Data','6nepsPl','ctor\x20plu','open','open_id','山文档授权','once','oxy','allowFro','with\x20cod','skill','stringif','gin\x20dele','nodeExec','nfig\x20del','正在检查飞书\x20C','ion\x20id\x20i','client_i','persistC','lient','trim','ALL_PROX','name','process','login\x20--','igRaw','qqbot\x20ch','重新生成','channels','.opencla','test','\x22\x20not\x20fo','connecto','map','/page/sc','slides,b','324694iBinGV','utf8','tion_url','oc-cli','金山文档','wujie.ai','pSecret\x20','rlencode','message','end','boolean','expire_i','http_pro','flow_id','ode','accounts','skills','client','_complet','und','ession\x20i','\x20channel','--domain','启动成功','pServer','spawn\x20op','imap.163','scope_au','2260276Fsiotf','的新版客户端','dmPolicy','安装包含微信插件','websocke','ail.qq.c','wechat-s','appDevic','max','resolveS','Kdocs\x20CL','失,无法初始化','appId','setPlugi','扫码成功','begin','annel\x20co','keys','ocs-cli\x20','setChann','spawn','plugins','se.','n\x20respon','正在验证飞书授权','call','channel','netease_','onfigPat','clientSe','ERROR','login','clear','timer','tatus','ame','tus','docs','\x20doc\x20mcp','二维码已过期,请','Local\x20lo','dingtalk','Current\x20','飞书机器人\x20Ap','kdocs-cl','飞书应用创建超时','n?flow_i','1292624DdZmPb','cliAppSe','botId','QQ助手','includes','权状态验证失败','docs-cli','正在打开飞书用户','.json','usTimer','授权状态','url','用户已取消飞书机','rvalMs','ogin',',sheets,','le-http','code','--app-id','--channe','doc_conn','飞书\x20CLI\x20用','appSecre','applicat','led','企微助手\x20Bot','rnal','netease\x20','...(','Spawn\x20er','--versio','streamab','startedA','p\x20URL','--scope','valid','gin\x20upda','gin\x20save','omplete','enabled','length','match','tencent_','transpor','hannels\x20','飞书\x20CLI\x20执','error','or\x20plugi','search','igSnapsh','access_d','文档\x20Strea','ll\x20conne','12pDeTlS','Failed','bind','金山文档已连接','slow_dow','onFailur','fig','required','readConf','权状态验证超时','headers','ation_ur','export','ternally','sage','writeCon','already\x20','esAt','nding','9309160wbDkfl','egistrat','ired','disabled','pID\x20is\x20r','deviceCo','.com','企微助手','pending','verifica','toLowerC','output','kill','ill\x20enab','user_inf','qq_mail','\x20is\x20requ','I\x20sessio','thorizat','ent_secr','Unsuppor','/oauth/v','飞书用户身份','onfig\x20up','support@','join','data','indexOf','apiKey','get','smtp.exm','expired_','find','gistrati','ocr','正在进入用户授权','当前客户端未内置','返回授权\x20URL','smtp.163','close','appPollC','金山文档尚未授权','scriptio','飞书机器人','ion\x20not\x20','init','\x20deleted','status','授权页',':authori','ethods','read','ecret\x20应用','com','\x20已安装','tokenSta','expired','identiti','tration\x20','tateDir','projectR','user','Channel\x20','nConfig','utable','verifyTi','complete','wechat-l','--force-','poll','kdocs','slice','72ATABci','id\x20is\x20re','Feishu\x20r','请在浏览器完成金','金山文档登录启动','Invalid\x20','d_auth_m','onfig\x20de','feishu_c','deleteMc','\x20exited\x20','ationUri','parse','stderr','wecom','config','secret','n\x20update','usStarte','timeoutM','response','飞书绑定失败:','飞书\x20CLI\x20授','mer','https:','创建失败','i:keycha','WujieAI','ocs:read','\x20not\x20sup','ated','authoriz','scanned','身份要求:\x20','Bin','CLOSED','groupAll','openclaw','ion_url','tion_uri','interval','ll\x20updat','腾讯企业邮箱','3765168LXVwin','exmail\x20c','pluginId',',请先连接','eamableH','then','30043321aFzTOE','filter','tionUriC','quired','allow','onSucces','is\x20requi','s\x20requir','飞书开放平台未返','授权码\x20is\x20r','POST','tencent\x20','xOf','cliHostC','exmail','feishu-d','push','smtp.qq.','dingding','elConfig','失败,请确认\x20k','appPollI','logged\x20i','Error','已连接过','ttp\x20URL\x20','deleteCh','check','ID\x20is\x20re','cret-std','docs,dri','et\x20auth.','等待飞书用户授权','ccess','Login\x20su','toString','scriptPa','mcp','\x20plugin\x20','supporte','ase','eted','errorMes','<empty>','8424500fpAYGn','qq\x20mail\x20','lastInde','mableHtt','stdout','ecret','li_user','ector','now','appTimer','Missing\x20','stdin','ion_flow','Entry','ctor\x20del','ntervalM','identity','wechat','executab','https_pr','户授权失败','QR_READY','权状态不符合用户','pollInte','environm','\x20config\x20','当前飞书开放平台','enied','oc\x20conne','rver','接失败','连接成功','device_c','ationCod','imap.exm','回应用创建页面或','wecom\x20ch','set','error_de','full','verify','oc\x20CLI\x20s','d\x20auth','channelI','ted\x20Feis','dated','HTTP_PRO','r\x20\x22','search:d','equired','2REfSmV','baseUrl','eCode','ion_uri','ve,markd','163\x20邮箱','mail\x20con','igWriteH','deleted','--no-wai','logout','values','entries','owFrom','ted','nector\x20p','assign','object','正在验证金山文档','openId','r\x20plugin','auth','Personal','r-log','行失败','feishu\x20d','mail','\x20updated','env','EXPIRED','器人绑定','nfig\x20upd','飞书应用已创建,','验证超时','dAt','验证失败','Connecto','飞书\x20CLI\x20连','groupPol','onnector','uired','lark-cli','function','hint','deleteSk','setSkill','ector\x20de','qqbot','e\x20or\x20dev','docs\x20ski','用绑定失败','delete','red','managedB','--brand','share','hannel\x20c','HTTPS_PR','ion\x20sess','env:\x20','authStat','create','1.0.0','resolve','飞书应用创建失败','feishu','illEntry','isArray',':user','cret','账号\x20is\x20re','lugin\x20de','onfig','leted','phase','client_s','expiresA','lePath','15lzLuLJ','n\x20id\x20is\x20','icy','ession\x20n','string','d\x20is\x20req','-weixin','飞书文档\x20CLI','setMcpSe','\x20device_','feishu\x20c','ready','update','ice_code','企微助手\x20Sec','ret\x20is\x20r','annelCon','exists'];_0x1502=function(){return _0x513cab;};return _0x1502();}function extractFirstUrl(_0xc84f6d){const _0x509daf=_0x575e,_0x337085=_0xc84f6d[_0x509daf(0x3a8)](/https?:\/\/[^\s"'<>]+/i);return _0x337085?_0x337085[0x0]:null;}function isKdocsAuthStatusReady(_0xd33614){const _0x3d71b2=_0x575e,_0x5b3e30=_0xd33614[_0x3d71b2(0x3d1)+_0x3d71b2(0x260)]();if(/not\s+login|not\s+logged|unauth|未登录|未认证|未授权|失败/[_0x3d71b2(0x32e)](_0x5b3e30))return![];return/login|logged|auth|valid|success|已登录|已认证|已授权|有效|成功/[_0x3d71b2(0x32e)](_0x5b3e30);}function parseFeishuDocCliJson(_0x156f01){const _0x165cec=_0x575e,_0x9491c8=_0x156f01['trim']();if(!_0x9491c8)return{};try{return asRecord(JSON[_0x165cec(0x213)](_0x9491c8));}catch{for(let _0x11285f=_0x9491c8['indexOf']('{');_0x11285f>=0x0;_0x11285f=_0x9491c8[_0x165cec(0x1da)]('{',_0x11285f+0x1)){for(let _0x29d2c5=_0x9491c8[_0x165cec(0x266)+_0x165cec(0x244)]('}');_0x29d2c5>_0x11285f;_0x29d2c5=_0x9491c8[_0x165cec(0x266)+_0x165cec(0x244)]('}',_0x29d2c5-0x1)){try{return asRecord(JSON[_0x165cec(0x213)](_0x9491c8[_0x165cec(0x206)](_0x11285f,_0x29d2c5+0x1)));}catch{}}}return{};}}function summarizeCliOutput(_0x4b9d8a){const _0x4e638e=_0x575e,_0x5b5132=_0x4b9d8a[_0x4e638e(0x324)]();if(!_0x5b5132)return _0x4e638e(0x263);return _0x5b5132[_0x4e638e(0x3a7)]>0x320?_0x5b5132[_0x4e638e(0x206)](0x0,0x320)+_0x4e638e(0x39b)+_0x5b5132['length']+'\x20chars)':_0x5b5132;}function extractFeishuDocCliError(_0x4280c5,_0x1e83b4){const _0x57cea4=_0x575e,_0x3bfdc9=parseFeishuDocCliJson(_0x4280c5),_0x513fc0=asRecord(_0x3bfdc9[_0x57cea4(0x3ad)]),_0xa9eed5=getTrimmedString(_0x513fc0[_0x57cea4(0x33c)]),_0x182a53=getTrimmedString(_0x513fc0[_0x57cea4(0x2c1)]);if(_0xa9eed5&&_0x182a53)return _0xa9eed5+'\x0a'+_0x182a53;if(_0xa9eed5)return _0xa9eed5;return _0x4280c5[_0x57cea4(0x324)]()||_0x1e83b4;}function getFeishuDocCliFailureMessage(_0x13db47,_0x298c7f,_0x2e0be5){const _0x17140d=_0x575e,_0x1a4540=_0x298c7f[_0x17140d(0x324)]()['split']('\x0a')[_0x17140d(0x206)](-0x8)[_0x17140d(0x1d8)]('\x0a')[_0x17140d(0x324)](),_0x267c30=_0x13db47===_0x17140d(0x2d3)?'飞书开放平台应用'+_0x17140d(0x220):_0x13db47===_0x17140d(0x3b6)?'飞书\x20CLI\x20应'+_0x17140d(0x2c8):_0x13db47===_0x17140d(0x2ab)?_0x17140d(0x394)+_0x17140d(0x278):_0x17140d(0x21d)+_0x17140d(0x384);return _0x1a4540?_0x267c30+':\x20'+_0x1a4540:_0x267c30+':\x20'+_0x2e0be5;}function ensureFeishuDocCliUserStatus(_0x35eee3){const _0x1564f0=_0x575e,_0x1740b7=parseFeishuDocCliJson(_0x35eee3),_0x3efc87=asRecord(_0x1740b7[_0x1564f0(0x1f8)+'es']),_0x2a2622=asRecord(_0x3efc87[_0x1564f0(0x1fc)]),_0x1e6187=getTrimmedString(_0x1740b7[_0x1564f0(0x274)]),_0x49ef54=getTrimmedString(_0x1740b7[_0x1564f0(0x1f6)+_0x1564f0(0x374)])||getTrimmedString(_0x2a2622[_0x1564f0(0x1f6)+'tus']),_0x4d23ca=getTrimmedString(_0x2a2622[_0x1564f0(0x1ee)]),_0x96928b=_0x2a2622['availabl'+'e']===!![];if(_0x1e6187!=='user'||_0x4d23ca&&_0x4d23ca!==_0x1564f0(0x2ef)||Object[_0x1564f0(0x361)](_0x2a2622)[_0x1564f0(0x3a7)]>0x0&&!_0x96928b||_0x49ef54!==_0x1564f0(0x3a2)&&_0x49ef54!=='needs_re'+_0x1564f0(0x308))throw new Error(_0x1564f0(0x21d)+_0x1564f0(0x27a)+_0x1564f0(0x228)+_0x35eee3[_0x1564f0(0x324)]());}function createKdocsCliStatus(_0x11172d){const _0x1c9462=_0x575e;return{'sessionId':_0x11172d[_0x1c9462(0x30f)+'d'],'status':_0x11172d[_0x1c9462(0x1ee)],'phase':_0x11172d[_0x1c9462(0x2e0)],'url':_0x11172d[_0x1c9462(0x38a)],'message':_0x11172d['message'],'errorMessage':_0x11172d['errorMes'+_0x1c9462(0x3c2)]};}function createFeishuDocCliStatus(_0xfc959b){const _0x3759c1=_0x575e;return{'sessionId':_0xfc959b[_0x3759c1(0x30f)+'d'],'status':_0xfc959b[_0x3759c1(0x1ee)],'phase':_0xfc959b['phase'],'url':_0xfc959b['url'],'message':_0xfc959b[_0x3759c1(0x33c)],'errorMessage':_0xfc959b[_0x3759c1(0x262)+_0x3759c1(0x3c2)]};}export function createConnectorController({shellConfig:_0x5ba426,configController:_0x33633a,broadcast:_0x533e40,shell:_0x52496f,getRuntimeSpawnContext:_0x2280b2,openClawConfigHandlers:openClawConfigHandlers={},resolveRuntimeKdocsCliCommand:_0x3b0bc6,resolveRuntimeLarkCliCommand:_0x1fadf2}){const _0x5bae69=_0x575e,_0x5cd7c6=new Map(),_0x1452bf=new Map(),_0x3c72cd=new Map();let _0x2f0ae0=null;const _0xc78487=()=>_0x33633a['readConf'+_0x5bae69(0x329)]();async function _0x3d662c(_0x3ee028,_0x294f10){const _0x46a549=_0x5bae69;if(typeof openClawConfigHandlers[_0x46a549(0x2f0)]==='function')return openClawConfigHandlers[_0x46a549(0x2f0)](_0x32c77b=>{const _0x2ddef1=_0x46a549;for(const _0x1a3e21 of Object[_0x2ddef1(0x361)](_0x32c77b)){!Object['prototyp'+'e']['hasOwnPr'+'operty'][_0x2ddef1(0x369)](_0x3ee028,_0x1a3e21)&&delete _0x32c77b[_0x1a3e21];}Object[_0x2ddef1(0x2a6)](_0x32c77b,_0x3ee028);},_0x294f10);return typeof _0x33633a[_0x46a549(0x322)+_0x46a549(0x2de)]==='function'?await _0x33633a['persistC'+_0x46a549(0x2de)](_0x3ee028,_0x294f10):(_0x33633a[_0x46a549(0x2fe)+_0x46a549(0x29d)+'andledIn'+_0x46a549(0x3c1)]?.(),await _0x33633a[_0x46a549(0x3c3)+_0x46a549(0x3ba)](_0x3ee028,_0x294f10)),{'ok':!![]};}function _0x3269cc(){const _0x4187f1=_0x5bae69;return join(_0x33633a['resolveS'+_0x4187f1(0x1fa)](),_0x4187f1(0x247)+_0x4187f1(0x337));}function _0x20e604(){const _0x303db0=_0x5bae69;return join(_0x3269cc(),_0x303db0(0x32d)+'w',_0x303db0(0x22c)+'.json');}async function _0x1ed832(_0x281def={}){const _0x4549be=_0x5bae69;return _0x2280b2(_0x5ba426[_0x4549be(0x1fb)+'oot'],_0x281def);}async function _0x116e9f(_0x2e9232,_0x1a1e6e){const _0x5eb6db=_0x5bae69,{env:_0x41b9fb,runtime:_0x5925aa}=await _0x1ed832({'FORCE_COLOR':'0','HOME':homedir()}),_0x342514=await _0x3b0bc6(_0x5925aa);return _0x533e40('connecto'+_0x5eb6db(0x2ad),{'connector':_0x5eb6db(0x205),'phase':'spawn','message':_0x5eb6db(0x37c)+'i\x20'+_0x2e9232['join']('\x20')}),new Promise((_0x154ac0,_0x26c4c4)=>{const _0x3f5a54=_0x5eb6db,_0x41b685=spawn(_0x342514[_0x3f5a54(0x276)+_0x3f5a54(0x2e3)],_0x2e9232,{'cwd':homedir(),'env':_0x41b9fb});let _0x517221='';const _0x4bbad3=_0x21334e=>{const _0xeba4e8=_0x3f5a54,_0x3fd90d=_0x21334e['toString'](_0xeba4e8(0x335));_0x517221+=_0x3fd90d,_0x533e40(_0xeba4e8(0x330)+'r-log',{'connector':_0xeba4e8(0x205),'phase':_0xeba4e8(0x3d2),'message':_0x3fd90d});};_0x41b685[_0x3f5a54(0x268)]['on'](_0x3f5a54(0x1d9),_0x4bbad3),_0x41b685[_0x3f5a54(0x214)]['on'](_0x3f5a54(0x1d9),_0x4bbad3),_0x41b685[_0x3f5a54(0x316)](_0x3f5a54(0x3ad),_0x26c4c4),_0x41b685['once']('close',_0x5a61ca=>_0x154ac0({'code':_0x5a61ca,'output':_0x517221}));if(typeof _0x1a1e6e===_0x3f5a54(0x2e8))_0x41b685[_0x3f5a54(0x26f)][_0x3f5a54(0x33d)](_0x1a1e6e);else _0x41b685[_0x3f5a54(0x26f)]['end']();});}async function _0x289277(){const _0x55b7f7=_0x5bae69,_0x3f3811=await _0xc78487(),_0x3a2180=asRecord(_0x3f3811[_0x55b7f7(0x344)]),_0x310f8a=asRecord(_0x3a2180[_0x55b7f7(0x2a2)]),_0x7814e4={...asRecord(_0x310f8a[KDOCS_SKILL_ID]),'enabled':!![]};if(typeof openClawConfigHandlers['setSkill'+'Entry']===_0x55b7f7(0x2c0)){await openClawConfigHandlers[_0x55b7f7(0x2c3)+_0x55b7f7(0x271)]({'skillId':KDOCS_SKILL_ID,'entry':_0x7814e4,'reason':'kdocs\x20sk'+_0x55b7f7(0x3d4)+_0x55b7f7(0x397)});return;}_0x310f8a[KDOCS_SKILL_ID]=_0x7814e4,_0x3a2180[_0x55b7f7(0x2a2)]=_0x310f8a,_0x3f3811[_0x55b7f7(0x344)]=_0x3a2180,await _0x3d662c(_0x3f3811,_0x55b7f7(0x30c)+_0x55b7f7(0x3d4)+'led');}async function _0x83c6cc(_0x47569d){const _0x3a6186=_0x5bae69,_0x13a3c0=await _0xc78487(),_0x44ca04=asRecord(_0x13a3c0['skills']),_0x1ad0b0=asRecord(_0x44ca04[_0x3a6186(0x2a2)]),_0x47f5e5={...asRecord(_0x1ad0b0[KDOCS_SKILL_ID]),'enabled':Boolean(_0x47569d)};if(typeof openClawConfigHandlers['setSkill'+_0x3a6186(0x271)]==='function'){await openClawConfigHandlers[_0x3a6186(0x2c3)+'Entry']({'skillId':KDOCS_SKILL_ID,'entry':_0x47f5e5,'reason':_0x3a6186(0x30c)+'ill\x20'+(_0x47569d?_0x3a6186(0x3a6):'disabled')});return;}_0x1ad0b0[KDOCS_SKILL_ID]=_0x47f5e5,_0x44ca04[_0x3a6186(0x2a2)]=_0x1ad0b0,_0x13a3c0['skills']=_0x44ca04,await _0x3d662c(_0x13a3c0,_0x3a6186(0x30c)+'ill\x20'+(_0x47569d?_0x3a6186(0x3a6):'disabled'));}async function _0xb6a20a(){const _0x2577f6=_0x5bae69;if(typeof openClawConfigHandlers['deleteSk'+_0x2577f6(0x2d8)]==='function'){await openClawConfigHandlers['deleteSk'+'illEntry']({'skillId':KDOCS_SKILL_ID,'reason':'kdocs\x20sk'+'ill\x20conn'+_0x2577f6(0x2c4)+_0x2577f6(0x2df)});return;}const _0x57185e=await _0xc78487(),_0x464e03=asRecord(_0x57185e[_0x2577f6(0x344)]),_0x1b1cb9=asRecord(_0x464e03[_0x2577f6(0x2a2)]);delete _0x1b1cb9[KDOCS_SKILL_ID],_0x464e03[_0x2577f6(0x2a2)]=_0x1b1cb9,_0x57185e[_0x2577f6(0x344)]=_0x464e03,await _0x3d662c(_0x57185e,_0x2577f6(0x30c)+'ill\x20conn'+'ector\x20de'+_0x2577f6(0x2df));}async function _0x1d9a74(){const _0x5d7d86=_0x5bae69;if(!await _0x255a0e())throw new Error(_0x5d7d86(0x1e8)+',请先完成\x20kd'+_0x5d7d86(0x362)+'连接');return await _0x289277(),{'ok':!![]};}async function _0x255a0e(){const _0x4f242a=_0x5bae69,_0x41e0ed=await _0x116e9f(['auth',_0x4f242a(0x1ee)])[_0x4f242a(0x2fc)](()=>({'code':null,'output':''}));return _0x41e0ed[_0x4f242a(0x390)]===0x0&&isKdocsAuthStatusReady(_0x41e0ed['output']);}async function _0x47afaa({appId:_0xda5d5c,appSecret:_0x557702,userInfo:userInfo=null}){const _0x158293=_0x5bae69,_0xa30548=await _0xc78487();applyFeishuChannelConfig(_0xa30548,{'appId':_0xda5d5c,'appSecret':_0x557702,'userInfo':userInfo});const _0x202447=asRecord(_0xa30548['channels']);if(typeof openClawConfigHandlers[_0x158293(0x363)+_0x158293(0x24b)]==='function')return openClawConfigHandlers[_0x158293(0x363)+_0x158293(0x24b)]({'channelId':_0x158293(0x2d7),'channel':asRecord(_0x202447[_0x158293(0x2d7)]),'pluginId':_0x158293(0x2d7),'pluginEnabled':!![],'reason':'feishu\x20c'+_0x158293(0x2ce)+'onfig\x20up'+'dated'});await _0x3d662c(_0xa30548,_0x158293(0x2ee)+_0x158293(0x2ce)+_0x158293(0x1d6)+_0x158293(0x291));}async function _0x1629be({appId:_0x4d06e9,appSecret:_0x741512,userInfo:userInfo=null,configPath:_0x55df7c}){const _0x592a4a=_0x5bae69,_0x26392d=getTrimmedString(userInfo?.[_0x592a4a(0x2a9)]),_0x2c1503={'channels':{'feishu':{'enabled':![],'appId':_0x4d06e9,'appSecret':_0x741512,'domain':_0x592a4a(0x2d7),'connectionMode':_0x592a4a(0x354)+'t','requireMention':!![],'dmPolicy':_0x26392d?_0x592a4a(0x30b)+'t':'disabled','groupPolicy':_0x592a4a(0x3ca),'streaming':!![],'allowFrom':_0x26392d?[_0x26392d]:[],'groupAllowFrom':[]}},'plugins':{'entries':{},'allow':[]},'tools':{'profile':_0x592a4a(0x28b)}};await mkdir(dirname(_0x55df7c),{'recursive':!![]}),await writeFile(_0x55df7c,JSON[_0x592a4a(0x31b)+'y'](_0x2c1503,null,0x2)+'\x0a',_0x592a4a(0x335));}async function _0x152105(_0x247101={}){const _0x5b44fa=_0x5bae69,_0x1bfb09=safeString(_0x247101['appId']),_0x35ef34=safeString(_0x247101[_0x5b44fa(0x395)+'t']);if(!_0x1bfb09)throw new Error(_0x5b44fa(0x37b)+_0x5b44fa(0x3cb)+_0x5b44fa(0x295));if(!_0x35ef34)throw new Error(_0x5b44fa(0x37b)+_0x5b44fa(0x33a)+_0x5b44fa(0x23e)+_0x5b44fa(0x2ca));return await _0x47afaa({'appId':_0x1bfb09,'appSecret':_0x35ef34,'userInfo':null}),{'ok':!![]};}async function _0x1e624d(_0xd1ce47={}){const _0x5914d7=_0x5bae69,_0x2a4580=safeString(_0xd1ce47[_0x5914d7(0x35c)]),_0x52d4ca=safeString(_0xd1ce47[_0x5914d7(0x36d)+_0x5914d7(0x2db)]);if(!_0x2a4580)throw new Error(_0x5914d7(0x304)+'pID\x20is\x20r'+_0x5914d7(0x295));if(!_0x52d4ca)throw new Error(_0x5914d7(0x304)+_0x5914d7(0x33a)+_0x5914d7(0x23e)+'red');const _0x5cd5f8=await _0xc78487(),_0x4a4102=asRecord(_0x5cd5f8['channels']),_0xda3754=asRecord(_0x4a4102['qqbot']),_0x2e9f91={'enabled':typeof _0xda3754[_0x5914d7(0x3a6)]===_0x5914d7(0x33e)?_0xda3754[_0x5914d7(0x3a6)]:!![],'allowFrom':['*'],'appId':_0x2a4580,'clientSecret':_0x52d4ca};if(typeof openClawConfigHandlers[_0x5914d7(0x363)+_0x5914d7(0x24b)]===_0x5914d7(0x2c0))return openClawConfigHandlers[_0x5914d7(0x363)+_0x5914d7(0x24b)]({'channelId':'qqbot','channel':_0x2e9f91,'pluginId':QQBOT_PLUGIN_ID,'pluginEnabled':!![],'reason':_0x5914d7(0x32a)+_0x5914d7(0x360)+_0x5914d7(0x2b5)+_0x5914d7(0x225)});_0x4a4102[_0x5914d7(0x2c5)]=_0x2e9f91,_0x5cd5f8[_0x5914d7(0x32c)]=_0x4a4102;const _0x15400f=asRecord(_0x5cd5f8[_0x5914d7(0x365)]),_0x4728ff=asRecord(_0x15400f[_0x5914d7(0x2a2)]);return _0x4728ff[QQBOT_PLUGIN_ID]={...asRecord(_0x4728ff[QQBOT_PLUGIN_ID]),'enabled':!![]},_0x15400f[_0x5914d7(0x2a2)]=_0x4728ff,_0x15400f[_0x5914d7(0x23c)]=dedupeStrings([...asStringArray(_0x15400f[_0x5914d7(0x23c)]),QQBOT_PLUGIN_ID]),_0x5cd5f8['plugins']=_0x15400f,await _0x3d662c(_0x5cd5f8,_0x5914d7(0x32a)+'annel\x20co'+_0x5914d7(0x2b5)+_0x5914d7(0x225)),{'ok':!![]};}async function _0x1cf017(_0x5e3d47={}){const _0x2b0064=_0x5bae69,_0x5c1a06=safeString(_0x5e3d47[_0x2b0064(0x381)]),_0x1ff180=safeString(_0x5e3d47[_0x2b0064(0x217)]);if(!_0x5c1a06)throw new Error(_0x2b0064(0x398)+_0x2b0064(0x254)+_0x2b0064(0x23b));if(!_0x1ff180)throw new Error(_0x2b0064(0x2f2)+_0x2b0064(0x2f3)+_0x2b0064(0x295));const _0x5b02e5=await _0xc78487(),_0x27b87c=asRecord(_0x5b02e5[_0x2b0064(0x32c)]),_0x429ccb=asRecord(_0x27b87c[_0x2b0064(0x215)]),_0x4f2492={..._0x429ccb,'enabled':typeof _0x429ccb[_0x2b0064(0x3a6)]===_0x2b0064(0x33e)?_0x429ccb[_0x2b0064(0x3a6)]:!![],'name':getTrimmedString(_0x429ccb[_0x2b0064(0x326)])||_0x2b0064(0x3ce),'connectionMode':getTrimmedString(_0x429ccb[_0x2b0064(0x30d)+_0x2b0064(0x301)])||'websocke'+'t','dmPolicy':normalizeFeishuDmPolicy(_0x429ccb[_0x2b0064(0x352)])??_0x2b0064(0x313),'groupPolicy':normalizeFeishuGroupPolicy(_0x429ccb[_0x2b0064(0x2bc)+_0x2b0064(0x2e6)])??_0x2b0064(0x313),'allowFrom':asStringArray(_0x429ccb[_0x2b0064(0x318)+'m']),'groupAllowFrom':asStringArray(_0x429ccb[_0x2b0064(0x22b)+_0x2b0064(0x2a3)]),'botId':_0x5c1a06,'secret':_0x1ff180};if(typeof openClawConfigHandlers['setChann'+_0x2b0064(0x24b)]===_0x2b0064(0x2c0))return openClawConfigHandlers[_0x2b0064(0x363)+_0x2b0064(0x24b)]({'channelId':_0x2b0064(0x215),'channel':_0x4f2492,'pluginId':WECOM_PLUGIN_ID,'pluginEnabled':!![],'reason':_0x2b0064(0x288)+_0x2b0064(0x360)+_0x2b0064(0x2b5)+_0x2b0064(0x225)});_0x27b87c[_0x2b0064(0x215)]=_0x4f2492,_0x5b02e5[_0x2b0064(0x32c)]=_0x27b87c;const _0x3fc406=asRecord(_0x5b02e5[_0x2b0064(0x365)]),_0x371174=asRecord(_0x3fc406[_0x2b0064(0x2a2)]);return _0x371174[WECOM_PLUGIN_ID]={...asRecord(_0x371174[WECOM_PLUGIN_ID]),'enabled':!![]},_0x3fc406[_0x2b0064(0x2a2)]=_0x371174,_0x3fc406[_0x2b0064(0x23c)]=dedupeStrings([...asStringArray(_0x3fc406['allow']),WECOM_PLUGIN_ID]),_0x5b02e5[_0x2b0064(0x365)]=_0x3fc406,await _0x3d662c(_0x5b02e5,_0x2b0064(0x288)+_0x2b0064(0x360)+_0x2b0064(0x2b5)+_0x2b0064(0x225)),{'ok':!![]};}async function _0x2d486b(_0x5e1efe,_0x5d76f8,_0x389ffa,_0x31a474){const _0x4f979e=_0x5bae69,_0xcce82=safeString(_0x5d76f8['account']),_0x56a05c=String(_0x5d76f8[_0x4f979e(0x226)+_0x4f979e(0x285)+'e']||'')[_0x4f979e(0x2fd)](/\s+/g,'');if(!_0xcce82)throw new Error(_0x31a474+(_0x4f979e(0x2dc)+_0x4f979e(0x23b)));if(!_0x56a05c)throw new Error(_0x31a474+(_0x4f979e(0x241)+_0x4f979e(0x295)));const _0x3fee7b=await _0xc78487(),_0x40de77=asRecord(_0x3fee7b['plugins']),_0x29e3aa=asRecord(_0x40de77[_0x4f979e(0x2a2)]),_0x5cbf4f=createConnectorPluginEntry(_0x5e1efe,_0x29e3aa[_0x5e1efe],!![],{'account':_0xcce82,'authorizationCode':_0x56a05c,..._0x389ffa});if(typeof openClawConfigHandlers['setPlugi'+_0x4f979e(0x1fe)]==='function')return openClawConfigHandlers[_0x4f979e(0x35d)+_0x4f979e(0x1fe)]({'pluginId':_0x5e1efe,'enabled':!![],'config':asRecord(_0x5cbf4f[_0x4f979e(0x216)]),'reason':_0x5e1efe+(_0x4f979e(0x303)+_0x4f979e(0x3ae)+'n\x20update'+'d')});return _0x29e3aa[_0x5e1efe]=_0x5cbf4f,_0x40de77[_0x4f979e(0x2a2)]=_0x29e3aa,_0x40de77[_0x4f979e(0x23c)]=dedupeStrings([...asStringArray(_0x40de77[_0x4f979e(0x23c)]),_0x5e1efe]),_0x3fee7b[_0x4f979e(0x365)]=_0x40de77,await _0x3d662c(_0x3fee7b,_0x5e1efe+(_0x4f979e(0x303)+_0x4f979e(0x3ae)+_0x4f979e(0x218)+'d')),{'ok':!![]};}const _0x1672d0=_0x2f05bc=>_0x2d486b(QQ_MAIL_CONNECTOR_PLUGIN_ID,_0x2f05bc,{'imapHost':'imap.qq.'+_0x5bae69(0x1f4),'imapPort':0x3e1,'smtpHost':_0x5bae69(0x249)+_0x5bae69(0x1f4),'smtpPort':0x1d1,'secure':!![]},_0x5bae69(0x2f9)),_0x489848=_0x5694ae=>_0x2d486b(NETEASE_MAIL_CONNECTOR_PLUGIN_ID,_0x5694ae,{'imapHost':_0x5bae69(0x34e)+_0x5bae69(0x3cd),'imapPort':0x3e1,'smtpHost':_0x5bae69(0x1e5)+_0x5bae69(0x3cd),'smtpPort':0x1d1,'imapClientName':_0x5bae69(0x222),'imapClientVersion':_0x5bae69(0x2d4),'imapClientVendor':'WujieAI','imapClientSupportEmail':_0x5bae69(0x1d7)+_0x5bae69(0x339),'secure':!![]},_0x5bae69(0x29b)),_0x5233ca=_0x110522=>_0x2d486b(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,_0x110522,{'imapHost':_0x5bae69(0x286)+_0x5bae69(0x355)+'om','imapPort':0x3e1,'smtpHost':_0x5bae69(0x1dd)+_0x5bae69(0x355)+'om','smtpPort':0x1d1,'secure':!![]},'腾讯企业邮箱');async function _0x35e796(_0x839ea4={}){const _0x4e3c3b=_0x5bae69,_0x1ffb58=safeString(_0x839ea4['accountN'+'ame'])||_0x4e3c3b(0x1d5),_0x157620=await _0xc78487(),_0x57e154=asRecord(_0x157620[_0x4e3c3b(0x365)]),_0xb4513=asRecord(_0x57e154[_0x4e3c3b(0x2a2)]),_0x2c02b9=createConnectorPluginEntry(FEISHU_DOC_CONNECTOR_PLUGIN_ID,_0xb4513[FEISHU_DOC_CONNECTOR_PLUGIN_ID],!![],{'authMode':_0x4e3c3b(0x1fc),'accountName':_0x1ffb58});if(typeof openClawConfigHandlers['setPlugi'+'nConfig']===_0x4e3c3b(0x2c0))return openClawConfigHandlers[_0x4e3c3b(0x35d)+_0x4e3c3b(0x1fe)]({'pluginId':FEISHU_DOC_CONNECTOR_PLUGIN_ID,'enabled':!![],'config':asRecord(_0x2c02b9['config']),'reason':'feishu\x20d'+_0x4e3c3b(0x280)+_0x4e3c3b(0x312)+_0x4e3c3b(0x3a3)+'ted'});return _0xb4513[FEISHU_DOC_CONNECTOR_PLUGIN_ID]=_0x2c02b9,_0x57e154[_0x4e3c3b(0x2a2)]=_0xb4513,_0x57e154[_0x4e3c3b(0x23c)]=dedupeStrings([...asStringArray(_0x57e154[_0x4e3c3b(0x23c)]),FEISHU_DOC_CONNECTOR_PLUGIN_ID]),_0x157620[_0x4e3c3b(0x365)]=_0x57e154,await _0x3d662c(_0x157620,_0x4e3c3b(0x2af)+_0x4e3c3b(0x280)+_0x4e3c3b(0x312)+_0x4e3c3b(0x3a3)+'ted'),{'ok':!![]};}async function _0x3c8f79(_0x4bbd9d={}){const _0x236b58=_0x5bae69,_0x2ca307=safeString(_0x4bbd9d[_0x236b58(0x1db)]);if(!_0x2ca307)throw new Error('腾讯文档\x20Key'+_0x236b58(0x1cf)+_0x236b58(0x3c9));const _0x737116=await _0xc78487(),_0x192409=asRecord(_0x737116[_0x236b58(0x344)]),_0x5d6147=asRecord(_0x192409[_0x236b58(0x2a2)]),_0x2f07c3=asRecord(_0x5d6147[TENCENT_DOCS_SKILL_ID]),_0x2c3287={..._0x2f07c3,'enabled':!![],'env':{...asRecord(_0x2f07c3[_0x236b58(0x2b2)]),[TENCENT_DOCS_TOKEN_ENV]:_0x2ca307}};if(typeof openClawConfigHandlers[_0x236b58(0x2c3)+'Entry']===_0x236b58(0x2c0))return openClawConfigHandlers[_0x236b58(0x2c3)+_0x236b58(0x271)]({'skillId':TENCENT_DOCS_SKILL_ID,'entry':_0x2c3287,'reason':_0x236b58(0x243)+_0x236b58(0x2c7)+_0x236b58(0x230)+'ed'});return _0x5d6147[TENCENT_DOCS_SKILL_ID]=_0x2c3287,_0x192409[_0x236b58(0x2a2)]=_0x5d6147,_0x737116[_0x236b58(0x344)]=_0x192409,await _0x3d662c(_0x737116,_0x236b58(0x243)+_0x236b58(0x2c7)+_0x236b58(0x230)+'ed'),{'ok':!![]};}async function _0x5afdba(_0x5e7dec={}){const _0x3c7242=_0x5bae69,_0x20c19c=safeString(_0x5e7dec[_0x3c7242(0x38a)]);if(!_0x20c19c)throw new Error('钉钉文档\x20Str'+_0x3c7242(0x236)+_0x3c7242(0x251)+_0x3c7242(0x23e)+'red');try{const _0xe9625=new URL(_0x20c19c);if(!['http:',_0x3c7242(0x21f)][_0x3c7242(0x383)](_0xe9625['protocol']))throw new Error(_0x3c7242(0x20c)+'protocol');}catch{throw new Error(_0x3c7242(0x2ff)+_0x3c7242(0x3b2)+_0x3c7242(0x267)+_0x3c7242(0x3a0));}if(typeof openClawConfigHandlers['setMcpSe'+_0x3c7242(0x281)]==='function')return openClawConfigHandlers[_0x3c7242(0x2ec)+_0x3c7242(0x281)]({'serverName':DINGTALK_DOC_MCP_SERVER_NAME,'server':createDingtalkDocMcpServerConfig(_0x20c19c),'reason':_0x3c7242(0x379)+_0x3c7242(0x376)+_0x3c7242(0x2b1)});const _0x321f96=await _0xc78487(),_0x1609b4=readOpenClawMcpServersFromConfig(_0x321f96);return _0x1609b4[DINGTALK_DOC_MCP_SERVER_NAME]=createDingtalkDocMcpServerConfig(_0x20c19c),writeOpenClawMcpServersToConfig(_0x321f96,_0x1609b4),await _0x3d662c(_0x321f96,'dingtalk'+'\x20doc\x20mcp'+_0x3c7242(0x2b1)),{'ok':!![]};}async function _0xcf5175(){const _0xa47190=_0x5bae69,_0x11d6f2=await _0xc78487(),_0xf8fc83=asRecord(_0x11d6f2[_0xa47190(0x365)]),_0x51ce5b=asRecord(_0xf8fc83['entries']),_0x4d7289=asRecord(_0x11d6f2[_0xa47190(0x344)]),_0x1dd3ae=asRecord(_0x4d7289[_0xa47190(0x2a2)]),_0x8e7c83={},_0x30c5db=_0x132671=>{const _0x5da43d=_0xa47190,_0x37181c=asRecord(_0x51ce5b[_0x132671]);return{'entry':_0x37181c,'config':asRecord(_0x37181c[_0x5da43d(0x216)])};},_0x12e5aa=(_0x5cde27,_0x423362,_0xf37919)=>{const _0x58db59=_0xa47190,{entry:_0x470151,config:_0x50fff1}=_0x30c5db(_0x423362),_0x43f05a=getTrimmedString(_0x50fff1['account']);if(!_0x43f05a)return;_0x8e7c83[_0x5cde27]={'provider':_0x5cde27,'sourceType':'plugin','adapter':_0x423362,'enabled':_0x470151[_0x58db59(0x3a6)]!==![]&&_0x50fff1[_0x58db59(0x3a6)]!==![],'account':_0x43f05a,'credentialRef':_0x423362+(_0x58db59(0x1f0)+_0x58db59(0x309)+'de'),'name':_0xf37919};};_0x12e5aa(_0xa47190(0x3d6),QQ_MAIL_CONNECTOR_PLUGIN_ID,_0xa47190(0x2f9)),_0x12e5aa(_0xa47190(0x36b)+_0xa47190(0x2b0),NETEASE_MAIL_CONNECTOR_PLUGIN_ID,_0xa47190(0x29b)),_0x12e5aa(_0xa47190(0x3a9)+_0xa47190(0x246),TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,_0xa47190(0x231));const _0xe4276c=_0x30c5db(FEISHU_DOC_CONNECTOR_PLUGIN_ID),_0x492b01=getTrimmedString(_0xe4276c[_0xa47190(0x216)]['accountN'+_0xa47190(0x373)]);_0x492b01&&(_0x8e7c83['feishu']={'provider':_0xa47190(0x2d7),'sourceType':_0xa47190(0x2bf),'adapter':_0xa47190(0x20f)+_0xa47190(0x26a),'enabled':_0xe4276c[_0xa47190(0x2f7)][_0xa47190(0x3a6)]!==![]&&_0xe4276c[_0xa47190(0x216)][_0xa47190(0x3a6)]!==![],'authMode':_0xa47190(0x1fc),'accountName':_0x492b01,'account':_0x492b01,'credentialRef':FEISHU_DOC_CONNECTOR_PLUGIN_ID+_0xa47190(0x2da),'capabilities':[_0xa47190(0x30a),_0xa47190(0x3af),_0xa47190(0x2d3),_0xa47190(0x1f2),'update',_0xa47190(0x2c9),_0xa47190(0x3c0)]});const _0x59a760=asRecord(_0x1dd3ae[TENCENT_DOCS_SKILL_ID]),_0x2155aa=asRecord(_0x59a760[_0xa47190(0x2b2)]),_0x4a78f2=getTrimmedString(_0x2155aa[TENCENT_DOCS_TOKEN_ENV]);_0x4a78f2&&(_0x8e7c83['tencent_'+_0xa47190(0x375)]={'provider':_0xa47190(0x3a9)+_0xa47190(0x375),'sourceType':_0xa47190(0x31a),'adapter':TENCENT_DOCS_SKILL_ID,'enabled':_0x59a760[_0xa47190(0x3a6)]!==![],'account':'腾讯文档','credentialRef':TENCENT_DOCS_SKILL_ID+':'+TENCENT_DOCS_TOKEN_ENV,'capabilities':[_0xa47190(0x2d3),_0xa47190(0x1f2),_0xa47190(0x2f0),_0xa47190(0x2c9),'import',_0xa47190(0x3c0),_0xa47190(0x1e1)]});const _0x12ced4=asRecord(_0x1dd3ae[KDOCS_SKILL_ID]);Object[_0xa47190(0x361)](_0x12ced4)[_0xa47190(0x3a7)]>0x0&&await _0x255a0e()&&(_0x8e7c83[_0xa47190(0x205)]={'provider':'kdocs','sourceType':_0xa47190(0x31a),'adapter':KDOCS_SKILL_ID,'enabled':_0x12ced4[_0xa47190(0x3a6)]!==![],'account':_0xa47190(0x338),'credentialRef':_0xa47190(0x37c)+_0xa47190(0x221)+'in','capabilities':[_0xa47190(0x2d3),_0xa47190(0x1f2),'update',_0xa47190(0x3af),_0xa47190(0x2cd),'import',_0xa47190(0x3c0)]});const _0x477319=readOpenClawMcpServersFromConfig(_0x11d6f2),_0x41b5db=findDingtalkDocMcpServer(_0x477319),_0x2de395=getTrimmedString(_0x41b5db['url']);return _0x2de395&&(_0x8e7c83['dingtalk'+_0xa47190(0x2f8)]={'provider':'dingtalk'+_0xa47190(0x2f8),'sourceType':_0xa47190(0x25d),'adapter':DINGTALK_DOC_MCP_SERVER_NAME,'enabled':_0x41b5db[_0xa47190(0x3a6)]!==![],'url':_0x2de395,'transport':getTrimmedString(_0x41b5db[_0xa47190(0x3aa)+'t'])||_0xa47190(0x39e)+_0xa47190(0x38f)}),_0x8e7c83;}async function _0x3fe734(){const _0x25aa40=_0x5bae69,_0x43d3cc=await _0x33633a[_0x25aa40(0x3bc)+_0x25aa40(0x3b0)+'otRaw']();return{..._0x43d3cc,'connectors':{...asRecord(_0x43d3cc['connecto'+'rs']),...await _0xcf5175()}};}function _0x46591d(_0x1f78f3){const _0x17077b=_0x5bae69;if(!_0x1f78f3[_0x17077b(0x200)+_0x17077b(0x21e)])return;clearTimeout(_0x1f78f3[_0x17077b(0x200)+_0x17077b(0x21e)]),_0x1f78f3['verifyTi'+_0x17077b(0x21e)]=null;}function _0x3ae337(_0x224139,_0x2de9d9=KDOCS_CLI_AUTH_POLL_INTERVAL_MS){const _0x5e0ea1=_0x5bae69;if(_0x224139['status']!==_0x5e0ea1(0x3cf))return;_0x46591d(_0x224139),_0x224139['verifyTi'+_0x5e0ea1(0x21e)]=setTimeout(()=>void _0x3fe5c3(_0x224139),_0x2de9d9);}async function _0x3fe5c3(_0x1244ef){const _0x4ea444=_0x5bae69;if(_0x1244ef[_0x4ea444(0x1ee)]!==_0x4ea444(0x3cf))return;_0x1244ef[_0x4ea444(0x2e0)]=_0x4ea444(0x28c),_0x1244ef[_0x4ea444(0x33c)]=_0x4ea444(0x2a8)+_0x4ea444(0x389);try{const _0x90f9a8=await _0x116e9f([_0x4ea444(0x2ab),_0x4ea444(0x1ee)]);_0x1244ef[_0x4ea444(0x3d2)]=_0x90f9a8[_0x4ea444(0x3d2)];if(_0x90f9a8[_0x4ea444(0x390)]===0x0&&isKdocsAuthStatusReady(_0x90f9a8[_0x4ea444(0x3d2)])){_0x46591d(_0x1244ef),await _0x289277(),_0x1244ef[_0x4ea444(0x2e0)]=_0x4ea444(0x201)+'d',_0x1244ef[_0x4ea444(0x1ee)]=_0x4ea444(0x201)+'d',_0x1244ef[_0x4ea444(0x33c)]=_0x4ea444(0x3b7);return;}if(Date['now']()-_0x1244ef[_0x4ea444(0x39f)+'t']>KDOCS_CLI_STEP_TIMEOUT_MS){_0x1244ef[_0x4ea444(0x1ee)]=_0x4ea444(0x3ad),_0x1244ef[_0x4ea444(0x262)+_0x4ea444(0x3c2)]='金山文档授权状态'+_0x4ea444(0x2b7);return;}_0x3ae337(_0x1244ef);}catch(_0x19a0a8){if(Date[_0x4ea444(0x26c)]()-_0x1244ef[_0x4ea444(0x39f)+'t']>KDOCS_CLI_STEP_TIMEOUT_MS){_0x1244ef['status']=_0x4ea444(0x3ad),_0x1244ef[_0x4ea444(0x262)+'sage']=_0x19a0a8 instanceof Error?_0x19a0a8[_0x4ea444(0x33c)]:'金山文档授权状态'+_0x4ea444(0x2b9);return;}_0x3ae337(_0x1244ef);}}async function _0x125207(){const _0x5b3512=_0x5bae69,_0x547f86=randomUUID(),_0x1d559d={'sessionId':_0x547f86,'status':_0x5b3512(0x3cf),'phase':_0x5b3512(0x253),'url':null,'message':'正在启动金山文档'+'登录','errorMessage':null,'output':'','process':null,'verifyTimer':null,'startedAt':Date[_0x5b3512(0x26c)]()};return _0x5cd7c6[_0x5b3512(0x289)](_0x547f86,_0x1d559d),void _0x1ed832({'FORCE_COLOR':'0','HOME':homedir()})['then'](async({env:_0x11dcc2,runtime:_0xff6e4b})=>{const _0x3b89ff=_0x5b3512,_0x3f3330=await _0x3b0bc6(_0xff6e4b);_0x533e40('connecto'+_0x3b89ff(0x2ad),{'connector':_0x3b89ff(0x205),'phase':_0x3b89ff(0x364),'message':'kdocs-cl'+'i\x20auth\x20l'+_0x3b89ff(0x38d)});const _0x1dc980=spawn(_0x3f3330[_0x3b89ff(0x276)+_0x3b89ff(0x2e3)],['auth',_0x3b89ff(0x36f)],{'cwd':homedir(),'env':_0x11dcc2});_0x1d559d[_0x3b89ff(0x327)]=_0x1dc980;const _0x472948=setTimeout(()=>{const _0x535496=_0x3b89ff;if(_0x1d559d['status']!==_0x535496(0x3cf))return;_0x1dc980[_0x535496(0x3d3)](),_0x1d559d[_0x535496(0x1ee)]='error',_0x1d559d[_0x535496(0x262)+_0x535496(0x3c2)]=_0x535496(0x20b)+'超时',_0x1d559d['process']=null;},KDOCS_CLI_STEP_TIMEOUT_MS),_0x414eaa=_0x27f265=>{const _0x33806e=_0x3b89ff,_0x98ebc9=_0x27f265[_0x33806e(0x25b)](_0x33806e(0x335));_0x1d559d['output']+=_0x98ebc9,_0x533e40('connecto'+_0x33806e(0x2ad),{'connector':_0x33806e(0x205),'phase':'output','message':_0x98ebc9});const _0x2dcb51=extractFirstUrl(_0x1d559d[_0x33806e(0x3d2)]);_0x2dcb51&&!_0x1d559d[_0x33806e(0x38a)]&&(_0x1d559d[_0x33806e(0x38a)]=_0x2dcb51,_0x1d559d[_0x33806e(0x2e0)]=_0x33806e(0x2ab),_0x1d559d[_0x33806e(0x33c)]=_0x33806e(0x20a)+'山文档授权',_0x3ae337(_0x1d559d,0x1f4),void _0x52496f[_0x33806e(0x305)+_0x33806e(0x399)](_0x2dcb51)[_0x33806e(0x2fc)](()=>{}));};_0x1dc980[_0x3b89ff(0x268)]['on'](_0x3b89ff(0x1d9),_0x414eaa),_0x1dc980[_0x3b89ff(0x214)]['on'](_0x3b89ff(0x1d9),_0x414eaa),_0x1dc980['stdin'][_0x3b89ff(0x33d)](),_0x1dc980[_0x3b89ff(0x316)](_0x3b89ff(0x3ad),_0x4a1033=>{const _0x5a93fb=_0x3b89ff;clearTimeout(_0x472948),_0x1d559d[_0x5a93fb(0x1ee)]=_0x5a93fb(0x3ad),_0x1d559d[_0x5a93fb(0x262)+_0x5a93fb(0x3c2)]=_0x4a1033 instanceof Error?_0x4a1033[_0x5a93fb(0x33c)]:'金山文档登录启动'+_0x5a93fb(0x24c)+_0x5a93fb(0x385)+'\x20已安装',_0x1d559d[_0x5a93fb(0x327)]=null,_0x533e40(_0x5a93fb(0x330)+'r-log',{'connector':_0x5a93fb(0x205),'phase':_0x5a93fb(0x3ad),'message':_0x1d559d[_0x5a93fb(0x262)+'sage']});}),_0x1dc980[_0x3b89ff(0x316)]('close',_0x303f28=>{const _0x56762e=_0x3b89ff;clearTimeout(_0x472948),_0x1d559d[_0x56762e(0x327)]=null;if(_0x1d559d[_0x56762e(0x1ee)]!==_0x56762e(0x3cf))return;const _0x3143f4=extractFirstUrl(_0x1d559d[_0x56762e(0x3d2)]);if(_0x3143f4&&!_0x1d559d['url']){_0x1d559d[_0x56762e(0x38a)]=_0x3143f4,_0x1d559d[_0x56762e(0x2e0)]=_0x56762e(0x2ab),_0x1d559d[_0x56762e(0x33c)]=_0x56762e(0x20a)+_0x56762e(0x315),_0x3ae337(_0x1d559d,0x1f4);return;}if(_0x303f28!==0x0){_0x1d559d[_0x56762e(0x1ee)]=_0x56762e(0x3ad),_0x1d559d['errorMes'+_0x56762e(0x3c2)]=_0x1d559d[_0x56762e(0x3d2)][_0x56762e(0x324)]()||_0x56762e(0x20b)+_0x56762e(0x24c)+_0x56762e(0x385)+_0x56762e(0x1f5),_0x533e40(_0x56762e(0x330)+_0x56762e(0x2ad),{'connector':_0x56762e(0x205),'phase':_0x56762e(0x3ad),'message':_0x1d559d[_0x56762e(0x262)+'sage']});return;}_0x1d559d[_0x56762e(0x2e0)]='verify',_0x1d559d[_0x56762e(0x33c)]='正在验证金山文档'+_0x56762e(0x389),_0x3ae337(_0x1d559d,0x1f4);});})['catch'](_0x116147=>{const _0x55b06c=_0x5b3512;_0x1d559d[_0x55b06c(0x1ee)]=_0x55b06c(0x3ad),_0x1d559d[_0x55b06c(0x262)+_0x55b06c(0x3c2)]=_0x116147 instanceof Error?_0x116147['message']:_0x55b06c(0x20b)+'失败,请确认\x20k'+_0x55b06c(0x385)+'\x20已安装',_0x533e40(_0x55b06c(0x330)+_0x55b06c(0x2ad),{'connector':_0x55b06c(0x205),'phase':'error','message':_0x1d559d[_0x55b06c(0x262)+_0x55b06c(0x3c2)]});}),createKdocsCliStatus(_0x1d559d);}function _0x35e65d(_0x2bc7c7={}){const _0x453dd9=_0x5bae69,_0x459790=safeString(_0x2bc7c7[_0x453dd9(0x30f)+'d']);if(!_0x459790)throw new Error(_0x453dd9(0x35a)+'I\x20sessio'+_0x453dd9(0x2e5)+_0x453dd9(0x3bb));const _0x3f486c=_0x5cd7c6[_0x453dd9(0x1dc)](_0x459790);if(!_0x3f486c)throw new Error(_0x453dd9(0x35a)+_0x453dd9(0x1d0)+'n\x20not\x20fo'+_0x453dd9(0x347));return createKdocsCliStatus(_0x3f486c);}function _0x52785b(_0x3e0ac7={}){const _0x1f7930=_0x5bae69,_0x3bce99=safeString(_0x3e0ac7['sessionI'+'d']);if(!_0x3bce99)return{'ok':!![]};const _0xfc104c=_0x5cd7c6[_0x1f7930(0x1dc)](_0x3bce99);if(!_0xfc104c)return{'ok':!![]};return _0x46591d(_0xfc104c),_0xfc104c['process']?.['kill'](),_0x5cd7c6[_0x1f7930(0x2c9)](_0x3bce99),{'ok':!![]};}function _0xfc8536(_0x471379){const _0x2ecb95=_0x5bae69;if(!_0x471379[_0x2ecb95(0x371)])return;clearTimeout(_0x471379[_0x2ecb95(0x371)]),_0x471379[_0x2ecb95(0x371)]=null;}function _0x28a338(_0x59a84f){const _0xbbdbbd=_0x5bae69,_0x285918=_0x1452bf[_0xbbdbbd(0x1dc)](_0x59a84f);if(!_0x285918||_0x285918['status']!==_0xbbdbbd(0x3cf))return;_0xfc8536(_0x285918),_0x285918[_0xbbdbbd(0x371)]=setTimeout(()=>void _0x34d071(_0x59a84f),_0x285918[_0xbbdbbd(0x27b)+_0xbbdbbd(0x38c)]);}async function _0x34d071(_0x280612){const _0x571f6f=_0x5bae69,_0x280193=_0x1452bf['get'](_0x280612);if(!_0x280193||_0x280193['status']!==_0x571f6f(0x3cf))return;if(Date[_0x571f6f(0x26c)]()>=_0x280193[_0x571f6f(0x2e2)+'t']){_0x280193[_0x571f6f(0x1ee)]=_0x571f6f(0x1f7),_0x280193['errorMes'+'sage']=_0x571f6f(0x377)+_0x571f6f(0x32b),_0xfc8536(_0x280193);return;}try{const _0x5ae3a1=await pollFeishuRegistration(_0x280193[_0x571f6f(0x345)],_0x280193['deviceCo'+'de']),_0x104b81=getTrimmedString(_0x5ae3a1[_0x571f6f(0x321)+'d']),_0x442578=getTrimmedString(_0x5ae3a1[_0x571f6f(0x2e1)+_0x571f6f(0x269)]),_0x2b0391=getTrimmedString(_0x5ae3a1[_0x571f6f(0x3ad)]),_0x1d7e93=extractFeishuRegistrationAuthorizationUri(_0x5ae3a1)||_0x280193[_0x571f6f(0x226)+_0x571f6f(0x212)];if(_0x1d7e93!==_0x280193[_0x571f6f(0x226)+_0x571f6f(0x212)])_0x280193[_0x571f6f(0x226)+_0x571f6f(0x212)]=_0x1d7e93;if(_0x104b81&&_0x442578){const _0x1154c9=asRecord(_0x5ae3a1[_0x571f6f(0x3d5)+'o']);await _0x47afaa({'appId':_0x104b81,'appSecret':_0x442578,'userInfo':{'openId':getTrimmedString(_0x1154c9[_0x571f6f(0x314)])||null}}),_0x280193[_0x571f6f(0x1ee)]=_0x571f6f(0x201)+'d',_0x280193[_0x571f6f(0x262)+_0x571f6f(0x3c2)]=null,_0xfc8536(_0x280193);return;}if(!_0x2b0391||_0x2b0391===_0x571f6f(0x226)+'ation_pe'+_0x571f6f(0x3c6)){_0x28a338(_0x280612);return;}if(_0x2b0391===_0x571f6f(0x3b8)+'n'){_0x280193[_0x571f6f(0x27b)+'rvalMs']+=0x1388,_0x28a338(_0x280612);return;}if(_0x2b0391===_0x571f6f(0x1de)+_0x571f6f(0x2fa)){_0x280193[_0x571f6f(0x1ee)]='expired',_0x280193[_0x571f6f(0x262)+_0x571f6f(0x3c2)]=_0x571f6f(0x377)+'重新生成',_0xfc8536(_0x280193);return;}_0x280193[_0x571f6f(0x1ee)]=_0x571f6f(0x3ad),_0x280193['errorMes'+_0x571f6f(0x3c2)]=getTrimmedString(_0x5ae3a1[_0x571f6f(0x28a)+_0x571f6f(0x1e9)+'n'])||(_0x2b0391===_0x571f6f(0x3b1)+_0x571f6f(0x27f)?_0x571f6f(0x38b)+_0x571f6f(0x2b4):_0x571f6f(0x21c)+_0x2b0391),_0xfc8536(_0x280193);}catch(_0x3dda09){_0x280193['status']=_0x571f6f(0x3ad),_0x280193['errorMes'+_0x571f6f(0x3c2)]=_0x3dda09 instanceof Error?_0x3dda09[_0x571f6f(0x33c)]:'飞书绑定失败',_0xfc8536(_0x280193);}}async function _0xd7f2f2(_0x86e7a2={}){const _0x2b1151=_0x5bae69,_0x1ce6d1=_0x86e7a2[_0x2b1151(0x30e)]===_0x2b1151(0x393)+_0x2b1151(0x26b)?'doc_conn'+_0x2b1151(0x26b):_0x2b1151(0x36a),_0x15c70f=createFeishuRegistrationClient(),_0x33a826=await initFeishuRegistration(_0x15c70f),_0xc2f6e7=Array[_0x2b1151(0x2d9)](_0x33a826[_0x2b1151(0x25f)+_0x2b1151(0x20d)+_0x2b1151(0x1f1)])?_0x33a826[_0x2b1151(0x25f)+_0x2b1151(0x20d)+'ethods'][_0x2b1151(0x331)](getTrimmedString)[_0x2b1151(0x239)](Boolean):[];if(!_0xc2f6e7['includes'](_0x2b1151(0x2e1)+'ecret'))throw new Error(_0x2b1151(0x37a)+_0x2b1151(0x27c)+'ent\x20does'+_0x2b1151(0x224)+'port\x20cli'+_0x2b1151(0x1d2)+_0x2b1151(0x257));const _0xefc567=await beginFeishuRegistration(_0x15c70f),_0x3e5f47=getTrimmedString(_0xefc567[_0x2b1151(0x3d0)+_0x2b1151(0x22e)+'_complet'+'e']),_0x4a78cf=extractFeishuRegistrationAuthorizationUri(_0xefc567),_0x3b8e3f=getTrimmedString(_0xefc567[_0x2b1151(0x284)+'ode']),_0x457063=Number(_0xefc567[_0x2b1151(0x33f)+'n'])||0x258,_0x3acc7b=Number(_0xefc567['interval'])||0x5;if(!_0x3e5f47||!_0x3b8e3f)throw new Error(_0x2b1151(0x26e)+'verifica'+_0x2b1151(0x22e)+_0x2b1151(0x346)+_0x2b1151(0x2c6)+_0x2b1151(0x2f1)+'\x20in\x20begi'+_0x2b1151(0x367)+_0x2b1151(0x366));const _0x4c70a4=randomUUID(),_0xa2b76e={'sessionId':_0x4c70a4,'purpose':_0x1ce6d1,'client':_0x15c70f,'deviceCode':_0x3b8e3f,'verificationUriComplete':_0x3e5f47,'authorizationUri':_0x4a78cf,'expiresAt':Date['now']()+_0x457063*0x3e8,'pollIntervalMs':Math[_0x2b1151(0x358)](_0x3acc7b*0x3e8,DEFAULT_FEISHU_REGISTRATION_INTERVAL_MS),'status':'pending','errorMessage':null,'timer':null};return _0x1452bf[_0x2b1151(0x289)](_0x4c70a4,_0xa2b76e),_0x28a338(_0x4c70a4),serializeFeishuRegistrationSession(_0xa2b76e);}function _0x5241a0(_0x3b9d38={}){const _0x3b82c6=_0x5bae69,_0x26bd85=safeString(_0x3b9d38[_0x3b82c6(0x30f)+'d']);if(!_0x26bd85)throw new Error(_0x3b82c6(0x209)+_0x3b82c6(0x3c8)+_0x3b82c6(0x2d0)+_0x3b82c6(0x320)+_0x3b82c6(0x23f)+'ed');const _0x1ff3bc=_0x1452bf[_0x3b82c6(0x1dc)](_0x26bd85);if(!_0x1ff3bc)throw new Error(_0x3b82c6(0x209)+_0x3b82c6(0x3c8)+_0x3b82c6(0x2d0)+_0x3b82c6(0x1eb)+'found');return serializeFeishuRegistrationSession(_0x1ff3bc);}function _0x16708a(_0x350a91={}){const _0x3057cb=_0x5bae69,_0x2d5778=safeString(_0x350a91['sessionI'+'d']);if(!_0x2d5778)return{'ok':!![]};const _0x48ba26=_0x1452bf[_0x3057cb(0x1dc)](_0x2d5778);if(!_0x48ba26)return{'ok':!![]};return _0xfc8536(_0x48ba26),_0x1452bf[_0x3057cb(0x2c9)](_0x2d5778),{'ok':!![]};}async function _0xcec9e(_0x1f89c0,_0x340adc){const _0x271b95=_0x5bae69,_0x736edf=_0x3269cc(),{env:_0x2e53a6,runtime:_0x20d337}=await _0x1ed832({'FORCE_COLOR':'0','HOME':homedir(),'LARK_CLI_NO_PROXY':'1','OPENCLAW_HOME':_0x736edf,'OPENCLAW_CONFIG_PATH':_0x1f89c0[_0x271b95(0x245)+'onfigPat'+'h']});await mkdir(_0x736edf,{'recursive':!![]});const _0x348a6d=await _0x1fadf2(_0x20d337);for(const _0x5c091d of[_0x271b95(0x292)+'XY',_0x271b95(0x2cf)+'OXY',_0x271b95(0x325)+'Y',_0x271b95(0x340)+'xy',_0x271b95(0x277)+_0x271b95(0x317),'all_prox'+'y']){delete _0x2e53a6[_0x5c091d];}return new Promise((_0x20e5d1,_0x566f54)=>{const _0xfa9a45=_0x271b95;_0x533e40(_0xfa9a45(0x330)+_0xfa9a45(0x2ad),{'connector':'feishu_d'+'oc','phase':_0xfa9a45(0x364),'message':_0xfa9a45(0x2bf)+'\x20'+_0x340adc[_0xfa9a45(0x1d8)]('\x20')});const _0x449e04=spawn(_0x348a6d['nodeExec'+_0xfa9a45(0x1ff)],[_0x348a6d[_0xfa9a45(0x25c)+'th'],..._0x340adc],{'cwd':_0x736edf,'env':_0x2e53a6});let _0x3a3b4c=![];_0x449e04[_0xfa9a45(0x316)](_0xfa9a45(0x364),()=>{_0x3a3b4c=!![],_0x20e5d1(_0x449e04);}),_0x449e04['once'](_0xfa9a45(0x3ad),_0x2e1952=>{if(_0x3a3b4c)return;_0x566f54(_0x2e1952);});});}function _0x48fdca(_0x23ca2b,_0x3bae53,_0x4be980){const _0x6949ad=_0x5bae69;_0x23ca2b[_0x6949ad(0x2e0)]=_0x4be980['phase'],_0x23ca2b['message']=_0x4be980[_0x6949ad(0x33c)];if(_0x4be980[_0x6949ad(0x2e0)]!==_0x6949ad(0x28c))_0x23ca2b[_0x6949ad(0x38a)]=null;_0x23ca2b['output']='',void _0xcec9e(_0x23ca2b,_0x3bae53)[_0x6949ad(0x237)](_0x1d4397=>{const _0x563217=_0x6949ad;_0x23ca2b[_0x563217(0x327)]=_0x1d4397;const _0x33e661=setTimeout(()=>{const _0x11bed8=_0x563217;if(_0x23ca2b[_0x11bed8(0x1ee)]!==_0x11bed8(0x3cf))return;_0x1d4397[_0x11bed8(0x3d3)](),_0x23ca2b[_0x11bed8(0x1ee)]='error',_0x23ca2b['errorMes'+_0x11bed8(0x3c2)]=_0x4be980[_0x11bed8(0x33c)]+'超时',_0x23ca2b[_0x11bed8(0x327)]=null;},FEISHU_DOC_CLI_STEP_TIMEOUT_MS),_0x4b4932=_0xafe93e=>{const _0x1d0b0e=_0x563217,_0x11d2d9=_0xafe93e['toString'](_0x1d0b0e(0x335));_0x23ca2b['output']+=_0x11d2d9,_0x533e40(_0x1d0b0e(0x330)+_0x1d0b0e(0x2ad),{'connector':_0x1d0b0e(0x306)+'oc','phase':_0x4be980[_0x1d0b0e(0x2e0)],'message':_0x11d2d9});};_0x1d4397[_0x563217(0x268)]['on'](_0x563217(0x1d9),_0x4b4932),_0x1d4397[_0x563217(0x214)]['on']('data',_0x4b4932);if(typeof _0x4be980[_0x563217(0x26f)]==='string')_0x1d4397[_0x563217(0x26f)][_0x563217(0x33d)](_0x4be980[_0x563217(0x26f)]);else _0x1d4397[_0x563217(0x26f)]['end']();_0x1d4397['on']('error',_0xdd192=>{const _0x2aaf19=_0x563217;clearTimeout(_0x33e661),_0x23ca2b[_0x2aaf19(0x1ee)]=_0x2aaf19(0x3ad),_0x23ca2b[_0x2aaf19(0x262)+_0x2aaf19(0x3c2)]=_0xdd192 instanceof Error?_0xdd192['message']:_0x2aaf19(0x3ac)+_0x2aaf19(0x2ae),_0x23ca2b[_0x2aaf19(0x327)]=null,_0x533e40('connecto'+'r-log',{'connector':_0x2aaf19(0x306)+'oc','phase':_0x2aaf19(0x3ad),'message':_0x23ca2b[_0x2aaf19(0x262)+'sage']});}),_0x1d4397['on'](_0x563217(0x1e6),_0x391c27=>{const _0x1b7c4e=_0x563217;clearTimeout(_0x33e661),_0x23ca2b['process']=null;if(_0x23ca2b['status']!==_0x1b7c4e(0x3cf))return;if(_0x391c27!==0x0){if(_0x4be980[_0x1b7c4e(0x3b9)+'e']){void Promise[_0x1b7c4e(0x2d5)](_0x4be980[_0x1b7c4e(0x3b9)+'e'](_0x391c27,_0x23ca2b[_0x1b7c4e(0x3d2)]))[_0x1b7c4e(0x2fc)](_0x107798=>{const _0x166835=_0x1b7c4e;_0x23ca2b[_0x166835(0x1ee)]=_0x166835(0x3ad),_0x23ca2b[_0x166835(0x262)+_0x166835(0x3c2)]=_0x107798 instanceof Error?_0x107798[_0x166835(0x33c)]:_0x166835(0x2bb)+_0x166835(0x282);});return;}_0x23ca2b[_0x1b7c4e(0x1ee)]=_0x1b7c4e(0x3ad),_0x23ca2b[_0x1b7c4e(0x262)+'sage']=getFeishuDocCliFailureMessage(_0x4be980[_0x1b7c4e(0x2e0)],extractFeishuDocCliError(_0x23ca2b['output'],_0x1b7c4e(0x2bf)+'\x20'+_0x3bae53[_0x1b7c4e(0x1d8)]('\x20')+(_0x1b7c4e(0x211)+_0x1b7c4e(0x319)+'e\x20')+_0x391c27),_0x1b7c4e(0x2bf)+'\x20'+_0x3bae53['join']('\x20')+(_0x1b7c4e(0x211)+_0x1b7c4e(0x319)+'e\x20')+_0x391c27),_0x533e40(_0x1b7c4e(0x330)+_0x1b7c4e(0x2ad),{'connector':_0x1b7c4e(0x306)+'oc','phase':_0x1b7c4e(0x3ad),'message':_0x23ca2b[_0x1b7c4e(0x262)+_0x1b7c4e(0x3c2)]});return;}void Promise[_0x1b7c4e(0x2d5)](_0x4be980[_0x1b7c4e(0x23d)+'s']())[_0x1b7c4e(0x2fc)](_0x242ccf=>{const _0x347b37=_0x1b7c4e;_0x23ca2b['status']=_0x347b37(0x3ad),_0x23ca2b[_0x347b37(0x262)+_0x347b37(0x3c2)]=_0x242ccf instanceof Error?_0x242ccf[_0x347b37(0x33c)]:_0x347b37(0x2bb)+_0x347b37(0x282);});});})[_0x6949ad(0x2fc)](_0x181e0b=>{const _0x256b8c=_0x6949ad;_0x23ca2b[_0x256b8c(0x1ee)]=_0x256b8c(0x3ad),_0x23ca2b[_0x256b8c(0x262)+'sage']=_0x181e0b instanceof Error?_0x181e0b[_0x256b8c(0x33c)]:'飞书\x20CLI\x20执'+_0x256b8c(0x2ae),_0x23ca2b[_0x256b8c(0x327)]=null,_0x533e40(_0x256b8c(0x330)+_0x256b8c(0x2ad),{'connector':_0x256b8c(0x306)+'oc','phase':_0x256b8c(0x3ad),'message':_0x23ca2b[_0x256b8c(0x262)+_0x256b8c(0x3c2)]});});}function _0x1fbc76(_0x2bd6f7){const _0x3f0080=_0x5bae69;if(!_0x2bd6f7[_0x3f0080(0x26d)])return;clearTimeout(_0x2bd6f7[_0x3f0080(0x26d)]),_0x2bd6f7[_0x3f0080(0x26d)]=null;}function _0x3f3d0c(_0x2f4c6d){const _0x9b80a1=_0x5bae69;if(!_0x2f4c6d[_0x9b80a1(0x2d2)+_0x9b80a1(0x388)])return;clearTimeout(_0x2f4c6d[_0x9b80a1(0x2d2)+_0x9b80a1(0x388)]),_0x2f4c6d[_0x9b80a1(0x2d2)+'usTimer']=null;}function _0xd5a899(_0xa40f31,_0x5578bf=0x7d0){const _0x30468e=_0x5bae69;if(_0xa40f31[_0x30468e(0x1ee)]!=='pending')return;_0x3f3d0c(_0xa40f31),_0xa40f31[_0x30468e(0x2d2)+_0x30468e(0x388)]=setTimeout(()=>{const _0x558154=_0x30468e;_0x48fdca(_0xa40f31,[_0x558154(0x2ab),_0x558154(0x1ee)],{'phase':'verify','message':_0x558154(0x368)+'状态','onFailure':(_0x3a93bd,_0x2f5094)=>{const _0x3e0062=_0x558154;if(Date[_0x3e0062(0x26c)]()-_0xa40f31[_0x3e0062(0x2d2)+_0x3e0062(0x219)+_0x3e0062(0x2b8)]>FEISHU_DOC_CLI_STEP_TIMEOUT_MS){_0xa40f31[_0x3e0062(0x1ee)]=_0x3e0062(0x3ad),_0xa40f31[_0x3e0062(0x262)+_0x3e0062(0x3c2)]=getFeishuDocCliFailureMessage(_0x3e0062(0x28c),extractFeishuDocCliError(_0x2f5094,_0x3e0062(0x21d)+_0x3e0062(0x3bd)),_0x3e0062(0x21d)+_0x3e0062(0x3bd));return;}_0xd5a899(_0xa40f31);},'onSuccess':()=>{const _0x5ed810=_0x558154;try{ensureFeishuDocCliUserStatus(_0xa40f31['output']);}catch(_0x48c823){if(Date['now']()-_0xa40f31[_0x5ed810(0x2d2)+_0x5ed810(0x219)+_0x5ed810(0x2b8)]>FEISHU_DOC_CLI_STEP_TIMEOUT_MS){_0xa40f31['status']=_0x5ed810(0x3ad),_0xa40f31[_0x5ed810(0x262)+_0x5ed810(0x3c2)]=_0x48c823 instanceof Error?_0x48c823[_0x5ed810(0x33c)]:_0x5ed810(0x21d)+_0x5ed810(0x384);return;}_0xd5a899(_0xa40f31);return;}return _0x3f3d0c(_0xa40f31),_0x2369f4(_0xa40f31);}});},_0x5578bf);}function _0x2390f3(_0x3d598f){const _0x3d3ed7=_0x5bae69;if(!_0x3d598f['cliAppId']||!_0x3d598f[_0x3d3ed7(0x380)+_0x3d3ed7(0x2db)]){_0x3d598f[_0x3d3ed7(0x1ee)]=_0x3d3ed7(0x3ad),_0x3d598f[_0x3d3ed7(0x262)+_0x3d3ed7(0x3c2)]=_0x3d3ed7(0x2eb)+'\x20专用应用凭据缺'+_0x3d3ed7(0x35b);return;}const _0x35595c=_0x3d598f['cliAppId'],_0x49b78e=_0x3d598f[_0x3d3ed7(0x380)+_0x3d3ed7(0x2db)];_0x48fdca(_0x3d598f,[_0x3d3ed7(0x39d)+'n'],{'phase':'bind','message':_0x3d3ed7(0x31f)+'LI','onSuccess':()=>{const _0x35871a=_0x3d3ed7;_0x48fdca(_0x3d598f,[_0x35871a(0x216),_0x35871a(0x1ec),_0x35871a(0x203)+'init',_0x35871a(0x391),_0x35595c,'--app-se'+_0x35871a(0x255)+'in',_0x35871a(0x2cc),_0x35871a(0x2d7)],{'phase':'bind','message':'正在初始化飞书\x20'+'CLI\x20用户身份'+'应用','stdin':_0x49b78e,'onSuccess':()=>{const _0x416531=_0x35871a;_0x48fdca(_0x3d598f,[_0x416531(0x2ab),'login',_0x416531(0x34a),_0x416531(0x256)+_0x416531(0x29a)+'own,wiki'+_0x416531(0x38e)+_0x416531(0x333)+_0x416531(0x260),_0x416531(0x3a1),_0x416531(0x294)+_0x416531(0x223),_0x416531(0x29f)+'t'],{'phase':_0x416531(0x2ab),'message':_0x416531(0x386)+_0x416531(0x1ef),'onSuccess':()=>{const _0x1f34eb=_0x416531,_0x5f29b8=parseFeishuDocCliJson(_0x3d598f[_0x1f34eb(0x3d2)]),_0x2e9051=getTrimmedString(_0x5f29b8[_0x1f34eb(0x3d0)+'tion_uri'+_0x1f34eb(0x346)+'e'])||getTrimmedString(_0x5f29b8[_0x1f34eb(0x3d0)+_0x1f34eb(0x336)])||getTrimmedString(_0x5f29b8[_0x1f34eb(0x3d0)+_0x1f34eb(0x22e)]),_0x3df5a7=getTrimmedString(_0x5f29b8['device_c'+_0x1f34eb(0x342)]);if(!_0x2e9051||!_0x3df5a7){_0x3d598f[_0x1f34eb(0x1ee)]=_0x1f34eb(0x3ad),_0x3d598f[_0x1f34eb(0x262)+'sage']='飞书\x20CLI\x20未'+_0x1f34eb(0x1e4)+'\x20或\x20devic'+'e_code:\x20'+summarizeCliOutput(_0x3d598f[_0x1f34eb(0x3d2)]);return;}_0x3d598f[_0x1f34eb(0x38a)]=_0x2e9051,_0x3d598f[_0x1f34eb(0x3cc)+'de']=_0x3df5a7,void _0x52496f['openExte'+_0x1f34eb(0x399)](_0x2e9051)[_0x1f34eb(0x2fc)](()=>{}),_0x48fdca(_0x3d598f,[_0x1f34eb(0x2ab),_0x1f34eb(0x36f),'--device'+'-code',_0x3df5a7],{'phase':_0x1f34eb(0x28c),'message':_0x1f34eb(0x258)+'完成','onSuccess':()=>{const _0x331e50=_0x1f34eb;_0x3d598f['authStat'+_0x331e50(0x219)+_0x331e50(0x2b8)]=Date[_0x331e50(0x26c)](),_0xd5a899(_0x3d598f,0x1f4);}});}});}});}});}function _0x1ebe5b(_0xae0d51){const _0x4f3f7d=_0x5bae69;if(_0xae0d51[_0x4f3f7d(0x1ee)]!==_0x4f3f7d(0x3cf))return;_0x1fbc76(_0xae0d51),_0xae0d51[_0x4f3f7d(0x26d)]=setTimeout(()=>void _0x36138e(_0xae0d51),_0xae0d51[_0x4f3f7d(0x24d)+_0x4f3f7d(0x273)+'s']);}async function _0x36138e(_0x22ddf0){const _0x1d0586=_0x5bae69;if(_0x22ddf0[_0x1d0586(0x1ee)]!==_0x1d0586(0x3cf)||_0x22ddf0[_0x1d0586(0x2e0)]!=='create'||!_0x22ddf0[_0x1d0586(0x1e7)+_0x1d0586(0x323)]||!_0x22ddf0[_0x1d0586(0x357)+'eCode'])return;if(Date['now']()>=_0x22ddf0['appExpir'+_0x1d0586(0x3c5)]){_0x22ddf0['status']=_0x1d0586(0x3ad),_0x22ddf0['errorMes'+_0x1d0586(0x3c2)]=_0x1d0586(0x37d)+',请重新连接',_0x1fbc76(_0x22ddf0);return;}try{const _0xbb699d=await pollFeishuRegistration(_0x22ddf0[_0x1d0586(0x1e7)+_0x1d0586(0x323)],_0x22ddf0[_0x1d0586(0x357)+_0x1d0586(0x298)]),_0x16c210=getTrimmedString(_0xbb699d[_0x1d0586(0x321)+'d']),_0x2ab96e=getTrimmedString(_0xbb699d[_0x1d0586(0x2e1)+'ecret']),_0x4c82b5=getTrimmedString(_0xbb699d[_0x1d0586(0x3ad)]);if(_0x16c210&&_0x2ab96e){const _0x460594=asRecord(_0xbb699d[_0x1d0586(0x3d5)+'o']);await _0x1629be({'appId':_0x16c210,'appSecret':_0x2ab96e,'userInfo':{'openId':getTrimmedString(_0x460594[_0x1d0586(0x314)])||null},'configPath':_0x22ddf0['cliHostC'+_0x1d0586(0x36c)+'h']}),_0x22ddf0['cliAppId']=_0x16c210,_0x22ddf0[_0x1d0586(0x380)+_0x1d0586(0x2db)]=_0x2ab96e,_0x1fbc76(_0x22ddf0),_0x22ddf0[_0x1d0586(0x33c)]=_0x1d0586(0x2b6)+_0x1d0586(0x1e2),_0x2390f3(_0x22ddf0);return;}if(!_0x4c82b5||_0x4c82b5===_0x1d0586(0x226)+'ation_pe'+_0x1d0586(0x3c6)){_0x1ebe5b(_0x22ddf0);return;}if(_0x4c82b5===_0x1d0586(0x3b8)+'n'){_0x22ddf0[_0x1d0586(0x24d)+_0x1d0586(0x273)+'s']+=0x1388,_0x1ebe5b(_0x22ddf0);return;}_0x22ddf0[_0x1d0586(0x1ee)]='error',_0x22ddf0[_0x1d0586(0x262)+_0x1d0586(0x3c2)]=getTrimmedString(_0xbb699d[_0x1d0586(0x28a)+_0x1d0586(0x1e9)+'n'])||_0x1d0586(0x2d6)+':'+_0x4c82b5,_0x1fbc76(_0x22ddf0);}catch(_0x5b35be){_0x22ddf0['status']='error',_0x22ddf0['errorMes'+_0x1d0586(0x3c2)]=_0x5b35be instanceof Error?_0x5b35be[_0x1d0586(0x33c)]:'飞书应用创建失败',_0x1fbc76(_0x22ddf0);}}async function _0x2369f4(_0x4287bd){const _0x1aa542=_0x5bae69;await _0x35e796({'accountName':_0x1aa542(0x1d5)}),_0x4287bd['status']='complete'+'d',_0x4287bd[_0x1aa542(0x2e0)]=_0x1aa542(0x201)+'d',_0x4287bd['message']='飞书用户身份授权'+'完成',_0x4287bd['errorMes'+_0x1aa542(0x3c2)]=null;}async function _0x355157(){const _0x542cba=_0x5bae69,_0x33f851=createFeishuRegistrationClient(),_0x4a6a35=await initFeishuRegistration(_0x33f851),_0x4ec0bf=Array[_0x542cba(0x2d9)](_0x4a6a35[_0x542cba(0x25f)+'d_auth_m'+_0x542cba(0x1f1)])?_0x4a6a35[_0x542cba(0x25f)+_0x542cba(0x20d)+_0x542cba(0x1f1)]['map'](getTrimmedString)['filter'](Boolean):[];if(!_0x4ec0bf[_0x542cba(0x383)](_0x542cba(0x2e1)+_0x542cba(0x269)))throw new Error(_0x542cba(0x27e)+'环境不支持创建\x20'+_0x542cba(0x2e1)+_0x542cba(0x1f3));const _0x56a7f4=await beginFeishuRegistration(_0x33f851),_0x438301=getTrimmedString(_0x56a7f4[_0x542cba(0x3d0)+_0x542cba(0x22e)+_0x542cba(0x346)+'e']),_0x4a0a60=getTrimmedString(_0x56a7f4['device_c'+_0x542cba(0x342)]),_0x377dca=Number(_0x56a7f4[_0x542cba(0x33f)+'n'])||0x258,_0x4436c0=Number(_0x56a7f4[_0x542cba(0x22f)])||0x5;if(!_0x438301||!_0x4a0a60)throw new Error(_0x542cba(0x240)+_0x542cba(0x287)+_0x542cba(0x2ed)+'code,请重试');const _0x378a37=randomUUID(),_0x31b319={'sessionId':_0x378a37,'status':'pending','phase':_0x542cba(0x2d3),'url':_0x438301,'appDeviceCode':_0x4a0a60,'appPollClient':_0x33f851,'appPollIntervalMs':Math[_0x542cba(0x358)](_0x4436c0*0x3e8,DEFAULT_FEISHU_REGISTRATION_INTERVAL_MS),'appExpiresAt':Date[_0x542cba(0x26c)]()+_0x377dca*0x3e8,'appTimer':null,'authStatusTimer':null,'authStatusStartedAt':0x0,'deviceCode':null,'message':'请在飞书开放平台'+_0x542cba(0x2f6),'errorMessage':null,'process':null,'output':'','cliHostConfigPath':_0x20e604(),'cliAppId':null,'cliAppSecret':null};return _0x3c72cd['set'](_0x378a37,_0x31b319),_0x1ebe5b(_0x31b319),createFeishuDocCliStatus(_0x31b319);}function _0x53614e(_0x4cd09a={}){const _0x127872=_0x5bae69,_0x547c6d=safeString(_0x4cd09a[_0x127872(0x30f)+'d']);if(!_0x547c6d)throw new Error(_0x127872(0x300)+'oc\x20CLI\x20s'+_0x127872(0x348)+_0x127872(0x2e9)+_0x127872(0x2be));const _0x210500=_0x3c72cd['get'](_0x547c6d);if(!_0x210500)throw new Error(_0x127872(0x300)+_0x127872(0x28d)+_0x127872(0x2e7)+'ot\x20found');return createFeishuDocCliStatus(_0x210500);}function _0x5656f1(_0x120171={}){const _0x453289=_0x5bae69,_0x419c84=safeString(_0x120171[_0x453289(0x30f)+'d']);if(!_0x419c84)return{'ok':!![]};const _0x5ee05e=_0x3c72cd['get'](_0x419c84);if(!_0x5ee05e)return{'ok':!![]};return _0x1fbc76(_0x5ee05e),_0x3f3d0c(_0x5ee05e),_0x5ee05e['process']?.[_0x453289(0x3d3)](),_0x3c72cd[_0x453289(0x2c9)](_0x419c84),{'ok':!![]};}function _0x23f258(_0x4c7bcf={}){const _0x6499e1=_0x5bae69,_0x1b38b4=safeString(_0x4c7bcf['sessionI'+'d']);if(!_0x1b38b4)throw new Error(_0x6499e1(0x300)+_0x6499e1(0x28d)+_0x6499e1(0x348)+_0x6499e1(0x2e9)+'uired');const _0x4542c4=_0x3c72cd[_0x6499e1(0x1dc)](_0x1b38b4);if(!_0x4542c4)throw new Error(_0x6499e1(0x300)+_0x6499e1(0x28d)+_0x6499e1(0x2e7)+'ot\x20found');if(_0x4542c4[_0x6499e1(0x1ee)]===_0x6499e1(0x3ad))throw new Error(_0x4542c4[_0x6499e1(0x262)+_0x6499e1(0x3c2)]||_0x6499e1(0x2bb)+_0x6499e1(0x282));return{'ok':!![]};}async function _0x33060b(_0x290a18){const _0x3b1c16=_0x5bae69,_0x2bb7c1=asRecord(_0x290a18['plugins']),_0x413bf1=asRecord(_0x2bb7c1['entries']),_0x2549f2=asStringArray(_0x2bb7c1['allow']),_0x5e461d=asRecord(_0x413bf1[WECHAT_PLUGIN_ID]),_0x10eb56=_0x5e461d[_0x3b1c16(0x3a6)]===!![]||_0x2549f2[_0x3b1c16(0x383)](WECHAT_PLUGIN_ID),_0x84491e=join(_0x33633a[_0x3b1c16(0x359)+_0x3b1c16(0x1fa)](),WECHAT_PLUGIN_ID),_0x1cc012=join(_0x84491e,_0x3b1c16(0x343)+_0x3b1c16(0x387));let _0x23dcff=![];try{const _0x20f38d=(await readFile(_0x1cc012,_0x3b1c16(0x335)))[_0x3b1c16(0x324)]();if(_0x20f38d){const _0x3dd3aa=JSON['parse'](_0x20f38d);_0x23dcff=Array[_0x3b1c16(0x2d9)](_0x3dd3aa)?_0x3dd3aa[_0x3b1c16(0x3a7)]>0x0:Object['keys'](asRecord(_0x3dd3aa))['length']>0x0;}}catch{}if(!_0x23dcff)try{_0x23dcff=(await readdir(join(_0x84491e,_0x3b1c16(0x343))))[_0x3b1c16(0x3a7)]>0x0;}catch{}return{'exists':_0x10eb56||_0x23dcff,'enabled':_0x10eb56,'connected':_0x10eb56&&_0x23dcff};}async function _0x59ccb6(){const _0x38a7af=_0x5bae69,_0x5b2c72=await _0xc78487(),_0x5ea475=asRecord(_0x5b2c72[_0x38a7af(0x32c)]),_0x1683d0=[],_0x349932=await _0x33060b(_0x5b2c72);_0x349932[_0x38a7af(0x2f5)]&&_0x1683d0['push']({'id':WECHAT_PLUGIN_ID,'type':_0x38a7af(0x275),'name':'微信','enabled':_0x349932[_0x38a7af(0x3a6)],'connected':_0x349932['connecte'+'d']});const _0x2c4a7b=asRecord(_0x5ea475[_0x38a7af(0x2c5)]),_0x55ecbd=getTrimmedString(_0x2c4a7b[_0x38a7af(0x35c)]),_0xf418c4=getTrimmedString(_0x2c4a7b[_0x38a7af(0x36d)+_0x38a7af(0x2db)]);_0x55ecbd&&_0xf418c4&&_0x1683d0[_0x38a7af(0x248)]({'id':'qqbot','type':'qqbot','name':_0x38a7af(0x382),'enabled':_0x2c4a7b[_0x38a7af(0x3a6)]!==![],'appId':_0x55ecbd,'clientSecret':_0xf418c4});const _0x2f1f97=asRecord(_0x5ea475[_0x38a7af(0x215)]),_0x56fbe7=getTrimmedString(_0x2f1f97[_0x38a7af(0x381)]),_0xf8ea1e=getTrimmedString(_0x2f1f97[_0x38a7af(0x217)]);_0x56fbe7&&_0xf8ea1e&&_0x1683d0[_0x38a7af(0x248)]({'id':'wecom','type':'wecom','name':_0x38a7af(0x3ce),'enabled':_0x2f1f97[_0x38a7af(0x3a6)]!==![],'botId':_0x56fbe7,'secret':_0xf8ea1e});const _0x1f8930=asRecord(_0x5ea475['feishu']),_0x128307=getTrimmedString(_0x1f8930[_0x38a7af(0x35c)]),_0x553edb=getTrimmedString(_0x1f8930[_0x38a7af(0x395)+'t']);return _0x128307&&_0x553edb&&getTrimmedString(_0x1f8930[_0x38a7af(0x2cb)+'y'])!==FEISHU_DOC_CONNECTOR_PLUGIN_ID&&_0x1683d0['push']({'id':'feishu','type':_0x38a7af(0x2d7),'name':_0x38a7af(0x1ea),'enabled':_0x1f8930['enabled']!==![],'appId':_0x128307,'appSecret':_0x553edb}),_0x1683d0;}async function _0x356c65(_0x3f2ab7){const _0x13d9a6=_0x5bae69;if(typeof openClawConfigHandlers['setPlugi'+_0x13d9a6(0x1fe)]===_0x13d9a6(0x2c0))return openClawConfigHandlers[_0x13d9a6(0x35d)+'nConfig']({'pluginId':WECHAT_PLUGIN_ID,'enabled':Boolean(_0x3f2ab7),'reason':WECHAT_PLUGIN_ID+'\x20plugin\x20'+(_0x3f2ab7?_0x13d9a6(0x3a6):_0x13d9a6(0x3ca))});const _0x4fbd4d=await _0xc78487(),_0x38536e=asRecord(_0x4fbd4d[_0x13d9a6(0x365)]),_0x451412=asRecord(_0x38536e[_0x13d9a6(0x2a2)]);return _0x451412[WECHAT_PLUGIN_ID]={...asRecord(_0x451412[WECHAT_PLUGIN_ID]),'enabled':Boolean(_0x3f2ab7)},_0x38536e[_0x13d9a6(0x2a2)]=_0x451412,_0x38536e[_0x13d9a6(0x23c)]=_0x3f2ab7?dedupeStrings([...asStringArray(_0x38536e['allow']),WECHAT_PLUGIN_ID]):asStringArray(_0x38536e[_0x13d9a6(0x23c)])[_0x13d9a6(0x239)](_0x5a20b6=>_0x5a20b6!==WECHAT_PLUGIN_ID),_0x4fbd4d[_0x13d9a6(0x365)]=_0x38536e,await _0x3d662c(_0x4fbd4d,WECHAT_PLUGIN_ID+'\x20plugin\x20'+(_0x3f2ab7?_0x13d9a6(0x3a6):'disabled')),{'ok':!![]};}async function _0x100daa(_0x508470={}){const _0x311749=_0x5bae69,_0x503ab0=safeString(_0x508470[_0x311749(0x28f)+'d']||_0x508470['id']);if(!_0x503ab0)throw new Error(_0x311749(0x1fd)+_0x311749(0x208)+'quired');const _0x29e755=await _0xc78487(),_0x2ac03f=asRecord(_0x29e755[_0x311749(0x32c)]),_0x15ab74=asRecord(_0x29e755['plugins']),_0x3794a5=asRecord(_0x15ab74['entries']),_0x3cc333=_0x4bf78b=>{const _0x1fa791=_0x311749;_0x3794a5[_0x4bf78b]=createConnectorPluginEntry(_0x4bf78b,_0x3794a5[_0x4bf78b],![],{}),_0x15ab74[_0x1fa791(0x23c)]=asStringArray(_0x15ab74[_0x1fa791(0x23c)])[_0x1fa791(0x239)](_0x1cc951=>_0x1cc951!==_0x4bf78b),_0x15ab74['entries']=_0x3794a5,_0x29e755[_0x1fa791(0x365)]=_0x15ab74;};if(_0x503ab0===_0x311749(0x306)+'oc')return _0x3cc333(FEISHU_DOC_CONNECTOR_PLUGIN_ID),getTrimmedString(asRecord(_0x2ac03f[_0x311749(0x2d7)])['managedB'+'y'])===FEISHU_DOC_CONNECTOR_PLUGIN_ID&&(delete _0x2ac03f[_0x311749(0x2d7)],_0x29e755['channels']=_0x2ac03f),await rm(_0x3269cc(),{'recursive':!![],'force':!![]})['catch'](()=>{}),_0x3d662c(_0x29e755,'feishu\x20d'+_0x311749(0x280)+'ctor\x20plu'+_0x311749(0x31c)+_0x311749(0x2a4));if(_0x503ab0===_0x311749(0x3d6)){if(typeof openClawConfigHandlers[_0x311749(0x35d)+_0x311749(0x1fe)]==='function')return openClawConfigHandlers[_0x311749(0x35d)+'nConfig']({'pluginId':QQ_MAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':'qq\x20mail\x20'+_0x311749(0x330)+_0x311749(0x2aa)+_0x311749(0x1ed)});return _0x3cc333(QQ_MAIL_CONNECTOR_PLUGIN_ID),_0x3d662c(_0x29e755,_0x311749(0x265)+'connecto'+_0x311749(0x2aa)+'\x20deleted');}if(_0x503ab0==='netease_'+_0x311749(0x2b0)){if(typeof openClawConfigHandlers[_0x311749(0x35d)+'nConfig']===_0x311749(0x2c0))return openClawConfigHandlers['setPlugi'+_0x311749(0x1fe)]({'pluginId':NETEASE_MAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':_0x311749(0x39a)+'mail\x20con'+'nector\x20p'+_0x311749(0x2dd)+_0x311749(0x2df)});return _0x3cc333(NETEASE_MAIL_CONNECTOR_PLUGIN_ID),_0x3d662c(_0x29e755,_0x311749(0x39a)+_0x311749(0x29c)+_0x311749(0x2a5)+_0x311749(0x2dd)+_0x311749(0x2df));}if(_0x503ab0===_0x311749(0x3a9)+_0x311749(0x246)){if(typeof openClawConfigHandlers[_0x311749(0x35d)+_0x311749(0x1fe)]==='function')return openClawConfigHandlers['setPlugi'+_0x311749(0x1fe)]({'pluginId':TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,'enabled':![],'config':{},'reason':_0x311749(0x243)+_0x311749(0x233)+_0x311749(0x2bd)+_0x311749(0x25e)+'deleted'});return _0x3cc333(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID),_0x3d662c(_0x29e755,_0x311749(0x243)+_0x311749(0x233)+_0x311749(0x2bd)+_0x311749(0x25e)+'deleted');}if(_0x503ab0===_0x311749(0x3a9)+_0x311749(0x375)){if(typeof openClawConfigHandlers['deleteSk'+_0x311749(0x2d8)]===_0x311749(0x2c0))return openClawConfigHandlers[_0x311749(0x2c2)+_0x311749(0x2d8)]({'skillId':TENCENT_DOCS_SKILL_ID,'reason':_0x311749(0x243)+_0x311749(0x2c7)+_0x311749(0x3b3)+_0x311749(0x272)+'eted'});const _0x4636fe=asRecord(_0x29e755['skills']),_0x5631b3=asRecord(_0x4636fe[_0x311749(0x2a2)]);return delete _0x5631b3[TENCENT_DOCS_SKILL_ID],_0x4636fe[_0x311749(0x2a2)]=_0x5631b3,_0x29e755[_0x311749(0x344)]=_0x4636fe,_0x3d662c(_0x29e755,_0x311749(0x243)+'docs\x20ski'+_0x311749(0x3b3)+_0x311749(0x272)+_0x311749(0x261));}if(_0x503ab0===_0x311749(0x205))return await _0x116e9f([_0x311749(0x2ab),_0x311749(0x2a0)])[_0x311749(0x2fc)](()=>({'code':null,'output':''})),await _0xb6a20a(),{'ok':!![]};if(_0x503ab0==='dingtalk'+_0x311749(0x2f8)){if(typeof openClawConfigHandlers[_0x311749(0x210)+_0x311749(0x34c)]===_0x311749(0x2c0))return openClawConfigHandlers[_0x311749(0x210)+_0x311749(0x34c)]({'serverName':DINGTALK_DOC_MCP_SERVER_NAME,'reason':_0x311749(0x379)+'\x20doc\x20mcp'+'\x20deleted'});const _0x2d2cf2=readOpenClawMcpServersFromConfig(_0x29e755);return delete _0x2d2cf2[DINGTALK_DOC_MCP_SERVER_NAME],writeOpenClawMcpServersToConfig(_0x29e755,_0x2d2cf2),_0x3d662c(_0x29e755,_0x311749(0x379)+_0x311749(0x376)+_0x311749(0x1ed));}if(_0x503ab0===WECHAT_PLUGIN_ID||_0x503ab0===_0x311749(0x22c)+_0x311749(0x2ea)){_0x3794a5[WECHAT_PLUGIN_ID]={...asRecord(_0x3794a5[WECHAT_PLUGIN_ID]),'enabled':![]},_0x15ab74[_0x311749(0x2a2)]=_0x3794a5,_0x15ab74['allow']=asStringArray(_0x15ab74['allow'])['filter'](_0x3019aa=>_0x3019aa!==WECHAT_PLUGIN_ID&&_0x3019aa!==_0x311749(0x22c)+_0x311749(0x2ea)),_0x29e755['plugins']=_0x15ab74;const _0x21b0c5=join(_0x33633a[_0x311749(0x359)+_0x311749(0x1fa)](),WECHAT_PLUGIN_ID);return await rm(join(_0x21b0c5,'accounts'+_0x311749(0x387)),{'force':!![]})[_0x311749(0x2fc)](()=>{}),await rm(join(_0x21b0c5,_0x311749(0x343)),{'recursive':!![],'force':!![]})['catch'](()=>{}),_0x3d662c(_0x29e755,_0x503ab0+(_0x311749(0x349)+'\x20config\x20'+_0x311749(0x29e)));}if(_0x503ab0==='feishu'){if(typeof openClawConfigHandlers[_0x311749(0x252)+_0x311749(0x2f4)+_0x311749(0x3ba)]===_0x311749(0x2c0))return openClawConfigHandlers[_0x311749(0x252)+_0x311749(0x2f4)+_0x311749(0x3ba)]({'channelId':'feishu','pluginId':_0x311749(0x2d7),'reason':_0x311749(0x2ee)+_0x311749(0x2ce)+_0x311749(0x20e)+_0x311749(0x2df)});return delete _0x2ac03f[_0x311749(0x2d7)],_0x29e755[_0x311749(0x32c)]=_0x2ac03f,_0x3794a5[_0x311749(0x2d7)]={...asRecord(_0x3794a5['feishu']),'enabled':![]},_0x15ab74[_0x311749(0x2a2)]=_0x3794a5,_0x15ab74[_0x311749(0x23c)]=asStringArray(_0x15ab74[_0x311749(0x23c)])[_0x311749(0x239)](_0x58ca9a=>_0x58ca9a!=='feishu'),_0x29e755['plugins']=_0x15ab74,_0x3d662c(_0x29e755,_0x311749(0x2ee)+_0x311749(0x2ce)+_0x311749(0x20e)+'leted');}if(_0x503ab0===_0x311749(0x2c5)){if(typeof openClawConfigHandlers[_0x311749(0x252)+'annelCon'+_0x311749(0x3ba)]==='function')return openClawConfigHandlers[_0x311749(0x252)+_0x311749(0x2f4)+'fig']({'channelId':_0x311749(0x2c5),'pluginId':QQBOT_PLUGIN_ID,'reason':_0x311749(0x32a)+_0x311749(0x360)+_0x311749(0x31e)+_0x311749(0x261)});delete _0x2ac03f[_0x311749(0x2c5)],_0x3794a5[QQBOT_PLUGIN_ID]={...asRecord(_0x3794a5[QQBOT_PLUGIN_ID]),'enabled':![]},_0x15ab74[_0x311749(0x23c)]=asStringArray(_0x15ab74[_0x311749(0x23c)])[_0x311749(0x239)](_0x3f6985=>_0x3f6985!==QQBOT_PLUGIN_ID);}if(_0x503ab0==='wecom'){if(typeof openClawConfigHandlers[_0x311749(0x252)+_0x311749(0x2f4)+_0x311749(0x3ba)]===_0x311749(0x2c0))return openClawConfigHandlers['deleteCh'+_0x311749(0x2f4)+_0x311749(0x3ba)]({'channelId':_0x311749(0x215),'pluginId':WECOM_PLUGIN_ID,'reason':_0x311749(0x288)+_0x311749(0x360)+_0x311749(0x31e)+_0x311749(0x261)});delete _0x2ac03f[_0x311749(0x215)],_0x3794a5[WECOM_PLUGIN_ID]={...asRecord(_0x3794a5[WECOM_PLUGIN_ID]),'enabled':![]},_0x15ab74[_0x311749(0x23c)]=asStringArray(_0x15ab74[_0x311749(0x23c)])[_0x311749(0x239)](_0x422938=>_0x422938!==WECOM_PLUGIN_ID);}return _0x29e755[_0x311749(0x32c)]=_0x2ac03f,_0x15ab74[_0x311749(0x2a2)]=_0x3794a5,_0x29e755[_0x311749(0x365)]=_0x15ab74,_0x3d662c(_0x29e755,_0x503ab0+(_0x311749(0x349)+_0x311749(0x27d)+'deleted'));}async function _0x540741(_0x1497f9={}){const _0x14f40a=_0x5bae69,_0x189bad=safeString(_0x1497f9['channelI'+'d']||_0x1497f9['id']);if(!_0x189bad)throw new Error(_0x14f40a(0x1fd)+'id\x20is\x20re'+_0x14f40a(0x23b));const _0x331f77=_0x1497f9[_0x14f40a(0x3a6)]===!![],_0x17c151=await _0xc78487(),_0x4dc1a1=asRecord(_0x17c151[_0x14f40a(0x365)]),_0x1a9717=asRecord(_0x4dc1a1[_0x14f40a(0x2a2)]),_0x81f898=_0x32a41b=>{const _0x1bb426=_0x14f40a;_0x1a9717[_0x32a41b]=createConnectorPluginEntry(_0x32a41b,_0x1a9717[_0x32a41b],_0x331f77,{},{'preserveExistingConfig':!![]}),_0x4dc1a1[_0x1bb426(0x23c)]=_0x331f77?dedupeStrings([...asStringArray(_0x4dc1a1['allow']),_0x32a41b]):asStringArray(_0x4dc1a1[_0x1bb426(0x23c)])[_0x1bb426(0x239)](_0x7fa608=>_0x7fa608!==_0x32a41b),_0x4dc1a1[_0x1bb426(0x2a2)]=_0x1a9717,_0x17c151[_0x1bb426(0x365)]=_0x4dc1a1;};if(_0x189bad==='feishu_d'+'oc'){const _0x504bc0=asRecord(_0x1a9717[FEISHU_DOC_CONNECTOR_PLUGIN_ID]);if(Object[_0x14f40a(0x361)](_0x504bc0)[_0x14f40a(0x3a7)]===0x0)throw new Error('Connecto'+_0x14f40a(0x293)+_0x189bad+('\x22\x20not\x20fo'+'und'));if(typeof openClawConfigHandlers[_0x14f40a(0x35d)+_0x14f40a(0x1fe)]===_0x14f40a(0x2c0))return openClawConfigHandlers[_0x14f40a(0x35d)+_0x14f40a(0x1fe)]({'pluginId':FEISHU_DOC_CONNECTOR_PLUGIN_ID,'enabled':_0x331f77,'reason':_0x189bad+('\x20channel'+_0x14f40a(0x27d))+(_0x331f77?_0x14f40a(0x3a6):_0x14f40a(0x3ca))});_0x81f898(FEISHU_DOC_CONNECTOR_PLUGIN_ID);}else{if(_0x189bad==='qq_mail'){if(typeof openClawConfigHandlers[_0x14f40a(0x35d)+_0x14f40a(0x1fe)]===_0x14f40a(0x2c0))return openClawConfigHandlers['setPlugi'+_0x14f40a(0x1fe)]({'pluginId':QQ_MAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x331f77,'reason':_0x189bad+('\x20channel'+_0x14f40a(0x27d))+(_0x331f77?_0x14f40a(0x3a6):_0x14f40a(0x3ca))});_0x81f898(QQ_MAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x189bad===_0x14f40a(0x36b)+_0x14f40a(0x2b0)){if(typeof openClawConfigHandlers[_0x14f40a(0x35d)+'nConfig']===_0x14f40a(0x2c0))return openClawConfigHandlers['setPlugi'+_0x14f40a(0x1fe)]({'pluginId':NETEASE_MAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x331f77,'reason':_0x189bad+('\x20channel'+_0x14f40a(0x27d))+(_0x331f77?_0x14f40a(0x3a6):_0x14f40a(0x3ca))});_0x81f898(NETEASE_MAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x189bad===_0x14f40a(0x3a9)+'exmail'){if(typeof openClawConfigHandlers[_0x14f40a(0x35d)+'nConfig']===_0x14f40a(0x2c0))return openClawConfigHandlers[_0x14f40a(0x35d)+_0x14f40a(0x1fe)]({'pluginId':TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID,'enabled':_0x331f77,'reason':_0x189bad+(_0x14f40a(0x349)+'\x20config\x20')+(_0x331f77?_0x14f40a(0x3a6):_0x14f40a(0x3ca))});_0x81f898(TENCENT_EXMAIL_CONNECTOR_PLUGIN_ID);}else{if(_0x189bad===_0x14f40a(0x3a9)+_0x14f40a(0x375)){const _0x412b79=asRecord(_0x17c151[_0x14f40a(0x344)]),_0xd35a6d=asRecord(_0x412b79['entries']),_0x102b70=asRecord(_0xd35a6d[TENCENT_DOCS_SKILL_ID]);if(typeof openClawConfigHandlers[_0x14f40a(0x2c3)+'Entry']===_0x14f40a(0x2c0))return openClawConfigHandlers['setSkill'+'Entry']({'skillId':TENCENT_DOCS_SKILL_ID,'entry':{..._0x102b70,'enabled':_0x331f77},'reason':_0x189bad+(_0x14f40a(0x349)+_0x14f40a(0x27d))+(_0x331f77?_0x14f40a(0x3a6):_0x14f40a(0x3ca))});_0xd35a6d[TENCENT_DOCS_SKILL_ID]={..._0x102b70,'enabled':_0x331f77},_0x412b79['entries']=_0xd35a6d,_0x17c151[_0x14f40a(0x344)]=_0x412b79;}else{if(_0x189bad==='kdocs'){if(_0x331f77&&!await _0x255a0e())throw new Error('金山文档尚未授权'+_0x14f40a(0x235));return await _0x83c6cc(_0x331f77),{'ok':!![]};}else{if(_0x189bad===_0x14f40a(0x379)+_0x14f40a(0x2f8)){const _0x531da9=readOpenClawMcpServersFromConfig(_0x17c151),_0x45f654=findDingtalkDocMcpServer(_0x531da9);if(!getTrimmedString(_0x45f654['url']))throw new Error(_0x14f40a(0x2ba)+_0x14f40a(0x293)+_0x189bad+('\x22\x20not\x20fo'+_0x14f40a(0x347)));_0x531da9[DINGTALK_DOC_MCP_SERVER_NAME]=createDingtalkDocMcpServerConfig(_0x45f654[_0x14f40a(0x38a)],{'enabled':_0x331f77}),writeOpenClawMcpServersToConfig(_0x17c151,_0x531da9);}else{const _0xdaf18a=asRecord(_0x17c151[_0x14f40a(0x32c)]),_0x28dc6f=asRecord(_0xdaf18a[_0x189bad]);if(Object[_0x14f40a(0x361)](_0x28dc6f)[_0x14f40a(0x3a7)]===0x0)throw new Error(_0x14f40a(0x1fd)+'\x22'+_0x189bad+(_0x14f40a(0x32f)+_0x14f40a(0x347)));_0x28dc6f[_0x14f40a(0x3a6)]=_0x331f77;let _0x48ff70=null;_0x189bad==='feishu'&&(_0x48ff70=_0x14f40a(0x2d7),_0x331f77&&(_0x28dc6f['streamin'+'g']=!![],delete _0x28dc6f['footer']));if(_0x189bad===_0x14f40a(0x2c5))_0x48ff70=QQBOT_PLUGIN_ID;if(_0x189bad===_0x14f40a(0x215))_0x48ff70=WECOM_PLUGIN_ID;if(_0x48ff70&&typeof openClawConfigHandlers[_0x14f40a(0x363)+_0x14f40a(0x24b)]===_0x14f40a(0x2c0))return openClawConfigHandlers[_0x14f40a(0x363)+'elConfig']({'channelId':_0x189bad,'channel':_0x28dc6f,'pluginId':_0x48ff70,'pluginEnabled':_0x331f77,'reason':_0x189bad+(_0x14f40a(0x349)+_0x14f40a(0x27d))+(_0x331f77?_0x14f40a(0x3a6):_0x14f40a(0x3ca))});_0xdaf18a[_0x189bad]=_0x28dc6f,_0x17c151[_0x14f40a(0x32c)]=_0xdaf18a;if(_0x189bad===_0x14f40a(0x2d7))_0x81f898(_0x14f40a(0x2d7));if(_0x189bad===_0x14f40a(0x2c5))_0x81f898(QQBOT_PLUGIN_ID);if(_0x189bad==='wecom')_0x81f898(WECOM_PLUGIN_ID);}}}}}}}return _0x3d662c(_0x17c151,_0x189bad+(_0x14f40a(0x349)+_0x14f40a(0x27d))+(_0x331f77?_0x14f40a(0x3a6):_0x14f40a(0x3ca)));}async function _0x419291({gatewayPort:_0x423b01,gatewayToken:_0x389d5b}={}){const _0x290562=_0x5bae69;_0x2f0ae0&&(_0x2f0ae0[_0x290562(0x3d3)](),_0x2f0ae0=null);const {cwd:_0x22f69e,env:_0x481eb5,runtime:_0x21cba1}=await _0x1ed832({'FORCE_COLOR':'0',..._0x423b01?{'OPENCLAW_GATEWAY_PORT':String(_0x423b01)}:{},..._0x389d5b?{'OPENCLAW_GATEWAY_TOKEN':_0x389d5b}:{}}),_0xf2a1=_0x21cba1['plugins'][_0x290562(0x1df)](_0x93e1c6=>_0x93e1c6[_0x290562(0x234)]===WECHAT_PLUGIN_ID);if(!_0xf2a1){const _0x1ae7f1=_0x290562(0x1e3)+'微信连接插件,请'+_0x290562(0x353)+_0x290562(0x351);return _0x533e40(_0x290562(0x356)+'tatus','ERROR'),_0x533e40('wechat-l'+'og',_0x1ae7f1),{'ok':![],'error':_0x1ae7f1};}await _0x356c65(!![]),_0x533e40(_0x290562(0x202)+'og',_0x290562(0x34d)+'enclaw\x20c'+_0x290562(0x3ab)+_0x290562(0x328)+'channel\x20'+_0xf2a1['pluginId']),_0x2f0ae0=spawn(_0x21cba1[_0x290562(0x31d)+'utable'],[_0x21cba1[_0x290562(0x22c)+_0x290562(0x229)],'channels','login',_0x290562(0x392)+'l',_0xf2a1[_0x290562(0x234)]],{'cwd':_0x22f69e,'env':_0x481eb5});let _0x3e4aab='',_0x24ae06=![],_0x1bab39=![];const _0x3516fb=_0x558a82=>{const _0x393b3e=_0x290562,_0x273b14=_0x558a82['toString']();_0x3e4aab+=_0x273b14;if(!_0x24ae06){const _0x3131b1=_0x3e4aab[_0x393b3e(0x3a8)](/(https:\/\/(?:[a-zA-Z0-9-]+\.)*weixin\.qq\.com\S+)/i);_0x3131b1?.[0x1]&&(_0x24ae06=!![],_0x533e40('wechat-q'+'rcode',_0x3131b1[0x1]),_0x533e40(_0x393b3e(0x356)+_0x393b3e(0x372),_0x393b3e(0x279)));}if(_0x273b14[_0x393b3e(0x383)]('已扫描')||_0x273b14[_0x393b3e(0x383)]('Scan\x20suc'+'cess')||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x227)))_0x533e40('wechat-s'+_0x393b3e(0x372),'SCANNED');else{if(_0x273b14[_0x393b3e(0x383)]('登录成功')||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x283))||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x35e))||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x24e)+'n')||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x25a)+_0x393b3e(0x259))||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x34b))||_0x273b14['includes'](_0x393b3e(0x250))||_0x273b14[_0x393b3e(0x383)]('无需重复连接')||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x3c4)+'connecte'+'d')||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x378)+_0x393b3e(0x3a4)+_0x393b3e(0x28e)))_0x1bab39=!![],_0x533e40(_0x393b3e(0x356)+'tatus','SUCCESS'),setTimeout(()=>{const _0x91872c=_0x393b3e;_0x2f0ae0&&(_0x2f0ae0[_0x91872c(0x3d3)](),_0x2f0ae0=null);},0xbb8);else{if(_0x273b14[_0x393b3e(0x383)]('过期')||_0x273b14['includes']('expired'))_0x533e40(_0x393b3e(0x356)+'tatus',_0x393b3e(0x2b3));else(_0x273b14[_0x393b3e(0x383)]('失败')||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x3b5))||_0x273b14[_0x393b3e(0x383)](_0x393b3e(0x24f)))&&_0x533e40(_0x393b3e(0x356)+_0x393b3e(0x372),_0x393b3e(0x36e));}}_0x533e40('wechat-l'+'og',_0x273b14);};return _0x2f0ae0[_0x290562(0x268)]?.['on'](_0x290562(0x1d9),_0x3516fb),_0x2f0ae0[_0x290562(0x214)]?.['on'](_0x290562(0x1d9),_0x3516fb),_0x2f0ae0['on'](_0x290562(0x3ad),_0x2369ee=>{const _0x5bad82=_0x290562;_0x2f0ae0=null,_0x533e40(_0x5bad82(0x356)+'tatus','ERROR'),_0x533e40(_0x5bad82(0x202)+'og',_0x5bad82(0x39c)+'ror:\x20'+_0x2369ee[_0x5bad82(0x33c)]);}),_0x2f0ae0['on']('close',_0x25c043=>{const _0x2820f0=_0x290562;_0x2f0ae0=null,_0x1bab39?_0x356c65(!![])[_0x2820f0(0x2fc)](()=>{}):(_0x356c65(![])[_0x2820f0(0x2fc)](()=>{}),_0x533e40(_0x2820f0(0x356)+_0x2820f0(0x372),_0x25c043===0x0?_0x2820f0(0x22a):_0x2820f0(0x36e)));}),{'ok':!![]};}function _0x3d6062(){return _0x2f0ae0&&(_0x2f0ae0['kill'](),_0x2f0ae0=null),{'ok':!![]};}function _0x26653a(){const _0xfb5e3c=_0x5bae69;for(const _0x1836e3 of _0x5cd7c6[_0xfb5e3c(0x2a1)]()){_0x46591d(_0x1836e3),_0x1836e3[_0xfb5e3c(0x327)]?.['kill']();}_0x5cd7c6[_0xfb5e3c(0x370)]();for(const _0x36c3f8 of _0x1452bf['values']()){_0xfc8536(_0x36c3f8);}_0x1452bf[_0xfb5e3c(0x370)]();for(const _0x2f849f of _0x3c72cd[_0xfb5e3c(0x2a1)]()){_0x1fbc76(_0x2f849f),_0x3f3d0c(_0x2f849f),_0x2f849f[_0xfb5e3c(0x327)]?.[_0xfb5e3c(0x3d3)]();}_0x3c72cd[_0xfb5e3c(0x370)](),_0x2f0ae0&&(_0x2f0ae0[_0xfb5e3c(0x3d3)](),_0x2f0ae0=null);}return{'saveFeishuChannelConfig':_0x152105,'saveQqbotChannelConfig':_0x1e624d,'saveWecomChannelConfig':_0x1cf017,'saveQqMailConnectorConfig':_0x1672d0,'saveNetEaseMailConnectorConfig':_0x489848,'saveTencentExmailConnectorConfig':_0x5233ca,'saveFeishuDocConnectorConfig':_0x35e796,'saveTencentDocsConnectorConfig':_0x3c8f79,'saveKdocsConnectorConfig':_0x1d9a74,'saveDingtalkDocConnectorConfig':_0x5afdba,'readConfigSnapshot':_0x3fe734,'startKdocsCliConnectSession':_0x125207,'getKdocsCliConnectStatus':_0x35e65d,'cancelKdocsCliConnectSession':_0x52785b,'startFeishuDocCliConnectSession':_0x355157,'getFeishuDocCliConnectStatus':_0x53614e,'cancelFeishuDocCliConnectSession':_0x5656f1,'completeFeishuDocCliConnectSession':_0x23f258,'startFeishuRegistrationSession':_0xd7f2f2,'getFeishuRegistrationStatus':_0x5241a0,'cancelFeishuRegistrationSession':_0x16708a,'listImChannelConfigs':_0x59ccb6,'deleteImChannelConfig':_0x100daa,'setImChannelEnabled':_0x540741,'startWechatChannelSession':_0x419291,'cancelWechatChannelSession':_0x3d6062,'dispose':_0x26653a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1bca2b=_0x507c;(function(_0x51ce63,_0x3f366c){const _0x227c0c=_0x507c,_0x890841=_0x51ce63();while(!![]){try{const _0x46737d=-parseInt(_0x227c0c(0x12c))/0x1+-parseInt(_0x227c0c(0x158))/0x2*(parseInt(_0x227c0c(0x127))/0x3)+-parseInt(_0x227c0c(0x171))/0x4+parseInt(_0x227c0c(0x126))/0x5*(-parseInt(_0x227c0c(0x16c))/0x6)+-parseInt(_0x227c0c(0x142))/0x7*(parseInt(_0x227c0c(0x125))/0x8)+-parseInt(_0x227c0c(0x146))/0x9*(parseInt(_0x227c0c(0x137))/0xa)+-parseInt(_0x227c0c(0x16f))/0xb*(-parseInt(_0x227c0c(0x118))/0xc);if(_0x46737d===_0x3f366c)break;else _0x890841['push'](_0x890841['shift']());}catch(_0x563066){_0x890841['push'](_0x890841['shift']());}}}(_0x4d90,0x66de8));import{existsSync,readdirSync}from'node:fs';import{createWriteStream}from'node:fs';import{chmod,cp,mkdir,readFile,readdir,rm,writeFile}from'node:fs/promises';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??_0x1bca2b(0x170)+_0x1bca2b(0x13d)+_0x1bca2b(0x14c)+_0x1bca2b(0x132)+_0x1bca2b(0x12e))[_0x1bca2b(0x113)](/\/$/,''),DOWNLOAD_TIMEOUT_MS=0xf*0x3c*0x3e8;async function runProcess(_0x3da158,_0x7799f5,_0x3e24bd={}){const _0x448836=_0x1bca2b,{spawn:_0x2f5787}=await import('node:chi'+_0x448836(0x112)+'ss'),_0xa62b2e=_0x3e24bd[_0x448836(0x110)]||[_0x3da158,..._0x7799f5][_0x448836(0x154)]('\x20'),_0x186028=_0x3e24bd[_0x448836(0x16b)+'s']??DOWNLOAD_TIMEOUT_MS;return await new Promise((_0x44b8d0,_0x481f03)=>{const _0x517b0f=_0x448836,_0x4cbd30=_0x2f5787(_0x3da158,_0x7799f5,{'cwd':_0x3e24bd[_0x517b0f(0x15d)],'env':_0x3e24bd[_0x517b0f(0x150)],'stdio':[_0x517b0f(0x16a),_0x517b0f(0x169),_0x517b0f(0x169)]});let _0x4b6eb4='',_0x2523e2='';const _0x26997a=setTimeout(()=>{const _0x442439=_0x517b0f;_0x4cbd30[_0x442439(0x117)]('SIGTERM'),_0x481f03(new Error(_0xa62b2e+(_0x442439(0x15e)+_0x442439(0x176)+'\x20')+_0x186028+'ms'));},_0x186028);_0x4cbd30[_0x517b0f(0x166)]['on']('data',_0xa3e2f6=>{_0x4b6eb4+=_0xa3e2f6['toString']();}),_0x4cbd30[_0x517b0f(0x10d)]['on'](_0x517b0f(0x12f),_0x4b5835=>{_0x2523e2+=_0x4b5835['toString']();}),_0x4cbd30['on'](_0x517b0f(0x14d),_0x1d3604=>{clearTimeout(_0x26997a),_0x481f03(_0x1d3604);}),_0x4cbd30['on'](_0x517b0f(0x10e),_0x27cc99=>{const _0x38d33a=_0x517b0f;clearTimeout(_0x26997a);if(_0x27cc99===0x0)_0x44b8d0({'stdout':_0x4b6eb4,'stderr':_0x2523e2,'code':_0x27cc99});else _0x481f03(new Error(_0xa62b2e+(_0x38d33a(0x174)+_0x38d33a(0x124)+'e\x20')+_0x27cc99+':\x20'+(_0x2523e2||_0x4b6eb4)));});});}async function downloadFile(_0x1a6bfe,_0x20c02d){await mkdir(dirname(_0x20c02d),{'recursive':!![]});const _0x5ba6c7=await new Promise((_0x24525d,_0x12641c)=>{const _0x42dbba=_0x507c,_0x1be01e=get(_0x1a6bfe,_0x400e5c=>{const _0x47c7a8=_0x507c;if([0x12d,0x12e,0x12f,0x133,0x134][_0x47c7a8(0x12b)](_0x400e5c[_0x47c7a8(0x160)+'de']||0x0)&&_0x400e5c['headers'][_0x47c7a8(0x147)]){_0x400e5c[_0x47c7a8(0x141)](),downloadFile(new URL(_0x400e5c[_0x47c7a8(0x15b)][_0x47c7a8(0x147)],_0x1a6bfe)[_0x47c7a8(0x16d)],_0x20c02d)[_0x47c7a8(0x157)](()=>_0x24525d(null))[_0x47c7a8(0x15c)](_0x12641c);return;}if((_0x400e5c[_0x47c7a8(0x160)+'de']||0x0)>=0x190){_0x400e5c['resume'](),_0x12641c(new Error(_0x47c7a8(0x167)+_0x47c7a8(0x174)+_0x400e5c['statusCo'+'de']+':\x20'+_0x1a6bfe));return;}_0x24525d(_0x400e5c);});_0x1be01e['on'](_0x42dbba(0x14d),_0x12641c);});if(!_0x5ba6c7)return;await pipeline(_0x5ba6c7,createWriteStream(_0x20c02d));}async function findRuntimeKdocsCliBin(_0x5a12a2){const _0x18a9af=_0x1bca2b,_0x2daf88=join(_0x5a12a2[_0x18a9af(0x130)+_0x18a9af(0x136)+'ir'],_0x18a9af(0x114),_0x18a9af(0x151)+'i'),_0x5a5fdf=join(_0x2daf88,process[_0x18a9af(0x145)]===_0x18a9af(0x133)?_0x18a9af(0x151)+_0x18a9af(0x159):_0x18a9af(0x151)+'i');return{'installDir':_0x2daf88,'binPath':existsSync(_0x5a5fdf)?_0x5a5fdf:null};}export async function resolveRuntimeKdocsCliCommand(_0x20e2f6){const _0x520460=_0x1bca2b,{installDir:_0x13ff88,binPath:_0xd7dcc}=await findRuntimeKdocsCliBin(_0x20e2f6);if(!_0xd7dcc||!existsSync(_0xd7dcc))throw new Error(_0x520460(0x156)+_0x520460(0x151)+_0x520460(0x14b)+_0x520460(0x12d)+_0x520460(0x179)+'aw\x20runti'+_0x520460(0x115)+_0x13ff88+(_0x520460(0x10c)+_0x520460(0x153)+_0x520460(0x11f)+'re\x22\x20to\x20r'+'ebuild\x20t'+'he\x20runti'+_0x520460(0x15a)));return{'executablePath':_0xd7dcc,'installDir':_0x13ff88};}function toKdocsCliPlatform(_0xed4b49){const _0x4751b3=_0x1bca2b;if(_0xed4b49===_0x4751b3(0x133))return'windows';return _0xed4b49;}function _0x4d90(){const _0x46565d=['now','rsion\x20fr','/release','li-extra','endsWith','wpsai.wp','\x20not\x20fou','runtimeL','push','resume','2048074dGMsNs','wujie-sh','ory','platform','108aighSq','location','llPaths','o\x20resolv','nd\x20in\x20ar','i\x20is\x20mis','scdn.cn/','error','name','y\x20instal','env','kdocs-cl','om\x20','ujie-she','join','e\x20kdocs\x20','Bundled\x20','then','39436yRaSwv','i.exe','me.','headers','catch','cwd','\x20timed\x20o','utf8','statusCo','i\x20versio','amd64','i\x20binary','oot','ime\x0a','stdout','download','test','pipe','ignore','timeoutM','6alfLdS','href','ogger','4558961UPFigU','https://','2426564lqcJJf','info','.cache','\x20failed\x20','[wujie-s','ut\x20after','runtimeR','tar','m\x20OpenCl','ct-','.\x20Run\x20\x22w','stderr','close','led','label','match','ld_proce','replace','tools','me:\x20','i\x20alread','kill','72eUWwra','Unable\x20t','pid','.zip','trim','resolved','extract\x20','ll\x20prepa','chive:\x20','hell:run','arch','-xzf','with\x20cod','8TVEDrZ','2787155iHaXia','9RLrDXw','SKILL.md','x64','time]\x20do','includes','381162kHDpBw','sing\x20fro','/pro','data','openclaw','log','skillhub','win32','windows','map','WorkingD','140320JfIUkk'];_0x4d90=function(){return _0x46565d;};return _0x4d90();}function toKdocsCliArch(_0x5aac16){const _0x4aadad=_0x1bca2b;if(_0x5aac16===_0x4aadad(0x129))return _0x4aadad(0x162);return _0x5aac16;}async function resolveKdocsSkillVersion(_0xf68246){const _0x4cf8d2=_0x1bca2b,_0x2a7121=_0xf68246[_0x4cf8d2(0x130)][_0x4cf8d2(0x11d)+'LocalSki'+_0x4cf8d2(0x148)]??[],_0x52287d=[];for(const _0xee438c of _0x2a7121){if(!existsSync(_0xee438c))continue;_0x52287d['push'](join(_0xee438c,'SKILL.md')),_0x52287d[_0x4cf8d2(0x140)](...(await readdir(_0xee438c,{'withFileTypes':!![]}))['filter'](_0x15da82=>_0x15da82['isDirect'+_0x4cf8d2(0x144)]())[_0x4cf8d2(0x135)](_0x278ca3=>join(_0xee438c,_0x278ca3[_0x4cf8d2(0x14e)],_0x4cf8d2(0x128))));}for(const _0x41289d of _0x52287d){if(!existsSync(_0x41289d))continue;const _0x4add52=await readFile(_0x41289d,'utf8');if(!/^name:\s*kdocs\s*$/m[_0x4cf8d2(0x168)](_0x4add52))continue;const _0x13060c=_0x4add52[_0x4cf8d2(0x111)](/^version:\s*"?([^"\s]+)"?\s*$/m);if(_0x13060c?.[0x1])return _0x13060c[0x1];}throw new Error(_0x4cf8d2(0x119)+_0x4cf8d2(0x149)+_0x4cf8d2(0x155)+'skill\x20ve'+_0x4cf8d2(0x139)+_0x4cf8d2(0x152)+_0x2a7121[_0x4cf8d2(0x154)](',\x20'));}export const __test__={'resolveKdocsSkillVersion':resolveKdocsSkillVersion};function _0x507c(_0x11d444,_0x3c3360){_0x11d444=_0x11d444-0x10c;const _0x4d906d=_0x4d90();let _0x507c3a=_0x4d906d[_0x11d444];return _0x507c3a;}function findFileByName(_0xf3e222,_0x5819d2){const _0x13a6e1=_0x1bca2b;if(!existsSync(_0xf3e222))return null;for(const _0x3d2494 of readdirSync(_0xf3e222,{'withFileTypes':!![]})){const _0x1765f2=join(_0xf3e222,_0x3d2494['name']);if(_0x3d2494['isDirect'+_0x13a6e1(0x144)]()){const _0x5c4d76=findFileByName(_0x1765f2,_0x5819d2);if(_0x5c4d76)return _0x5c4d76;continue;}if(_0x3d2494['isFile']()&&_0x3d2494[_0x13a6e1(0x14e)]===_0x5819d2)return _0x1765f2;}return null;}export async function installKdocsCliBinary(_0x76fdee,_0x499955,_0x1e92d6={}){const _0x58144a=_0x1bca2b,_0x28d9a9=await resolveKdocsSkillVersion(_0x76fdee),_0x46e0eb=toKdocsCliPlatform(process[_0x58144a(0x145)]),_0x363c95=toKdocsCliArch(process[_0x58144a(0x122)]),_0x8f2b87=process[_0x58144a(0x145)]===_0x58144a(0x133)?_0x58144a(0x151)+_0x58144a(0x159):'kdocs-cl'+'i',_0x163d84=join(_0x499955[_0x58144a(0x130)+_0x58144a(0x136)+'ir'],'tools',_0x58144a(0x151)+'i'),_0x47a828=join(_0x163d84,_0x8f2b87);if(existsSync(_0x47a828))try{const _0x15404a=(await runProcess(_0x47a828,['version'],{'label':_0x58144a(0x151)+_0x58144a(0x161)+'n','timeoutMs':0x7530}))[_0x58144a(0x166)][_0x58144a(0x11c)]();if(_0x15404a===_0x28d9a9){_0x1e92d6[_0x58144a(0x13f)+_0x58144a(0x16e)]?.[_0x58144a(0x172)]('kdocs-cl'+_0x58144a(0x116)+_0x58144a(0x14f)+_0x58144a(0x10f),{'version':_0x28d9a9,'installDir':_0x163d84});return;}}catch{}const _0x59dff3=_0x46e0eb===_0x58144a(0x134)?_0x58144a(0x11b):'.tar.gz',_0xe3f41f=_0x58144a(0x151)+'i-'+_0x28d9a9+'-'+_0x46e0eb+'-'+_0x363c95+_0x59dff3,_0xd1f88b=join(_0x499955[_0x58144a(0x177)+_0x58144a(0x164)],_0x58144a(0x173)),_0xa52deb=join(_0xd1f88b,_0xe3f41f),_0x3f172b=join(_0x499955[_0x58144a(0x177)+_0x58144a(0x164)],'.kdocs-c'+_0x58144a(0x13b)+_0x58144a(0x17a)+process[_0x58144a(0x11a)]+'-'+Date[_0x58144a(0x138)]()),_0x5b01db=KDOCS_CLI_CDN_BASE+'/v'+_0x28d9a9+(_0x58144a(0x13a)+'s/')+_0xe3f41f;await mkdir(_0xd1f88b,{'recursive':!![]});!existsSync(_0xa52deb)&&(console[_0x58144a(0x131)](_0x58144a(0x175)+_0x58144a(0x121)+_0x58144a(0x12a)+'wnloadin'+'g\x20'+_0x5b01db),await downloadFile(_0x5b01db,_0xa52deb));await rm(_0x3f172b,{'recursive':!![],'force':!![]}),await mkdir(_0x3f172b,{'recursive':!![]});_0xa52deb[_0x58144a(0x13c)](_0x58144a(0x11b))?await runProcess('unzip',['-q',_0xa52deb,'-d',_0x3f172b],{'label':_0x58144a(0x11e)+_0xe3f41f}):await runProcess(_0x58144a(0x178),[_0x58144a(0x123),_0xa52deb,'-C',_0x3f172b],{'label':_0x58144a(0x11e)+_0xe3f41f});const _0x2df99f=findFileByName(_0x3f172b,_0x8f2b87);if(!_0x2df99f)throw new Error('kdocs-cl'+_0x58144a(0x163)+_0x58144a(0x13e)+_0x58144a(0x14a)+_0x58144a(0x120)+_0xe3f41f);await rm(_0x163d84,{'recursive':!![],'force':!![]}),await mkdir(_0x163d84,{'recursive':!![]}),await cp(_0x2df99f,_0x47a828);if(process[_0x58144a(0x145)]!==_0x58144a(0x133))await chmod(_0x47a828,0x1ed);await writeFile(join(_0x163d84,'.source'),_0x58144a(0x143)+'ell-runt'+_0x58144a(0x165),_0x58144a(0x15f)),await rm(_0x3f172b,{'recursive':!![],'force':!![]}),_0x1e92d6[_0x58144a(0x13f)+_0x58144a(0x16e)]?.[_0x58144a(0x172)]('kdocs-cl'+'i\x20instal'+_0x58144a(0x10f),{'version':_0x28d9a9,'installDir':_0x163d84,'binPath':_0x47a828});}
|
|
1
|
+
const _0x25c9b9=_0x28a3;(function(_0x15cf7a,_0x4332b5){const _0x5306ba=_0x28a3,_0x11b018=_0x15cf7a();while(!![]){try{const _0x16bef1=-parseInt(_0x5306ba(0xd3))/0x1*(parseInt(_0x5306ba(0x10a))/0x2)+-parseInt(_0x5306ba(0x126))/0x3+parseInt(_0x5306ba(0x12d))/0x4+-parseInt(_0x5306ba(0x10c))/0x5+-parseInt(_0x5306ba(0xf9))/0x6+-parseInt(_0x5306ba(0xc6))/0x7*(-parseInt(_0x5306ba(0xfb))/0x8)+parseInt(_0x5306ba(0x100))/0x9;if(_0x16bef1===_0x4332b5)break;else _0x11b018['push'](_0x11b018['shift']());}catch(_0x10009f){_0x11b018['push'](_0x11b018['shift']());}}}(_0x2606,0x4d4cc));import{existsSync,readdirSync}from'node:fs';import{createWriteStream}from'node:fs';function _0x28a3(_0x30ba7c,_0x5939c3){_0x30ba7c=_0x30ba7c-0xc5;const _0x260673=_0x2606();let _0x28a3f0=_0x260673[_0x30ba7c];return _0x28a3f0;}import{chmod,cp,mkdir,readFile,readdir,rm,writeFile}from'node:fs/promises';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??_0x25c9b9(0xd4)+_0x25c9b9(0xe0)+_0x25c9b9(0xfd)+_0x25c9b9(0x113)+_0x25c9b9(0x12b))[_0x25c9b9(0xfa)](/\/$/,''),DOWNLOAD_TIMEOUT_MS=0xf*0x3c*0x3e8;async function runProcess(_0x28ab11,_0x156d29,_0xff8d7a={}){const _0x58a645=_0x25c9b9,{spawn:_0x530920}=await import('node:chi'+_0x58a645(0x103)+'ss'),_0x4c7a74=_0xff8d7a[_0x58a645(0xef)]||[_0x28ab11,..._0x156d29]['join']('\x20'),_0x296d00=_0xff8d7a[_0x58a645(0xfe)+'s']??DOWNLOAD_TIMEOUT_MS;return await new Promise((_0x1043fe,_0x1a8a4b)=>{const _0x32d319=_0x58a645,_0x41fc9d=_0x530920(_0x28ab11,_0x156d29,{'cwd':_0xff8d7a['cwd'],'env':_0xff8d7a[_0x32d319(0x115)],'stdio':[_0x32d319(0xf3),_0x32d319(0xd1),_0x32d319(0xd1)]});let _0x1734c9='',_0x1f29b8='';const _0x4312f0=setTimeout(()=>{const _0x39f971=_0x32d319;_0x41fc9d[_0x39f971(0xf4)](_0x39f971(0xf2)),_0x1a8a4b(new Error(_0x4c7a74+('\x20timed\x20o'+_0x39f971(0x130)+'\x20')+_0x296d00+'ms'));},_0x296d00);_0x41fc9d[_0x32d319(0x10b)]['on'](_0x32d319(0xe2),_0x408546=>{_0x1734c9+=_0x408546['toString']();}),_0x41fc9d[_0x32d319(0xed)]['on']('data',_0xb3cf4f=>{const _0x549570=_0x32d319;_0x1f29b8+=_0xb3cf4f[_0x549570(0xf5)]();}),_0x41fc9d['on']('error',_0x2869ea=>{clearTimeout(_0x4312f0),_0x1a8a4b(_0x2869ea);}),_0x41fc9d['on'](_0x32d319(0x11c),_0x2d40fd=>{const _0x4876de=_0x32d319;clearTimeout(_0x4312f0);if(_0x2d40fd===0x0)_0x1043fe({'stdout':_0x1734c9,'stderr':_0x1f29b8,'code':_0x2d40fd});else _0x1a8a4b(new Error(_0x4c7a74+(_0x4876de(0x121)+_0x4876de(0xf1)+'e\x20')+_0x2d40fd+':\x20'+(_0x1f29b8||_0x1734c9)));});});}async function downloadFile(_0x3d0e62,_0xe8d8ff){await mkdir(dirname(_0xe8d8ff),{'recursive':!![]});const _0x349926=await new Promise((_0x4574c6,_0x2d48be)=>{const _0x3d67dc=_0x28a3,_0x2ae314=get(_0x3d0e62,_0x5dceeb=>{const _0x54c19b=_0x28a3;if([0x12d,0x12e,0x12f,0x133,0x134][_0x54c19b(0xe6)](_0x5dceeb[_0x54c19b(0x125)+'de']||0x0)&&_0x5dceeb[_0x54c19b(0xe1)][_0x54c19b(0x110)]){_0x5dceeb[_0x54c19b(0x12c)](),downloadFile(new URL(_0x5dceeb[_0x54c19b(0xe1)][_0x54c19b(0x110)],_0x3d0e62)[_0x54c19b(0xeb)],_0xe8d8ff)[_0x54c19b(0x108)](()=>_0x4574c6(null))[_0x54c19b(0x127)](_0x2d48be);return;}if((_0x5dceeb[_0x54c19b(0x125)+'de']||0x0)>=0x190){_0x5dceeb[_0x54c19b(0x12c)](),_0x2d48be(new Error('download'+_0x54c19b(0x121)+_0x5dceeb['statusCo'+'de']+':\x20'+_0x3d0e62));return;}_0x4574c6(_0x5dceeb);});_0x2ae314['on'](_0x3d67dc(0xdd),_0x2d48be);});if(!_0x349926)return;await pipeline(_0x349926,createWriteStream(_0xe8d8ff));}async function findRuntimeKdocsCliBin(_0x3c4e64){const _0x2eb8ae=_0x25c9b9,_0x1c968d=join(_0x3c4e64['openclaw'+_0x2eb8ae(0x11f)+'ir'],_0x2eb8ae(0x11e),_0x2eb8ae(0xc8)+'i'),_0x3a968b=join(_0x1c968d,process[_0x2eb8ae(0x124)]===_0x2eb8ae(0xe5)?_0x2eb8ae(0xc8)+_0x2eb8ae(0x109):_0x2eb8ae(0xc8)+'i');return{'installDir':_0x1c968d,'binPath':existsSync(_0x3a968b)?_0x3a968b:null};}export async function resolveRuntimeKdocsCliCommand(_0x58042e){const _0x5e1005=_0x25c9b9,{installDir:_0x2151f8,binPath:_0x309c11}=await findRuntimeKdocsCliBin(_0x58042e);if(!_0x309c11||!existsSync(_0x309c11))throw new Error(_0x5e1005(0x105)+_0x5e1005(0xc8)+'i\x20is\x20mis'+_0x5e1005(0xc9)+_0x5e1005(0x123)+'aw\x20runti'+'me:\x20'+_0x2151f8+(_0x5e1005(0xe9)+_0x5e1005(0x116)+_0x5e1005(0x118)+_0x5e1005(0xde)+_0x5e1005(0xc7)+_0x5e1005(0x112)+_0x5e1005(0xee)));return{'executablePath':_0x309c11,'installDir':_0x2151f8};}function toKdocsCliPlatform(_0x31e22f){const _0x47721f=_0x25c9b9;if(_0x31e22f==='win32')return _0x47721f(0xcc);return _0x31e22f;}function toKdocsCliArch(_0x3bdef5){const _0x5cf53b=_0x25c9b9;if(_0x3bdef5===_0x5cf53b(0xf8))return'amd64';return _0x3bdef5;}async function resolveKdocsSkillVersion(_0x4f85e5){const _0x5f1c60=_0x25c9b9,_0x559371=_0x4f85e5[_0x5f1c60(0xd9)][_0x5f1c60(0x117)+_0x5f1c60(0xd7)+_0x5f1c60(0x11d)]??[],_0x43e092=[];for(const _0xefbfd8 of _0x559371){if(!existsSync(_0xefbfd8))continue;_0x43e092[_0x5f1c60(0x12f)](join(_0xefbfd8,'SKILL.md')),_0x43e092[_0x5f1c60(0x12f)](...(await readdir(_0xefbfd8,{'withFileTypes':!![]}))[_0x5f1c60(0x10e)](_0x528ac0=>_0x528ac0[_0x5f1c60(0x122)+_0x5f1c60(0xce)]())[_0x5f1c60(0xff)](_0x1c50a7=>join(_0xefbfd8,_0x1c50a7[_0x5f1c60(0xcf)],_0x5f1c60(0xea))));}for(const _0x30665 of _0x43e092){if(!existsSync(_0x30665))continue;const _0x69c7e7=await readFile(_0x30665,_0x5f1c60(0x107));if(!/^name:\s*kdocs\s*$/m[_0x5f1c60(0xca)](_0x69c7e7))continue;const _0x4e2426=_0x69c7e7['match'](/^version:\s*"?([^"\s]+)"?\s*$/m);if(_0x4e2426?.[0x1])return _0x4e2426[0x1];}throw new Error(_0x5f1c60(0x128)+_0x5f1c60(0x102)+_0x5f1c60(0xe4)+_0x5f1c60(0xe7)+'rsion\x20fr'+'om\x20'+_0x559371[_0x5f1c60(0xe8)](',\x20'));}export async function hasConfiguredKdocsSkill(_0x96d43f){const _0x14b0f3=_0x25c9b9,_0x398416=_0x96d43f[_0x14b0f3(0xd9)][_0x14b0f3(0x117)+'LocalSki'+_0x14b0f3(0x11d)]??[],_0x20c7c5=[];for(const _0x21a0f4 of _0x398416){if(!existsSync(_0x21a0f4))continue;_0x20c7c5[_0x14b0f3(0x12f)](join(_0x21a0f4,_0x14b0f3(0xea))),_0x20c7c5['push'](...(await readdir(_0x21a0f4,{'withFileTypes':!![]}))[_0x14b0f3(0x10e)](_0x37adff=>_0x37adff['isDirect'+_0x14b0f3(0xce)]())[_0x14b0f3(0xff)](_0x5f3549=>join(_0x21a0f4,_0x5f3549[_0x14b0f3(0xcf)],_0x14b0f3(0xea))));}for(const _0xa51a24 of _0x20c7c5){if(!existsSync(_0xa51a24))continue;const _0x192e0b=await readFile(_0xa51a24,_0x14b0f3(0x107));if(/^name:\s*kdocs\s*$/m[_0x14b0f3(0xca)](_0x192e0b))return!![];}return![];}function _0x2606(){const _0x21f6b4=['me.','label','trim','with\x20cod','SIGTERM','ignore','kill','toString','\x20not\x20fou','y\x20instal','x64','1949814yYZbcg','replace','2076616qQvrSH','extract\x20','scdn.cn/','timeoutM','map','8873370MecCGP','ct-','o\x20resolv','ld_proce','time]\x20do','Bundled\x20','.cache','utf8','then','i.exe','24694EpFSky','stdout','1650190KTPzkD','pid','filter','.source','location','oot','he\x20runti','skillhub','nd\x20in\x20ar','env','ujie-she','resolved','ll\x20prepa','[wujie-s','wnloadin','.zip','close','llPaths','tools','WorkingD','ell-runt','\x20failed\x20','isDirect','m\x20OpenCl','platform','statusCo','1232964RIoVGu','catch','Unable\x20t','log','ime\x0a','/pro','resume','4004onCkxd','runtimeL','push','ut\x20after','runtimeR','14pzPqdu','ebuild\x20t','kdocs-cl','sing\x20fro','test','ogger','windows','info','ory','name','.kdocs-c','pipe','chive:\x20','10XVRPoW','https://','now','tar','LocalSki','-xzf','openclaw','led','version','.tar.gz','error','re\x22\x20to\x20r','wujie-sh','wpsai.wp','headers','data','endsWith','e\x20kdocs\x20','win32','includes','skill\x20ve','join','.\x20Run\x20\x22w','SKILL.md','href','arch','stderr'];_0x2606=function(){return _0x21f6b4;};return _0x2606();}export const __test__={'hasConfiguredKdocsSkill':hasConfiguredKdocsSkill,'resolveKdocsSkillVersion':resolveKdocsSkillVersion};function findFileByName(_0xada05b,_0x466f50){const _0x4ed706=_0x25c9b9;if(!existsSync(_0xada05b))return null;for(const _0x158f56 of readdirSync(_0xada05b,{'withFileTypes':!![]})){const _0x247481=join(_0xada05b,_0x158f56[_0x4ed706(0xcf)]);if(_0x158f56[_0x4ed706(0x122)+_0x4ed706(0xce)]()){const _0x232660=findFileByName(_0x247481,_0x466f50);if(_0x232660)return _0x232660;continue;}if(_0x158f56['isFile']()&&_0x158f56['name']===_0x466f50)return _0x247481;}return null;}export async function installKdocsCliBinary(_0x4847ac,_0x339ed1,_0x531b50={}){const _0x5eaae9=_0x25c9b9,_0x3de4e0=await resolveKdocsSkillVersion(_0x4847ac),_0xe59394=toKdocsCliPlatform(process[_0x5eaae9(0x124)]),_0x1809bd=toKdocsCliArch(process[_0x5eaae9(0xec)]),_0x20e0fc=process[_0x5eaae9(0x124)]===_0x5eaae9(0xe5)?_0x5eaae9(0xc8)+'i.exe':_0x5eaae9(0xc8)+'i',_0x72a888=join(_0x339ed1['openclaw'+'WorkingD'+'ir'],_0x5eaae9(0x11e),_0x5eaae9(0xc8)+'i'),_0x12e212=join(_0x72a888,_0x20e0fc);if(existsSync(_0x12e212))try{const _0x34ee27=(await runProcess(_0x12e212,[_0x5eaae9(0xdb)],{'label':_0x5eaae9(0xc8)+'i\x20versio'+'n','timeoutMs':0x7530}))['stdout'][_0x5eaae9(0xf0)]();if(_0x34ee27===_0x3de4e0){_0x531b50[_0x5eaae9(0x12e)+_0x5eaae9(0xcb)]?.[_0x5eaae9(0xcd)](_0x5eaae9(0xc8)+'i\x20alread'+_0x5eaae9(0xf7)+_0x5eaae9(0xda),{'version':_0x3de4e0,'installDir':_0x72a888});return;}}catch{}const _0x286032=_0xe59394===_0x5eaae9(0xcc)?'.zip':_0x5eaae9(0xdc),_0x2b904b='kdocs-cl'+'i-'+_0x3de4e0+'-'+_0xe59394+'-'+_0x1809bd+_0x286032,_0x14e42a=join(_0x339ed1['runtimeR'+_0x5eaae9(0x111)],_0x5eaae9(0x106)),_0xa2e80b=join(_0x14e42a,_0x2b904b),_0x20959a=join(_0x339ed1[_0x5eaae9(0xc5)+_0x5eaae9(0x111)],_0x5eaae9(0xd0)+'li-extra'+_0x5eaae9(0x101)+process[_0x5eaae9(0x10d)]+'-'+Date[_0x5eaae9(0xd5)]()),_0x2ab62c=KDOCS_CLI_CDN_BASE+'/v'+_0x3de4e0+('/release'+'s/')+_0x2b904b;await mkdir(_0x14e42a,{'recursive':!![]});!existsSync(_0xa2e80b)&&(console[_0x5eaae9(0x129)](_0x5eaae9(0x119)+'hell:run'+_0x5eaae9(0x104)+_0x5eaae9(0x11a)+'g\x20'+_0x2ab62c),await downloadFile(_0x2ab62c,_0xa2e80b));await rm(_0x20959a,{'recursive':!![],'force':!![]}),await mkdir(_0x20959a,{'recursive':!![]});_0xa2e80b[_0x5eaae9(0xe3)](_0x5eaae9(0x11b))?await runProcess('unzip',['-q',_0xa2e80b,'-d',_0x20959a],{'label':_0x5eaae9(0xfc)+_0x2b904b}):await runProcess(_0x5eaae9(0xd6),[_0x5eaae9(0xd8),_0xa2e80b,'-C',_0x20959a],{'label':_0x5eaae9(0xfc)+_0x2b904b});const _0x85df3c=findFileByName(_0x20959a,_0x20e0fc);if(!_0x85df3c)throw new Error(_0x5eaae9(0xc8)+'i\x20binary'+_0x5eaae9(0xf6)+_0x5eaae9(0x114)+_0x5eaae9(0xd2)+_0x2b904b);await rm(_0x72a888,{'recursive':!![],'force':!![]}),await mkdir(_0x72a888,{'recursive':!![]}),await cp(_0x85df3c,_0x12e212);if(process[_0x5eaae9(0x124)]!==_0x5eaae9(0xe5))await chmod(_0x12e212,0x1ed);await writeFile(join(_0x72a888,_0x5eaae9(0x10f)),_0x5eaae9(0xdf)+_0x5eaae9(0x120)+_0x5eaae9(0x12a),_0x5eaae9(0x107)),await rm(_0x20959a,{'recursive':!![],'force':!![]}),_0x531b50[_0x5eaae9(0x12e)+_0x5eaae9(0xcb)]?.[_0x5eaae9(0xcd)](_0x5eaae9(0xc8)+'i\x20instal'+_0x5eaae9(0xda),{'version':_0x3de4e0,'installDir':_0x72a888,'binPath':_0x12e212});}
|