cc-ding 0.0.2 → 0.0.4
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/LICENSE +21 -0
- package/README.md +103 -97
- package/dist/bin/cc-ding.js +1 -1
- package/dist/src/biz/api-key-manager.js +1 -1
- package/dist/src/biz/cc-ding-cli.js +1 -1
- package/dist/src/biz/claude-process.js +1 -1
- package/dist/src/biz/commands.js +1 -1
- package/dist/src/biz/cron.js +1 -1
- package/dist/src/biz/doctor.js +1 -1
- package/dist/src/biz/image.js +1 -1
- package/dist/src/biz/lock.js +1 -1
- package/dist/src/biz/messaging.js +1 -1
- package/dist/src/biz/quote.js +1 -1
- package/dist/src/biz/session.js +1 -1
- package/dist/src/biz/task.js +1 -1
- package/dist/src/biz/types.js +1 -1
- package/dist/src/common.js +1 -1
- package/dist/src/constants.js +1 -1
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a2_0x5caa(_0x380e5a,_0x3075ae){_0x380e5a=_0x380e5a-0xb3;const _0x1fc877=a2_0x1fc8();let _0x5caa74=_0x1fc877[_0x380e5a];return _0x5caa74;}function a2_0x1fc8(){const _0x432de4=['taskHandlerCount','formatConversationInfo','scheduleApiKeyCfgDailyReset','-\x20**dingToken:**\x20','),\x20发送者=','🧹\x20缓存清理完成','删除定时任务\x20','platform','787413vNXBUo','⚠️\x20无法解析手机号:\x20','getCommandByName','child_process','debug','message','user','config','resolveAllPhonesInConfig','markdown','switchToSession','❌\x20文件创建失败:\x20`','delete','❌\x20未找到定时任务:\x20','resolveUserId','parseVersionCommand','❌\x20未找到名为\x20**','toggleJob','DEFAULT_TASK_HANDLER_COUNT','❌\x20未找到命令:\x20**','splice','sessionDir','log','loadActiveSessions','检测到引用消息:\x20quoteMessageId=','📋\x20**当前群白名单**\x0a','\x0a⚠️\x20错误:\x20','sendCronNoNotifyError','未找到定时任务:\x20','resetTime','❌\x20路径已存在但不是文件:\x20`','3337808zsmziJ','fetchQuotedMessage','cronExpression','saveClientConfig','endSession','\x0a💡\x20可编辑\x20config.json\x20补充更多配置','parseContinueSessionCommand','(无历史数据)','formatCronJobInfo','✅\x20已移除\x20','addJob','sanitizeLogContent','activeSessions','▶️\x20定时任务\x20**','✅\x20定时任务\x20**','pause','get','⚠️\x20当前无活跃会话或暂无日志','interruptClaudeProcess','folder','⚠️\x20图片下载失败,请重试或使用文字描述','**\x0a\x0a💡\x20输入\x20`/help`\x20查看所有可用命令','✅\x20目录创建成功:\x20`','列出\x20','-\x20**linkConversationId:**\x20','parseMkdirCommand','saveTask','pictureDownloadCode','\x20行日志:\x0a```\x0a','handleRmCommand','clientId','socketCallBackResponse','isArray','(空,使用全局白名单)','resetApiKeyCfg','findIndex','replace','sendDingMessage','runTaskHandlerLoop','executeClaudeQuery','analyzeAndCreate','###\x20💬\x20当前会话信息\x0a','handleMkdirCommand','key','rmSync','Error:\x20DingStreamClient\x20init\x20failed.','content','exit','❌\x20路径不能使用绝对路径(不能以\x20/\x20开头)','test','registerCallbackListener','⚠️\x20','processRichTextMessage','handleCronCommand','5fQxdPE','./commands','\x0a-\x20重置时间:\x20','claudeSettings','getOwnPropertyNames','unlinkSync','parseResetApiKeyCfgCommand','run','parseTaskCancelCommand','/session.log','⚠️\x20该群未注册,请先使用\x20`/reg`\x20命令注册','/cron\x20delete\x20','startupCheck','conversationTitle','resume',',\x20内容=','❌\x20定时任务分析失败:\x20','588572QntvTd','DingStreamClient','useLocalOcr','getConversationDir','imagesDeleted','./session','YYYY-MM-DD\x20HH:mm:ss','conversations','conversationId','getActiveSessionsFile','/cron\x20','__importDefault','countTodoTask','parseLsCommand','dingToken','抱歉,您暂无使用权限,请联系应用机器人owner授权...','Fatal\x20error','),\x20类型=','formatTaskInfo','isDirectory','getOwnPropertyDescriptor','-\x20任务目录:\x20','userIdToPhone','isValid','explorer\x20\x22','formatSessionInfo','statSync','\x20到当前群白名单\x0a当前白名单:\x20','apiKeyCfg','cancelTask','❌\x20路径不存在:\x20`','defineProperty','hashConversationId','getClientConfig','isOwner','parseTouchCommand','hasNotifyCapability','robot','未注册的机器人,群:','💻\x20已在终端中打开:\x0a```\x0a','❌\x20目录创建失败:\x20`','📂\x20已在文件管理器中打开:\x0a```\x0a','configurable','saveActiveSession','finishTask',']\x20启动任务处理器\x20#','恢复定时任务\x20','prototype','open\x20-a\x20Terminal\x20\x22','findSubdirByName','clientSecret','botMsgGetCallback','join','**版本:**\x20','-\x20**群ID:**\x20','955759xtGYrq','create_nl','-\x20**群名称:**\x20','list','parseClaudeStreamLine','format','robotCode','conversationConfig','input','cronEngine','prompt','\x0a```','root','map','910874iJSYPJ','all','📋\x20最近\x20','tasksDeleted','utf-8','/session.json','parseRegCommand','linkConversationId','findHistorySession',',\x20会话ID=','❌\x20路径超出工作目录范围','❌\x20无效的cron表达式:\x20`','parseAuthCommand','✅\x20已添加\x20','job','getConversationConfig','picture','error','updateSessionFile','./messaging','richText','sessionsDeleted','isValidCronExpression','创建定时任务:\x20','✅\x20apiKeyCfg\x20已重置\x0a-\x20有效\x20Key\x20数:\x20','⚠️\x20文件已存在:\x20`','getSessionDir','DingClaude','handleTask','formatHelpOverview','catch',']\x20注册新群:\x20','\x20错误:','./image','parseCleanCommand','/task\x20','isFile','cleanCache','getOrCreateLogSession','formatPromptWithQuote','type','getPkgVersion','###\x20📝\x20任务队列信息\x0a','appendSessionLog','parseCommandHelp','whiteUserList','...','../','handleSessionMessage','timestamp','⚠️\x20目录已存在:\x20`','`\x0a\x0a💡\x20格式:\x20`分\x20时\x20日\x20月\x20周`,如\x20`0\x209\x20*\x20*\x20*`','quoteMessageId','authCheck','create','isMobile','projUtil','⚠️\x20未找到已结束的会话','existsSync',')...','**\x20的目录','handleTouchCommand','dingStreamClient',':\x20`','text','quoteText','findActiveSession','session','getDirectoryStructure','CronEngine','✅\x20已删除','-\x20图片文件:\x20','call','staffId','resolvedPhones','📂\x20',']\x20群配置:\x20','\x20已在当前群白名单中','当前工作目录','DEFAULT_SESSION_MAX_CONCURRENCY','assistant','❌\x20当前群未配置\x20dingToken\x20且无客户端级\x20defaultDingToken,\x20定时任务无法主动发送消息,\x20请联系管理员配置','/cron\x20pause\x20','resolveToUserId','`\x0a原因:\x20','filter','resolve','\x0a\x0a💡\x20你也可以直接指定cron表达式:\x20`/cron\x200\x209\x20*\x20*\x20*\x20任务描述`','hasOwnProperty','parseCronCommand','utils-ok','writeFileSync',']\x20任务处理器数量:\x20','add','requireOwner','1533078EeuaPy','getSessionId','❌\x20路径已存在但不是目录:\x20`','930518wQcHgi','some','trim','extractQuoteInfo','抱歉,该群的机器人未在服务端注册,请联系应用机器人owner注册(','writable','/cron\x20list','startNewSession','getSessionsDir','default','收到新会话命令,结束旧会话:\x20群=','getTasksDir','\x20个定时任务','⚠️\x20未配置\x20apiKeyCfg,无需重置','###\x20🤖\x20群配置信息\x0a','stringify','push','substring','-\x20**dingToken:**\x20(未指定,\x20使用\x20defaultDingToken)','mtime','errors','❌\x20删除失败:\x20`','mkdirSync','resolveAndValidatePath','/v1.0/im/bot/messages/get','darwin','./claude-process','\x0a当前白名单:\x20','-\x20**whiteUserList:**\x20','暂停定时任务\x20','description','length','parseInfoCommand','debugLog','readSessionLogTail','✅\x20群已注册','./cron','\x20不在当前群白名单中','parseLogCommand','dateUtil','-\x20会话目录:\x20','⏳\x20正在分析定时任务描述...','任务处理器\x20#','startsWith'];a2_0x1fc8=function(){return _0x432de4;};return a2_0x1fc8();}const a2_0x3b619c=a2_0x5caa;(function(_0xccd488,_0x55dbf5){const _0x319e9b=a2_0x5caa,_0x54f633=_0xccd488();while(!![]){try{const _0x1a8043=parseInt(_0x319e9b(0x121))/0x1+parseInt(_0x319e9b(0xbf))/0x2+-parseInt(_0x319e9b(0x155))/0x3+parseInt(_0x319e9b(0x1bb))/0x4*(-parseInt(_0x319e9b(0x1aa))/0x5)+parseInt(_0x319e9b(0x11e))/0x6+-parseInt(_0x319e9b(0x1f2))/0x7+-parseInt(_0x319e9b(0x174))/0x8;if(_0x1a8043===_0x55dbf5)break;else _0x54f633['push'](_0x54f633['shift']());}catch(_0x853c32){_0x54f633['push'](_0x54f633['shift']());}}}(a2_0x1fc8,0xa58cb));var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0xfa50f9,_0x180f97,_0x2acf12,_0x392e57){const _0x1b678e=a2_0x5caa;if(_0x392e57===undefined)_0x392e57=_0x2acf12;var _0xbb27a6=Object[_0x1b678e(0x1cf)](_0x180f97,_0x2acf12);(!_0xbb27a6||(_0x1b678e(0x184)in _0xbb27a6?!_0x180f97['__esModule']:_0xbb27a6[_0x1b678e(0x126)]||_0xbb27a6[_0x1b678e(0x1e5)]))&&(_0xbb27a6={'enumerable':!![],'get':function(){return _0x180f97[_0x2acf12];}}),Object[_0x1b678e(0x1da)](_0xfa50f9,_0x392e57,_0xbb27a6);}:function(_0x4fb997,_0x103496,_0x1b36e9,_0x3d65b4){if(_0x3d65b4===undefined)_0x3d65b4=_0x1b36e9;_0x4fb997[_0x3d65b4]=_0x103496[_0x1b36e9];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a2_0x3b619c(0xf5)]?function(_0x2ffbfa,_0x48cb43){const _0x5e53c7=a2_0x3b619c;Object[_0x5e53c7(0x1da)](_0x2ffbfa,_0x5e53c7(0x12a),{'enumerable':!![],'value':_0x48cb43});}:function(_0x1d44a7,_0x5d70ce){const _0x4534e5=a2_0x3b619c;_0x1d44a7[_0x4534e5(0x12a)]=_0x5d70ce;}),__importStar=this&&this['__importStar']||(function(){var _0x58909a=function(_0x2ccd77){const _0x4531ff=a2_0x5caa;return _0x58909a=Object[_0x4531ff(0x1ae)]||function(_0x4433b5){const _0x3f2ffc=_0x4531ff;var _0xd51ec1=[];for(var _0x360dcb in _0x4433b5)if(Object[_0x3f2ffc(0x1ea)][_0x3f2ffc(0x117)][_0x3f2ffc(0x107)](_0x4433b5,_0x360dcb))_0xd51ec1[_0xd51ec1[_0x3f2ffc(0x140)]]=_0x360dcb;return _0xd51ec1;},_0x58909a(_0x2ccd77);};return function(_0x2bb738){const _0xcd66c0=a2_0x5caa;if(_0x2bb738&&_0x2bb738['__esModule'])return _0x2bb738;var _0xe920fe={};if(_0x2bb738!=null){for(var _0x4256cd=_0x58909a(_0x2bb738),_0xa7d139=0x0;_0xa7d139<_0x4256cd[_0xcd66c0(0x140)];_0xa7d139++)if(_0x4256cd[_0xa7d139]!==_0xcd66c0(0x12a))__createBinding(_0xe920fe,_0x2bb738,_0x4256cd[_0xa7d139]);}return __setModuleDefault(_0xe920fe,_0x2bb738),_0xe920fe;};}()),__importDefault=this&&this[a2_0x3b619c(0x1c6)]||function(_0x43c07b){return _0x43c07b&&_0x43c07b['__esModule']?_0x43c07b:{'default':_0x43c07b};};Object[a2_0x3b619c(0x1da)](exports,'__esModule',{'value':!![]}),exports[a2_0x3b619c(0xda)]=void 0x0;const utils_ok_1=require(a2_0x3b619c(0x119)),fs_1=__importDefault(require('fs')),path_1=__importDefault(require('path')),common_1=require('../common'),quote_1=require('./quote'),messaging_1=require(a2_0x3b619c(0xd2)),image_1=require(a2_0x3b619c(0xe0)),commands_1=require(a2_0x3b619c(0x1ab)),messaging_2=require(a2_0x3b619c(0xd2)),claude_process_1=require(a2_0x3b619c(0x13b)),session_1=require(a2_0x3b619c(0x1c0)),task_1=require('./task'),api_key_manager_1=require('./api-key-manager'),cron_1=require(a2_0x3b619c(0x145)),TOOL_VERSION=(0x0,common_1[a2_0x3b619c(0xf7)])()[a2_0x3b619c(0xe8)]();class DingClaude{constructor(_0x4ee11c){const _0x4a70e2=a2_0x3b619c;this[_0x4a70e2(0x109)]={},this[_0x4a70e2(0x180)]=new Map(),this[_0x4a70e2(0x10e)]=0x5,this[_0x4a70e2(0x167)]=0x1,this['DEFAULT_TASK_QUEUE_SIZE']=0x32,this[_0x4a70e2(0x199)]=_0x8bd833=>(0x0,messaging_2[_0x4a70e2(0x199)])(this,_0x8bd833),this['sendClaudeResponseToDing']=(_0x31a9cb,_0x4cbc51,_0x16759a,_0x1118a7)=>(0x0,messaging_2['sendClaudeResponseToDing'])(this,_0x31a9cb,_0x4cbc51,_0x16759a,_0x1118a7),this[_0x4a70e2(0xb5)]=claude_process_1[_0x4a70e2(0xb5)],this[_0x4a70e2(0x186)]=(_0xe25e2f,_0x5a0174)=>(0x0,claude_process_1[_0x4a70e2(0x186)])(_0xe25e2f,_0x5a0174),this[_0x4a70e2(0x19b)]=(_0x190572,_0x5e6bd3,_0x52b6b3)=>(0x0,claude_process_1[_0x4a70e2(0x19b)])(this,_0x190572,_0x5e6bd3,_0x52b6b3),this['getClientDir']=()=>(0x0,session_1['getClientDir'])(this),this[_0x4a70e2(0x1dc)]=()=>(0x0,session_1[_0x4a70e2(0x1dc)])(this),this[_0x4a70e2(0xf4)]=(_0x35a687,_0x9a209a)=>(0x0,session_1[_0x4a70e2(0xf4)])(this,_0x35a687,_0x9a209a),this[_0x4a70e2(0x1dd)]=_0x56b74f=>(0x0,session_1['isOwner'])(this,_0x56b74f),this[_0x4a70e2(0x142)]=(_0x477b14,..._0x3fe928)=>(0x0,session_1[_0x4a70e2(0x142)])(this,_0x477b14,..._0x3fe928),this[_0x4a70e2(0x1db)]=_0x431883=>(0x0,session_1['hashConversationId'])(this,_0x431883),this[_0x4a70e2(0xce)]=_0x5df623=>(0x0,session_1[_0x4a70e2(0xce)])(this,_0x5df623),this[_0x4a70e2(0x1be)]=_0x66b36=>(0x0,session_1[_0x4a70e2(0x1be)])(this,_0x66b36),this['getSessionsDir']=_0x2110df=>(0x0,session_1[_0x4a70e2(0x129)])(this,_0x2110df),this[_0x4a70e2(0x12c)]=_0x438177=>(0x0,session_1['getTasksDir'])(this,_0x438177),this[_0x4a70e2(0xd9)]=_0x527c65=>(0x0,session_1[_0x4a70e2(0xd9)])(this,_0x527c65),this[_0x4a70e2(0x11f)]=session_1[_0x4a70e2(0x11f)],this['formatSessionInfo']=_0xee5685=>(0x0,session_1[_0x4a70e2(0x1d4)])(this,_0xee5685),this[_0x4a70e2(0x143)]=(_0x60679e,_0x3b1fed)=>(0x0,session_1[_0x4a70e2(0x143)])(this,_0x60679e,_0x3b1fed),this[_0x4a70e2(0x101)]=_0x3efb65=>(0x0,session_1[_0x4a70e2(0x101)])(this,_0x3efb65),this[_0x4a70e2(0xc7)]=(_0x33c3c2,_0x318eee)=>(0x0,session_1['findHistorySession'])(this,_0x33c3c2,_0x318eee),this['findLatestSession']=_0x1368e0=>(0x0,session_1['findLatestSession'])(this,_0x1368e0),this[_0x4a70e2(0xd1)]=(_0x36e89b,_0xa86383)=>(0x0,session_1[_0x4a70e2(0xd1)])(this,_0x36e89b,_0xa86383),this[_0x4a70e2(0xea)]=session_1[_0x4a70e2(0xea)],this[_0x4a70e2(0x1c4)]=_0x3dd483=>(0x0,session_1[_0x4a70e2(0x1c4)])(this,_0x3dd483),this[_0x4a70e2(0x1e6)]=_0x33226b=>(0x0,session_1[_0x4a70e2(0x1e6)])(this,_0x33226b),this[_0x4a70e2(0x16c)]=()=>(0x0,session_1[_0x4a70e2(0x16c)])(this),this[_0x4a70e2(0x178)]=(_0x16bdf7,_0x523c20)=>(0x0,session_1[_0x4a70e2(0x178)])(this,_0x16bdf7,_0x523c20),this['switchToSession']=(_0x3a9454,_0x5597a6,_0x57bf25,_0xc1d372,_0x2dfc8e)=>(0x0,session_1[_0x4a70e2(0x15f)])(this,_0x3a9454,_0x5597a6,_0x57bf25,_0xc1d372,_0x2dfc8e),this['startNewSession']=_0x18ca39=>(0x0,session_1['startNewSession'])(this,_0x18ca39),this[_0x4a70e2(0xef)]=_0x550378=>(0x0,session_1[_0x4a70e2(0xef)])(this,_0x550378),this[_0x4a70e2(0xe4)]=(_0xeb23e7,_0xe3ea2d=!![])=>(0x0,session_1['cleanCache'])(this,_0xeb23e7,_0xe3ea2d),this['formatTaskInfo']=()=>(0x0,task_1[_0x4a70e2(0x1cd)])(this),this[_0x4a70e2(0x1d8)]=(_0x3e5202,_0x3f290c)=>(0x0,task_1[_0x4a70e2(0x1d8)])(this,_0x3e5202,_0x3f290c),this[_0x4a70e2(0x1c7)]=()=>(0x0,task_1[_0x4a70e2(0x1c7)])(this),this['getOneTodoTask']=()=>(0x0,task_1['getOneTodoTask'])(this),this[_0x4a70e2(0x1e7)]=_0x3f72d8=>(0x0,task_1['finishTask'])(this,_0x3f72d8),this['handleTask']=()=>(0x0,task_1[_0x4a70e2(0xdb)])(this),this['runTaskHandlerLoop']=()=>(0x0,task_1['runTaskHandlerLoop'])(this),this['saveTask']=_0x3b3573=>(0x0,task_1[_0x4a70e2(0x18e)])(this,_0x3b3573),this['clientId']=_0x4ee11c,this[_0x4a70e2(0x15c)]=(0x0,session_1['getClientConfig'])(this);try{this[_0x4a70e2(0xfd)]=new utils_ok_1[(_0x4a70e2(0x1bc))]({'clientId':_0x4ee11c,'clientSecret':this[_0x4a70e2(0x15c)][_0x4a70e2(0x1ed)],'keepAlive':!![],'debug':this[_0x4a70e2(0x15c)][_0x4a70e2(0x159)]??![]});}catch(_0x5f58bc){console[_0x4a70e2(0xd0)](_0x4a70e2(0x1a1),_0x5f58bc),process[_0x4a70e2(0x1a3)](0x1);}this[_0x4a70e2(0xba)]=new cron_1[(_0x4a70e2(0x104))](this);}async['requireOwner'](_0x1c21ec,_0x48b556,_0x3e3dd8){const _0x3af8c2=a2_0x3b619c;if(!this['isOwner'](_0x3e3dd8))return await this[_0x3af8c2(0x199)]({'conversationId':_0x1c21ec,'sessionWebhook':_0x48b556,'content':'❌\x20只有机器人\x20owner\x20才能执行此操作','msgType':_0x3af8c2(0x15e)}),![];return!![];}async[a2_0x3b619c(0x1a9)](_0x1ba7b0,_0x22a121){const _0x39aeb3=a2_0x3b619c,{conversationId:_0x5918ab,sessionWebhook:_0x3595d7,senderStaffId:_0x262a8d,senderNick:_0x413746,conversationConfig:_0x19463d}=_0x22a121;switch(_0x1ba7b0[_0x39aeb3(0xe7)]){case _0x39aeb3(0xb4):{const _0x43d33d=await this[_0x39aeb3(0xe5)](_0x5918ab,_0x3595d7,_0x262a8d,_0x413746,_0x19463d,!![]),_0x2172b8=this[_0x39aeb3(0xba)]['listJobs'](_0x5918ab);_0x43d33d['sessionDir']&&(this['appendSessionLog'](_0x43d33d[_0x39aeb3(0x16a)],_0x39aeb3(0x15b),_0x39aeb3(0x127)),this[_0x39aeb3(0xea)](_0x43d33d[_0x39aeb3(0x16a)],_0x39aeb3(0x10f),_0x39aeb3(0x18b)+_0x2172b8['length']+_0x39aeb3(0x12d)));await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':(0x0,cron_1['formatCronJobList'])(_0x2172b8),'msgType':'markdown'});return;}case'delete':{const _0x21108d=this[_0x39aeb3(0xba)]['removeJob'](_0x1ba7b0['id']),_0x20eb73=await this[_0x39aeb3(0xe5)](_0x5918ab,_0x3595d7,_0x262a8d,_0x413746,_0x19463d);_0x20eb73[_0x39aeb3(0x16a)]&&(this[_0x39aeb3(0xea)](_0x20eb73['sessionDir'],_0x39aeb3(0x15b),_0x39aeb3(0x1b5)+_0x1ba7b0['id']),this['appendSessionLog'](_0x20eb73['sessionDir'],_0x39aeb3(0x10f),_0x21108d?_0x39aeb3(0x153)+_0x1ba7b0['id']:'未找到定时任务:\x20'+_0x1ba7b0['id']));await this['sendDingMessage']({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':_0x21108d?_0x39aeb3(0x182)+_0x1ba7b0['id']+'**\x20已删除':'❌\x20未找到定时任务:\x20'+_0x1ba7b0['id'],'msgType':_0x39aeb3(0x15e)});return;}case _0x39aeb3(0x183):{const _0x540710=this[_0x39aeb3(0xba)][_0x39aeb3(0x166)](_0x1ba7b0['id'],![]),_0x4f5b14=await this[_0x39aeb3(0xe5)](_0x5918ab,_0x3595d7,_0x262a8d,_0x413746,_0x19463d);_0x4f5b14['sessionDir']&&(this[_0x39aeb3(0xea)](_0x4f5b14[_0x39aeb3(0x16a)],'user',_0x39aeb3(0x111)+_0x1ba7b0['id']),this[_0x39aeb3(0xea)](_0x4f5b14[_0x39aeb3(0x16a)],'assistant',_0x540710?_0x39aeb3(0x13e)+_0x1ba7b0['id']:'未找到定时任务:\x20'+_0x1ba7b0['id']));await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':_0x540710?'⏸️\x20定时任务\x20**'+_0x1ba7b0['id']+'**\x20已暂停':_0x39aeb3(0x162)+_0x1ba7b0['id'],'msgType':_0x39aeb3(0x15e)});return;}case _0x39aeb3(0x1b8):{const _0x27940=this[_0x39aeb3(0xba)][_0x39aeb3(0x166)](_0x1ba7b0['id'],!![]),_0x19eed6=await this['getOrCreateLogSession'](_0x5918ab,_0x3595d7,_0x262a8d,_0x413746,_0x19463d);_0x19eed6['sessionDir']&&(this[_0x39aeb3(0xea)](_0x19eed6[_0x39aeb3(0x16a)],'user','/cron\x20resume\x20'+_0x1ba7b0['id']),this['appendSessionLog'](_0x19eed6['sessionDir'],_0x39aeb3(0x10f),_0x27940?_0x39aeb3(0x1e9)+_0x1ba7b0['id']:_0x39aeb3(0x171)+_0x1ba7b0['id']));await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':_0x27940?_0x39aeb3(0x181)+_0x1ba7b0['id']+'**\x20已恢复':_0x39aeb3(0x162)+_0x1ba7b0['id'],'msgType':_0x39aeb3(0x15e)});return;}case'create_cron':{if(!(0x0,cron_1[_0x39aeb3(0xd5)])(_0x1ba7b0[_0x39aeb3(0x176)])){await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':_0x39aeb3(0xca)+_0x1ba7b0[_0x39aeb3(0x176)]+_0x39aeb3(0xf2),'msgType':_0x39aeb3(0x15e)});return;}if(!this[_0x39aeb3(0x1df)](_0x22a121[_0x39aeb3(0xb8)])){await this[_0x39aeb3(0x170)](_0x5918ab,_0x3595d7);return;}const _0x32948c=this[_0x39aeb3(0xba)][_0x39aeb3(0x17e)]({'conversationId':_0x5918ab,'cronExpression':_0x1ba7b0[_0x39aeb3(0x176)],'description':this[_0x39aeb3(0x17f)](_0x1ba7b0[_0x39aeb3(0xbb)][_0x39aeb3(0x132)](0x0,0x32)),'prompt':_0x1ba7b0[_0x39aeb3(0xbb)],'senderStaffId':_0x262a8d,'senderNick':_0x413746}),_0x19b96f=await this[_0x39aeb3(0xe5)](_0x5918ab,_0x3595d7,_0x262a8d,_0x413746,_0x19463d);_0x19b96f[_0x39aeb3(0x16a)]&&(this['appendSessionLog'](_0x19b96f['sessionDir'],_0x39aeb3(0x15b),_0x39aeb3(0x1c5)+_0x1ba7b0[_0x39aeb3(0x176)]+'\x20'+this[_0x39aeb3(0x17f)](_0x1ba7b0[_0x39aeb3(0xbb)])),this[_0x39aeb3(0xea)](_0x19b96f[_0x39aeb3(0x16a)],_0x39aeb3(0x10f),_0x39aeb3(0xd6)+_0x32948c['id']+'\x20['+_0x32948c[_0x39aeb3(0x176)]+']\x20'+_0x32948c[_0x39aeb3(0x13f)]));await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':(0x0,cron_1['formatCronJobInfo'])(_0x32948c),'msgType':'markdown'});return;}case _0x39aeb3(0x1f3):{if(!this[_0x39aeb3(0x1df)](_0x22a121[_0x39aeb3(0xb8)])){await this['sendCronNoNotifyError'](_0x5918ab,_0x3595d7);return;}await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':_0x39aeb3(0x14a)});const _0x39723a=await this[_0x39aeb3(0xba)][_0x39aeb3(0x19c)](_0x5918ab,_0x1ba7b0[_0x39aeb3(0xb9)],_0x262a8d,_0x413746),_0x6dfd98=await this['getOrCreateLogSession'](_0x5918ab,_0x3595d7,_0x262a8d,_0x413746,_0x19463d);_0x39723a['job']?(_0x6dfd98[_0x39aeb3(0x16a)]&&(this[_0x39aeb3(0xea)](_0x6dfd98[_0x39aeb3(0x16a)],'user',_0x39aeb3(0x1c5)+this['sanitizeLogContent'](_0x1ba7b0[_0x39aeb3(0xb9)])),this[_0x39aeb3(0xea)](_0x6dfd98['sessionDir'],_0x39aeb3(0x10f),'创建定时任务:\x20'+_0x39723a[_0x39aeb3(0xcd)]['id']+'\x20['+_0x39723a[_0x39aeb3(0xcd)][_0x39aeb3(0x176)]+']\x20'+_0x39723a[_0x39aeb3(0xcd)][_0x39aeb3(0x13f)])),await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':(0x0,cron_1[_0x39aeb3(0x17c)])(_0x39723a[_0x39aeb3(0xcd)]),'msgType':'markdown'})):(_0x6dfd98[_0x39aeb3(0x16a)]&&(this[_0x39aeb3(0xea)](_0x6dfd98[_0x39aeb3(0x16a)],_0x39aeb3(0x15b),_0x39aeb3(0x1c5)+this[_0x39aeb3(0x17f)](_0x1ba7b0[_0x39aeb3(0xb9)])),this[_0x39aeb3(0xea)](_0x6dfd98[_0x39aeb3(0x16a)],_0x39aeb3(0x10f),'定时任务分析失败:\x20'+_0x39723a[_0x39aeb3(0xd0)])),await this[_0x39aeb3(0x199)]({'conversationId':_0x5918ab,'sessionWebhook':_0x3595d7,'content':_0x39aeb3(0x1ba)+_0x39723a[_0x39aeb3(0xd0)]+_0x39aeb3(0x116),'msgType':_0x39aeb3(0x15e)}));return;}}}[a2_0x3b619c(0x17f)](_0x5b70d2){const _0x2b47e3=a2_0x3b619c;return _0x5b70d2[_0x2b47e3(0x198)](/\n/g,'\x5cn')[_0x2b47e3(0x198)](/\r/g,'\x5cr');}async[a2_0x3b619c(0xe5)](_0x1ed7e7,_0x2b0721,_0x2dd5ff,_0x356aee,_0x563817,_0x1a0606=![]){const _0x268acb=a2_0x3b619c,_0x335908=this[_0x268acb(0x101)](_0x1ed7e7);if(_0x335908){const _0x3bc9eb=this[_0x268acb(0xd9)](_0x335908['session'][_0x268acb(0x102)]);return{'sessionDir':_0x3bc9eb,'isNew':![]};}if(_0x1a0606)return{'sessionDir':null,'isNew':![]};const _0x2a969f=Date['now'](),_0x4f432b={'conversationId':_0x1ed7e7,'sessionWebhook':_0x2b0721,'startTime':_0x2a969f,'startTimeStr':utils_ok_1[_0x268acb(0x148)]['mm'](_0x2a969f)['format']('YYYY-MM-DD-HH-mm-ss'),'startStaffId':_0x2dd5ff,'startNickName':'[cron]'+_0x356aee},_0x5c2fb7=this[_0x268acb(0xd9)](_0x4f432b);return fs_1[_0x268acb(0x12a)][_0x268acb(0x137)](_0x5c2fb7,{'recursive':!![]}),fs_1[_0x268acb(0x12a)][_0x268acb(0x11a)](_0x5c2fb7+_0x268acb(0xc4),JSON[_0x268acb(0x130)](_0x4f432b,null,0x2),_0x268acb(0xc3)),fs_1[_0x268acb(0x12a)]['appendFileSync'](_0x5c2fb7+_0x268acb(0x1b3),'['+(0x0,session_1['timestamp'])()+']\x20[SYSTEM]:\x20创建会话用于记录\x20/cron\x20命令操作\x0a',_0x268acb(0xc3)),{'sessionDir':_0x5c2fb7,'isNew':!![]};}['hasNotifyCapability'](_0xdceeb2){const _0x4fbdfb=a2_0x3b619c;return!!(_0xdceeb2[_0x4fbdfb(0x1c9)]||this['config']['defaultDingToken']);}async['sendCronNoNotifyError'](_0x362d27,_0xd122f4){const _0x1d9977=a2_0x3b619c;await this[_0x1d9977(0x199)]({'conversationId':_0x362d27,'sessionWebhook':_0xd122f4,'content':_0x1d9977(0x110),'msgType':_0x1d9977(0x15e)});}[a2_0x3b619c(0x138)](_0x54cd7f,_0x3f494b){const _0x4362bd=a2_0x3b619c,_0x114538=this[_0x4362bd(0x1be)](_0x54cd7f);if(_0x3f494b[_0x4362bd(0x14c)]('/'))return{'absolutePath':'','error':_0x4362bd(0x1a4)};const _0x370dc3=path_1[_0x4362bd(0x12a)]['resolve'](_0x114538,_0x3f494b);if(!_0x370dc3[_0x4362bd(0x14c)](_0x114538))return{'absolutePath':'','error':_0x4362bd(0xc9)};return{'absolutePath':_0x370dc3};}async[a2_0x3b619c(0x19e)](_0x5bb439,_0x203186,_0x460123){const _0x24103a=a2_0x3b619c,{absolutePath:_0x3f8343,error:_0xd81afd}=this[_0x24103a(0x138)](_0x5bb439,_0x460123);if(_0xd81afd){await this[_0x24103a(0x199)]({'conversationId':_0x5bb439,'sessionWebhook':_0x203186,'content':_0xd81afd,'msgType':_0x24103a(0x15e)});return;}try{const _0x35b76a=fs_1['default'][_0x24103a(0x1d5)](_0x3f8343);_0x35b76a[_0x24103a(0x1ce)]()?await this[_0x24103a(0x199)]({'conversationId':_0x5bb439,'sessionWebhook':_0x203186,'content':_0x24103a(0xf1)+_0x460123+'`','msgType':'markdown'}):await this['sendDingMessage']({'conversationId':_0x5bb439,'sessionWebhook':_0x203186,'content':_0x24103a(0x120)+_0x460123+'`','msgType':'markdown'});return;}catch{}try{fs_1[_0x24103a(0x12a)][_0x24103a(0x137)](_0x3f8343,{'recursive':!![]}),await this[_0x24103a(0x199)]({'conversationId':_0x5bb439,'sessionWebhook':_0x203186,'content':_0x24103a(0x18a)+_0x460123+'`','msgType':'markdown'});}catch(_0x17f679){await this[_0x24103a(0x199)]({'conversationId':_0x5bb439,'sessionWebhook':_0x203186,'content':_0x24103a(0x1e3)+_0x460123+_0x24103a(0x113)+(_0x17f679 instanceof Error?_0x17f679[_0x24103a(0x15a)]:String(_0x17f679)),'msgType':_0x24103a(0x15e)});}}async[a2_0x3b619c(0x191)](_0x1a3be0,_0x322843,_0x2357b0){const _0x543300=a2_0x3b619c,{absolutePath:_0x43ff8b,error:_0x22c9ce}=this[_0x543300(0x138)](_0x1a3be0,_0x2357b0);if(_0x22c9ce){await this[_0x543300(0x199)]({'conversationId':_0x1a3be0,'sessionWebhook':_0x322843,'content':_0x22c9ce,'msgType':_0x543300(0x15e)});return;}let _0x475a7a;try{_0x475a7a=fs_1['default'][_0x543300(0x1d5)](_0x43ff8b);}catch{await this[_0x543300(0x199)]({'conversationId':_0x1a3be0,'sessionWebhook':_0x322843,'content':_0x543300(0x1d9)+_0x2357b0+'`','msgType':'markdown'});return;}const _0x2d6517=_0x475a7a[_0x543300(0x1ce)]();try{_0x2d6517?fs_1[_0x543300(0x12a)][_0x543300(0x1a0)](_0x43ff8b,{'recursive':!![],'force':!![]}):fs_1[_0x543300(0x12a)][_0x543300(0x1af)](_0x43ff8b),await this[_0x543300(0x199)]({'conversationId':_0x1a3be0,'sessionWebhook':_0x322843,'content':_0x543300(0x105)+(_0x2d6517?'目录':'文件')+_0x543300(0xfe)+_0x2357b0+'`','msgType':_0x543300(0x15e)});}catch(_0x5ab32b){await this[_0x543300(0x199)]({'conversationId':_0x1a3be0,'sessionWebhook':_0x322843,'content':_0x543300(0x136)+_0x2357b0+'`\x0a原因:\x20'+(_0x5ab32b instanceof Error?_0x5ab32b[_0x543300(0x15a)]:String(_0x5ab32b)),'msgType':_0x543300(0x15e)});}}async[a2_0x3b619c(0xfc)](_0x58a9b3,_0x17516b,_0x4283ab){const _0x49b107=a2_0x3b619c,{absolutePath:_0x266666,error:_0x35b09c}=this['resolveAndValidatePath'](_0x58a9b3,_0x4283ab);if(_0x35b09c){await this[_0x49b107(0x199)]({'conversationId':_0x58a9b3,'sessionWebhook':_0x17516b,'content':_0x35b09c,'msgType':_0x49b107(0x15e)});return;}try{const _0x1fda57=fs_1[_0x49b107(0x12a)][_0x49b107(0x1d5)](_0x266666);_0x1fda57[_0x49b107(0xe3)]()?await this[_0x49b107(0x199)]({'conversationId':_0x58a9b3,'sessionWebhook':_0x17516b,'content':_0x49b107(0xd8)+_0x4283ab+'`\x0a最后修改时间:\x20'+utils_ok_1[_0x49b107(0x148)]['mm'](_0x1fda57[_0x49b107(0x134)])[_0x49b107(0xb6)](_0x49b107(0x1c1)),'msgType':_0x49b107(0x15e)}):await this[_0x49b107(0x199)]({'conversationId':_0x58a9b3,'sessionWebhook':_0x17516b,'content':_0x49b107(0x173)+_0x4283ab+'`','msgType':_0x49b107(0x15e)});return;}catch{}try{const _0x204330=path_1[_0x49b107(0x12a)]['dirname'](_0x266666);fs_1[_0x49b107(0x12a)][_0x49b107(0x137)](_0x204330,{'recursive':!![]}),fs_1[_0x49b107(0x12a)][_0x49b107(0x11a)](_0x266666,'',_0x49b107(0xc3)),await this[_0x49b107(0x199)]({'conversationId':_0x58a9b3,'sessionWebhook':_0x17516b,'content':'✅\x20文件创建成功:\x20`'+_0x4283ab+'`','msgType':_0x49b107(0x15e)});}catch(_0x502120){await this[_0x49b107(0x199)]({'conversationId':_0x58a9b3,'sessionWebhook':_0x17516b,'content':_0x49b107(0x160)+_0x4283ab+_0x49b107(0x113)+(_0x502120 instanceof Error?_0x502120[_0x49b107(0x15a)]:String(_0x502120)),'msgType':_0x49b107(0x15e)});}}async[a2_0x3b619c(0x1ee)](_0x5df50c){const _0x1466a2=a2_0x3b619c;this[_0x1466a2(0xfd)][_0x1466a2(0x193)](_0x5df50c['headers']['messageId'],'');const _0x4974d8=JSON['parse'](_0x5df50c['data']),{senderNick:_0x579306,senderStaffId:_0x251e3e,conversationId:_0x13141d,conversationTitle:_0x470d97,sessionWebhook:_0x295a23,msgtype:_0x556814}=_0x4974d8,_0x6663cd=_0x4974d8[_0x1466a2(0xff)]?.[_0x1466a2(0x1a2)]?.['trim']()??'';this['debugLog']('收到消息:\x20群='+_0x470d97+'('+_0x13141d+_0x1466a2(0x151)+_0x579306+'('+_0x251e3e+_0x1466a2(0x1cc)+_0x556814+_0x1466a2(0x1b9)+_0x6663cd[_0x1466a2(0x132)](0x0,0x32));if(!this[_0x1466a2(0xf4)](_0x251e3e,_0x13141d)){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'atUserId':_0x251e3e,'content':_0x1466a2(0x1ca)});return;}const _0x188bf5=this[_0x1466a2(0xce)](_0x13141d);let _0x16f91d;if(_0x556814===_0x1466a2(0xcf)&&_0x4974d8[_0x1466a2(0x18f)]){const _0x3fe294=this['getConversationDir'](_0x13141d),_0x202093=_0x188bf5?.[_0x1466a2(0x1bd)]!==![],_0x298f31=await(0x0,image_1['processPictureMessage'])(this,_0x4974d8[_0x1466a2(0x18f)],_0x4974d8[_0x1466a2(0xb7)],_0x3fe294,_0x202093,_0x6663cd||undefined);if(!_0x298f31){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'atUserId':_0x251e3e,'content':_0x1466a2(0x188)});return;}_0x16f91d=_0x298f31;}else{if(_0x556814==='richText'&&_0x4974d8[_0x1466a2(0x1a2)]?.['richText']){const _0x4cd13d=this[_0x1466a2(0x1be)](_0x13141d),_0x4d15e4=_0x188bf5?.['useLocalOcr']!==![];_0x16f91d=await(0x0,image_1[_0x1466a2(0x1a8)])(this,_0x4974d8[_0x1466a2(0x1a2)][_0x1466a2(0xd3)],_0x4974d8[_0x1466a2(0xb7)],_0x4cd13d,_0x4d15e4);}else{_0x16f91d=_0x6663cd;if(!_0x16f91d)return;}}if(!_0x16f91d[_0x1466a2(0x14c)]('/')&&_0x556814===_0x1466a2(0xff)){const _0x2b38a8=(0x0,quote_1[_0x1466a2(0x124)])(_0x4974d8);if(_0x2b38a8){this[_0x1466a2(0x142)](_0x1466a2(0x16d)+_0x2b38a8[_0x1466a2(0xf3)]);if(_0x2b38a8[_0x1466a2(0xf3)]&&!_0x2b38a8[_0x1466a2(0x100)]){const _0x420b6f=await(0x0,messaging_1[_0x1466a2(0x175)])(this,_0x2b38a8[_0x1466a2(0xf3)]);if(_0x420b6f)_0x2b38a8['quoteText']=_0x420b6f;}_0x2b38a8['quoteText']&&(_0x16f91d=(0x0,quote_1[_0x1466a2(0xe6)])(_0x16f91d,_0x2b38a8));}}const _0x21dcde=_0x188bf5?null:(0x0,commands_1[_0x1466a2(0xc5)])(_0x16f91d);if(_0x21dcde!==null){if(!await this[_0x1466a2(0x11d)](_0x13141d,_0x295a23,_0x251e3e))return;const _0x2caf53={'conversationId':_0x13141d,'conversationTitle':_0x21dcde[_0x1466a2(0x1b7)]||_0x470d97};if(_0x21dcde[_0x1466a2(0x1c9)])_0x2caf53[_0x1466a2(0x1c9)]=_0x21dcde[_0x1466a2(0x1c9)];if(_0x21dcde['linkConversationId'])_0x2caf53[_0x1466a2(0xc6)]=_0x21dcde[_0x1466a2(0xc6)];if(_0x21dcde['whiteUserList']&&_0x21dcde[_0x1466a2(0xec)]['length']>0x0){_0x2caf53[_0x1466a2(0xec)]=_0x21dcde[_0x1466a2(0xec)];for(const _0x41666a of _0x21dcde[_0x1466a2(0xec)]){(0x0,session_1[_0x1466a2(0xf6)])(_0x41666a)&&await(0x0,session_1[_0x1466a2(0x163)])(this,_0x41666a);}}this[_0x1466a2(0x15c)][_0x1466a2(0x1c2)][_0x1466a2(0x131)](_0x2caf53),(0x0,api_key_manager_1[_0x1466a2(0x177)])(this);const _0x3d9194=[_0x1466a2(0x144),_0x1466a2(0xb3)+(_0x2caf53[_0x1466a2(0x1b7)]||'-'),_0x1466a2(0x1f1)+_0x13141d];if(_0x2caf53[_0x1466a2(0x1c9)])_0x3d9194[_0x1466a2(0x131)](_0x1466a2(0x150)+_0x2caf53['dingToken'][_0x1466a2(0x132)](0x0,0x8)+_0x1466a2(0xed));else _0x3d9194[_0x1466a2(0x131)](_0x1466a2(0x133));if(_0x2caf53['linkConversationId'])_0x3d9194[_0x1466a2(0x131)](_0x1466a2(0x18c)+_0x2caf53[_0x1466a2(0xc6)]);if(_0x2caf53[_0x1466a2(0xec)]?.['length']){const _0x409102=_0x2caf53[_0x1466a2(0xec)][_0x1466a2(0xbe)](_0x33cca7=>{const _0x315db5=_0x1466a2;if((0x0,session_1[_0x315db5(0xf6)])(_0x33cca7))return _0x33cca7;return(0x0,session_1[_0x315db5(0x1d1)])(this,_0x33cca7)||_0x33cca7;})[_0x1466a2(0x1ef)](',\x20');_0x3d9194['push'](_0x1466a2(0x13d)+_0x409102);}_0x3d9194[_0x1466a2(0x131)](_0x1466a2(0x179)),console[_0x1466a2(0x16b)]('['+(0x0,session_1[_0x1466a2(0xf0)])()+_0x1466a2(0xde)+_0x2caf53[_0x1466a2(0x1b7)]+'('+_0x13141d+')'),await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x3d9194[_0x1466a2(0x1ef)]('\x0a'),'msgType':'markdown'});return;}if((0x0,commands_1['parseHelpCommand'])(_0x16f91d)){await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':(0x0,commands_1[_0x1466a2(0xdc)])(TOOL_VERSION,this[_0x1466a2(0x1dd)](_0x251e3e)),'msgType':_0x1466a2(0x15e)});return;}if((0x0,commands_1[_0x1466a2(0x164)])(_0x16f91d)){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x1f0)+TOOL_VERSION,'msgType':_0x1466a2(0x15e)});return;}const _0x58cb03=(0x0,commands_1[_0x1466a2(0xeb)])(_0x16f91d);if(_0x58cb03){const _0x8da2d3=(0x0,commands_1[_0x1466a2(0x157)])(_0x58cb03);_0x8da2d3?await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':(0x0,commands_1['formatCommandHelp'])(_0x8da2d3),'msgType':_0x1466a2(0x15e)}):await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x168)+_0x58cb03+_0x1466a2(0x189),'msgType':_0x1466a2(0x15e)});return;}if(!_0x188bf5){console[_0x1466a2(0x16b)](_0x1466a2(0x1e1)+_0x470d97+','+_0x13141d);this['isOwner'](_0x251e3e)?await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'atUserId':_0x251e3e,'content':_0x1466a2(0x1b4),'msgType':_0x1466a2(0x15e)}):await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'atUserId':_0x251e3e,'content':_0x1466a2(0x125)+_0x13141d+_0x1466a2(0xfa)});return;}const _0x2a0d20=(0x0,commands_1[_0x1466a2(0xe1)])(_0x16f91d);if(_0x2a0d20!==null){if(!await this[_0x1466a2(0x11d)](_0x13141d,_0x295a23,_0x251e3e))return;const _0x1108fa=_0x2a0d20==='all'?null:_0x13141d,_0x55b259=this[_0x1466a2(0xe4)](_0x1108fa,!![]),_0x5f2d77=[];_0x5f2d77[_0x1466a2(0x131)](_0x1466a2(0x152));if(_0x55b259[_0x1466a2(0xd4)]>0x0)_0x5f2d77['push'](_0x1466a2(0x149)+_0x55b259['sessionsDeleted']+'\x20个');if(_0x55b259[_0x1466a2(0xc2)]>0x0)_0x5f2d77['push'](_0x1466a2(0x1d0)+_0x55b259[_0x1466a2(0xc2)]+'\x20个');if(_0x55b259[_0x1466a2(0x1bf)]>0x0)_0x5f2d77[_0x1466a2(0x131)](_0x1466a2(0x106)+_0x55b259['imagesDeleted']+'\x20个');_0x55b259[_0x1466a2(0xd4)]===0x0&&_0x55b259[_0x1466a2(0xc2)]===0x0&&_0x55b259['imagesDeleted']===0x0&&_0x5f2d77[_0x1466a2(0x131)](_0x1466a2(0x17b));_0x5f2d77[_0x1466a2(0x131)]('\x0a💡\x20活跃会话已保留');_0x55b259[_0x1466a2(0x135)]['length']>0x0&&_0x5f2d77['push'](_0x1466a2(0x16f)+_0x55b259['errors'][_0x1466a2(0x1ef)](';\x20'));await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x5f2d77[_0x1466a2(0x1ef)]('\x0a'),'msgType':'markdown'});return;}if((0x0,commands_1[_0x1466a2(0x1b0)])(_0x16f91d)){if(!await this[_0x1466a2(0x11d)](_0x13141d,_0x295a23,_0x251e3e))return;if(!this[_0x1466a2(0x15c)][_0x1466a2(0x1d7)]){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x12e),'msgType':'markdown'});return;}(0x0,api_key_manager_1[_0x1466a2(0x196)])(this);const _0x352627=this[_0x1466a2(0x15c)]['apiKeyCfg'][_0x1466a2(0x1ad)][_0x1466a2(0x114)](_0x76bc8e=>_0x76bc8e[_0x1466a2(0x1d2)])[_0x1466a2(0x140)];await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0xd7)+_0x352627+'/'+this[_0x1466a2(0x15c)]['apiKeyCfg'][_0x1466a2(0x1ad)][_0x1466a2(0x140)]+_0x1466a2(0x1ac)+(this[_0x1466a2(0x15c)][_0x1466a2(0x1d7)][_0x1466a2(0x172)]||'-'),'msgType':_0x1466a2(0x15e)});return;}const _0x6bc5ee=(0x0,commands_1[_0x1466a2(0xcb)])(_0x16f91d);if(_0x6bc5ee){if(!await this[_0x1466a2(0x11d)](_0x13141d,_0x295a23,_0x251e3e))return;const _0x249a38=_0x188bf5[_0x1466a2(0xec)];if(_0x6bc5ee[_0x1466a2(0xe7)]===_0x1466a2(0xb4)){const _0x36a8b7=_0x249a38&&_0x249a38[_0x1466a2(0x140)]>0x0?_0x249a38[_0x1466a2(0xbe)](_0x17da05=>{const _0x52e482=_0x1466a2,_0x32a0f4=(0x0,session_1[_0x52e482(0x1d1)])(this,_0x17da05);return'-\x20'+(_0x32a0f4||_0x17da05);})['join']('\x0a'):'(未配置群级白名单,使用全局白名单)';await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x16e)+_0x36a8b7,'msgType':_0x1466a2(0x15e)});return;}if(_0x6bc5ee['type']===_0x1466a2(0x11c)){let _0x343f3f=_0x6bc5ee[_0x1466a2(0x108)];if((0x0,session_1[_0x1466a2(0xf6)])(_0x6bc5ee[_0x1466a2(0x108)])){_0x343f3f=await(0x0,session_1[_0x1466a2(0x163)])(this,_0x6bc5ee[_0x1466a2(0x108)]);if(!_0x343f3f){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x156)+_0x6bc5ee[_0x1466a2(0x108)],'msgType':_0x1466a2(0x15e)});return;}}const _0x4255a6=_0x249a38?.[_0x1466a2(0x122)](_0x468996=>(0x0,session_1[_0x1466a2(0x112)])(this,_0x468996)===_0x343f3f);if(_0x4255a6){const _0x20750c=(0x0,session_1['userIdToPhone'])(this,_0x343f3f)||_0x343f3f;await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':'⚠️\x20'+_0x20750c+_0x1466a2(0x10c),'msgType':_0x1466a2(0x15e)});return;}!_0x188bf5[_0x1466a2(0xec)]&&(_0x188bf5[_0x1466a2(0xec)]=[]);_0x188bf5['whiteUserList'][_0x1466a2(0x131)](_0x6bc5ee[_0x1466a2(0x108)]),(0x0,api_key_manager_1['saveClientConfig'])(this);const _0x327f33=_0x188bf5['whiteUserList'][_0x1466a2(0xbe)](_0x3b7ff0=>{const _0x3b11df=_0x1466a2,_0x152a82=(0x0,session_1[_0x3b11df(0x112)])(this,_0x3b7ff0);return(0x0,session_1[_0x3b11df(0x1d1)])(this,_0x152a82)||_0x3b7ff0;}),_0x5ee9cb=(0x0,session_1['isMobile'])(_0x6bc5ee[_0x1466a2(0x108)])?_0x6bc5ee[_0x1466a2(0x108)]:(0x0,session_1['userIdToPhone'])(this,_0x6bc5ee[_0x1466a2(0x108)])||_0x6bc5ee[_0x1466a2(0x108)];await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0xcc)+_0x5ee9cb+_0x1466a2(0x1d6)+_0x327f33[_0x1466a2(0x1ef)](',\x20'),'msgType':'markdown'});return;}if(_0x6bc5ee[_0x1466a2(0xe7)]==='del'){let _0x3abcb1=_0x6bc5ee[_0x1466a2(0x108)];if((0x0,session_1[_0x1466a2(0xf6)])(_0x6bc5ee['staffId'])){_0x3abcb1=await(0x0,session_1[_0x1466a2(0x163)])(this,_0x6bc5ee[_0x1466a2(0x108)]);if(!_0x3abcb1){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x156)+_0x6bc5ee[_0x1466a2(0x108)],'msgType':'markdown'});return;}}const _0x4b3ce0=_0x249a38?.[_0x1466a2(0x197)](_0x4fceea=>(0x0,session_1['resolveToUserId'])(this,_0x4fceea)===_0x3abcb1)??-0x1;if(_0x4b3ce0<0x0){const _0x486f86=(0x0,session_1[_0x1466a2(0x1d1)])(this,_0x3abcb1)||_0x3abcb1;await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x1a7)+_0x486f86+_0x1466a2(0x146),'msgType':_0x1466a2(0x15e)});return;}const _0x5b08d7=_0x188bf5[_0x1466a2(0xec)][_0x4b3ce0];_0x188bf5[_0x1466a2(0xec)][_0x1466a2(0x169)](_0x4b3ce0,0x1);_0x188bf5[_0x1466a2(0xec)][_0x1466a2(0x140)]===0x0&&delete _0x188bf5[_0x1466a2(0xec)];(0x0,api_key_manager_1['saveClientConfig'])(this);const _0x4eb888=_0x188bf5[_0x1466a2(0xec)]?.[_0x1466a2(0x140)]?_0x188bf5['whiteUserList'][_0x1466a2(0xbe)](_0x2c197b=>{const _0x5194e2=_0x1466a2,_0x2e5ccd=(0x0,session_1[_0x5194e2(0x112)])(this,_0x2c197b);return(0x0,session_1[_0x5194e2(0x1d1)])(this,_0x2e5ccd)||_0x2c197b;})[_0x1466a2(0x1ef)](',\x20'):_0x1466a2(0x195),_0x52f850=(0x0,session_1[_0x1466a2(0x1d1)])(this,_0x3abcb1)||_0x5b08d7;await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x17d)+_0x52f850+_0x1466a2(0x13c)+_0x4eb888,'msgType':'markdown'});return;}}const _0x2574c0=(0x0,commands_1['parseOpenCommand'])(_0x16f91d);if(_0x2574c0!==null){if(!await this['requireOwner'](_0x13141d,_0x295a23,_0x251e3e))return;const _0x5f2fdc=this['getConversationDir'](_0x13141d),{exec:_0x18c855}=await Promise[_0x1466a2(0x115)]()['then'](()=>__importStar(require(_0x1466a2(0x158)))),_0x41a36b=process[_0x1466a2(0x154)];try{_0x2574c0===_0x1466a2(0x187)?(_0x41a36b===_0x1466a2(0x13a)?_0x18c855('open\x20\x22'+_0x5f2fdc+'\x22'):_0x18c855(_0x1466a2(0x1d3)+_0x5f2fdc+'\x22'),await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x1e4)+_0x5f2fdc+'\x0a```','msgType':_0x1466a2(0x15e)})):(_0x41a36b===_0x1466a2(0x13a)?_0x18c855(_0x1466a2(0x1eb)+_0x5f2fdc+'\x22'):_0x18c855('start\x20cmd\x20/k\x20\x22cd\x20/d\x20'+_0x5f2fdc+'\x22',{'shell':'cmd.exe'}),await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x1e2)+_0x5f2fdc+'\x0a```','msgType':'markdown'}));}catch(_0x14cfaf){await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':'❌\x20打开失败:\x20'+(_0x14cfaf instanceof Error?_0x14cfaf['message']:String(_0x14cfaf)),'msgType':_0x1466a2(0x15e)});}return;}const _0x8bcba4=(0x0,commands_1[_0x1466a2(0x118)])(_0x16f91d);if(_0x8bcba4){await this[_0x1466a2(0x1a9)](_0x8bcba4,{'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'senderStaffId':_0x251e3e,'senderNick':_0x579306,'conversationConfig':_0x188bf5});return;}if((0x0,commands_1['parsePwdCommand'])(_0x16f91d)){const _0xeded1c=this[_0x1466a2(0x1be)](_0x13141d);await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':'📂\x20当前工作目录:\x0a```\x0a'+_0xeded1c+_0x1466a2(0xbc),'msgType':_0x1466a2(0x15e)});return;}const _0x51e016=(0x0,commands_1[_0x1466a2(0x18d)])(_0x16f91d);if(_0x51e016!==null){await this[_0x1466a2(0x19e)](_0x13141d,_0x295a23,_0x51e016);return;}const _0x38b831=(0x0,commands_1[_0x1466a2(0x1de)])(_0x16f91d);if(_0x38b831!==null){await this['handleTouchCommand'](_0x13141d,_0x295a23,_0x38b831);return;}const _0x50c30f=(0x0,commands_1['parseRmCommand'])(_0x16f91d);if(_0x50c30f!==null){await this[_0x1466a2(0x191)](_0x13141d,_0x295a23,_0x50c30f);return;}if(/^\/new(?:\s|$)/i[_0x1466a2(0x1a5)](_0x16f91d)){const _0x5c92a0=this[_0x1466a2(0x101)](_0x13141d);_0x5c92a0&&(console[_0x1466a2(0x16b)](_0x1466a2(0x12b)+_0x5c92a0[_0x1466a2(0x102)]['session'][_0x1466a2(0x1c3)]+_0x1466a2(0xc8)+this[_0x1466a2(0x11f)](_0x5c92a0[_0x1466a2(0x102)][_0x1466a2(0x102)])),this[_0x1466a2(0x186)](_0x5c92a0[_0x1466a2(0x102)],'新会话命令中断正在执行的\x20Claude\x20进程'),this[_0x1466a2(0x180)][_0x1466a2(0x161)](_0x5c92a0[_0x1466a2(0x19f)]),this[_0x1466a2(0x1e6)](_0x5c92a0[_0x1466a2(0x19f)]));const _0x18dee8=_0x16f91d[_0x1466a2(0x198)](/^\/new\s*/i,'')['trim']();_0x18dee8?await this[_0x1466a2(0x128)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'senderStaffId':_0x251e3e,'senderNick':_0x579306,'message':_0x18dee8,'conversationConfig':_0x188bf5}):await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'atUserId':_0x251e3e,'content':'🚀\x20请输入您的问题开始新会话'});return;}const _0x48e94e=(0x0,commands_1[_0x1466a2(0x17a)])(_0x16f91d);if(_0x48e94e!==null&&_0x188bf5){let _0x1bc66d=_0x48e94e;if(!_0x1bc66d){const _0x429c83=(0x0,session_1['findLatestSession'])(this,_0x13141d);if(!_0x429c83){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'atUserId':_0x251e3e,'content':_0x1466a2(0xf8),'msgType':_0x1466a2(0x15e)});return;}_0x1bc66d=(0x0,session_1[_0x1466a2(0x11f)])(_0x429c83);}await this[_0x1466a2(0x15f)](_0x13141d,_0x295a23,_0x1bc66d,_0x251e3e,_0x188bf5);return;}const _0x61ce87=(0x0,commands_1[_0x1466a2(0x147)])(_0x16f91d);if(_0x61ce87!==null){const _0x2a3a85=this[_0x1466a2(0x143)](_0x13141d,_0x61ce87);_0x2a3a85?await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0xc1)+_0x61ce87+_0x1466a2(0x190)+_0x2a3a85+'\x0a```','msgType':'markdown'}):await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x185)});return;}const _0x40eda9=(0x0,commands_1[_0x1466a2(0x141)])(_0x16f91d);if(_0x40eda9!==null){const _0x1cf85d=[];(_0x40eda9===_0x1466a2(0xc0)||_0x40eda9===_0x1466a2(0x1e0))&&_0x1cf85d[_0x1466a2(0x131)](_0x1466a2(0x12f)+(0x0,commands_1[_0x1466a2(0x14e)])(_0x188bf5,_0x13141d,_0x38923c=>(0x0,session_1['userIdToPhone'])(this,_0x38923c)));if(_0x40eda9===_0x1466a2(0xc0)||_0x40eda9===_0x1466a2(0x102)){const _0x238a36=this[_0x1466a2(0x1d4)](_0x13141d);_0x238a36?_0x1cf85d[_0x1466a2(0x131)](_0x1466a2(0x19d)+_0x238a36):_0x1cf85d[_0x1466a2(0x131)]('###\x20💬\x20当前会话信息\x0a无活跃会话');}(_0x40eda9===_0x1466a2(0xc0)||_0x40eda9==='task')&&_0x1cf85d[_0x1466a2(0x131)](_0x1466a2(0xe9)+this[_0x1466a2(0x1cd)]());await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1cf85d['join']('\x0a\x0a'),'msgType':_0x1466a2(0x15e)});return;}const _0x1a5d37=(0x0,commands_1[_0x1466a2(0x1c8)])(_0x16f91d);if(_0x1a5d37!==null){const {target:_0x3d283,depth:_0x371a47}=_0x1a5d37,_0x36437e=this[_0x1466a2(0x1be)](_0x13141d);let _0x2c1f2b=_0x36437e,_0x526bf9=_0x1466a2(0x10d);if(_0x3d283&&_0x3d283!==_0x1466a2(0xbd)){if(_0x3d283[_0x1466a2(0x14c)]('./')||_0x3d283[_0x1466a2(0x14c)](_0x1466a2(0xee))||_0x3d283[_0x1466a2(0x14c)]('/')){const _0xf27882=path_1[_0x1466a2(0x12a)][_0x1466a2(0x115)](_0x36437e,_0x3d283);if(fs_1[_0x1466a2(0x12a)][_0x1466a2(0xf9)](_0xf27882)&&fs_1['default'][_0x1466a2(0x1d5)](_0xf27882)[_0x1466a2(0x1ce)]()){if(!_0xf27882[_0x1466a2(0x14c)](_0x36437e)){await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0xc9),'msgType':_0x1466a2(0x15e)});return;}_0x2c1f2b=_0xf27882,_0x526bf9=_0x3d283;}else{await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':'❌\x20路径不存在或不是目录:\x20**'+_0x3d283+'**','msgType':_0x1466a2(0x15e)});return;}}else{const _0x57fc02=(0x0,commands_1[_0x1466a2(0x1ec)])(_0x36437e,_0x3d283);if(_0x57fc02)_0x2c1f2b=_0x57fc02,_0x526bf9=_0x3d283;else{await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x165)+_0x3d283+_0x1466a2(0xfb),'msgType':_0x1466a2(0x15e)});return;}}}const _0x2261a3=(0x0,commands_1[_0x1466a2(0x103)])(_0x2c1f2b,0x0,_0x371a47);await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1466a2(0x10a)+_0x526bf9+'\x20(展开'+_0x371a47+'层):\x0a```\x0a'+_0x2261a3+_0x1466a2(0xbc),'msgType':_0x1466a2(0x15e)});return;}const _0xd581cb=(0x0,task_1[_0x1466a2(0x1b2)])(_0x16f91d);if(_0xd581cb){const _0x1a2b61=this[_0x1466a2(0x1d8)](_0xd581cb,_0x13141d);await this[_0x1466a2(0x199)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'content':_0x1a2b61,'msgType':_0x1466a2(0x15e)});return;}if(_0x16f91d[_0x1466a2(0x14c)](_0x1466a2(0xe2))){const _0x5eee1a=_0x16f91d[_0x1466a2(0x132)](0x6)[_0x1466a2(0x123)]();_0x5eee1a&&(await this['sendDingMessage']({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'atUserId':_0x251e3e,'content':'📋\x20任务已收到,完成后我会回复'}),await this[_0x1466a2(0x18e)]({'conversationId':_0x13141d,'prompt':_0x5eee1a,'senderStaffId':_0x251e3e,'senderNickName':_0x579306,'sessionWebhook':_0x295a23}));return;}await this[_0x1466a2(0xef)]({'conversationId':_0x13141d,'sessionWebhook':_0x295a23,'senderStaffId':_0x251e3e,'senderNick':_0x579306,'message':_0x16f91d,'conversationConfig':_0x188bf5});}async[a2_0x3b619c(0x1b1)](){const _0x847749=a2_0x3b619c,_0x44286e=Array[_0x847749(0x194)](this[_0x847749(0x15c)][_0x847749(0x1c2)])?this[_0x847749(0x15c)][_0x847749(0x1c2)]:[],_0x45c8ab=this[_0x847749(0x15c)][_0x847749(0x14d)]??this[_0x847749(0x167)],_0x465698=_0x44286e[_0x847749(0x140)]>0x0;console[_0x847749(0x16b)]('['+(0x0,session_1['timestamp'])()+']\x20钉钉机器人服务启动,clientId:\x20'+this[_0x847749(0x192)]),console[_0x847749(0x16b)]('['+(0x0,session_1[_0x847749(0xf0)])()+_0x847749(0x10b)+_0x44286e[_0x847749(0xbe)](_0x30df9a=>_0x30df9a['conversationTitle']||_0x30df9a[_0x847749(0x1c3)])[_0x847749(0x1ef)](',\x20')),(0x0,api_key_manager_1[_0x847749(0x1b6)])(this),await(0x0,session_1[_0x847749(0x15d)])(this);this[_0x847749(0x15c)]['apiKeyCfg']&&((0x0,api_key_manager_1[_0x847749(0x196)])(this),(0x0,api_key_manager_1[_0x847749(0x14f)])(this));this['loadActiveSessions'](),this['cronEngine']['start']();_0x465698&&console[_0x847749(0x16b)]('['+(0x0,session_1[_0x847749(0xf0)])()+_0x847749(0x11b)+_0x45c8ab);this[_0x847749(0xfd)][_0x847749(0x1a6)](_0x847749(0x139),async _0x5ec2ad=>{const _0x24d742=_0x847749;await this[_0x24d742(0x1ee)](_0x5ec2ad);});const _0x51bdad=[];if(_0x465698)for(let _0x36bae8=0x0;_0x36bae8<_0x45c8ab;_0x36bae8++){console['log']('['+(0x0,session_1[_0x847749(0xf0)])()+_0x847749(0x1e8)+(_0x36bae8+0x1)),_0x51bdad[_0x847749(0x131)](this[_0x847749(0x19a)]()[_0x847749(0xdd)](_0x3a8fb2=>console[_0x847749(0xd0)](_0x847749(0x14b)+(_0x36bae8+0x1)+_0x847749(0xdf),_0x3a8fb2)));}const _0x35e15d=this[_0x847749(0xfd)]['connect']()['catch'](_0x35327f=>{const _0x31b193=_0x847749;console[_0x31b193(0xd0)](_0x31b193(0x1cb),_0x35327f),process[_0x31b193(0x1a3)](0x1);});await Promise[_0x847749(0xc0)]([_0x35e15d,..._0x51bdad]);}}exports[a2_0x3b619c(0xda)]=DingClaude;
|
|
1
|
+
'use strict';const a2_0xfaab8f=a2_0x18a6;(function(_0x6c31fe,_0x2ea50f){const _0x26f4eb=a2_0x18a6,_0x39e333=_0x6c31fe();while(!![]){try{const _0x124e88=parseInt(_0x26f4eb(0x1a1))/0x1*(parseInt(_0x26f4eb(0x143))/0x2)+parseInt(_0x26f4eb(0x1ce))/0x3*(-parseInt(_0x26f4eb(0x215))/0x4)+-parseInt(_0x26f4eb(0x269))/0x5+parseInt(_0x26f4eb(0x229))/0x6+-parseInt(_0x26f4eb(0x234))/0x7*(-parseInt(_0x26f4eb(0x14d))/0x8)+-parseInt(_0x26f4eb(0x23a))/0x9*(-parseInt(_0x26f4eb(0x155))/0xa)+-parseInt(_0x26f4eb(0x19a))/0xb;if(_0x124e88===_0x2ea50f)break;else _0x39e333['push'](_0x39e333['shift']());}catch(_0x3f70c2){_0x39e333['push'](_0x39e333['shift']());}}}(a2_0x1f00,0xa0bdd));function a2_0x18a6(_0x40a520,_0xafcf40){_0x40a520=_0x40a520-0x121;const _0x1f000d=a2_0x1f00();let _0x18a6f4=_0x1f000d[_0x40a520];return _0x18a6f4;}var __createBinding=this&&this[a2_0xfaab8f(0x1b8)]||(Object['create']?function(_0x727dfc,_0x38ce6d,_0x55e903,_0x5925a0){const _0x71a27d=a2_0xfaab8f;if(_0x5925a0===undefined)_0x5925a0=_0x55e903;var _0x3a5592=Object[_0x71a27d(0x1f2)](_0x38ce6d,_0x55e903);(!_0x3a5592||(_0x71a27d(0x16e)in _0x3a5592?!_0x38ce6d['__esModule']:_0x3a5592[_0x71a27d(0x133)]||_0x3a5592['configurable']))&&(_0x3a5592={'enumerable':!![],'get':function(){return _0x38ce6d[_0x55e903];}}),Object[_0x71a27d(0x275)](_0x727dfc,_0x5925a0,_0x3a5592);}:function(_0x282193,_0x11f3b9,_0x38f085,_0xd70309){if(_0xd70309===undefined)_0xd70309=_0x38f085;_0x282193[_0xd70309]=_0x11f3b9[_0x38f085];}),__setModuleDefault=this&&this[a2_0xfaab8f(0x1c3)]||(Object[a2_0xfaab8f(0x17a)]?function(_0x113cfa,_0x49e3e1){Object['defineProperty'](_0x113cfa,'default',{'enumerable':!![],'value':_0x49e3e1});}:function(_0x5cfd6d,_0x57c12c){const _0x8f6e52=a2_0xfaab8f;_0x5cfd6d[_0x8f6e52(0x221)]=_0x57c12c;}),__importStar=this&&this[a2_0xfaab8f(0x149)]||(function(){var _0x352c48=function(_0x59dbc0){return _0x352c48=Object['getOwnPropertyNames']||function(_0x54e545){const _0x4548c4=a2_0x18a6;var _0x3113e5=[];for(var _0x2b7d6c in _0x54e545)if(Object[_0x4548c4(0x1ec)][_0x4548c4(0x1d6)][_0x4548c4(0x25a)](_0x54e545,_0x2b7d6c))_0x3113e5[_0x3113e5[_0x4548c4(0x153)]]=_0x2b7d6c;return _0x3113e5;},_0x352c48(_0x59dbc0);};return function(_0x4b40ad){const _0x8ebf7f=a2_0x18a6;if(_0x4b40ad&&_0x4b40ad['__esModule'])return _0x4b40ad;var _0x429037={};if(_0x4b40ad!=null){for(var _0x2de7d1=_0x352c48(_0x4b40ad),_0x272037=0x0;_0x272037<_0x2de7d1[_0x8ebf7f(0x153)];_0x272037++)if(_0x2de7d1[_0x272037]!=='default')__createBinding(_0x429037,_0x4b40ad,_0x2de7d1[_0x272037]);}return __setModuleDefault(_0x429037,_0x4b40ad),_0x429037;};}()),__importDefault=this&&this[a2_0xfaab8f(0x1e9)]||function(_0x1381e4){const _0x1b2810=a2_0xfaab8f;return _0x1381e4&&_0x1381e4[_0x1b2810(0x1ed)]?_0x1381e4:{'default':_0x1381e4};};function a2_0x1f00(){const _0x2db469=['userIdToPhone','\x20&&\x20','start\x20cmd\x20/k\x20\x22cd\x20/d\x20','conversationId','[bash]\x20发送消息失败:','./messaging','stringify','runTaskHandlerLoop','processPictureMessage','connect','saveActiveSession','-\x20**linkConversationId:**\x20','`\x0a\x0a💡\x20格式:\x20`分\x20时\x20日\x20月\x20周`,如\x20`0\x209\x20*\x20*\x20*`','⚠️\x20图片下载失败,请重试或使用文字描述','/cron\x20list','✅\x20群配置已刷新','saveTask','hashConversationId','messageId','__createBinding','❌\x20路径超出工作目录范围','⚠️\x20未配置\x20apiKeyCfg,无需重置','countTodoTask','min','error','botMsgGetCallback','appendSessionLog','apiKeyCfg','📂\x20工作目录:\x20`','parseVersionCommand','__setModuleDefault','###\x20💬\x20当前会话信息\x0a无活跃会话','getPkgVersion','preBash','未注册的机器人,群:','isFile','getTasksDir','startupCheck','taskHandlerCount','❌\x20路径不能使用绝对路径(不能以\x20/\x20开头)',']\x20任务处理器数量:\x20','78GBcdqU','path','**\x20已暂停','❌\x20目录创建失败:\x20`','/cron\x20pause\x20','Error:\x20DingStreamClient\x20init\x20failed.','sanitizeOutput','parseBashCommand','hasOwnProperty','isMobile','tasksDeleted','🧹\x20缓存清理完成','sessionDir','extractQuoteInfo','dingToken','create_nl','创建定时任务:\x20','now','✅\x20目录创建成功:\x20`','pause','projUtil','),\x20发送者=','child_process','senderStaffId','\x20条消息\x0a','toggleJob','getCommandByName','__importDefault','truncateMsg','analyzeAndCreate','prototype','__esModule','\x0a当前白名单:\x20','input','cronEngine','YYYY-MM-DD-HH-mm-ss','getOwnPropertyDescriptor',',\x20内容=','\x0a💡\x20可编辑\x20config.json\x20补充更多配置','listJobs','\x0a\x0a💡\x20你也可以直接指定cron表达式:\x20`/cron\x200\x209\x20*\x20*\x20*\x20任务描述`','✅\x20已添加\x20','appendFileSync','formatSessionInfo',']\x20群配置:\x20','removeJob','replace','**版本:**\x20','open\x20\x22','hasNotifyCapability','暂停定时任务\x20','cronExpression',']\x20启动任务处理器\x20#','parseClaudeStreamLine','getOrCreateLogSession','✅\x20已移除\x20','map',')...','atSender',':**\x20','DingClaude','quoteMessageId','headers','✅\x20执行成功\x0a```\x0a','⚠️\x20目录已存在:\x20`','isOwner','🚀\x20请输入您的问题开始新会话','⏳\x20正在分析定时任务描述...','some','✅\x20已从队尾移除\x20','**\x20已恢复','149608gDvjse','log','❌\x20未找到定时任务:\x20','-\x20**群名称:**\x20','`\x0a最后修改时间:\x20','findIndex','-\x20**atSender:**\x20false\x20(不\x20@\x20发送人)','DEFAULT_TASK_HANDLER_COUNT','),\x20类型=','switchToSession','删除定时任务\x20','scheduleApiKeyCfgDailyReset','default','✅\x20文件创建成功:\x20`','requireOwner','conversationTitle','收到消息:\x20群=','CronEngine','\x20条)\x0a','findActiveSession','2533248kLSdNi','handleTask','层):\x0a```\x0a','getSessionsDir','staffId','readSessionLogTail','📋\x20**当前群白名单**\x0a','getConversationDir','handleCronCommand','⚠️\x20','findSubdirByName','7GlZJit','content','registerCallbackListener','sanitizeLogContent','任务处理器\x20#','platform','4122mSMQWl','sendDingMessage','handleMkdirCommand','resolveUserId','message','richText','###\x20📝\x20任务队列信息\x0a','✅\x20apiKeyCfg\x20已重置\x0a-\x20有效\x20Key\x20数:\x20','format','/cron\x20delete\x20','debug','errors','/task\x20','未找到定时任务:\x20','./task','job','getClientConfig','❌\x20无效的cron表达式:\x20`','parseMqCommand','resume','/v1.0/im/bot/messages/get','robotCode','catch','text','messageQueue','del','⚠️\x20无法解析手机号:\x20','###\x20🤖\x20群配置信息\x0a','✅\x20已删除','statSync','prompt','新会话命令中断正在执行的\x20Claude\x20进程','call','getDirectoryStructure','handleTouchCommand',']\x20钉钉机器人服务启动,clientId:\x20','linkConversationId','root','parseOpenCommand',']\x20注册新群:\x20','`\x0a原因:\x20','saveClientConfig','robot','✅\x20已清空消息队列,共移除\x20','恢复定时任务\x20','claudeSettings','mkdirSync','1088105ykGyJP','-\x20**receiveReply:**\x20false\x20(不回复确认消息)','\x0a```','(空,使用全局白名单)','-\x20会话目录:\x20','existsSync','⚠️\x20未找到已结束的会话','endSession','writeFileSync','📭\x20当前无排队消息','...','formatCronJobInfo','defineProperty','authCheck','📨\x20消息队列\x20(','useLocalOcr','then','cancelTask','isValid','isDirectory','resolveToUserId','user','\x20行日志:\x0a```\x0a','抱歉,您暂无使用权限,请联系应用机器人owner授权...','⚠️\x20当前无活跃会话或暂无日志','handleRmCommand','pictureDownloadCode','clientId','substring','conversations','getSessionId','activeSessions','❌\x20定时任务分析失败:\x20','writable','\x0a💡\x20活跃会话已保留','📋\x20任务已收到,完成后我会回复','start','\x0a...(输出已截断)','formatHelpOverview','config','⏸️\x20定时任务\x20**','processRichTextMessage','type','darwin','./session','rmSync','./commands','handleSessionMessage','./cron','2048676fnGBBh','parse','列出\x20','❌\x20路径已存在但不是文件:\x20`','❌\x20当前群未配置\x20dingToken\x20且无客户端级\x20defaultDingToken,\x20定时任务无法主动发送消息,\x20请联系管理员配置','Fatal\x20error','__importStar','resolveAllPhonesInConfig','count','/cron\x20','8057088GLlkya','✅\x20定时任务\x20**','run','startNewSession','imagesDeleted','\x20(展开','length','utf-8','9670YTmViV','explorer\x20\x22','whiteUserList','📋\x20最近\x20','❌\x20命令执行失败\x0a```\x0a','folder','push','**\x20的目录','list','startsWith','executeClaudeQuery','description','\x0a⚠️\x20错误:\x20','fetchQuotedMessage','isArray','📂\x20当前工作目录:\x0a```\x0a','\x0a-\x20重置时间:\x20','quoteText','getActiveSessionsFile','all','YYYY-MM-DD\x20HH:mm:ss','parseTouchCommand','-\x20**群ID:**\x20','sendCronNoNotifyError','exec','get','resolve','updateSessionFile','receiveReply','📂\x20已在文件管理器中打开:\x0a```\x0a','defaultDingToken','mtime','slice','❌\x20未找到命令:\x20**','join','收到新会话命令,结束旧会话:\x20群=','cancel','create','parseCommandHelp','**\x0a\x0a💡\x20输入\x20`/help`\x20查看所有可用命令','trim','dingStreamClient','###\x20💬\x20当前会话信息\x0a','assistant','dateUtil','unlinkSync','getConversationConfig','splice','loadActiveSessions','isValidCronExpression','open\x20-a\x20Terminal\x20\x22','\x20到当前群白名单\x0a当前白名单:\x20','⚠️\x20该群未注册,请先使用\x20`/cfg`\x20命令注册','getClientDir','session','socketCallBackResponse','cancelAll','markdown','⚠️\x20文件已存在:\x20`','formatTaskInfo','debugLog','sessionsDeleted','timestamp','cleanCache','findLatestSession','resolveAndValidatePath','delete',']\x20[SYSTEM]:\x20创建会话用于记录\x20/cron\x20命令操作\x0a','finishTask','11529078sIgMLJ','❌\x20路径不存在或不是目录:\x20**','getSessionDir','.\x20**','senderNick','findHistorySession','\x0a\x0a**stderr:**\x0a```\x0a','1MgznNC','picture','test','❌\x20文件创建失败:\x20`'];a2_0x1f00=function(){return _0x2db469;};return a2_0x1f00();}Object[a2_0xfaab8f(0x275)](exports,a2_0xfaab8f(0x1ed),{'value':!![]}),exports['DingClaude']=void 0x0;const child_process_1=require(a2_0xfaab8f(0x1e4)),utils_ok_1=require('utils-ok'),fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a2_0xfaab8f(0x1cf))),common_1=require('../common'),quote_1=require('./quote'),messaging_1=require('./messaging'),image_1=require('./image'),commands_1=require(a2_0xfaab8f(0x140)),messaging_2=require(a2_0xfaab8f(0x1aa)),claude_process_1=require('./claude-process'),session_1=require(a2_0xfaab8f(0x13e)),task_1=require(a2_0xfaab8f(0x248)),api_key_manager_1=require('./api-key-manager'),cron_1=require(a2_0xfaab8f(0x142)),TOOL_VERSION=(0x0,common_1[a2_0xfaab8f(0x1e2)])()[a2_0xfaab8f(0x1c5)]();class DingClaude{constructor(_0xf6fc17){const _0x54dbdb=a2_0xfaab8f;this['resolvedPhones']={},this[_0x54dbdb(0x131)]=new Map(),this['DEFAULT_SESSION_MAX_CONCURRENCY']=0x5,this[_0x54dbdb(0x21c)]=0x1,this['DEFAULT_TASK_QUEUE_SIZE']=0x32,this[_0x54dbdb(0x23b)]=_0x5de7f2=>(0x0,messaging_2[_0x54dbdb(0x23b)])(this,_0x5de7f2),this['sendClaudeResponseToDing']=(_0x3ad4d6,_0x2d9aa7,_0x120cf8,_0x4603c2)=>(0x0,messaging_2['sendClaudeResponseToDing'])(this,_0x3ad4d6,_0x2d9aa7,_0x120cf8,_0x4603c2),this['parseClaudeStreamLine']=claude_process_1[_0x54dbdb(0x203)],this['interruptClaudeProcess']=(_0xd7c46e,_0x7719e2)=>(0x0,claude_process_1['interruptClaudeProcess'])(_0xd7c46e,_0x7719e2),this['executeClaudeQuery']=(_0x21792c,_0x44c08a,_0xea89fa)=>(0x0,claude_process_1[_0x54dbdb(0x15f)])(this,_0x21792c,_0x44c08a,_0xea89fa),this[_0x54dbdb(0x18a)]=()=>(0x0,session_1['getClientDir'])(this),this[_0x54dbdb(0x24a)]=()=>(0x0,session_1[_0x54dbdb(0x24a)])(this),this[_0x54dbdb(0x276)]=(_0x102f49,_0x4f4736)=>(0x0,session_1[_0x54dbdb(0x276)])(this,_0x102f49,_0x4f4736),this[_0x54dbdb(0x20f)]=_0x15bc92=>(0x0,session_1['isOwner'])(this,_0x15bc92),this[_0x54dbdb(0x191)]=(_0x2760d1,..._0x44aea1)=>(0x0,session_1[_0x54dbdb(0x191)])(this,_0x2760d1,..._0x44aea1),this[_0x54dbdb(0x1b6)]=_0x1fd15c=>(0x0,session_1[_0x54dbdb(0x1b6)])(this,_0x1fd15c),this[_0x54dbdb(0x183)]=_0x2446ba=>(0x0,session_1[_0x54dbdb(0x183)])(this,_0x2446ba),this[_0x54dbdb(0x230)]=_0x1f653b=>(0x0,session_1[_0x54dbdb(0x230)])(this,_0x1f653b),this[_0x54dbdb(0x22c)]=_0x314def=>(0x0,session_1['getSessionsDir'])(this,_0x314def),this[_0x54dbdb(0x1c9)]=_0xe4fb5b=>(0x0,session_1['getTasksDir'])(this,_0xe4fb5b),this[_0x54dbdb(0x19c)]=_0x5e20fd=>(0x0,session_1['getSessionDir'])(this,_0x5e20fd),this[_0x54dbdb(0x130)]=session_1[_0x54dbdb(0x130)],this[_0x54dbdb(0x1f9)]=_0x271cec=>(0x0,session_1[_0x54dbdb(0x1f9)])(this,_0x271cec),this['readSessionLogTail']=(_0x455f28,_0x359618)=>(0x0,session_1['readSessionLogTail'])(this,_0x455f28,_0x359618),this[_0x54dbdb(0x228)]=_0xdfbc93=>(0x0,session_1[_0x54dbdb(0x228)])(this,_0xdfbc93),this[_0x54dbdb(0x19f)]=(_0x306341,_0x1fb9ee)=>(0x0,session_1[_0x54dbdb(0x19f)])(this,_0x306341,_0x1fb9ee),this[_0x54dbdb(0x195)]=_0x52a84e=>(0x0,session_1['findLatestSession'])(this,_0x52a84e),this['updateSessionFile']=(_0x2ea11c,_0x4da4db)=>(0x0,session_1[_0x54dbdb(0x170)])(this,_0x2ea11c,_0x4da4db),this['appendSessionLog']=session_1[_0x54dbdb(0x1bf)],this[_0x54dbdb(0x167)]=_0x796143=>(0x0,session_1['getActiveSessionsFile'])(this,_0x796143),this[_0x54dbdb(0x1af)]=_0x2fc951=>(0x0,session_1[_0x54dbdb(0x1af)])(this,_0x2fc951),this[_0x54dbdb(0x185)]=()=>(0x0,session_1[_0x54dbdb(0x185)])(this),this['endSession']=(_0x553796,_0x127848)=>(0x0,session_1[_0x54dbdb(0x270)])(this,_0x553796,_0x127848),this[_0x54dbdb(0x21e)]=(_0x1f72af,_0x1bf800,_0x7e5cb7,_0x459a13,_0x59192e)=>(0x0,session_1['switchToSession'])(this,_0x1f72af,_0x1bf800,_0x7e5cb7,_0x459a13,_0x59192e),this['startNewSession']=_0x2fe7c0=>(0x0,session_1[_0x54dbdb(0x150)])(this,_0x2fe7c0),this[_0x54dbdb(0x141)]=_0x4b9dfe=>(0x0,session_1[_0x54dbdb(0x141)])(this,_0x4b9dfe),this[_0x54dbdb(0x194)]=(_0x4500ee,_0x4eb57e=!![])=>(0x0,session_1['cleanCache'])(this,_0x4500ee,_0x4eb57e),this['formatTaskInfo']=()=>(0x0,task_1[_0x54dbdb(0x190)])(this),this[_0x54dbdb(0x123)]=(_0x4726f7,_0x48c6dd)=>(0x0,task_1[_0x54dbdb(0x123)])(this,_0x4726f7,_0x48c6dd),this[_0x54dbdb(0x1bb)]=()=>(0x0,task_1['countTodoTask'])(this),this['getOneTodoTask']=()=>(0x0,task_1['getOneTodoTask'])(this),this['finishTask']=_0x5865c0=>(0x0,task_1[_0x54dbdb(0x199)])(this,_0x5865c0),this[_0x54dbdb(0x22a)]=()=>(0x0,task_1[_0x54dbdb(0x22a)])(this),this[_0x54dbdb(0x1ac)]=()=>(0x0,task_1[_0x54dbdb(0x1ac)])(this),this[_0x54dbdb(0x1b5)]=_0x50dc4f=>(0x0,task_1[_0x54dbdb(0x1b5)])(this,_0x50dc4f),this[_0x54dbdb(0x12d)]=_0xf6fc17,this[_0x54dbdb(0x139)]=(0x0,session_1[_0x54dbdb(0x24a)])(this);try{this[_0x54dbdb(0x17e)]=new utils_ok_1['DingStreamClient']({'clientId':_0xf6fc17,'clientSecret':this['config']['clientSecret'],'keepAlive':!![],'debug':this[_0x54dbdb(0x139)][_0x54dbdb(0x244)]??![]});}catch(_0x2bc6a1){console[_0x54dbdb(0x1bd)](_0x54dbdb(0x1d3),_0x2bc6a1),process['exit'](0x1);}this['cronEngine']=new cron_1[(_0x54dbdb(0x226))](this);}async[a2_0xfaab8f(0x223)](_0x32a7cc,_0xfccc7f,_0x34b116){const _0x590fea=a2_0xfaab8f;if(!this[_0x590fea(0x20f)](_0x34b116))return await this[_0x590fea(0x23b)]({'conversationId':_0x32a7cc,'sessionWebhook':_0xfccc7f,'content':'❌\x20只有机器人\x20owner\x20才能执行此操作','msgType':_0x590fea(0x18e)}),![];return!![];}async[a2_0xfaab8f(0x231)](_0x35200e,_0x37e37b){const _0xe74416=a2_0xfaab8f,{conversationId:_0x3ec63b,sessionWebhook:_0x5f1954,senderStaffId:_0x18e071,senderNick:_0x347b7e,conversationConfig:_0x37fc78}=_0x37e37b;switch(_0x35200e['type']){case _0xe74416(0x15d):{const _0x21ab17=await this[_0xe74416(0x204)](_0x3ec63b,_0x5f1954,_0x18e071,_0x347b7e,_0x37fc78,!![]),_0x495e7c=this[_0xe74416(0x1f0)][_0xe74416(0x1f5)](_0x3ec63b);_0x21ab17[_0xe74416(0x1da)]&&(this['appendSessionLog'](_0x21ab17[_0xe74416(0x1da)],_0xe74416(0x127),_0xe74416(0x1b3)),this['appendSessionLog'](_0x21ab17[_0xe74416(0x1da)],_0xe74416(0x180),_0xe74416(0x145)+_0x495e7c[_0xe74416(0x153)]+'\x20个定时任务'));await this['sendDingMessage']({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':(0x0,cron_1['formatCronJobList'])(_0x495e7c),'msgType':'markdown'});return;}case _0xe74416(0x197):{const _0x3cee29=this[_0xe74416(0x1f0)][_0xe74416(0x1fb)](_0x35200e['id']),_0x5ed36e=await this[_0xe74416(0x204)](_0x3ec63b,_0x5f1954,_0x18e071,_0x347b7e,_0x37fc78);_0x5ed36e['sessionDir']&&(this['appendSessionLog'](_0x5ed36e[_0xe74416(0x1da)],_0xe74416(0x127),_0xe74416(0x243)+_0x35200e['id']),this[_0xe74416(0x1bf)](_0x5ed36e[_0xe74416(0x1da)],_0xe74416(0x180),_0x3cee29?_0xe74416(0x21f)+_0x35200e['id']:_0xe74416(0x247)+_0x35200e['id']));await this[_0xe74416(0x23b)]({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':_0x3cee29?_0xe74416(0x14e)+_0x35200e['id']+'**\x20已删除':_0xe74416(0x217)+_0x35200e['id'],'msgType':_0xe74416(0x18e)});return;}case _0xe74416(0x1e1):{const _0x584b90=this[_0xe74416(0x1f0)][_0xe74416(0x1e7)](_0x35200e['id'],![]),_0x3c513e=await this[_0xe74416(0x204)](_0x3ec63b,_0x5f1954,_0x18e071,_0x347b7e,_0x37fc78);_0x3c513e[_0xe74416(0x1da)]&&(this['appendSessionLog'](_0x3c513e[_0xe74416(0x1da)],'user',_0xe74416(0x1d2)+_0x35200e['id']),this[_0xe74416(0x1bf)](_0x3c513e[_0xe74416(0x1da)],'assistant',_0x584b90?_0xe74416(0x200)+_0x35200e['id']:_0xe74416(0x247)+_0x35200e['id']));await this[_0xe74416(0x23b)]({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':_0x584b90?_0xe74416(0x13a)+_0x35200e['id']+_0xe74416(0x1d0):_0xe74416(0x217)+_0x35200e['id'],'msgType':'markdown'});return;}case _0xe74416(0x24d):{const _0x90e134=this[_0xe74416(0x1f0)]['toggleJob'](_0x35200e['id'],!![]),_0x2124a9=await this[_0xe74416(0x204)](_0x3ec63b,_0x5f1954,_0x18e071,_0x347b7e,_0x37fc78);_0x2124a9[_0xe74416(0x1da)]&&(this[_0xe74416(0x1bf)](_0x2124a9[_0xe74416(0x1da)],_0xe74416(0x127),'/cron\x20resume\x20'+_0x35200e['id']),this[_0xe74416(0x1bf)](_0x2124a9[_0xe74416(0x1da)],'assistant',_0x90e134?_0xe74416(0x266)+_0x35200e['id']:_0xe74416(0x247)+_0x35200e['id']));await this[_0xe74416(0x23b)]({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':_0x90e134?'▶️\x20定时任务\x20**'+_0x35200e['id']+_0xe74416(0x214):_0xe74416(0x217)+_0x35200e['id'],'msgType':'markdown'});return;}case'create_cron':{if(!(0x0,cron_1[_0xe74416(0x186)])(_0x35200e[_0xe74416(0x201)])){await this['sendDingMessage']({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':_0xe74416(0x24b)+_0x35200e[_0xe74416(0x201)]+_0xe74416(0x1b1),'msgType':_0xe74416(0x18e)});return;}if(!this['hasNotifyCapability'](_0x37e37b['conversationConfig'])){await this[_0xe74416(0x16c)](_0x3ec63b,_0x5f1954);return;}const _0xdbd5b3=this[_0xe74416(0x1f0)]['addJob']({'conversationId':_0x3ec63b,'cronExpression':_0x35200e[_0xe74416(0x201)],'description':this[_0xe74416(0x237)](_0x35200e['prompt'][_0xe74416(0x12e)](0x0,0x32)),'prompt':_0x35200e[_0xe74416(0x258)],'senderStaffId':_0x18e071,'senderNick':_0x347b7e}),_0x3369a=await this[_0xe74416(0x204)](_0x3ec63b,_0x5f1954,_0x18e071,_0x347b7e,_0x37fc78);_0x3369a['sessionDir']&&(this['appendSessionLog'](_0x3369a[_0xe74416(0x1da)],_0xe74416(0x127),_0xe74416(0x14c)+_0x35200e[_0xe74416(0x201)]+'\x20'+this[_0xe74416(0x237)](_0x35200e['prompt'])),this[_0xe74416(0x1bf)](_0x3369a[_0xe74416(0x1da)],'assistant',_0xe74416(0x1de)+_0xdbd5b3['id']+'\x20['+_0xdbd5b3[_0xe74416(0x201)]+']\x20'+_0xdbd5b3[_0xe74416(0x160)]));await this[_0xe74416(0x23b)]({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':(0x0,cron_1[_0xe74416(0x274)])(_0xdbd5b3),'msgType':_0xe74416(0x18e)});return;}case _0xe74416(0x1dd):{if(!this['hasNotifyCapability'](_0x37e37b['conversationConfig'])){await this['sendCronNoNotifyError'](_0x3ec63b,_0x5f1954);return;}await this[_0xe74416(0x23b)]({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':_0xe74416(0x211)});const _0x5cbc9a=await this[_0xe74416(0x1f0)][_0xe74416(0x1eb)](_0x3ec63b,_0x35200e[_0xe74416(0x1ef)],_0x18e071,_0x347b7e),_0x2ba04e=await this[_0xe74416(0x204)](_0x3ec63b,_0x5f1954,_0x18e071,_0x347b7e,_0x37fc78);_0x5cbc9a['job']?(_0x2ba04e[_0xe74416(0x1da)]&&(this[_0xe74416(0x1bf)](_0x2ba04e[_0xe74416(0x1da)],_0xe74416(0x127),_0xe74416(0x14c)+this['sanitizeLogContent'](_0x35200e[_0xe74416(0x1ef)])),this['appendSessionLog'](_0x2ba04e[_0xe74416(0x1da)],_0xe74416(0x180),_0xe74416(0x1de)+_0x5cbc9a[_0xe74416(0x249)]['id']+'\x20['+_0x5cbc9a['job'][_0xe74416(0x201)]+']\x20'+_0x5cbc9a['job'][_0xe74416(0x160)])),await this[_0xe74416(0x23b)]({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':(0x0,cron_1['formatCronJobInfo'])(_0x5cbc9a[_0xe74416(0x249)]),'msgType':_0xe74416(0x18e)})):(_0x2ba04e[_0xe74416(0x1da)]&&(this[_0xe74416(0x1bf)](_0x2ba04e[_0xe74416(0x1da)],'user','/cron\x20'+this[_0xe74416(0x237)](_0x35200e[_0xe74416(0x1ef)])),this['appendSessionLog'](_0x2ba04e[_0xe74416(0x1da)],_0xe74416(0x180),'定时任务分析失败:\x20'+_0x5cbc9a[_0xe74416(0x1bd)])),await this['sendDingMessage']({'conversationId':_0x3ec63b,'sessionWebhook':_0x5f1954,'content':_0xe74416(0x132)+_0x5cbc9a[_0xe74416(0x1bd)]+_0xe74416(0x1f6),'msgType':'markdown'}));return;}}}[a2_0xfaab8f(0x237)](_0x4f58ef){const _0x5119f8=a2_0xfaab8f;return _0x4f58ef[_0x5119f8(0x1fc)](/\n/g,'\x5cn')[_0x5119f8(0x1fc)](/\r/g,'\x5cr');}[a2_0xfaab8f(0x1d4)](_0x19ed6d){const _0x2e8b42=a2_0xfaab8f,_0x40c6e4=_0x19ed6d[_0x2e8b42(0x1fc)](/\r\n/g,'\x0a'),_0x1f16da=0x1f40;if(_0x40c6e4['length']>_0x1f16da)return _0x40c6e4['substring'](0x0,_0x1f16da)+_0x2e8b42(0x137);return _0x40c6e4;}[a2_0xfaab8f(0x1ea)](_0x3a4dd9,_0x5a52d8=0x64){const _0x1bf7ca=a2_0xfaab8f,_0x53dea1=_0x3a4dd9['replace'](/\n/g,'\x20')[_0x1bf7ca(0x17d)]();return _0x53dea1[_0x1bf7ca(0x153)]>_0x5a52d8?_0x53dea1[_0x1bf7ca(0x175)](0x0,_0x5a52d8)+_0x1bf7ca(0x273):_0x53dea1;}async[a2_0xfaab8f(0x204)](_0x35ff2b,_0x5dad66,_0x40ea11,_0x9d3616,_0x47d559,_0x53ce26=![]){const _0x4d601c=a2_0xfaab8f,_0x24c3c7=this['findActiveSession'](_0x35ff2b);if(_0x24c3c7){const _0x377d77=this['getSessionDir'](_0x24c3c7[_0x4d601c(0x18b)][_0x4d601c(0x18b)]);return{'sessionDir':_0x377d77,'isNew':![]};}if(_0x53ce26)return{'sessionDir':null,'isNew':![]};const _0xc2735b=Date[_0x4d601c(0x1df)](),_0x56c28d={'conversationId':_0x35ff2b,'sessionWebhook':_0x5dad66,'startTime':_0xc2735b,'startTimeStr':utils_ok_1[_0x4d601c(0x181)]['mm'](_0xc2735b)[_0x4d601c(0x242)](_0x4d601c(0x1f1)),'startStaffId':_0x40ea11,'startNickName':'[cron]'+_0x9d3616},_0xadaa8b=this[_0x4d601c(0x19c)](_0x56c28d);return fs_1[_0x4d601c(0x221)][_0x4d601c(0x268)](_0xadaa8b,{'recursive':!![]}),fs_1['default'][_0x4d601c(0x271)](_0xadaa8b+'/session.json',JSON[_0x4d601c(0x1ab)](_0x56c28d,null,0x2),_0x4d601c(0x154)),fs_1[_0x4d601c(0x221)][_0x4d601c(0x1f8)](_0xadaa8b+'/session.log','['+(0x0,session_1['timestamp'])()+_0x4d601c(0x198),'utf-8'),{'sessionDir':_0xadaa8b,'isNew':!![]};}[a2_0xfaab8f(0x1ff)](_0x5d3786){const _0x973349=a2_0xfaab8f;return!!(_0x5d3786[_0x973349(0x1dc)]||this['config'][_0x973349(0x173)]);}async[a2_0xfaab8f(0x16c)](_0x4c4772,_0x45874c){const _0x4f28f7=a2_0xfaab8f;await this[_0x4f28f7(0x23b)]({'conversationId':_0x4c4772,'sessionWebhook':_0x45874c,'content':_0x4f28f7(0x147),'msgType':_0x4f28f7(0x18e)});}[a2_0xfaab8f(0x196)](_0x45b9d9,_0x3d73f1){const _0x5f3704=a2_0xfaab8f,_0x42003e=this[_0x5f3704(0x230)](_0x45b9d9);if(_0x3d73f1[_0x5f3704(0x15e)]('/'))return{'absolutePath':'','error':_0x5f3704(0x1cc)};const _0x14a661=path_1[_0x5f3704(0x221)][_0x5f3704(0x16f)](_0x42003e,_0x3d73f1);if(!_0x14a661[_0x5f3704(0x15e)](_0x42003e))return{'absolutePath':'','error':_0x5f3704(0x1b9)};return{'absolutePath':_0x14a661};}async[a2_0xfaab8f(0x23c)](_0x28a0c,_0x2c0a8a,_0x290e3f){const _0x54f11c=a2_0xfaab8f,{absolutePath:_0x3f06ba,error:_0x174e5b}=this['resolveAndValidatePath'](_0x28a0c,_0x290e3f);if(_0x174e5b){await this[_0x54f11c(0x23b)]({'conversationId':_0x28a0c,'sessionWebhook':_0x2c0a8a,'content':_0x174e5b,'msgType':'markdown'});return;}try{const _0x4c1ef4=fs_1['default'][_0x54f11c(0x257)](_0x3f06ba);_0x4c1ef4[_0x54f11c(0x125)]()?await this[_0x54f11c(0x23b)]({'conversationId':_0x28a0c,'sessionWebhook':_0x2c0a8a,'content':_0x54f11c(0x20e)+_0x290e3f+'`','msgType':_0x54f11c(0x18e)}):await this['sendDingMessage']({'conversationId':_0x28a0c,'sessionWebhook':_0x2c0a8a,'content':'❌\x20路径已存在但不是目录:\x20`'+_0x290e3f+'`','msgType':_0x54f11c(0x18e)});return;}catch{}try{fs_1[_0x54f11c(0x221)][_0x54f11c(0x268)](_0x3f06ba,{'recursive':!![]}),await this[_0x54f11c(0x23b)]({'conversationId':_0x28a0c,'sessionWebhook':_0x2c0a8a,'content':_0x54f11c(0x1e0)+_0x290e3f+'`','msgType':'markdown'});}catch(_0x534182){await this[_0x54f11c(0x23b)]({'conversationId':_0x28a0c,'sessionWebhook':_0x2c0a8a,'content':_0x54f11c(0x1d1)+_0x290e3f+_0x54f11c(0x262)+(_0x534182 instanceof Error?_0x534182[_0x54f11c(0x23e)]:String(_0x534182)),'msgType':'markdown'});}}async[a2_0xfaab8f(0x12b)](_0x1fd222,_0x327cf9,_0x1a3148){const _0x48150e=a2_0xfaab8f,{absolutePath:_0x540d8f,error:_0x2dd83b}=this[_0x48150e(0x196)](_0x1fd222,_0x1a3148);if(_0x2dd83b){await this[_0x48150e(0x23b)]({'conversationId':_0x1fd222,'sessionWebhook':_0x327cf9,'content':_0x2dd83b,'msgType':'markdown'});return;}let _0xfd54e2;try{_0xfd54e2=fs_1[_0x48150e(0x221)][_0x48150e(0x257)](_0x540d8f);}catch{await this[_0x48150e(0x23b)]({'conversationId':_0x1fd222,'sessionWebhook':_0x327cf9,'content':'❌\x20路径不存在:\x20`'+_0x1a3148+'`','msgType':'markdown'});return;}const _0x3fe6c7=_0xfd54e2['isDirectory']();try{_0x3fe6c7?fs_1[_0x48150e(0x221)][_0x48150e(0x13f)](_0x540d8f,{'recursive':!![],'force':!![]}):fs_1[_0x48150e(0x221)][_0x48150e(0x182)](_0x540d8f),await this['sendDingMessage']({'conversationId':_0x1fd222,'sessionWebhook':_0x327cf9,'content':_0x48150e(0x256)+(_0x3fe6c7?'目录':'文件')+':\x20`'+_0x1a3148+'`','msgType':'markdown'});}catch(_0x516a5b){await this[_0x48150e(0x23b)]({'conversationId':_0x1fd222,'sessionWebhook':_0x327cf9,'content':'❌\x20删除失败:\x20`'+_0x1a3148+_0x48150e(0x262)+(_0x516a5b instanceof Error?_0x516a5b[_0x48150e(0x23e)]:String(_0x516a5b)),'msgType':_0x48150e(0x18e)});}}async[a2_0xfaab8f(0x25c)](_0x48f67f,_0xcb639,_0x55ec49){const _0x44505b=a2_0xfaab8f,{absolutePath:_0x439d92,error:_0x367074}=this[_0x44505b(0x196)](_0x48f67f,_0x55ec49);if(_0x367074){await this[_0x44505b(0x23b)]({'conversationId':_0x48f67f,'sessionWebhook':_0xcb639,'content':_0x367074,'msgType':_0x44505b(0x18e)});return;}try{const _0x566d8f=fs_1[_0x44505b(0x221)][_0x44505b(0x257)](_0x439d92);_0x566d8f[_0x44505b(0x1c8)]()?await this['sendDingMessage']({'conversationId':_0x48f67f,'sessionWebhook':_0xcb639,'content':_0x44505b(0x18f)+_0x55ec49+_0x44505b(0x219)+utils_ok_1[_0x44505b(0x181)]['mm'](_0x566d8f[_0x44505b(0x174)])['format'](_0x44505b(0x169)),'msgType':'markdown'}):await this[_0x44505b(0x23b)]({'conversationId':_0x48f67f,'sessionWebhook':_0xcb639,'content':_0x44505b(0x146)+_0x55ec49+'`','msgType':'markdown'});return;}catch{}try{const _0x1a0988=path_1['default']['dirname'](_0x439d92);fs_1['default']['mkdirSync'](_0x1a0988,{'recursive':!![]}),fs_1['default'][_0x44505b(0x271)](_0x439d92,'','utf-8'),await this[_0x44505b(0x23b)]({'conversationId':_0x48f67f,'sessionWebhook':_0xcb639,'content':_0x44505b(0x222)+_0x55ec49+'`','msgType':_0x44505b(0x18e)});}catch(_0x1f9f1b){await this['sendDingMessage']({'conversationId':_0x48f67f,'sessionWebhook':_0xcb639,'content':_0x44505b(0x1a4)+_0x55ec49+_0x44505b(0x262)+(_0x1f9f1b instanceof Error?_0x1f9f1b[_0x44505b(0x23e)]:String(_0x1f9f1b)),'msgType':'markdown'});}}async[a2_0xfaab8f(0x1be)](_0x59d149){const _0x208208=a2_0xfaab8f;this[_0x208208(0x17e)][_0x208208(0x18c)](_0x59d149[_0x208208(0x20c)][_0x208208(0x1b7)],'');const _0x34a74d=JSON[_0x208208(0x144)](_0x59d149['data']),{senderNick:_0x119a61,senderStaffId:_0x399c6b,conversationId:_0x57bd0f,conversationTitle:_0xba51a2,sessionWebhook:_0xd5c47,msgtype:_0x15bcf6}=_0x34a74d,_0x59da6d=_0x34a74d[_0x208208(0x251)]?.[_0x208208(0x235)]?.['trim']()??'';this[_0x208208(0x191)](_0x208208(0x225)+_0xba51a2+'('+_0x57bd0f+_0x208208(0x1e3)+_0x119a61+'('+_0x399c6b+_0x208208(0x21d)+_0x15bcf6+_0x208208(0x1f3)+_0x59da6d[_0x208208(0x12e)](0x0,0x32));if(!this[_0x208208(0x276)](_0x399c6b,_0x57bd0f)){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'atUserId':_0x399c6b,'content':_0x208208(0x129)});return;}const _0x150a64=this[_0x208208(0x183)](_0x57bd0f);let _0x474939;if(_0x15bcf6===_0x208208(0x1a2)&&_0x34a74d[_0x208208(0x12c)]){const _0x27efc4=this[_0x208208(0x230)](_0x57bd0f),_0x5d8d29=_0x150a64?.[_0x208208(0x121)]!==![],_0x1f173b=await(0x0,image_1[_0x208208(0x1ad)])(this,_0x34a74d[_0x208208(0x12c)],_0x34a74d[_0x208208(0x24f)],_0x27efc4,_0x5d8d29,_0x59da6d||undefined);if(!_0x1f173b){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'atUserId':_0x399c6b,'content':_0x208208(0x1b2)});return;}_0x474939=_0x1f173b;}else{if(_0x15bcf6===_0x208208(0x23f)&&_0x34a74d['content']?.[_0x208208(0x23f)]){const _0x334d2c=this[_0x208208(0x230)](_0x57bd0f),_0x1f23c8=_0x150a64?.[_0x208208(0x121)]!==![];_0x474939=await(0x0,image_1[_0x208208(0x13b)])(this,_0x34a74d[_0x208208(0x235)][_0x208208(0x23f)],_0x34a74d[_0x208208(0x24f)],_0x334d2c,_0x1f23c8);}else{_0x474939=_0x59da6d;if(!_0x474939)return;}}if(!_0x474939[_0x208208(0x15e)]('/')&&_0x15bcf6===_0x208208(0x251)){const _0x1aaada=(0x0,quote_1[_0x208208(0x1db)])(_0x34a74d);if(_0x1aaada){this[_0x208208(0x191)]('检测到引用消息:\x20quoteMessageId='+_0x1aaada[_0x208208(0x20b)]);if(_0x1aaada[_0x208208(0x20b)]&&!_0x1aaada[_0x208208(0x166)]){const _0x1a4e81=await(0x0,messaging_1[_0x208208(0x162)])(this,_0x1aaada[_0x208208(0x20b)]);if(_0x1a4e81)_0x1aaada[_0x208208(0x166)]=_0x1a4e81;}_0x1aaada[_0x208208(0x166)]&&(_0x474939=(0x0,quote_1['formatPromptWithQuote'])(_0x474939,_0x1aaada));}}const _0x10974e=(0x0,commands_1['parseCfgCommand'])(_0x474939);if(_0x10974e!==null){if(!await this[_0x208208(0x223)](_0x57bd0f,_0xd5c47,_0x399c6b))return;const _0x329252=_0x150a64,_0xf1042d=!!(_0x10974e[_0x208208(0x1dc)]||_0x10974e[_0x208208(0x25e)]||_0x10974e[_0x208208(0x157)]&&_0x10974e[_0x208208(0x157)][_0x208208(0x153)]>0x0||_0x10974e[_0x208208(0x224)]||_0x10974e[_0x208208(0x208)]!==undefined||_0x10974e[_0x208208(0x171)]!==undefined||_0x10974e[_0x208208(0x1c6)]!==undefined);if(_0x329252&&_0xf1042d){if(_0x10974e[_0x208208(0x224)])_0x329252[_0x208208(0x224)]=_0x10974e['conversationTitle'];if(_0x10974e[_0x208208(0x1dc)])_0x329252[_0x208208(0x1dc)]=_0x10974e['dingToken'];if(_0x10974e[_0x208208(0x25e)])_0x329252[_0x208208(0x25e)]=_0x10974e[_0x208208(0x25e)];if(_0x10974e[_0x208208(0x208)]!==undefined)_0x329252[_0x208208(0x208)]=_0x10974e['atSender'];if(_0x10974e[_0x208208(0x171)]!==undefined)_0x329252['receiveReply']=_0x10974e[_0x208208(0x171)];if(_0x10974e[_0x208208(0x1c6)]!==undefined)_0x329252[_0x208208(0x1c6)]=_0x10974e[_0x208208(0x1c6)];if(_0x10974e[_0x208208(0x157)]&&_0x10974e['whiteUserList'][_0x208208(0x153)]>0x0){_0x329252['whiteUserList']=_0x10974e[_0x208208(0x157)];for(const _0x56666d of _0x10974e[_0x208208(0x157)]){(0x0,session_1[_0x208208(0x1d7)])(_0x56666d)&&await(0x0,session_1['resolveUserId'])(this,_0x56666d);}}(0x0,api_key_manager_1[_0x208208(0x263)])(this),console[_0x208208(0x216)]('['+(0x0,session_1[_0x208208(0x193)])()+']\x20刷新群配置:\x20'+(_0x329252[_0x208208(0x224)]||_0xba51a2)+'('+_0x57bd0f+')');}else{if(!_0x329252){const _0x470506={'conversationId':_0x57bd0f,'conversationTitle':_0x10974e['conversationTitle']||_0xba51a2};if(_0x10974e[_0x208208(0x1dc)])_0x470506[_0x208208(0x1dc)]=_0x10974e['dingToken'];if(_0x10974e['linkConversationId'])_0x470506[_0x208208(0x25e)]=_0x10974e[_0x208208(0x25e)];if(_0x10974e[_0x208208(0x208)]!==undefined)_0x470506[_0x208208(0x208)]=_0x10974e[_0x208208(0x208)];if(_0x10974e[_0x208208(0x171)]!==undefined)_0x470506[_0x208208(0x171)]=_0x10974e[_0x208208(0x171)];if(_0x10974e[_0x208208(0x1c6)]!==undefined)_0x470506['preBash']=_0x10974e[_0x208208(0x1c6)];if(_0x10974e['whiteUserList']&&_0x10974e[_0x208208(0x157)]['length']>0x0){_0x470506[_0x208208(0x157)]=_0x10974e[_0x208208(0x157)];for(const _0x5b9f4a of _0x10974e[_0x208208(0x157)]){(0x0,session_1[_0x208208(0x1d7)])(_0x5b9f4a)&&await(0x0,session_1[_0x208208(0x23d)])(this,_0x5b9f4a);}}this[_0x208208(0x139)][_0x208208(0x12f)][_0x208208(0x15b)](_0x470506),(0x0,api_key_manager_1[_0x208208(0x263)])(this),console[_0x208208(0x216)]('['+(0x0,session_1['timestamp'])()+_0x208208(0x261)+(_0x470506[_0x208208(0x224)]||_0xba51a2)+'('+_0x57bd0f+')');}}const _0x452e26=this[_0x208208(0x230)](_0x57bd0f);!fs_1['default'][_0x208208(0x26e)](_0x452e26)&&(fs_1[_0x208208(0x221)][_0x208208(0x268)](_0x452e26,{'recursive':!![]}),console[_0x208208(0x216)]('['+(0x0,session_1['timestamp'])()+']\x20创建工作目录:\x20'+_0x452e26));const _0x1de96f=_0x329252||this['getConversationConfig'](_0x57bd0f),_0x2c3e7f=[_0x329252?_0x208208(0x1b4):'✅\x20群已注册',_0x208208(0x218)+(_0x1de96f?.[_0x208208(0x224)]||_0xba51a2||'-'),_0x208208(0x16b)+_0x57bd0f];if(_0x1de96f?.[_0x208208(0x1dc)])_0x2c3e7f['push']('-\x20**dingToken:**\x20'+_0x1de96f[_0x208208(0x1dc)][_0x208208(0x12e)](0x0,0x8)+_0x208208(0x273));else _0x2c3e7f[_0x208208(0x15b)]('-\x20**dingToken:**\x20(未指定,\x20使用\x20defaultDingToken)');if(_0x1de96f?.[_0x208208(0x25e)])_0x2c3e7f['push'](_0x208208(0x1b0)+_0x1de96f[_0x208208(0x25e)]);if(_0x1de96f?.[_0x208208(0x208)]===![])_0x2c3e7f[_0x208208(0x15b)](_0x208208(0x21b));if(_0x1de96f?.['receiveReply']===![])_0x2c3e7f[_0x208208(0x15b)](_0x208208(0x26a));if(_0x1de96f?.[_0x208208(0x157)]?.[_0x208208(0x153)]){const _0x9c242=_0x1de96f['whiteUserList']['map'](_0x27334e=>{const _0x460fc5=_0x208208;if((0x0,session_1['isMobile'])(_0x27334e))return _0x27334e;return(0x0,session_1[_0x460fc5(0x1a5)])(this,_0x27334e)||_0x27334e;})[_0x208208(0x177)](',\x20');_0x2c3e7f[_0x208208(0x15b)]('-\x20**whiteUserList:**\x20'+_0x9c242);}_0x2c3e7f[_0x208208(0x15b)](_0x208208(0x1f4)),_0x2c3e7f[_0x208208(0x15b)](_0x208208(0x1c1)+_0x452e26+'`'),await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x2c3e7f['join']('\x0a'),'msgType':_0x208208(0x18e)});return;}if((0x0,commands_1['parseHelpCommand'])(_0x474939)){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':(0x0,commands_1[_0x208208(0x138)])(TOOL_VERSION,this[_0x208208(0x20f)](_0x399c6b)),'msgType':'markdown'});return;}if((0x0,commands_1[_0x208208(0x1c2)])(_0x474939)){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x1fd)+TOOL_VERSION,'msgType':'markdown'});return;}const _0x2e0865=(0x0,commands_1[_0x208208(0x17b)])(_0x474939);if(_0x2e0865){const _0x4eacb6=(0x0,commands_1[_0x208208(0x1e8)])(_0x2e0865);_0x4eacb6?await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':(0x0,commands_1['formatCommandHelp'])(_0x4eacb6),'msgType':_0x208208(0x18e)}):await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x176)+_0x2e0865+_0x208208(0x17c),'msgType':_0x208208(0x18e)});return;}if(!_0x150a64){console[_0x208208(0x216)](_0x208208(0x1c7)+_0xba51a2+','+_0x57bd0f);this['isOwner'](_0x399c6b)?await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'atUserId':_0x399c6b,'content':_0x208208(0x189),'msgType':_0x208208(0x18e)}):await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'atUserId':_0x399c6b,'content':'抱歉,该群的机器人未在服务端注册,请联系应用机器人owner注册('+_0x57bd0f+_0x208208(0x207)});return;}const _0x4ac4c3=(0x0,commands_1['parseCleanCommand'])(_0x474939);if(_0x4ac4c3!==null){if(!await this['requireOwner'](_0x57bd0f,_0xd5c47,_0x399c6b))return;const _0x2b04f5=_0x4ac4c3===_0x208208(0x168)?null:_0x57bd0f,_0x505985=this[_0x208208(0x194)](_0x2b04f5,!![]),_0x499b45=[];_0x499b45[_0x208208(0x15b)](_0x208208(0x1d9));if(_0x505985[_0x208208(0x192)]>0x0)_0x499b45[_0x208208(0x15b)](_0x208208(0x26d)+_0x505985['sessionsDeleted']+'\x20个');if(_0x505985[_0x208208(0x1d8)]>0x0)_0x499b45[_0x208208(0x15b)]('-\x20任务目录:\x20'+_0x505985[_0x208208(0x1d8)]+'\x20个');if(_0x505985['imagesDeleted']>0x0)_0x499b45['push']('-\x20图片文件:\x20'+_0x505985[_0x208208(0x151)]+'\x20个');_0x505985['sessionsDeleted']===0x0&&_0x505985[_0x208208(0x1d8)]===0x0&&_0x505985['imagesDeleted']===0x0&&_0x499b45['push']('(无历史数据)');_0x499b45[_0x208208(0x15b)](_0x208208(0x134));_0x505985[_0x208208(0x245)]['length']>0x0&&_0x499b45[_0x208208(0x15b)](_0x208208(0x161)+_0x505985[_0x208208(0x245)][_0x208208(0x177)](';\x20'));await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x499b45[_0x208208(0x177)]('\x0a'),'msgType':'markdown'});return;}if((0x0,commands_1['parseResetApiKeyCfgCommand'])(_0x474939)){if(!await this[_0x208208(0x223)](_0x57bd0f,_0xd5c47,_0x399c6b))return;if(!this[_0x208208(0x139)]['apiKeyCfg']){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x1ba),'msgType':_0x208208(0x18e)});return;}(0x0,api_key_manager_1['resetApiKeyCfg'])(this);const _0xe463c7=this[_0x208208(0x139)][_0x208208(0x1c0)][_0x208208(0x267)]['filter'](_0x8cdb9a=>_0x8cdb9a[_0x208208(0x124)])[_0x208208(0x153)];await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x241)+_0xe463c7+'/'+this['config'][_0x208208(0x1c0)][_0x208208(0x267)][_0x208208(0x153)]+_0x208208(0x165)+(this[_0x208208(0x139)][_0x208208(0x1c0)]['resetTime']||'-'),'msgType':_0x208208(0x18e)});return;}const _0x40ca0b=(0x0,commands_1['parseAuthCommand'])(_0x474939);if(_0x40ca0b){if(!await this[_0x208208(0x223)](_0x57bd0f,_0xd5c47,_0x399c6b))return;const _0x4ded63=_0x150a64['whiteUserList'];if(_0x40ca0b[_0x208208(0x13c)]==='list'){const _0x1be941=_0x4ded63&&_0x4ded63['length']>0x0?_0x4ded63[_0x208208(0x206)](_0x2c6172=>{const _0x4422d9=_0x208208,_0xbf6466=(0x0,session_1[_0x4422d9(0x1a5)])(this,_0x2c6172);return'-\x20'+(_0xbf6466||_0x2c6172);})[_0x208208(0x177)]('\x0a'):'(未配置群级白名单,使用全局白名单)';await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x22f)+_0x1be941,'msgType':_0x208208(0x18e)});return;}if(_0x40ca0b[_0x208208(0x13c)]==='add'){let _0x13abe7=_0x40ca0b['staffId'];if((0x0,session_1['isMobile'])(_0x40ca0b[_0x208208(0x22d)])){_0x13abe7=await(0x0,session_1[_0x208208(0x23d)])(this,_0x40ca0b['staffId']);if(!_0x13abe7){await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':'⚠️\x20无法解析手机号:\x20'+_0x40ca0b[_0x208208(0x22d)],'msgType':_0x208208(0x18e)});return;}}const _0x1cc26c=_0x4ded63?.[_0x208208(0x212)](_0x41ce71=>(0x0,session_1[_0x208208(0x126)])(this,_0x41ce71)===_0x13abe7);if(_0x1cc26c){const _0x34ad06=(0x0,session_1['userIdToPhone'])(this,_0x13abe7)||_0x13abe7;await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x232)+_0x34ad06+'\x20已在当前群白名单中','msgType':_0x208208(0x18e)});return;}!_0x150a64[_0x208208(0x157)]&&(_0x150a64['whiteUserList']=[]);_0x150a64[_0x208208(0x157)][_0x208208(0x15b)](_0x40ca0b['staffId']),(0x0,api_key_manager_1['saveClientConfig'])(this);const _0xd0aadf=_0x150a64['whiteUserList'][_0x208208(0x206)](_0x43c961=>{const _0xc1b5dc=(0x0,session_1['resolveToUserId'])(this,_0x43c961);return(0x0,session_1['userIdToPhone'])(this,_0xc1b5dc)||_0x43c961;}),_0x4ab010=(0x0,session_1[_0x208208(0x1d7)])(_0x40ca0b['staffId'])?_0x40ca0b[_0x208208(0x22d)]:(0x0,session_1['userIdToPhone'])(this,_0x40ca0b[_0x208208(0x22d)])||_0x40ca0b[_0x208208(0x22d)];await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x1f7)+_0x4ab010+_0x208208(0x188)+_0xd0aadf['join'](',\x20'),'msgType':_0x208208(0x18e)});return;}if(_0x40ca0b[_0x208208(0x13c)]===_0x208208(0x253)){let _0x20843d=_0x40ca0b[_0x208208(0x22d)];if((0x0,session_1[_0x208208(0x1d7)])(_0x40ca0b[_0x208208(0x22d)])){_0x20843d=await(0x0,session_1[_0x208208(0x23d)])(this,_0x40ca0b[_0x208208(0x22d)]);if(!_0x20843d){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x254)+_0x40ca0b[_0x208208(0x22d)],'msgType':_0x208208(0x18e)});return;}}const _0x4a266e=_0x4ded63?.[_0x208208(0x21a)](_0x41784a=>(0x0,session_1[_0x208208(0x126)])(this,_0x41784a)===_0x20843d)??-0x1;if(_0x4a266e<0x0){const _0x2336f3=(0x0,session_1[_0x208208(0x1a5)])(this,_0x20843d)||_0x20843d;await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x232)+_0x2336f3+'\x20不在当前群白名单中','msgType':_0x208208(0x18e)});return;}const _0x529203=_0x150a64[_0x208208(0x157)][_0x4a266e];_0x150a64['whiteUserList'][_0x208208(0x184)](_0x4a266e,0x1);_0x150a64[_0x208208(0x157)]['length']===0x0&&delete _0x150a64['whiteUserList'];(0x0,api_key_manager_1[_0x208208(0x263)])(this);const _0x7cde5b=_0x150a64[_0x208208(0x157)]?.[_0x208208(0x153)]?_0x150a64[_0x208208(0x157)][_0x208208(0x206)](_0x3eb49e=>{const _0x53b949=_0x208208,_0x5eed8f=(0x0,session_1[_0x53b949(0x126)])(this,_0x3eb49e);return(0x0,session_1[_0x53b949(0x1a5)])(this,_0x5eed8f)||_0x3eb49e;})[_0x208208(0x177)](',\x20'):_0x208208(0x26c),_0x40fd8a=(0x0,session_1[_0x208208(0x1a5)])(this,_0x20843d)||_0x529203;await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x205)+_0x40fd8a+_0x208208(0x1ee)+_0x7cde5b,'msgType':'markdown'});return;}}const _0x2b2991=(0x0,commands_1[_0x208208(0x260)])(_0x474939);if(_0x2b2991!==null){if(!await this[_0x208208(0x223)](_0x57bd0f,_0xd5c47,_0x399c6b))return;const _0x8678d=this[_0x208208(0x230)](_0x57bd0f),{exec:_0x4db0aa}=await Promise[_0x208208(0x16f)]()[_0x208208(0x122)](()=>__importStar(require('child_process'))),_0x2524a5=process[_0x208208(0x239)];try{_0x2b2991===_0x208208(0x15a)?(_0x2524a5===_0x208208(0x13d)?_0x4db0aa(_0x208208(0x1fe)+_0x8678d+'\x22'):_0x4db0aa(_0x208208(0x156)+_0x8678d+'\x22'),await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x172)+_0x8678d+_0x208208(0x26b),'msgType':'markdown'})):(_0x2524a5===_0x208208(0x13d)?_0x4db0aa(_0x208208(0x187)+_0x8678d+'\x22'):_0x4db0aa(_0x208208(0x1a7)+_0x8678d+'\x22',{'shell':'cmd.exe'}),await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':'💻\x20已在终端中打开:\x0a```\x0a'+_0x8678d+'\x0a```','msgType':_0x208208(0x18e)}));}catch(_0x40ad7b){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':'❌\x20打开失败:\x20'+(_0x40ad7b instanceof Error?_0x40ad7b['message']:String(_0x40ad7b)),'msgType':_0x208208(0x18e)});}return;}const _0x37e11e=(0x0,commands_1['parseCronCommand'])(_0x474939);if(_0x37e11e){await this[_0x208208(0x231)](_0x37e11e,{'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'senderStaffId':_0x399c6b,'senderNick':_0x119a61,'conversationConfig':_0x150a64});return;}if((0x0,commands_1['parsePwdCommand'])(_0x474939)){const _0x4804e7=this[_0x208208(0x230)](_0x57bd0f);await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x164)+_0x4804e7+_0x208208(0x26b),'msgType':_0x208208(0x18e)});return;}const _0x3f6c9f=(0x0,commands_1['parseMkdirCommand'])(_0x474939);if(_0x3f6c9f!==null){await this[_0x208208(0x23c)](_0x57bd0f,_0xd5c47,_0x3f6c9f);return;}const _0x597a25=(0x0,commands_1[_0x208208(0x16a)])(_0x474939);if(_0x597a25!==null){await this['handleTouchCommand'](_0x57bd0f,_0xd5c47,_0x597a25);return;}const _0x4f9566=(0x0,commands_1['parseRmCommand'])(_0x474939);if(_0x4f9566!==null){await this[_0x208208(0x12b)](_0x57bd0f,_0xd5c47,_0x4f9566);return;}const _0x11bed9=(0x0,commands_1[_0x208208(0x1d5)])(_0x474939);if(_0x11bed9!==null){const _0x211f35=this[_0x208208(0x230)](_0x57bd0f),_0xdfcb78=[];if(this[_0x208208(0x139)]['preBash'])_0xdfcb78[_0x208208(0x15b)](this['config'][_0x208208(0x1c6)]);if(_0x150a64?.[_0x208208(0x1c6)])_0xdfcb78['push'](_0x150a64['preBash']);const _0x199e9b=_0xdfcb78[_0x208208(0x153)]>0x0?_0xdfcb78[_0x208208(0x177)]('\x20&&\x20')+_0x208208(0x1a6)+_0x11bed9:_0x11bed9,_0x32ccdb=this;(0x0,child_process_1[_0x208208(0x16d)])(_0x199e9b,{'cwd':_0x211f35,'timeout':0x7530,'maxBuffer':0x400*0x400},async(_0x13e1e4,_0x2672c0,_0x160752)=>{const _0x2e5e8=_0x208208;try{let _0x54e604;if(_0x13e1e4)_0x54e604=_0x2e5e8(0x159)+_0x13e1e4[_0x2e5e8(0x23e)]+'\x0a```',_0x160752&&(_0x54e604+='\x0a\x0a**stderr:**\x0a```\x0a'+_0x32ccdb['sanitizeOutput'](_0x160752)+_0x2e5e8(0x26b));else{const _0x4aeadc=_0x2672c0||'(无输出)';_0x54e604=_0x2e5e8(0x20d)+_0x32ccdb[_0x2e5e8(0x1d4)](_0x4aeadc)+_0x2e5e8(0x26b),_0x160752&&(_0x54e604+=_0x2e5e8(0x1a0)+_0x32ccdb['sanitizeOutput'](_0x160752)+'\x0a```');}await _0x32ccdb[_0x2e5e8(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x54e604,'msgType':'markdown'});}catch(_0x264c8d){console['error'](_0x2e5e8(0x1a9),_0x264c8d);}});return;}if(/^\/new(?:\s|$)/i[_0x208208(0x1a3)](_0x474939)){const _0x41ec35=this['findActiveSession'](_0x57bd0f);_0x41ec35&&(console['log'](_0x208208(0x178)+_0x41ec35['session'][_0x208208(0x18b)][_0x208208(0x1a8)]+',\x20会话ID='+this[_0x208208(0x130)](_0x41ec35[_0x208208(0x18b)][_0x208208(0x18b)])),this['interruptClaudeProcess'](_0x41ec35[_0x208208(0x18b)],_0x208208(0x259)),this['activeSessions']['delete'](_0x41ec35['key']),this[_0x208208(0x1af)](_0x41ec35['key']));const _0x212a32=_0x474939[_0x208208(0x1fc)](/^\/new\s*/i,'')[_0x208208(0x17d)]();_0x212a32?await this[_0x208208(0x150)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'senderStaffId':_0x399c6b,'senderNick':_0x119a61,'message':_0x212a32,'conversationConfig':_0x150a64}):await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'atUserId':_0x399c6b,'content':_0x208208(0x210)});return;}const _0x20b659=(0x0,commands_1['parseContinueSessionCommand'])(_0x474939);if(_0x20b659!==null&&_0x150a64){let _0x517eaf=_0x20b659;if(!_0x517eaf){const _0x188041=(0x0,session_1[_0x208208(0x195)])(this,_0x57bd0f);if(!_0x188041){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'atUserId':_0x399c6b,'content':_0x208208(0x26f),'msgType':_0x208208(0x18e)});return;}_0x517eaf=(0x0,session_1[_0x208208(0x130)])(_0x188041);}await this[_0x208208(0x21e)](_0x57bd0f,_0xd5c47,_0x517eaf,_0x399c6b,_0x150a64);return;}const _0x45b1d8=(0x0,commands_1['parseLogCommand'])(_0x474939);if(_0x45b1d8!==null){const _0xf0beee=this[_0x208208(0x22e)](_0x57bd0f,_0x45b1d8);_0xf0beee?await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x158)+_0x45b1d8+_0x208208(0x128)+_0xf0beee+_0x208208(0x26b),'msgType':_0x208208(0x18e)}):await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x12a)});return;}const _0x863f29=(0x0,commands_1['parseInfoCommand'])(_0x474939);if(_0x863f29!==null){const _0x1af79f=[],_0x327e24=this['getConversationDir'](_0x57bd0f);(_0x863f29===_0x208208(0x168)||_0x863f29===_0x208208(0x264))&&(_0x1af79f[_0x208208(0x15b)]('###\x20🌐\x20全局核心配置\x0a'+(0x0,commands_1['formatGlobalConfig'])(this[_0x208208(0x139)])),_0x1af79f[_0x208208(0x15b)](_0x208208(0x255)+(0x0,commands_1['formatConversationInfo'])(_0x150a64,_0x57bd0f,_0x5e083f=>(0x0,session_1['userIdToPhone'])(this,_0x5e083f),_0x327e24)));if(_0x863f29===_0x208208(0x168)||_0x863f29===_0x208208(0x18b)){const _0x3b0125=this[_0x208208(0x1f9)](_0x57bd0f);_0x3b0125?_0x1af79f[_0x208208(0x15b)](_0x208208(0x17f)+_0x3b0125):_0x1af79f[_0x208208(0x15b)](_0x208208(0x1c4));}(_0x863f29===_0x208208(0x168)||_0x863f29==='task')&&_0x1af79f[_0x208208(0x15b)](_0x208208(0x240)+this['formatTaskInfo']());await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x1af79f[_0x208208(0x177)]('\x0a\x0a'),'msgType':_0x208208(0x18e)});return;}const _0x2d14d0=(0x0,commands_1['parseLsCommand'])(_0x474939);if(_0x2d14d0!==null){const {target:_0x5a4976,depth:_0x1fbf6c}=_0x2d14d0,_0x5bded7=this[_0x208208(0x230)](_0x57bd0f);let _0x218fce=_0x5bded7,_0x18b290='当前工作目录';if(_0x5a4976&&_0x5a4976!==_0x208208(0x25f)){if(_0x5a4976['startsWith']('./')||_0x5a4976[_0x208208(0x15e)]('../')||_0x5a4976[_0x208208(0x15e)]('/')){const _0x505fd0=path_1['default'][_0x208208(0x16f)](_0x5bded7,_0x5a4976);if(fs_1['default']['existsSync'](_0x505fd0)&&fs_1['default'][_0x208208(0x257)](_0x505fd0)[_0x208208(0x125)]()){if(!_0x505fd0[_0x208208(0x15e)](_0x5bded7)){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x1b9),'msgType':_0x208208(0x18e)});return;}_0x218fce=_0x505fd0,_0x18b290=_0x5a4976;}else{await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x19b)+_0x5a4976+'**','msgType':_0x208208(0x18e)});return;}}else{const _0x877442=(0x0,commands_1[_0x208208(0x233)])(_0x5bded7,_0x5a4976);if(_0x877442)_0x218fce=_0x877442,_0x18b290=_0x5a4976;else{await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':'❌\x20未找到名为\x20**'+_0x5a4976+_0x208208(0x15c),'msgType':_0x208208(0x18e)});return;}}}const _0x1c4558=(0x0,commands_1[_0x208208(0x25b)])(_0x218fce,0x0,_0x1fbf6c);await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':'📂\x20'+_0x18b290+_0x208208(0x152)+_0x1fbf6c+_0x208208(0x22b)+_0x1c4558+_0x208208(0x26b),'msgType':'markdown'});return;}const _0x193653=(0x0,task_1['parseTaskCancelCommand'])(_0x474939);if(_0x193653){const _0x5abfe2=this[_0x208208(0x123)](_0x193653,_0x57bd0f);await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x5abfe2,'msgType':_0x208208(0x18e)});return;}if(_0x474939[_0x208208(0x15e)](_0x208208(0x246))){const _0x52c7e7=_0x474939[_0x208208(0x12e)](0x6)['trim']();_0x52c7e7&&(await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'atUserId':_0x399c6b,'content':_0x208208(0x135)}),await this[_0x208208(0x1b5)]({'conversationId':_0x57bd0f,'prompt':_0x52c7e7,'senderStaffId':_0x399c6b,'senderNickName':_0x119a61,'sessionWebhook':_0xd5c47}));return;}const _0x5d2078=(0x0,commands_1[_0x208208(0x24c)])(_0x474939);if(_0x5d2078){const _0x3d8c96=this[_0x208208(0x228)](_0x57bd0f),_0x36faae=_0x3d8c96?.['session'][_0x208208(0x252)]??[];switch(_0x5d2078[_0x208208(0x13c)]){case _0x208208(0x15d):{if(_0x36faae['length']===0x0)await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x272),'msgType':_0x208208(0x18e)});else{const _0x224c58=_0x36faae[_0x208208(0x206)]((_0x58c544,_0xabcadb)=>_0xabcadb+0x1+_0x208208(0x19d)+(_0x58c544[_0x208208(0x19e)]||_0x58c544[_0x208208(0x1e5)])+_0x208208(0x209)+this[_0x208208(0x1ea)](_0x58c544[_0x208208(0x23e)]));await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x277)+_0x36faae[_0x208208(0x153)]+_0x208208(0x227)+_0x224c58[_0x208208(0x177)]('\x0a'),'msgType':_0x208208(0x18e)});}return;}case _0x208208(0x179):{if(_0x36faae[_0x208208(0x153)]===0x0){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':'📭\x20当前无排队消息','msgType':'markdown'});return;}const _0x2bb428=Math[_0x208208(0x1bc)](_0x5d2078[_0x208208(0x14b)],_0x36faae[_0x208208(0x153)]),_0x38983e=_0x36faae['splice'](_0x36faae[_0x208208(0x153)]-_0x2bb428,_0x2bb428),_0x5126dd=_0x38983e[_0x208208(0x206)]((_0xbe80b7,_0x1c1548)=>_0x1c1548+0x1+_0x208208(0x19d)+(_0xbe80b7['senderNick']||_0xbe80b7['senderStaffId'])+_0x208208(0x209)+this['truncateMsg'](_0xbe80b7[_0x208208(0x23e)]));await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x213)+_0x2bb428+_0x208208(0x1e6)+_0x5126dd['join']('\x0a'),'msgType':_0x208208(0x18e)});return;}case _0x208208(0x18d):{if(_0x36faae[_0x208208(0x153)]===0x0){await this[_0x208208(0x23b)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x272),'msgType':_0x208208(0x18e)});return;}const _0x13b7b8=_0x36faae[_0x208208(0x153)];_0x36faae[_0x208208(0x153)]=0x0,await this['sendDingMessage']({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'content':_0x208208(0x265)+_0x13b7b8+'\x20条消息','msgType':'markdown'});return;}}}await this[_0x208208(0x141)]({'conversationId':_0x57bd0f,'sessionWebhook':_0xd5c47,'senderStaffId':_0x399c6b,'senderNick':_0x119a61,'message':_0x474939,'conversationConfig':_0x150a64});}async[a2_0xfaab8f(0x14f)](){const _0x4cd076=a2_0xfaab8f,_0x361fc7=Array[_0x4cd076(0x163)](this['config']['conversations'])?this[_0x4cd076(0x139)][_0x4cd076(0x12f)]:[],_0x29e08b=this['config'][_0x4cd076(0x1cb)]??this[_0x4cd076(0x21c)],_0x449d0f=_0x361fc7['length']>0x0;console[_0x4cd076(0x216)]('['+(0x0,session_1[_0x4cd076(0x193)])()+_0x4cd076(0x25d)+this[_0x4cd076(0x12d)]),console['log']('['+(0x0,session_1[_0x4cd076(0x193)])()+_0x4cd076(0x1fa)+_0x361fc7[_0x4cd076(0x206)](_0x5edafe=>_0x5edafe[_0x4cd076(0x224)]||_0x5edafe[_0x4cd076(0x1a8)])['join'](',\x20')),(0x0,api_key_manager_1[_0x4cd076(0x1ca)])(this),await(0x0,session_1[_0x4cd076(0x14a)])(this);this[_0x4cd076(0x139)]['apiKeyCfg']&&((0x0,api_key_manager_1['resetApiKeyCfg'])(this),(0x0,api_key_manager_1[_0x4cd076(0x220)])(this));this[_0x4cd076(0x185)](),this['cronEngine'][_0x4cd076(0x136)]();_0x449d0f&&console['log']('['+(0x0,session_1[_0x4cd076(0x193)])()+_0x4cd076(0x1cd)+_0x29e08b);this[_0x4cd076(0x17e)][_0x4cd076(0x236)](_0x4cd076(0x24e),async _0x270c5d=>{const _0x420489=_0x4cd076;await this[_0x420489(0x1be)](_0x270c5d);});const _0x1039cd=[];if(_0x449d0f)for(let _0x5400f4=0x0;_0x5400f4<_0x29e08b;_0x5400f4++){console[_0x4cd076(0x216)]('['+(0x0,session_1[_0x4cd076(0x193)])()+_0x4cd076(0x202)+(_0x5400f4+0x1)),_0x1039cd[_0x4cd076(0x15b)](this[_0x4cd076(0x1ac)]()[_0x4cd076(0x250)](_0x9ba3e=>console[_0x4cd076(0x1bd)](_0x4cd076(0x238)+(_0x5400f4+0x1)+'\x20错误:',_0x9ba3e)));}const _0x263cd7=this['dingStreamClient'][_0x4cd076(0x1ae)]()[_0x4cd076(0x250)](_0x532193=>{const _0x4316e8=_0x4cd076;console[_0x4316e8(0x1bd)](_0x4316e8(0x148),_0x532193),process['exit'](0x1);});await Promise['all']([_0x263cd7,..._0x1039cd]);}}exports[a2_0xfaab8f(0x20a)]=DingClaude;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a3_0x17c0b8=a3_0x1596;(function(_0x525f08,_0x556781){const _0x3b50f0=a3_0x1596,_0x3e3f3a=_0x525f08();while(!![]){try{const _0x4b5495=parseInt(_0x3b50f0(0x182))/0x1+-parseInt(_0x3b50f0(0x119))/0x2+-parseInt(_0x3b50f0(0x148))/0x3+parseInt(_0x3b50f0(0x16a))/0x4+parseInt(_0x3b50f0(0x16f))/0x5*(-parseInt(_0x3b50f0(0x174))/0x6)+parseInt(_0x3b50f0(0x13f))/0x7*(parseInt(_0x3b50f0(0x10e))/0x8)+-parseInt(_0x3b50f0(0x118))/0x9*(-parseInt(_0x3b50f0(0x196))/0xa);if(_0x4b5495===_0x556781)break;else _0x3e3f3a['push'](_0x3e3f3a['shift']());}catch(_0x41628a){_0x3e3f3a['push'](_0x3e3f3a['shift']());}}}(a3_0x2242,0x1e0f8));var __importDefault=this&&this[a3_0x17c0b8(0x18e)]||function(_0x272ea3){const _0x20645c=a3_0x17c0b8;return _0x272ea3&&_0x272ea3[_0x20645c(0x13a)]?_0x272ea3:{'default':_0x272ea3};};Object[a3_0x17c0b8(0x13b)](exports,a3_0x17c0b8(0x13a),{'value':!![]}),exports['resolveClaudeSettingsPath']=resolveClaudeSettingsPath,exports[a3_0x17c0b8(0x185)]=isRetryableApiError,exports['parseClaudeStreamLine']=parseClaudeStreamLine,exports[a3_0x17c0b8(0x142)]=interruptClaudeProcess,exports['executeClaudeQuery']=executeClaudeQuery;function a3_0x1596(_0x1d5f58,_0x2f503e){_0x1d5f58=_0x1d5f58-0xfd;const _0x22422e=a3_0x2242();let _0x15960f=_0x22422e[_0x1d5f58];return _0x15960f;}const fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a3_0x17c0b8(0x16b))),readline_1=__importDefault(require(a3_0x17c0b8(0x199))),child_process_1=require('child_process'),messaging_1=require(a3_0x17c0b8(0x17a)),session_1=require(a3_0x17c0b8(0x1a0)),api_key_manager_1=require(a3_0x17c0b8(0x102)),MAX_FAST_FAIL=0x14,API_RETRY_DELAY_MS=0x2710,FAST_FAIL_THRESHOLD_MS=0x2710;function resolveClaudeSettingsPath(_0x3cc123,_0x57594f,_0x19c5a0){const _0x21021b=a3_0x17c0b8,_0x2f99ae=(0x0,api_key_manager_1[_0x21021b(0x115)])(_0x57594f);if(_0x2f99ae)return _0x2f99ae;if(_0x3cc123[_0x21021b(0x11e)]['apiKeyCfg']){const _0x4645aa=(0x0,api_key_manager_1[_0x21021b(0x154)])(_0x57594f);let _0x44bc9b=null;_0x4645aa&&(_0x44bc9b=_0x3cc123['config'][_0x21021b(0x162)][_0x21021b(0x10b)][_0x21021b(0x19b)](_0x242c9e=>_0x242c9e['apiKey']===_0x4645aa&&_0x242c9e[_0x21021b(0x14b)])||null);!_0x44bc9b&&(_0x44bc9b=(0x0,api_key_manager_1[_0x21021b(0x161)])(_0x3cc123));if(_0x44bc9b)return(0x0,api_key_manager_1['ensureSettingsWithApiKey'])(_0x57594f,_0x44bc9b);}if(_0x3cc123[_0x21021b(0x11e)][_0x21021b(0x162)])return undefined;if(_0x19c5a0)return _0x19c5a0;const _0x542340=path_1[_0x21021b(0x19d)]['join'](_0x57594f,_0x21021b(0x18a),_0x21021b(0x105));if(fs_1[_0x21021b(0x19d)][_0x21021b(0x188)](_0x542340))return console['log']('['+(0x0,session_1[_0x21021b(0x1a8)])()+']\x20自动检测到\x20settings.json:\x20'+_0x542340),_0x542340;return undefined;}function isRetryableApiError(_0x1f423f){const _0x220ddd=a3_0x17c0b8;if(/\b429\b/[_0x220ddd(0x167)](_0x1f423f)&&!(0x0,api_key_manager_1['isQuotaExhaustedError'])(_0x1f423f))return!![];if(/API\s*Error.*422/i[_0x220ddd(0x167)](_0x1f423f))return!![];if(/\b422\b.*(?:TPM|额度超限|rate\s*limit|tokens?\s*per\s*minute)/i[_0x220ddd(0x167)](_0x1f423f))return!![];if(/(?:TPM|额度超限).*\b422\b/i[_0x220ddd(0x167)](_0x1f423f))return!![];const _0x3215e3=_0x1f423f['toLowerCase'](),_0x385aa7=[_0x220ddd(0x124),'rate_limit',_0x220ddd(0x189),_0x220ddd(0x137),_0x220ddd(0x13d),_0x220ddd(0x1a9),_0x220ddd(0x151),'overloaded',_0x220ddd(0x19e),_0x220ddd(0x156)];return _0x385aa7[_0x220ddd(0x15a)](_0x167b39=>_0x3215e3[_0x220ddd(0x179)](_0x167b39));}function sleep(_0x302d6e){return new Promise(_0x19ee5e=>setTimeout(_0x19ee5e,_0x302d6e));}class RetryableApiError extends Error{constructor(_0x339bba,_0x3d88be=''){const _0x4f29d6=a3_0x17c0b8;super('Retryable\x20API\x20error\x20(TPM\x20limit\x20etc.)'+(_0x339bba?'\x20[fast\x20fail]':'')),this[_0x4f29d6(0x163)]=_0x4f29d6(0xfd),this[_0x4f29d6(0x123)]=_0x339bba,this['output']=_0x3d88be;}}function a3_0x2242(){const _0x1c58ba=['length','isRetryableApiError',']\x20[WARN]:\x20Claude\x20进程正常退出但未产生任何回复内容\x0a','system','existsSync','ratelimit','.claude',']\x20TPM\x20限流连续快速失败\x20',']\x20[SYSTEM]:\x20TPM\x20限流,发送\x22继续\x22重试\x20(快速失败连续','settings','__importDefault','getReplyWebhook',']\x20[RAW]:\x20','assistant','now','claude','get','--resume','15650QymAku','次,放弃','isQuotaExhaustedError','readline','rotateApiKey','find',']\x20[ERROR]:\x20','default','capacity','appendSessionLog','./session','join',']\x20检测到配额耗尽错误(429),stdout匹配=','createInterface','activeSessions','没有权限','发送钉钉消息失败:',']\x20Claude\x20进程退出,代码:\x20','timestamp','requests\x20per\x20minute',']\x20[SYSTEM]:\x20TPM\x20限流,','s\x20后重试\x0a','sendDingMessage','RetryableApiError','settingLabel','end','close','resultOnly','./api-key-manager','log','authorize','settings.json','stderr','result','add',']\x20Claude\x20进程正常退出但未产生任何回复内容','tool','claudeSettings',']\x20[SYSTEM]:\x20TPM\x20限流连续快速失败,切换到新\x20Key\x0a','prompt','16JLFGTK',']\x20[Claude\x20stderr]\x20配额耗尽错误(429):\x20',']\x20[ERROR]:\x20进程错误:\x20','--agent','bypassPermissions','error','⚠️\x20Claude\x20需要授权,请人工介入','getForceEnabledSettingsPath','interrupted','content','666xgfzHs','20650PaEsuU','toString','apiKey','updateSessionFile','\x20──\x20消息来自:\x20','config','appendFileSync','warn','session_id','currentProcess','isFastFail','rate\x20limit','lastSenderStaffId',']\x20[SYSTEM]:\x20API\x20Key\x20配额耗尽(429),切换到新\x20Key\x0a','次,放弃\x0a','claudeSessionId','string','type','isAuthenticationError','input','parse','spawn','⚠️\x20当前无可用配额(无可用\x20API\x20Key),请明天再试或联系管理员','needs\x20permission','push',']\x20Claude\x20返回了空的\x20result\x20且\x20responseBuffer\x20也为空,无内容可发送','--verbose','[Claude\x20stderr]:\x20',']\x20用户主动中断,忽略错误','toLowerCase','too\x20many\x20requests','query','text','__esModule','defineProperty','startStaffId','tokens\x20per\x20minute','getSessionDir','210917WsFrdE','pipe','sessionId','interruptClaudeProcess','substring','getReplyConversationId','unknown','utf-8','stream-json','690036ckqDwC','kill','access\x20denied','isValid',']\x20TPM\x20限流快速失败连续','Claude\x20进程错误:','...',']\x20[SYSTEM]:\x20TPM\x20限流快速失败连续','stdin','rpm\x20limit','\x20(重试)','has','readApiKeyFromSettings','trim','temporarily\x20unavailable','user','conversationId',']\x20从\x20settings-ding.json\x20恢复\x20Claude\x20Setting:\x20','some','SIGINT','--permission-mode',']\x20[WARN]:\x20','TPM\x20限流,快速失败连续\x20','command','tool_use','pickValidApiKey','apiKeyCfg','name',']\x20恢复\x20Claude\x20会话:\x20',']\x20检测到\x20TPM\x20限流(进程已运行一段时间),重置快速失败计数,','catch','test','sendClaudeResponseToDing','message','638292eLrdLG','path','⚠️\x20当前无可用配额/API\x20Key,请明天再试或联系管理员','debugLog','getConversationDir','60GpbllT','thinking','\x0a```',']\x20API\x20Key\x20配额耗尽(429),切换到新\x20Key:\x20','description','71868OwMoZt','mkdirSync','output','debug','/session.log','includes','./messaging',']\x20[Claude\x20stderr]\x20可重试API错误(422\x20TPM限流):\x20','permission_required','Claude\x20进程退出,代码:\x20','line','isArray','permission\x20denied','stdout','171556EsnRCe','init'];a3_0x2242=function(){return _0x1c58ba;};return a3_0x2242();}function isPermissionError(_0x364b55){const _0x3209d7=a3_0x17c0b8,_0x2d694b=_0x364b55[_0x3209d7(0x136)](),_0x57f02f=[_0x3209d7(0x180),_0x3209d7(0x17c),_0x3209d7(0x130),'requires\x20permission','authorization\x20required',_0x3209d7(0x104),'not\x20authorized',_0x3209d7(0x14a),'需要授权','权限不足',_0x3209d7(0x1a5)];return _0x57f02f['some'](_0x9e88df=>_0x2d694b[_0x3209d7(0x179)](_0x9e88df));}function parseClaudeStreamLine(_0x8bfbf9,_0x283249=![]){const _0x398d8b=a3_0x17c0b8;if(!_0x8bfbf9[_0x398d8b(0x155)]())return null;try{const _0x1576d0=JSON['parse'](_0x8bfbf9);if(_0x1576d0[_0x398d8b(0x12a)]===_0x398d8b(0x187)&&_0x1576d0['subtype']===_0x398d8b(0x183)&&_0x1576d0['session_id'])return{'type':_0x398d8b(0x187),'sessionId':_0x1576d0[_0x398d8b(0x121)]};if(_0x1576d0[_0x398d8b(0x12a)]==='assistant'){const _0x29db9c=_0x1576d0[_0x398d8b(0x169)]?.[_0x398d8b(0x117)];if(Array[_0x398d8b(0x17f)](_0x29db9c)){const _0x1ebfa8=[];for(const _0x3228ec of _0x29db9c){if(_0x3228ec[_0x398d8b(0x12a)]===_0x398d8b(0x139)&&_0x3228ec[_0x398d8b(0x139)])_0x1ebfa8[_0x398d8b(0x131)](_0x3228ec['text']);else _0x3228ec['type']===_0x398d8b(0x170)&&_0x3228ec[_0x398d8b(0x170)]&&_0x283249&&_0x1ebfa8['push']('💭\x20**思考过程**\x0a```\x0a'+_0x3228ec[_0x398d8b(0x170)]+_0x398d8b(0x171));}if(_0x1ebfa8[_0x398d8b(0x184)]>0x0)return{'type':_0x398d8b(0x191),'content':_0x1ebfa8[_0x398d8b(0x1a1)]('\x0a')};}else{if(_0x1576d0[_0x398d8b(0x117)])return{'type':_0x398d8b(0x191),'content':typeof _0x1576d0[_0x398d8b(0x117)]===_0x398d8b(0x129)?_0x1576d0[_0x398d8b(0x117)]:JSON['stringify'](_0x1576d0[_0x398d8b(0x117)])};}return{'type':_0x398d8b(0x191)};}if(_0x1576d0[_0x398d8b(0x12a)]===_0x398d8b(0x107)){const _0x797a90=_0x1576d0[_0x398d8b(0x107)]||'';return{'type':_0x398d8b(0x107),'content':typeof _0x797a90===_0x398d8b(0x129)?_0x797a90:JSON['stringify'](_0x797a90)};}return{'type':_0x1576d0[_0x398d8b(0x12a)]||_0x398d8b(0x145)};}catch{return{'type':_0x398d8b(0x139),'content':_0x8bfbf9};}}function interruptClaudeProcess(_0x1a2f41,_0x1428ae){const _0x1ad31d=a3_0x17c0b8;if(!_0x1a2f41[_0x1ad31d(0x122)])return![];return console[_0x1ad31d(0x103)]('['+(0x0,session_1['timestamp'])()+']\x20'+_0x1428ae),_0x1a2f41[_0x1ad31d(0x116)]=!![],_0x1a2f41[_0x1ad31d(0x122)][_0x1ad31d(0x149)](_0x1ad31d(0x15b)),!![];}function runClaudeOnce(_0x4550f5,_0x51467e,_0x2567cc,_0x581461,_0xd398f6,_0x3637c6,_0x3036c0){const _0x139a43=a3_0x17c0b8;let _0x28ef42=_0x4550f5[_0x139a43(0x13e)](_0x51467e),_0x1920da=_0x28ef42+_0x139a43(0x178);const _0x38cbb9=Date['now']();return new Promise((_0x286373,_0x5ca6b2)=>{const _0x2b692f=_0x139a43,_0x4a29ce=(0x0,child_process_1[_0x2b692f(0x12e)])(_0x581461,_0x2567cc,{'cwd':_0xd398f6,'stdio':[_0x2b692f(0x140),_0x2b692f(0x140),_0x2b692f(0x140)]}),_0x336522=_0x4550f5[_0x2b692f(0x1a4)]['get'](_0x51467e[_0x2b692f(0x158)]);_0x336522&&(_0x336522[_0x2b692f(0x122)]=_0x4a29ce);fs_1[_0x2b692f(0x19d)]['appendFileSync'](_0x1920da,'['+(0x0,session_1[_0x2b692f(0x1a8)])()+']\x20[SYSTEM]:\x20Claude\x20查询启动'+(_0x3036c0?_0x2b692f(0x152):'')+'\x0a',_0x2b692f(0x146)),_0x4a29ce[_0x2b692f(0x150)]?.['write'](_0x3637c6+'\x0a'),_0x4a29ce['stdin']?.[_0x2b692f(0xff)]();let _0x2521f0=!_0x3036c0&&!!_0x51467e[_0x2b692f(0x128)],_0xbf1a90=[],_0x485586='',_0x31f6a8='',_0x50e611=![];const _0x3cddd6=new Set(),_0x1d252f=readline_1[_0x2b692f(0x19d)][_0x2b692f(0x1a3)]({'input':_0x4a29ce[_0x2b692f(0x181)]});_0x1d252f['on'](_0x2b692f(0x17e),_0xb1636d=>{const _0x2c4c1e=_0x2b692f;_0x31f6a8+=_0xb1636d+'\x0a',_0x4550f5[_0x2c4c1e(0x16d)]('Claude\x20stdout:\x20'+_0xb1636d['substring'](0x0,0xc8)+(_0xb1636d[_0x2c4c1e(0x184)]>0xc8?_0x2c4c1e(0x14e):''));if(_0x4550f5[_0x2c4c1e(0x11e)][_0x2c4c1e(0x177)])try{fs_1['default'][_0x2c4c1e(0x11f)](_0x1920da,'['+(0x0,session_1[_0x2c4c1e(0x1a8)])()+_0x2c4c1e(0x190)+_0xb1636d+'\x0a',_0x2c4c1e(0x146));}catch{}const _0x5bbb97=parseClaudeStreamLine(_0xb1636d,_0x4550f5[_0x2c4c1e(0x11e)]['includeThinking']??![]);if(_0x5bbb97){_0x5bbb97['type']==='system'&&_0x5bbb97[_0x2c4c1e(0x141)]&&!_0x2521f0&&(_0x4550f5[_0x2c4c1e(0x11c)](_0x51467e,{'claudeSessionId':_0x5bbb97[_0x2c4c1e(0x141)]}),_0x2521f0=!![],_0x28ef42=_0x4550f5[_0x2c4c1e(0x13e)](_0x51467e),_0x1920da=_0x28ef42+_0x2c4c1e(0x178));if(_0x5bbb97['type']==='assistant'){try{const _0x491e38=JSON[_0x2c4c1e(0x12d)](_0xb1636d),_0x1c3edd=_0x491e38?.['message']?.[_0x2c4c1e(0x117)];if(Array[_0x2c4c1e(0x17f)](_0x1c3edd))for(const _0x12cbac of _0x1c3edd){if(_0x12cbac[_0x2c4c1e(0x12a)]===_0x2c4c1e(0x160)&&_0x12cbac['id']&&!_0x3cddd6[_0x2c4c1e(0x153)](_0x12cbac['id'])){_0x3cddd6[_0x2c4c1e(0x108)](_0x12cbac['id']);const _0x2c4d03=_0x12cbac['name']||_0x2c4c1e(0x145);let _0x170562='';if(_0x12cbac[_0x2c4c1e(0x12c)]){if(_0x12cbac[_0x2c4c1e(0x12c)][_0x2c4c1e(0x15f)])_0x170562=_0x12cbac['input'][_0x2c4c1e(0x15f)]['substring'](0x0,0xc8);else{if(_0x12cbac[_0x2c4c1e(0x12c)]['file_path'])_0x170562=_0x12cbac[_0x2c4c1e(0x12c)]['file_path'];else{if(_0x12cbac['input']['pattern'])_0x170562=_0x12cbac[_0x2c4c1e(0x12c)]['pattern'];else{if(_0x12cbac['input'][_0x2c4c1e(0x138)])_0x170562=_0x12cbac['input'][_0x2c4c1e(0x138)];else{if(_0x12cbac[_0x2c4c1e(0x12c)][_0x2c4c1e(0x173)])_0x170562=_0x12cbac['input'][_0x2c4c1e(0x173)];else{if(_0x12cbac[_0x2c4c1e(0x12c)][_0x2c4c1e(0x10d)])_0x170562=_0x12cbac[_0x2c4c1e(0x12c)][_0x2c4c1e(0x10d)][_0x2c4c1e(0x143)](0x0,0xc8);else _0x170562=JSON['stringify'](_0x12cbac[_0x2c4c1e(0x12c)])[_0x2c4c1e(0x143)](0x0,0xc8);}}}}}}_0x4550f5[_0x2c4c1e(0x19f)](_0x28ef42,_0x2c4c1e(0x10a),''+_0x2c4d03+(_0x170562?':\x20'+_0x170562:''));}}}catch{}_0x5bbb97['content']&&_0xbf1a90[_0x2c4c1e(0x131)](_0x5bbb97[_0x2c4c1e(0x117)]);}if(_0x5bbb97[_0x2c4c1e(0x12a)]===_0x2c4c1e(0x107)){const _0x1f426c=_0x4550f5[_0x2c4c1e(0x11e)][_0x2c4c1e(0x101)]??!![],_0x20b9a4=(_0x5bbb97[_0x2c4c1e(0x117)]||'')[_0x2c4c1e(0x155)](),_0x260685=_0xbf1a90[_0x2c4c1e(0x1a1)]('\x0a')['trim'](),_0x501c73=_0x1f426c?_0x20b9a4||_0x260685:_0x260685;if(_0x501c73){try{_0x4550f5[_0x2c4c1e(0x19f)](_0x28ef42,_0x2c4c1e(0x191),_0x501c73);}catch{}const _0x4b261a=_0x4550f5[_0x2c4c1e(0x1a4)][_0x2c4c1e(0x194)](_0x51467e[_0x2c4c1e(0x158)]),_0x30772b=_0x4b261a?.[_0x2c4c1e(0x125)]||_0x51467e[_0x2c4c1e(0x13c)];_0x50e611=!![],(0x0,messaging_1[_0x2c4c1e(0x168)])(_0x4550f5,(0x0,session_1[_0x2c4c1e(0x144)])(_0x51467e),(0x0,session_1[_0x2c4c1e(0x18f)])(_0x51467e),_0x30772b,_0x501c73)[_0x2c4c1e(0x166)](_0x3f0071=>console['error'](_0x2c4c1e(0x1a6),_0x3f0071));}else console[_0x2c4c1e(0x120)]('['+(0x0,session_1[_0x2c4c1e(0x1a8)])()+_0x2c4c1e(0x132));_0xbf1a90=[];}}}),_0x4a29ce[_0x2b692f(0x106)]?.['on']('data',_0x540a50=>{const _0xf0ef4c=_0x2b692f,_0x24f718=_0x540a50[_0xf0ef4c(0x11a)]();_0x485586+=_0x24f718;if((0x0,api_key_manager_1['isQuotaExhaustedError'])(_0x24f718)){console[_0xf0ef4c(0x103)]('['+(0x0,session_1['timestamp'])()+_0xf0ef4c(0x10f)+_0x24f718[_0xf0ef4c(0x155)]());try{fs_1[_0xf0ef4c(0x19d)][_0xf0ef4c(0x11f)](_0x1920da,'['+(0x0,session_1[_0xf0ef4c(0x1a8)])()+_0xf0ef4c(0x15d)+_0x24f718,'utf-8');}catch{}}else{if(isRetryableApiError(_0x24f718)){console[_0xf0ef4c(0x103)]('['+(0x0,session_1[_0xf0ef4c(0x1a8)])()+_0xf0ef4c(0x17b)+_0x24f718[_0xf0ef4c(0x155)]());try{fs_1['default']['appendFileSync'](_0x1920da,'['+(0x0,session_1[_0xf0ef4c(0x1a8)])()+_0xf0ef4c(0x15d)+_0x24f718,_0xf0ef4c(0x146));}catch{}}else{console[_0xf0ef4c(0x113)](_0xf0ef4c(0x134)+_0x24f718);try{fs_1[_0xf0ef4c(0x19d)][_0xf0ef4c(0x11f)](_0x1920da,'['+(0x0,session_1[_0xf0ef4c(0x1a8)])()+_0xf0ef4c(0x19c)+_0x24f718,_0xf0ef4c(0x146));}catch{}}}}),_0x4a29ce['on'](_0x2b692f(0x100),_0xc8677=>{const _0x3ed04e=_0x2b692f;console[_0x3ed04e(0x103)]('['+(0x0,session_1[_0x3ed04e(0x1a8)])()+_0x3ed04e(0x1a7)+_0xc8677);try{fs_1[_0x3ed04e(0x19d)][_0x3ed04e(0x11f)](_0x1920da,'['+(0x0,session_1[_0x3ed04e(0x1a8)])()+']\x20[SYSTEM]:\x20Claude\x20查询结束,退出码:\x20'+_0xc8677+'\x0a',_0x3ed04e(0x146));}catch{}const _0x3ea924=_0x4550f5['activeSessions'][_0x3ed04e(0x194)](_0x51467e[_0x3ed04e(0x158)]);_0x3ea924&&(_0x3ea924['currentProcess']=undefined);if(_0xbf1a90[_0x3ed04e(0x184)]>0x0){const _0x23541=_0xbf1a90[_0x3ed04e(0x1a1)]('\x0a')['trim']();if(_0x23541){try{_0x4550f5[_0x3ed04e(0x19f)](_0x28ef42,_0x3ed04e(0x191),_0x23541);}catch{}const _0xbdd1b1=_0x3ea924?.['lastSenderStaffId']||_0x51467e['startStaffId'];_0x50e611=!![],(0x0,messaging_1[_0x3ed04e(0x168)])(_0x4550f5,(0x0,session_1['getReplyConversationId'])(_0x51467e),(0x0,session_1[_0x3ed04e(0x18f)])(_0x51467e),_0xbdd1b1,_0x23541)[_0x3ed04e(0x166)](_0x2d4574=>console['error'](_0x3ed04e(0x1a6),_0x2d4574));}}if(_0xc8677===0x0&&!_0x50e611&&!_0x3ea924?.[_0x3ed04e(0x116)]){console[_0x3ed04e(0x120)]('['+(0x0,session_1['timestamp'])()+_0x3ed04e(0x109));try{fs_1[_0x3ed04e(0x19d)][_0x3ed04e(0x11f)](_0x1920da,'['+(0x0,session_1[_0x3ed04e(0x1a8)])()+_0x3ed04e(0x186),_0x3ed04e(0x146));}catch{}const _0x104904=_0x3ea924?.[_0x3ed04e(0x125)]||_0x51467e[_0x3ed04e(0x13c)];(0x0,messaging_1[_0x3ed04e(0x1ac)])(_0x4550f5,{'conversationId':(0x0,session_1[_0x3ed04e(0x144)])(_0x51467e),'sessionWebhook':(0x0,session_1[_0x3ed04e(0x18f)])(_0x51467e),'atUserId':_0x104904,'content':'⚠️\x20Claude\x20处理完成但未返回任何内容,请重试或换种方式提问'})[_0x3ed04e(0x166)](_0x3b994e=>console[_0x3ed04e(0x113)](_0x3ed04e(0x1a6),_0x3b994e));}if(_0xc8677===0x0){_0x286373(0x0);return;}if(_0x3ea924?.['interrupted']){console[_0x3ed04e(0x103)]('['+(0x0,session_1['timestamp'])()+_0x3ed04e(0x135)),_0x3ea924[_0x3ed04e(0x116)]=![],_0x286373(0x0);return;}const _0x5f0728=_0x485586+'\x0a'+_0x31f6a8;if((0x0,api_key_manager_1['isQuotaExhaustedError'])(_0x5f0728)){const _0x59ed82=Date[_0x3ed04e(0x192)]()-_0x38cbb9,_0x3a8364=_0x59ed82<FAST_FAIL_THRESHOLD_MS;console[_0x3ed04e(0x103)]('['+(0x0,session_1[_0x3ed04e(0x1a8)])()+_0x3ed04e(0x1a2)+(0x0,api_key_manager_1[_0x3ed04e(0x198)])(_0x31f6a8)+',\x20stderr匹配='+(0x0,api_key_manager_1[_0x3ed04e(0x198)])(_0x485586)),_0x5ca6b2(new RetryableApiError(_0x3a8364,_0x5f0728));return;}if((0x0,api_key_manager_1[_0x3ed04e(0x12b)])(_0x5f0728)){console[_0x3ed04e(0x103)]('['+(0x0,session_1[_0x3ed04e(0x1a8)])()+']\x20检测到认证错误(401),通知用户');const _0x1ea5f2=_0x3ea924?.[_0x3ed04e(0x125)]||_0x51467e['startStaffId'];(0x0,messaging_1[_0x3ed04e(0x1ac)])(_0x4550f5,{'conversationId':(0x0,session_1[_0x3ed04e(0x144)])(_0x51467e),'sessionWebhook':(0x0,session_1[_0x3ed04e(0x18f)])(_0x51467e),'atUserId':_0x1ea5f2,'content':'⚠️\x20认证失败(401),API\x20Key\x20无效或服务未授权,请检查配置'})['catch'](_0x2e1162=>console['error'](_0x3ed04e(0x1a6),_0x2e1162)),_0x286373(_0xc8677??0x1);return;}if(isRetryableApiError(_0x5f0728)){const _0x52ea1b=Date[_0x3ed04e(0x192)]()-_0x38cbb9,_0x5142f4=_0x52ea1b<FAST_FAIL_THRESHOLD_MS;_0x5ca6b2(new RetryableApiError(_0x5142f4,_0x5f0728));return;}if(isPermissionError(_0x5f0728)){console[_0x3ed04e(0x103)]('['+(0x0,session_1[_0x3ed04e(0x1a8)])()+']\x20检测到需要授权,通知用户');const _0x1a2d00=_0x3ea924?.[_0x3ed04e(0x125)]||_0x51467e['startStaffId'];(0x0,messaging_1[_0x3ed04e(0x1ac)])(_0x4550f5,{'conversationId':(0x0,session_1['getReplyConversationId'])(_0x51467e),'sessionWebhook':(0x0,session_1[_0x3ed04e(0x18f)])(_0x51467e),'atUserId':_0x1a2d00,'content':_0x3ed04e(0x114)})[_0x3ed04e(0x166)](_0x5d13f4=>console[_0x3ed04e(0x113)](_0x3ed04e(0x1a6),_0x5d13f4)),_0x286373(_0xc8677??0x1);return;}_0x5ca6b2(new Error(_0x3ed04e(0x17d)+_0xc8677));}),_0x4a29ce['on'](_0x2b692f(0x113),_0x48d099=>{const _0x4a83aa=_0x2b692f;console['error'](_0x4a83aa(0x14d),_0x48d099),fs_1[_0x4a83aa(0x19d)]['appendFileSync'](_0x1920da,'['+(0x0,session_1[_0x4a83aa(0x1a8)])()+_0x4a83aa(0x110)+_0x48d099[_0x4a83aa(0x169)]+'\x0a',_0x4a83aa(0x146)),_0x5ca6b2(_0x48d099);});});}async function executeClaudeQuery(_0x30d71f,_0x1260c7,_0x146cf1,_0x47589a){const _0x1f758f=a3_0x17c0b8,{skill:_0x486fe6,agent:_0x10a908,senderNick:_0x534335,senderStaffId:_0x5db52a}=_0x47589a||{};let _0x3c950f=_0x30d71f[_0x1f758f(0x13e)](_0x1260c7),_0x532e5d=_0x3c950f+_0x1f758f(0x178);const _0x53f12f=_0x30d71f[_0x1f758f(0x16e)](_0x1260c7[_0x1f758f(0x158)]);fs_1[_0x1f758f(0x19d)][_0x1f758f(0x175)](_0x3c950f,{'recursive':!![]});let _0x1b5fbd=null;const _0xe6df9f=(0x0,api_key_manager_1[_0x1f758f(0x154)])(_0x53f12f);_0xe6df9f&&_0x30d71f['config']['apiKeyCfg']&&(_0x1b5fbd=_0x30d71f[_0x1f758f(0x11e)][_0x1f758f(0x162)]['claudeSettings'][_0x1f758f(0x19b)](_0x23f186=>_0x23f186[_0x1f758f(0x11b)]===_0xe6df9f&&_0x23f186['isValid'])||null,_0x1b5fbd&&console[_0x1f758f(0x103)]('['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x159)+(0x0,api_key_manager_1[_0x1f758f(0xfe)])(_0x1b5fbd)));const _0x202692=(0x0,api_key_manager_1[_0x1f758f(0x115)])(_0x53f12f);if(!_0x202692&&_0x30d71f[_0x1f758f(0x11e)][_0x1f758f(0x162)]){_0x1b5fbd=(0x0,api_key_manager_1[_0x1f758f(0x161)])(_0x30d71f);if(!_0x1b5fbd){const _0x203b01=_0x5db52a||_0x1260c7[_0x1f758f(0x13c)];await(0x0,messaging_1['sendDingMessage'])(_0x30d71f,{'conversationId':(0x0,session_1[_0x1f758f(0x144)])(_0x1260c7),'sessionWebhook':(0x0,session_1[_0x1f758f(0x18f)])(_0x1260c7),'atUserId':_0x203b01,'content':_0x1f758f(0x12f)});return;}}const _0x1c4485=_0x534335&&_0x5db52a?_0x534335+'('+_0x5db52a+')':_0x1f758f(0x145),_0x1b4e1d=_0x146cf1+_0x1f758f(0x11d)+_0x1c4485;_0x30d71f['appendSessionLog'](_0x3c950f,_0x1f758f(0x157),_0x1b4e1d);const _0xec5ed1=_0x1f758f(0x193),_0x1f4161=[_0x1f758f(0x15c),_0x1f758f(0x112),'--print','--output-format',_0x1f758f(0x147),_0x1f758f(0x133)];_0x10a908&&_0x1f4161[_0x1f758f(0x131)](_0x1f758f(0x111),_0x10a908);_0x1260c7[_0x1f758f(0x128)]&&(_0x1f4161[_0x1f758f(0x131)]('--resume',_0x1260c7[_0x1f758f(0x128)]),console[_0x1f758f(0x103)]('['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x164)+_0x1260c7['claudeSessionId']));const _0x560c6a=_0x486fe6?'/'+_0x486fe6+'\x20'+_0x1b4e1d:_0x1b4e1d;let _0x4a9a44=0x0;while(!![]){const _0x473c27=_0x4a9a44>0x0,_0x9f80e0=[..._0x1f4161],_0x329769=resolveClaudeSettingsPath(_0x30d71f,_0x53f12f,_0x47589a?.[_0x1f758f(0x18d)]);_0x329769&&_0x9f80e0[_0x1f758f(0x131)]('--settings',_0x329769);let _0x5333df;_0x473c27?(_0x1260c7[_0x1f758f(0x128)]&&!_0x9f80e0[_0x1f758f(0x179)](_0x1f758f(0x195))&&_0x9f80e0[_0x1f758f(0x131)](_0x1f758f(0x195),_0x1260c7[_0x1f758f(0x128)]),_0x5333df='继续',console[_0x1f758f(0x103)]('['+(0x0,session_1[_0x1f758f(0x1a8)])()+']\x20发送\x22继续\x22重试\x20(快速失败连续'+_0x4a9a44+'/'+MAX_FAST_FAIL+'次)'),fs_1['default'][_0x1f758f(0x11f)](_0x532e5d,'['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x18c)+_0x4a9a44+'/'+MAX_FAST_FAIL+')\x0a','utf-8')):_0x5333df=_0x560c6a;console[_0x1f758f(0x103)]('['+(0x0,session_1['timestamp'])()+']\x20执行\x20Claude\x20查询[原生claude\x20模式]:\x20'+_0xec5ed1+'\x20'+_0x9f80e0[_0x1f758f(0x1a1)]('\x20')),_0x30d71f[_0x1f758f(0x16d)]('发送消息:\x20'+_0x5333df[_0x1f758f(0x143)](0x0,0x64)+_0x1f758f(0x14e));try{await runClaudeOnce(_0x30d71f,_0x1260c7,_0x9f80e0,_0xec5ed1,_0x53f12f,_0x5333df,_0x473c27);return;}catch(_0x3b554d){_0x3c950f=_0x30d71f[_0x1f758f(0x13e)](_0x1260c7),_0x532e5d=_0x3c950f+_0x1f758f(0x178);if(_0x3b554d instanceof RetryableApiError){if((0x0,api_key_manager_1[_0x1f758f(0x198)])(_0x3b554d[_0x1f758f(0x176)])&&_0x30d71f[_0x1f758f(0x11e)][_0x1f758f(0x162)]){if(_0x1b5fbd){const _0x12b8a0=(0x0,api_key_manager_1['rotateApiKey'])(_0x30d71f,_0x1b5fbd[_0x1f758f(0x11b)]);if(_0x12b8a0){_0x1b5fbd=_0x12b8a0,_0x4a9a44=0x0,console['log']('['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x172)+(0x0,api_key_manager_1['settingLabel'])(_0x12b8a0)),fs_1[_0x1f758f(0x19d)][_0x1f758f(0x11f)](_0x532e5d,'['+(0x0,session_1['timestamp'])()+_0x1f758f(0x126),'utf-8');continue;}}const _0x7d260e=_0x5db52a||_0x1260c7['startStaffId'];await(0x0,messaging_1['sendDingMessage'])(_0x30d71f,{'conversationId':(0x0,session_1[_0x1f758f(0x144)])(_0x1260c7),'sessionWebhook':(0x0,session_1[_0x1f758f(0x18f)])(_0x1260c7),'atUserId':_0x7d260e,'content':_0x1f758f(0x16c)});return;}if(_0x3b554d[_0x1f758f(0x123)]){_0x4a9a44++;if(_0x4a9a44>=MAX_FAST_FAIL){if(_0x1b5fbd&&_0x30d71f[_0x1f758f(0x11e)][_0x1f758f(0x162)]){const _0x244fa0=(0x0,api_key_manager_1[_0x1f758f(0x19a)])(_0x30d71f,_0x1b5fbd['apiKey']);if(_0x244fa0){_0x1b5fbd=_0x244fa0,_0x4a9a44=0x0,console['log']('['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x18b)+MAX_FAST_FAIL+'\x20次,切换到新\x20Key:\x20'+(0x0,api_key_manager_1['settingLabel'])(_0x244fa0)),fs_1[_0x1f758f(0x19d)][_0x1f758f(0x11f)](_0x532e5d,'['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x10c),_0x1f758f(0x146));continue;}}console[_0x1f758f(0x103)]('['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x14c)+MAX_FAST_FAIL+_0x1f758f(0x197)),fs_1[_0x1f758f(0x19d)]['appendFileSync'](_0x532e5d,'['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x14f)+MAX_FAST_FAIL+_0x1f758f(0x127),_0x1f758f(0x146));throw new Error(_0x1f758f(0x15e)+MAX_FAST_FAIL+'\x20次');}console[_0x1f758f(0x103)]('['+(0x0,session_1['timestamp'])()+']\x20检测到\x20TPM\x20限流(快速失败),'+API_RETRY_DELAY_MS/0x3e8+'s\x20后重试\x20('+_0x4a9a44+'/'+MAX_FAST_FAIL+')');}else _0x4a9a44=0x0,console[_0x1f758f(0x103)]('['+(0x0,session_1[_0x1f758f(0x1a8)])()+_0x1f758f(0x165)+API_RETRY_DELAY_MS/0x3e8+'s\x20后重试');fs_1[_0x1f758f(0x19d)][_0x1f758f(0x11f)](_0x532e5d,'['+(0x0,session_1['timestamp'])()+_0x1f758f(0x1aa)+API_RETRY_DELAY_MS/0x3e8+_0x1f758f(0x1ab),_0x1f758f(0x146)),await sleep(API_RETRY_DELAY_MS);continue;}throw _0x3b554d;}}}
|
|
1
|
+
'use strict';const a3_0x486d6c=a3_0x5764;(function(_0x19bd54,_0x4c3565){const _0x37dc70=a3_0x5764,_0x368781=_0x19bd54();while(!![]){try{const _0x379800=parseInt(_0x37dc70(0x279))/0x1*(parseInt(_0x37dc70(0x289))/0x2)+parseInt(_0x37dc70(0x264))/0x3+-parseInt(_0x37dc70(0x1eb))/0x4+-parseInt(_0x37dc70(0x23e))/0x5+-parseInt(_0x37dc70(0x254))/0x6*(-parseInt(_0x37dc70(0x24c))/0x7)+parseInt(_0x37dc70(0x217))/0x8+parseInt(_0x37dc70(0x202))/0x9*(-parseInt(_0x37dc70(0x27a))/0xa);if(_0x379800===_0x4c3565)break;else _0x368781['push'](_0x368781['shift']());}catch(_0x3169fd){_0x368781['push'](_0x368781['shift']());}}}(a3_0x1a44,0x81705));function a3_0x1a44(){const _0x5d97c7=['没有权限','get','timestamp','stringify','isFastFail','overloaded','getReplyWebhook','utf-8','push','isRetryableApiError','--verbose','default',']\x20发送\x22继续\x22重试\x20(快速失败连续','defineProperty','debug','bypassPermissions','⚠️\x20认证失败(401),API\x20Key\x20无效或服务未授权,请检查配置','728865ycyGTQ',',\x20stderr匹配=','log','thinking','find','authorize','add','string','\x20[fast\x20fail]','--agent','debugLog','Claude\x20进程错误:','需要授权','Claude\x20进程退出,代码:\x20','4294451fbHWxh','s\x20后重试','getConversationDir',']\x20检测到\x20TPM\x20限流(进程已运行一段时间),重置快速失败计数,','\x20次,切换到新\x20Key:\x20',']\x20恢复\x20Claude\x20会话:\x20','发送钉钉消息失败:','⚠️\x20当前无可用配额(无可用\x20API\x20Key),请明天再试或联系管理员','6FictdQ','toLowerCase','⚠️\x20Claude\x20处理完成但未返回任何内容,请重试或换种方式提问','--permission-mode','toString','ConversationNotFoundError','file_path',']\x20TPM\x20限流连续快速失败\x20','warn','apiKey','now','__esModule','stderr','pattern','次,放弃\x0a',']\x20[SYSTEM]:\x20TPM\x20限流,','2036946XeVvGy','\x20(重试)',']\x20[WARN]:\x20','needs\x20permission','isArray','end','sessionId',']\x20[SYSTEM]:\x20Claude\x20查询结束,退出码:\x20','existsSync','parse','substring','input','assistant',']\x20[SYSTEM]:\x20Claude\x20查询启动','conversationId','updateSessionFile','--output-format','pickValidApiKey','output','child_process',']\x20Claude\x20进程退出,代码:\x20','4GjkWVN','16890gAZcnk',']\x20TPM\x20限流快速失败连续','sendDingMessage','⚠️\x20当前无可用配额/API\x20Key,请明天再试或联系管理员','Retryable\x20API\x20error\x20(TPM\x20limit\x20etc.)','stdout','data','resultOnly','💭\x20**思考过程**\x0a```\x0a','pipe','path','test','startStaffId',']\x20[ERROR]:\x20','line','191992JqVfvB','prompt','system','tool','trim','config',']\x20[SYSTEM]:\x20TPM\x20限流,发送\x22继续\x22重试\x20(快速失败连续','text','tool_use',']\x20[WARN]:\x20Claude\x20进程正常退出但未产生任何回复内容\x0a','getForceEnabledSettingsPath','type','rpm\x20limit',']\x20[SYSTEM]:\x20API\x20Key\x20配额耗尽(429),切换到新\x20Key\x0a',']\x20[Claude\x20stderr]\x20配额耗尽错误(429):\x20','发送消息:\x20','executeClaudeQuery','query','ensureSettingsWithApiKey','requests\x20per\x20minute','mkdirSync','stdin','capacity','currentProcess','message',']\x20Claude\x20进程正常退出但未产生任何回复内容','getSessionDir','...','545176LykvJi','has',']\x20[SYSTEM]:\x20Claude\x20会话已失效,清除旧会话并重新发起\x0a','readApiKeyFromSettings','permission\x20denied','init','too\x20many\x20requests','includes','\x0a```','claudeSessionId','settingLabel','__importDefault',']\x20[SYSTEM]:\x20TPM\x20限流快速失败连续','access\x20denied','\x20──\x20消息来自:\x20','s\x20后重试\x0a','Claude\x20stdout:\x20','length','TPM\x20限流,快速失败连续\x20','result','requires\x20permission','stream-json','lastSenderStaffId','7740zoctvV','unknown','--settings',']\x20自动检测到\x20settings.json:\x20',']\x20检测到\x20TPM\x20限流(快速失败),','appendSessionLog','rotateApiKey','join','claude','session_id','.claude','getReplyConversationId','/session.log','appendFileSync','catch','SIGINT','authorization\x20required',',通知外层重新发起新会话','command','RetryableApiError','isAuthenticationError','4706632iGIksQ','content',']\x20从\x20settings-ding.json\x20恢复\x20Claude\x20Setting:\x20','error',']\x20执行\x20Claude\x20查询[原生claude\x20模式]:\x20','apiKeyCfg','isQuotaExhaustedError','interrupted','subtype',']\x20[ERROR]:\x20进程错误:\x20','次,放弃','ratelimit','write','settings',']\x20Claude\x20会话已失效:\x20','name','claudeSettings','./session','rate_limit','parseClaudeStreamLine','activeSessions','isValid'];a3_0x1a44=function(){return _0x5d97c7;};return a3_0x1a44();}var __importDefault=this&&this[a3_0x486d6c(0x1f6)]||function(_0x38ebcb){return _0x38ebcb&&_0x38ebcb['__esModule']?_0x38ebcb:{'default':_0x38ebcb};};Object[a3_0x486d6c(0x23a)](exports,a3_0x486d6c(0x25f),{'value':!![]}),exports['resolveClaudeSettingsPath']=resolveClaudeSettingsPath,exports[a3_0x486d6c(0x236)]=isRetryableApiError,exports[a3_0x486d6c(0x22a)]=parseClaudeStreamLine,exports['interruptClaudeProcess']=interruptClaudeProcess,exports[a3_0x486d6c(0x1df)]=executeClaudeQuery;const fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a3_0x486d6c(0x284))),readline_1=__importDefault(require('readline')),child_process_1=require(a3_0x486d6c(0x277)),messaging_1=require('./messaging'),session_1=require(a3_0x486d6c(0x228)),api_key_manager_1=require('./api-key-manager'),MAX_FAST_FAIL=0x14,API_RETRY_DELAY_MS=0x2710,FAST_FAIL_THRESHOLD_MS=0x2710;function resolveClaudeSettingsPath(_0x2c1b70,_0x4f6e9b,_0x3de868){const _0x4041a1=a3_0x486d6c,_0x531056=(0x0,api_key_manager_1[_0x4041a1(0x1d9)])(_0x4f6e9b);if(_0x531056)return _0x531056;if(_0x2c1b70[_0x4041a1(0x28e)][_0x4041a1(0x21c)]){const _0x1c80a6=(0x0,api_key_manager_1[_0x4041a1(0x1ee)])(_0x4f6e9b);let _0x16d157=null;_0x1c80a6&&(_0x16d157=_0x2c1b70['config']['apiKeyCfg']['claudeSettings'][_0x4041a1(0x242)](_0xa09de=>_0xa09de[_0x4041a1(0x25d)]===_0x1c80a6&&_0xa09de['isValid'])||null);!_0x16d157&&(_0x16d157=(0x0,api_key_manager_1['pickValidApiKey'])(_0x2c1b70));if(_0x16d157)return(0x0,api_key_manager_1[_0x4041a1(0x1e1)])(_0x4f6e9b,_0x16d157);}if(_0x2c1b70[_0x4041a1(0x28e)][_0x4041a1(0x21c)])return undefined;if(_0x3de868)return _0x3de868;const _0x3cde58=path_1[_0x4041a1(0x238)][_0x4041a1(0x209)](_0x4f6e9b,_0x4041a1(0x20c),'settings.json');if(fs_1[_0x4041a1(0x238)][_0x4041a1(0x26c)](_0x3cde58))return console[_0x4041a1(0x240)]('['+(0x0,session_1[_0x4041a1(0x22f)])()+_0x4041a1(0x205)+_0x3cde58),_0x3cde58;return undefined;}function a3_0x5764(_0x4a2c70,_0x10bf4b){_0x4a2c70=_0x4a2c70-0x1d6;const _0x1a4471=a3_0x1a44();let _0x5764c2=_0x1a4471[_0x4a2c70];return _0x5764c2;}function isRetryableApiError(_0x3be1cd){const _0x52bf50=a3_0x486d6c;if(/\b429\b/[_0x52bf50(0x285)](_0x3be1cd)&&!(0x0,api_key_manager_1[_0x52bf50(0x21d)])(_0x3be1cd))return!![];if(/API\s*Error.*422/i['test'](_0x3be1cd))return!![];if(/\b422\b.*(?:TPM|额度超限|rate\s*limit|tokens?\s*per\s*minute)/i[_0x52bf50(0x285)](_0x3be1cd))return!![];if(/(?:TPM|额度超限).*\b422\b/i['test'](_0x3be1cd))return!![];const _0x2ea751=_0x3be1cd[_0x52bf50(0x255)](),_0x20b178=['rate\x20limit',_0x52bf50(0x229),_0x52bf50(0x222),_0x52bf50(0x1f1),'tokens\x20per\x20minute',_0x52bf50(0x1e2),_0x52bf50(0x1db),_0x52bf50(0x232),_0x52bf50(0x1e5),'temporarily\x20unavailable'];return _0x20b178['some'](_0x168a1c=>_0x2ea751[_0x52bf50(0x1f2)](_0x168a1c));}function sleep(_0x282043){return new Promise(_0x1fcf1a=>setTimeout(_0x1fcf1a,_0x282043));}class RetryableApiError extends Error{constructor(_0x1d594f,_0x339101=''){const _0x49c98b=a3_0x486d6c;super(_0x49c98b(0x27e)+(_0x1d594f?_0x49c98b(0x246):'')),this[_0x49c98b(0x226)]=_0x49c98b(0x215),this[_0x49c98b(0x231)]=_0x1d594f,this[_0x49c98b(0x276)]=_0x339101;}}class ConversationNotFoundError extends Error{constructor(){const _0x201521=a3_0x486d6c;super('Claude\x20conversation\x20not\x20found'),this[_0x201521(0x226)]=_0x201521(0x259);}}function isPermissionError(_0x5cb146){const _0xba565e=a3_0x486d6c,_0x25a087=_0x5cb146[_0xba565e(0x255)](),_0x1c9281=[_0xba565e(0x1ef),'permission_required',_0xba565e(0x267),_0xba565e(0x1ff),_0xba565e(0x212),_0xba565e(0x243),'not\x20authorized',_0xba565e(0x1f8),_0xba565e(0x24a),'权限不足',_0xba565e(0x22d)];return _0x1c9281['some'](_0x24a2f8=>_0x25a087[_0xba565e(0x1f2)](_0x24a2f8));}function isConversationNotFoundError(_0x4081c9){const _0x459769=a3_0x486d6c;return/no conversation found with session id/i[_0x459769(0x285)](_0x4081c9);}function parseClaudeStreamLine(_0x5bd221,_0x4e992f=![]){const _0x4356db=a3_0x486d6c;if(!_0x5bd221[_0x4356db(0x28d)]())return null;try{const _0x170a37=JSON['parse'](_0x5bd221);if(_0x170a37[_0x4356db(0x1da)]===_0x4356db(0x28b)&&_0x170a37[_0x4356db(0x21f)]===_0x4356db(0x1f0)&&_0x170a37[_0x4356db(0x20b)])return{'type':_0x4356db(0x28b),'sessionId':_0x170a37['session_id']};if(_0x170a37['type']===_0x4356db(0x270)){const _0x105c8a=_0x170a37[_0x4356db(0x1e7)]?.[_0x4356db(0x218)];if(Array[_0x4356db(0x268)](_0x105c8a)){const _0x3b9ec5=[];for(const _0x1961d6 of _0x105c8a){if(_0x1961d6[_0x4356db(0x1da)]==='text'&&_0x1961d6[_0x4356db(0x1d6)])_0x3b9ec5['push'](_0x1961d6[_0x4356db(0x1d6)]);else _0x1961d6[_0x4356db(0x1da)]==='thinking'&&_0x1961d6[_0x4356db(0x241)]&&_0x4e992f&&_0x3b9ec5[_0x4356db(0x235)](_0x4356db(0x282)+_0x1961d6[_0x4356db(0x241)]+_0x4356db(0x1f3));}if(_0x3b9ec5[_0x4356db(0x1fc)]>0x0)return{'type':'assistant','content':_0x3b9ec5['join']('\x0a')};}else{if(_0x170a37[_0x4356db(0x218)])return{'type':_0x4356db(0x270),'content':typeof _0x170a37[_0x4356db(0x218)]===_0x4356db(0x245)?_0x170a37['content']:JSON['stringify'](_0x170a37[_0x4356db(0x218)])};}return{'type':_0x4356db(0x270)};}if(_0x170a37[_0x4356db(0x1da)]===_0x4356db(0x1fe)){const _0x131d3a=_0x170a37[_0x4356db(0x1fe)]||'';return{'type':_0x4356db(0x1fe),'content':typeof _0x131d3a===_0x4356db(0x245)?_0x131d3a:JSON[_0x4356db(0x230)](_0x131d3a)};}return{'type':_0x170a37[_0x4356db(0x1da)]||_0x4356db(0x203)};}catch{return{'type':'text','content':_0x5bd221};}}function interruptClaudeProcess(_0x1c5792,_0x354788){const _0xd8caeb=a3_0x486d6c;if(!_0x1c5792['currentProcess'])return![];return console[_0xd8caeb(0x240)]('['+(0x0,session_1[_0xd8caeb(0x22f)])()+']\x20'+_0x354788),_0x1c5792['interrupted']=!![],_0x1c5792[_0xd8caeb(0x1e6)]['kill'](_0xd8caeb(0x211)),!![];}function runClaudeOnce(_0x1fe9d1,_0x56dbc8,_0x4be77c,_0x4385e9,_0x4f4940,_0x476e60,_0x4d9907){const _0x34c4fc=a3_0x486d6c;let _0x3fe9ee=_0x1fe9d1[_0x34c4fc(0x1e9)](_0x56dbc8),_0x2af0a2=_0x3fe9ee+_0x34c4fc(0x20e);!fs_1['default'][_0x34c4fc(0x26c)](_0x3fe9ee)&&fs_1[_0x34c4fc(0x238)]['mkdirSync'](_0x3fe9ee,{'recursive':!![]});const _0x3dab08=Date[_0x34c4fc(0x25e)]();return new Promise((_0x3e15bb,_0x35b7d0)=>{const _0x174b64=_0x34c4fc,_0x35bc85=(0x0,child_process_1['spawn'])(_0x4385e9,_0x4be77c,{'cwd':_0x4f4940,'stdio':[_0x174b64(0x283),_0x174b64(0x283),_0x174b64(0x283)]}),_0x947fb8=_0x1fe9d1[_0x174b64(0x22b)]['get'](_0x56dbc8[_0x174b64(0x272)]);_0x947fb8&&(_0x947fb8[_0x174b64(0x1e6)]=_0x35bc85);fs_1[_0x174b64(0x238)][_0x174b64(0x20f)](_0x2af0a2,'['+(0x0,session_1[_0x174b64(0x22f)])()+_0x174b64(0x271)+(_0x4d9907?_0x174b64(0x265):'')+'\x0a','utf-8'),_0x35bc85['stdin']?.[_0x174b64(0x223)](_0x476e60+'\x0a'),_0x35bc85[_0x174b64(0x1e4)]?.[_0x174b64(0x269)]();let _0xf90a29=!_0x4d9907&&!!_0x56dbc8[_0x174b64(0x1f4)],_0x4903a2=[],_0x7d1501='',_0x4c96c1='',_0x56b2ec=![];const _0x17327f=new Set(),_0x26bf11=readline_1[_0x174b64(0x238)]['createInterface']({'input':_0x35bc85[_0x174b64(0x27f)]});_0x26bf11['on'](_0x174b64(0x288),_0x4ab809=>{const _0x1e3d9=_0x174b64;_0x4c96c1+=_0x4ab809+'\x0a',_0x1fe9d1[_0x1e3d9(0x248)](_0x1e3d9(0x1fb)+_0x4ab809[_0x1e3d9(0x26e)](0x0,0xc8)+(_0x4ab809[_0x1e3d9(0x1fc)]>0xc8?'...':''));if(_0x1fe9d1['config'][_0x1e3d9(0x23b)])try{fs_1[_0x1e3d9(0x238)][_0x1e3d9(0x20f)](_0x2af0a2,'['+(0x0,session_1[_0x1e3d9(0x22f)])()+']\x20[RAW]:\x20'+_0x4ab809+'\x0a',_0x1e3d9(0x234));}catch{}const _0x1ec1b5=parseClaudeStreamLine(_0x4ab809,_0x1fe9d1[_0x1e3d9(0x28e)]['includeThinking']??![]);if(_0x1ec1b5){_0x1ec1b5['type']===_0x1e3d9(0x28b)&&_0x1ec1b5[_0x1e3d9(0x26a)]&&!_0xf90a29&&(_0x1fe9d1[_0x1e3d9(0x273)](_0x56dbc8,{'claudeSessionId':_0x1ec1b5[_0x1e3d9(0x26a)]}),_0xf90a29=!![],_0x3fe9ee=_0x1fe9d1['getSessionDir'](_0x56dbc8),_0x2af0a2=_0x3fe9ee+_0x1e3d9(0x20e));if(_0x1ec1b5[_0x1e3d9(0x1da)]===_0x1e3d9(0x270)){try{const _0x5292b9=JSON[_0x1e3d9(0x26d)](_0x4ab809),_0x3a4f4e=_0x5292b9?.['message']?.['content'];if(Array[_0x1e3d9(0x268)](_0x3a4f4e))for(const _0x1c76cd of _0x3a4f4e){if(_0x1c76cd[_0x1e3d9(0x1da)]===_0x1e3d9(0x1d7)&&_0x1c76cd['id']&&!_0x17327f[_0x1e3d9(0x1ec)](_0x1c76cd['id'])){_0x17327f[_0x1e3d9(0x244)](_0x1c76cd['id']);const _0x1e5e11=_0x1c76cd[_0x1e3d9(0x226)]||'unknown';let _0x49256d='';if(_0x1c76cd['input']){if(_0x1c76cd[_0x1e3d9(0x26f)]['command'])_0x49256d=_0x1c76cd['input'][_0x1e3d9(0x214)][_0x1e3d9(0x26e)](0x0,0xc8);else{if(_0x1c76cd[_0x1e3d9(0x26f)][_0x1e3d9(0x25a)])_0x49256d=_0x1c76cd[_0x1e3d9(0x26f)]['file_path'];else{if(_0x1c76cd['input'][_0x1e3d9(0x261)])_0x49256d=_0x1c76cd['input'][_0x1e3d9(0x261)];else{if(_0x1c76cd[_0x1e3d9(0x26f)][_0x1e3d9(0x1e0)])_0x49256d=_0x1c76cd[_0x1e3d9(0x26f)][_0x1e3d9(0x1e0)];else{if(_0x1c76cd[_0x1e3d9(0x26f)]['description'])_0x49256d=_0x1c76cd[_0x1e3d9(0x26f)]['description'];else{if(_0x1c76cd[_0x1e3d9(0x26f)][_0x1e3d9(0x28a)])_0x49256d=_0x1c76cd['input'][_0x1e3d9(0x28a)]['substring'](0x0,0xc8);else _0x49256d=JSON[_0x1e3d9(0x230)](_0x1c76cd[_0x1e3d9(0x26f)])[_0x1e3d9(0x26e)](0x0,0xc8);}}}}}}_0x1fe9d1[_0x1e3d9(0x207)](_0x3fe9ee,_0x1e3d9(0x28c),''+_0x1e5e11+(_0x49256d?':\x20'+_0x49256d:''));}}}catch{}_0x1ec1b5[_0x1e3d9(0x218)]&&_0x4903a2[_0x1e3d9(0x235)](_0x1ec1b5['content']);}if(_0x1ec1b5[_0x1e3d9(0x1da)]==='result'){const _0x299bb0=_0x1fe9d1[_0x1e3d9(0x28e)][_0x1e3d9(0x281)]??!![],_0x1062ae=(_0x1ec1b5['content']||'')[_0x1e3d9(0x28d)](),_0x3e35b2=_0x4903a2['join']('\x0a')[_0x1e3d9(0x28d)](),_0x262fcf=_0x299bb0?_0x1062ae||_0x3e35b2:_0x3e35b2;if(_0x262fcf){try{_0x1fe9d1[_0x1e3d9(0x207)](_0x3fe9ee,'assistant',_0x262fcf);}catch{}const _0x319f5f=_0x1fe9d1[_0x1e3d9(0x22b)][_0x1e3d9(0x22e)](_0x56dbc8[_0x1e3d9(0x272)]),_0x475d3c=_0x319f5f?.['lastSenderStaffId']||_0x56dbc8[_0x1e3d9(0x286)];_0x56b2ec=!![],(0x0,messaging_1['sendClaudeResponseToDing'])(_0x1fe9d1,(0x0,session_1['getReplyConversationId'])(_0x56dbc8),(0x0,session_1[_0x1e3d9(0x233)])(_0x56dbc8),_0x475d3c,_0x262fcf)[_0x1e3d9(0x210)](_0x5937ba=>console[_0x1e3d9(0x21a)](_0x1e3d9(0x252),_0x5937ba));}else console[_0x1e3d9(0x25c)]('['+(0x0,session_1[_0x1e3d9(0x22f)])()+']\x20Claude\x20返回了空的\x20result\x20且\x20responseBuffer\x20也为空,无内容可发送');_0x4903a2=[];}}}),_0x35bc85[_0x174b64(0x260)]?.['on'](_0x174b64(0x280),_0x41fdaa=>{const _0x441aae=_0x174b64,_0x3b7ddd=_0x41fdaa[_0x441aae(0x258)]();_0x7d1501+=_0x3b7ddd;if((0x0,api_key_manager_1[_0x441aae(0x21d)])(_0x3b7ddd)){console[_0x441aae(0x240)]('['+(0x0,session_1['timestamp'])()+_0x441aae(0x1dd)+_0x3b7ddd[_0x441aae(0x28d)]());try{fs_1[_0x441aae(0x238)]['appendFileSync'](_0x2af0a2,'['+(0x0,session_1[_0x441aae(0x22f)])()+']\x20[WARN]:\x20'+_0x3b7ddd,_0x441aae(0x234));}catch{}}else{if(isRetryableApiError(_0x3b7ddd)){console[_0x441aae(0x240)]('['+(0x0,session_1[_0x441aae(0x22f)])()+']\x20[Claude\x20stderr]\x20可重试API错误(422\x20TPM限流):\x20'+_0x3b7ddd['trim']());try{fs_1[_0x441aae(0x238)][_0x441aae(0x20f)](_0x2af0a2,'['+(0x0,session_1[_0x441aae(0x22f)])()+_0x441aae(0x266)+_0x3b7ddd,_0x441aae(0x234));}catch{}}else{console['error']('[Claude\x20stderr]:\x20'+_0x3b7ddd);try{fs_1[_0x441aae(0x238)]['appendFileSync'](_0x2af0a2,'['+(0x0,session_1[_0x441aae(0x22f)])()+_0x441aae(0x287)+_0x3b7ddd,_0x441aae(0x234));}catch{}}}}),_0x35bc85['on']('close',_0x5acdd1=>{const _0x381f74=_0x174b64;console[_0x381f74(0x240)]('['+(0x0,session_1[_0x381f74(0x22f)])()+_0x381f74(0x278)+_0x5acdd1);try{fs_1[_0x381f74(0x238)]['appendFileSync'](_0x2af0a2,'['+(0x0,session_1[_0x381f74(0x22f)])()+_0x381f74(0x26b)+_0x5acdd1+'\x0a','utf-8');}catch{}const _0x46176e=_0x1fe9d1[_0x381f74(0x22b)][_0x381f74(0x22e)](_0x56dbc8['conversationId']);_0x46176e&&(_0x46176e[_0x381f74(0x1e6)]=undefined);if(_0x4903a2[_0x381f74(0x1fc)]>0x0){const _0x341293=_0x4903a2['join']('\x0a')[_0x381f74(0x28d)]();if(_0x341293){try{_0x1fe9d1['appendSessionLog'](_0x3fe9ee,_0x381f74(0x270),_0x341293);}catch{}const _0x174a90=_0x46176e?.[_0x381f74(0x201)]||_0x56dbc8[_0x381f74(0x286)];_0x56b2ec=!![],(0x0,messaging_1['sendClaudeResponseToDing'])(_0x1fe9d1,(0x0,session_1['getReplyConversationId'])(_0x56dbc8),(0x0,session_1[_0x381f74(0x233)])(_0x56dbc8),_0x174a90,_0x341293)['catch'](_0x52a888=>console[_0x381f74(0x21a)](_0x381f74(0x252),_0x52a888));}}if(_0x5acdd1===0x0&&!_0x56b2ec&&!_0x46176e?.[_0x381f74(0x21e)]){console[_0x381f74(0x25c)]('['+(0x0,session_1[_0x381f74(0x22f)])()+_0x381f74(0x1e8));try{fs_1[_0x381f74(0x238)][_0x381f74(0x20f)](_0x2af0a2,'['+(0x0,session_1[_0x381f74(0x22f)])()+_0x381f74(0x1d8),_0x381f74(0x234));}catch{}const _0x5810a9=_0x46176e?.[_0x381f74(0x201)]||_0x56dbc8['startStaffId'];(0x0,messaging_1[_0x381f74(0x27c)])(_0x1fe9d1,{'conversationId':(0x0,session_1['getReplyConversationId'])(_0x56dbc8),'sessionWebhook':(0x0,session_1['getReplyWebhook'])(_0x56dbc8),'atUserId':_0x5810a9,'content':_0x381f74(0x256)})[_0x381f74(0x210)](_0x55b47f=>console['error'](_0x381f74(0x252),_0x55b47f));}if(_0x5acdd1===0x0){_0x3e15bb(0x0);return;}if(_0x46176e?.['interrupted']){console[_0x381f74(0x240)]('['+(0x0,session_1[_0x381f74(0x22f)])()+']\x20用户主动中断,忽略错误'),_0x46176e[_0x381f74(0x21e)]=![],_0x3e15bb(0x0);return;}const _0x14054e=_0x7d1501+'\x0a'+_0x4c96c1;if((0x0,api_key_manager_1[_0x381f74(0x21d)])(_0x14054e)){const _0x1e4a97=Date[_0x381f74(0x25e)]()-_0x3dab08,_0x60674b=_0x1e4a97<FAST_FAIL_THRESHOLD_MS;console[_0x381f74(0x240)]('['+(0x0,session_1[_0x381f74(0x22f)])()+']\x20检测到配额耗尽错误(429),stdout匹配='+(0x0,api_key_manager_1[_0x381f74(0x21d)])(_0x4c96c1)+_0x381f74(0x23f)+(0x0,api_key_manager_1[_0x381f74(0x21d)])(_0x7d1501)),_0x35b7d0(new RetryableApiError(_0x60674b,_0x14054e));return;}if((0x0,api_key_manager_1[_0x381f74(0x216)])(_0x14054e)){console[_0x381f74(0x240)]('['+(0x0,session_1[_0x381f74(0x22f)])()+']\x20检测到认证错误(401),通知用户');const _0x383c78=_0x46176e?.[_0x381f74(0x201)]||_0x56dbc8['startStaffId'];(0x0,messaging_1['sendDingMessage'])(_0x1fe9d1,{'conversationId':(0x0,session_1['getReplyConversationId'])(_0x56dbc8),'sessionWebhook':(0x0,session_1['getReplyWebhook'])(_0x56dbc8),'atUserId':_0x383c78,'content':_0x381f74(0x23d)})[_0x381f74(0x210)](_0x3072c2=>console[_0x381f74(0x21a)](_0x381f74(0x252),_0x3072c2)),_0x3e15bb(_0x5acdd1??0x1);return;}if(isRetryableApiError(_0x14054e)){const _0x2cead9=Date[_0x381f74(0x25e)]()-_0x3dab08,_0x11fe72=_0x2cead9<FAST_FAIL_THRESHOLD_MS;_0x35b7d0(new RetryableApiError(_0x11fe72,_0x14054e));return;}if(isPermissionError(_0x14054e)){console[_0x381f74(0x240)]('['+(0x0,session_1[_0x381f74(0x22f)])()+']\x20检测到需要授权,通知用户');const _0x112b0f=_0x46176e?.[_0x381f74(0x201)]||_0x56dbc8[_0x381f74(0x286)];(0x0,messaging_1[_0x381f74(0x27c)])(_0x1fe9d1,{'conversationId':(0x0,session_1['getReplyConversationId'])(_0x56dbc8),'sessionWebhook':(0x0,session_1[_0x381f74(0x233)])(_0x56dbc8),'atUserId':_0x112b0f,'content':'⚠️\x20Claude\x20需要授权,请人工介入'})['catch'](_0x19c073=>console[_0x381f74(0x21a)](_0x381f74(0x252),_0x19c073)),_0x3e15bb(_0x5acdd1??0x1);return;}if(_0x56dbc8[_0x381f74(0x1f4)]&&isConversationNotFoundError(_0x14054e)){console[_0x381f74(0x240)]('['+(0x0,session_1[_0x381f74(0x22f)])()+_0x381f74(0x225)+_0x56dbc8[_0x381f74(0x1f4)]+_0x381f74(0x213)),_0x35b7d0(new ConversationNotFoundError());return;}_0x35b7d0(new Error(_0x381f74(0x24b)+_0x5acdd1));}),_0x35bc85['on']('error',_0x5b5e87=>{const _0x262e3e=_0x174b64;console[_0x262e3e(0x21a)](_0x262e3e(0x249),_0x5b5e87),fs_1['default'][_0x262e3e(0x20f)](_0x2af0a2,'['+(0x0,session_1[_0x262e3e(0x22f)])()+_0x262e3e(0x220)+_0x5b5e87[_0x262e3e(0x1e7)]+'\x0a',_0x262e3e(0x234)),_0x35b7d0(_0x5b5e87);});});}async function executeClaudeQuery(_0x30c99f,_0x588897,_0x3e78b4,_0x158a34){const _0x27fbf1=a3_0x486d6c,{skill:_0xc1e1a3,agent:_0x488447,senderNick:_0x14a328,senderStaffId:_0x2d9f2f}=_0x158a34||{};let _0x25ed92=_0x30c99f[_0x27fbf1(0x1e9)](_0x588897),_0x260802=_0x25ed92+'/session.log';const _0x5a9c67=_0x30c99f[_0x27fbf1(0x24e)](_0x588897[_0x27fbf1(0x272)]);fs_1[_0x27fbf1(0x238)][_0x27fbf1(0x1e3)](_0x25ed92,{'recursive':!![]});let _0x3f5c35=null;const _0x19fbde=(0x0,api_key_manager_1[_0x27fbf1(0x1ee)])(_0x5a9c67);_0x19fbde&&_0x30c99f['config']['apiKeyCfg']&&(_0x3f5c35=_0x30c99f[_0x27fbf1(0x28e)][_0x27fbf1(0x21c)][_0x27fbf1(0x227)][_0x27fbf1(0x242)](_0x25a653=>_0x25a653['apiKey']===_0x19fbde&&_0x25a653[_0x27fbf1(0x22c)])||null,_0x3f5c35&&console['log']('['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x219)+(0x0,api_key_manager_1[_0x27fbf1(0x1f5)])(_0x3f5c35)));const _0x3bde22=(0x0,api_key_manager_1['getForceEnabledSettingsPath'])(_0x5a9c67);if(!_0x3bde22&&_0x30c99f[_0x27fbf1(0x28e)]['apiKeyCfg']){_0x3f5c35=(0x0,api_key_manager_1[_0x27fbf1(0x275)])(_0x30c99f);if(!_0x3f5c35){const _0x142494=_0x2d9f2f||_0x588897[_0x27fbf1(0x286)];await(0x0,messaging_1[_0x27fbf1(0x27c)])(_0x30c99f,{'conversationId':(0x0,session_1[_0x27fbf1(0x20d)])(_0x588897),'sessionWebhook':(0x0,session_1[_0x27fbf1(0x233)])(_0x588897),'atUserId':_0x142494,'content':_0x27fbf1(0x253)});return;}}const _0x37cbc7=_0x14a328&&_0x2d9f2f?_0x14a328+'('+_0x2d9f2f+')':_0x27fbf1(0x203),_0xff6e6f=_0x3e78b4+_0x27fbf1(0x1f9)+_0x37cbc7;_0x30c99f[_0x27fbf1(0x207)](_0x25ed92,'user',_0xff6e6f);const _0x1ed9c4=_0x27fbf1(0x20a),_0x170089=[_0x27fbf1(0x257),_0x27fbf1(0x23c),'--print',_0x27fbf1(0x274),_0x27fbf1(0x200),_0x27fbf1(0x237)];_0x488447&&_0x170089[_0x27fbf1(0x235)](_0x27fbf1(0x247),_0x488447);const _0x419b81=_0xc1e1a3?'/'+_0xc1e1a3+'\x20'+_0xff6e6f:_0xff6e6f;let _0xa55ab7=0x0;while(!![]){const _0x35a160=_0xa55ab7>0x0,_0x451ed3=[..._0x170089];_0x588897[_0x27fbf1(0x1f4)]&&(_0x451ed3['push']('--resume',_0x588897[_0x27fbf1(0x1f4)]),!_0x35a160&&console[_0x27fbf1(0x240)]('['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x251)+_0x588897[_0x27fbf1(0x1f4)]));const _0x369454=resolveClaudeSettingsPath(_0x30c99f,_0x5a9c67,_0x158a34?.[_0x27fbf1(0x224)]);_0x369454&&_0x451ed3[_0x27fbf1(0x235)](_0x27fbf1(0x204),_0x369454);let _0x54efc5;_0x35a160?(_0x54efc5='继续',console[_0x27fbf1(0x240)]('['+(0x0,session_1['timestamp'])()+_0x27fbf1(0x239)+_0xa55ab7+'/'+MAX_FAST_FAIL+'次)'),fs_1['default'][_0x27fbf1(0x20f)](_0x260802,'['+(0x0,session_1['timestamp'])()+_0x27fbf1(0x28f)+_0xa55ab7+'/'+MAX_FAST_FAIL+')\x0a','utf-8')):_0x54efc5=_0x419b81;console[_0x27fbf1(0x240)]('['+(0x0,session_1['timestamp'])()+_0x27fbf1(0x21b)+_0x1ed9c4+'\x20'+_0x451ed3[_0x27fbf1(0x209)]('\x20')),_0x30c99f[_0x27fbf1(0x248)](_0x27fbf1(0x1de)+_0x54efc5[_0x27fbf1(0x26e)](0x0,0x64)+_0x27fbf1(0x1ea));try{await runClaudeOnce(_0x30c99f,_0x588897,_0x451ed3,_0x1ed9c4,_0x5a9c67,_0x54efc5,_0x35a160);return;}catch(_0x13e097){_0x25ed92=_0x30c99f[_0x27fbf1(0x1e9)](_0x588897),_0x260802=_0x25ed92+_0x27fbf1(0x20e);if(_0x13e097 instanceof RetryableApiError){if((0x0,api_key_manager_1[_0x27fbf1(0x21d)])(_0x13e097[_0x27fbf1(0x276)])&&_0x30c99f['config']['apiKeyCfg']){if(_0x3f5c35){const _0x159aa3=(0x0,api_key_manager_1['rotateApiKey'])(_0x30c99f,_0x3f5c35[_0x27fbf1(0x25d)]);if(_0x159aa3){_0x3f5c35=_0x159aa3,_0xa55ab7=0x0,console[_0x27fbf1(0x240)]('['+(0x0,session_1[_0x27fbf1(0x22f)])()+']\x20API\x20Key\x20配额耗尽(429),切换到新\x20Key:\x20'+(0x0,api_key_manager_1['settingLabel'])(_0x159aa3)),fs_1[_0x27fbf1(0x238)][_0x27fbf1(0x20f)](_0x260802,'['+(0x0,session_1['timestamp'])()+_0x27fbf1(0x1dc),_0x27fbf1(0x234));continue;}}const _0x147317=_0x2d9f2f||_0x588897[_0x27fbf1(0x286)];await(0x0,messaging_1[_0x27fbf1(0x27c)])(_0x30c99f,{'conversationId':(0x0,session_1[_0x27fbf1(0x20d)])(_0x588897),'sessionWebhook':(0x0,session_1[_0x27fbf1(0x233)])(_0x588897),'atUserId':_0x147317,'content':_0x27fbf1(0x27d)});return;}if(_0x13e097[_0x27fbf1(0x231)]){_0xa55ab7++;if(_0xa55ab7>=MAX_FAST_FAIL){if(_0x3f5c35&&_0x30c99f[_0x27fbf1(0x28e)][_0x27fbf1(0x21c)]){const _0x5b14a4=(0x0,api_key_manager_1[_0x27fbf1(0x208)])(_0x30c99f,_0x3f5c35[_0x27fbf1(0x25d)]);if(_0x5b14a4){_0x3f5c35=_0x5b14a4,_0xa55ab7=0x0,console[_0x27fbf1(0x240)]('['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x25b)+MAX_FAST_FAIL+_0x27fbf1(0x250)+(0x0,api_key_manager_1[_0x27fbf1(0x1f5)])(_0x5b14a4)),fs_1[_0x27fbf1(0x238)][_0x27fbf1(0x20f)](_0x260802,'['+(0x0,session_1[_0x27fbf1(0x22f)])()+']\x20[SYSTEM]:\x20TPM\x20限流连续快速失败,切换到新\x20Key\x0a',_0x27fbf1(0x234));continue;}}console['log']('['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x27b)+MAX_FAST_FAIL+_0x27fbf1(0x221)),fs_1['default'][_0x27fbf1(0x20f)](_0x260802,'['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x1f7)+MAX_FAST_FAIL+_0x27fbf1(0x262),_0x27fbf1(0x234));throw new Error(_0x27fbf1(0x1fd)+MAX_FAST_FAIL+'\x20次');}console[_0x27fbf1(0x240)]('['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x206)+API_RETRY_DELAY_MS/0x3e8+'s\x20后重试\x20('+_0xa55ab7+'/'+MAX_FAST_FAIL+')');}else _0xa55ab7=0x0,console[_0x27fbf1(0x240)]('['+(0x0,session_1['timestamp'])()+_0x27fbf1(0x24f)+API_RETRY_DELAY_MS/0x3e8+_0x27fbf1(0x24d));fs_1['default'][_0x27fbf1(0x20f)](_0x260802,'['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x263)+API_RETRY_DELAY_MS/0x3e8+_0x27fbf1(0x1fa),_0x27fbf1(0x234)),await sleep(API_RETRY_DELAY_MS);continue;}if(_0x13e097 instanceof ConversationNotFoundError){console[_0x27fbf1(0x240)]('['+(0x0,session_1[_0x27fbf1(0x22f)])()+']\x20Claude\x20会话失效,清除\x20claudeSessionId\x20并重新发起'),fs_1[_0x27fbf1(0x238)][_0x27fbf1(0x20f)](_0x260802,'['+(0x0,session_1[_0x27fbf1(0x22f)])()+_0x27fbf1(0x1ed),'utf-8');_0x588897[_0x27fbf1(0x1f4)]&&(_0x588897['claudeSessionId']=undefined,_0x30c99f[_0x27fbf1(0x273)](_0x588897,{}));_0xa55ab7=0x0;continue;}throw _0x13e097;}}}
|
package/dist/src/biz/commands.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a4_0x19fe69=a4_0x267b;(function(_0x2a5021,_0x47f45f){const _0x27f7ac=a4_0x267b,_0x25ef0b=_0x2a5021();while(!![]){try{const _0xe9e9e4=-parseInt(_0x27f7ac(0x156))/0x1*(-parseInt(_0x27f7ac(0x11d))/0x2)+-parseInt(_0x27f7ac(0x157))/0x3*(-parseInt(_0x27f7ac(0x17e))/0x4)+parseInt(_0x27f7ac(0xfe))/0x5*(-parseInt(_0x27f7ac(0x121))/0x6)+parseInt(_0x27f7ac(0x110))/0x7+parseInt(_0x27f7ac(0x147))/0x8+parseInt(_0x27f7ac(0x191))/0x9+-parseInt(_0x27f7ac(0x126))/0xa*(parseInt(_0x27f7ac(0x146))/0xb);if(_0xe9e9e4===_0x47f45f)break;else _0x25ef0b['push'](_0x25ef0b['shift']());}catch(_0xa5690d){_0x25ef0b['push'](_0x25ef0b['shift']());}}}(a4_0x2636,0xd81a5));var __importDefault=this&&this[a4_0x19fe69(0xf8)]||function(_0xe7c0f){const _0xf8c78c=a4_0x19fe69;return _0xe7c0f&&_0xe7c0f[_0xf8c78c(0x13e)]?_0xe7c0f:{'default':_0xe7c0f};};Object[a4_0x19fe69(0x114)](exports,'__esModule',{'value':!![]}),exports[a4_0x19fe69(0x194)]=parseHelpCommand,exports[a4_0x19fe69(0x13b)]=parseCommandHelp,exports[a4_0x19fe69(0x188)]=getCommandByName,exports[a4_0x19fe69(0x101)]=formatHelpOverview,exports[a4_0x19fe69(0x190)]=formatCommandHelp,exports[a4_0x19fe69(0x178)]=parseEndCommand,exports[a4_0x19fe69(0x132)]=parseInfoCommand,exports['formatConversationInfo']=formatConversationInfo,exports[a4_0x19fe69(0x168)]=parseLogCommand,exports[a4_0x19fe69(0x141)]=parseLsCommand,exports[a4_0x19fe69(0x16d)]=findSubdirByName,exports[a4_0x19fe69(0x187)]=getDirectoryStructure,exports['parseContinueSessionCommand']=parseContinueSessionCommand,exports['parseCronCommand']=parseCronCommand,exports[a4_0x19fe69(0x102)]=parsePwdCommand,exports['parseVersionCommand']=parseVersionCommand,exports[a4_0x19fe69(0x11b)]=parseMkdirCommand,exports['parseTouchCommand']=parseTouchCommand,exports['parseRmCommand']=parseRmCommand,exports[a4_0x19fe69(0x151)]=parseOpenCommand,exports['parseCleanCommand']=parseCleanCommand,exports['parseResetApiKeyCfgCommand']=parseResetApiKeyCfgCommand,exports[a4_0x19fe69(0xf9)]=parseRegCommand,exports[a4_0x19fe69(0x138)]=parseAuthCommand;const fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a4_0x19fe69(0x18c))),COMMAND_REGISTRY=[{'name':a4_0x19fe69(0x11c),'description':a4_0x19fe69(0x169),'usage':a4_0x19fe69(0x11c),'examples':[a4_0x19fe69(0x11c)],'category':'系统'},{'name':'/info','description':a4_0x19fe69(0x107),'usage':a4_0x19fe69(0x140),'examples':[a4_0x19fe69(0x149),'/info\x20robot',a4_0x19fe69(0x145),a4_0x19fe69(0x14a)],'category':'系统'},{'name':a4_0x19fe69(0x136),'description':'查看最近会话日志','usage':a4_0x19fe69(0x197),'examples':[a4_0x19fe69(0x136),'/log\x2020'],'category':'会话'},{'name':a4_0x19fe69(0x10a),'description':a4_0x19fe69(0x112),'usage':'/new\x20[初始消息]','examples':[a4_0x19fe69(0x10a),'/new\x20帮我分析一下这个项目'],'category':'会话'},{'name':'/resume','description':a4_0x19fe69(0x161),'usage':a4_0x19fe69(0x129),'examples':[a4_0x19fe69(0x196),a4_0x19fe69(0x130)],'category':'会话'},{'name':'/end','description':'结束当前会话','usage':a4_0x19fe69(0x19e),'examples':[a4_0x19fe69(0x19e)],'category':'会话'},{'name':a4_0x19fe69(0x10c),'description':a4_0x19fe69(0x12e),'usage':a4_0x19fe69(0x184),'examples':[a4_0x19fe69(0x128)],'category':'任务'},{'name':a4_0x19fe69(0x17f),'description':a4_0x19fe69(0x10b),'usage':a4_0x19fe69(0x18e),'examples':[a4_0x19fe69(0x166),a4_0x19fe69(0x174),'/cron\x20list','/cron\x20pause\x20cron_123',a4_0x19fe69(0x139)],'category':'任务'},{'name':a4_0x19fe69(0x16c),'description':a4_0x19fe69(0x175),'usage':'/pwd','examples':[a4_0x19fe69(0x16c)],'category':'文件'},{'name':a4_0x19fe69(0x179),'description':a4_0x19fe69(0x104),'usage':a4_0x19fe69(0x125),'examples':[a4_0x19fe69(0x179),'/ls\x20root\x202',a4_0x19fe69(0x195)],'category':'文件'},{'name':a4_0x19fe69(0x154),'description':a4_0x19fe69(0x119),'usage':a4_0x19fe69(0x144),'examples':['/mkdir\x20src',a4_0x19fe69(0x113),'/mkdir\x20./docs'],'category':'文件'},{'name':a4_0x19fe69(0x12d),'description':a4_0x19fe69(0x143),'usage':a4_0x19fe69(0x159),'examples':[a4_0x19fe69(0x15f),a4_0x19fe69(0x12f),a4_0x19fe69(0x173)],'category':'文件'},{'name':a4_0x19fe69(0x120),'description':a4_0x19fe69(0x122),'usage':a4_0x19fe69(0x135),'examples':['/rm\x20temp.txt',a4_0x19fe69(0x18d),a4_0x19fe69(0x18b)],'category':'文件'},{'name':'/version','description':a4_0x19fe69(0x160),'usage':a4_0x19fe69(0x14b),'examples':['/version'],'category':'系统'},{'name':a4_0x19fe69(0x15a),'description':a4_0x19fe69(0x111),'usage':a4_0x19fe69(0x13c),'examples':['/open',a4_0x19fe69(0x11e)],'category':'管理','ownerOnly':!![]},{'name':'/clean','description':a4_0x19fe69(0x106),'usage':a4_0x19fe69(0x17a),'examples':[a4_0x19fe69(0x17a)],'category':'管理','ownerOnly':!![]},{'name':a4_0x19fe69(0x14f),'description':a4_0x19fe69(0x176),'usage':a4_0x19fe69(0x14f),'examples':[a4_0x19fe69(0x14f)],'category':'管理','ownerOnly':!![]},{'name':a4_0x19fe69(0x133),'description':a4_0x19fe69(0x163),'usage':a4_0x19fe69(0x170),'examples':[a4_0x19fe69(0x133),a4_0x19fe69(0x12c),a4_0x19fe69(0x116)],'category':'管理','ownerOnly':!![]},{'name':a4_0x19fe69(0x199),'description':a4_0x19fe69(0x10d),'usage':'/auth\x20[add|del\x20<手机号或userId>]','examples':[a4_0x19fe69(0x199),a4_0x19fe69(0x14d),'/auth\x20del\x2013800138000'],'category':'管理','ownerOnly':!![]}],CATEGORY_DISPLAY=[{'category':'会话','icon':'💬'},{'category':'任务','icon':'📋'},{'category':'文件','icon':'📂'},{'category':'系统','icon':'⚙️'},{'category':'管理','icon':'🔧'}];function parseHelpCommand(_0x38434f){const _0x290814=a4_0x19fe69;return _0x38434f[_0x290814(0x185)]()[_0x290814(0x14c)]()===_0x290814(0x11c);}function parseCommandHelp(_0x5667b7){const _0x5efe07=a4_0x19fe69,_0x59f635=_0x5667b7['trim'](),_0x1a99e8=_0x59f635[_0x5efe07(0x108)](/^(\/\w+)\s+--help$/i);if(!_0x1a99e8)return null;return _0x1a99e8[0x1][_0x5efe07(0x14c)]();}function getCommandByName(_0x117ad2){const _0x3cc8b8=a4_0x19fe69,_0x52c095=_0x117ad2[_0x3cc8b8(0x14c)]();return COMMAND_REGISTRY['find'](_0x4f6831=>_0x4f6831[_0x3cc8b8(0x103)]['toLowerCase']()===_0x52c095||_0x4f6831['aliases']?.[_0x3cc8b8(0x181)](_0x354f0f=>_0x354f0f['toLowerCase']()===_0x52c095));}function formatHelpOverview(_0x6821f6,_0x1d143b){const _0x8ea346=a4_0x19fe69,_0x30e713=COMMAND_REGISTRY[_0x8ea346(0x189)](_0x30416c=>_0x1d143b||!_0x30416c[_0x8ea346(0x16f)]),_0x365430=[_0x8ea346(0x124),_0x8ea346(0x155),'-\x20**版本:**\x20'+_0x6821f6,_0x8ea346(0x137),_0x8ea346(0x18a),'----'];for(const {category:_0x579706,icon:_0x538694}of CATEGORY_DISPLAY){const _0x2c37d8=_0x30e713['filter'](_0x46d683=>_0x46d683[_0x8ea346(0x142)]===_0x579706);if(_0x2c37d8[_0x8ea346(0x17c)]===0x0)continue;_0x365430[_0x8ea346(0x14e)](_0x538694+_0x8ea346(0x118)+_0x579706+'**');for(const _0x1cdeed of _0x2c37d8){_0x365430[_0x8ea346(0x14e)]('-\x20`'+_0x1cdeed[_0x8ea346(0x103)]+'`\x20'+_0x1cdeed['description']);}_0x365430[_0x8ea346(0x14e)]('');}return _0x365430['push']('💡\x20输入\x20`/{命令}\x20--help`\x20查看命令详细用法'),_0x365430[_0x8ea346(0x19f)]('\x0a');}function formatCommandHelp(_0x24462e){const _0x1614a2=a4_0x19fe69,_0x47029d=['###\x20📖\x20'+_0x24462e[_0x1614a2(0x103)],'','**描述:**\x20'+_0x24462e['description'],'',_0x1614a2(0xfb)+_0x24462e[_0x1614a2(0x180)]+'`'];_0x24462e['aliases']?.['length']&&_0x47029d['push']('',_0x1614a2(0x13a)+_0x24462e[_0x1614a2(0x19b)][_0x1614a2(0x19f)](',\x20'));_0x47029d['push']('',_0x1614a2(0x150));for(const _0x1f15d0 of _0x24462e[_0x1614a2(0x127)]){_0x47029d[_0x1614a2(0x14e)](_0x1614a2(0x16a)+_0x1f15d0+'`');}return _0x47029d[_0x1614a2(0x19f)]('\x0a');}function parseEndCommand(_0x51089c){const _0xd645fa=a4_0x19fe69;return _0x51089c[_0xd645fa(0x185)]()[_0xd645fa(0x14c)]()==='/end';}function parseInfoCommand(_0x419de8){const _0x555c22=a4_0x19fe69,_0x4944bd=_0x419de8[_0x555c22(0x185)]()[_0x555c22(0x14c)]();if(_0x4944bd===_0x555c22(0x149))return'all';if(_0x4944bd===_0x555c22(0x167))return _0x555c22(0x162);if(_0x4944bd===_0x555c22(0x145))return _0x555c22(0x117);if(_0x4944bd==='/info\x20task')return _0x555c22(0xfd);return null;}function formatConversationInfo(_0x172357,_0x319b27,_0x2fcbf0){const _0x3fdc38=a4_0x19fe69,_0x247ed0=['-\x20**群ID:**\x20'+_0x319b27];if(_0x172357[_0x3fdc38(0x17d)])_0x247ed0['push'](_0x3fdc38(0x10e)+_0x172357[_0x3fdc38(0x17d)]);if(_0x172357[_0x3fdc38(0x19c)])_0x247ed0[_0x3fdc38(0x14e)](_0x3fdc38(0x11a)+_0x172357[_0x3fdc38(0x19c)]);if(_0x172357['agent'])_0x247ed0[_0x3fdc38(0x14e)](_0x3fdc38(0xff)+_0x172357[_0x3fdc38(0x134)]);if(_0x172357['dingToken'])_0x247ed0[_0x3fdc38(0x14e)](_0x3fdc38(0x171)+_0x172357['dingToken']+_0x3fdc38(0x164));if(_0x172357[_0x3fdc38(0x105)]?.['length']){const _0x565010=_0x172357[_0x3fdc38(0x105)][_0x3fdc38(0x10f)](_0x1be33c=>{const _0x83a9fd=_0x2fcbf0?.(_0x1be33c);return _0x83a9fd||_0x1be33c;})[_0x3fdc38(0x19f)](',\x20');_0x247ed0[_0x3fdc38(0x14e)](_0x3fdc38(0x172)+_0x565010);}if(_0x172357[_0x3fdc38(0x12b)]?.[_0x3fdc38(0x198)])_0x247ed0[_0x3fdc38(0x14e)](_0x3fdc38(0x193)+_0x172357['taskCfg'][_0x3fdc38(0x198)]);return _0x247ed0[_0x3fdc38(0x19f)]('\x0a');}function parseLogCommand(_0xb3431d){const _0x2283df=a4_0x19fe69,_0x5897d8=_0xb3431d[_0x2283df(0x185)](),_0x210622=_0x5897d8[_0x2283df(0x108)](/^\/log(?:\s+(\d+))?$/i);if(!_0x210622)return null;const _0x18bf55=parseInt(_0x210622[0x1],0xa);return isNaN(_0x18bf55)||_0x18bf55<=0x0?0xa:_0x18bf55;}function parseLsCommand(_0xe1980f){const _0x45aeb7=a4_0x19fe69,_0x27d222=_0xe1980f[_0x45aeb7(0x185)](),_0x28fce0=_0x27d222['match'](/^\/ls(?:\s+(.+))?$/i);if(!_0x28fce0)return null;if(_0x28fce0[0x1]===undefined)return{'target':'','depth':0x1};const _0x682bc=_0x28fce0[0x1][_0x45aeb7(0x185)]()[_0x45aeb7(0x15d)](/\s+/),_0x41e5bd=_0x682bc[0x0]||'',_0x2fc371=_0x682bc[0x1]?parseInt(_0x682bc[0x1],0xa):0x1;return{'target':_0x41e5bd,'depth':isNaN(_0x2fc371)||_0x2fc371<0x0?0x1:Math['min'](_0x2fc371,0x5)};}function findSubdirByName(_0xf49705,_0x4af718,_0x2abee8=0x3){const _0x442855=a4_0x19fe69,_0x102448=[{'dir':_0xf49705,'depth':0x0}];while(_0x102448['length']>0x0){const {dir:_0x22b3b8,depth:_0x302689}=_0x102448[_0x442855(0x153)]();if(_0x302689>_0x2abee8)continue;try{const _0x402a53=fs_1[_0x442855(0x13d)]['readdirSync'](_0x22b3b8,{'withFileTypes':!![]});for(const _0x50e9fd of _0x402a53){if(!_0x50e9fd[_0x442855(0x115)]()||_0x50e9fd[_0x442855(0x103)][_0x442855(0x19d)]('.'))continue;if(_0x50e9fd['name']===_0x4af718)return path_1[_0x442855(0x13d)][_0x442855(0x19f)](_0x22b3b8,_0x50e9fd['name']);_0x102448['push']({'dir':path_1['default']['join'](_0x22b3b8,_0x50e9fd[_0x442855(0x103)]),'depth':_0x302689+0x1});}}catch{continue;}}return null;}function getDirectoryStructure(_0x5e9f21,_0x480fdc=0x0,_0x58f0b1=0x1){const _0x5d136b=a4_0x19fe69;try{const _0x238d77=fs_1[_0x5d136b(0x13d)][_0x5d136b(0x11f)](_0x5e9f21,{'withFileTypes':!![]})[_0x5d136b(0x189)](_0x5ea448=>!_0x5ea448[_0x5d136b(0x103)]['startsWith']('.'));if(_0x238d77[_0x5d136b(0x17c)]===0x0)return _0x480fdc===0x0?_0x5d136b(0x15c):'';_0x238d77[_0x5d136b(0x123)]((_0x178826,_0x27a3d9)=>{const _0x381dfa=_0x5d136b;if(_0x178826[_0x381dfa(0x115)]()!==_0x27a3d9[_0x381dfa(0x115)]())return _0x178826[_0x381dfa(0x115)]()?-0x1:0x1;return _0x178826[_0x381dfa(0x103)][_0x381dfa(0x192)](_0x27a3d9['name']);});const _0x9c3bef=[],_0x3e7e91='.\x20'[_0x5d136b(0xfa)](_0x480fdc);for(const _0x148ab9 of _0x238d77){const _0x5174e0=_0x148ab9['isDirectory']()?_0x5d136b(0x16e):_0x5d136b(0x19a),_0x5327b9=_0x148ab9[_0x5d136b(0x115)]()?'/':'';_0x9c3bef[_0x5d136b(0x14e)](''+_0x3e7e91+_0x5174e0+_0x148ab9[_0x5d136b(0x103)]+_0x5327b9);if(_0x148ab9[_0x5d136b(0x115)]()&&_0x480fdc<_0x58f0b1){const _0x4ad9ec=path_1[_0x5d136b(0x13d)][_0x5d136b(0x19f)](_0x5e9f21,_0x148ab9[_0x5d136b(0x103)]),_0x4fecc9=getDirectoryStructure(_0x4ad9ec,_0x480fdc+0x1,_0x58f0b1);_0x4fecc9&&_0x9c3bef[_0x5d136b(0x14e)](_0x4fecc9);}}return _0x9c3bef[_0x5d136b(0x19f)]('\x0a');}catch{return _0x480fdc===0x0?_0x5d136b(0x16b):'';}}function parseContinueSessionCommand(_0x5578c0){const _0x4870fb=a4_0x19fe69,_0x551554=_0x5578c0[_0x4870fb(0x185)]()[_0x4870fb(0x108)](/^\/resume(?:\s+(\S+))?$/i);if(!_0x551554)return null;return _0x551554[0x1]!==undefined?_0x551554[0x1]:'';}function looksLikeCronExpression(_0x5b7b5d){const _0x1b04fa=a4_0x19fe69,_0x5c59fd=_0x5b7b5d[_0x1b04fa(0x185)]()['split'](/\s+/);if(_0x5c59fd['length']!==0x5)return![];return _0x5c59fd[_0x1b04fa(0x18f)](_0x3b95d1=>/^[\d*/\-]+$/['test'](_0x3b95d1));}function a4_0x267b(_0xae0236,_0x276a94){_0xae0236=_0xae0236-0xf8;const _0x2636fe=a4_0x2636();let _0x267bf7=_0x2636fe[_0xae0236];return _0x267bf7;}function parseCronCommand(_0x5c21a3){const _0x10d80c=a4_0x19fe69,_0x34ac4e=_0x5c21a3[_0x10d80c(0x185)]();if(!_0x34ac4e[_0x10d80c(0x14c)]()[_0x10d80c(0x19d)]('/cron'))return null;const _0x24aae2=_0x34ac4e['substring'](0x5)['trim']();if(!_0x24aae2)return null;if(/^(list|ls)$/i['test'](_0x24aae2))return{'type':'list'};const _0x2a7c56=_0x24aae2[_0x10d80c(0x108)](/^(?:delete|rm)\s+(\S+)$/i);if(_0x2a7c56)return{'type':_0x10d80c(0xfc),'id':_0x2a7c56[0x1]};const _0x2c12fc=_0x24aae2[_0x10d80c(0x108)](/^pause\s+(\S+)$/i);if(_0x2c12fc)return{'type':_0x10d80c(0x13f),'id':_0x2c12fc[0x1]};const _0x458d63=_0x24aae2['match'](/^resume\s+(\S+)$/i);if(_0x458d63)return{'type':'resume','id':_0x458d63[0x1]};const _0x1f5072=_0x24aae2[_0x10d80c(0x108)](/^(\S+\s+\S+\s+\S+\s+\S+\s+\S+)\s+(.+)$/);if(_0x1f5072&&looksLikeCronExpression(_0x1f5072[0x1]))return{'type':_0x10d80c(0x100),'cronExpression':_0x1f5072[0x1],'prompt':_0x1f5072[0x2]};return{'type':'create_nl','input':_0x24aae2};}function parsePwdCommand(_0x4f0044){const _0x136348=a4_0x19fe69;return _0x4f0044[_0x136348(0x185)]()===_0x136348(0x16c);}function parseVersionCommand(_0x674770){const _0x21ba65=a4_0x19fe69;return _0x674770['trim']()===_0x21ba65(0x14b);}function a4_0x2636(){const _0x5c1de2=['查看工作目录结构','whiteUserList','清除历史会话和缓存(.sessions/.tasks/.images)','查看群配置、会话和任务信息','match','--conversationTitle','/new','创建和管理定时任务(Claude自动分析自然语言)','/task','管理当前群白名单(add/del,默认list)','-\x20**群名称:**\x20','map','9461739nEwKCN','在文件管理器或终端中打开工作目录','开始新的对话会话(结束当前会话)','/mkdir\x20src/components','defineProperty','isDirectory','/reg\x20--conversationTitle\x20工作群','session','\x20**','在工作目录下创建文件夹(支持相对路径,不能超出工作目录范围)','-\x20**关联会话ID:**\x20','parseMkdirCommand','/help','2lpiyKA','/open\x20shell','readdirSync','/rm','6768858DlMrMH','删除工作目录下的文件或目录(支持相对路径,不能超出工作目录范围)','sort','###\x20🤗','/ls\x20[目标目录]\x20[展开层数]','10xurwZC','examples','/task\x20帮我重构登录模块','/resume\x20[会话ID]','--dingToken','taskCfg','/reg\x20--dingToken\x20myToken\x20--whiteUserList\x2013800138000,13900139000','/touch','提交任务到队列','/touch\x20src/cc-ding-cli.ts','/resume\x20abc123','test','parseInfoCommand','/reg','agent','/rm\x20<相对路径>','/log','-\x20**作者:**\x20yihuineng','parseAuthCommand','/cron\x20delete\x20cron_123','**别名:**\x20','parseCommandHelp','/open\x20[shell]','default','__esModule','pause','/info\x20[robot|session|task]','parseLsCommand','category','在工作目录下创建空文件(支持相对路径,不能超出工作目录范围)','/mkdir\x20<相对路径>','/info\x20session','45108327wCoNZH','3961824DAKoNl','^\x5c/','/info','/info\x20task','/version','toLowerCase','/auth\x20add\x2013800138000','push','/reset-apikeycfg','**示例:**','parseOpenCommand','del','shift','/mkdir','----','1518934kfVIdK','9ZQgasx','/clean\x20all','/touch\x20<相对路径>','/open','list','📂\x20目录为空','split','substring','/touch\x20README.md','查看工具版本信息','继续指定的历史会话(可指定会话ID,不指定则恢复最近一个)','robot','注册当前群到配置(未注册群可用)','...','\x5cs+(.+)$','/cron\x20每天早上9点查看dima任务','/info\x20robot','parseLogCommand','查看所有可用命令','-\x20`','❌\x20无法读取目录','/pwd','findSubdirByName','📁\x20','ownerOnly','/reg\x20[--dingToken\x20xxx]\x20[--linkConversationId\x20yyy]\x20[--whiteUserList\x20138xxxx,139xxxx]\x20[--conversationTitle\x20名称]','-\x20**dingToken:**\x20','-\x20**群白名单:**\x20','/touch\x20./config.json','/cron\x200\x209\x20*\x20*\x20*\x20查看dima任务','显示当前工作目录的绝对路径','重置API\x20Key配置(将所有Key标记为有效)','folder','parseEndCommand','/ls','/clean','--linkConversationId','length','conversationTitle','2022772rvktpD','/cron','usage','some','current','mkdir','/task\x20<任务描述>','trim','touch','getDirectoryStructure','getCommandByName','filter','-\x20**Github:**\x20https://github.com/yihuineng/cc-ding','/rm\x20./docs/obsolete/','path','/rm\x20src/old.ts','/cron\x20<自然语言描述>\x20|\x20/cron\x20<cron表达式>\x20<任务描述>\x20|\x20/cron\x20list|pause|resume|delete\x20<id>','every','formatCommandHelp','11080251Fzspxr','localeCompare','-\x20**taskSkill:**\x20','parseHelpCommand','/ls\x20product\x201','/resume','/log\x20[行数]','skill','/auth','📄\x20','aliases','linkConversationId','startsWith','/end','join','__importDefault','parseRegCommand','repeat','**用法:**\x20`','delete','task','5lcaILN','-\x20**agent:**\x20','create_cron','formatHelpOverview','parsePwdCommand','name'];a4_0x2636=function(){return _0x5c1de2;};return a4_0x2636();}function parsePathCommand(_0xcc4252,_0x4802e8){const _0x34ff23=a4_0x19fe69,_0x2d41cc=_0xcc4252[_0x34ff23(0x185)](),_0x4248b7=_0x2d41cc[_0x34ff23(0x108)](new RegExp(_0x34ff23(0x148)+_0x4802e8+_0x34ff23(0x165)));if(!_0x4248b7)return null;const _0x234ae4=_0x4248b7[0x1][_0x34ff23(0x185)]();return _0x234ae4||null;}function parseMkdirCommand(_0x566b50){const _0x818801=a4_0x19fe69;return parsePathCommand(_0x566b50,_0x818801(0x183));}function parseTouchCommand(_0x5d9f7a){const _0x38cf1b=a4_0x19fe69;return parsePathCommand(_0x5d9f7a,_0x38cf1b(0x186));}function parseRmCommand(_0x5666d5){return parsePathCommand(_0x5666d5,'rm');}function parseOpenCommand(_0x56fca4){const _0x4b32a5=a4_0x19fe69,_0x474ba0=_0x56fca4[_0x4b32a5(0x185)]()['toLowerCase']();if(_0x474ba0===_0x4b32a5(0x15a))return _0x4b32a5(0x177);if(_0x474ba0==='/open\x20shell')return'shell';return null;}function parseCleanCommand(_0x3c774a){const _0x1b2933=a4_0x19fe69,_0x4a15c7=_0x3c774a['trim']()[_0x1b2933(0x14c)]();if(_0x4a15c7===_0x1b2933(0x17a))return _0x1b2933(0x182);if(_0x4a15c7===_0x1b2933(0x158))return'all';return null;}function parseResetApiKeyCfgCommand(_0x24b3fb){const _0x4455df=a4_0x19fe69;return _0x24b3fb['trim']()[_0x4455df(0x14c)]()===_0x4455df(0x14f);}function parseRegCommand(_0x245e02){const _0x591fd6=a4_0x19fe69,_0x113d91=_0x245e02['trim']();if(!/^\/reg(?:\s|$)/i['test'](_0x113d91))return null;const _0x5ec257=_0x113d91[_0x591fd6(0x15e)](0x4)[_0x591fd6(0x185)]();if(!_0x5ec257)return{};if(/^--help$/i[_0x591fd6(0x131)](_0x5ec257))return null;const _0x59c053={},_0x2359c7=_0x5ec257[_0x591fd6(0x15d)](/\s+/);for(let _0x2b5e33=0x0;_0x2b5e33<_0x2359c7[_0x591fd6(0x17c)];_0x2b5e33++){const _0x26776a=_0x2359c7[_0x2b5e33];if(_0x26776a===_0x591fd6(0x12a)&&_0x2359c7[_0x2b5e33+0x1])_0x59c053['dingToken']=_0x2359c7[++_0x2b5e33];else{if(_0x26776a===_0x591fd6(0x17b)&&_0x2359c7[_0x2b5e33+0x1])_0x59c053['linkConversationId']=_0x2359c7[++_0x2b5e33];else{if(_0x26776a==='--whiteUserList'&&_0x2359c7[_0x2b5e33+0x1])_0x59c053[_0x591fd6(0x105)]=_0x2359c7[++_0x2b5e33][_0x591fd6(0x15d)](',')[_0x591fd6(0x10f)](_0x507363=>_0x507363['trim']())[_0x591fd6(0x189)](Boolean);else{if(_0x26776a===_0x591fd6(0x109)&&_0x2359c7[_0x2b5e33+0x1]){const _0x33a4be=[];while(_0x2b5e33+0x1<_0x2359c7[_0x591fd6(0x17c)]&&!_0x2359c7[_0x2b5e33+0x1][_0x591fd6(0x19d)]('--')){_0x33a4be[_0x591fd6(0x14e)](_0x2359c7[++_0x2b5e33]);}_0x33a4be['length']>0x0&&(_0x59c053[_0x591fd6(0x17d)]=_0x33a4be['join']('\x20'));}}}}}return _0x59c053;}function parseAuthCommand(_0x451f7a){const _0x295542=a4_0x19fe69,_0x3b297e=_0x451f7a['trim'](),_0xdfc2a9=_0x3b297e[_0x295542(0x108)](/^\/auth\s+add\s+(\S+)$/i);if(_0xdfc2a9)return{'type':'add','staffId':_0xdfc2a9[0x1]};const _0x4fe29c=_0x3b297e[_0x295542(0x108)](/^\/auth\s+del(?:ete)?\s+(\S+)$/i);if(_0x4fe29c)return{'type':_0x295542(0x152),'staffId':_0x4fe29c[0x1]};if(/^\/auth(?:\s+list)?$/i[_0x295542(0x131)](_0x3b297e))return{'type':_0x295542(0x15b)};return null;}
|
|
1
|
+
'use strict';const a4_0x25db81=a4_0x5650;(function(_0x331fb0,_0x53ce5b){const _0x1b0e00=a4_0x5650,_0x1a68d9=_0x331fb0();while(!![]){try{const _0x1750ff=-parseInt(_0x1b0e00(0xe8))/0x1*(parseInt(_0x1b0e00(0xb2))/0x2)+-parseInt(_0x1b0e00(0x136))/0x3*(parseInt(_0x1b0e00(0x10b))/0x4)+-parseInt(_0x1b0e00(0x14e))/0x5+parseInt(_0x1b0e00(0xbd))/0x6*(parseInt(_0x1b0e00(0xb7))/0x7)+parseInt(_0x1b0e00(0xd8))/0x8+parseInt(_0x1b0e00(0x161))/0x9*(parseInt(_0x1b0e00(0x18c))/0xa)+parseInt(_0x1b0e00(0xec))/0xb;if(_0x1750ff===_0x53ce5b)break;else _0x1a68d9['push'](_0x1a68d9['shift']());}catch(_0x2ecce4){_0x1a68d9['push'](_0x1a68d9['shift']());}}}(a4_0x2238,0x6f75b));var __importDefault=this&&this[a4_0x25db81(0x114)]||function(_0x33147e){const _0x288a13=a4_0x25db81;return _0x33147e&&_0x33147e[_0x288a13(0xe7)]?_0x33147e:{'default':_0x33147e};};Object[a4_0x25db81(0x172)](exports,a4_0x25db81(0xe7),{'value':!![]}),exports[a4_0x25db81(0xc3)]=parseHelpCommand,exports[a4_0x25db81(0x188)]=parseCommandHelp,exports[a4_0x25db81(0xf3)]=getCommandByName,exports['formatHelpOverview']=formatHelpOverview,exports[a4_0x25db81(0xc1)]=formatCommandHelp,exports[a4_0x25db81(0x117)]=parseEndCommand,exports[a4_0x25db81(0x12c)]=parseInfoCommand,exports[a4_0x25db81(0xd9)]=formatConversationInfo,exports['formatGlobalConfig']=formatGlobalConfig,exports[a4_0x25db81(0x181)]=parseLogCommand,exports[a4_0x25db81(0x155)]=parseLsCommand,exports[a4_0x25db81(0x133)]=findSubdirByName,exports[a4_0x25db81(0x159)]=getDirectoryStructure,exports[a4_0x25db81(0x153)]=parseContinueSessionCommand,exports[a4_0x25db81(0xdf)]=parseCronCommand,exports[a4_0x25db81(0xed)]=parsePwdCommand,exports[a4_0x25db81(0x17a)]=parseVersionCommand,exports[a4_0x25db81(0x119)]=parseMkdirCommand,exports[a4_0x25db81(0x152)]=parseTouchCommand,exports[a4_0x25db81(0x16b)]=parseRmCommand,exports[a4_0x25db81(0x144)]=parseOpenCommand,exports[a4_0x25db81(0x106)]=parseCleanCommand,exports['parseResetApiKeyCfgCommand']=parseResetApiKeyCfgCommand,exports[a4_0x25db81(0x10f)]=parseCfgCommand,exports['parseBashCommand']=parseBashCommand,exports['parseMqCommand']=parseMqCommand,exports['parseAuthCommand']=parseAuthCommand;const fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a4_0x25db81(0xb6))),COMMAND_REGISTRY=[{'name':a4_0x25db81(0x104),'description':'查看所有可用命令','usage':a4_0x25db81(0x104),'examples':[a4_0x25db81(0x104)],'category':'系统'},{'name':a4_0x25db81(0x12f),'description':a4_0x25db81(0xb4),'usage':a4_0x25db81(0x140),'examples':[a4_0x25db81(0x12f),a4_0x25db81(0x185),'/info\x20session',a4_0x25db81(0x176)],'category':'系统'},{'name':'/log','description':'查看最近会话日志','usage':a4_0x25db81(0x143),'examples':[a4_0x25db81(0x13d),a4_0x25db81(0xdb)],'category':'会话'},{'name':a4_0x25db81(0x134),'description':a4_0x25db81(0x11b),'usage':'/new\x20[初始消息]','examples':[a4_0x25db81(0x134),'/new\x20帮我分析一下这个项目'],'category':'会话'},{'name':a4_0x25db81(0x16d),'description':a4_0x25db81(0xbe),'usage':a4_0x25db81(0xf4),'examples':['/resume',a4_0x25db81(0xe5)],'category':'会话'},{'name':'/end','description':a4_0x25db81(0x18d),'usage':a4_0x25db81(0xf2),'examples':[a4_0x25db81(0xf2)],'category':'会话'},{'name':a4_0x25db81(0xfd),'description':a4_0x25db81(0xf0),'usage':a4_0x25db81(0xde),'examples':[a4_0x25db81(0x13f)],'category':'任务'},{'name':a4_0x25db81(0x175),'description':a4_0x25db81(0x124),'usage':a4_0x25db81(0xce),'examples':[a4_0x25db81(0x175),'/mq\x20-n\x201','/mq\x20-n\x203','/mq\x20-all'],'category':'任务'},{'name':a4_0x25db81(0xe2),'description':a4_0x25db81(0xc8),'usage':a4_0x25db81(0x158),'examples':[a4_0x25db81(0x17e),'/cron\x200\x209\x20*\x20*\x20*\x20查看dima任务',a4_0x25db81(0x171),a4_0x25db81(0x10d),a4_0x25db81(0x131)],'category':'任务'},{'name':'/pwd','description':a4_0x25db81(0x166),'usage':'/pwd','examples':['/pwd'],'category':'文件'},{'name':a4_0x25db81(0x13b),'description':'查看工作目录结构','usage':a4_0x25db81(0x170),'examples':[a4_0x25db81(0x13b),a4_0x25db81(0x108),a4_0x25db81(0x103)],'category':'文件'},{'name':a4_0x25db81(0xe9),'description':a4_0x25db81(0x118),'usage':a4_0x25db81(0xe3),'examples':[a4_0x25db81(0x179),a4_0x25db81(0x13a),a4_0x25db81(0xd7)],'category':'文件'},{'name':a4_0x25db81(0x14b),'description':a4_0x25db81(0x15f),'usage':a4_0x25db81(0x102),'examples':['/touch\x20README.md',a4_0x25db81(0xfc),a4_0x25db81(0x189)],'category':'文件'},{'name':a4_0x25db81(0x16f),'description':a4_0x25db81(0xc4),'usage':a4_0x25db81(0x138),'examples':[a4_0x25db81(0x178),'/rm\x20src/old.ts',a4_0x25db81(0x168)],'category':'文件'},{'name':'/version','description':'查看工具版本信息','usage':a4_0x25db81(0xd5),'examples':[a4_0x25db81(0xd5)],'category':'系统'},{'name':a4_0x25db81(0x163),'description':a4_0x25db81(0x101),'usage':a4_0x25db81(0x174),'examples':[a4_0x25db81(0x163),a4_0x25db81(0x162)],'category':'管理','ownerOnly':!![]},{'name':a4_0x25db81(0xc7),'description':'清除历史会话和缓存(.sessions/.tasks/.images)','usage':a4_0x25db81(0xc7),'examples':[a4_0x25db81(0xc7)],'category':'管理','ownerOnly':!![]},{'name':a4_0x25db81(0x126),'description':a4_0x25db81(0x14d),'usage':a4_0x25db81(0x126),'examples':[a4_0x25db81(0x126)],'category':'管理','ownerOnly':!![]},{'name':a4_0x25db81(0x105),'description':a4_0x25db81(0xe4),'usage':a4_0x25db81(0x13e),'examples':[a4_0x25db81(0x105),a4_0x25db81(0x180),a4_0x25db81(0xcf),'/cfg\x20--whiteUserList\x2013800138000',a4_0x25db81(0xc5),a4_0x25db81(0x14f),a4_0x25db81(0x183)],'category':'管理','ownerOnly':!![]},{'name':'/bash','description':a4_0x25db81(0x187),'usage':a4_0x25db81(0xf9),'examples':[a4_0x25db81(0x122),a4_0x25db81(0xf8),a4_0x25db81(0x139)],'category':'文件'},{'name':a4_0x25db81(0x11d),'description':'管理当前群白名单(add/del,默认list)','usage':a4_0x25db81(0xc2),'examples':[a4_0x25db81(0x11d),a4_0x25db81(0xee),a4_0x25db81(0x14a)],'category':'管理','ownerOnly':!![]}],CATEGORY_DISPLAY=[{'category':'会话','icon':'💬'},{'category':'任务','icon':'📋'},{'category':'文件','icon':'📂'},{'category':'系统','icon':'⚙️'},{'category':'管理','icon':'🔧'}];function parseHelpCommand(_0x2e5737){const _0x4a44f8=a4_0x25db81;return _0x2e5737[_0x4a44f8(0xda)]()['toLowerCase']()==='/help';}function parseCommandHelp(_0xdd668e){const _0x32350b=a4_0x25db81,_0x1a109f=_0xdd668e[_0x32350b(0xda)](),_0xe618d8=_0x1a109f[_0x32350b(0x169)](/^(\/\w+)\s+--help$/i);if(!_0xe618d8)return null;return _0xe618d8[0x1]['toLowerCase']();}function getCommandByName(_0x4ffa92){const _0x2e9569=a4_0x25db81,_0x229aaa=_0x4ffa92['toLowerCase']();return COMMAND_REGISTRY[_0x2e9569(0x147)](_0x137418=>_0x137418[_0x2e9569(0x16a)][_0x2e9569(0x16e)]()===_0x229aaa||_0x137418[_0x2e9569(0xdc)]?.['some'](_0x12893f=>_0x12893f[_0x2e9569(0x16e)]()===_0x229aaa));}function formatHelpOverview(_0x260563,_0x381189){const _0xd542d6=a4_0x25db81,_0xbcc595=COMMAND_REGISTRY[_0xd542d6(0x135)](_0xfec5f5=>_0x381189||!_0xfec5f5[_0xd542d6(0xbf)]),_0x434cd2=[_0xd542d6(0x154),_0xd542d6(0x115),_0xd542d6(0xb3)+_0x260563,_0xd542d6(0x18a),_0xd542d6(0x15d),'----'];for(const {category:_0x47e83b,icon:_0x1db9fd}of CATEGORY_DISPLAY){const _0x17378e=_0xbcc595[_0xd542d6(0x135)](_0xec87e6=>_0xec87e6[_0xd542d6(0x15c)]===_0x47e83b);if(_0x17378e[_0xd542d6(0x130)]===0x0)continue;_0x434cd2['push'](_0x1db9fd+_0xd542d6(0x111)+_0x47e83b+'**');for(const _0x86f82f of _0x17378e){_0x434cd2[_0xd542d6(0x177)](_0xd542d6(0x15a)+_0x86f82f[_0xd542d6(0x16a)]+'`\x20'+_0x86f82f[_0xd542d6(0x13c)]);}_0x434cd2['push']('');}return _0x434cd2[_0xd542d6(0x177)]('💡\x20输入\x20`/{命令}\x20--help`\x20查看命令详细用法'),_0x434cd2[_0xd542d6(0x12d)]('\x0a');}function formatCommandHelp(_0x5a9964){const _0x4ea473=a4_0x25db81,_0x38da28=[_0x4ea473(0xd4)+_0x5a9964['name'],'',_0x4ea473(0x120)+_0x5a9964['description'],'',_0x4ea473(0x186)+_0x5a9964[_0x4ea473(0xf7)]+'`'];_0x5a9964[_0x4ea473(0xdc)]?.[_0x4ea473(0x130)]&&_0x38da28[_0x4ea473(0x177)]('',_0x4ea473(0xfe)+_0x5a9964[_0x4ea473(0xdc)][_0x4ea473(0x12d)](',\x20'));_0x38da28[_0x4ea473(0x177)]('','**示例:**');for(const _0x65c4e9 of _0x5a9964[_0x4ea473(0xc0)]){_0x38da28[_0x4ea473(0x177)](_0x4ea473(0x15a)+_0x65c4e9+'`');}return _0x38da28[_0x4ea473(0x12d)]('\x0a');}function parseEndCommand(_0x2678f1){const _0x8a0f4b=a4_0x25db81;return _0x2678f1[_0x8a0f4b(0xda)]()['toLowerCase']()===_0x8a0f4b(0xf2);}function parseInfoCommand(_0x32cba6){const _0x54ed29=a4_0x25db81,_0x134499=_0x32cba6[_0x54ed29(0xda)]()[_0x54ed29(0x16e)]();if(_0x134499==='/info')return'all';if(_0x134499===_0x54ed29(0x185))return _0x54ed29(0xf5);if(_0x134499===_0x54ed29(0xcb))return'session';if(_0x134499==='/info\x20task')return _0x54ed29(0x109);return null;}function a4_0x5650(_0x348b34,_0x1aa99e){_0x348b34=_0x348b34-0xb2;const _0x2238ba=a4_0x2238();let _0x565041=_0x2238ba[_0x348b34];return _0x565041;}function formatConversationInfo(_0x1434d9,_0x2db45e,_0x38f111,_0x4a1e83){const _0x1b224d=a4_0x25db81,_0x64b5ac=[_0x1b224d(0x17f)+_0x2db45e];if(_0x1434d9['conversationTitle'])_0x64b5ac['push'](_0x1b224d(0x11e)+_0x1434d9[_0x1b224d(0x18b)]);if(_0x4a1e83)_0x64b5ac[_0x1b224d(0x177)]('-\x20**工作目录:**\x20`'+_0x4a1e83+'`');if(_0x1434d9[_0x1b224d(0x100)])_0x64b5ac[_0x1b224d(0x177)](_0x1b224d(0x17b)+_0x1434d9['linkConversationId']);if(_0x1434d9[_0x1b224d(0x184)])_0x64b5ac[_0x1b224d(0x177)](_0x1b224d(0x129)+_0x1434d9[_0x1b224d(0x184)]);if(_0x1434d9[_0x1b224d(0xb9)])_0x64b5ac[_0x1b224d(0x177)](_0x1b224d(0xd6)+_0x1434d9['dingToken']['substring'](0x0,0x8)+_0x1b224d(0x107));if(_0x1434d9[_0x1b224d(0x16c)]?.[_0x1b224d(0x130)]){const _0x3f08d1=_0x1434d9[_0x1b224d(0x16c)]['map'](_0x3dd9d5=>{const _0x142130=_0x38f111?.(_0x3dd9d5);return _0x142130||_0x3dd9d5;})[_0x1b224d(0x12d)](',\x20');_0x64b5ac[_0x1b224d(0x177)](_0x1b224d(0x15b)+_0x3f08d1);}if(_0x1434d9[_0x1b224d(0xe0)]===![])_0x64b5ac['push'](_0x1b224d(0xd1));if(_0x1434d9[_0x1b224d(0x112)]===![])_0x64b5ac[_0x1b224d(0x177)](_0x1b224d(0x11a));if(_0x1434d9[_0x1b224d(0x18e)]===![])_0x64b5ac['push'](_0x1b224d(0x125));if(_0x1434d9[_0x1b224d(0x150)]?.[_0x1b224d(0x167)])_0x64b5ac[_0x1b224d(0x177)](_0x1b224d(0xdd)+_0x1434d9[_0x1b224d(0x150)][_0x1b224d(0x167)]);if(_0x1434d9[_0x1b224d(0xbb)])_0x64b5ac[_0x1b224d(0x177)]('-\x20**preBash:**\x20`'+_0x1434d9['preBash']+'`');return _0x64b5ac['join']('\x0a');}function formatGlobalConfig(_0x474cc6){const _0x1f6ef6=a4_0x25db81,_0x563873=[_0x1f6ef6(0xca)+(_0x474cc6[_0x1f6ef6(0x160)]||'-'),_0x1f6ef6(0x142)+(_0x474cc6[_0x1f6ef6(0xba)]??0x5),_0x1f6ef6(0xb5)+(_0x474cc6[_0x1f6ef6(0x12e)]??0x1),'-\x20**taskQueueSize:**\x20'+(_0x474cc6[_0x1f6ef6(0x128)]??0x32),_0x1f6ef6(0x14c)+(_0x474cc6['includeThinking']??![]),_0x1f6ef6(0x12a)+(_0x474cc6[_0x1f6ef6(0x12b)]??!![])];if(_0x474cc6[_0x1f6ef6(0x146)])_0x563873['push'](_0x1f6ef6(0x116)+_0x474cc6[_0x1f6ef6(0x146)][_0x1f6ef6(0x164)](0x0,0x8)+_0x1f6ef6(0x107));if(_0x474cc6[_0x1f6ef6(0x182)])_0x563873[_0x1f6ef6(0x177)]('-\x20**owner:**\x20'+_0x474cc6[_0x1f6ef6(0x182)]);if(_0x474cc6[_0x1f6ef6(0x16c)]?.[_0x1f6ef6(0x130)])_0x563873['push'](_0x1f6ef6(0x165)+_0x474cc6[_0x1f6ef6(0x16c)]['join'](',\x20'));if(_0x474cc6[_0x1f6ef6(0xef)]){const _0xa88c85=_0x474cc6[_0x1f6ef6(0xef)][_0x1f6ef6(0x11c)][_0x1f6ef6(0x135)](_0x3860a0=>_0x3860a0[_0x1f6ef6(0x137)])[_0x1f6ef6(0x130)];_0x563873['push'](_0x1f6ef6(0x151)+_0xa88c85+'/'+_0x474cc6[_0x1f6ef6(0xef)][_0x1f6ef6(0x11c)][_0x1f6ef6(0x130)]+_0x1f6ef6(0x113)),_0x563873[_0x1f6ef6(0x177)]('\x20\x20-\x20**最近重置:**\x20'+(_0x474cc6['apiKeyCfg']['resetTime']||'-'));}return _0x563873[_0x1f6ef6(0x12d)]('\x0a');}function a4_0x2238(){const _0x29d254=['resultOnly','parseInfoCommand','join','taskHandlerCount','/info','length','/cron\x20delete\x20cron_123','shell','findSubdirByName','/new','filter','3ghIAhX','isValid','/rm\x20<相对路径>','/bash\x20git\x20status','/mkdir\x20src/components','/ls','description','/log','/cfg\x20[--dingToken\x20xxx]\x20[--linkConversationId\x20yyy]\x20[--whiteUserList\x20138xxxx,139xxxx]\x20[--conversationTitle\x20名称]\x20[--atSender\x20true|false]\x20[--receiveReply\x20true|false]\x20[--preBash\x20\x22命令\x22]','/task\x20帮我重构登录模块','/info\x20[robot|session|task]','create_cron','-\x20**sessionMaxConcurrency:**\x20','/log\x20[行数]','parseOpenCommand','cancel','defaultDingToken','find','📂\x20目录为空','--linkConversationId','/auth\x20del\x2013800138000','/touch','-\x20**includeThinking:**\x20','重置API\x20Key配置(将所有Key标记为有效)','4187725QaRPPU','/cfg\x20--receiveReply\x20false','taskCfg','-\x20**apiKeyCfg:**\x20','parseTouchCommand','parseContinueSessionCommand','###\x20🤗','parseLsCommand','delete','mkdir','/cron\x20<自然语言描述>\x20|\x20/cron\x20<cron表达式>\x20<任务描述>\x20|\x20/cron\x20list|pause|resume|delete\x20<id>','getDirectoryStructure','-\x20`','-\x20**群白名单:**\x20','category','-\x20**Github:**\x20https://github.com/yihuineng/cc-ding','📄\x20','在工作目录下创建空文件(支持相对路径,不能超出工作目录范围)','clientName','312741pKUhgc','/open\x20shell','/open','substring','-\x20**全局白名单:**\x20','显示当前工作目录的绝对路径','skill','/rm\x20./docs/obsolete/','match','name','parseRmCommand','whiteUserList','/resume','toLowerCase','/rm','/ls\x20[目标目录]\x20[展开层数]','/cron\x20list','defineProperty','yes','/open\x20[shell]','/mq','/info\x20task','push','/rm\x20temp.txt','/mkdir\x20src','parseVersionCommand','-\x20**关联会话ID:**\x20','readdirSync','del','/cron\x20每天早上9点查看dima任务','-\x20**群ID:**\x20','/cfg\x20--dingToken\x20myToken\x20--whiteUserList\x2013800138000,13900139000','parseLogCommand','owner','/cfg\x20--preBash\x20\x22source\x20.env\x22','agent','/info\x20robot','**用法:**\x20`','在工作目录执行\x20bash\x20命令(如配置了\x20preBash\x20全局/群级别,将叠加前置执行)','parseCommandHelp','/touch\x20./config.json','-\x20**作者:**\x20yihuineng','conversationTitle','120ORVjjY','结束当前会话','useLocalOcr','26cGQNMN','-\x20**版本:**\x20','查看群配置、会话和任务信息','-\x20**taskHandlerCount:**\x20','path','112FCuFxj','replace','dingToken','sessionMaxConcurrency','preBash','--conversationTitle','29874arIdai','继续指定的历史会话(可指定会话ID,不指定则恢复最近一个)','ownerOnly','examples','formatCommandHelp','/auth\x20[add|del\x20<手机号或userId>]','parseHelpCommand','删除工作目录下的文件或目录(支持相对路径,不能超出工作目录范围)','/cfg\x20--atSender\x20false','startsWith','/clean','创建和管理定时任务(Claude自动分析自然语言)','/clean\x20all','-\x20**clientName:**\x20','/info\x20session','folder','--receiveReply','/mq\x20|\x20/mq\x20-n\x20<数量>\x20|\x20/mq\x20-all','/cfg\x20--conversationTitle\x20工作群','shift','-\x20**atSender:**\x20false','^\x5c/','list','###\x20📖\x20','/version','-\x20**dingToken:**\x20','/mkdir\x20./docs','2010256yiYrfb','formatConversationInfo','trim','/log\x2020','aliases','-\x20**taskSkill:**\x20','/task\x20<任务描述>','parseCronCommand','atSender','\x5cs+(.+)$','/cron','/mkdir\x20<相对路径>','注册当前群到配置,或刷新指定字段(已注册群)','/resume\x20abc123','current','__esModule','60983ayowci','/mkdir','split','--whiteUserList','16577132JkCAxh','parsePwdCommand','/auth\x20add\x2013800138000','apiKeyCfg','提交任务到队列','min','/end','getCommandByName','/resume\x20[会话ID]','robot','isDirectory','usage','/bash\x20pwd','/bash\x20<命令>','❌\x20无法读取目录','test','/touch\x20src/cc-ding-cli.ts','/task','**别名:**\x20','--preBash','linkConversationId','在文件管理器或终端中打开工作目录','/touch\x20<相对路径>','/ls\x20product\x201','/help','/cfg','parseCleanCommand','...','/ls\x20root\x202','task','add','672332hxHISP','resume','/cron\x20pause\x20cron_123','--atSender','parseCfgCommand','pause','\x20**','receiveReply','\x20有效','__importDefault','----','-\x20**defaultDingToken:**\x20','parseEndCommand','在工作目录下创建文件夹(支持相对路径,不能超出工作目录范围)','parseMkdirCommand','-\x20**receiveReply:**\x20false\x20(不回复确认消息)','开始新的对话会话(结束当前会话)','claudeSettings','/auth','-\x20**群名称:**\x20','repeat','**描述:**\x20','default','/bash\x20ls\x20-la','sort','查看和管理当前会话消息队列(排队中的消息)','-\x20**本地OCR:**\x20关闭','/reset-apikeycfg','all','taskQueueSize','-\x20**agent:**\x20','-\x20**resultOnly:**\x20'];a4_0x2238=function(){return _0x29d254;};return a4_0x2238();}function parseLogCommand(_0x5d1660){const _0x218256=a4_0x25db81,_0x4ef558=_0x5d1660[_0x218256(0xda)](),_0x456237=_0x4ef558[_0x218256(0x169)](/^\/log(?:\s+(\d+))?$/i);if(!_0x456237)return null;const _0x109666=parseInt(_0x456237[0x1],0xa);return isNaN(_0x109666)||_0x109666<=0x0?0xa:_0x109666;}function parseLsCommand(_0x3130d2){const _0xad7465=a4_0x25db81,_0x5c9237=_0x3130d2[_0xad7465(0xda)](),_0x147d58=_0x5c9237['match'](/^\/ls(?:\s+(.+))?$/i);if(!_0x147d58)return null;if(_0x147d58[0x1]===undefined)return{'target':'','depth':0x1};const _0x22a91b=_0x147d58[0x1][_0xad7465(0xda)]()['split'](/\s+/),_0xd2d707=_0x22a91b[0x0]||'',_0xe12725=_0x22a91b[0x1]?parseInt(_0x22a91b[0x1],0xa):0x1;return{'target':_0xd2d707,'depth':isNaN(_0xe12725)||_0xe12725<0x0?0x1:Math[_0xad7465(0xf1)](_0xe12725,0x5)};}function findSubdirByName(_0x761838,_0x47c18c,_0x479594=0x3){const _0x481195=a4_0x25db81,_0x5e5d5d=[{'dir':_0x761838,'depth':0x0}];while(_0x5e5d5d[_0x481195(0x130)]>0x0){const {dir:_0x30718d,depth:_0x5c325e}=_0x5e5d5d[_0x481195(0xd0)]();if(_0x5c325e>_0x479594)continue;try{const _0x5a2491=fs_1[_0x481195(0x121)][_0x481195(0x17c)](_0x30718d,{'withFileTypes':!![]});for(const _0xbacea5 of _0x5a2491){if(!_0xbacea5[_0x481195(0xf6)]()||_0xbacea5[_0x481195(0x16a)][_0x481195(0xc6)]('.'))continue;if(_0xbacea5[_0x481195(0x16a)]===_0x47c18c)return path_1[_0x481195(0x121)]['join'](_0x30718d,_0xbacea5['name']);_0x5e5d5d[_0x481195(0x177)]({'dir':path_1[_0x481195(0x121)][_0x481195(0x12d)](_0x30718d,_0xbacea5[_0x481195(0x16a)]),'depth':_0x5c325e+0x1});}}catch{continue;}}return null;}function getDirectoryStructure(_0x1a1321,_0xcd642b=0x0,_0x54d0b6=0x1){const _0x383b26=a4_0x25db81;try{const _0x1ffbc6=fs_1[_0x383b26(0x121)][_0x383b26(0x17c)](_0x1a1321,{'withFileTypes':!![]})[_0x383b26(0x135)](_0xf50fe5=>!_0xf50fe5['name'][_0x383b26(0xc6)]('.'));if(_0x1ffbc6[_0x383b26(0x130)]===0x0)return _0xcd642b===0x0?_0x383b26(0x148):'';_0x1ffbc6[_0x383b26(0x123)]((_0x50277f,_0x435654)=>{const _0x4a7dbb=_0x383b26;if(_0x50277f['isDirectory']()!==_0x435654[_0x4a7dbb(0xf6)]())return _0x50277f['isDirectory']()?-0x1:0x1;return _0x50277f[_0x4a7dbb(0x16a)]['localeCompare'](_0x435654[_0x4a7dbb(0x16a)]);});const _0x449c23=[],_0x1e8962='.\x20'[_0x383b26(0x11f)](_0xcd642b);for(const _0x314897 of _0x1ffbc6){const _0x1e7929=_0x314897[_0x383b26(0xf6)]()?'📁\x20':_0x383b26(0x15e),_0x324377=_0x314897['isDirectory']()?'/':'';_0x449c23[_0x383b26(0x177)](''+_0x1e8962+_0x1e7929+_0x314897[_0x383b26(0x16a)]+_0x324377);if(_0x314897[_0x383b26(0xf6)]()&&_0xcd642b<_0x54d0b6){const _0x113473=path_1[_0x383b26(0x121)][_0x383b26(0x12d)](_0x1a1321,_0x314897[_0x383b26(0x16a)]),_0x2913a8=getDirectoryStructure(_0x113473,_0xcd642b+0x1,_0x54d0b6);_0x2913a8&&_0x449c23[_0x383b26(0x177)](_0x2913a8);}}return _0x449c23[_0x383b26(0x12d)]('\x0a');}catch{return _0xcd642b===0x0?_0x383b26(0xfa):'';}}function parseContinueSessionCommand(_0x500db1){const _0x5b5acb=a4_0x25db81,_0x206b7e=_0x500db1[_0x5b5acb(0xda)]()[_0x5b5acb(0x169)](/^\/resume(?:\s+(\S+))?$/i);if(!_0x206b7e)return null;return _0x206b7e[0x1]!==undefined?_0x206b7e[0x1]:'';}function looksLikeCronExpression(_0x25125f){const _0x28bb13=a4_0x25db81,_0x316e88=_0x25125f['trim']()[_0x28bb13(0xea)](/\s+/);if(_0x316e88['length']!==0x5)return![];return _0x316e88['every'](_0x2c5213=>/^[\d*/\-]+$/[_0x28bb13(0xfb)](_0x2c5213));}function parseCronCommand(_0x4196b9){const _0x3611e7=a4_0x25db81,_0x5b0ff7=_0x4196b9[_0x3611e7(0xda)]();if(!_0x5b0ff7[_0x3611e7(0x16e)]()[_0x3611e7(0xc6)](_0x3611e7(0xe2)))return null;const _0x4cac79=_0x5b0ff7[_0x3611e7(0x164)](0x5)[_0x3611e7(0xda)]();if(!_0x4cac79)return null;if(/^(list|ls)$/i[_0x3611e7(0xfb)](_0x4cac79))return{'type':'list'};const _0x2229e9=_0x4cac79['match'](/^(?:delete|rm)\s+(\S+)$/i);if(_0x2229e9)return{'type':_0x3611e7(0x156),'id':_0x2229e9[0x1]};const _0x1b16ec=_0x4cac79[_0x3611e7(0x169)](/^pause\s+(\S+)$/i);if(_0x1b16ec)return{'type':_0x3611e7(0x110),'id':_0x1b16ec[0x1]};const _0x320d4c=_0x4cac79[_0x3611e7(0x169)](/^resume\s+(\S+)$/i);if(_0x320d4c)return{'type':_0x3611e7(0x10c),'id':_0x320d4c[0x1]};const _0x11eb49=_0x4cac79[_0x3611e7(0x169)](/^(\S+\s+\S+\s+\S+\s+\S+\s+\S+)\s+(.+)$/);if(_0x11eb49&&looksLikeCronExpression(_0x11eb49[0x1]))return{'type':_0x3611e7(0x141),'cronExpression':_0x11eb49[0x1],'prompt':_0x11eb49[0x2]};return{'type':'create_nl','input':_0x4cac79};}function parsePwdCommand(_0x5c42bd){const _0x947ef7=a4_0x25db81;return _0x5c42bd[_0x947ef7(0xda)]()==='/pwd';}function parseVersionCommand(_0x50d324){const _0x2e54b3=a4_0x25db81;return _0x50d324[_0x2e54b3(0xda)]()===_0x2e54b3(0xd5);}function parsePathCommand(_0x44fa16,_0x586b50){const _0x48c94f=a4_0x25db81,_0x32cd61=_0x44fa16['trim'](),_0x27f8d7=_0x32cd61[_0x48c94f(0x169)](new RegExp(_0x48c94f(0xd2)+_0x586b50+_0x48c94f(0xe1)));if(!_0x27f8d7)return null;const _0x1f8d78=_0x27f8d7[0x1][_0x48c94f(0xda)]();return _0x1f8d78||null;}function parseMkdirCommand(_0x1df0de){const _0x3aec8a=a4_0x25db81;return parsePathCommand(_0x1df0de,_0x3aec8a(0x157));}function parseTouchCommand(_0x20c88b){return parsePathCommand(_0x20c88b,'touch');}function parseRmCommand(_0x1865c8){return parsePathCommand(_0x1865c8,'rm');}function parseOpenCommand(_0x2cbf98){const _0x82ebac=a4_0x25db81,_0x31bcd9=_0x2cbf98[_0x82ebac(0xda)]()[_0x82ebac(0x16e)]();if(_0x31bcd9===_0x82ebac(0x163))return _0x82ebac(0xcc);if(_0x31bcd9==='/open\x20shell')return _0x82ebac(0x132);return null;}function parseCleanCommand(_0x3023b9){const _0x15688e=a4_0x25db81,_0x5f5d34=_0x3023b9[_0x15688e(0xda)]()[_0x15688e(0x16e)]();if(_0x5f5d34==='/clean')return _0x15688e(0xe6);if(_0x5f5d34===_0x15688e(0xc9))return _0x15688e(0x127);return null;}function parseResetApiKeyCfgCommand(_0x1ec699){const _0x27fc8c=a4_0x25db81;return _0x1ec699[_0x27fc8c(0xda)]()[_0x27fc8c(0x16e)]()===_0x27fc8c(0x126);}function parseCfgCommand(_0x53e9fc){const _0x57f889=a4_0x25db81,_0x2a977a=_0x53e9fc[_0x57f889(0xda)]();if(!/^\/cfg(?:\s|$)/i[_0x57f889(0xfb)](_0x2a977a))return null;const _0x411ba0=_0x2a977a[_0x57f889(0x164)](0x4)[_0x57f889(0xda)]();if(!_0x411ba0)return{};if(/^--help$/i['test'](_0x411ba0))return null;const _0x1f0659={},_0x5d1a8d=_0x411ba0[_0x57f889(0xea)](/\s+/);for(let _0x589660=0x0;_0x589660<_0x5d1a8d['length'];_0x589660++){const _0x84f1a3=_0x5d1a8d[_0x589660];if(_0x84f1a3==='--dingToken'&&_0x5d1a8d[_0x589660+0x1])_0x1f0659['dingToken']=_0x5d1a8d[++_0x589660];else{if(_0x84f1a3===_0x57f889(0x149)&&_0x5d1a8d[_0x589660+0x1])_0x1f0659[_0x57f889(0x100)]=_0x5d1a8d[++_0x589660];else{if(_0x84f1a3===_0x57f889(0xeb)&&_0x5d1a8d[_0x589660+0x1])_0x1f0659[_0x57f889(0x16c)]=_0x5d1a8d[++_0x589660]['split'](',')['map'](_0x1af1c6=>_0x1af1c6[_0x57f889(0xda)]())[_0x57f889(0x135)](Boolean);else{if(_0x84f1a3===_0x57f889(0xbc)&&_0x5d1a8d[_0x589660+0x1]){const _0x1a4cac=[];while(_0x589660+0x1<_0x5d1a8d[_0x57f889(0x130)]&&!_0x5d1a8d[_0x589660+0x1][_0x57f889(0xc6)]('--')){_0x1a4cac[_0x57f889(0x177)](_0x5d1a8d[++_0x589660]);}_0x1a4cac[_0x57f889(0x130)]>0x0&&(_0x1f0659['conversationTitle']=_0x1a4cac['join']('\x20'));}else{if(_0x84f1a3===_0x57f889(0x10e)&&_0x5d1a8d[_0x589660+0x1]){const _0x9506d3=_0x5d1a8d[++_0x589660][_0x57f889(0x16e)]();_0x1f0659['atSender']=_0x9506d3==='true'||_0x9506d3==='1'||_0x9506d3===_0x57f889(0x173);}else{if(_0x84f1a3===_0x57f889(0xcd)&&_0x5d1a8d[_0x589660+0x1]){const _0x1f3d8c=_0x5d1a8d[++_0x589660]['toLowerCase']();_0x1f0659['receiveReply']=_0x1f3d8c==='true'||_0x1f3d8c==='1'||_0x1f3d8c==='yes';}else{if(_0x84f1a3===_0x57f889(0xff)&&_0x5d1a8d[_0x589660+0x1]){const _0x56f01c=[];while(_0x589660+0x1<_0x5d1a8d[_0x57f889(0x130)]&&!_0x5d1a8d[_0x589660+0x1][_0x57f889(0xc6)]('--')){_0x56f01c[_0x57f889(0x177)](_0x5d1a8d[++_0x589660]);}_0x56f01c[_0x57f889(0x130)]>0x0&&(_0x1f0659[_0x57f889(0xbb)]=_0x56f01c[_0x57f889(0x12d)]('\x20')[_0x57f889(0xb8)](/^["']|["']$/g,''));}}}}}}}}return _0x1f0659;}function parseBashCommand(_0x5eb5e7){const _0x4e98af=a4_0x25db81,_0x21b879=_0x5eb5e7[_0x4e98af(0xda)](),_0x5e1cfc=_0x21b879['match'](/^\/bash\s+(.+)$/i);if(!_0x5e1cfc)return null;const _0x450ea5=_0x5e1cfc[0x1]['trim']();return _0x450ea5||null;}function parseMqCommand(_0xc0c6c5){const _0x4a9935=a4_0x25db81,_0x4ece07=_0xc0c6c5[_0x4a9935(0xda)]();if(!/^\/mq(?:\s|$)/i[_0x4a9935(0xfb)](_0x4ece07)&&_0x4ece07['toLowerCase']()!=='/mq')return null;const _0x4a3d66=_0x4ece07['substring'](0x3)[_0x4a9935(0xda)]();if(!_0x4a3d66)return{'type':_0x4a9935(0xd3)};const _0x699da5=_0x4a3d66[_0x4a9935(0x169)](/^-n\s+(\d+)$/i);if(_0x699da5){const _0x391e63=parseInt(_0x699da5[0x1],0xa);return _0x391e63>0x0?{'type':_0x4a9935(0x145),'count':_0x391e63}:{'type':_0x4a9935(0xd3)};}if(/^-all$/i[_0x4a9935(0xfb)](_0x4a3d66))return{'type':'cancelAll'};return null;}function parseAuthCommand(_0x13fcdd){const _0x5e1ca2=a4_0x25db81,_0x3348e7=_0x13fcdd[_0x5e1ca2(0xda)](),_0x4d2d22=_0x3348e7['match'](/^\/auth\s+add\s+(\S+)$/i);if(_0x4d2d22)return{'type':_0x5e1ca2(0x10a),'staffId':_0x4d2d22[0x1]};const _0x26720f=_0x3348e7[_0x5e1ca2(0x169)](/^\/auth\s+del(?:ete)?\s+(\S+)$/i);if(_0x26720f)return{'type':_0x5e1ca2(0x17d),'staffId':_0x26720f[0x1]};if(/^\/auth(?:\s+list)?$/i[_0x5e1ca2(0xfb)](_0x3348e7))return{'type':'list'};return null;}
|