cc-ding 0.0.3 → 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/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
package/dist/bin/cc-ding.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';const
|
|
2
|
+
'use strict';const a0_0x2c5c4e=a0_0x3adf;(function(_0x4ec8ca,_0x3b7a08){const _0x5df3e9=a0_0x3adf,_0xcd082d=_0x4ec8ca();while(!![]){try{const _0x4e4698=-parseInt(_0x5df3e9(0x133))/0x1*(parseInt(_0x5df3e9(0x171))/0x2)+parseInt(_0x5df3e9(0x178))/0x3*(parseInt(_0x5df3e9(0x15e))/0x4)+-parseInt(_0x5df3e9(0x140))/0x5*(parseInt(_0x5df3e9(0x143))/0x6)+parseInt(_0x5df3e9(0x16f))/0x7*(parseInt(_0x5df3e9(0x134))/0x8)+parseInt(_0x5df3e9(0x174))/0x9*(-parseInt(_0x5df3e9(0x141))/0xa)+-parseInt(_0x5df3e9(0x168))/0xb+-parseInt(_0x5df3e9(0x12f))/0xc*(-parseInt(_0x5df3e9(0x130))/0xd);if(_0x4e4698===_0x3b7a08)break;else _0xcd082d['push'](_0xcd082d['shift']());}catch(_0x502cec){_0xcd082d['push'](_0xcd082d['shift']());}}}(a0_0x5282,0x69213));function a0_0x3adf(_0x2ec54c,_0x3e73e7){_0x2ec54c=_0x2ec54c-0x12b;const _0x5282e9=a0_0x5282();let _0x3adfff=_0x5282e9[_0x2ec54c];return _0x3adfff;}function a0_0x5282(){const _0x53f559=['clientSecret','warning','__esModule','检查指定client的配置文件schema合法性和有效性','-cs,\x20--clientSecret\x20<value>','getPkgVersion','uncaughtException','setMaxListeners','defineProperty','description','printDoctorResults','-ci,\x20--clientId\x20<value>','addHelpText','\x0a\x20\x20\x20\x20cc-ding\x20for\x20connect\x20ClaudeCode\x20to\x20DingDingRobot\x0a\x20\x20','1212SiOiqb','commander','command','.cc-ding','如需重新初始化,\x20请先删除已有配置文件','slice','-m,\x20--mobile\x20<value>','default','-cn,\x20--clientName\x20<value>','version','2771142tjNhJT','init','option','\x0aExamples:\x0a\x20\x20$\x20cc-ding\x20init\x20-ci\x20{clientId}\x20-cs\x20{clientSecret}\x20-m\x20{mobile}\x0a\x20\x20$\x20cc-ding\x20run\x20-ci\x20{clientId}\x0a','exit','/.cc-ding/','后续步骤:','2353393jgUHml','\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20功能:\x20钉钉机器人对接本地Claude,\x20支持会话模式和任务队列模式\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20会话数据路径:\x20~/.cc-ding/{clientId}/{MD5}/.sessions/{claudeSessionId}/session.{json|log}\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20任务数据路径:\x20~/.cc-ding/{clientId}/{MD5}/.tasks/{时间戳}/task.{json|log}\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20定时任务数据:\x20~/.cc-ding/{clientId}/cron.json\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20启动方式:\x20pm2\x20start\x20--name\x20\x22cc-ding-{clientId}\x22\x20npx\x20--\x20-p\x20cc-ding\x20run\x20-ci\x20{clientId}\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20会话模式说明\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20会话ID:\x20由\x20Claude\x20分配的\x20claudeSessionId\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20结束会话:\x20/end\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20新会话:\x20/new\x20[初始消息]\x20强制结束当前会话并开启新会话\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20恢复会话:\x20/resume\x20[会话ID]\x20恢复指定历史会话,\x20不指定则恢复最近一个\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20会话持久化:\x20活跃会话自动保存到\x20active.json,\x20服务重启后自动恢复\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20群内多用户:\x20允许群内所有白名单用户参与对话\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20/help:\x20查看所有可用命令(含版本、作者、文档链接);\x20/{命令}\x20--help\x20查看命令详细用法\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20图片消息支持\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20支持接收钉钉图片消息(picture)和富文本消息(richText,\x20含内嵌图片)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20图片自动下载保存到\x20<会话目录>/.images/\x20下\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20useLocalOcr:\x20默认开启,\x20使用本地OCR识别图片文字,\x20同时传入原图路径供Claude自主查看\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20配置方式:\x20conversations[].useLocalOcr\x20=\x20false\x20可关闭OCR(适用于支持图片识别的模型)\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20任务模式说明\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20任务ID:\x20任务接收时间戳\x0a\x20\x20\x20\x20\x20\x20\x20\x20-\x20API\x20Key\x20池化管理(可选,\x20配置apiKeyCfg后启用)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20429自动切换:\x20自动切换到API\x20Key模式\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Key轮换:\x20API\x20Key遇到429或连续TPM不稳定时自动换Key\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20跨天重置:\x20每日自动重置API\x20Key状态\x0a\x20\x20\x20\x20\x20\x20','60820ajCUcz','removeAllListeners','action','1890117aWKYSB','配置文件已存在:\x20','doctor','配置文件已生成:','8049KEMXCE','\x20\x20\x20\x20\x20pm2\x20start\x20--name\x20\x22cc-ding-','projUtil','runDoctor','clientId','3324XFScJX','17979SWMqiC','getHomeDir','loadEnv','2jRVwoG','8ckQxUE','../src/biz/cc-ding-cli','__importDefault','../src/biz/lock','parse','ensureClientDir','cc助手','\x20\x202.\x20启动机器人:\x20cc-ding\x20run\x20-ci','clientSecret\x20(钉钉Stream连接密钥)','run','/config.json','path','2894365QeTNUN','10cnelev','初始化cc-ding配置文件,\x20生成最简config.json','6GsfSdf','join','\x0a💡\x20请升级\x20Node\x20版本后重新运行\x0a','\x20\x201.\x20编辑\x20config.json\x20添加\x20conversations\x20配置(群聊需配置dingToken)','log','split','mobile','<兜底钉钉机器人Token-用于无dingToken群的消息接收>','acquirePidLock','\x20\x203.\x20推荐PM2启动:','argv','existsSync','requiredOption'];a0_0x5282=function(){return _0x53f559;};return a0_0x5282();}var __importDefault=this&&this[a0_0x2c5c4e(0x136)]||function(_0x35150e){const _0x59e354=a0_0x2c5c4e;return _0x35150e&&_0x35150e[_0x59e354(0x152)]?_0x35150e:{'default':_0x35150e};};Object[a0_0x2c5c4e(0x158)](exports,a0_0x2c5c4e(0x152),{'value':!![]});const common_1=require('../src/common'),commander_1=require(a0_0x2c5c4e(0x15f)),session_1=require('../src/biz/session'),path_1=__importDefault(require(a0_0x2c5c4e(0x13f))),cc_ding_cli_1=require(a0_0x2c5c4e(0x135)),lock_1=require(a0_0x2c5c4e(0x137)),doctor_1=require('../src/biz/doctor'),fs_1=__importDefault(require('fs'));(0x0,common_1[a0_0x2c5c4e(0x132)])(),process[a0_0x2c5c4e(0x172)](a0_0x2c5c4e(0x151)),process[a0_0x2c5c4e(0x157)](0x0),process['on'](a0_0x2c5c4e(0x156),function(_0x39428e){const _0x4ed981=a0_0x2c5c4e;console[_0x4ed981(0x147)]('Caught\x20exception:\x20'+_0x39428e),process[_0x4ed981(0x16c)](0x1);});const program=new commander_1['Command']();program[a0_0x2c5c4e(0x15c)]('before',a0_0x2c5c4e(0x15d))[a0_0x2c5c4e(0x15c)]('after',a0_0x2c5c4e(0x16b))[a0_0x2c5c4e(0x167)]((0x0,common_1[a0_0x2c5c4e(0x12c)])()[a0_0x2c5c4e(0x155)]()),program[a0_0x2c5c4e(0x160)](a0_0x2c5c4e(0x169))[a0_0x2c5c4e(0x159)](a0_0x2c5c4e(0x142))[a0_0x2c5c4e(0x14f)]('-ci,\x20--clientId\x20<value>','clientId')[a0_0x2c5c4e(0x14f)](a0_0x2c5c4e(0x154),a0_0x2c5c4e(0x13c))[a0_0x2c5c4e(0x14f)](a0_0x2c5c4e(0x164),'mobile\x20(自己的手机号,\x20自动加入白名单)')[a0_0x2c5c4e(0x16a)](a0_0x2c5c4e(0x166),'clientName\x20(机器人名称,\x20可选)')['action'](async _0x43c2e9=>{const _0x56c49b=a0_0x2c5c4e,_0x3b7999=process[_0x56c49b(0x167)][_0x56c49b(0x163)](0x1),_0x14f1f6=parseInt(_0x3b7999[_0x56c49b(0x148)]('.')[0x0],0xa);_0x14f1f6<0x18&&(console[_0x56c49b(0x147)]('\x0a❌\x20Node\x20版本过低,无法执行\x20init\x20命令'),console['log']('\x20\x20当前版本:'+_0x3b7999),console[_0x56c49b(0x147)]('\x20\x20要求:Node\x20>=\x2024'),console[_0x56c49b(0x147)](_0x56c49b(0x145)),process[_0x56c49b(0x16c)](0x1));const _0x48f9d0=(0x0,session_1[_0x56c49b(0x131)])()+_0x56c49b(0x16d)+_0x43c2e9[_0x56c49b(0x12e)],_0x380477=_0x48f9d0+_0x56c49b(0x13e);fs_1[_0x56c49b(0x165)][_0x56c49b(0x14e)](_0x380477)&&(console['log'](_0x56c49b(0x175)+_0x380477),console['log'](_0x56c49b(0x162)),process[_0x56c49b(0x16c)](0x1));const _0x336f96={'clientName':_0x43c2e9['clientName']||_0x56c49b(0x13a),'owner':_0x43c2e9['mobile'],'whiteUserList':[_0x43c2e9[_0x56c49b(0x149)]],'clientSecret':_0x43c2e9[_0x56c49b(0x150)],'defaultDingToken':_0x56c49b(0x14a),'conversations':[],'includeThinking':![],'resultOnly':!![],'debug':![],'taskQueueSize':0xa,'taskHandlerCount':0x1,'sessionMaxConcurrency':0x14};(0x0,session_1['initClientDir'])(_0x43c2e9[_0x56c49b(0x12e)],_0x336f96),console[_0x56c49b(0x147)](_0x56c49b(0x177),_0x380477),console[_0x56c49b(0x147)](''),console['log'](_0x56c49b(0x16e)),console['log'](_0x56c49b(0x146)),console['log'](_0x56c49b(0x13b),_0x43c2e9['clientId']),console[_0x56c49b(0x147)](_0x56c49b(0x14c)),console[_0x56c49b(0x147)](_0x56c49b(0x12b)+_0x43c2e9[_0x56c49b(0x12e)]+'\x22\x20npx\x20--\x20-p\x20cc-ding\x20cc-ding\x20run\x20-ci\x20'+_0x43c2e9[_0x56c49b(0x12e)]);}),program[a0_0x2c5c4e(0x160)]('run')[a0_0x2c5c4e(0x159)](a0_0x2c5c4e(0x170))[a0_0x2c5c4e(0x14f)](a0_0x2c5c4e(0x15b),a0_0x2c5c4e(0x12e))[a0_0x2c5c4e(0x173)](async _0x462d13=>{const _0x39416f=a0_0x2c5c4e;(0x0,session_1[_0x39416f(0x139)])(_0x462d13[_0x39416f(0x12e)]);const _0x18e8e2=path_1['default']['join']((0x0,session_1['getHomeDir'])(),'.cc-ding',_0x462d13[_0x39416f(0x12e)]);(0x0,lock_1[_0x39416f(0x14b)])(_0x18e8e2,_0x462d13[_0x39416f(0x12e)]),await new cc_ding_cli_1['DingClaude'](_0x462d13['clientId'])[_0x39416f(0x13d)]();}),program['command'](a0_0x2c5c4e(0x176))[a0_0x2c5c4e(0x159)](a0_0x2c5c4e(0x153))['requiredOption'](a0_0x2c5c4e(0x15b),a0_0x2c5c4e(0x12e))[a0_0x2c5c4e(0x173)](async _0x420a74=>{const _0x2b4b8f=a0_0x2c5c4e,_0x499a8f=path_1[_0x2b4b8f(0x165)][_0x2b4b8f(0x144)]((0x0,session_1[_0x2b4b8f(0x131)])(),_0x2b4b8f(0x161),_0x420a74[_0x2b4b8f(0x12e)]),_0x2d9e95=(0x0,doctor_1[_0x2b4b8f(0x12d)])(_0x499a8f);(0x0,doctor_1[_0x2b4b8f(0x15a)])(_0x2d9e95);}),program[a0_0x2c5c4e(0x138)](process[a0_0x2c5c4e(0x14d)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a1_0x2b6750=a1_0x15c9;(function(_0x522308,_0x33ff2a){const _0x16b360=a1_0x15c9,_0x4451d0=_0x522308();while(!![]){try{const _0x45a4d4=parseInt(_0x16b360(0x136))/0x1+parseInt(_0x16b360(0x12f))/0x2+-parseInt(_0x16b360(0x148))/0x3+-parseInt(_0x16b360(0x129))/0x4+-parseInt(_0x16b360(0x120))/0x5+parseInt(_0x16b360(0x13d))/0x6+-parseInt(_0x16b360(0x15c))/0x7*(-parseInt(_0x16b360(0x155))/0x8);if(_0x45a4d4===_0x33ff2a)break;else _0x4451d0['push'](_0x4451d0['shift']());}catch(_0x52a38){_0x4451d0['push'](_0x4451d0['shift']());}}}(a1_0x4cad,0x3bf34));var __importDefault=this&&this[a1_0x2b6750(0x18b)]||function(_0x50d1c3){const _0x3edf1e=a1_0x2b6750;return _0x50d1c3&&_0x50d1c3[_0x3edf1e(0xff)]?_0x50d1c3:{'default':_0x50d1c3};};Object[a1_0x2b6750(0x128)](exports,a1_0x2b6750(0xff),{'value':!![]}),exports[a1_0x2b6750(0xf7)]=saveClientConfig,exports[a1_0x2b6750(0x121)]=resetApiKeyCfg,exports['scheduleApiKeyCfgDailyReset']=scheduleApiKeyCfgDailyReset,exports[a1_0x2b6750(0x189)]=settingLabel,exports[a1_0x2b6750(0x146)]=rotateApiKey,exports[a1_0x2b6750(0x17c)]=pickValidApiKey,exports[a1_0x2b6750(0x176)]=ensureSettingsWithApiKey,exports['isQuotaExhaustedError']=isQuotaExhaustedError,exports[a1_0x2b6750(0x13c)]=isAuthenticationError,exports[a1_0x2b6750(0x135)]=readApiKeyFromSettings,exports[a1_0x2b6750(0x186)]=getForceEnabledSettingsPath,exports[a1_0x2b6750(0x15e)]=startupCheck;function a1_0x15c9(_0x2fe1cf,_0x2e7c9b){_0x2fe1cf=_0x2fe1cf-0xf7;const _0x4cad92=a1_0x4cad();let _0x15c9c9=_0x4cad92[_0x2fe1cf];return _0x15c9c9;}const fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a1_0x2b6750(0xfd))),child_process_1=require(a1_0x2b6750(0x126)),session_1=require(a1_0x2b6750(0x185)),utils_ok_1=require(a1_0x2b6750(0x18a));function saveClientConfig(_0x51d212){const _0x53c60f=a1_0x2b6750,_0x2cde8e=_0x51d212[_0x53c60f(0x159)]()+_0x53c60f(0x11a);try{fs_1[_0x53c60f(0x154)][_0x53c60f(0x17f)](_0x2cde8e,JSON[_0x53c60f(0x17d)](_0x51d212[_0x53c60f(0x104)],null,0x2),_0x53c60f(0x11d));}catch(_0x1ea28e){console[_0x53c60f(0x163)]('['+(0x0,session_1[_0x53c60f(0x167)])()+_0x53c60f(0x114),_0x1ea28e);}}function resetApiKeyCfg(_0x24e8fa){const _0x125f80=a1_0x2b6750,_0xadf80e=_0x24e8fa['config'][_0x125f80(0xfc)];if(!_0xadf80e)return;const _0x337395=new Date();_0xadf80e['resetTime']=utils_ok_1[_0x125f80(0x169)]['mm'](_0x337395[_0x125f80(0x14c)]())['format'](_0x125f80(0x170));let _0x549918=0x0;for(const _0x1914cc of _0xadf80e[_0x125f80(0x12d)]){!_0x1914cc[_0x125f80(0x125)]&&(_0x1914cc[_0x125f80(0x125)]=!![],_0x549918++);}_0x549918>0x0&&console[_0x125f80(0x131)]('['+(0x0,session_1[_0x125f80(0x167)])()+']\x20'+_0x549918+_0x125f80(0x102)),saveClientConfig(_0x24e8fa),console[_0x125f80(0x131)]('['+(0x0,session_1[_0x125f80(0x167)])()+_0x125f80(0x12c));}function a1_0x4cad(){const _0x1cfd13=['apiKeyCfg.claudeSettings\x20共\x20','getTime','linkConversationId','\x20致命','clientSecret\x20(钉钉\x20Stream\x20Client\x20密钥)','which\x20claude',',\x20smallModel:\x20','push','apiKeyCfg.claudeSettings[','default','20904mrsvnE','FATAL',']\x20==========\x20启动自检\x20==========','settings-ding.json','getClientDir','isArray','find','525HNHqIe','model','startupCheck','apiKey','level','settings-tpl.json','boolean','error','floor','conversationTitle','has','timestamp','.cc-ding','dateUtil','[WARN]\x20','\x20isValid\x20类型异常:\x20','settings-tpl.json\x20有效,env\x20包含:\x20','filter','pipe',']\x20自检完成:\x20','YYYY-MM-DD\x20HH:mm:ss',',创建\x20settings-ding.json\x20时将使用空模板','PASS','FORCE_ENABLE','...','memo','ensureSettingsWithApiKey','\x20警告,\x20','claude\x20命令不可用,请确认\x20Claude\x20Code\x20CLI\x20已安装','\x22\x20未在\x20conversations\x20中找到','slice','claude\x20命令可用','pickValidApiKey','stringify','\x20apiKey\x20重复:\x20','writeFileSync','whiteUserList\x20(白名单用户)','ANTHROPIC_AUTH_TOKEN','\x20linkConversationId\x20\x22','object','message','./session','getForceEnabledSettingsPath','execSync','add','settingLabel','utils-ok','__importDefault','saveClientConfig','parse','\x20通过,\x20','conversationId','工作目录不可写:\x20','apiKeyCfg','path','conversations','__esModule',']\x20检测到\x20settings-ding.json\x20FORCE_ENABLE=','join','\x20个已失效\x20Claude\x20Setting\x20重新标记为有效','getFullYear','config','.claude','\x20缺少\x20apiKey','getHomeDir',']\x20启动自检发现致命错误,进程退出','settings-tpl.json\x20缺少\x20env\x20字段,创建\x20settings-ding.json\x20时将不包含预配置环境变量','existsSync','WARN','\x20缺少\x20conversationId',',\x20model:\x20','\x20—\x20','readFileSync','apiKeyCfg\x20上次重置时间:\x20','conversations\x20应为数组或已配置','getConversationDir','conversations[',']\x20保存\x20config.json\x20失败:','test','settings-tpl.json\x20不存在:\x20','conversations\x20为空数组,可通过\x20/reg\x20命令动态注册','群工作目录已就绪:\x20','random','/config.json','getMonth','resetTime','utf-8','mkdirSync','ANTHROPIC_BASE_URL','1943250NPSIVT','resetApiKeyCfg','工作目录可写:\x20','length','env','isValid','child_process','群工作目录创建失败:\x20','defineProperty','27452lcfSjv','some','exit',']\x20apiKeyCfg\x20已重置\x20(所有\x20Claude\x20Setting\x20isValid=true)','claudeSettings',']\x20Claude\x20Setting\x20已失效:\x20','176352jSNHLp','whiteUserList','log','apiKeyCfg.claudeSettings\x20为空,无可用\x20Key','\x20个群配置','(空)','readApiKeyFromSettings','298680SOpOim','clientSecret','ANTHROPIC_MODEL',',\x20剩余有效:\x20','config.json\x20缺少必填字段:\x20','\x20conversationId\x20重复:\x20','isAuthenticationError','1022484iZJpju','smallModel','baseUrl','conversations\x20共\x20','\x20缺少\x20baseUrl',']\x20定时重置\x20apiKeyCfg\x20(每天0点)','toISOString','owner','.healthcheck','rotateApiKey','keys','336528NUYtjD','CLAUDE_SMALL_FAST_MODEL','apiKeyCfg.claudeSettings\x20不是数组,API\x20Key\x20轮换功能不可用'];a1_0x4cad=function(){return _0x1cfd13;};return a1_0x4cad();}function scheduleApiKeyCfgDailyReset(_0x5a2746){const _0x3741f3=()=>{const _0x2be77e=a1_0x15c9,_0x28dea7=new Date(),_0x2c1859=new Date(_0x28dea7[_0x2be77e(0x103)](),_0x28dea7[_0x2be77e(0x11b)](),_0x28dea7['getDate']()+0x1,0x0,0x0,0x0,0x0),_0x1a98dc=_0x2c1859[_0x2be77e(0x14c)]()-_0x28dea7[_0x2be77e(0x14c)]();setTimeout(()=>{const _0x15e604=_0x2be77e;console['log']('['+(0x0,session_1[_0x15e604(0x167)])()+_0x15e604(0x142)),resetApiKeyCfg(_0x5a2746),_0x3741f3();},_0x1a98dc),console[_0x2be77e(0x131)]('['+(0x0,session_1[_0x2be77e(0x167)])()+']\x20apiKeyCfg\x20每日重置已调度,下次重置:\x20'+_0x2c1859[_0x2be77e(0x143)]());};_0x3741f3();}function settingLabel(_0xc6e115){const _0x227de6=a1_0x2b6750;return _0xc6e115[_0x227de6(0x175)]?_0xc6e115['memo']:_0x227de6(0x174)+_0xc6e115[_0x227de6(0x15f)][_0x227de6(0x17a)](-0x6);}function findSettingLabel(_0x115d10,_0x59e5bc){const _0x190e73=a1_0x2b6750,_0x33cfab=_0x115d10[_0x190e73(0x15b)](_0x2df110=>_0x2df110[_0x190e73(0x15f)]===_0x59e5bc);return _0x33cfab?settingLabel(_0x33cfab):_0x190e73(0x174)+_0x59e5bc[_0x190e73(0x17a)](-0x6);}function rotateApiKey(_0x77ffcd,_0x22b505){const _0x309296=a1_0x2b6750,_0x96c7c3=_0x77ffcd[_0x309296(0x104)][_0x309296(0xfc)];if(!_0x96c7c3)return null;for(const _0x399415 of _0x96c7c3['claudeSettings']){if(_0x399415['apiKey']===_0x22b505&&_0x399415['isValid']){_0x399415['isValid']=![];break;}}const _0x2120ab=_0x96c7c3[_0x309296(0x12d)]['filter'](_0x57116f=>_0x57116f[_0x309296(0x125)])[_0x309296(0x123)],_0x52e4c7=findSettingLabel(_0x96c7c3['claudeSettings'],_0x22b505);return console[_0x309296(0x131)]('['+(0x0,session_1[_0x309296(0x167)])()+_0x309296(0x12e)+_0x52e4c7+_0x309296(0x139)+_0x2120ab),saveClientConfig(_0x77ffcd),pickValidApiKey(_0x77ffcd);}function pickValidApiKey(_0x26dff7){const _0x16132c=a1_0x2b6750,_0x4bed6f=_0x26dff7[_0x16132c(0x104)][_0x16132c(0xfc)];if(!_0x4bed6f)return null;const _0x397256=_0x4bed6f[_0x16132c(0x12d)][_0x16132c(0x16d)](_0x2ed890=>_0x2ed890[_0x16132c(0x125)]);if(_0x397256[_0x16132c(0x123)]===0x0)return null;return _0x397256[Math[_0x16132c(0x164)](Math[_0x16132c(0x119)]()*_0x397256[_0x16132c(0x123)])];}function ensureSettingsWithApiKey(_0x2b5a64,_0x16a498){const _0x341e3d=a1_0x2b6750,_0x43e8e3=path_1['default'][_0x341e3d(0x101)](_0x2b5a64,'.claude'),_0x154a7=path_1[_0x341e3d(0x154)][_0x341e3d(0x101)](_0x43e8e3,_0x341e3d(0x158));let _0x49c328={};if(fs_1[_0x341e3d(0x154)][_0x341e3d(0x10a)](_0x154a7))try{_0x49c328=JSON[_0x341e3d(0xf8)](fs_1[_0x341e3d(0x154)][_0x341e3d(0x10f)](_0x154a7,'utf-8'));}catch{_0x49c328={};}else{const _0x57c0be=path_1[_0x341e3d(0x154)][_0x341e3d(0x101)]((0x0,session_1[_0x341e3d(0x107)])(),_0x341e3d(0x168),_0x341e3d(0x161));if(fs_1['default'][_0x341e3d(0x10a)](_0x57c0be))try{_0x49c328=JSON['parse'](fs_1[_0x341e3d(0x154)][_0x341e3d(0x10f)](_0x57c0be,_0x341e3d(0x11d))),console[_0x341e3d(0x131)]('['+(0x0,session_1[_0x341e3d(0x167)])()+']\x20从模板创建\x20settings-ding.json:\x20'+_0x57c0be);}catch{_0x49c328={};}}!_0x49c328[_0x341e3d(0x124)]&&(_0x49c328['env']={});let _0x1f5c4c=![];_0x49c328['env']['ANTHROPIC_AUTH_TOKEN']!==_0x16a498[_0x341e3d(0x15f)]&&(_0x49c328[_0x341e3d(0x124)][_0x341e3d(0x181)]=_0x16a498[_0x341e3d(0x15f)],_0x1f5c4c=!![]);_0x16a498['baseUrl']&&_0x49c328[_0x341e3d(0x124)]['ANTHROPIC_BASE_URL']!==_0x16a498[_0x341e3d(0x13f)]&&(_0x49c328[_0x341e3d(0x124)][_0x341e3d(0x11f)]=_0x16a498['baseUrl'],_0x1f5c4c=!![]);_0x16a498[_0x341e3d(0x15d)]&&_0x49c328[_0x341e3d(0x124)][_0x341e3d(0x138)]!==_0x16a498[_0x341e3d(0x15d)]&&(_0x49c328[_0x341e3d(0x124)][_0x341e3d(0x138)]=_0x16a498[_0x341e3d(0x15d)],_0x1f5c4c=!![]);const _0x5e63d6=_0x16a498[_0x341e3d(0x13e)]||_0x16a498[_0x341e3d(0x15d)];return _0x5e63d6&&_0x49c328[_0x341e3d(0x124)][_0x341e3d(0x149)]!==_0x5e63d6&&(_0x49c328['env'][_0x341e3d(0x149)]=_0x5e63d6,_0x1f5c4c=!![]),_0x1f5c4c&&(fs_1[_0x341e3d(0x154)]['mkdirSync'](_0x43e8e3,{'recursive':!![]}),fs_1[_0x341e3d(0x154)][_0x341e3d(0x17f)](_0x154a7,JSON['stringify'](_0x49c328,null,0x2),_0x341e3d(0x11d)),console[_0x341e3d(0x131)]('['+(0x0,session_1[_0x341e3d(0x167)])()+']\x20已写入\x20Claude\x20配置到\x20'+_0x154a7+'\x20('+settingLabel(_0x16a498)+_0x341e3d(0x10d)+_0x16a498['model']+_0x341e3d(0x151)+_0x5e63d6+')')),_0x154a7;}function isQuotaExhaustedError(_0x2058eb){const _0x3853e7=a1_0x2b6750;if(/Request\s+rejected.*429/i[_0x3853e7(0x115)](_0x2058eb))return!![];if(/429.*Request\s+rejected/i[_0x3853e7(0x115)](_0x2058eb))return!![];if(/429.*(?:超过.*上限|使用上限|配额|quota|capacity)/i[_0x3853e7(0x115)](_0x2058eb))return!![];if(/(?:超过.*上限|使用上限|配额|quota|capacity).*429/i[_0x3853e7(0x115)](_0x2058eb))return!![];return![];}function isAuthenticationError(_0x2dc64a){const _0x23d3e7=a1_0x2b6750;if(/authentication_error/i[_0x23d3e7(0x115)](_0x2dc64a))return!![];if(/401.*(?:未授权|unauthorized|invalid\s*(?:key|token|api)|auth)/i[_0x23d3e7(0x115)](_0x2dc64a))return!![];if(/(?:未授权|unauthorized|invalid\s*(?:key|token|api)|auth).*401/i[_0x23d3e7(0x115)](_0x2dc64a))return!![];return![];}function readApiKeyFromSettings(_0x316da1){const _0x394893=a1_0x2b6750,_0x52be39=path_1['default'][_0x394893(0x101)](_0x316da1,_0x394893(0x105),_0x394893(0x158));if(!fs_1[_0x394893(0x154)][_0x394893(0x10a)](_0x52be39))return null;try{const _0x14c72a=JSON[_0x394893(0xf8)](fs_1[_0x394893(0x154)][_0x394893(0x10f)](_0x52be39,'utf-8'));return _0x14c72a[_0x394893(0x124)]?.['ANTHROPIC_AUTH_TOKEN']||null;}catch{return null;}}function getForceEnabledSettingsPath(_0x47d0a7){const _0x2989f6=a1_0x2b6750,_0x36c62d=path_1['default'][_0x2989f6(0x101)](_0x47d0a7,_0x2989f6(0x105),'settings-ding.json');if(!fs_1[_0x2989f6(0x154)]['existsSync'](_0x36c62d))return null;try{const _0x326485=JSON[_0x2989f6(0xf8)](fs_1[_0x2989f6(0x154)][_0x2989f6(0x10f)](_0x36c62d,_0x2989f6(0x11d))),_0x3986c5=_0x326485[_0x2989f6(0x124)]?.[_0x2989f6(0x173)];if(_0x3986c5!==undefined&&_0x3986c5!==![]&&_0x3986c5!=='')return console[_0x2989f6(0x131)]('['+(0x0,session_1[_0x2989f6(0x167)])()+_0x2989f6(0x100)+_0x3986c5+',强制使用该配置'),_0x36c62d;return null;}catch{return null;}}function startupCheck(_0x12e4a2){const _0x269a3b=a1_0x2b6750,_0x2167eb=[],_0x913cba=_0x12e4a2[_0x269a3b(0x104)],_0x4220bc=_0x12e4a2[_0x269a3b(0x159)](),_0x5c5697=[{'key':_0x269a3b(0x137),'label':_0x269a3b(0x14f)},{'key':_0x269a3b(0x130),'label':_0x269a3b(0x180)},{'key':_0x269a3b(0x144),'label':'owner\x20(机器人\x20owner)'}];for(const {key:_0x2ddf62,label:_0x2f8f9a}of _0x5c5697){const _0x10777a=_0x913cba[_0x2ddf62];_0x10777a===undefined||_0x10777a===null||_0x10777a===''||Array[_0x269a3b(0x15a)](_0x10777a)&&_0x10777a[_0x269a3b(0x123)]===0x0?_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x156),'message':_0x269a3b(0x13a)+_0x2f8f9a}):_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':'config.json\x20'+_0x2f8f9a+'\x20✓'});}if(!Array[_0x269a3b(0x15a)](_0x913cba[_0x269a3b(0xfe)]))_0x2167eb[_0x269a3b(0x152)]({'level':'FATAL','message':_0x269a3b(0x111)});else{if(_0x913cba[_0x269a3b(0xfe)]['length']===0x0)_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':_0x269a3b(0x117)});else{const _0x1a427a=new Set();for(let _0x3c8163=0x0;_0x3c8163<_0x913cba[_0x269a3b(0xfe)][_0x269a3b(0x123)];_0x3c8163++){const _0x2c5b5c=_0x913cba[_0x269a3b(0xfe)][_0x3c8163],_0x327c9b=_0x269a3b(0x113)+_0x3c8163+']';if(!_0x2c5b5c[_0x269a3b(0xfa)])_0x2167eb['push']({'level':_0x269a3b(0x156),'message':_0x327c9b+_0x269a3b(0x10c)});else _0x1a427a['has'](_0x2c5b5c[_0x269a3b(0xfa)])?_0x2167eb['push']({'level':_0x269a3b(0x10b),'message':_0x327c9b+_0x269a3b(0x13b)+_0x2c5b5c[_0x269a3b(0xfa)]}):_0x1a427a[_0x269a3b(0x188)](_0x2c5b5c['conversationId']);_0x2c5b5c[_0x269a3b(0x14d)]&&!_0x913cba[_0x269a3b(0xfe)][_0x269a3b(0x12a)](_0x20b835=>_0x20b835['conversationId']===_0x2c5b5c[_0x269a3b(0x14d)])&&_0x2167eb[_0x269a3b(0x152)]({'level':'WARN','message':_0x327c9b+_0x269a3b(0x182)+_0x2c5b5c[_0x269a3b(0x14d)]+_0x269a3b(0x179)});}_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':_0x269a3b(0x140)+_0x913cba[_0x269a3b(0xfe)][_0x269a3b(0x123)]+_0x269a3b(0x133)});}}if(_0x913cba['apiKeyCfg']){const _0x2ec498=_0x913cba[_0x269a3b(0xfc)];_0x2ec498[_0x269a3b(0x11c)]&&_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':_0x269a3b(0x110)+_0x2ec498[_0x269a3b(0x11c)]});if(!Array['isArray'](_0x2ec498[_0x269a3b(0x12d)]))_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':_0x269a3b(0x14a)});else{if(_0x2ec498[_0x269a3b(0x12d)]['length']===0x0)_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':_0x269a3b(0x132)});else{const _0x57b305=new Set();for(let _0x25fe6f=0x0;_0x25fe6f<_0x2ec498[_0x269a3b(0x12d)][_0x269a3b(0x123)];_0x25fe6f++){const _0x52f67e=_0x2ec498[_0x269a3b(0x12d)][_0x25fe6f],_0x415bcc=_0x269a3b(0x153)+_0x25fe6f+']';if(!_0x52f67e[_0x269a3b(0x15f)])_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x156),'message':_0x415bcc+_0x269a3b(0x106)});else _0x57b305[_0x269a3b(0x166)](_0x52f67e[_0x269a3b(0x15f)])?_0x2167eb[_0x269a3b(0x152)]({'level':'WARN','message':_0x415bcc+_0x269a3b(0x17e)+settingLabel(_0x52f67e)}):_0x57b305['add'](_0x52f67e[_0x269a3b(0x15f)]);!_0x52f67e[_0x269a3b(0x13f)]&&_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':_0x415bcc+_0x269a3b(0x141)}),!_0x52f67e['model']&&_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':_0x415bcc+'\x20缺少\x20model'}),typeof _0x52f67e[_0x269a3b(0x125)]!==_0x269a3b(0x162)&&_0x2167eb['push']({'level':_0x269a3b(0x10b),'message':_0x415bcc+_0x269a3b(0x16b)+typeof _0x52f67e[_0x269a3b(0x125)]});}const _0x159e89=_0x2ec498[_0x269a3b(0x12d)][_0x269a3b(0x16d)](_0x20b4a6=>_0x20b4a6[_0x269a3b(0x125)])[_0x269a3b(0x123)];_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':_0x269a3b(0x14b)+_0x2ec498['claudeSettings']['length']+'\x20项,有效\x20'+_0x159e89});}}}const _0x25615e=path_1[_0x269a3b(0x154)][_0x269a3b(0x101)]((0x0,session_1[_0x269a3b(0x107)])(),_0x269a3b(0x168),'settings-tpl.json');if(fs_1['default'][_0x269a3b(0x10a)](_0x25615e))try{const _0x48ba25=JSON[_0x269a3b(0xf8)](fs_1[_0x269a3b(0x154)][_0x269a3b(0x10f)](_0x25615e,_0x269a3b(0x11d)));if(typeof _0x48ba25!==_0x269a3b(0x183)||_0x48ba25===null)_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':'settings-tpl.json\x20根元素不是对象'});else{if(!_0x48ba25[_0x269a3b(0x124)]||typeof _0x48ba25['env']!=='object')_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':_0x269a3b(0x109)});else{const _0x4363ef=Object[_0x269a3b(0x147)](_0x48ba25[_0x269a3b(0x124)]);_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':_0x269a3b(0x16c)+(_0x4363ef[_0x269a3b(0x101)](',\x20')||_0x269a3b(0x134))});}}}catch(_0x21d7e2){_0x2167eb[_0x269a3b(0x152)]({'level':'WARN','message':'settings-tpl.json\x20解析失败:\x20'+(_0x21d7e2 instanceof Error?_0x21d7e2['message']:_0x21d7e2)});}else _0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':_0x269a3b(0x116)+_0x25615e+_0x269a3b(0x171)});try{(0x0,child_process_1[_0x269a3b(0x187)])(_0x269a3b(0x150),{'stdio':_0x269a3b(0x16e)}),_0x2167eb['push']({'level':_0x269a3b(0x172),'message':_0x269a3b(0x17b)});}catch{_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x156),'message':_0x269a3b(0x178)});}try{const _0x3fc086=path_1[_0x269a3b(0x154)][_0x269a3b(0x101)](_0x4220bc,_0x269a3b(0x145));fs_1[_0x269a3b(0x154)][_0x269a3b(0x17f)](_0x3fc086,'ok',_0x269a3b(0x11d)),fs_1[_0x269a3b(0x154)]['unlinkSync'](_0x3fc086),_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':_0x269a3b(0x122)+_0x4220bc});}catch(_0x3f8176){_0x2167eb['push']({'level':_0x269a3b(0x156),'message':_0x269a3b(0xfb)+_0x4220bc+_0x269a3b(0x10e)+(_0x3f8176 instanceof Error?_0x3f8176['message']:_0x3f8176)});}if(Array[_0x269a3b(0x15a)](_0x913cba[_0x269a3b(0xfe)]))for(const _0x4428d3 of _0x913cba[_0x269a3b(0xfe)]){const _0x15188c=_0x12e4a2[_0x269a3b(0x112)](_0x4428d3[_0x269a3b(0xfa)]);try{fs_1[_0x269a3b(0x154)][_0x269a3b(0x11e)](_0x15188c,{'recursive':!![]}),_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x172),'message':_0x269a3b(0x118)+(_0x4428d3[_0x269a3b(0x165)]||_0x4428d3[_0x269a3b(0xfa)])});}catch(_0x4ec318){_0x2167eb[_0x269a3b(0x152)]({'level':_0x269a3b(0x10b),'message':_0x269a3b(0x127)+_0x15188c+_0x269a3b(0x10e)+(_0x4ec318 instanceof Error?_0x4ec318[_0x269a3b(0x184)]:_0x4ec318)});}}console[_0x269a3b(0x131)]('\x0a['+(0x0,session_1[_0x269a3b(0x167)])()+_0x269a3b(0x157));const _0xd447c0=_0x2167eb[_0x269a3b(0x12a)](_0x284943=>_0x284943['level']===_0x269a3b(0x156));for(const _0x29f980 of _0x2167eb){const _0x538e55=_0x29f980['level']==='PASS'?'✓':_0x29f980['level']===_0x269a3b(0x156)?'✗':'⚠',_0x117b45=_0x29f980[_0x269a3b(0x160)]===_0x269a3b(0x172)?_0x29f980[_0x269a3b(0x184)]:_0x29f980[_0x269a3b(0x160)]===_0x269a3b(0x156)?'[FATAL]\x20'+_0x29f980['message']:_0x269a3b(0x16a)+_0x29f980[_0x269a3b(0x184)];console['log']('\x20\x20'+_0x538e55+'\x20'+_0x117b45);}const _0x111463=_0x2167eb[_0x269a3b(0x16d)](_0x3b7996=>_0x3b7996['level']==='PASS')[_0x269a3b(0x123)],_0x4c4333=_0x2167eb[_0x269a3b(0x16d)](_0x428648=>_0x428648[_0x269a3b(0x160)]===_0x269a3b(0x10b))[_0x269a3b(0x123)],_0x1dc98d=_0x2167eb[_0x269a3b(0x16d)](_0x1587cf=>_0x1587cf[_0x269a3b(0x160)]===_0x269a3b(0x156))[_0x269a3b(0x123)];console[_0x269a3b(0x131)]('['+(0x0,session_1['timestamp'])()+_0x269a3b(0x16f)+_0x111463+_0x269a3b(0xf9)+_0x4c4333+_0x269a3b(0x177)+_0x1dc98d+_0x269a3b(0x14e)),console[_0x269a3b(0x131)]('['+(0x0,session_1[_0x269a3b(0x167)])()+']\x20==============================\x0a'),_0xd447c0&&(console['error']('['+(0x0,session_1['timestamp'])()+_0x269a3b(0x108)),process[_0x269a3b(0x12b)](0x1));}
|
|
1
|
+
'use strict';const a1_0x252c47=a1_0x5c8d;(function(_0x4f4a6e,_0x262409){const _0x35471d=a1_0x5c8d,_0x3b7b9a=_0x4f4a6e();while(!![]){try{const _0x2aaaae=parseInt(_0x35471d(0x134))/0x1+parseInt(_0x35471d(0x124))/0x2+-parseInt(_0x35471d(0xda))/0x3+parseInt(_0x35471d(0x102))/0x4+parseInt(_0x35471d(0x13e))/0x5*(-parseInt(_0x35471d(0x115))/0x6)+-parseInt(_0x35471d(0x12b))/0x7+-parseInt(_0x35471d(0x101))/0x8*(-parseInt(_0x35471d(0x13f))/0x9);if(_0x2aaaae===_0x262409)break;else _0x3b7b9a['push'](_0x3b7b9a['shift']());}catch(_0x536b00){_0x3b7b9a['push'](_0x3b7b9a['shift']());}}}(a1_0x4889,0x9320b));var __importDefault=this&&this[a1_0x252c47(0x131)]||function(_0x3a0ad2){const _0x1f3e16=a1_0x252c47;return _0x3a0ad2&&_0x3a0ad2[_0x1f3e16(0x10e)]?_0x3a0ad2:{'default':_0x3a0ad2};};function a1_0x5c8d(_0x3a9957,_0x3cad61){_0x3a9957=_0x3a9957-0xd7;const _0x4889a1=a1_0x4889();let _0x5c8da8=_0x4889a1[_0x3a9957];return _0x5c8da8;}function a1_0x4889(){const _0x44ccd2=[',\x20剩余有效:\x20','baseUrl','./session','settings-ding.json',',强制使用该配置','pickValidApiKey','getClientDir','length','whiteUserList','utils-ok',']\x20==========\x20启动自检\x20==========','keys','boolean','\x20通过,\x20','owner\x20(机器人\x20owner)','stringify',']\x20已写入\x20Claude\x20配置到\x20','dateUtil','defineProperty','writeFileSync','apiKeyCfg\x20上次重置时间:\x20','execSync','level','105712qDuBnT','1269988jfrpWV','conversations[','conversations\x20为空数组,可通过\x20/reg\x20命令动态注册',']\x20apiKeyCfg\x20每日重置已调度,下次重置:\x20','ANTHROPIC_AUTH_TOKEN',']\x20apiKeyCfg\x20已重置\x20(所有\x20Claude\x20Setting\x20isValid=true)','config','ANTHROPIC_MODEL','existsSync','\x20linkConversationId\x20\x22','claude\x20命令可用','pipe','__esModule','\x20警告,\x20','config.json\x20缺少必填字段:\x20','random','find','conversations','push','131982qOmvLI','model','YYYY-MM-DD\x20HH:mm:ss',']\x20Claude\x20Setting\x20已失效:\x20','mkdirSync','apiKeyCfg','timestamp','.claude','floor','FORCE_ENABLE','format','\x20缺少\x20conversationId',']\x20启动自检发现致命错误,进程退出','conversationTitle','...','641964NPJrNb','settings-tpl.json\x20不存在:\x20','test','memo','\x20isValid\x20类型异常:\x20','apiKeyCfg.claudeSettings[','getTime','5837013yrhfEi','getHomeDir','工作目录不可写:\x20','unlinkSync',']\x20==============================\x0a','apiKey','__importDefault','ensureSettingsWithApiKey','saveClientConfig','974697RwGWuI','smallModel','apiKeyCfg.claudeSettings\x20为空,无可用\x20Key','PASS','join','getForceEnabledSettingsPath','FATAL','\x20缺少\x20apiKey','\x20个群配置','isValid','80rLxSYG','126puzaPl','\x20—\x20','settings-tpl.json\x20解析失败:\x20',']\x20自检完成:\x20','scheduleApiKeyCfgDailyReset','conversations\x20应为数组或已配置','.cc-ding','\x20apiKey\x20重复:\x20','.healthcheck',',\x20model:\x20','/config.json','apiKeyCfg.claudeSettings\x20共\x20','log','env','filter','CLAUDE_SMALL_FAST_MODEL','resetTime','(空)','config.json\x20','rotateApiKey','\x22\x20未在\x20conversations\x20中找到','linkConversationId','parse','isArray','path','\x20缺少\x20model','\x20缺少\x20baseUrl','some','getConversationDir','ANTHROPIC_BASE_URL','message','settings-tpl.json\x20根元素不是对象','child_process','error','claudeSettings','isAuthenticationError','[WARN]\x20','exit','has','29178qWsiNA','add','工作目录可写:\x20','conversationId','settings-tpl.json','default','readApiKeyFromSettings','utf-8','getFullYear',']\x20保存\x20config.json\x20失败:','WARN','readFileSync','\x20项,有效\x20',']\x20从模板创建\x20settings-ding.json:\x20','object','owner'];a1_0x4889=function(){return _0x44ccd2;};return a1_0x4889();}Object[a1_0x252c47(0xfc)](exports,a1_0x252c47(0x10e),{'value':!![]}),exports[a1_0x252c47(0x133)]=saveClientConfig,exports['resetApiKeyCfg']=resetApiKeyCfg,exports[a1_0x252c47(0x143)]=scheduleApiKeyCfgDailyReset,exports['settingLabel']=settingLabel,exports[a1_0x252c47(0x152)]=rotateApiKey,exports[a1_0x252c47(0xef)]=pickValidApiKey,exports[a1_0x252c47(0x132)]=ensureSettingsWithApiKey,exports['isQuotaExhaustedError']=isQuotaExhaustedError,exports[a1_0x252c47(0x162)]=isAuthenticationError,exports[a1_0x252c47(0xe0)]=readApiKeyFromSettings,exports[a1_0x252c47(0x139)]=getForceEnabledSettingsPath,exports['startupCheck']=startupCheck;const fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a1_0x252c47(0x157))),child_process_1=require(a1_0x252c47(0x15f)),session_1=require(a1_0x252c47(0xec)),utils_ok_1=require(a1_0x252c47(0xf3));function saveClientConfig(_0x288090){const _0x255ffb=a1_0x252c47,_0x52b580=_0x288090[_0x255ffb(0xf0)]()+_0x255ffb(0x149);try{fs_1[_0x255ffb(0xdf)]['writeFileSync'](_0x52b580,JSON[_0x255ffb(0xf9)](_0x288090[_0x255ffb(0x108)],null,0x2),_0x255ffb(0xe1));}catch(_0x5d1ce0){console[_0x255ffb(0x160)]('['+(0x0,session_1[_0x255ffb(0x11b)])()+_0x255ffb(0xe3),_0x5d1ce0);}}function resetApiKeyCfg(_0x204f16){const _0x5c77a7=a1_0x252c47,_0x23db9c=_0x204f16['config'][_0x5c77a7(0x11a)];if(!_0x23db9c)return;const _0xb927e1=new Date();_0x23db9c[_0x5c77a7(0x14f)]=utils_ok_1[_0x5c77a7(0xfb)]['mm'](_0xb927e1[_0x5c77a7(0x12a)]())[_0x5c77a7(0x11f)](_0x5c77a7(0x117));let _0x5ad3e7=0x0;for(const _0x40d55e of _0x23db9c[_0x5c77a7(0x161)]){!_0x40d55e[_0x5c77a7(0x13d)]&&(_0x40d55e[_0x5c77a7(0x13d)]=!![],_0x5ad3e7++);}_0x5ad3e7>0x0&&console[_0x5c77a7(0x14b)]('['+(0x0,session_1[_0x5c77a7(0x11b)])()+']\x20'+_0x5ad3e7+'\x20个已失效\x20Claude\x20Setting\x20重新标记为有效'),saveClientConfig(_0x204f16),console[_0x5c77a7(0x14b)]('['+(0x0,session_1['timestamp'])()+_0x5c77a7(0x107));}function scheduleApiKeyCfgDailyReset(_0x22ebc6){const _0x1251d1=()=>{const _0x5e06d5=a1_0x5c8d,_0x31e41d=new Date(),_0x15a087=new Date(_0x31e41d[_0x5e06d5(0xe2)](),_0x31e41d['getMonth'](),_0x31e41d['getDate']()+0x1,0x0,0x0,0x0,0x0),_0x407d6f=_0x15a087[_0x5e06d5(0x12a)]()-_0x31e41d[_0x5e06d5(0x12a)]();setTimeout(()=>{const _0x5e07b1=_0x5e06d5;console[_0x5e07b1(0x14b)]('['+(0x0,session_1[_0x5e07b1(0x11b)])()+']\x20定时重置\x20apiKeyCfg\x20(每天0点)'),resetApiKeyCfg(_0x22ebc6),_0x1251d1();},_0x407d6f),console[_0x5e06d5(0x14b)]('['+(0x0,session_1[_0x5e06d5(0x11b)])()+_0x5e06d5(0x105)+_0x15a087['toISOString']());};_0x1251d1();}function settingLabel(_0x149e46){const _0x276eb2=a1_0x252c47;return _0x149e46['memo']?_0x149e46[_0x276eb2(0x127)]:_0x276eb2(0x123)+_0x149e46[_0x276eb2(0x130)]['slice'](-0x6);}function findSettingLabel(_0xa9f8ca,_0xd39c39){const _0x1d87f1=a1_0x252c47,_0x2a9188=_0xa9f8ca[_0x1d87f1(0x112)](_0x26b965=>_0x26b965[_0x1d87f1(0x130)]===_0xd39c39);return _0x2a9188?settingLabel(_0x2a9188):_0x1d87f1(0x123)+_0xd39c39['slice'](-0x6);}function rotateApiKey(_0x2c6753,_0x537bed){const _0x4b7994=a1_0x252c47,_0x261298=_0x2c6753[_0x4b7994(0x108)]['apiKeyCfg'];if(!_0x261298)return null;for(const _0x14ffee of _0x261298[_0x4b7994(0x161)]){if(_0x14ffee[_0x4b7994(0x130)]===_0x537bed&&_0x14ffee[_0x4b7994(0x13d)]){_0x14ffee[_0x4b7994(0x13d)]=![];break;}}const _0x5c25fa=_0x261298[_0x4b7994(0x161)][_0x4b7994(0x14d)](_0x54170d=>_0x54170d[_0x4b7994(0x13d)])[_0x4b7994(0xf1)],_0x5b1341=findSettingLabel(_0x261298[_0x4b7994(0x161)],_0x537bed);return console[_0x4b7994(0x14b)]('['+(0x0,session_1[_0x4b7994(0x11b)])()+_0x4b7994(0x118)+_0x5b1341+_0x4b7994(0xea)+_0x5c25fa),saveClientConfig(_0x2c6753),pickValidApiKey(_0x2c6753);}function pickValidApiKey(_0x1f6b16){const _0x17b4ac=a1_0x252c47,_0x4e680e=_0x1f6b16[_0x17b4ac(0x108)][_0x17b4ac(0x11a)];if(!_0x4e680e)return null;const _0x245559=_0x4e680e[_0x17b4ac(0x161)]['filter'](_0x2cbd82=>_0x2cbd82[_0x17b4ac(0x13d)]);if(_0x245559[_0x17b4ac(0xf1)]===0x0)return null;return _0x245559[Math[_0x17b4ac(0x11d)](Math[_0x17b4ac(0x111)]()*_0x245559[_0x17b4ac(0xf1)])];}function ensureSettingsWithApiKey(_0x4daebf,_0x1b9553){const _0x2d608b=a1_0x252c47,_0x2d7ba7=path_1[_0x2d608b(0xdf)][_0x2d608b(0x138)](_0x4daebf,'.claude'),_0x1b350a=path_1[_0x2d608b(0xdf)][_0x2d608b(0x138)](_0x2d7ba7,'settings-ding.json');let _0x61033c={};if(fs_1[_0x2d608b(0xdf)][_0x2d608b(0x10a)](_0x1b350a))try{_0x61033c=JSON['parse'](fs_1[_0x2d608b(0xdf)][_0x2d608b(0xe5)](_0x1b350a,_0x2d608b(0xe1)));}catch{_0x61033c={};}else{const _0x28bc86=path_1[_0x2d608b(0xdf)][_0x2d608b(0x138)]((0x0,session_1[_0x2d608b(0x12c)])(),_0x2d608b(0x145),_0x2d608b(0xde));if(fs_1[_0x2d608b(0xdf)][_0x2d608b(0x10a)](_0x28bc86))try{_0x61033c=JSON[_0x2d608b(0x155)](fs_1[_0x2d608b(0xdf)][_0x2d608b(0xe5)](_0x28bc86,_0x2d608b(0xe1))),console['log']('['+(0x0,session_1[_0x2d608b(0x11b)])()+_0x2d608b(0xe7)+_0x28bc86);}catch{_0x61033c={};}}!_0x61033c[_0x2d608b(0x14c)]&&(_0x61033c[_0x2d608b(0x14c)]={});let _0x3266de=![];_0x61033c[_0x2d608b(0x14c)][_0x2d608b(0x106)]!==_0x1b9553['apiKey']&&(_0x61033c[_0x2d608b(0x14c)][_0x2d608b(0x106)]=_0x1b9553[_0x2d608b(0x130)],_0x3266de=!![]);_0x1b9553['baseUrl']&&_0x61033c[_0x2d608b(0x14c)][_0x2d608b(0x15c)]!==_0x1b9553[_0x2d608b(0xeb)]&&(_0x61033c[_0x2d608b(0x14c)]['ANTHROPIC_BASE_URL']=_0x1b9553['baseUrl'],_0x3266de=!![]);_0x1b9553[_0x2d608b(0x116)]&&_0x61033c['env'][_0x2d608b(0x109)]!==_0x1b9553[_0x2d608b(0x116)]&&(_0x61033c[_0x2d608b(0x14c)][_0x2d608b(0x109)]=_0x1b9553[_0x2d608b(0x116)],_0x3266de=!![]);const _0x15a284=_0x1b9553[_0x2d608b(0x135)]||_0x1b9553['model'];return _0x15a284&&_0x61033c['env'][_0x2d608b(0x14e)]!==_0x15a284&&(_0x61033c[_0x2d608b(0x14c)][_0x2d608b(0x14e)]=_0x15a284,_0x3266de=!![]),_0x3266de&&(fs_1[_0x2d608b(0xdf)][_0x2d608b(0x119)](_0x2d7ba7,{'recursive':!![]}),fs_1[_0x2d608b(0xdf)][_0x2d608b(0xfd)](_0x1b350a,JSON[_0x2d608b(0xf9)](_0x61033c,null,0x2),_0x2d608b(0xe1)),console[_0x2d608b(0x14b)]('['+(0x0,session_1['timestamp'])()+_0x2d608b(0xfa)+_0x1b350a+'\x20('+settingLabel(_0x1b9553)+_0x2d608b(0x148)+_0x1b9553[_0x2d608b(0x116)]+',\x20smallModel:\x20'+_0x15a284+')')),_0x1b350a;}function isQuotaExhaustedError(_0x1c0bde){const _0xff5499=a1_0x252c47;if(/Request\s+rejected.*429/i[_0xff5499(0x126)](_0x1c0bde))return!![];if(/429.*Request\s+rejected/i[_0xff5499(0x126)](_0x1c0bde))return!![];if(/429.*(?:超过.*上限|使用上限|配额|quota|capacity)/i[_0xff5499(0x126)](_0x1c0bde))return!![];if(/(?:超过.*上限|使用上限|配额|quota|capacity).*429/i[_0xff5499(0x126)](_0x1c0bde))return!![];return![];}function isAuthenticationError(_0x2c78bc){const _0x47ecf5=a1_0x252c47;if(/authentication_error/i['test'](_0x2c78bc))return!![];if(/401.*(?:未授权|unauthorized|invalid\s*(?:key|token|api)|auth)/i[_0x47ecf5(0x126)](_0x2c78bc))return!![];if(/(?:未授权|unauthorized|invalid\s*(?:key|token|api)|auth).*401/i[_0x47ecf5(0x126)](_0x2c78bc))return!![];return![];}function readApiKeyFromSettings(_0x1ba3d5){const _0x329bf8=a1_0x252c47,_0x205022=path_1[_0x329bf8(0xdf)][_0x329bf8(0x138)](_0x1ba3d5,_0x329bf8(0x11c),_0x329bf8(0xed));if(!fs_1[_0x329bf8(0xdf)]['existsSync'](_0x205022))return null;try{const _0x368642=JSON[_0x329bf8(0x155)](fs_1['default'][_0x329bf8(0xe5)](_0x205022,_0x329bf8(0xe1)));return _0x368642['env']?.[_0x329bf8(0x106)]||null;}catch{return null;}}function getForceEnabledSettingsPath(_0x50994e){const _0x52f3fb=a1_0x252c47,_0x277111=path_1[_0x52f3fb(0xdf)][_0x52f3fb(0x138)](_0x50994e,'.claude',_0x52f3fb(0xed));if(!fs_1[_0x52f3fb(0xdf)][_0x52f3fb(0x10a)](_0x277111))return null;try{const _0xce30b2=JSON['parse'](fs_1[_0x52f3fb(0xdf)][_0x52f3fb(0xe5)](_0x277111,_0x52f3fb(0xe1))),_0x1fa2a0=_0xce30b2['env']?.[_0x52f3fb(0x11e)];if(_0x1fa2a0!==undefined&&_0x1fa2a0!==![]&&_0x1fa2a0!=='')return console['log']('['+(0x0,session_1['timestamp'])()+']\x20检测到\x20settings-ding.json\x20FORCE_ENABLE='+_0x1fa2a0+_0x52f3fb(0xee)),_0x277111;return null;}catch{return null;}}function startupCheck(_0x333327){const _0x1da345=a1_0x252c47,_0x43ad2b=[],_0x142121=_0x333327['config'],_0x389536=_0x333327[_0x1da345(0xf0)](),_0x406b4f=[{'key':'clientSecret','label':'clientSecret\x20(钉钉\x20Stream\x20Client\x20密钥)'},{'key':_0x1da345(0xf2),'label':'whiteUserList\x20(白名单用户)'},{'key':_0x1da345(0xe9),'label':_0x1da345(0xf8)}];for(const {key:_0x4339fd,label:_0x247130}of _0x406b4f){const _0x5d1686=_0x142121[_0x4339fd];_0x5d1686===undefined||_0x5d1686===null||_0x5d1686===''||Array[_0x1da345(0x156)](_0x5d1686)&&_0x5d1686[_0x1da345(0xf1)]===0x0?_0x43ad2b['push']({'level':_0x1da345(0x13a),'message':_0x1da345(0x110)+_0x247130}):_0x43ad2b['push']({'level':'PASS','message':_0x1da345(0x151)+_0x247130+'\x20✓'});}if(!Array[_0x1da345(0x156)](_0x142121[_0x1da345(0x113)]))_0x43ad2b[_0x1da345(0x114)]({'level':'FATAL','message':_0x1da345(0x144)});else{if(_0x142121[_0x1da345(0x113)][_0x1da345(0xf1)]===0x0)_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x137),'message':_0x1da345(0x104)});else{const _0x21f630=new Set();for(let _0x464fcb=0x0;_0x464fcb<_0x142121['conversations'][_0x1da345(0xf1)];_0x464fcb++){const _0x17e613=_0x142121[_0x1da345(0x113)][_0x464fcb],_0x192e79=_0x1da345(0x103)+_0x464fcb+']';if(!_0x17e613[_0x1da345(0xdd)])_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x13a),'message':_0x192e79+_0x1da345(0x120)});else _0x21f630[_0x1da345(0xd9)](_0x17e613[_0x1da345(0xdd)])?_0x43ad2b[_0x1da345(0x114)]({'level':'WARN','message':_0x192e79+'\x20conversationId\x20重复:\x20'+_0x17e613[_0x1da345(0xdd)]}):_0x21f630[_0x1da345(0xdb)](_0x17e613[_0x1da345(0xdd)]);_0x17e613[_0x1da345(0x154)]&&!_0x142121['conversations'][_0x1da345(0x15a)](_0x59008c=>_0x59008c[_0x1da345(0xdd)]===_0x17e613[_0x1da345(0x154)])&&_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0xe4),'message':_0x192e79+_0x1da345(0x10b)+_0x17e613['linkConversationId']+_0x1da345(0x153)});}_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x137),'message':'conversations\x20共\x20'+_0x142121[_0x1da345(0x113)][_0x1da345(0xf1)]+_0x1da345(0x13c)});}}if(_0x142121[_0x1da345(0x11a)]){const _0x1fbd44=_0x142121[_0x1da345(0x11a)];_0x1fbd44[_0x1da345(0x14f)]&&_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x137),'message':_0x1da345(0xfe)+_0x1fbd44['resetTime']});if(!Array['isArray'](_0x1fbd44[_0x1da345(0x161)]))_0x43ad2b['push']({'level':_0x1da345(0xe4),'message':'apiKeyCfg.claudeSettings\x20不是数组,API\x20Key\x20轮换功能不可用'});else{if(_0x1fbd44[_0x1da345(0x161)][_0x1da345(0xf1)]===0x0)_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0xe4),'message':_0x1da345(0x136)});else{const _0x2968e7=new Set();for(let _0x16d6bb=0x0;_0x16d6bb<_0x1fbd44['claudeSettings'][_0x1da345(0xf1)];_0x16d6bb++){const _0x24a4be=_0x1fbd44['claudeSettings'][_0x16d6bb],_0x333ac0=_0x1da345(0x129)+_0x16d6bb+']';if(!_0x24a4be[_0x1da345(0x130)])_0x43ad2b['push']({'level':_0x1da345(0x13a),'message':_0x333ac0+_0x1da345(0x13b)});else _0x2968e7[_0x1da345(0xd9)](_0x24a4be[_0x1da345(0x130)])?_0x43ad2b['push']({'level':_0x1da345(0xe4),'message':_0x333ac0+_0x1da345(0x146)+settingLabel(_0x24a4be)}):_0x2968e7[_0x1da345(0xdb)](_0x24a4be['apiKey']);!_0x24a4be[_0x1da345(0xeb)]&&_0x43ad2b[_0x1da345(0x114)]({'level':'WARN','message':_0x333ac0+_0x1da345(0x159)}),!_0x24a4be[_0x1da345(0x116)]&&_0x43ad2b['push']({'level':_0x1da345(0xe4),'message':_0x333ac0+_0x1da345(0x158)}),typeof _0x24a4be['isValid']!==_0x1da345(0xf6)&&_0x43ad2b[_0x1da345(0x114)]({'level':'WARN','message':_0x333ac0+_0x1da345(0x128)+typeof _0x24a4be[_0x1da345(0x13d)]});}const _0x1f0baa=_0x1fbd44[_0x1da345(0x161)]['filter'](_0x5d6da2=>_0x5d6da2['isValid'])[_0x1da345(0xf1)];_0x43ad2b['push']({'level':'PASS','message':_0x1da345(0x14a)+_0x1fbd44[_0x1da345(0x161)][_0x1da345(0xf1)]+_0x1da345(0xe6)+_0x1f0baa});}}}const _0x5826a0=path_1[_0x1da345(0xdf)][_0x1da345(0x138)]((0x0,session_1['getHomeDir'])(),'.cc-ding',_0x1da345(0xde));if(fs_1['default'][_0x1da345(0x10a)](_0x5826a0))try{const _0x507d60=JSON[_0x1da345(0x155)](fs_1[_0x1da345(0xdf)][_0x1da345(0xe5)](_0x5826a0,_0x1da345(0xe1)));if(typeof _0x507d60!==_0x1da345(0xe8)||_0x507d60===null)_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0xe4),'message':_0x1da345(0x15e)});else{if(!_0x507d60[_0x1da345(0x14c)]||typeof _0x507d60['env']!==_0x1da345(0xe8))_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0xe4),'message':'settings-tpl.json\x20缺少\x20env\x20字段,创建\x20settings-ding.json\x20时将不包含预配置环境变量'});else{const _0x13a300=Object[_0x1da345(0xf5)](_0x507d60[_0x1da345(0x14c)]);_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x137),'message':'settings-tpl.json\x20有效,env\x20包含:\x20'+(_0x13a300[_0x1da345(0x138)](',\x20')||_0x1da345(0x150))});}}}catch(_0x579cb7){_0x43ad2b[_0x1da345(0x114)]({'level':'WARN','message':_0x1da345(0x141)+(_0x579cb7 instanceof Error?_0x579cb7[_0x1da345(0x15d)]:_0x579cb7)});}else _0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0xe4),'message':_0x1da345(0x125)+_0x5826a0+',创建\x20settings-ding.json\x20时将使用空模板'});try{(0x0,child_process_1[_0x1da345(0xff)])('which\x20claude',{'stdio':_0x1da345(0x10d)}),_0x43ad2b[_0x1da345(0x114)]({'level':'PASS','message':_0x1da345(0x10c)});}catch{_0x43ad2b['push']({'level':_0x1da345(0x13a),'message':'claude\x20命令不可用,请确认\x20Claude\x20Code\x20CLI\x20已安装'});}try{const _0x15adb7=path_1[_0x1da345(0xdf)][_0x1da345(0x138)](_0x389536,_0x1da345(0x147));fs_1[_0x1da345(0xdf)]['writeFileSync'](_0x15adb7,'ok',_0x1da345(0xe1)),fs_1['default'][_0x1da345(0x12e)](_0x15adb7),_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x137),'message':_0x1da345(0xdc)+_0x389536});}catch(_0x3ee05e){_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x13a),'message':_0x1da345(0x12d)+_0x389536+'\x20—\x20'+(_0x3ee05e instanceof Error?_0x3ee05e[_0x1da345(0x15d)]:_0x3ee05e)});}if(Array[_0x1da345(0x156)](_0x142121[_0x1da345(0x113)]))for(const _0x574117 of _0x142121[_0x1da345(0x113)]){const _0x34b70d=_0x333327[_0x1da345(0x15b)](_0x574117[_0x1da345(0xdd)]);try{fs_1[_0x1da345(0xdf)]['mkdirSync'](_0x34b70d,{'recursive':!![]}),_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0x137),'message':'群工作目录已就绪:\x20'+(_0x574117[_0x1da345(0x122)]||_0x574117[_0x1da345(0xdd)])});}catch(_0x43ba5c){_0x43ad2b[_0x1da345(0x114)]({'level':_0x1da345(0xe4),'message':'群工作目录创建失败:\x20'+_0x34b70d+_0x1da345(0x140)+(_0x43ba5c instanceof Error?_0x43ba5c['message']:_0x43ba5c)});}}console['log']('\x0a['+(0x0,session_1['timestamp'])()+_0x1da345(0xf4));const _0x36ef27=_0x43ad2b[_0x1da345(0x15a)](_0x200672=>_0x200672[_0x1da345(0x100)]===_0x1da345(0x13a));for(const _0x1e6cd3 of _0x43ad2b){const _0x4a98a0=_0x1e6cd3[_0x1da345(0x100)]===_0x1da345(0x137)?'✓':_0x1e6cd3[_0x1da345(0x100)]===_0x1da345(0x13a)?'✗':'⚠',_0x293c64=_0x1e6cd3[_0x1da345(0x100)]===_0x1da345(0x137)?_0x1e6cd3[_0x1da345(0x15d)]:_0x1e6cd3['level']===_0x1da345(0x13a)?'[FATAL]\x20'+_0x1e6cd3[_0x1da345(0x15d)]:_0x1da345(0xd7)+_0x1e6cd3[_0x1da345(0x15d)];console[_0x1da345(0x14b)]('\x20\x20'+_0x4a98a0+'\x20'+_0x293c64);}const _0x51d59b=_0x43ad2b[_0x1da345(0x14d)](_0x2b71c0=>_0x2b71c0[_0x1da345(0x100)]==='PASS')[_0x1da345(0xf1)],_0xdd3330=_0x43ad2b['filter'](_0x57fff2=>_0x57fff2[_0x1da345(0x100)]==='WARN')[_0x1da345(0xf1)],_0x483243=_0x43ad2b[_0x1da345(0x14d)](_0x1a1d69=>_0x1a1d69[_0x1da345(0x100)]==='FATAL')['length'];console[_0x1da345(0x14b)]('['+(0x0,session_1[_0x1da345(0x11b)])()+_0x1da345(0x142)+_0x51d59b+_0x1da345(0xf7)+_0xdd3330+_0x1da345(0x10f)+_0x483243+'\x20致命'),console['log']('['+(0x0,session_1[_0x1da345(0x11b)])()+_0x1da345(0x12f)),_0x36ef27&&(console[_0x1da345(0x160)]('['+(0x0,session_1['timestamp'])()+_0x1da345(0x121)),process[_0x1da345(0xd8)](0x1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a2_0x329fca=a2_0x10b9;(function(_0x5542c0,_0x171672){const _0x362225=a2_0x10b9,_0x17d9f5=_0x5542c0();while(!![]){try{const _0x259393=-parseInt(_0x362225(0xfe))/0x1*(-parseInt(_0x362225(0x22c))/0x2)+-parseInt(_0x362225(0xf9))/0x3+parseInt(_0x362225(0x1e1))/0x4+parseInt(_0x362225(0x189))/0x5*(-parseInt(_0x362225(0x1d6))/0x6)+-parseInt(_0x362225(0x147))/0x7*(parseInt(_0x362225(0x10f))/0x8)+-parseInt(_0x362225(0x1f8))/0x9+parseInt(_0x362225(0xfb))/0xa;if(_0x259393===_0x171672)break;else _0x17d9f5['push'](_0x17d9f5['shift']());}catch(_0x4778bd){_0x17d9f5['push'](_0x17d9f5['shift']());}}}(a2_0x1145,0x26125));function a2_0x1145(){const _0x3848d3=['parseCfgCommand','getDirectoryStructure','assistant','getClientConfig','\x20行日志:\x0a```\x0a','抱歉,该群的机器人未在服务端注册,请联系应用机器人owner注册(','__esModule','⚠️\x20目录已存在:\x20`','whiteUserList','resolve','linkConversationId','cleanCache','parseOpenCommand','interruptClaudeProcess','抱歉,您暂无使用权限,请联系应用机器人owner授权...','-\x20**linkConversationId:**\x20','resolveAllPhonesInConfig','del','恢复定时任务\x20','exec','parseContinueSessionCommand','19792WZReBZ','❌\x20文件创建失败:\x20`','getOwnPropertyNames','type','🚀\x20请输入您的问题开始新会话','parseResetApiKeyCfgCommand',']\x20注册新群:\x20','未找到定时任务:\x20','cancel','robotCode','formatHelpOverview','⚠️\x20文件已存在:\x20`','picture','../','input','loadActiveSessions','-\x20**群ID:**\x20','isOwner','sanitizeOutput','job','YYYY-MM-DD\x20HH:mm:ss','isValidCronExpression','robot','**版本:**\x20','(无历史数据)','列出\x20','findSubdirByName','catch','messageId','./task','DEFAULT_TASK_HANDLER_COUNT','\x20到当前群白名单\x0a当前白名单:\x20','CronEngine','claudeSettings','🧹\x20缓存清理完成',']\x20创建工作目录:\x20','finishTask','parseVersionCommand','⚠️\x20无法解析手机号:\x20','(无输出)','dingStreamClient','parse','parseMqCommand','cronEngine','getSessionsDir','findActiveSession','activeSessions','###\x20💬\x20当前会话信息\x0a','\x0a\x0a💡\x20你也可以直接指定cron表达式:\x20`/cron\x200\x209\x20*\x20*\x20*\x20任务描述`','then','utf-8',']\x20任务处理器数量:\x20','YYYY-MM-DD-HH-mm-ss','useLocalOcr','90072zUWnnX','isMobile','373780IqRHTY','min','handleMkdirCommand','23VBjaHJ','formatConversationInfo','getClientDir','errors','data','**\x20已暂停','getOrCreateLogSession','path','../common','-\x20图片文件:\x20','层):\x0a```\x0a','sessionsDeleted','isArray','📭\x20当前无排队消息','✅\x20已移除\x20','trim','📋\x20任务已收到,完成后我会回复','138936RGNYds','getOneTodoTask','❌\x20路径已存在但不是文件:\x20`',',\x20会话ID=','atSender','dateUtil','error','connect','folder','description','###\x20🤖\x20群配置信息\x0a','./messaging','📂\x20工作目录:\x20`','-\x20**群名称:**\x20','formatGlobalConfig','parsePwdCommand','DingClaude','cmd.exe','❌\x20未找到命令:\x20**','###\x20💬\x20当前会话信息\x0a无活跃会话','some','/cron\x20list','startsWith','clientSecret','senderNick','❌\x20只有机器人\x20owner\x20才能执行此操作','parseBashCommand','conversationTitle','getSessionId','runTaskHandlerLoop','substring','log','⚠️\x20该群未注册,请先使用\x20`/cfg`\x20命令注册','❌\x20删除失败:\x20`','exit','parseHelpCommand','headers','quoteText','processRichTextMessage','prototype','count','open\x20\x22','staffId','resetTime','get','sendDingMessage','(空,使用全局白名单)','mkdirSync','\x0a⚠️\x20错误:\x20','content','list','✅\x20群已注册','scheduleApiKeyCfgDailyReset','pictureDownloadCode','writeFileSync','unlinkSync','21QlstRB','收到消息:\x20群=','Fatal\x20error','toggleJob','\x0a...(输出已截断)','/cron\x20delete\x20','###\x20📝\x20任务队列信息\x0a','resume','✅\x20文件创建成功:\x20`','📂\x20已在文件管理器中打开:\x0a```\x0a','findHistorySession','conversationId','formatCronJobInfo','resolveAndValidatePath','dingToken','switchToSession','📋\x20最近\x20','slice','isDirectory','userIdToPhone','endSession','dirname','❌\x20定时任务分析失败:\x20','当前工作目录','cronExpression','run','**\x20已删除','startupCheck','clientId','hasOwnProperty','\x0a\x0a**stderr:**\x0a```\x0a','findIndex','existsSync','\x20条消息','session','replace','收到新会话命令,结束旧会话:\x20群=','parseCommandHelp','###\x20🌐\x20全局核心配置\x0a','✅\x20已从队尾移除\x20','appendSessionLog','sanitizeLogContent','parseClaudeStreamLine','getPkgVersion','registerCallbackListener','❌\x20路径不存在:\x20`','resetApiKeyCfg','__importStar','markdown','defineProperty','sessionDir','mtime',',\x20内容=','removeJob','/cron\x20','\x20已在当前群白名单中','tasksDeleted','(未配置群级白名单,使用全局白名单)','`\x0a原因:\x20','/cron\x20pause\x20','join','parseInfoCommand','./api-key-manager','未注册的机器人,群:','projUtil','timestamp','10gNmwwk','**\x20的目录','call','defaultDingToken','...','formatCronJobList','⚠️\x20当前无活跃会话或暂无日志','create_nl','DEFAULT_SESSION_MAX_CONCURRENCY','\x0a```','delete','✅\x20群配置已刷新','),\x20类型=','❌\x20当前群未配置\x20dingToken\x20且无客户端级\x20defaultDingToken,\x20定时任务无法主动发送消息,\x20请联系管理员配置','open\x20-a\x20Terminal\x20\x22','/session.log',':**\x20','message','debugLog','sendClaudeResponseToDing','conversations','getSessionDir','❌\x20路径超出工作目录范围','创建定时任务:\x20','getConversationConfig','⏳\x20正在分析定时任务描述...','requireOwner',']\x20[SYSTEM]:\x20创建会话用于记录\x20/cron\x20命令操作\x0a','quoteMessageId','[cron]','format',']\x20刷新群配置:\x20','handleTask','formatSessionInfo','./session','./image','richText','imagesDeleted','map','senderStaffId','length','test','startNewSession','saveActiveSession','pause','create','\x20个定时任务','root','handleRmCommand','getTasksDir','authCheck','updateSessionFile','-\x20**receiveReply:**\x20false\x20(不回复确认消息)','apiKeyCfg','darwin','parseCleanCommand','key','push','-\x20会话目录:\x20','⚠️\x20未配置\x20apiKeyCfg,无需重置','.\x20**','user','statSync','preBash','/task\x20','configurable','handleSessionMessage','default','📂\x20当前工作目录:\x0a```\x0a','text','/v1.0/im/bot/messages/get','socketCallBackResponse','删除定时任务\x20','-\x20**atSender:**\x20false\x20(不\x20@\x20发送人)','),\x20发送者=','create_cron','▶️\x20定时任务\x20**','204030qXnQJa',':\x20`','\x20&&\x20','formatTaskInfo','getCommandByName','sendCronNoNotifyError','receiveReply','-\x20**dingToken:**\x20','❌\x20未找到定时任务:\x20','formatCommandHelp','config','1083060RhKhxh','✅\x20已清空消息队列,共移除\x20','resolveToUserId','add','/cron\x20resume\x20','rmSync','processPictureMessage','/session.json','formatPromptWithQuote','handleCronCommand','botMsgGetCallback','resolveUserId','检测到引用消息:\x20quoteMessageId=','now','saveClientConfig','filter','prompt','appendFileSync','conversationConfig','⚠️\x20','\x0a💡\x20活跃会话已保留','parseLsCommand','Error:\x20DingStreamClient\x20init\x20failed.','2067075rZLDEM','truncateMsg','start','⚠️\x20未找到已结束的会话','findLatestSession','writable','hashConversationId','saveTask','`\x0a\x0a💡\x20格式:\x20`分\x20时\x20日\x20月\x20周`,如\x20`0\x209\x20*\x20*\x20*`','\x20(展开','\x20错误:','❌\x20路径已存在但不是目录:\x20`','all','getConversationDir','hasNotifyCapability','\x20不在当前群白名单中','❌\x20无效的cron表达式:\x20`','parseCronCommand','❌\x20打开失败:\x20','⏸️\x20定时任务\x20**','任务处理器\x20#','handleTouchCommand','❌\x20路径不能使用绝对路径(不能以\x20/\x20开头)','task','messageQueue','\x20条)\x0a','readSessionLogTail','parseAuthCommand','cancelTask','debug','./commands'];a2_0x1145=function(){return _0x3848d3;};return a2_0x1145();}var __createBinding=this&&this['__createBinding']||(Object[a2_0x329fca(0x1b6)]?function(_0x2f07c2,_0x142867,_0x2fbbaa,_0x2ac65d){const _0x10a097=a2_0x329fca;if(_0x2ac65d===undefined)_0x2ac65d=_0x2fbbaa;var _0x1d16cf=Object['getOwnPropertyDescriptor'](_0x142867,_0x2fbbaa);(!_0x1d16cf||(_0x10a097(0x13b)in _0x1d16cf?!_0x142867[_0x10a097(0x21d)]:_0x1d16cf[_0x10a097(0x1fd)]||_0x1d16cf[_0x10a097(0x1ca)]))&&(_0x1d16cf={'enumerable':!![],'get':function(){return _0x142867[_0x2fbbaa];}}),Object['defineProperty'](_0x2f07c2,_0x2ac65d,_0x1d16cf);}:function(_0x43d527,_0x39c9b5,_0x6d7f0b,_0x141a4){if(_0x141a4===undefined)_0x141a4=_0x6d7f0b;_0x43d527[_0x141a4]=_0x39c9b5[_0x6d7f0b];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x30dcb4,_0xbb47bc){const _0x4f2e4b=a2_0x329fca;Object[_0x4f2e4b(0x178)](_0x30dcb4,_0x4f2e4b(0x1cc),{'enumerable':!![],'value':_0xbb47bc});}:function(_0x1a93ed,_0x2f837b){const _0x872ea9=a2_0x329fca;_0x1a93ed[_0x872ea9(0x1cc)]=_0x2f837b;}),__importStar=this&&this[a2_0x329fca(0x176)]||(function(){var _0xf9724c=function(_0x255b24){const _0x4e249f=a2_0x10b9;return _0xf9724c=Object[_0x4e249f(0xc5)]||function(_0x417bd0){const _0x32a63e=_0x4e249f;var _0x4e2693=[];for(var _0x58bdc0 in _0x417bd0)if(Object[_0x32a63e(0x136)][_0x32a63e(0x164)][_0x32a63e(0x18b)](_0x417bd0,_0x58bdc0))_0x4e2693[_0x4e2693['length']]=_0x58bdc0;return _0x4e2693;},_0xf9724c(_0x255b24);};return function(_0x9ddee8){const _0x1ebeff=a2_0x10b9;if(_0x9ddee8&&_0x9ddee8['__esModule'])return _0x9ddee8;var _0x4e9a90={};if(_0x9ddee8!=null){for(var _0x3565bd=_0xf9724c(_0x9ddee8),_0xe959ca=0x0;_0xe959ca<_0x3565bd[_0x1ebeff(0x1b1)];_0xe959ca++)if(_0x3565bd[_0xe959ca]!==_0x1ebeff(0x1cc))__createBinding(_0x4e9a90,_0x9ddee8,_0x3565bd[_0xe959ca]);}return __setModuleDefault(_0x4e9a90,_0x9ddee8),_0x4e9a90;};}()),__importDefault=this&&this['__importDefault']||function(_0x557c16){return _0x557c16&&_0x557c16['__esModule']?_0x557c16:{'default':_0x557c16};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a2_0x329fca(0x11f)]=void 0x0;const child_process_1=require('child_process'),utils_ok_1=require('utils-ok'),fs_1=__importDefault(require('fs')),path_1=__importDefault(require(a2_0x329fca(0x105))),common_1=require(a2_0x329fca(0x106)),quote_1=require('./quote'),messaging_1=require(a2_0x329fca(0x11a)),image_1=require(a2_0x329fca(0x1ac)),commands_1=require(a2_0x329fca(0x216)),messaging_2=require(a2_0x329fca(0x11a)),claude_process_1=require('./claude-process'),session_1=require(a2_0x329fca(0x1ab)),task_1=require(a2_0x329fca(0xe0)),api_key_manager_1=require(a2_0x329fca(0x185)),cron_1=require('./cron'),TOOL_VERSION=(0x0,common_1[a2_0x329fca(0x187)])()[a2_0x329fca(0x172)]();function a2_0x10b9(_0x4049b3,_0x205724){_0x4049b3=_0x4049b3-0xc4;const _0x1145cb=a2_0x1145();let _0x10b954=_0x1145cb[_0x4049b3];return _0x10b954;}class DingClaude{constructor(_0x2f5d6d){const _0xd8edc3=a2_0x329fca;this['resolvedPhones']={},this['activeSessions']=new Map(),this[_0xd8edc3(0x191)]=0x5,this[_0xd8edc3(0xe1)]=0x1,this['DEFAULT_TASK_QUEUE_SIZE']=0x32,this[_0xd8edc3(0x13c)]=_0x1b0b06=>(0x0,messaging_2['sendDingMessage'])(this,_0x1b0b06),this[_0xd8edc3(0x19c)]=(_0x5197fb,_0x491163,_0x58edb9,_0x5a73e3)=>(0x0,messaging_2[_0xd8edc3(0x19c)])(this,_0x5197fb,_0x491163,_0x58edb9,_0x5a73e3),this[_0xd8edc3(0x171)]=claude_process_1[_0xd8edc3(0x171)],this[_0xd8edc3(0x224)]=(_0x47638c,_0x79ad43)=>(0x0,claude_process_1['interruptClaudeProcess'])(_0x47638c,_0x79ad43),this['executeClaudeQuery']=(_0x405116,_0x50fd35,_0x185226)=>(0x0,claude_process_1['executeClaudeQuery'])(this,_0x405116,_0x50fd35,_0x185226),this['getClientDir']=()=>(0x0,session_1[_0xd8edc3(0x100)])(this),this['getClientConfig']=()=>(0x0,session_1['getClientConfig'])(this),this['authCheck']=(_0x483b04,_0x44e30a)=>(0x0,session_1[_0xd8edc3(0x1bb)])(this,_0x483b04,_0x44e30a),this[_0xd8edc3(0xd4)]=_0x188620=>(0x0,session_1['isOwner'])(this,_0x188620),this[_0xd8edc3(0x19b)]=(_0x99234d,..._0x27d6e5)=>(0x0,session_1['debugLog'])(this,_0x99234d,..._0x27d6e5),this[_0xd8edc3(0x1fe)]=_0x32c440=>(0x0,session_1[_0xd8edc3(0x1fe)])(this,_0x32c440),this[_0xd8edc3(0x1a1)]=_0x1f1f4e=>(0x0,session_1[_0xd8edc3(0x1a1)])(this,_0x1f1f4e),this['getConversationDir']=_0x489e31=>(0x0,session_1[_0xd8edc3(0x205)])(this,_0x489e31),this['getSessionsDir']=_0x5981f4=>(0x0,session_1[_0xd8edc3(0xef)])(this,_0x5981f4),this[_0xd8edc3(0x1ba)]=_0x358cc5=>(0x0,session_1[_0xd8edc3(0x1ba)])(this,_0x358cc5),this[_0xd8edc3(0x19e)]=_0x42a90d=>(0x0,session_1[_0xd8edc3(0x19e)])(this,_0x42a90d),this['getSessionId']=session_1['getSessionId'],this[_0xd8edc3(0x1aa)]=_0x4036b6=>(0x0,session_1[_0xd8edc3(0x1aa)])(this,_0x4036b6),this[_0xd8edc3(0x212)]=(_0x14d796,_0x2920c9)=>(0x0,session_1[_0xd8edc3(0x212)])(this,_0x14d796,_0x2920c9),this[_0xd8edc3(0xf0)]=_0x2843af=>(0x0,session_1[_0xd8edc3(0xf0)])(this,_0x2843af),this[_0xd8edc3(0x151)]=(_0x1d429c,_0x56de56)=>(0x0,session_1[_0xd8edc3(0x151)])(this,_0x1d429c,_0x56de56),this[_0xd8edc3(0x1fc)]=_0x40cdae=>(0x0,session_1['findLatestSession'])(this,_0x40cdae),this[_0xd8edc3(0x1bc)]=(_0x3b0d71,_0x391b73)=>(0x0,session_1[_0xd8edc3(0x1bc)])(this,_0x3b0d71,_0x391b73),this[_0xd8edc3(0x16f)]=session_1[_0xd8edc3(0x16f)],this['getActiveSessionsFile']=_0x874941=>(0x0,session_1['getActiveSessionsFile'])(this,_0x874941),this[_0xd8edc3(0x1b4)]=_0x511f72=>(0x0,session_1['saveActiveSession'])(this,_0x511f72),this[_0xd8edc3(0xd2)]=()=>(0x0,session_1[_0xd8edc3(0xd2)])(this),this[_0xd8edc3(0x15b)]=(_0x34a2c1,_0x5c8a26)=>(0x0,session_1[_0xd8edc3(0x15b)])(this,_0x34a2c1,_0x5c8a26),this[_0xd8edc3(0x156)]=(_0x27befe,_0x2b6343,_0x7101b0,_0x3e9e44,_0x3742c)=>(0x0,session_1['switchToSession'])(this,_0x27befe,_0x2b6343,_0x7101b0,_0x3e9e44,_0x3742c),this[_0xd8edc3(0x1b3)]=_0x24046a=>(0x0,session_1['startNewSession'])(this,_0x24046a),this[_0xd8edc3(0x1cb)]=_0x4e3f06=>(0x0,session_1['handleSessionMessage'])(this,_0x4e3f06),this[_0xd8edc3(0x222)]=(_0x186035,_0x39fb62=!![])=>(0x0,session_1[_0xd8edc3(0x222)])(this,_0x186035,_0x39fb62),this['formatTaskInfo']=()=>(0x0,task_1[_0xd8edc3(0x1d9)])(this),this[_0xd8edc3(0x214)]=(_0x3ef2a9,_0x2cffc7)=>(0x0,task_1[_0xd8edc3(0x214)])(this,_0x3ef2a9,_0x2cffc7),this['countTodoTask']=()=>(0x0,task_1['countTodoTask'])(this),this[_0xd8edc3(0x110)]=()=>(0x0,task_1[_0xd8edc3(0x110)])(this),this[_0xd8edc3(0xe7)]=_0x546d15=>(0x0,task_1[_0xd8edc3(0xe7)])(this,_0x546d15),this[_0xd8edc3(0x1a9)]=()=>(0x0,task_1[_0xd8edc3(0x1a9)])(this),this['runTaskHandlerLoop']=()=>(0x0,task_1[_0xd8edc3(0x12c)])(this),this['saveTask']=_0x36f7be=>(0x0,task_1[_0xd8edc3(0x1ff)])(this,_0x36f7be),this[_0xd8edc3(0x163)]=_0x2f5d6d,this[_0xd8edc3(0x1e0)]=(0x0,session_1[_0xd8edc3(0x21a)])(this);try{this['dingStreamClient']=new utils_ok_1['DingStreamClient']({'clientId':_0x2f5d6d,'clientSecret':this[_0xd8edc3(0x1e0)][_0xd8edc3(0x126)],'keepAlive':!![],'debug':this['config'][_0xd8edc3(0x215)]??![]});}catch(_0x59b8a3){console[_0xd8edc3(0x115)](_0xd8edc3(0x1f7),_0x59b8a3),process[_0xd8edc3(0x131)](0x1);}this[_0xd8edc3(0xee)]=new cron_1[(_0xd8edc3(0xe3))](this);}async[a2_0x329fca(0x1a3)](_0x1cf830,_0x22ab33,_0x497684){const _0x3cf13b=a2_0x329fca;if(!this[_0x3cf13b(0xd4)](_0x497684))return await this['sendDingMessage']({'conversationId':_0x1cf830,'sessionWebhook':_0x22ab33,'content':_0x3cf13b(0x128),'msgType':_0x3cf13b(0x177)}),![];return!![];}async[a2_0x329fca(0x1ea)](_0x378f6b,_0x118549){const _0x1a8e6f=a2_0x329fca,{conversationId:_0x481411,sessionWebhook:_0x202309,senderStaffId:_0x488df6,senderNick:_0x419907,conversationConfig:_0x11abf7}=_0x118549;switch(_0x378f6b['type']){case _0x1a8e6f(0x141):{const _0x300963=await this['getOrCreateLogSession'](_0x481411,_0x202309,_0x488df6,_0x419907,_0x11abf7,!![]),_0x28cdde=this['cronEngine']['listJobs'](_0x481411);_0x300963[_0x1a8e6f(0x179)]&&(this['appendSessionLog'](_0x300963[_0x1a8e6f(0x179)],_0x1a8e6f(0x1c6),_0x1a8e6f(0x124)),this[_0x1a8e6f(0x16f)](_0x300963[_0x1a8e6f(0x179)],_0x1a8e6f(0x219),_0x1a8e6f(0xdc)+_0x28cdde[_0x1a8e6f(0x1b1)]+_0x1a8e6f(0x1b7)));await this['sendDingMessage']({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':(0x0,cron_1[_0x1a8e6f(0x18e)])(_0x28cdde),'msgType':_0x1a8e6f(0x177)});return;}case _0x1a8e6f(0x193):{const _0x5b39cb=this[_0x1a8e6f(0xee)][_0x1a8e6f(0x17c)](_0x378f6b['id']),_0x485c9f=await this[_0x1a8e6f(0x104)](_0x481411,_0x202309,_0x488df6,_0x419907,_0x11abf7);_0x485c9f[_0x1a8e6f(0x179)]&&(this['appendSessionLog'](_0x485c9f[_0x1a8e6f(0x179)],_0x1a8e6f(0x1c6),_0x1a8e6f(0x14c)+_0x378f6b['id']),this[_0x1a8e6f(0x16f)](_0x485c9f['sessionDir'],_0x1a8e6f(0x219),_0x5b39cb?_0x1a8e6f(0x1d1)+_0x378f6b['id']:'未找到定时任务:\x20'+_0x378f6b['id']));await this[_0x1a8e6f(0x13c)]({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':_0x5b39cb?'✅\x20定时任务\x20**'+_0x378f6b['id']+_0x1a8e6f(0x161):_0x1a8e6f(0x1de)+_0x378f6b['id'],'msgType':'markdown'});return;}case _0x1a8e6f(0x1b5):{const _0xc5a814=this['cronEngine'][_0x1a8e6f(0x14a)](_0x378f6b['id'],![]),_0x14e1e9=await this[_0x1a8e6f(0x104)](_0x481411,_0x202309,_0x488df6,_0x419907,_0x11abf7);_0x14e1e9[_0x1a8e6f(0x179)]&&(this[_0x1a8e6f(0x16f)](_0x14e1e9[_0x1a8e6f(0x179)],_0x1a8e6f(0x1c6),_0x1a8e6f(0x182)+_0x378f6b['id']),this[_0x1a8e6f(0x16f)](_0x14e1e9[_0x1a8e6f(0x179)],'assistant',_0xc5a814?'暂停定时任务\x20'+_0x378f6b['id']:_0x1a8e6f(0xca)+_0x378f6b['id']));await this['sendDingMessage']({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':_0xc5a814?_0x1a8e6f(0x20b)+_0x378f6b['id']+_0x1a8e6f(0x103):_0x1a8e6f(0x1de)+_0x378f6b['id'],'msgType':'markdown'});return;}case _0x1a8e6f(0x14e):{const _0x2cc1bf=this[_0x1a8e6f(0xee)][_0x1a8e6f(0x14a)](_0x378f6b['id'],!![]),_0x267d5e=await this[_0x1a8e6f(0x104)](_0x481411,_0x202309,_0x488df6,_0x419907,_0x11abf7);_0x267d5e[_0x1a8e6f(0x179)]&&(this['appendSessionLog'](_0x267d5e[_0x1a8e6f(0x179)],_0x1a8e6f(0x1c6),_0x1a8e6f(0x1e5)+_0x378f6b['id']),this[_0x1a8e6f(0x16f)](_0x267d5e[_0x1a8e6f(0x179)],_0x1a8e6f(0x219),_0x2cc1bf?_0x1a8e6f(0x229)+_0x378f6b['id']:_0x1a8e6f(0xca)+_0x378f6b['id']));await this['sendDingMessage']({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':_0x2cc1bf?_0x1a8e6f(0x1d5)+_0x378f6b['id']+'**\x20已恢复':_0x1a8e6f(0x1de)+_0x378f6b['id'],'msgType':_0x1a8e6f(0x177)});return;}case _0x1a8e6f(0x1d4):{if(!(0x0,cron_1[_0x1a8e6f(0xd8)])(_0x378f6b[_0x1a8e6f(0x15f)])){await this['sendDingMessage']({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':_0x1a8e6f(0x208)+_0x378f6b[_0x1a8e6f(0x15f)]+_0x1a8e6f(0x200),'msgType':_0x1a8e6f(0x177)});return;}if(!this[_0x1a8e6f(0x206)](_0x118549[_0x1a8e6f(0x1f3)])){await this['sendCronNoNotifyError'](_0x481411,_0x202309);return;}const _0x22dc6d=this[_0x1a8e6f(0xee)]['addJob']({'conversationId':_0x481411,'cronExpression':_0x378f6b[_0x1a8e6f(0x15f)],'description':this[_0x1a8e6f(0x170)](_0x378f6b[_0x1a8e6f(0x1f1)][_0x1a8e6f(0x12d)](0x0,0x32)),'prompt':_0x378f6b[_0x1a8e6f(0x1f1)],'senderStaffId':_0x488df6,'senderNick':_0x419907}),_0x38258e=await this[_0x1a8e6f(0x104)](_0x481411,_0x202309,_0x488df6,_0x419907,_0x11abf7);_0x38258e['sessionDir']&&(this['appendSessionLog'](_0x38258e[_0x1a8e6f(0x179)],'user','/cron\x20'+_0x378f6b['cronExpression']+'\x20'+this[_0x1a8e6f(0x170)](_0x378f6b[_0x1a8e6f(0x1f1)])),this['appendSessionLog'](_0x38258e[_0x1a8e6f(0x179)],_0x1a8e6f(0x219),_0x1a8e6f(0x1a0)+_0x22dc6d['id']+'\x20['+_0x22dc6d[_0x1a8e6f(0x15f)]+']\x20'+_0x22dc6d['description']));await this[_0x1a8e6f(0x13c)]({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':(0x0,cron_1['formatCronJobInfo'])(_0x22dc6d),'msgType':'markdown'});return;}case _0x1a8e6f(0x190):{if(!this[_0x1a8e6f(0x206)](_0x118549[_0x1a8e6f(0x1f3)])){await this[_0x1a8e6f(0x1db)](_0x481411,_0x202309);return;}await this[_0x1a8e6f(0x13c)]({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':_0x1a8e6f(0x1a2)});const _0x3c3008=await this['cronEngine']['analyzeAndCreate'](_0x481411,_0x378f6b[_0x1a8e6f(0xd1)],_0x488df6,_0x419907),_0x4e81d0=await this[_0x1a8e6f(0x104)](_0x481411,_0x202309,_0x488df6,_0x419907,_0x11abf7);_0x3c3008[_0x1a8e6f(0xd6)]?(_0x4e81d0[_0x1a8e6f(0x179)]&&(this[_0x1a8e6f(0x16f)](_0x4e81d0['sessionDir'],'user',_0x1a8e6f(0x17d)+this['sanitizeLogContent'](_0x378f6b[_0x1a8e6f(0xd1)])),this[_0x1a8e6f(0x16f)](_0x4e81d0['sessionDir'],_0x1a8e6f(0x219),_0x1a8e6f(0x1a0)+_0x3c3008[_0x1a8e6f(0xd6)]['id']+'\x20['+_0x3c3008[_0x1a8e6f(0xd6)]['cronExpression']+']\x20'+_0x3c3008[_0x1a8e6f(0xd6)][_0x1a8e6f(0x118)])),await this[_0x1a8e6f(0x13c)]({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':(0x0,cron_1[_0x1a8e6f(0x153)])(_0x3c3008[_0x1a8e6f(0xd6)]),'msgType':_0x1a8e6f(0x177)})):(_0x4e81d0['sessionDir']&&(this[_0x1a8e6f(0x16f)](_0x4e81d0[_0x1a8e6f(0x179)],_0x1a8e6f(0x1c6),_0x1a8e6f(0x17d)+this[_0x1a8e6f(0x170)](_0x378f6b['input'])),this[_0x1a8e6f(0x16f)](_0x4e81d0[_0x1a8e6f(0x179)],_0x1a8e6f(0x219),'定时任务分析失败:\x20'+_0x3c3008['error'])),await this[_0x1a8e6f(0x13c)]({'conversationId':_0x481411,'sessionWebhook':_0x202309,'content':_0x1a8e6f(0x15d)+_0x3c3008[_0x1a8e6f(0x115)]+_0x1a8e6f(0xf3),'msgType':_0x1a8e6f(0x177)}));return;}}}[a2_0x329fca(0x170)](_0x567ce1){const _0x1e03a9=a2_0x329fca;return _0x567ce1[_0x1e03a9(0x16a)](/\n/g,'\x5cn')[_0x1e03a9(0x16a)](/\r/g,'\x5cr');}[a2_0x329fca(0xd5)](_0x4b43e5){const _0x4cb791=a2_0x329fca,_0x437263=_0x4b43e5[_0x4cb791(0x16a)](/\r\n/g,'\x0a'),_0x40252a=0x1f40;if(_0x437263[_0x4cb791(0x1b1)]>_0x40252a)return _0x437263[_0x4cb791(0x12d)](0x0,_0x40252a)+_0x4cb791(0x14b);return _0x437263;}[a2_0x329fca(0x1f9)](_0x485920,_0x2122c2=0x64){const _0x4dbfe9=a2_0x329fca,_0x253949=_0x485920['replace'](/\n/g,'\x20')[_0x4dbfe9(0x10d)]();return _0x253949[_0x4dbfe9(0x1b1)]>_0x2122c2?_0x253949[_0x4dbfe9(0x158)](0x0,_0x2122c2)+_0x4dbfe9(0x18d):_0x253949;}async[a2_0x329fca(0x104)](_0x482ea8,_0x279fe8,_0x15aff8,_0x3a4431,_0x56dd1a,_0x291fdb=![]){const _0x5e0077=a2_0x329fca,_0x43a781=this['findActiveSession'](_0x482ea8);if(_0x43a781){const _0x5ebe77=this[_0x5e0077(0x19e)](_0x43a781[_0x5e0077(0x169)][_0x5e0077(0x169)]);return{'sessionDir':_0x5ebe77,'isNew':![]};}if(_0x291fdb)return{'sessionDir':null,'isNew':![]};const _0x106c40=Date[_0x5e0077(0x1ee)](),_0x53d75f={'conversationId':_0x482ea8,'sessionWebhook':_0x279fe8,'startTime':_0x106c40,'startTimeStr':utils_ok_1[_0x5e0077(0x114)]['mm'](_0x106c40)[_0x5e0077(0x1a7)](_0x5e0077(0xf7)),'startStaffId':_0x15aff8,'startNickName':_0x5e0077(0x1a6)+_0x3a4431},_0x31d97a=this['getSessionDir'](_0x53d75f);return fs_1['default'][_0x5e0077(0x13e)](_0x31d97a,{'recursive':!![]}),fs_1[_0x5e0077(0x1cc)][_0x5e0077(0x145)](_0x31d97a+_0x5e0077(0x1e8),JSON['stringify'](_0x53d75f,null,0x2),_0x5e0077(0xf5)),fs_1[_0x5e0077(0x1cc)][_0x5e0077(0x1f2)](_0x31d97a+_0x5e0077(0x198),'['+(0x0,session_1[_0x5e0077(0x188)])()+_0x5e0077(0x1a4),_0x5e0077(0xf5)),{'sessionDir':_0x31d97a,'isNew':!![]};}[a2_0x329fca(0x206)](_0x3ecc3f){const _0x3ae539=a2_0x329fca;return!!(_0x3ecc3f[_0x3ae539(0x155)]||this[_0x3ae539(0x1e0)][_0x3ae539(0x18c)]);}async[a2_0x329fca(0x1db)](_0x49a73c,_0x1554da){const _0x38fe6a=a2_0x329fca;await this[_0x38fe6a(0x13c)]({'conversationId':_0x49a73c,'sessionWebhook':_0x1554da,'content':_0x38fe6a(0x196),'msgType':'markdown'});}[a2_0x329fca(0x154)](_0x247ddb,_0x3470c5){const _0x3727a3=a2_0x329fca,_0x27d547=this[_0x3727a3(0x205)](_0x247ddb);if(_0x3470c5[_0x3727a3(0x125)]('/'))return{'absolutePath':'','error':_0x3727a3(0x20e)};const _0x476ced=path_1[_0x3727a3(0x1cc)][_0x3727a3(0x220)](_0x27d547,_0x3470c5);if(!_0x476ced[_0x3727a3(0x125)](_0x27d547))return{'absolutePath':'','error':_0x3727a3(0x19f)};return{'absolutePath':_0x476ced};}async[a2_0x329fca(0xfd)](_0xdba801,_0x3bf8c9,_0x445f0e){const _0x463cf1=a2_0x329fca,{absolutePath:_0x37321f,error:_0x4bb638}=this[_0x463cf1(0x154)](_0xdba801,_0x445f0e);if(_0x4bb638){await this[_0x463cf1(0x13c)]({'conversationId':_0xdba801,'sessionWebhook':_0x3bf8c9,'content':_0x4bb638,'msgType':_0x463cf1(0x177)});return;}try{const _0x286cf6=fs_1[_0x463cf1(0x1cc)][_0x463cf1(0x1c7)](_0x37321f);_0x286cf6[_0x463cf1(0x159)]()?await this[_0x463cf1(0x13c)]({'conversationId':_0xdba801,'sessionWebhook':_0x3bf8c9,'content':_0x463cf1(0x21e)+_0x445f0e+'`','msgType':'markdown'}):await this[_0x463cf1(0x13c)]({'conversationId':_0xdba801,'sessionWebhook':_0x3bf8c9,'content':_0x463cf1(0x203)+_0x445f0e+'`','msgType':'markdown'});return;}catch{}try{fs_1[_0x463cf1(0x1cc)][_0x463cf1(0x13e)](_0x37321f,{'recursive':!![]}),await this[_0x463cf1(0x13c)]({'conversationId':_0xdba801,'sessionWebhook':_0x3bf8c9,'content':'✅\x20目录创建成功:\x20`'+_0x445f0e+'`','msgType':_0x463cf1(0x177)});}catch(_0x4b0140){await this[_0x463cf1(0x13c)]({'conversationId':_0xdba801,'sessionWebhook':_0x3bf8c9,'content':'❌\x20目录创建失败:\x20`'+_0x445f0e+_0x463cf1(0x181)+(_0x4b0140 instanceof Error?_0x4b0140['message']:String(_0x4b0140)),'msgType':_0x463cf1(0x177)});}}async[a2_0x329fca(0x1b9)](_0x3e07cb,_0x3b97b5,_0x2db938){const _0x47c98e=a2_0x329fca,{absolutePath:_0x24c57f,error:_0xd9ed5e}=this[_0x47c98e(0x154)](_0x3e07cb,_0x2db938);if(_0xd9ed5e){await this[_0x47c98e(0x13c)]({'conversationId':_0x3e07cb,'sessionWebhook':_0x3b97b5,'content':_0xd9ed5e,'msgType':'markdown'});return;}let _0x40e076;try{_0x40e076=fs_1[_0x47c98e(0x1cc)][_0x47c98e(0x1c7)](_0x24c57f);}catch{await this['sendDingMessage']({'conversationId':_0x3e07cb,'sessionWebhook':_0x3b97b5,'content':_0x47c98e(0x174)+_0x2db938+'`','msgType':_0x47c98e(0x177)});return;}const _0x361338=_0x40e076[_0x47c98e(0x159)]();try{_0x361338?fs_1[_0x47c98e(0x1cc)][_0x47c98e(0x1e6)](_0x24c57f,{'recursive':!![],'force':!![]}):fs_1[_0x47c98e(0x1cc)][_0x47c98e(0x146)](_0x24c57f),await this[_0x47c98e(0x13c)]({'conversationId':_0x3e07cb,'sessionWebhook':_0x3b97b5,'content':'✅\x20已删除'+(_0x361338?'目录':'文件')+_0x47c98e(0x1d7)+_0x2db938+'`','msgType':_0x47c98e(0x177)});}catch(_0x52f62c){await this[_0x47c98e(0x13c)]({'conversationId':_0x3e07cb,'sessionWebhook':_0x3b97b5,'content':_0x47c98e(0x130)+_0x2db938+'`\x0a原因:\x20'+(_0x52f62c instanceof Error?_0x52f62c[_0x47c98e(0x19a)]:String(_0x52f62c)),'msgType':_0x47c98e(0x177)});}}async[a2_0x329fca(0x20d)](_0x17a27b,_0x33bc09,_0x545e53){const _0x31388c=a2_0x329fca,{absolutePath:_0xf1ee6d,error:_0xe14dfb}=this[_0x31388c(0x154)](_0x17a27b,_0x545e53);if(_0xe14dfb){await this[_0x31388c(0x13c)]({'conversationId':_0x17a27b,'sessionWebhook':_0x33bc09,'content':_0xe14dfb,'msgType':'markdown'});return;}try{const _0x44c8d7=fs_1['default'][_0x31388c(0x1c7)](_0xf1ee6d);_0x44c8d7['isFile']()?await this['sendDingMessage']({'conversationId':_0x17a27b,'sessionWebhook':_0x33bc09,'content':_0x31388c(0xce)+_0x545e53+'`\x0a最后修改时间:\x20'+utils_ok_1[_0x31388c(0x114)]['mm'](_0x44c8d7[_0x31388c(0x17a)])[_0x31388c(0x1a7)](_0x31388c(0xd7)),'msgType':_0x31388c(0x177)}):await this['sendDingMessage']({'conversationId':_0x17a27b,'sessionWebhook':_0x33bc09,'content':_0x31388c(0x111)+_0x545e53+'`','msgType':'markdown'});return;}catch{}try{const _0x49f9c0=path_1[_0x31388c(0x1cc)][_0x31388c(0x15c)](_0xf1ee6d);fs_1[_0x31388c(0x1cc)][_0x31388c(0x13e)](_0x49f9c0,{'recursive':!![]}),fs_1[_0x31388c(0x1cc)][_0x31388c(0x145)](_0xf1ee6d,'',_0x31388c(0xf5)),await this[_0x31388c(0x13c)]({'conversationId':_0x17a27b,'sessionWebhook':_0x33bc09,'content':_0x31388c(0x14f)+_0x545e53+'`','msgType':_0x31388c(0x177)});}catch(_0x1f3147){await this['sendDingMessage']({'conversationId':_0x17a27b,'sessionWebhook':_0x33bc09,'content':_0x31388c(0xc4)+_0x545e53+_0x31388c(0x181)+(_0x1f3147 instanceof Error?_0x1f3147[_0x31388c(0x19a)]:String(_0x1f3147)),'msgType':_0x31388c(0x177)});}}async['botMsgGetCallback'](_0x1948fb){const _0x3558aa=a2_0x329fca;this[_0x3558aa(0xeb)][_0x3558aa(0x1d0)](_0x1948fb[_0x3558aa(0x133)][_0x3558aa(0xdf)],'');const _0x475d72=JSON[_0x3558aa(0xec)](_0x1948fb[_0x3558aa(0x102)]),{senderNick:_0x537cd9,senderStaffId:_0x5d7c74,conversationId:_0x1f57ec,conversationTitle:_0x5a5c3a,sessionWebhook:_0x405f08,msgtype:_0x50ca60}=_0x475d72,_0x15fc23=_0x475d72[_0x3558aa(0x1ce)]?.['content']?.[_0x3558aa(0x10d)]()??'';this[_0x3558aa(0x19b)](_0x3558aa(0x148)+_0x5a5c3a+'('+_0x1f57ec+_0x3558aa(0x1d3)+_0x537cd9+'('+_0x5d7c74+_0x3558aa(0x195)+_0x50ca60+_0x3558aa(0x17b)+_0x15fc23[_0x3558aa(0x12d)](0x0,0x32));if(!this[_0x3558aa(0x1bb)](_0x5d7c74,_0x1f57ec)){await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'atUserId':_0x5d7c74,'content':_0x3558aa(0x225)});return;}const _0x5e0fc9=this[_0x3558aa(0x1a1)](_0x1f57ec);let _0x5917e8;if(_0x50ca60===_0x3558aa(0xcf)&&_0x475d72[_0x3558aa(0x144)]){const _0x51d65e=this[_0x3558aa(0x205)](_0x1f57ec),_0x45d96c=_0x5e0fc9?.[_0x3558aa(0xf8)]!==![],_0x2ed3b2=await(0x0,image_1[_0x3558aa(0x1e7)])(this,_0x475d72['pictureDownloadCode'],_0x475d72[_0x3558aa(0xcc)],_0x51d65e,_0x45d96c,_0x15fc23||undefined);if(!_0x2ed3b2){await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'atUserId':_0x5d7c74,'content':'⚠️\x20图片下载失败,请重试或使用文字描述'});return;}_0x5917e8=_0x2ed3b2;}else{if(_0x50ca60===_0x3558aa(0x1ad)&&_0x475d72[_0x3558aa(0x140)]?.['richText']){const _0x10eef8=this[_0x3558aa(0x205)](_0x1f57ec),_0x1ebc6d=_0x5e0fc9?.[_0x3558aa(0xf8)]!==![];_0x5917e8=await(0x0,image_1[_0x3558aa(0x135)])(this,_0x475d72[_0x3558aa(0x140)][_0x3558aa(0x1ad)],_0x475d72[_0x3558aa(0xcc)],_0x10eef8,_0x1ebc6d);}else{_0x5917e8=_0x15fc23;if(!_0x5917e8)return;}}if(!_0x5917e8[_0x3558aa(0x125)]('/')&&_0x50ca60==='text'){const _0x4fc697=(0x0,quote_1['extractQuoteInfo'])(_0x475d72);if(_0x4fc697){this['debugLog'](_0x3558aa(0x1ed)+_0x4fc697[_0x3558aa(0x1a5)]);if(_0x4fc697[_0x3558aa(0x1a5)]&&!_0x4fc697[_0x3558aa(0x134)]){const _0x5dadda=await(0x0,messaging_1['fetchQuotedMessage'])(this,_0x4fc697[_0x3558aa(0x1a5)]);if(_0x5dadda)_0x4fc697[_0x3558aa(0x134)]=_0x5dadda;}_0x4fc697[_0x3558aa(0x134)]&&(_0x5917e8=(0x0,quote_1[_0x3558aa(0x1e9)])(_0x5917e8,_0x4fc697));}}const _0x15b2e2=(0x0,commands_1[_0x3558aa(0x217)])(_0x5917e8);if(_0x15b2e2!==null){if(!await this[_0x3558aa(0x1a3)](_0x1f57ec,_0x405f08,_0x5d7c74))return;const _0x41aa3a=_0x5e0fc9,_0x23a5b6=!!(_0x15b2e2[_0x3558aa(0x155)]||_0x15b2e2[_0x3558aa(0x221)]||_0x15b2e2[_0x3558aa(0x21f)]&&_0x15b2e2[_0x3558aa(0x21f)][_0x3558aa(0x1b1)]>0x0||_0x15b2e2[_0x3558aa(0x12a)]||_0x15b2e2[_0x3558aa(0x113)]!==undefined||_0x15b2e2[_0x3558aa(0x1dc)]!==undefined||_0x15b2e2[_0x3558aa(0x1c8)]!==undefined);if(_0x41aa3a&&_0x23a5b6){if(_0x15b2e2[_0x3558aa(0x12a)])_0x41aa3a[_0x3558aa(0x12a)]=_0x15b2e2[_0x3558aa(0x12a)];if(_0x15b2e2[_0x3558aa(0x155)])_0x41aa3a[_0x3558aa(0x155)]=_0x15b2e2[_0x3558aa(0x155)];if(_0x15b2e2[_0x3558aa(0x221)])_0x41aa3a[_0x3558aa(0x221)]=_0x15b2e2[_0x3558aa(0x221)];if(_0x15b2e2[_0x3558aa(0x113)]!==undefined)_0x41aa3a[_0x3558aa(0x113)]=_0x15b2e2[_0x3558aa(0x113)];if(_0x15b2e2[_0x3558aa(0x1dc)]!==undefined)_0x41aa3a['receiveReply']=_0x15b2e2[_0x3558aa(0x1dc)];if(_0x15b2e2['preBash']!==undefined)_0x41aa3a[_0x3558aa(0x1c8)]=_0x15b2e2[_0x3558aa(0x1c8)];if(_0x15b2e2['whiteUserList']&&_0x15b2e2[_0x3558aa(0x21f)][_0x3558aa(0x1b1)]>0x0){_0x41aa3a[_0x3558aa(0x21f)]=_0x15b2e2[_0x3558aa(0x21f)];for(const _0x4843eb of _0x15b2e2[_0x3558aa(0x21f)]){(0x0,session_1[_0x3558aa(0xfa)])(_0x4843eb)&&await(0x0,session_1['resolveUserId'])(this,_0x4843eb);}}(0x0,api_key_manager_1[_0x3558aa(0x1ef)])(this),console[_0x3558aa(0x12e)]('['+(0x0,session_1[_0x3558aa(0x188)])()+_0x3558aa(0x1a8)+(_0x41aa3a[_0x3558aa(0x12a)]||_0x5a5c3a)+'('+_0x1f57ec+')');}else{if(!_0x41aa3a){const _0x2a6ae9={'conversationId':_0x1f57ec,'conversationTitle':_0x15b2e2['conversationTitle']||_0x5a5c3a};if(_0x15b2e2[_0x3558aa(0x155)])_0x2a6ae9['dingToken']=_0x15b2e2[_0x3558aa(0x155)];if(_0x15b2e2[_0x3558aa(0x221)])_0x2a6ae9[_0x3558aa(0x221)]=_0x15b2e2[_0x3558aa(0x221)];if(_0x15b2e2[_0x3558aa(0x113)]!==undefined)_0x2a6ae9[_0x3558aa(0x113)]=_0x15b2e2[_0x3558aa(0x113)];if(_0x15b2e2[_0x3558aa(0x1dc)]!==undefined)_0x2a6ae9[_0x3558aa(0x1dc)]=_0x15b2e2[_0x3558aa(0x1dc)];if(_0x15b2e2[_0x3558aa(0x1c8)]!==undefined)_0x2a6ae9[_0x3558aa(0x1c8)]=_0x15b2e2[_0x3558aa(0x1c8)];if(_0x15b2e2[_0x3558aa(0x21f)]&&_0x15b2e2[_0x3558aa(0x21f)][_0x3558aa(0x1b1)]>0x0){_0x2a6ae9['whiteUserList']=_0x15b2e2[_0x3558aa(0x21f)];for(const _0x57f946 of _0x15b2e2[_0x3558aa(0x21f)]){(0x0,session_1[_0x3558aa(0xfa)])(_0x57f946)&&await(0x0,session_1[_0x3558aa(0x1ec)])(this,_0x57f946);}}this[_0x3558aa(0x1e0)][_0x3558aa(0x19d)][_0x3558aa(0x1c2)](_0x2a6ae9),(0x0,api_key_manager_1[_0x3558aa(0x1ef)])(this),console['log']('['+(0x0,session_1[_0x3558aa(0x188)])()+_0x3558aa(0xc9)+(_0x2a6ae9[_0x3558aa(0x12a)]||_0x5a5c3a)+'('+_0x1f57ec+')');}}const _0x191799=this['getConversationDir'](_0x1f57ec);!fs_1[_0x3558aa(0x1cc)][_0x3558aa(0x167)](_0x191799)&&(fs_1[_0x3558aa(0x1cc)][_0x3558aa(0x13e)](_0x191799,{'recursive':!![]}),console['log']('['+(0x0,session_1['timestamp'])()+_0x3558aa(0xe6)+_0x191799));const _0x45fecf=_0x41aa3a||this['getConversationConfig'](_0x1f57ec),_0x54d797=[_0x41aa3a?_0x3558aa(0x194):_0x3558aa(0x142),_0x3558aa(0x11c)+(_0x45fecf?.['conversationTitle']||_0x5a5c3a||'-'),_0x3558aa(0xd3)+_0x1f57ec];if(_0x45fecf?.[_0x3558aa(0x155)])_0x54d797[_0x3558aa(0x1c2)](_0x3558aa(0x1dd)+_0x45fecf[_0x3558aa(0x155)][_0x3558aa(0x12d)](0x0,0x8)+_0x3558aa(0x18d));else _0x54d797['push']('-\x20**dingToken:**\x20(未指定,\x20使用\x20defaultDingToken)');if(_0x45fecf?.[_0x3558aa(0x221)])_0x54d797[_0x3558aa(0x1c2)](_0x3558aa(0x226)+_0x45fecf[_0x3558aa(0x221)]);if(_0x45fecf?.['atSender']===![])_0x54d797[_0x3558aa(0x1c2)](_0x3558aa(0x1d2));if(_0x45fecf?.[_0x3558aa(0x1dc)]===![])_0x54d797[_0x3558aa(0x1c2)](_0x3558aa(0x1bd));if(_0x45fecf?.[_0x3558aa(0x21f)]?.[_0x3558aa(0x1b1)]){const _0x39c7b5=_0x45fecf[_0x3558aa(0x21f)][_0x3558aa(0x1af)](_0x31849a=>{const _0x5c06d0=_0x3558aa;if((0x0,session_1[_0x5c06d0(0xfa)])(_0x31849a))return _0x31849a;return(0x0,session_1[_0x5c06d0(0x15a)])(this,_0x31849a)||_0x31849a;})[_0x3558aa(0x183)](',\x20');_0x54d797[_0x3558aa(0x1c2)]('-\x20**whiteUserList:**\x20'+_0x39c7b5);}_0x54d797[_0x3558aa(0x1c2)]('\x0a💡\x20可编辑\x20config.json\x20补充更多配置'),_0x54d797[_0x3558aa(0x1c2)](_0x3558aa(0x11b)+_0x191799+'`'),await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x54d797[_0x3558aa(0x183)]('\x0a'),'msgType':_0x3558aa(0x177)});return;}if((0x0,commands_1[_0x3558aa(0x132)])(_0x5917e8)){await this['sendDingMessage']({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':(0x0,commands_1[_0x3558aa(0xcd)])(TOOL_VERSION,this[_0x3558aa(0xd4)](_0x5d7c74)),'msgType':'markdown'});return;}if((0x0,commands_1[_0x3558aa(0xe8)])(_0x5917e8)){await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0xda)+TOOL_VERSION,'msgType':_0x3558aa(0x177)});return;}const _0x342b72=(0x0,commands_1[_0x3558aa(0x16c)])(_0x5917e8);if(_0x342b72){const _0x57fe99=(0x0,commands_1[_0x3558aa(0x1da)])(_0x342b72);_0x57fe99?await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':(0x0,commands_1[_0x3558aa(0x1df)])(_0x57fe99),'msgType':_0x3558aa(0x177)}):await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x121)+_0x342b72+'**\x0a\x0a💡\x20输入\x20`/help`\x20查看所有可用命令','msgType':_0x3558aa(0x177)});return;}if(!_0x5e0fc9){console['log'](_0x3558aa(0x186)+_0x5a5c3a+','+_0x1f57ec);this[_0x3558aa(0xd4)](_0x5d7c74)?await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'atUserId':_0x5d7c74,'content':_0x3558aa(0x12f),'msgType':'markdown'}):await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'atUserId':_0x5d7c74,'content':_0x3558aa(0x21c)+_0x1f57ec+')...'});return;}const _0x188dbf=(0x0,commands_1[_0x3558aa(0x1c0)])(_0x5917e8);if(_0x188dbf!==null){if(!await this[_0x3558aa(0x1a3)](_0x1f57ec,_0x405f08,_0x5d7c74))return;const _0x5e0e2e=_0x188dbf==='all'?null:_0x1f57ec,_0x58f9e7=this['cleanCache'](_0x5e0e2e,!![]),_0x4e1b19=[];_0x4e1b19[_0x3558aa(0x1c2)](_0x3558aa(0xe5));if(_0x58f9e7[_0x3558aa(0x109)]>0x0)_0x4e1b19[_0x3558aa(0x1c2)](_0x3558aa(0x1c3)+_0x58f9e7[_0x3558aa(0x109)]+'\x20个');if(_0x58f9e7[_0x3558aa(0x17f)]>0x0)_0x4e1b19[_0x3558aa(0x1c2)]('-\x20任务目录:\x20'+_0x58f9e7['tasksDeleted']+'\x20个');if(_0x58f9e7[_0x3558aa(0x1ae)]>0x0)_0x4e1b19['push'](_0x3558aa(0x107)+_0x58f9e7[_0x3558aa(0x1ae)]+'\x20个');_0x58f9e7[_0x3558aa(0x109)]===0x0&&_0x58f9e7['tasksDeleted']===0x0&&_0x58f9e7[_0x3558aa(0x1ae)]===0x0&&_0x4e1b19[_0x3558aa(0x1c2)](_0x3558aa(0xdb));_0x4e1b19[_0x3558aa(0x1c2)](_0x3558aa(0x1f5));_0x58f9e7[_0x3558aa(0x101)][_0x3558aa(0x1b1)]>0x0&&_0x4e1b19[_0x3558aa(0x1c2)](_0x3558aa(0x13f)+_0x58f9e7[_0x3558aa(0x101)][_0x3558aa(0x183)](';\x20'));await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x4e1b19['join']('\x0a'),'msgType':_0x3558aa(0x177)});return;}if((0x0,commands_1[_0x3558aa(0xc8)])(_0x5917e8)){if(!await this['requireOwner'](_0x1f57ec,_0x405f08,_0x5d7c74))return;if(!this[_0x3558aa(0x1e0)][_0x3558aa(0x1be)]){await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x1c4),'msgType':_0x3558aa(0x177)});return;}(0x0,api_key_manager_1[_0x3558aa(0x175)])(this);const _0x222de3=this[_0x3558aa(0x1e0)][_0x3558aa(0x1be)][_0x3558aa(0xe4)][_0x3558aa(0x1f0)](_0x3f0af5=>_0x3f0af5['isValid'])['length'];await this['sendDingMessage']({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'✅\x20apiKeyCfg\x20已重置\x0a-\x20有效\x20Key\x20数:\x20'+_0x222de3+'/'+this[_0x3558aa(0x1e0)]['apiKeyCfg'][_0x3558aa(0xe4)][_0x3558aa(0x1b1)]+'\x0a-\x20重置时间:\x20'+(this[_0x3558aa(0x1e0)][_0x3558aa(0x1be)][_0x3558aa(0x13a)]||'-'),'msgType':_0x3558aa(0x177)});return;}const _0x513852=(0x0,commands_1[_0x3558aa(0x213)])(_0x5917e8);if(_0x513852){if(!await this[_0x3558aa(0x1a3)](_0x1f57ec,_0x405f08,_0x5d7c74))return;const _0x24cee6=_0x5e0fc9[_0x3558aa(0x21f)];if(_0x513852[_0x3558aa(0xc6)]===_0x3558aa(0x141)){const _0x2a33a6=_0x24cee6&&_0x24cee6['length']>0x0?_0x24cee6['map'](_0x1cc257=>{const _0x79896f=(0x0,session_1['userIdToPhone'])(this,_0x1cc257);return'-\x20'+(_0x79896f||_0x1cc257);})[_0x3558aa(0x183)]('\x0a'):_0x3558aa(0x180);await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'📋\x20**当前群白名单**\x0a'+_0x2a33a6,'msgType':'markdown'});return;}if(_0x513852[_0x3558aa(0xc6)]===_0x3558aa(0x1e4)){let _0x56c365=_0x513852[_0x3558aa(0x139)];if((0x0,session_1[_0x3558aa(0xfa)])(_0x513852[_0x3558aa(0x139)])){_0x56c365=await(0x0,session_1[_0x3558aa(0x1ec)])(this,_0x513852[_0x3558aa(0x139)]);if(!_0x56c365){await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0xe9)+_0x513852[_0x3558aa(0x139)],'msgType':_0x3558aa(0x177)});return;}}const _0x54714f=_0x24cee6?.[_0x3558aa(0x123)](_0x3fa89f=>(0x0,session_1['resolveToUserId'])(this,_0x3fa89f)===_0x56c365);if(_0x54714f){const _0x1d5881=(0x0,session_1[_0x3558aa(0x15a)])(this,_0x56c365)||_0x56c365;await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'⚠️\x20'+_0x1d5881+_0x3558aa(0x17e),'msgType':_0x3558aa(0x177)});return;}!_0x5e0fc9['whiteUserList']&&(_0x5e0fc9[_0x3558aa(0x21f)]=[]);_0x5e0fc9['whiteUserList'][_0x3558aa(0x1c2)](_0x513852[_0x3558aa(0x139)]),(0x0,api_key_manager_1[_0x3558aa(0x1ef)])(this);const _0x6b1911=_0x5e0fc9['whiteUserList']['map'](_0x4c73a3=>{const _0x1e4975=_0x3558aa,_0x120095=(0x0,session_1['resolveToUserId'])(this,_0x4c73a3);return(0x0,session_1[_0x1e4975(0x15a)])(this,_0x120095)||_0x4c73a3;}),_0x5ceee6=(0x0,session_1[_0x3558aa(0xfa)])(_0x513852[_0x3558aa(0x139)])?_0x513852[_0x3558aa(0x139)]:(0x0,session_1[_0x3558aa(0x15a)])(this,_0x513852[_0x3558aa(0x139)])||_0x513852[_0x3558aa(0x139)];await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'✅\x20已添加\x20'+_0x5ceee6+_0x3558aa(0xe2)+_0x6b1911[_0x3558aa(0x183)](',\x20'),'msgType':_0x3558aa(0x177)});return;}if(_0x513852[_0x3558aa(0xc6)]===_0x3558aa(0x228)){let _0x47542c=_0x513852[_0x3558aa(0x139)];if((0x0,session_1[_0x3558aa(0xfa)])(_0x513852['staffId'])){_0x47542c=await(0x0,session_1[_0x3558aa(0x1ec)])(this,_0x513852[_0x3558aa(0x139)]);if(!_0x47542c){await this['sendDingMessage']({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0xe9)+_0x513852['staffId'],'msgType':_0x3558aa(0x177)});return;}}const _0x5d3065=_0x24cee6?.[_0x3558aa(0x166)](_0x173ede=>(0x0,session_1[_0x3558aa(0x1e3)])(this,_0x173ede)===_0x47542c)??-0x1;if(_0x5d3065<0x0){const _0x5c95fb=(0x0,session_1['userIdToPhone'])(this,_0x47542c)||_0x47542c;await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x1f4)+_0x5c95fb+_0x3558aa(0x207),'msgType':'markdown'});return;}const _0x158ca9=_0x5e0fc9[_0x3558aa(0x21f)][_0x5d3065];_0x5e0fc9[_0x3558aa(0x21f)]['splice'](_0x5d3065,0x1);_0x5e0fc9[_0x3558aa(0x21f)]['length']===0x0&&delete _0x5e0fc9[_0x3558aa(0x21f)];(0x0,api_key_manager_1[_0x3558aa(0x1ef)])(this);const _0x1fbbda=_0x5e0fc9[_0x3558aa(0x21f)]?.['length']?_0x5e0fc9[_0x3558aa(0x21f)][_0x3558aa(0x1af)](_0x22529c=>{const _0x32d02b=_0x3558aa,_0x284139=(0x0,session_1[_0x32d02b(0x1e3)])(this,_0x22529c);return(0x0,session_1['userIdToPhone'])(this,_0x284139)||_0x22529c;})['join'](',\x20'):_0x3558aa(0x13d),_0x5d6656=(0x0,session_1[_0x3558aa(0x15a)])(this,_0x47542c)||_0x158ca9;await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x10c)+_0x5d6656+'\x0a当前白名单:\x20'+_0x1fbbda,'msgType':'markdown'});return;}}const _0x15cd9d=(0x0,commands_1[_0x3558aa(0x223)])(_0x5917e8);if(_0x15cd9d!==null){if(!await this[_0x3558aa(0x1a3)](_0x1f57ec,_0x405f08,_0x5d7c74))return;const _0x37c682=this[_0x3558aa(0x205)](_0x1f57ec),{exec:_0x7223a0}=await Promise['resolve']()[_0x3558aa(0xf4)](()=>__importStar(require('child_process'))),_0x3700cc=process['platform'];try{_0x15cd9d===_0x3558aa(0x117)?(_0x3700cc==='darwin'?_0x7223a0(_0x3558aa(0x138)+_0x37c682+'\x22'):_0x7223a0('explorer\x20\x22'+_0x37c682+'\x22'),await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x150)+_0x37c682+'\x0a```','msgType':'markdown'})):(_0x3700cc===_0x3558aa(0x1bf)?_0x7223a0(_0x3558aa(0x197)+_0x37c682+'\x22'):_0x7223a0('start\x20cmd\x20/k\x20\x22cd\x20/d\x20'+_0x37c682+'\x22',{'shell':_0x3558aa(0x120)}),await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'💻\x20已在终端中打开:\x0a```\x0a'+_0x37c682+_0x3558aa(0x192),'msgType':_0x3558aa(0x177)}));}catch(_0x36e26d){await this['sendDingMessage']({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x20a)+(_0x36e26d instanceof Error?_0x36e26d[_0x3558aa(0x19a)]:String(_0x36e26d)),'msgType':_0x3558aa(0x177)});}return;}const _0x223d93=(0x0,commands_1[_0x3558aa(0x209)])(_0x5917e8);if(_0x223d93){await this[_0x3558aa(0x1ea)](_0x223d93,{'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'senderStaffId':_0x5d7c74,'senderNick':_0x537cd9,'conversationConfig':_0x5e0fc9});return;}if((0x0,commands_1[_0x3558aa(0x11e)])(_0x5917e8)){const _0x1a79db=this[_0x3558aa(0x205)](_0x1f57ec);await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x1cd)+_0x1a79db+'\x0a```','msgType':'markdown'});return;}const _0x49243e=(0x0,commands_1['parseMkdirCommand'])(_0x5917e8);if(_0x49243e!==null){await this[_0x3558aa(0xfd)](_0x1f57ec,_0x405f08,_0x49243e);return;}const _0x3eddb=(0x0,commands_1['parseTouchCommand'])(_0x5917e8);if(_0x3eddb!==null){await this[_0x3558aa(0x20d)](_0x1f57ec,_0x405f08,_0x3eddb);return;}const _0x18a637=(0x0,commands_1['parseRmCommand'])(_0x5917e8);if(_0x18a637!==null){await this['handleRmCommand'](_0x1f57ec,_0x405f08,_0x18a637);return;}const _0x26666c=(0x0,commands_1[_0x3558aa(0x129)])(_0x5917e8);if(_0x26666c!==null){const _0x1ca752=this[_0x3558aa(0x205)](_0x1f57ec),_0x57e216=[];if(this['config'][_0x3558aa(0x1c8)])_0x57e216[_0x3558aa(0x1c2)](this[_0x3558aa(0x1e0)][_0x3558aa(0x1c8)]);if(_0x5e0fc9?.['preBash'])_0x57e216[_0x3558aa(0x1c2)](_0x5e0fc9[_0x3558aa(0x1c8)]);const _0x15b3ba=_0x57e216['length']>0x0?_0x57e216[_0x3558aa(0x183)](_0x3558aa(0x1d8))+_0x3558aa(0x1d8)+_0x26666c:_0x26666c,_0x343eba=this;(0x0,child_process_1[_0x3558aa(0x22a)])(_0x15b3ba,{'cwd':_0x1ca752,'timeout':0x7530,'maxBuffer':0x400*0x400},async(_0x528a32,_0x6292ea,_0x9ccb43)=>{const _0x514858=_0x3558aa;try{let _0x498c69;if(_0x528a32)_0x498c69='❌\x20命令执行失败\x0a```\x0a'+_0x528a32[_0x514858(0x19a)]+'\x0a```',_0x9ccb43&&(_0x498c69+='\x0a\x0a**stderr:**\x0a```\x0a'+_0x343eba['sanitizeOutput'](_0x9ccb43)+_0x514858(0x192));else{const _0x43e793=_0x6292ea||_0x514858(0xea);_0x498c69='✅\x20执行成功\x0a```\x0a'+_0x343eba[_0x514858(0xd5)](_0x43e793)+_0x514858(0x192),_0x9ccb43&&(_0x498c69+=_0x514858(0x165)+_0x343eba[_0x514858(0xd5)](_0x9ccb43)+'\x0a```');}await _0x343eba[_0x514858(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x498c69,'msgType':_0x514858(0x177)});}catch(_0x36b94e){console[_0x514858(0x115)]('[bash]\x20发送消息失败:',_0x36b94e);}});return;}if(/^\/new(?:\s|$)/i[_0x3558aa(0x1b2)](_0x5917e8)){const _0x54d581=this[_0x3558aa(0xf0)](_0x1f57ec);_0x54d581&&(console[_0x3558aa(0x12e)](_0x3558aa(0x16b)+_0x54d581[_0x3558aa(0x169)][_0x3558aa(0x169)][_0x3558aa(0x152)]+_0x3558aa(0x112)+this[_0x3558aa(0x12b)](_0x54d581['session'][_0x3558aa(0x169)])),this['interruptClaudeProcess'](_0x54d581[_0x3558aa(0x169)],'新会话命令中断正在执行的\x20Claude\x20进程'),this[_0x3558aa(0xf1)]['delete'](_0x54d581[_0x3558aa(0x1c1)]),this[_0x3558aa(0x1b4)](_0x54d581[_0x3558aa(0x1c1)]));const _0x5f2113=_0x5917e8[_0x3558aa(0x16a)](/^\/new\s*/i,'')[_0x3558aa(0x10d)]();_0x5f2113?await this[_0x3558aa(0x1b3)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'senderStaffId':_0x5d7c74,'senderNick':_0x537cd9,'message':_0x5f2113,'conversationConfig':_0x5e0fc9}):await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'atUserId':_0x5d7c74,'content':_0x3558aa(0xc7)});return;}const _0x1ae993=(0x0,commands_1[_0x3558aa(0x22b)])(_0x5917e8);if(_0x1ae993!==null&&_0x5e0fc9){let _0x5806f8=_0x1ae993;if(!_0x5806f8){const _0x1e038a=(0x0,session_1[_0x3558aa(0x1fc)])(this,_0x1f57ec);if(!_0x1e038a){await this['sendDingMessage']({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'atUserId':_0x5d7c74,'content':_0x3558aa(0x1fb),'msgType':_0x3558aa(0x177)});return;}_0x5806f8=(0x0,session_1[_0x3558aa(0x12b)])(_0x1e038a);}await this[_0x3558aa(0x156)](_0x1f57ec,_0x405f08,_0x5806f8,_0x5d7c74,_0x5e0fc9);return;}const _0x3f9b5b=(0x0,commands_1['parseLogCommand'])(_0x5917e8);if(_0x3f9b5b!==null){const _0x2b74c7=this[_0x3558aa(0x212)](_0x1f57ec,_0x3f9b5b);_0x2b74c7?await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x157)+_0x3f9b5b+_0x3558aa(0x21b)+_0x2b74c7+_0x3558aa(0x192),'msgType':_0x3558aa(0x177)}):await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x18f)});return;}const _0x29c92a=(0x0,commands_1[_0x3558aa(0x184)])(_0x5917e8);if(_0x29c92a!==null){const _0x376f01=[],_0x444ce7=this[_0x3558aa(0x205)](_0x1f57ec);(_0x29c92a===_0x3558aa(0x204)||_0x29c92a===_0x3558aa(0xd9))&&(_0x376f01[_0x3558aa(0x1c2)](_0x3558aa(0x16d)+(0x0,commands_1[_0x3558aa(0x11d)])(this[_0x3558aa(0x1e0)])),_0x376f01[_0x3558aa(0x1c2)](_0x3558aa(0x119)+(0x0,commands_1[_0x3558aa(0xff)])(_0x5e0fc9,_0x1f57ec,_0x44a96b=>(0x0,session_1[_0x3558aa(0x15a)])(this,_0x44a96b),_0x444ce7)));if(_0x29c92a===_0x3558aa(0x204)||_0x29c92a===_0x3558aa(0x169)){const _0x4efcd8=this[_0x3558aa(0x1aa)](_0x1f57ec);_0x4efcd8?_0x376f01[_0x3558aa(0x1c2)](_0x3558aa(0xf2)+_0x4efcd8):_0x376f01[_0x3558aa(0x1c2)](_0x3558aa(0x122));}(_0x29c92a===_0x3558aa(0x204)||_0x29c92a===_0x3558aa(0x20f))&&_0x376f01[_0x3558aa(0x1c2)](_0x3558aa(0x14d)+this[_0x3558aa(0x1d9)]());await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x376f01[_0x3558aa(0x183)]('\x0a\x0a'),'msgType':_0x3558aa(0x177)});return;}const _0x4cad74=(0x0,commands_1[_0x3558aa(0x1f6)])(_0x5917e8);if(_0x4cad74!==null){const {target:_0x248da7,depth:_0x1be5a5}=_0x4cad74,_0x2ead37=this['getConversationDir'](_0x1f57ec);let _0xa45d5c=_0x2ead37,_0x1ee11f=_0x3558aa(0x15e);if(_0x248da7&&_0x248da7!==_0x3558aa(0x1b8)){if(_0x248da7[_0x3558aa(0x125)]('./')||_0x248da7['startsWith'](_0x3558aa(0xd0))||_0x248da7[_0x3558aa(0x125)]('/')){const _0xef1f37=path_1[_0x3558aa(0x1cc)][_0x3558aa(0x220)](_0x2ead37,_0x248da7);if(fs_1[_0x3558aa(0x1cc)][_0x3558aa(0x167)](_0xef1f37)&&fs_1[_0x3558aa(0x1cc)][_0x3558aa(0x1c7)](_0xef1f37)['isDirectory']()){if(!_0xef1f37[_0x3558aa(0x125)](_0x2ead37)){await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x19f),'msgType':_0x3558aa(0x177)});return;}_0xa45d5c=_0xef1f37,_0x1ee11f=_0x248da7;}else{await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'❌\x20路径不存在或不是目录:\x20**'+_0x248da7+'**','msgType':_0x3558aa(0x177)});return;}}else{const _0x29d998=(0x0,commands_1[_0x3558aa(0xdd)])(_0x2ead37,_0x248da7);if(_0x29d998)_0xa45d5c=_0x29d998,_0x1ee11f=_0x248da7;else{await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'❌\x20未找到名为\x20**'+_0x248da7+_0x3558aa(0x18a),'msgType':_0x3558aa(0x177)});return;}}}const _0xd8eaff=(0x0,commands_1[_0x3558aa(0x218)])(_0xa45d5c,0x0,_0x1be5a5);await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'📂\x20'+_0x1ee11f+_0x3558aa(0x201)+_0x1be5a5+_0x3558aa(0x108)+_0xd8eaff+'\x0a```','msgType':_0x3558aa(0x177)});return;}const _0x1fd54f=(0x0,task_1['parseTaskCancelCommand'])(_0x5917e8);if(_0x1fd54f){const _0x185777=this['cancelTask'](_0x1fd54f,_0x1f57ec);await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x185777,'msgType':_0x3558aa(0x177)});return;}if(_0x5917e8['startsWith'](_0x3558aa(0x1c9))){const _0x40726a=_0x5917e8['substring'](0x6)[_0x3558aa(0x10d)]();_0x40726a&&(await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'atUserId':_0x5d7c74,'content':_0x3558aa(0x10e)}),await this[_0x3558aa(0x1ff)]({'conversationId':_0x1f57ec,'prompt':_0x40726a,'senderStaffId':_0x5d7c74,'senderNickName':_0x537cd9,'sessionWebhook':_0x405f08}));return;}const _0x3ab22d=(0x0,commands_1[_0x3558aa(0xed)])(_0x5917e8);if(_0x3ab22d){const _0x458d19=this['findActiveSession'](_0x1f57ec),_0x4d96a7=_0x458d19?.[_0x3558aa(0x169)][_0x3558aa(0x210)]??[];switch(_0x3ab22d[_0x3558aa(0xc6)]){case _0x3558aa(0x141):{if(_0x4d96a7[_0x3558aa(0x1b1)]===0x0)await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'📭\x20当前无排队消息','msgType':'markdown'});else{const _0x3039ea=_0x4d96a7[_0x3558aa(0x1af)]((_0x241562,_0x451991)=>_0x451991+0x1+_0x3558aa(0x1c5)+(_0x241562[_0x3558aa(0x127)]||_0x241562[_0x3558aa(0x1b0)])+_0x3558aa(0x199)+this['truncateMsg'](_0x241562[_0x3558aa(0x19a)]));await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'📨\x20消息队列\x20('+_0x4d96a7['length']+_0x3558aa(0x211)+_0x3039ea[_0x3558aa(0x183)]('\x0a'),'msgType':_0x3558aa(0x177)});}return;}case _0x3558aa(0xcb):{if(_0x4d96a7[_0x3558aa(0x1b1)]===0x0){await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':'📭\x20当前无排队消息','msgType':_0x3558aa(0x177)});return;}const _0x15d924=Math[_0x3558aa(0xfc)](_0x3ab22d[_0x3558aa(0x137)],_0x4d96a7[_0x3558aa(0x1b1)]),_0x55c65b=_0x4d96a7['splice'](_0x4d96a7[_0x3558aa(0x1b1)]-_0x15d924,_0x15d924),_0x53fad1=_0x55c65b[_0x3558aa(0x1af)]((_0x5558c1,_0x39777b)=>_0x39777b+0x1+_0x3558aa(0x1c5)+(_0x5558c1['senderNick']||_0x5558c1[_0x3558aa(0x1b0)])+_0x3558aa(0x199)+this['truncateMsg'](_0x5558c1[_0x3558aa(0x19a)]));await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x16e)+_0x15d924+'\x20条消息\x0a'+_0x53fad1[_0x3558aa(0x183)]('\x0a'),'msgType':_0x3558aa(0x177)});return;}case'cancelAll':{if(_0x4d96a7[_0x3558aa(0x1b1)]===0x0){await this['sendDingMessage']({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x10b),'msgType':_0x3558aa(0x177)});return;}const _0x52ad6e=_0x4d96a7[_0x3558aa(0x1b1)];_0x4d96a7[_0x3558aa(0x1b1)]=0x0,await this[_0x3558aa(0x13c)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'content':_0x3558aa(0x1e2)+_0x52ad6e+_0x3558aa(0x168),'msgType':_0x3558aa(0x177)});return;}}}await this[_0x3558aa(0x1cb)]({'conversationId':_0x1f57ec,'sessionWebhook':_0x405f08,'senderStaffId':_0x5d7c74,'senderNick':_0x537cd9,'message':_0x5917e8,'conversationConfig':_0x5e0fc9});}async[a2_0x329fca(0x160)](){const _0xb74dfe=a2_0x329fca,_0x18e6ad=Array[_0xb74dfe(0x10a)](this[_0xb74dfe(0x1e0)]['conversations'])?this[_0xb74dfe(0x1e0)][_0xb74dfe(0x19d)]:[],_0x47a90c=this[_0xb74dfe(0x1e0)]['taskHandlerCount']??this[_0xb74dfe(0xe1)],_0x1803ad=_0x18e6ad[_0xb74dfe(0x1b1)]>0x0;console['log']('['+(0x0,session_1[_0xb74dfe(0x188)])()+']\x20钉钉机器人服务启动,clientId:\x20'+this[_0xb74dfe(0x163)]),console[_0xb74dfe(0x12e)]('['+(0x0,session_1[_0xb74dfe(0x188)])()+']\x20群配置:\x20'+_0x18e6ad[_0xb74dfe(0x1af)](_0x5857ab=>_0x5857ab[_0xb74dfe(0x12a)]||_0x5857ab[_0xb74dfe(0x152)])['join'](',\x20')),(0x0,api_key_manager_1[_0xb74dfe(0x162)])(this),await(0x0,session_1[_0xb74dfe(0x227)])(this);this[_0xb74dfe(0x1e0)]['apiKeyCfg']&&((0x0,api_key_manager_1[_0xb74dfe(0x175)])(this),(0x0,api_key_manager_1[_0xb74dfe(0x143)])(this));this['loadActiveSessions'](),this['cronEngine'][_0xb74dfe(0x1fa)]();_0x1803ad&&console[_0xb74dfe(0x12e)]('['+(0x0,session_1[_0xb74dfe(0x188)])()+_0xb74dfe(0xf6)+_0x47a90c);this[_0xb74dfe(0xeb)][_0xb74dfe(0x173)](_0xb74dfe(0x1cf),async _0x3af87e=>{const _0x1cb6a7=_0xb74dfe;await this[_0x1cb6a7(0x1eb)](_0x3af87e);});const _0x31a873=[];if(_0x1803ad)for(let _0x32189f=0x0;_0x32189f<_0x47a90c;_0x32189f++){console[_0xb74dfe(0x12e)]('['+(0x0,session_1[_0xb74dfe(0x188)])()+']\x20启动任务处理器\x20#'+(_0x32189f+0x1)),_0x31a873[_0xb74dfe(0x1c2)](this['runTaskHandlerLoop']()['catch'](_0x116a3d=>console[_0xb74dfe(0x115)](_0xb74dfe(0x20c)+(_0x32189f+0x1)+_0xb74dfe(0x202),_0x116a3d)));}const _0x1c3375=this[_0xb74dfe(0xeb)][_0xb74dfe(0x116)]()[_0xb74dfe(0xde)](_0x57f0dd=>{const _0x1357f8=_0xb74dfe;console['error'](_0x1357f8(0x149),_0x57f0dd),process[_0x1357f8(0x131)](0x1);});await Promise[_0xb74dfe(0x204)]([_0x1c3375,..._0x31a873]);}}exports[a2_0x329fca(0x11f)]=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;
|