opclawtm 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/bin/team-manager.js +1 -1
  2. package/dist/bin/team-setup.js +1 -1
  3. package/dist/bin/team-uninstall.js +1 -1
  4. package/dist/cli/commands/agent.command.js +1 -1
  5. package/dist/cli/commands/checklist.command.js +1 -1
  6. package/dist/cli/commands/dept.command.js +1 -1
  7. package/dist/cli/commands/document.command.js +1 -1
  8. package/dist/cli/commands/domain.command.js +1 -1
  9. package/dist/cli/commands/feishu.command.js +1 -1
  10. package/dist/cli/commands/guide.command.js +1 -1
  11. package/dist/cli/commands/job.command.js +1 -1
  12. package/dist/cli/commands/license.command.js +1 -1
  13. package/dist/cli/commands/message-failure.command.js +1 -1
  14. package/dist/cli/commands/message.command.js +1 -1
  15. package/dist/cli/commands/node.command.js +1 -1
  16. package/dist/cli/commands/role-flow.command.js +1 -1
  17. package/dist/cli/commands/skill-pack.command.js +1 -1
  18. package/dist/cli/commands/status.command.js +1 -1
  19. package/dist/cli/commands/sync.command.js +1 -1
  20. package/dist/cli/commands/task.command.js +1 -1
  21. package/dist/cli/commands/user.command.js +1 -1
  22. package/dist/cli/index.js +1 -1
  23. package/dist/cli/tui/index.js +1 -1
  24. package/dist/cli/tui/menus/agent-manage.menu.js +1 -1
  25. package/dist/cli/tui/menus/dept-manage.menu.js +1 -1
  26. package/dist/cli/tui/menus/domain-manage.menu.js +1 -1
  27. package/dist/cli/tui/menus/feishu.menu.js +1 -1
  28. package/dist/cli/tui/menus/job-manage.menu.js +1 -1
  29. package/dist/cli/tui/menus/license.menu.js +1 -1
  30. package/dist/cli/tui/menus/main.menu.js +1 -1
  31. package/dist/cli/tui/menus/reset.menu.js +1 -1
  32. package/dist/cli/tui/menus/status.menu.js +1 -1
  33. package/dist/cli/tui/menus/task-manage.menu.js +1 -1
  34. package/dist/cli/tui/menus/team-create.menu.js +1 -1
  35. package/dist/config.js +1 -1
  36. package/dist/core/auth/index.js +1 -1
  37. package/dist/core/auth/middleware.js +1 -1
  38. package/dist/core/auth/storage.js +1 -1
  39. package/dist/core/models/types.js +1 -1
  40. package/dist/core/preset-version.txt +1 -1
  41. package/dist/core/services/agent-template.service.js +1 -1
  42. package/dist/core/services/agent.service.js +1 -1
  43. package/dist/core/services/auth-profiles.service.js +1 -1
  44. package/dist/core/services/checklist.service.js +1 -1
  45. package/dist/core/services/config-tracker.service.js +1 -1
  46. package/dist/core/services/crypto.service.js +1 -1
  47. package/dist/core/services/dept.service.js +1 -1
  48. package/dist/core/services/document.service.js +1 -1
  49. package/dist/core/services/domain.service.js +1 -1
  50. package/dist/core/services/feishu.service.js +1 -1
  51. package/dist/core/services/index.js +1 -1
  52. package/dist/core/services/job.service.js +1 -1
  53. package/dist/core/services/log.service.js +1 -1
  54. package/dist/core/services/message-failure.service.js +1 -1
  55. package/dist/core/services/message.service.js +1 -1
  56. package/dist/core/services/node.service.js +1 -1
  57. package/dist/core/services/openclaw-config.service.js +1 -1
  58. package/dist/core/services/preset-loader.service.js +1 -1
  59. package/dist/core/services/role-flow.service.js +1 -1
  60. package/dist/core/services/session-cleanup.service.js +1 -1
  61. package/dist/core/services/setup.service.js +1 -1
  62. package/dist/core/services/skill-pack.service.js +1 -1
  63. package/dist/core/services/task.service.js +1 -1
  64. package/dist/core/services/template.service.js +1 -1
  65. package/dist/core/services/user.service.js +1 -1
  66. package/dist/core/utils/agent-guide-generator.js +1 -1
  67. package/dist/core/utils/credentials-cleanup.js +1 -1
  68. package/dist/core/utils/index.js +1 -1
  69. package/dist/core/utils/openclaw-helper.js +1 -1
  70. package/dist/core/utils/template-generator.js +1 -1
  71. package/dist/db/index.js +1 -1
  72. package/dist/db/migrations/index.js +1 -1
  73. package/dist/db/migrations/v1.7.12-migration.js +1 -1
  74. package/dist/db/migrations/v1.7.14-migration.js +1 -1
  75. package/dist/db/migrations/v1.7.3-migration.js +1 -1
  76. package/dist/db/migrations/v1.7.4-migration.js +1 -1
  77. package/dist/db/migrations/v1.9.13-migration.js +1 -1
  78. package/dist/db/migrations/v1.9.4-migration.js +1 -1
  79. package/dist/db/repositories/agent-template.repo.js +1 -1
  80. package/dist/db/repositories/agent.repo.js +1 -1
  81. package/dist/db/repositories/base.repository.js +1 -1
  82. package/dist/db/repositories/company.repo.js +1 -1
  83. package/dist/db/repositories/config-change.repo.js +1 -1
  84. package/dist/db/repositories/dept.repo.js +1 -1
  85. package/dist/db/repositories/document.repo.d.ts +1 -0
  86. package/dist/db/repositories/document.repo.js +1 -1
  87. package/dist/db/repositories/domain.repo.js +1 -1
  88. package/dist/db/repositories/guide.repo.js +1 -1
  89. package/dist/db/repositories/index.js +1 -1
  90. package/dist/db/repositories/init-session.repo.js +1 -1
  91. package/dist/db/repositories/job.repo.js +1 -1
  92. package/dist/db/repositories/message-failure.repo.js +1 -1
  93. package/dist/db/repositories/message-log.repo.js +1 -1
  94. package/dist/db/repositories/node.repo.js +1 -1
  95. package/dist/db/repositories/role-flow.repo.js +1 -1
  96. package/dist/db/repositories/skill-pack.repo.js +1 -1
  97. package/dist/db/repositories/skill.repo.js +1 -1
  98. package/dist/db/repositories/task.repo.js +1 -1
  99. package/dist/db/repositories/template.repo.js +1 -1
  100. package/dist/db/repositories/user.repo.js +1 -1
  101. package/package.json +1 -1
  102. package/resources/preset-version.txt +1 -1
@@ -1 +1 @@
1
- 'use strict';(function(_0x4833c4,_0x21106a){const _0x2778b4=_0x4833c4();while(!![]){try{const _0x42c5bf=parseInt(_0x186a(0x78))/0x1+-parseInt(_0x186a(0x8c))/0x2+-parseInt(_0x186a(0x88))/0x3*(parseInt(_0x186a(0xa8))/0x4)+parseInt(_0x186a(0x80))/0x5+-parseInt(_0x186a(0x90))/0x6*(-parseInt(_0x186a(0x93))/0x7)+-parseInt(_0x186a(0x7a))/0x8*(-parseInt(_0x186a(0x76))/0x9)+-parseInt(_0x186a(0x86))/0xa;if(_0x42c5bf===_0x21106a)break;else _0x2778b4['push'](_0x2778b4['shift']());}catch(_0x476f55){_0x2778b4['push'](_0x2778b4['shift']());}}}(_0x1de2,0xeecb9));var __importDefault=this&&this['__importDefault']||function(_0x2b01d3){return _0x2b01d3&&_0x2b01d3[_0x186a(0x79)]?_0x2b01d3:{'default':_0x2b01d3};};Object[_0x186a(0x91)](exports,_0x186a(0x79),{'value':!![]}),exports['showDomainManageMenu']=showDomainManageMenu;const inquirer_1=__importDefault(require(_0x186a(0xab))),chalk_1=__importDefault(require('chalk')),services_1=require(_0x186a(0x70)),index_1=require('../index');function _0x1de2(){const _0x591e6b=['6Akg5z+F5zcn56EW77YA','cIaG4PYtioMIHUwFN+w3SUwiOoMzPaO','zgvMyxvSDa','BwfW','C2XPy2u','mZCXoteWmtbxu2X0EwK','4P6viowiM+w7UUMIHUwFNW','mtC2mxzZAxbWAG','AxnFChjLC2v0','CMvK','z3jLzw4','mJa3mJK2nLb5A3r0wa','ywn0Aw9U','yMfJAW','lI4U','mtyYsuDitLjg','zgvMAw5LuhjVCgvYDhK','cIaG8j+pOIdPOOBLN5/LIjFOOAGGka','ndyYmJu5q2nJsLDO','cIaG4P6viowiM+w7UUAwSoMIHUwFNWO','ChjVBxb0','BgvUz3rO','DhvPvxrPBhm','8j+xKE+4JYdLIkdPMAtPOOBLN58','icdPOOtNVA46ia','zg9TywLU','BwvZC2fNzq','zgvSzxrL','zg9TywLUu2vYDMLJzq','BgLZDa','BgLZDefSBa','DhjPBq','icbjrdOG','y3jLyxrL','cIaG4PYxia','DxbKyxrL','y29UzMLYBq','cIaG6Akg5z+F5lIn5A2y5zYOcG','y3LHBG','mJq2ofnIyKnMuW','y29UDgvUDa','cIaG4PYtioMIHUwFN+w3SUABToAwSaO','Aw5XDwLYzxi','BMfTzq','5PAW5zcn56EW77YA','cIaG5PQc5PEG6Akg5z+FcG','u2vWyxjHDg9Y','6k+36l6t5ywL6Akg5z+F5zcn56EW','8j+uMsdOV5tLM54','z2v0qNLjza','yM9Sza','C3vJy2vZCW','8j+tIYdPOOBLN5/LIjFOOAG','6k+36ycj5OUP5Pon5l2C77YA','lI4VlI4VlI4Vy29Yzs9Zzxj2AwnLCW','6Akg5z+F5O+p6l+W77Yi5y+V6ycj77Yj77YA','icdPOOtNVA7POOBLN5/KUi3LJ6/KV67MLlNMIjBLIkdPMAqk','zgLT','icdMJ4/OV7a6ia','icdLKi3NP7a6ia','mJuYmZzdu2vSueS','Bg9N','mtuWote1oeXewxnxwa','x19LC01VzhvSzq','ndm3nLDJyuvLEq','cIaG4PYtioMIHUwFN+wiM+w7UUAiKowkNWO','D2fPDezVCKTLEq','56gU5A6A5yIG6zMK6Akg5z+Fici','4PYp77Ipios/RUAuUEwqJEENSa','zg9TywLUswq','nJm0otyXnxHXCgH3Ba'];_0x1de2=function(){return _0x591e6b;};return _0x1de2();}async function showDomainManageMenu(){while(!![]){const _0x1eba4c=[new inquirer_1['default']['Separator'](chalk_1[_0x186a(0x83)]['cyan'][_0x186a(0x6c)]('🏢\x20领域管理')),new inquirer_1['default'][(_0x186a(0xaf))](),{'name':_0x186a(0x87),'value':_0x186a(0xa2)},{'name':_0x186a(0x6e),'value':'list'},new inquirer_1[(_0x186a(0x83))]['Separator'](),{'name':'🔙\x20返回主菜单','value':'back'}],{action:_0x31c9e6}=await inquirer_1['default'][_0x186a(0x95)]([{'type':_0x186a(0x9e),'name':_0x186a(0x8d),'message':_0x186a(0x6f),'choices':_0x1eba4c,'loop':!![]}]);switch(_0x31c9e6){case _0x186a(0xa2):await showCreateDomainWizard();break;case'list':await showDomainList();break;case'back':return;}}}async function showCreateDomainWizard(){console[_0x186a(0x77)](chalk_1[_0x186a(0x83)][_0x186a(0xa7)](_0x186a(0x94)));const {name:_0x2e6a3e,content:_0x3cdc50}=await inquirer_1[_0x186a(0x83)][_0x186a(0x95)]([{'type':'input','name':_0x186a(0xac),'message':_0x186a(0x81),'validate':_0x41d003=>_0x41d003[_0x186a(0xa0)]()?!![]:_0x186a(0xb0)},{'type':'editor','name':'content','message':_0x186a(0x71)}]),_0x3b012b=services_1['domainService'][_0x186a(0xa2)]({'name':_0x2e6a3e,'content':_0x3cdc50||undefined});_0x3b012b[_0x186a(0x6d)]?(console[_0x186a(0x77)](chalk_1[_0x186a(0x83)]['green'](_0x186a(0x7b))),console[_0x186a(0x77)](_0x186a(0xa1)+_0x3b012b[_0x186a(0x9a)]?.['id']),console[_0x186a(0x77)]('\x20\x20名称:\x20'+_0x3b012b['domain']?.[_0x186a(0xac)]+'\x0a')):console[_0x186a(0x77)](chalk_1[_0x186a(0x83)][_0x186a(0x8a)](_0x186a(0xa3)+_0x3b012b['message']+'\x0a')),await index_1[_0x186a(0x97)][_0x186a(0x7c)]();}function _0x186a(_0xdf1cf3,_0x4e3f01){_0xdf1cf3=_0xdf1cf3-0x6a;const _0x1de22a=_0x1de2();let _0x186a7d=_0x1de22a[_0xdf1cf3];if(_0x186a['wblrYK']===undefined){var _0x1775df=function(_0x36a14){const _0x5082a8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2b01d3='',_0x1eba4c='';for(let _0x31c9e6=0x0,_0x2e6a3e,_0x3cdc50,_0x3b012b=0x0;_0x3cdc50=_0x36a14['charAt'](_0x3b012b++);~_0x3cdc50&&(_0x2e6a3e=_0x31c9e6%0x4?_0x2e6a3e*0x40+_0x3cdc50:_0x3cdc50,_0x31c9e6++%0x4)?_0x2b01d3+=String['fromCharCode'](0xff&_0x2e6a3e>>(-0x2*_0x31c9e6&0x6)):0x0){_0x3cdc50=_0x5082a8['indexOf'](_0x3cdc50);}for(let _0x41d003=0x0,_0x1f83e7=_0x2b01d3['length'];_0x41d003<_0x1f83e7;_0x41d003++){_0x1eba4c+='%'+('00'+_0x2b01d3['charCodeAt'](_0x41d003)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1eba4c);};_0x186a['OIeOag']=_0x1775df,_0x186a['zIBbdT']={},_0x186a['wblrYK']=!![];}const _0x429a3e=_0x1de22a[0x0],_0x24f335=_0xdf1cf3+_0x429a3e,_0xa25475=_0x186a['zIBbdT'][_0x24f335];return!_0xa25475?(_0x186a7d=_0x186a['OIeOag'](_0x186a7d),_0x186a['zIBbdT'][_0x24f335]=_0x186a7d):_0x186a7d=_0xa25475,_0x186a7d;}async function showDomainList(){const _0x1f83e7=services_1[_0x186a(0x9d)][_0x186a(0x9f)]();if(_0x1f83e7[_0x186a(0x96)]===0x0){console['log'](chalk_1[_0x186a(0x83)][_0x186a(0x73)](_0x186a(0xae))),await index_1[_0x186a(0x97)]['waitForKey']();return;}console[_0x186a(0x77)](chalk_1[_0x186a(0x83)][_0x186a(0xa7)](_0x186a(0x92)+_0x1f83e7[_0x186a(0x96)]+')\x0a'));const _0x3955f=[..._0x1f83e7[_0x186a(0x84)](_0x4dd9fc=>({'name':_0x4dd9fc['name']+'\x20'+(_0x4dd9fc[_0x186a(0x89)]?chalk_1[_0x186a(0x83)]['green']('[预置]'):''),'value':_0x4dd9fc['id']})),new inquirer_1[(_0x186a(0x83))][(_0x186a(0xaf))](),{'name':_0x186a(0x6a),'value':_0x186a(0x8e)}],{domainId:_0x2d4589}=await inquirer_1[_0x186a(0x83)]['prompt']([{'type':'list','name':_0x186a(0x7f),'message':'选择领域查看详情:','choices':_0x3955f,'loop':!![]}]);_0x2d4589!==_0x186a(0x8e)&&await showDomainDetail(_0x2d4589);}async function showDomainDetail(_0x176904){const _0x24a72a=services_1[_0x186a(0x9d)][_0x186a(0x6b)](_0x176904);if(!_0x24a72a){console[_0x186a(0x77)](chalk_1[_0x186a(0x83)]['red'](_0x186a(0xa6)));return;}console[_0x186a(0x77)](chalk_1['default'][_0x186a(0xa7)]('\x0a\x20\x20🏢\x20领域详情\x0a')),console['log'](_0x186a(0xa1)+_0x24a72a['id']),console[_0x186a(0x77)](_0x186a(0x75)+_0x24a72a[_0x186a(0xac)]),console[_0x186a(0x77)](_0x186a(0x99)+(_0x24a72a[_0x186a(0x89)]?'是':'否'));_0x24a72a[_0x186a(0xa9)]&&console[_0x186a(0x77)](_0x186a(0x74)+_0x24a72a['content'][_0x186a(0x85)](0x0,0x64)+_0x186a(0x8f));console[_0x186a(0x77)]();if(_0x24a72a['is_preset']){console[_0x186a(0x77)](chalk_1[_0x186a(0x83)][_0x186a(0x73)](_0x186a(0x72))),await index_1[_0x186a(0x97)][_0x186a(0x7c)]();return;}const _0x3ea332=[{'name':_0x186a(0x7e),'value':_0x186a(0xa4)},{'name':_0x186a(0x98),'value':_0x186a(0x9c)},new inquirer_1[(_0x186a(0x83))]['Separator'](),{'name':_0x186a(0x6a),'value':'back'}],{action:_0x56bcf3}=await inquirer_1['default'][_0x186a(0x95)]([{'type':'list','name':'action','message':'操作:','choices':_0x3ea332}]);switch(_0x56bcf3){case _0x186a(0xa4):await showUpdateDomain(_0x176904);break;case _0x186a(0x9c):await showDeleteDomain(_0x176904);break;}}async function showUpdateDomain(_0x500712){const _0x24349e=services_1[_0x186a(0x9d)][_0x186a(0x6b)](_0x500712);if(!_0x24349e)return;const {name:_0x3cb008}=await inquirer_1['default'][_0x186a(0x95)]([{'type':'input','name':'name','message':_0x186a(0xad),'default':_0x24349e[_0x186a(0xac)]}]),_0x1abb06=services_1[_0x186a(0x9d)][_0x186a(0xa4)](_0x500712,{'name':_0x3cb008});_0x1abb06[_0x186a(0x6d)]?console[_0x186a(0x77)](chalk_1['default'][_0x186a(0x8b)](_0x186a(0xaa))):console['log'](chalk_1[_0x186a(0x83)][_0x186a(0x8a)](_0x186a(0xa3)+_0x1abb06[_0x186a(0x9b)]+'\x0a')),await index_1['tuiUtils']['waitForKey']();}async function showDeleteDomain(_0x28b87f){const _0x1abd0d=services_1[_0x186a(0x9d)][_0x186a(0x6b)](_0x28b87f);if(!_0x1abd0d)return;const {confirm:_0x5359d1}=await inquirer_1[_0x186a(0x83)][_0x186a(0x95)]([{'type':'confirm','name':_0x186a(0xa5),'message':_0x186a(0x7d)+_0x1abd0d[_0x186a(0xac)]+'\x22?','default':![]}]);if(_0x5359d1){const _0x5209e1=services_1[_0x186a(0x9d)][_0x186a(0x9c)](_0x28b87f);_0x5209e1['success']?console[_0x186a(0x77)](chalk_1[_0x186a(0x83)][_0x186a(0x8b)](_0x186a(0x82))):console[_0x186a(0x77)](chalk_1[_0x186a(0x83)][_0x186a(0x8a)](_0x186a(0xa3)+_0x5209e1['message']+'\x0a'));}await index_1[_0x186a(0x97)][_0x186a(0x7c)]();}
1
+ 'use strict';(function(_0x5c8722,_0x2e84b1){const _0x60faac=_0x5c8722();while(!![]){try{const _0x33c9ee=-parseInt(_0x2d4e(0x134))/0x1*(parseInt(_0x2d4e(0x138))/0x2)+parseInt(_0x2d4e(0x164))/0x3*(-parseInt(_0x2d4e(0x142))/0x4)+parseInt(_0x2d4e(0x15e))/0x5*(-parseInt(_0x2d4e(0x168))/0x6)+-parseInt(_0x2d4e(0x12b))/0x7*(parseInt(_0x2d4e(0x137))/0x8)+-parseInt(_0x2d4e(0x13c))/0x9+-parseInt(_0x2d4e(0x13d))/0xa*(-parseInt(_0x2d4e(0x129))/0xb)+parseInt(_0x2d4e(0x159))/0xc*(parseInt(_0x2d4e(0x135))/0xd);if(_0x33c9ee===_0x2e84b1)break;else _0x60faac['push'](_0x60faac['shift']());}catch(_0x57926b){_0x60faac['push'](_0x60faac['shift']());}}}(_0x32e3,0xca016));function _0x2d4e(_0x50ecee,_0x23ff6d){_0x50ecee=_0x50ecee-0x123;const _0x32e32c=_0x32e3();let _0x2d4e54=_0x32e32c[_0x50ecee];if(_0x2d4e['UMCaRl']===undefined){var _0x4dad69=function(_0x1d0319){const _0x21dd1f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2c7632='',_0x220166='';for(let _0x3c7c70=0x0,_0x5c6d46,_0x1f14d5,_0x229d60=0x0;_0x1f14d5=_0x1d0319['charAt'](_0x229d60++);~_0x1f14d5&&(_0x5c6d46=_0x3c7c70%0x4?_0x5c6d46*0x40+_0x1f14d5:_0x1f14d5,_0x3c7c70++%0x4)?_0x2c7632+=String['fromCharCode'](0xff&_0x5c6d46>>(-0x2*_0x3c7c70&0x6)):0x0){_0x1f14d5=_0x21dd1f['indexOf'](_0x1f14d5);}for(let _0x36c785=0x0,_0x15e0b7=_0x2c7632['length'];_0x36c785<_0x15e0b7;_0x36c785++){_0x220166+='%'+('00'+_0x2c7632['charCodeAt'](_0x36c785)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x220166);};_0x2d4e['ZKGKvc']=_0x4dad69,_0x2d4e['VyUseL']={},_0x2d4e['UMCaRl']=!![];}const _0x560b44=_0x32e32c[0x0],_0x121054=_0x50ecee+_0x560b44,_0x1a03d2=_0x2d4e['VyUseL'][_0x121054];return!_0x1a03d2?(_0x2d4e54=_0x2d4e['ZKGKvc'](_0x2d4e54),_0x2d4e['VyUseL'][_0x121054]=_0x2d4e54):_0x2d4e54=_0x1a03d2,_0x2d4e54;}var __importDefault=this&&this['__importDefault']||function(_0x2c7632){return _0x2c7632&&_0x2c7632[_0x2d4e(0x13e)]?_0x2c7632:{'default':_0x2c7632};};Object[_0x2d4e(0x12a)](exports,_0x2d4e(0x13e),{'value':!![]}),exports[_0x2d4e(0x154)]=showDomainManageMenu;const inquirer_1=__importDefault(require(_0x2d4e(0x145))),chalk_1=__importDefault(require(_0x2d4e(0x15d))),services_1=require('../../../core/services'),index_1=require(_0x2d4e(0x161));async function showDomainManageMenu(){while(!![]){const _0x220166=[new inquirer_1[(_0x2d4e(0x151))]['Separator'](chalk_1['default'][_0x2d4e(0x152)][_0x2d4e(0x13a)](_0x2d4e(0x13b))),new inquirer_1[(_0x2d4e(0x151))]['Separator'](),{'name':'➕\x20创建领域','value':_0x2d4e(0x124)},{'name':_0x2d4e(0x128),'value':_0x2d4e(0x127)},new inquirer_1[(_0x2d4e(0x151))][(_0x2d4e(0x141))](),{'name':_0x2d4e(0x140),'value':'back'}],{action:_0x3c7c70}=await inquirer_1['default']['prompt']([{'type':_0x2d4e(0x127),'name':'action','message':'请选择操作:','choices':_0x220166,'loop':!![]}]);switch(_0x3c7c70){case _0x2d4e(0x124):await showCreateDomainWizard();break;case _0x2d4e(0x127):await showDomainList();break;case'back':return;}}}async function showCreateDomainWizard(){console['log'](chalk_1[_0x2d4e(0x151)][_0x2d4e(0x152)](_0x2d4e(0x130)));const {name:_0x5c6d46,content:_0x1f14d5}=await inquirer_1[_0x2d4e(0x151)]['prompt']([{'type':_0x2d4e(0x148),'name':'name','message':_0x2d4e(0x14b),'validate':_0x36c785=>_0x36c785[_0x2d4e(0x14d)]()?!![]:'请输入领域名称'},{'type':_0x2d4e(0x166),'name':'content','message':_0x2d4e(0x12e)}]),_0x229d60=services_1['domainService'][_0x2d4e(0x124)]({'name':_0x5c6d46,'content':_0x1f14d5||undefined});_0x229d60[_0x2d4e(0x165)]?(console[_0x2d4e(0x126)](chalk_1['default'][_0x2d4e(0x15c)](_0x2d4e(0x12d))),console[_0x2d4e(0x126)](_0x2d4e(0x15f)+_0x229d60[_0x2d4e(0x167)]?.['id']),console[_0x2d4e(0x126)](_0x2d4e(0x163)+_0x229d60[_0x2d4e(0x167)]?.[_0x2d4e(0x16a)]+'\x0a')):console['log'](chalk_1[_0x2d4e(0x151)]['red']('\x0a\x20\x20✗\x20'+_0x229d60[_0x2d4e(0x155)]+'\x0a')),await index_1[_0x2d4e(0x162)][_0x2d4e(0x160)]();}async function showDomainList(){const _0x15e0b7=services_1[_0x2d4e(0x156)][_0x2d4e(0x13f)]();if(_0x15e0b7['length']===0x0){console['log'](chalk_1[_0x2d4e(0x151)][_0x2d4e(0x15a)](_0x2d4e(0x14e))),await index_1[_0x2d4e(0x162)][_0x2d4e(0x160)]();return;}console[_0x2d4e(0x126)](chalk_1[_0x2d4e(0x151)][_0x2d4e(0x152)](_0x2d4e(0x131)+_0x15e0b7['length']+')\x0a'));const _0x5632d4=[..._0x15e0b7[_0x2d4e(0x158)](_0x5be2cc=>({'name':_0x5be2cc[_0x2d4e(0x16a)]+'\x20'+(_0x5be2cc['is_preset']?chalk_1[_0x2d4e(0x151)][_0x2d4e(0x15c)](_0x2d4e(0x14a)):''),'value':_0x5be2cc['id']})),new inquirer_1['default']['Separator'](),{'name':'🔙\x20返回','value':_0x2d4e(0x143)}],{domainId:_0x27f5b5}=await inquirer_1['default'][_0x2d4e(0x12f)]([{'type':_0x2d4e(0x127),'name':'domainId','message':'选择领域查看详情:','choices':_0x5632d4,'loop':!![]}]);_0x27f5b5!==_0x2d4e(0x143)&&await showDomainDetail(_0x27f5b5);}async function showDomainDetail(_0x489077){const _0x214dd0=services_1[_0x2d4e(0x156)][_0x2d4e(0x136)](_0x489077);if(!_0x214dd0){console[_0x2d4e(0x126)](chalk_1['default'][_0x2d4e(0x14c)](_0x2d4e(0x150)));return;}console[_0x2d4e(0x126)](chalk_1[_0x2d4e(0x151)][_0x2d4e(0x152)](_0x2d4e(0x144))),console['log'](_0x2d4e(0x15f)+_0x214dd0['id']),console['log'](_0x2d4e(0x163)+_0x214dd0['name']),console[_0x2d4e(0x126)]('\x20\x20预置:\x20'+(_0x214dd0['is_preset']?'是':'否'));_0x214dd0[_0x2d4e(0x132)]&&console['log'](_0x2d4e(0x147)+_0x214dd0[_0x2d4e(0x132)]['slice'](0x0,0x64)+_0x2d4e(0x12c));console[_0x2d4e(0x126)]();if(_0x214dd0[_0x2d4e(0x139)]){console['log'](chalk_1[_0x2d4e(0x151)][_0x2d4e(0x15a)]('\x20\x20预置领域不可修改或删除\x0a')),await index_1[_0x2d4e(0x162)][_0x2d4e(0x160)]();return;}const _0xa1e747=[{'name':_0x2d4e(0x14f),'value':_0x2d4e(0x125)},{'name':_0x2d4e(0x149),'value':_0x2d4e(0x133)},new inquirer_1[(_0x2d4e(0x151))][(_0x2d4e(0x141))](),{'name':_0x2d4e(0x15b),'value':'back'}],{action:_0x2b6723}=await inquirer_1[_0x2d4e(0x151)][_0x2d4e(0x12f)]([{'type':_0x2d4e(0x127),'name':_0x2d4e(0x123),'message':'操作:','choices':_0xa1e747}]);switch(_0x2b6723){case _0x2d4e(0x125):await showUpdateDomain(_0x489077);break;case'delete':await showDeleteDomain(_0x489077);break;}}async function showUpdateDomain(_0x476758){const _0x36f440=services_1[_0x2d4e(0x156)][_0x2d4e(0x136)](_0x476758);if(!_0x36f440)return;const {name:_0x28669e}=await inquirer_1[_0x2d4e(0x151)][_0x2d4e(0x12f)]([{'type':_0x2d4e(0x148),'name':_0x2d4e(0x16a),'message':'新名称:','default':_0x36f440[_0x2d4e(0x16a)]}]),_0x4549ab=services_1[_0x2d4e(0x156)][_0x2d4e(0x125)](_0x476758,{'name':_0x28669e});_0x4549ab[_0x2d4e(0x165)]?console[_0x2d4e(0x126)](chalk_1[_0x2d4e(0x151)][_0x2d4e(0x15c)]('\x0a\x20\x20✓\x20领域已更新\x0a')):console['log'](chalk_1['default'][_0x2d4e(0x14c)](_0x2d4e(0x146)+_0x4549ab[_0x2d4e(0x155)]+'\x0a')),await index_1[_0x2d4e(0x162)][_0x2d4e(0x160)]();}function _0x32e3(){const _0x5a1832=['m2f1DuXszW','C3vJy2vZCW','zwrPDg9Y','zg9TywLU','mti3ntu0t0HZEKDx','cIaG4PYtioMIHUwFN+w3SUwiOoMzPaO','BMfTzq','ywn0Aw9U','y3jLyxrL','DxbKyxrL','Bg9N','BgLZDa','8j+tIYdPOOBLN5/LIjFOOAG','mtCZnJa3nJfPAK1ZsuK','zgvMAw5LuhjVCgvYDhK','ndCZotKXBw9PsfPl','lI4U','cIaG4PYtioMIHUwFN+wiM+w7UUAiKowkNWO','6Akg5z+F5O+p6l+W77Yi5y+V6ycj77Yj77YA','ChjVBxb0','cIaG4P6viowiM+w7UUAwSoMIHUwFNWO','cIaG8j+pOIdPOOBLN5/LIjFOOAGGka','y29UDgvUDa','zgvSzxrL','mZG0nZbcvurSC1q','mtG3ndy3ndfxu2rcq2W','z2v0qNLjza','ndbvzgTZzxy','nJHJren6zvG','AxnFChjLC2v0','yM9Sza','8j+pOIdPOOBLN5/NRQhNKiy','mtq2nZeXmZruywHNt08','mtb6werIEKG','x19LC01VzhvSzq','BgLZDefSBa','8j+uMsdOV5tLM57KUlVOJ5ZLJzu','u2vWyxjHDg9Y','ndCZntmWnfDbshfbCq','yMfJAW','cIaG8j+pOIdPOOBLN5/OR6BMG4uk','Aw5XDwLYzxi','cIaG4PYxia','icdMJ4/OV7a6ia','Aw5WDxq','8j+xKE+4JYdLIkdPMAtPOOBLN58','w+MIHoE9RL0','6Akg5z+F5zcn56EW77YA','CMvK','DhjPBq','cIaG5PQc5PEG6Akg5z+FcG','4PYp77Ipios/RUAuUEwqJEENSa','cIaG6Akg5z+F5lIn5A2y5zYOcG','zgvMyxvSDa','y3LHBG','56gU5A6A5yIG6zMK6Akg5z+Fici','C2HVD0rVBwfPBK1HBMfNzu1LBNu','BwvZC2fNzq','zg9TywLUu2vYDMLJzq','y29UzMLYBq','BwfW','mZzNwK9LzuG','zgLT','8j+uMsdOV5tLM54','z3jLzw4','y2HHBgS','mtq1EejWAev5','icbjrdOG','D2fPDezVCKTLEq','lI4VAw5KzxG','DhvPvxrPBhm','icdLKi3NP7a6ia'];_0x32e3=function(){return _0x5a1832;};return _0x32e3();}async function showDeleteDomain(_0x5172ca){const _0x27004e=services_1[_0x2d4e(0x156)][_0x2d4e(0x136)](_0x5172ca);if(!_0x27004e)return;const {confirm:_0xbb1773}=await inquirer_1[_0x2d4e(0x151)][_0x2d4e(0x12f)]([{'type':_0x2d4e(0x157),'name':_0x2d4e(0x157),'message':_0x2d4e(0x153)+_0x27004e[_0x2d4e(0x16a)]+'\x22?','default':![]}]);if(_0xbb1773){const _0xa35ff0=services_1[_0x2d4e(0x156)][_0x2d4e(0x133)](_0x5172ca);_0xa35ff0['success']?console['log'](chalk_1[_0x2d4e(0x151)][_0x2d4e(0x15c)](_0x2d4e(0x169))):console['log'](chalk_1['default'][_0x2d4e(0x14c)]('\x0a\x20\x20✗\x20'+_0xa35ff0[_0x2d4e(0x155)]+'\x0a'));}await index_1['tuiUtils'][_0x2d4e(0x160)]();}
@@ -1 +1 @@
1
- 'use strict';(function(_0x33240b,_0x410fca){const _0x3ec674=_0x33240b();while(!![]){try{const _0xcec5d0=parseInt(_0x5d24(0x1d2))/0x1+-parseInt(_0x5d24(0x193))/0x2+-parseInt(_0x5d24(0x1be))/0x3*(parseInt(_0x5d24(0xd3))/0x4)+-parseInt(_0x5d24(0xae))/0x5+parseInt(_0x5d24(0x1b3))/0x6+parseInt(_0x5d24(0xf3))/0x7*(parseInt(_0x5d24(0x15e))/0x8)+-parseInt(_0x5d24(0x147))/0x9*(-parseInt(_0x5d24(0x20d))/0xa);if(_0xcec5d0===_0x410fca)break;else _0x3ec674['push'](_0x3ec674['shift']());}catch(_0x336b39){_0x3ec674['push'](_0x3ec674['shift']());}}}(_0x3b64,0xe4d59));var __createBinding=this&&this['__createBinding']||(Object[_0x5d24(0xeb)]?function(_0x155b34,_0x1f89eb,_0xc117e8,_0x38376c){if(_0x38376c===undefined)_0x38376c=_0xc117e8;var _0x1d61bd=Object['getOwnPropertyDescriptor'](_0x1f89eb,_0xc117e8);(!_0x1d61bd||(_0x5d24(0x1dd)in _0x1d61bd?!_0x1f89eb['__esModule']:_0x1d61bd[_0x5d24(0x151)]||_0x1d61bd[_0x5d24(0xd2)]))&&(_0x1d61bd={'enumerable':!![],'get':function(){return _0x1f89eb[_0xc117e8];}}),Object['defineProperty'](_0x155b34,_0x38376c,_0x1d61bd);}:function(_0x39672f,_0x4e792d,_0x53c067,_0x1ef35b){if(_0x1ef35b===undefined)_0x1ef35b=_0x53c067;_0x39672f[_0x1ef35b]=_0x4e792d[_0x53c067];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[_0x5d24(0xeb)]?function(_0x184c5a,_0x5a62cd){Object[_0x5d24(0x11c)](_0x184c5a,'default',{'enumerable':!![],'value':_0x5a62cd});}:function(_0x5dcc5c,_0x5f37a7){_0x5dcc5c[_0x5d24(0x19b)]=_0x5f37a7;}),__importStar=this&&this[_0x5d24(0x18b)]||(function(){var _0x275356=function(_0x190980){return _0x275356=Object[_0x5d24(0xd0)]||function(_0x564102){var _0x24afe5=[];for(var _0x2fcb68 in _0x564102)if(Object['prototype'][_0x5d24(0x9c)][_0x5d24(0x194)](_0x564102,_0x2fcb68))_0x24afe5[_0x24afe5[_0x5d24(0x137)]]=_0x2fcb68;return _0x24afe5;},_0x275356(_0x190980);};return function(_0x4a6e7e){if(_0x4a6e7e&&_0x4a6e7e[_0x5d24(0x18d)])return _0x4a6e7e;var _0x2af32f={};if(_0x4a6e7e!=null){for(var _0x2c1849=_0x275356(_0x4a6e7e),_0x4c76f9=0x0;_0x4c76f9<_0x2c1849[_0x5d24(0x137)];_0x4c76f9++)if(_0x2c1849[_0x4c76f9]!==_0x5d24(0x19b))__createBinding(_0x2af32f,_0x4a6e7e,_0x2c1849[_0x4c76f9]);}return __setModuleDefault(_0x2af32f,_0x4a6e7e),_0x2af32f;};}()),__importDefault=this&&this[_0x5d24(0xe6)]||function(_0x39f5f0){return _0x39f5f0&&_0x39f5f0[_0x5d24(0x18d)]?_0x39f5f0:{'default':_0x39f5f0};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x5d24(0x1a3)]=showFeishuConfigMenu;const inquirer_1=__importDefault(require('inquirer')),chalk_1=__importDefault(require(_0x5d24(0x126))),fs=__importStar(require('fs')),path=__importStar(require(_0x5d24(0x17a))),index_1=require(_0x5d24(0x1ce)),services_1=require('../../../core/services'),utils_1=require(_0x5d24(0xd4)),configTracker=__importStar(require(_0x5d24(0x76))),dept_repo_1=require(_0x5d24(0x82)),job_repo_1=require(_0x5d24(0x133));async function showFeishuConfigMenu(){while(!![]){const _0x425600=getConfiguredAgents(),_0xf71880=Object[_0x5d24(0x173)](_0x425600)[_0x5d24(0x137)],_0xb6a106=[new inquirer_1[(_0x5d24(0x19b))]['Separator'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)][_0x5d24(0x10a)](_0x5d24(0xdb))),new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](),{'name':_0x5d24(0x17d)+_0xf71880+'\x20个)','value':_0x5d24(0x1f5)},{'name':_0x5d24(0x188),'value':_0x5d24(0x10f)},{'name':_0x5d24(0x98),'value':_0x5d24(0x1e8)},{'name':_0x5d24(0x159),'value':_0x5d24(0xc1)},new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](),new inquirer_1[(_0x5d24(0x19b))]['Separator'](chalk_1['default'][_0x5d24(0x1cf)][_0x5d24(0x10a)](_0x5d24(0x21e))),new inquirer_1[(_0x5d24(0x19b))]['Separator'](),{'name':_0x5d24(0x86),'value':'listGroups'},{'name':_0x5d24(0x13e),'value':_0x5d24(0x141)},new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](),new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](chalk_1[_0x5d24(0x19b)]['cyan'][_0x5d24(0x10a)](_0x5d24(0x1c7))),new inquirer_1['default'][(_0x5d24(0x229))](),{'name':_0x5d24(0xcc),'value':_0x5d24(0x1f8)},{'name':_0x5d24(0x77),'value':_0x5d24(0x111)},{'name':_0x5d24(0x91),'value':_0x5d24(0x181)},new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](),new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)][_0x5d24(0x10a)](_0x5d24(0x160))),new inquirer_1['default']['Separator'](),{'name':_0x5d24(0x114),'value':_0x5d24(0x1c9)},new inquirer_1['default'][(_0x5d24(0x229))](),{'name':_0x5d24(0x1e4),'value':'back'}],{action:_0x2e38b8}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0x1f5),'name':'action','message':'请选择操作:','choices':_0xb6a106,'loop':!![],'pageSize':0x14}]);switch(_0x2e38b8){case _0x5d24(0x1f5):await listConfiguredAgents();break;case _0x5d24(0x10f):await addFeishuBot();break;case _0x5d24(0x1e8):await editFeishuBot();break;case _0x5d24(0xc1):await deleteFeishuBot();break;case _0x5d24(0x219):await listFeishuGroups();break;case _0x5d24(0x141):await bindFeishuGroup();break;case _0x5d24(0x1f8):await showUserFeishuBinding();break;case'bindUser':await bindUserFeishuId();break;case _0x5d24(0x181):await unbindUserFeishu();break;case _0x5d24(0x1c9):await showPairingMenu();break;case'back':return;}}}function safeReadJsonConfig(_0x38d215){if(!fs['existsSync'](_0x38d215))return null;try{let _0x321cb0=fs[_0x5d24(0x18f)](_0x38d215,'utf-8');return _0x321cb0[_0x5d24(0x1fa)](0x0)===0xfeff&&(_0x321cb0=_0x321cb0['slice'](0x1)),_0x321cb0=_0x321cb0[_0x5d24(0x9a)](/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,''),JSON[_0x5d24(0x94)](_0x321cb0);}catch(_0xa4ea37){return console['error'](_0x5d24(0x1c4),_0xa4ea37 instanceof Error?_0xa4ea37[_0x5d24(0xba)]:String(_0xa4ea37)),null;}}function getConfiguredAgents(){const _0x1cb03c=(0x0,utils_1['getOpenClawJsonPath'])(),_0x16597b=safeReadJsonConfig(_0x1cb03c);if(!_0x16597b)return{};const _0x2cf73f=_0x16597b['channels'],_0x5bdd4b=_0x2cf73f?.['feishu'],_0x5726dd=_0x5bdd4b?.[_0x5d24(0xb0)];if(!_0x5726dd)return{};const _0x37c430={};for(const [_0x56b75f,_0x5cc48f]of Object[_0x5d24(0x205)](_0x5726dd)){if(_0x56b75f==='default')continue;const _0x40cb3e=_0x5cc48f;_0x40cb3e?.[_0x5d24(0x78)]&&(_0x37c430[_0x56b75f]={'appId':_0x40cb3e[_0x5d24(0x78)],'name':_0x40cb3e[_0x5d24(0x11e)]||_0x40cb3e[_0x5d24(0x1de)]});}return _0x37c430;}async function listConfiguredAgents(){const _0x459dcb=getConfiguredAgents(),_0x2828ec=Object['keys'](_0x459dcb);if(_0x2828ec['length']===0x0){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x1fd))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0xbc))),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)](_0x5d24(0x146))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim']('Agent\x20ID'[_0x5d24(0x10b)](0x1e))+chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0xc3)[_0x5d24(0x10b)](0x14))+chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('App\x20ID')),index_1[_0x5d24(0x185)][_0x5d24(0x8f)]();for(const _0x3c068a of _0x2828ec){const _0x3de94a=_0x459dcb[_0x3c068a],_0x21b9dd=services_1[_0x5d24(0x1d6)]['getById'](_0x3c068a),_0x1a29ae=_0x21b9dd?.[_0x5d24(0x11e)]||_0x3c068a,_0x254a8a=_0x3de94a['name']||'-';console['log'](''+_0x3c068a['padEnd'](0x1e)+_0x254a8a[_0x5d24(0x10b)](0x14)+_0x3de94a['appId']);}console[_0x5d24(0xed)](''),await index_1[_0x5d24(0x185)]['waitForKey']();}async function addFeishuBot(){const _0x6e8fa1=services_1[_0x5d24(0x1d6)][_0x5d24(0x197)]();if(_0x6e8fa1[_0x5d24(0x137)]===0x0){index_1[_0x5d24(0x185)][_0x5d24(0xb8)](_0x5d24(0xb2));return;}const _0x19698e=getConfiguredAgents(),_0x47a971=_0x6e8fa1[_0x5d24(0x1a8)](_0x2be46d=>!_0x19698e[_0x2be46d['id']]);if(_0x47a971[_0x5d24(0x137)]===0x0){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x11d))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x13c))),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}const _0x30c6df=_0x47a971[_0x5d24(0x1d5)](_0x5dff2e=>{const _0x347011=_0x5dff2e[_0x5d24(0xe8)]?dept_repo_1[_0x5d24(0x163)][_0x5d24(0x191)](_0x5dff2e[_0x5d24(0xe8)]):null,_0x12adcb=_0x5dff2e[_0x5d24(0x17b)]?job_repo_1[_0x5d24(0x8a)]['findById'](_0x5dff2e[_0x5d24(0x17b)]):null,_0x140c03={'manager':'管理者','executor':'执行者','reviewer':_0x5d24(0x1e1),'assistant':_0x5d24(0x8b),'watchdog':'监控者'};return{..._0x5dff2e,'deptName':_0x347011?.[_0x5d24(0x11e)]||_0x5d24(0x145),'jobName':_0x12adcb?.[_0x5d24(0x11e)]||_0x5d24(0x1b0),'roleDisplay':_0x140c03[_0x5dff2e[_0x5d24(0x21f)]]||_0x5dff2e[_0x5d24(0x21f)]};});console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['bold'][_0x5d24(0x1cf)](_0x5d24(0x20f))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x10a)](_0x5d24(0x188))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)]['cyan'](_0x5d24(0x12d))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x10a)]['yellow'](_0x5d24(0xfe))),console[_0x5d24(0xed)](chalk_1['default']['cyan'](_0x5d24(0x204))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x10a)][_0x5d24(0x1e3)](_0x5d24(0x164))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['bold'](_0x5d24(0x14a))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x207))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x13a))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['bold'](_0x5d24(0x1a9))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim']('\x20\x20•\x20进入「应用能力」→「机器人」')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x171))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x10a)](_0x5d24(0x201))),console[_0x5d24(0xed)](chalk_1['default']['dim'](_0x5d24(0x79))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x20\x20•\x20复制以下\x20JSON\x20内容直接导入:\x0a')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x129))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x130))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x165))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0xca))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1cf)](_0x5d24(0x132))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x14c))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x1f6))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x13f))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x1b8))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x83))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1cf)](_0x5d24(0x192))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0xfa))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x21d))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)](_0x5d24(0x1dc))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim']('\x20\x20•\x20进入「事件订阅」页面')),console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x211))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x14d))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)](_0x5d24(0x95))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x172))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1ff))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)](_0x5d24(0xf0))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1d1))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x101))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x20\x20•\x20保存版本,点击「申请上线」\x0a')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['bold'](_0x5d24(0xd8))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)]('\x20\x20•\x20进入「凭证与基础信息」页面')),console[_0x5d24(0xed)](chalk_1['default']['dim'](_0x5d24(0xbb))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x10a)]['cyan'](_0x5d24(0x12d)));const {agentId:_0x4c3ce1}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':'list','name':'agentId','message':'选择要配置飞书\x20Bot\x20的\x20Agent:','choices':[..._0x30c6df[_0x5d24(0x1d5)](_0xd5a5fe=>({'name':_0xd5a5fe[_0x5d24(0x11e)]+_0x5d24(0x203)+_0xd5a5fe[_0x5d24(0xd6)]+_0x5d24(0x203)+_0xd5a5fe[_0x5d24(0x187)]+_0x5d24(0x203)+_0xd5a5fe[_0x5d24(0xa9)],'value':_0xd5a5fe['id']})),new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](),{'name':_0x5d24(0x1ab),'value':_0x5d24(0x158)}],'loop':!![]}]);if(_0x4c3ce1===_0x5d24(0x158))return;const _0x4b30f5=services_1['agentService'][_0x5d24(0x20c)](_0x4c3ce1);console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x81))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x20\x20飞书开放平台:https://open.feishu.cn/app\x0a'));const {appId:_0x1f0498,appSecret:_0x415fbd,dmPolicy:_0x38e652}=await inquirer_1[_0x5d24(0x19b)]['prompt']([{'type':_0x5d24(0xe5),'name':'appId','message':_0x5d24(0xf2)},{'type':_0x5d24(0x16b),'name':_0x5d24(0x125),'message':_0x5d24(0x127)},{'type':'list','name':_0x5d24(0x1e2),'message':'私聊策略:','choices':[{'name':_0x5d24(0x1b4),'value':_0x5d24(0x1c9)},{'name':_0x5d24(0x12c),'value':_0x5d24(0x200)},{'name':_0x5d24(0x20e),'value':_0x5d24(0xa7)}],'default':'pairing','loop':!![]}]);if(!_0x1f0498?.[_0x5d24(0xfb)]()||!_0x1f0498[_0x5d24(0x16a)]('cli_')){index_1[_0x5d24(0x185)][_0x5d24(0x214)](_0x5d24(0x1ac));return;}if(!_0x415fbd?.[_0x5d24(0xfb)]()){index_1[_0x5d24(0x185)][_0x5d24(0x214)]('App\x20Secret\x20不能为空');return;}const _0xf23c6f=(0x0,utils_1[_0x5d24(0x16f)])(),_0x11528d=safeReadJsonConfig(_0xf23c6f)||{'gateway':{'port':0x7075,'mode':_0x5d24(0x14b),'bind':_0x5d24(0xfc),'auth':{'mode':_0x5d24(0x136),'token':_0x5d24(0x190)}},'agents':{'defaults':{},'list':[]},'bindings':[],'models':{'providers':{}},'channels':{}};if(!_0x11528d[_0x5d24(0x186)])_0x11528d['channels']={};const _0x342964=_0x11528d[_0x5d24(0x186)],_0x4f8b40=!_0x342964[_0x5d24(0x1fb)];!_0x342964[_0x5d24(0x1fb)]&&(_0x342964['feishu']={'enabled':!![],'dmPolicy':_0x5d24(0x1c9),'connectionMode':_0x5d24(0xb1),'accounts':{}});const _0x524694=_0x342964['feishu'];!_0x524694[_0x5d24(0xb0)]&&(_0x524694[_0x5d24(0xb0)]={});const _0x1680d3=_0x524694[_0x5d24(0xb0)];console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('[调试]\x20保存前\x20accounts\x20中的账号:\x20'+(Object[_0x5d24(0x173)](_0x1680d3)[_0x5d24(0x209)](',\x20')||'无')));const _0x103aa2=_0x1680d3[_0x4c3ce1]?{[_0x4c3ce1]:_0x1680d3[_0x4c3ce1]}:undefined;_0x1680d3[_0x4c3ce1]={'appId':_0x1f0498['trim'](),'appSecret':_0x415fbd[_0x5d24(0xfb)]()};!_0x524694[_0x5d24(0x1a7)]&&(_0x524694[_0x5d24(0x1a7)]=!![]);!_0x524694['dmPolicy']&&(_0x524694['dmPolicy']=_0x38e652);!_0x524694[_0x5d24(0x161)]&&(_0x524694[_0x5d24(0x161)]=_0x5d24(0xb1));console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x11f)+Object[_0x5d24(0x173)](_0x1680d3)['join'](',\x20')));if(!_0x11528d['plugins'])_0x11528d[_0x5d24(0x115)]={};const _0x2f0dcb=_0x11528d[_0x5d24(0x115)];if(!_0x2f0dcb[_0x5d24(0x205)])_0x2f0dcb[_0x5d24(0x205)]={};const _0x326265=_0x2f0dcb['entries'];if(!_0x326265[_0x5d24(0x1fb)])_0x326265[_0x5d24(0x1fb)]={};const _0x2c53cb=_0x326265[_0x5d24(0x1fb)];_0x2c53cb['enabled']=!![];if(!_0x11528d[_0x5d24(0x202)])_0x11528d['bindings']=[];const _0x965fa6=_0x11528d['bindings'],_0x5624a1=_0x965fa6['findIndex'](_0x4dbd53=>_0x4dbd53[_0x5d24(0x210)]===_0x4c3ce1&&_0x4dbd53[_0x5d24(0x217)]?.[_0x5d24(0x1a0)]===_0x5d24(0x1fb)),_0x1ba4f6={'agentId':_0x4c3ce1,'match':{'channel':_0x5d24(0x1fb),'accountId':_0x4c3ce1}};_0x5624a1>=0x0?_0x965fa6[_0x5624a1]=_0x1ba4f6:_0x965fa6['push'](_0x1ba4f6),fs[_0x5d24(0x7e)](_0xf23c6f,JSON[_0x5d24(0xcd)](_0x11528d,null,0x2),'utf-8'),_0x4f8b40&&configTracker[_0x5d24(0x1fc)]({'change_type':_0x5d24(0x119),'action':_0x5d24(0x10f),'target_path':_0x5d24(0x92),'target_type':_0x5d24(0x92),'new_value':JSON['stringify'](_0x342964[_0x5d24(0x1fb)]),'description':_0x5d24(0xaf)}),configTracker[_0x5d24(0x1fc)]({'change_type':_0x5d24(0x119),'action':_0x103aa2?_0x5d24(0xda):_0x5d24(0x10f),'target_path':_0x5d24(0x128)+_0x4c3ce1,'target_type':_0x5d24(0x92),'old_value':_0x103aa2?JSON[_0x5d24(0xcd)](_0x103aa2):undefined,'new_value':JSON['stringify']({[_0x4c3ce1]:_0x1680d3[_0x4c3ce1]}),'related_id':_0x4c3ce1,'description':_0x5d24(0x189)+_0x4c3ce1}),configTracker[_0x5d24(0x150)](_0x1ba4f6,_0x4c3ce1),services_1[_0x5d24(0x1d6)]['update'](_0x4c3ce1,{'feishu_bot_id':_0x4c3ce1}),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)](_0x5d24(0x1d3)+_0x4b30f5?.[_0x5d24(0x11e)]+_0x5d24(0x175))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x107)+_0x1f0498)),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xe7)+_0x4c3ce1)),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1e9)+_0x38e652)),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)][_0x5d24(0x1cf)](_0x5d24(0x20f))),console['log'](chalk_1['default']['bold'][_0x5d24(0x1e3)]('📋\x20后续步骤:\x0a')),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x10a)](_0x5d24(0xfd))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x157))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x149))),console['log'](chalk_1['default'][_0x5d24(0x10a)](_0x5d24(0x108))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x10c))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x20\x20•\x20用户发送私聊消息,机器人返回配对码')),console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0xa5))),console['log'](chalk_1['default'][_0x5d24(0x10a)]['cyan']('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\x0a')),await index_1[_0x5d24(0x185)]['waitForKey']();}async function editFeishuBot(){const _0x279263=getConfiguredAgents(),_0x53a86d=Object[_0x5d24(0x173)](_0x279263);if(_0x53a86d[_0x5d24(0x137)]===0x0){console[_0x5d24(0xed)](chalk_1['default']['yellow'](_0x5d24(0x1fd))),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)](_0x5d24(0x7c)));const _0x15408b=_0x53a86d[_0x5d24(0x1d5)](_0x423747=>{const _0x42a953=services_1[_0x5d24(0x1d6)][_0x5d24(0x20c)](_0x423747),_0x42066c=_0x279263[_0x423747],_0x4d0e0b=_0x42a953?.[_0x5d24(0xe8)]?dept_repo_1[_0x5d24(0x163)][_0x5d24(0x191)](_0x42a953[_0x5d24(0xe8)]):null,_0x1aebcb=_0x42a953?.[_0x5d24(0x17b)]?job_repo_1[_0x5d24(0x8a)]['findById'](_0x42a953[_0x5d24(0x17b)]):null,_0x4c9a5d={'manager':'管理者','executor':_0x5d24(0xc5),'reviewer':_0x5d24(0x1e1),'assistant':_0x5d24(0x8b),'watchdog':_0x5d24(0x72)};return{'id':_0x423747,'agent':_0x42a953,'info':_0x42066c,'deptName':_0x4d0e0b?.[_0x5d24(0x11e)]||_0x5d24(0x145),'jobName':_0x1aebcb?.[_0x5d24(0x11e)]||_0x5d24(0x1b0),'roleDisplay':_0x4c9a5d[_0x42a953?.[_0x5d24(0x21f)]||'']||_0x42a953?.[_0x5d24(0x21f)]||'未知'};}),{agentId:_0x480847}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':'list','name':_0x5d24(0x210),'message':_0x5d24(0x7f),'choices':[..._0x15408b[_0x5d24(0x1d5)](_0x59aecd=>({'name':(_0x59aecd['agent']?.[_0x5d24(0x11e)]||_0x59aecd['id'])+_0x5d24(0x203)+_0x59aecd[_0x5d24(0xd6)]+_0x5d24(0x203)+_0x59aecd[_0x5d24(0x187)]+_0x5d24(0x203)+_0x59aecd[_0x5d24(0xa9)]+'\x20('+(_0x59aecd[_0x5d24(0x1c2)]['name']||_0x59aecd[_0x5d24(0x1c2)][_0x5d24(0x78)])+')','value':_0x59aecd['id']})),new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](),{'name':'🔙\x20取消','value':_0x5d24(0x158)}],'loop':!![]}]);if(_0x480847===_0x5d24(0x158))return;const _0x43233b=(0x0,utils_1['getOpenClawJsonPath'])(),_0x579ec2=safeReadJsonConfig(_0x43233b),_0x596fd3=_0x579ec2?.['channels'],_0x183aad=_0x596fd3?.[_0x5d24(0x1fb)],_0x2c4519=_0x183aad?.['accounts'],_0x3fc878=_0x2c4519?.[_0x480847];if(!_0x183aad){index_1[_0x5d24(0x185)]['printError']('飞书配置不存在');return;}if(!_0x3fc878){index_1[_0x5d24(0x185)][_0x5d24(0x214)](_0x5d24(0x84));return;}const _0x579bba=services_1[_0x5d24(0x1d6)][_0x5d24(0x20c)](_0x480847),_0x60d332=_0x183aad?.[_0x5d24(0x1e2)]||_0x5d24(0x1c9);console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xc6))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x107)+_0x3fc878[_0x5d24(0x78)])),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1e9)+_0x60d332+'\x0a'));const {fields:_0x4f4901}=await inquirer_1[_0x5d24(0x19b)]['prompt']([{'type':_0x5d24(0x183),'name':_0x5d24(0x1a6),'message':_0x5d24(0x22c),'choices':[{'name':_0x5d24(0x102),'value':_0x5d24(0x125)},{'name':_0x5d24(0xd5),'value':_0x5d24(0x1e2)}]}]);if(_0x4f4901[_0x5d24(0x137)]===0x0){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xf7)));return;}if(_0x4f4901[_0x5d24(0xf6)]('appSecret')){const {appSecret:_0x2f2a61}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0x16b),'name':'appSecret','message':_0x5d24(0xcf)}]);_0x2f2a61?.[_0x5d24(0xfb)]()&&(_0x3fc878[_0x5d24(0x125)]=_0x2f2a61[_0x5d24(0xfb)]());}if(_0x4f4901['includes']('dmPolicy')){const {dmPolicy:_0x5cc9c1}=await inquirer_1['default'][_0x5d24(0x169)]([{'type':'list','name':_0x5d24(0x1e2),'message':'新的私聊策略:','choices':[{'name':_0x5d24(0x1ca),'value':_0x5d24(0x1c9)},{'name':_0x5d24(0x12c),'value':_0x5d24(0x200)},{'name':_0x5d24(0x20e),'value':_0x5d24(0xa7)}],'default':_0x60d332,'loop':!![]}]);_0x183aad[_0x5d24(0x1e2)]=_0x5cc9c1;}fs[_0x5d24(0x7e)](_0x43233b,JSON['stringify'](_0x579ec2,null,0x2),'utf-8'),console['log'](chalk_1['default'][_0x5d24(0x1bd)](_0x5d24(0x1f9))),await index_1['tuiUtils'][_0x5d24(0xa4)]();}async function deleteFeishuBot(){const _0x10365c=getConfiguredAgents(),_0x351e00=Object[_0x5d24(0x173)](_0x10365c);if(_0x351e00['length']===0x0){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)]('\x0a暂无已配置的飞书\x20Bot\x0a')),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}console['log'](chalk_1['default'][_0x5d24(0x10a)]('\x0a🗑️\x20删除\x20Agent\x20的飞书配置\x0a')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x8c)));const {agentId:_0x18388d}=await inquirer_1['default'][_0x5d24(0x169)]([{'type':_0x5d24(0x1f5),'name':'agentId','message':'选择要删除的\x20Agent\x20配置:','choices':[..._0x351e00[_0x5d24(0x1d5)](_0x6ee20c=>{const _0x4e3646=services_1[_0x5d24(0x1d6)][_0x5d24(0x20c)](_0x6ee20c),_0xc0dd65=_0x10365c[_0x6ee20c];return{'name':(_0x4e3646?.[_0x5d24(0x11e)]||_0x6ee20c)+'\x20('+_0x6ee20c+_0x5d24(0xbe)+(_0xc0dd65['name']||_0xc0dd65[_0x5d24(0x78)]),'value':_0x6ee20c};}),new inquirer_1['default'][(_0x5d24(0x229))](),{'name':_0x5d24(0x1ab),'value':_0x5d24(0x158)}],'loop':!![]}]);if(_0x18388d===_0x5d24(0x158))return;const {confirm:_0x5a46cc}=await inquirer_1[_0x5d24(0x19b)]['prompt']([{'type':_0x5d24(0x19d),'name':_0x5d24(0x19d),'message':_0x5d24(0x9b),'default':![]}]);if(!_0x5a46cc){console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)]('\x0a已取消\x0a'));return;}const _0xbbf756=(0x0,utils_1[_0x5d24(0x16f)])(),_0x547e57=safeReadJsonConfig(_0xbbf756);if(!_0x547e57){index_1[_0x5d24(0x185)][_0x5d24(0x214)]('配置文件读取失败');return;}const _0x4cd71f=_0x547e57['channels'],_0x2da642=_0x4cd71f?.[_0x5d24(0x1fb)],_0x55f783=_0x2da642?.['accounts'],_0x1f204e=_0x55f783?.[_0x18388d]?JSON['stringify'](_0x55f783[_0x18388d]):undefined,_0x39fa0f=Array[_0x5d24(0x99)](_0x547e57[_0x5d24(0x202)])?[..._0x547e57[_0x5d24(0x202)]]:[];_0x55f783&&_0x55f783[_0x18388d]&&delete _0x55f783[_0x18388d];_0x547e57[_0x5d24(0x202)]&&Array[_0x5d24(0x99)](_0x547e57[_0x5d24(0x202)])&&(_0x547e57['bindings']=_0x547e57[_0x5d24(0x202)][_0x5d24(0x1a8)](_0x139fee=>!(_0x139fee[_0x5d24(0x210)]===_0x18388d&&_0x139fee[_0x5d24(0x217)]?.[_0x5d24(0x1a0)]===_0x5d24(0x1fb))));_0x1f204e&&configTracker[_0x5d24(0x1fc)]({'change_type':_0x5d24(0x119),'action':_0x5d24(0xe0),'target_path':_0x5d24(0x128)+_0x18388d,'target_type':_0x5d24(0x92),'old_value':_0x1f204e,'related_id':_0x18388d,'description':_0x5d24(0xf5)+_0x18388d});const _0x16abd5=Array[_0x5d24(0x99)](_0x547e57[_0x5d24(0x202)])?_0x547e57['bindings']:[];_0x39fa0f[_0x5d24(0x137)]>_0x16abd5[_0x5d24(0x137)]&&configTracker['recordConfigChange']({'change_type':_0x5d24(0xe2),'action':_0x5d24(0xe0),'target_path':_0x5d24(0x202),'target_type':_0x5d24(0x202),'old_value':JSON[_0x5d24(0xcd)](_0x39fa0f),'new_value':JSON['stringify'](_0x16abd5),'related_id':_0x18388d,'description':'删除\x20Agent\x20'+_0x18388d+'\x20的飞书绑定'}),fs[_0x5d24(0x7e)](_0xbbf756,JSON[_0x5d24(0xcd)](_0x547e57,null,0x2),_0x5d24(0x144)),services_1[_0x5d24(0x1d6)][_0x5d24(0xda)](_0x18388d,{'feishu_bot_id':null}),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1bd)](_0x5d24(0xf4))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x93))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x19c))),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();}async function listFeishuGroups(){console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x10a)][_0x5d24(0x1cf)]('\x0a🏢\x20飞书群绑定列表\x0a'));const {departmentRepository:_0x1fa3dc}=await Promise[_0x5d24(0x1d0)]()[_0x5d24(0x105)](()=>__importStar(require('../../../db/repositories/dept.repo'))),_0x47dcdc=_0x1fa3dc[_0x5d24(0x174)]();if(_0x47dcdc[_0x5d24(0x137)]===0x0)console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('暂无事业部\x0a'));else{console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x1af)[_0x5d24(0x10b)](0x14))+chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x96))),index_1[_0x5d24(0x185)][_0x5d24(0x8f)]();for(const _0x1c0044 of _0x47dcdc){const _0x5087fa=_0x1c0044['feishu_group_id']||'-';console['log'](''+(_0x1c0044['name']||'-')[_0x5d24(0x10b)](0x14)+_0x5087fa);}console[_0x5d24(0xed)]('');}const _0x3b7a90=(0x0,utils_1[_0x5d24(0x16f)])(),_0x11dfab=safeReadJsonConfig(_0x3b7a90),_0x1d68a6=_0x11dfab?.['bindings']||[],_0x3fb527=_0x1d68a6[_0x5d24(0x1a8)](_0x38b6b2=>_0x38b6b2[_0x5d24(0x217)]?.['channel']===_0x5d24(0x1fb));if(_0x3fb527['length']>0x0){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['bold'](_0x5d24(0x167))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x1c5)[_0x5d24(0x10b)](0x19))+chalk_1['default'][_0x5d24(0x22d)]('类型'['padEnd'](0xa))+chalk_1[_0x5d24(0x19b)]['dim']('ID')),index_1[_0x5d24(0x185)]['printDivider']();for(const _0x4792da of _0x3fb527){const _0x360bc4=_0x4792da[_0x5d24(0x217)]?.['peer']?.[_0x5d24(0x80)]||_0x5d24(0x18a),_0x13ded4=_0x4792da['match']?.[_0x5d24(0x122)]?.['id']||_0x4792da['match']?.[_0x5d24(0x198)]||'*';console['log'](''+(_0x4792da['agentId']||'-')['padEnd'](0x19)+_0x360bc4[_0x5d24(0x10b)](0xa)+_0x13ded4);}console[_0x5d24(0xed)]('');}await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();}async function bindFeishuGroup(){try{console[_0x5d24(0xed)](chalk_1['default']['bold'][_0x5d24(0x1cf)](_0x5d24(0x1e6)));const {departmentRepository:_0x4bddda}=await Promise[_0x5d24(0x1d0)]()[_0x5d24(0x105)](()=>__importStar(require(_0x5d24(0x82)))),_0x1887fa=_0x4bddda[_0x5d24(0x174)]();if(_0x1887fa['length']===0x0){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x184))),await index_1[_0x5d24(0x185)]['waitForKey']();return;}const {deptId:_0x2b694f}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0x1f5),'name':_0x5d24(0x179),'message':_0x5d24(0x16c),'choices':[..._0x1887fa['map'](_0x281730=>({'name':_0x281730[_0x5d24(0x11e)]+'\x20('+_0x281730['id']+')'+(_0x281730['feishu_group_id']?_0x5d24(0xb9)+_0x281730[_0x5d24(0x1da)]+']':''),'value':_0x281730['id']})),new inquirer_1[(_0x5d24(0x19b))][(_0x5d24(0x229))](),{'name':_0x5d24(0x1ab),'value':_0x5d24(0x158)}],'loop':!![]}]);if(_0x2b694f===_0x5d24(0x158))return;const {groupId:_0x234763}=await inquirer_1['default'][_0x5d24(0x169)]([{'type':'input','name':_0x5d24(0x97),'message':_0x5d24(0xa6),'validate':_0x23b691=>{if(!_0x23b691['trim']())return _0x5d24(0x12f);if(!_0x23b691[_0x5d24(0x16a)](_0x5d24(0x109)))return'飞书群ID格式错误,应以\x20oc_\x20开头';return!![];}}]),_0x3911f1=_0x1887fa[_0x5d24(0x1ba)](_0x2facdb=>_0x2facdb['id']===_0x2b694f),_0x17f7f5=_0x3911f1?.[_0x5d24(0x1da)];_0x4bddda['update'](_0x2b694f,{'feishu_group_id':_0x234763}),configTracker[_0x5d24(0x1cb)](_0x2b694f,_0x3911f1?.[_0x5d24(0x11e)]||_0x2b694f,_0x234763,_0x17f7f5);const _0x57ed35=(0x0,utils_1['getOpenClawJsonPath'])(),_0xa95c2b=safeReadJsonConfig(_0x57ed35)||{};if(!_0xa95c2b[_0x5d24(0x186)])_0xa95c2b['channels']={};const _0x44b4a7=_0xa95c2b['channels'];!_0x44b4a7['feishu']&&(_0x44b4a7['feishu']={'enabled':!![],'dmPolicy':_0x5d24(0x1c9),'groupPolicy':_0x5d24(0xc7),'accounts':{}});const _0x2a5b76=_0x44b4a7[_0x5d24(0x1fb)];!_0x2a5b76[_0x5d24(0xb0)]&&(_0x2a5b76[_0x5d24(0xb0)]={});_0x2a5b76['groupPolicy']=_0x5d24(0xc7);if(!_0x2a5b76['groupAllowFrom'])_0x2a5b76[_0x5d24(0x224)]=[];const _0x480185=_0x2a5b76[_0x5d24(0x224)],_0x34d1e5=[..._0x480185];!_0x480185[_0x5d24(0xf6)](_0x234763)&&(_0x480185['push'](_0x234763),configTracker[_0x5d24(0x1fc)]({'change_type':_0x5d24(0x119),'action':_0x5d24(0xda),'target_path':_0x5d24(0x142),'target_type':_0x5d24(0x92),'old_value':JSON[_0x5d24(0xcd)](_0x34d1e5),'new_value':JSON[_0x5d24(0xcd)](_0x480185),'related_id':_0x234763,'description':_0x5d24(0x7b)+_0x234763}));if(!_0x2a5b76[_0x5d24(0x1cd)])_0x2a5b76[_0x5d24(0x1cd)]={};const _0x4836d3=_0x2a5b76['groups'];_0x4836d3[_0x234763]={'requireMention':!![],'enabled':!![]};if(!_0xa95c2b['bindings'])_0xa95c2b[_0x5d24(0x202)]=[];const _0x413753=_0xa95c2b['bindings'],_0x1df8e1=services_1[_0x5d24(0x1d6)][_0x5d24(0x197)]();console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('[调试]\x20总\x20Agent\x20数:\x20'+_0x1df8e1[_0x5d24(0x137)]));const _0x3e3167=_0x1df8e1[_0x5d24(0x1a8)](_0x4303c1=>_0x4303c1['department_id']===_0x2b694f);console[_0x5d24(0xed)](chalk_1['default']['dim']('[调试]\x20事业部\x20'+_0x2b694f+_0x5d24(0x118)+_0x3e3167[_0x5d24(0x137)]));const _0x16d1c7=_0x1df8e1['find'](_0x50edc5=>_0x50edc5['id']==='assistant_main'||_0x50edc5[_0x5d24(0x21f)]===_0x5d24(0x1b7));console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('[调试]\x20总助理:\x20'+(_0x16d1c7?.['id']||_0x5d24(0x162))));const _0x273b28=[..._0x3e3167];_0x16d1c7&&!_0x273b28[_0x5d24(0x1ba)](_0x166589=>_0x166589['id']===_0x16d1c7['id'])&&_0x273b28[_0x5d24(0x1f7)](_0x16d1c7);console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x220)+_0x273b28[_0x5d24(0x137)]));if(_0x273b28['length']===0x0){console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1e3)](_0x5d24(0x15c))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('请确保该事业部已创建\x20Agent(管理者、审核者、执行者)\x0a')),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}const _0x4789e5=_0x413753,_0x5ef681=_0x4789e5[_0x5d24(0x1a8)](_0x3dff1b=>_0x3dff1b[_0x5d24(0x217)]?.[_0x5d24(0x122)]?.['id']!==_0x234763);for(const _0x250d09 of _0x273b28){const _0x190f04={'agentId':_0x250d09['id'],'match':{'channel':'feishu','peer':{'kind':'group','id':_0x234763}}};_0x5ef681[_0x5d24(0x1f7)](_0x190f04),configTracker[_0x5d24(0x150)](_0x190f04);}_0xa95c2b[_0x5d24(0x202)]=_0x5ef681,console[_0x5d24(0xed)](chalk_1['default']['dim']('[调试]\x20保存配置到:\x20'+_0x57ed35)),fs['writeFileSync'](_0x57ed35,JSON[_0x5d24(0xcd)](_0xa95c2b,null,0x2),_0x5d24(0x144)),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xdd)));const {syncTeamFeishuGroup:_0x15d35c}=await Promise['resolve']()['then'](()=>__importStar(require(_0x5d24(0x8d)))),_0x2874a8=_0x15d35c(_0x2b694f,_0x234763);console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x14f)+_0x2874a8[_0x5d24(0x226)]+_0x5d24(0x10d))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)](_0x5d24(0x20a))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x1ef)+(_0x3911f1?.['name']||_0x2b694f))),console['log'](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x140)+_0x234763)),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x0a绑定的\x20Agent(共\x20'+_0x273b28[_0x5d24(0x137)]+_0x5d24(0xde)));for(const _0x1629f2 of _0x273b28){const _0x4dfac0=_0x1629f2[_0x5d24(0x21f)]===_0x5d24(0x1b7)?_0x5d24(0x1d9):_0x1629f2['role']==='manager'?'[管理者]':_0x1629f2[_0x5d24(0x21f)]===_0x5d24(0x139)?_0x5d24(0xf8):_0x5d24(0xb4);console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x87)+_0x1629f2[_0x5d24(0x11e)]+'\x20'+_0x4dfac0));}console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x74))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x19f))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1b1))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x106))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)]('\x20\x20-\x20在群内\x20@机器人\x20发送消息,绑定的\x20Agent\x20会响应')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x124))),console['log'](chalk_1['default'][_0x5d24(0x1e3)](_0x5d24(0x1c6))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1b6))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1f4))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1a2))),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]('按回车键返回...');}catch(_0x1722f7){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x19a)](_0x5d24(0x21b))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x1f1)+(_0x1722f7 instanceof Error?_0x1722f7[_0x5d24(0xba)]:String(_0x1722f7))+'\x0a')),await index_1[_0x5d24(0x185)]['waitForKey']();}}async function showPairingMenu(){const {execSync:_0x18a22a}=require(_0x5d24(0x1ed));while(!![]){const _0x459d78=readFeishuPairingRequests();console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['bold'][_0x5d24(0x1cf)]('\x0a🔐\x20配对管理\x0a')),console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x104)+getCredentialsDir()+'\x0a'));if(_0x459d78[_0x5d24(0x137)]===0x0){console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x218))),console[_0x5d24(0xed)](chalk_1['default']['dim']('提示:用户在飞书私聊机器人后,会收到配对码\x0a')),await index_1['tuiUtils']['waitForKey']();return;}console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)](_0x5d24(0xf9)+_0x459d78[_0x5d24(0x137)]+_0x5d24(0x1f2))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('配对码'[_0x5d24(0x10b)](0xf))+chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0xe3)[_0x5d24(0x10b)](0x2d))+chalk_1['default'][_0x5d24(0x22d)]('账号')),index_1[_0x5d24(0x185)][_0x5d24(0x8f)]();for(const _0x44012d of _0x459d78){const _0x2998be=_0x44012d[_0x5d24(0x19e)]||'-',_0x59232d=_0x44012d['id']||'-',_0x2b8478=_0x44012d['meta']?.[_0x5d24(0x198)]||_0x44012d[_0x5d24(0x198)]||_0x5d24(0x19b);console[_0x5d24(0xed)](_0x2998be['padEnd'](0xf)+_0x59232d[_0x5d24(0x10b)](0x2d)+_0x2b8478);}console[_0x5d24(0xed)]('');const _0x495abc=[..._0x459d78['map'](_0x3d9296=>{const _0x37bbc6=_0x3d9296[_0x5d24(0x19e)]||'-',_0x24b05b=_0x3d9296[_0x5d24(0x1df)]?.['accountId']||_0x3d9296[_0x5d24(0x198)]||_0x5d24(0x19b);return{'name':'批准:\x20'+_0x37bbc6+'\x20('+_0x24b05b+')','value':{'code':_0x3d9296['code'],'userId':_0x3d9296['id'],'accountId':_0x3d9296[_0x5d24(0x1df)]?.[_0x5d24(0x198)]||_0x3d9296[_0x5d24(0x198)]||'default'}};}),new inquirer_1['default'][(_0x5d24(0x229))](),{'name':'🔄\x20刷新列表','value':_0x5d24(0xe4)},{'name':'🔙\x20返回','value':_0x5d24(0x1bc)}],{action:_0x4a2cdd}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0x1f5),'name':_0x5d24(0x11a),'message':_0x5d24(0xcb),'choices':_0x495abc,'loop':!![]}]);if(_0x4a2cdd===_0x5d24(0x1bc))return;if(_0x4a2cdd===_0x5d24(0xe4))continue;const {code:_0x4e8f40,userId:_0x30eae6,accountId:_0x3e3829}=_0x4a2cdd,_0x3f0e56=_0x5d24(0x1b5)+_0x4e8f40;console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x206)+_0x3f0e56+'\x0a'));try{const _0x424059=_0x18a22a(_0x3f0e56,{'encoding':'utf-8','cwd':(0x0,utils_1[_0x5d24(0x1a4)])()||undefined});console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)](_0x5d24(0x143))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x424059)),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1e3)](_0x5d24(0x1e7))),configTracker[_0x5d24(0x1fc)]({'change_type':_0x5d24(0x103),'action':_0x5d24(0x10f),'target_path':'credentials.feishu.allowFrom.'+_0x3e3829,'target_type':_0x5d24(0xdc),'new_value':JSON[_0x5d24(0xcd)]({'accountId':_0x3e3829,'userId':_0x30eae6}),'related_id':_0x3e3829,'description':'批准飞书配对:\x20'+_0x30eae6+_0x5d24(0x14e)+_0x3e3829});}catch(_0x51e314){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x19a)]('\x0a✗\x20配对授权失败\x0a'));const _0x17da04=_0x51e314 instanceof Error?_0x51e314['stderr']||_0x51e314[_0x5d24(0xba)]:String(_0x51e314);console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x85)+_0x17da04+'\x0a')),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x88))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1b9))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xc2))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xc4))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x20\x20•\x20openclaw\x20命令未安装或不在\x20PATH\x20中\x0a'));}await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();}}async function scanGateways(){const _0x13e9a9=require(_0x5d24(0x1c0)),_0x3ecd79=[],_0x1f398a=[0x7075,0x4965,0x9785,0xbe95],_0x33c882=(0x0,utils_1[_0x5d24(0x16f)])(),_0x50190b=safeReadJsonConfig(_0x33c882),_0x2acb4f=_0x50190b?.[_0x5d24(0xb6)],_0x133a6a=_0x2acb4f?.[_0x5d24(0x138)]||0x7075,_0x4be2d8=_0x2acb4f?.[_0x5d24(0x170)]?.['token'],_0x14e795=[_0x133a6a,..._0x1f398a[_0x5d24(0x1a8)](_0x191847=>_0x191847!==_0x133a6a)];for(const _0x50e1c4 of _0x14e795){const _0x1440a7=await checkGatewayPort(_0x50e1c4);if(_0x1440a7){const _0x1c37fa=_0x50e1c4===_0x133a6a?_0x4be2d8:undefined,_0x2586de=_0x50e1c4===_0x133a6a?'当前配置':'自动发现';_0x3ecd79['push']({'port':_0x50e1c4,'status':'running','token':_0x1c37fa,'source':_0x2586de});}}return _0x3ecd79;}function checkGatewayPort(_0x3b4660){const _0x237bb4=require(_0x5d24(0x1c0));return new Promise(_0x5086b6=>{const _0x37462b=_0x237bb4[_0x5d24(0xb7)]({'hostname':'127.0.0.1','port':_0x3b4660,'path':'/health','method':_0x5d24(0x90),'timeout':0x7d0},_0x5541ef=>{_0x5086b6(_0x5541ef['statusCode']===0xc8);});_0x37462b['on'](_0x5d24(0x1eb),()=>_0x5086b6(![])),_0x37462b['on']('timeout',()=>{_0x37462b[_0x5d24(0xa8)](),_0x5086b6(![]);}),_0x37462b['end']();});}async function selectGateway(){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x112)));const _0x57c94d=await scanGateways();if(_0x57c94d[_0x5d24(0x137)]===0x0)return console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x213))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x153))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x1bf))),null;if(_0x57c94d[_0x5d24(0x137)]===0x1){const _0x5ecd11=_0x57c94d[0x0];console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)]('✓\x20发现\x20Gateway:\x20端口\x20'+_0x5ecd11[_0x5d24(0x138)]+'\x20('+_0x5ecd11['source']+')\x0a'));if(_0x5ecd11[_0x5d24(0x136)])return{'port':_0x5ecd11[_0x5d24(0x138)],'token':_0x5ecd11[_0x5d24(0x136)]};const {token:_0x50eaf5}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0x16b),'name':_0x5d24(0x136),'message':_0x5d24(0x12b)+_0x5ecd11['port']+'):'}]);if(!_0x50eaf5?.[_0x5d24(0xfb)]())return console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x17f))),null;return{'port':_0x5ecd11['port'],'token':_0x50eaf5[_0x5d24(0xfb)]()};}console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('发现\x20'+_0x57c94d['length']+'\x20个活跃的\x20Gateway:\x0a'));const _0x4240e0=_0x57c94d['map'](_0x9f9776=>({'name':_0x5d24(0x154)+_0x9f9776[_0x5d24(0x138)]+'\x20('+_0x9f9776[_0x5d24(0x1e5)]+')'+(_0x9f9776['token']?_0x5d24(0x208):''),'value':_0x9f9776})),{selected:_0x319cd3}=await inquirer_1['default'][_0x5d24(0x169)]([{'type':_0x5d24(0x1f5),'name':_0x5d24(0x196),'message':_0x5d24(0x1d7),'choices':_0x4240e0,'loop':!![]}]);if(_0x319cd3[_0x5d24(0x136)])return{'port':_0x319cd3[_0x5d24(0x138)],'token':_0x319cd3[_0x5d24(0x136)]};const {token:_0x21cf8a}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0x16b),'name':_0x5d24(0x136),'message':_0x5d24(0x12b)+_0x319cd3[_0x5d24(0x138)]+'):'}]);if(!_0x21cf8a?.[_0x5d24(0xfb)]())return console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x17f))),null;return{'port':_0x319cd3[_0x5d24(0x138)],'token':_0x21cf8a[_0x5d24(0xfb)]()};}class GatewayClient{[_0x5d24(0xb6)]=null;[_0x5d24(0x7a)](_0x5481d1){this[_0x5d24(0xb6)]=_0x5481d1;}async['init'](){if(this[_0x5d24(0xb6)])return!![];const _0xfceb77=await selectGateway();if(!_0xfceb77)return![];return this[_0x5d24(0xb6)]=_0xfceb77,!![];}async[_0x5d24(0x15b)](_0x2ce015,_0x2a04e8={}){if(!this[_0x5d24(0xb6)])return{'success':![],'error':_0x5d24(0x199)};const _0x423699=this[_0x5d24(0xb6)],_0x3f4dd=require('ws'),_0x5cc0b6=_0x5d24(0xa1)+_0x423699[_0x5d24(0x138)]+_0x5d24(0x1d8),_0x35fc75=_0x5d24(0x1e0)+_0x423699[_0x5d24(0x138)];return new Promise(_0x1d114d=>{const _0x4c0b61=new _0x3f4dd(_0x5cc0b6,{'headers':{'Origin':_0x35fc75}});let _0xcbd9cf=![];const _0x5c0d23='connect_'+Date[_0x5d24(0xf1)](),_0x3260fa='method_'+Date[_0x5d24(0xf1)](),_0x57976b=setTimeout(()=>{!_0xcbd9cf&&(_0xcbd9cf=!![],_0x4c0b61['close'](),_0x1d114d({'success':![],'error':_0x5d24(0x1f0)}));},0x3a98);_0x4c0b61['on'](_0x5d24(0x200),()=>{}),_0x4c0b61['on']('message',_0x2ba144=>{try{const _0x4e08e6=JSON[_0x5d24(0x94)](_0x2ba144[_0x5d24(0xef)]());if(_0x4e08e6[_0x5d24(0x135)]===_0x5d24(0xbf)&&_0x4e08e6[_0x5d24(0xbf)]===_0x5d24(0xa0)){_0x4c0b61['send'](JSON[_0x5d24(0xcd)]({'type':_0x5d24(0x1b2),'id':_0x5c0d23,'method':_0x5d24(0x73),'params':{'minProtocol':0x3,'maxProtocol':0x3,'client':{'id':_0x5d24(0x221),'version':_0x5d24(0x9d),'platform':process[_0x5d24(0x7d)],'mode':'ui'},'role':_0x5d24(0x75),'scopes':[_0x5d24(0x16e)],'auth':{'token':_0x423699[_0x5d24(0x136)]}}}));return;}if(_0x4e08e6[_0x5d24(0x135)]===_0x5d24(0xdf)&&_0x4e08e6['id']===_0x5c0d23){if(_0x4e08e6['ok'])_0x4c0b61[_0x5d24(0x215)](JSON[_0x5d24(0xcd)]({'type':_0x5d24(0x1b2),'id':_0x3260fa,'method':_0x2ce015,'params':_0x2a04e8}));else{clearTimeout(_0x57976b),_0xcbd9cf=!![],_0x4c0b61[_0x5d24(0x177)]();const _0x5a36a7=_0x4e08e6[_0x5d24(0x1eb)]?.[_0x5d24(0xba)]||_0x4e08e6[_0x5d24(0x1eb)]?.[_0x5d24(0x1db)]||JSON['stringify'](_0x4e08e6[_0x5d24(0x1eb)]);_0x1d114d({'success':![],'error':'认证失败:\x20'+_0x5a36a7});}return;}if(_0x4e08e6[_0x5d24(0x135)]===_0x5d24(0xdf)&&_0x4e08e6['id']===_0x3260fa){clearTimeout(_0x57976b),_0xcbd9cf=!![],_0x4c0b61['close']();if(_0x4e08e6['ok'])_0x1d114d({'success':!![],'result':_0x4e08e6[_0x5d24(0x113)]||_0x4e08e6[_0x5d24(0x10e)]});else{const _0x51e8fb=_0x4e08e6[_0x5d24(0x1eb)]?.['message']||_0x4e08e6[_0x5d24(0x1eb)]?.[_0x5d24(0x1db)]||JSON[_0x5d24(0xcd)](_0x4e08e6[_0x5d24(0x1eb)]);_0x1d114d({'success':![],'error':_0x51e8fb});}return;}}catch(_0x2993dd){}}),_0x4c0b61['on']('error',_0x44297b=>{clearTimeout(_0x57976b),!_0xcbd9cf&&(_0xcbd9cf=!![],_0x1d114d({'success':![],'error':'WebSocket错误:\x20'+_0x44297b[_0x5d24(0xba)]}));}),_0x4c0b61['on'](_0x5d24(0x177),(_0x384128,_0x49db46)=>{clearTimeout(_0x57976b);if(!_0xcbd9cf){_0xcbd9cf=!![];const _0x47c1be=_0x49db46[_0x5d24(0xef)]()||_0x5d24(0xce)+_0x384128;_0x1d114d({'success':![],'error':_0x5d24(0x1aa)+_0x47c1be});}});});}[_0x5d24(0x1c8)](){if(!this[_0x5d24(0xb6)])return{'needsConfig':![],'message':''};const _0x322345=(0x0,utils_1[_0x5d24(0x16f)])(),_0x2c5f5c=safeReadJsonConfig(_0x322345);if(!_0x2c5f5c)return{'needsConfig':!![],'message':'无法读取配置文件'};const _0xe0e0af=_0x2c5f5c[_0x5d24(0xb6)],_0x54214e=_0xe0e0af?.['controlUi'];if(_0x54214e?.['allowInsecureAuth']!==!![])return{'needsConfig':!![],'message':'需要在\x20openclaw.json\x20中添加以下配置:\x0a\x0a\x20\x20\x22gateway\x22:\x20{\x0a\x20\x20\x20\x20\x22controlUi\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22allowInsecureAuth\x22:\x20true\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a或者配置允许的\x20origin:\x0a\x0a\x20\x20\x22gateway\x22:\x20{\x0a\x20\x20\x20\x20\x22controlUi\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22allowedOrigins\x22:\x20[\x22http://127.0.0.1:'+this[_0x5d24(0xb6)][_0x5d24(0x138)]+_0x5d24(0x12a)};return{'needsConfig':![],'message':''};}async[_0x5d24(0x9f)](){const _0x5e2719=await this[_0x5d24(0x15b)]('node.pair.list',{});if(!_0x5e2719['success'])return{'success':![],'error':_0x5e2719['error']};const _0x5b80dc=_0x5e2719[_0x5d24(0x113)];return{'success':!![],'pending':_0x5b80dc[_0x5d24(0x1c1)]||[]};}async[_0x5d24(0x18c)](_0x4874db){const _0x36e5be=await this[_0x5d24(0x15b)](_0x5d24(0x156),{'requestId':_0x4874db});if(!_0x36e5be['success'])return{'success':![],'error':_0x36e5be[_0x5d24(0x1eb)]};return{'success':!![]};}}const gatewayClient=new GatewayClient();function getCredentialsDir(){const _0xd29372=require(_0x5d24(0x17a)),_0x30eb51=require('os'),_0x5a494e=(0x0,utils_1[_0x5d24(0x1a4)])();if(_0x5a494e)return _0xd29372[_0x5d24(0x209)](_0x5a494e,_0x5d24(0xdc));const _0x8c7c43=(0x0,utils_1['getOpenClawJsonPath'])();if(_0x8c7c43){const _0x37163d=_0xd29372['dirname'](_0x8c7c43);return _0xd29372[_0x5d24(0x209)](_0x37163d,'credentials');}if(process[_0x5d24(0xd9)]['OPENCLAW_CREDENTIALS_DIR'])return process[_0x5d24(0xd9)]['OPENCLAW_CREDENTIALS_DIR'];if(process[_0x5d24(0xd9)]['OPENCLAW_STATE_DIR'])return _0xd29372[_0x5d24(0x209)](process[_0x5d24(0xd9)][_0x5d24(0x9e)],_0x5d24(0xdc));return _0xd29372[_0x5d24(0x209)](_0x30eb51[_0x5d24(0x16d)](),_0x5d24(0xec),_0x5d24(0xdc));}function getFeishuPairingFilePath(){const _0x18b78b=require('path');return _0x18b78b[_0x5d24(0x209)](getCredentialsDir(),'feishu-pairing.json');}function readFeishuPairingRequests(){const _0x581196=getFeishuPairingFilePath();if(!fs[_0x5d24(0x227)](_0x581196))return[];try{const _0x29f287=fs[_0x5d24(0x18f)](_0x581196,_0x5d24(0x144)),_0x1bd9da=JSON[_0x5d24(0x94)](_0x29f287);return _0x1bd9da[_0x5d24(0xbd)]||[];}catch{return[];}}function approveFeishuPairing(_0x20b961,_0x285016){const _0x9181a1=getCredentialsDir(),_0xa9e984=getFeishuPairingFilePath();console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x104)+_0x9181a1)),console[_0x5d24(0xed)](chalk_1['default']['dim'](_0x5d24(0x1ec)+_0xa9e984));if(!fs[_0x5d24(0x227)](_0xa9e984))return{'success':![],'error':'配对请求文件不存在'};try{const _0x518cd7=fs[_0x5d24(0x18f)](_0xa9e984,_0x5d24(0x144)),_0x5084d7=JSON['parse'](_0x518cd7),_0x43e758=_0x5084d7['requests']||[];console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x100)+_0x43e758[_0x5d24(0x137)]));const _0xb9edd4=_0x43e758[_0x5d24(0xee)](_0x583b79=>_0x583b79['code']&&_0x583b79[_0x5d24(0x19e)]['toUpperCase']()===_0x20b961[_0x5d24(0x1ae)]());if(_0xb9edd4<0x0)return{'success':![],'error':_0x5d24(0x8e)+_0x20b961+_0x5d24(0x134)};const _0x474b05=_0x43e758[_0xb9edd4];console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0xa3)+_0x474b05['id'])),_0x43e758[_0x5d24(0xb5)](_0xb9edd4,0x1),_0x5084d7[_0x5d24(0xbd)]=_0x43e758;!fs[_0x5d24(0x227)](_0x9181a1)&&fs[_0x5d24(0x1d4)](_0x9181a1,{'recursive':!![]});fs['writeFileSync'](_0xa9e984,JSON[_0x5d24(0xcd)](_0x5084d7,null,0x2),_0x5d24(0x144)),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1ad)));const _0x3fee6e=_0x474b05[_0x5d24(0x1df)]?.['accountId']||_0x474b05[_0x5d24(0x198)];let _0xa54910;if(_0x285016&&_0x285016!==_0x5d24(0x19b))_0xa54910=_0x285016;else _0x3fee6e?_0xa54910=_0x3fee6e:_0xa54910=_0x5d24(0x19b);console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1ee)+_0xa54910));const _0x42b8a9=_0x474b05['id'],_0x1837c2=['feishu-allowFrom.json',_0x5d24(0x15f)+_0xa54910+_0x5d24(0xac),_0x5d24(0x166)];for(const _0x2125ec of _0x1837c2){const _0x43252d=path[_0x5d24(0x209)](_0x9181a1,_0x2125ec);let _0x5a2a3c=[];if(fs[_0x5d24(0x227)](_0x43252d))try{_0x5a2a3c=JSON[_0x5d24(0x94)](fs[_0x5d24(0x18f)](_0x43252d,'utf-8'))||[];}catch{_0x5a2a3c=[];}!_0x5a2a3c['includes'](_0x42b8a9)&&(_0x5a2a3c[_0x5d24(0x1f7)](_0x42b8a9),fs[_0x5d24(0x7e)](_0x43252d,JSON[_0x5d24(0xcd)](_0x5a2a3c,null,0x2),_0x5d24(0x144)),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('已写入:\x20'+_0x2125ec)));}return configTracker[_0x5d24(0x1fc)]({'change_type':_0x5d24(0x103),'action':_0x5d24(0x10f),'target_path':_0x5d24(0x152)+_0xa54910,'target_type':_0x5d24(0xdc),'new_value':JSON[_0x5d24(0xcd)]({'accountId':_0xa54910,'userId':_0x42b8a9}),'related_id':_0xa54910,'description':_0x5d24(0x18e)+_0x42b8a9+_0x5d24(0x14e)+_0xa54910}),{'success':!![],'userId':_0x42b8a9,'targetAccountId':_0xa54910};}catch(_0x3c78bc){return{'success':![],'error':_0x3c78bc instanceof Error?_0x3c78bc['message']:String(_0x3c78bc)};}}async function listPairingRequests(){console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x1a1))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim']('凭证目录:\x20'+getCredentialsDir()+'\x0a'));const _0x31eba5=readFeishuPairingRequests();if(_0x31eba5[_0x5d24(0x137)]===0x0)console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)]('暂无待批准的配对请求\x0a')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x182)));else{console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)](_0x5d24(0xf9)+_0x31eba5[_0x5d24(0x137)]+_0x5d24(0x1f2))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x155)['padEnd'](0xf))+chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xe3)['padEnd'](0x2d))+chalk_1[_0x5d24(0x19b)]['dim']('账号')),index_1[_0x5d24(0x185)][_0x5d24(0x8f)]();for(const _0x2a785e of _0x31eba5){const _0x4228b9=_0x2a785e[_0x5d24(0x19e)]||'-',_0x83427=_0x2a785e['id']||'-',_0x389c2e=_0x2a785e[_0x5d24(0x198)]||_0x2a785e[_0x5d24(0x1df)]?.[_0x5d24(0x198)]||_0x5d24(0x19b);console[_0x5d24(0xed)](_0x4228b9[_0x5d24(0x10b)](0xf)+_0x83427[_0x5d24(0x10b)](0x2d)+_0x389c2e);}console[_0x5d24(0xed)]('');}await index_1['tuiUtils'][_0x5d24(0xa4)]();}async function approvePairingRequest(){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)][_0x5d24(0x1cf)](_0x5d24(0x20f))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['bold']('🔐\x20飞书配对授权')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)][_0x5d24(0x1cf)](_0x5d24(0x12d))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1a5))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x104)+getCredentialsDir()+'\x0a'));const {pairingCode:_0x41469d}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0xe5),'name':_0x5d24(0xd7),'message':_0x5d24(0xab)}]);if(!_0x41469d||!_0x41469d['trim']()){console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x0a已取消\x0a')),await index_1[_0x5d24(0x185)]['waitForKey']();return;}const _0x13c22f=_0x41469d[_0x5d24(0xfb)]()[_0x5d24(0x1ae)]();console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x0a正在批准配对码:\x20'+_0x13c22f+_0x5d24(0xb3)));const _0x59c07c=approveFeishuPairing(_0x13c22f);_0x59c07c['success']?(console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)](_0x5d24(0x143))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xa3)+_0x59c07c['userId'])),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xff)+_0x59c07c[_0x5d24(0xe1)]+'\x0a')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['yellow'](_0x5d24(0x1e7)))):(console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x19a)](_0x5d24(0x148))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('错误:\x20'+(_0x59c07c[_0x5d24(0x1eb)]||_0x5d24(0x117))+'\x0a')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('可能原因:')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x1b9))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xc2))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim']('\x20\x20•\x20凭证目录配置不正确\x0a'))),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();}function _0x5d24(_0x36ea3d,_0x28be9a){_0x36ea3d=_0x36ea3d-0x72;const _0x3b642c=_0x3b64();let _0x5d2499=_0x3b642c[_0x36ea3d];if(_0x5d24['cvrXVm']===undefined){var _0x3fc32d=function(_0x2fb205){const _0x2dea6a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x155b34='',_0x1f89eb='';for(let _0xc117e8=0x0,_0x38376c,_0x1d61bd,_0x39672f=0x0;_0x1d61bd=_0x2fb205['charAt'](_0x39672f++);~_0x1d61bd&&(_0x38376c=_0xc117e8%0x4?_0x38376c*0x40+_0x1d61bd:_0x1d61bd,_0xc117e8++%0x4)?_0x155b34+=String['fromCharCode'](0xff&_0x38376c>>(-0x2*_0xc117e8&0x6)):0x0){_0x1d61bd=_0x2dea6a['indexOf'](_0x1d61bd);}for(let _0x4e792d=0x0,_0x53c067=_0x155b34['length'];_0x4e792d<_0x53c067;_0x4e792d++){_0x1f89eb+='%'+('00'+_0x155b34['charCodeAt'](_0x4e792d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1f89eb);};_0x5d24['OdDUKs']=_0x3fc32d,_0x5d24['gKNGzO']={},_0x5d24['cvrXVm']=!![];}const _0x57da56=_0x3b642c[0x0],_0x3b0d53=_0x36ea3d+_0x57da56,_0x316558=_0x5d24['gKNGzO'][_0x3b0d53];return!_0x316558?(_0x5d2499=_0x5d24['OdDUKs'](_0x5d2499),_0x5d24['gKNGzO'][_0x3b0d53]=_0x5d2499):_0x5d2499=_0x316558,_0x5d2499;}function _0x3b64(){const _0x53ca79=['Cgf0Aa','AM9Ix2LK','DxbKyxrLtMfTzq','8j+tIYdMN6xNNiVLT7lPHy3NVA7NMOqGqwDLBNqGqM90iowiL+IHQcaO','zMvPC2H1qM91BMq','cUACQUI+K+wfPsbuB2TLBU+8Jow3SUwpLUA2IaO','5B2t5yMn57Ur5A6A5l+H5OgV77YA','Dw5IAw5KvxnLCG','5O+q56s677YA6k6P55sO5OI35zYO6AoE5lMM56Eb6igk5PY65zMO5lQ677Ym5PY65zMO5lQ65lYA6l+u5zUE6ywn5A+556cbcG','y2HLy2TIB3G','5PQc5PEG5lQl5lIA6yoO77Ym6k+35ywi5yIB5BU65lQl5lIA6yoOcG','DhvPvxrPBhm','y2HHBM5LBhm','CM9SzurPC3bSyxK','4P6vios4UIbbz2vUDcdMT7VLIQdPO57KUAyGqM90','6ywn572U6AoE5lMM6lsM5y+3oIa','Dw5RBM93BG','x19PBxbVCNrtDgfY','yxbWCM92zvbHAxjPBMC','x19LC01VzhvSzq','5OM55yEg6AoE5lMM6ywn5A+5oIa','CMvHzezPBgvtEw5J','zgvMyxvSDc10B2TLBG','zMLUzej5swq','icaGih0','ntC1mJm4s29buNDh','y2fSBa','cUkCLYdOP6pNU5hLPlhOTkuk','C2vSzwn0zwq','BgLZDefSBa','ywnJB3vUDeLK','r2f0zxDHEsdMNkRPHy3NVA4','CMvK','zgvMyxvSDa','icaGig9Wzw5JBgf3igDHDgv3yxKGCMvZDgfYDaO','y29UzMLYBq','y29Kzq','icaTigDYB3vWug9SAwn5oIbHBgXVD2XPC3tVViJKU4xLHyhORRJNU5hLRPRNMOtNVQtVViK','y2HHBM5LBa','cUATO+wCQoAFPEIVOUMfJEwVUEIVT+AXGI4UlGO','icaGiowqR+wkQowrVEs7PdOGB3bLBMnSyxCGz2f0zxDHEsbYDw4k','C2HVD0zLAxnODunVBMzPz01LBNu','z2v0t3bLBKnSyxDsB290','55sO5OI35zYO6AoE5lMM56Eb6igk5PY65zMO5lQ65zco77Ym5lYA5Ps25yIW6ywn5A+556cb44cccG','zMLLBgrZ','zw5HyMXLza','zMLSDgvY','5Q2L6AQKidlVVjRLKk/NLkJMNlRLMAJKURROG73LIPS','6l+E5O6L5BEY5ywZ6zEToIa','8j+uMsdLJ5BMTOG','qxbWieLeioAGVow8J+MuMEIVR++8Jow6Los7PsbJBgLFiow8GowKTa','5BEY5lUo6ywn5A+55yIx6kgO56E76zMK6ywn5A+556cb','Dg9vChbLCKnHC2u','5lQl5lIA6yoO','5PYQ5OYh5A6A','icaTihjLCxvPCMvnzw50Aw9UoIb0CNvL77Yi6zYa6kAbieaG5PY65zMO5lQ65OMn6io96kEM5y+r77Yj','CMvX','mZa1mtC2mNPjDfnOva','CgfPCMLUzYaTioMCGoMfJEwVUEAjUEwhHU+8IoAoQoInKo+8JoACGowUIEwfQo+8Iq','B3bLBMnSyxCGCgfPCMLUzYbHChbYB3zLigzLAxnODsa','icaGideUiowfS+MxREw9K+wjJEI/KoIHJoEAHcbhyxrLD2f577Yiq3rYBcTd77Yj','yxnZAxn0yw50','icaGicaGicaIAw06CMvZB3vYy2uI','icdIGkiG6ywn5A+556cb5PEG5Pwi5OIw5BEY6l+h5PYF','zMLUza','6k+36l6t5ywL55sO5OI35zcn77YA','yMfJAW','z3jLzw4','nJKYn3jXBNnoqG','icbVCgvUy2XHDYbNyxrLD2f5cG','Ahr0Ca','CgvUzgLUzW','Aw5MBW','5B2t5yMn5BEY57Ur5A6A77YA','sLnptIdOP6pMNPdPLjNOR686','qwDLBNqGsuq','cUkAOo+4JYaG6k+36yEn5zcVieDHDgv3yxKG5l2/6ywn572U55sF5Pwi','8j+rPcdNLkJMIlFPO57KUABNU5hLRPO','y2HLy2ThyxrLD2f5q29UzMLN','CgfPCMLUzW','CgfPCMLUzYaTioMCGoMfJEwVUEAjUEwhHG','CMvJB3jKrMvPC2H1r3jVDxbcAw5K','cUkCLYdNU5hLRPRLPlhOTkuk','z3jVDxbZ','lI4VAw5KzxG','y3LHBG','CMvZB2X2zq','icdIGkiG6l+B5ywL44cm54Mi5PYS566H55cg5lIo5y+r5BId44cn6Ag16z2I','mJq0nte1A0Pzsfvp','cUkCKYdLT7lKUlOGqwDLBNqGiG','BwTKAxjtEw5J','BwfW','ywDLBNrtzxj2AwnL','6ycj5OUP6kAb5l2/55sO55QeieDHDgv3yxNVVjO','l3DZ','w+AaU+wkQEEqHL0','zMvPC2H1x2DYB3vWx2LK','Dgv4Da','5Q2L6AQKidtVVjRPHy3NVA7KUOVKU7BORQlPMiu','z2v0','yM90tMfTzq','Bwv0yq','Ahr0CdOVlZeYnY4WlJaUmtO','5A6H5Qc46icf','zg1qB2XPy3K','EwvSBg93','8j+uMsdOV5tLM57KUlVOJ5ZLJzu','C291CMnL','cVcFLjCG57Ur5A6A6AoE5lMM576K5yIW5lQl5lIA6yoOcG','5O+q56s677YA55sO5OI3546W5zYO5y+V5lUL5zYO6AoE5lMM5lIT5lIo5PY65zMO5lQ65A+56k+D44cccG','zwrPDa','icdNP4hOGyRNRzBNLAu6ia','Dw5IAw5KrMvPC2H1','zxjYB3i','6ywn5A+55PAh5lU2oIa','y2HPBgrFChjVy2vZCW','55UU5Qch6lsM5OI3oIa','5lQl5lIA6yoOoIa','6l+E5O6L6lAf5PE2','6zsz6k+VoIa','ios4QU+8IE+8MGO','cVcFKAqG55sO5OI36AoE5lMM57Ur5A6A54Q25OcbcG','icaGidiUioMhJEAwSowqR+wkQcbhyxrLD2f5','BgLZDa','icaGicaGicaIAw06BwvZC2fNzs5NCM91Cf9HDf9TC2C6CMvHzg9UBhKIla','ChvZAa','C2HVD1vZzxjcAw5KAw5N','cUkCKYdPHy3NVA7LT7lMM7tMLRak','y2HHCKnVzgvbDa','zMvPC2H1','CMvJB3jKq29UzMLNq2HHBMDL','cUAAGUAxOow3SUMfJEE9RUEAHoMJNUs5PIbcB3qk','55sO5OI35l+H5OgV77YA','icdIGkiG5BYa5zcV44cm5l2/55sO6zw/6l+E5O6L5O6L5Ps25lQl5lU244cn5BYa5ywZcG','B3bLBG','5Q2L6AQKidpVVjRPHy3NVA7LUPtNLkJMNypPMza','yMLUzgLUz3m','ihWG','icbODhrWCZOVl3D3DY5MzwLZAhuUy24Vy29UDgvUDc9HCNrPy2XLlZC2mdi1mtKYmZK0ndu5nZqYmduk','zw50CMLLCW','cUAjP+IHJowrVEs7PdOG','icdIGkiG6l+B5ywL6AoE5lMM5BYa5Ps+5BMZ5y+W77YAAhr0Chm6lY9VCgvUlMzLAxnODs5JBI9HCha','ifVLT7lPHy3NVA5uB2TLBL0','AM9PBG','cUkCKYdPO57KUABNVQtLT7lNU5hLRPOk','5Oc75yQP55cg5Bcg5PEG5Rov6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G44cc','z2v0qNLjza','ndG5otuWB3Lvwg56','zgLZywjSzwqGlsdNPOhNLkJNP4hOGyO','cUkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGq','ywDLBNrjza','icdIGkiG5BYa5zcV44cm5l2/55sO6zw/6l+E5O6L5O6L5Ps25lQl5lU244cn5BYa5ywZ','8j+tLIdLPOlKVzxOJRFLJ5BPO57KUAyGt3bLBIbjro+8MGO','5PYQ5y+r546W5Rs76lEd55QeieDHDgv3yxKk','ChjPBNrfCNjVCG','C2vUza','6AoE5lMM57Ur5A6A54Q25OcboIdLT7lNU5hLRPO','Bwf0y2G','5PQc5PEG5B6f5OM55yEg55Qe6ywn5A+56k+35RgccG','BgLZDeDYB3vWCW','yMLUzezLAxnODq','cUkCLYdNU5hLRPRLPlhOTku','56gU6k6K6kEJ57Ur6AoE5lMM6lsM5y+377YF','icdMJ5dNPlRVVjRLJ6/MOlNMJA7LRP7PMyxPNidMSylMT7VLIQdMM7tLPjRMNypPMzak','8j+pOIdPO57KUABNVQtNU5hLRPO','CM9Szq','w+IWG+IVLv0G5PYa57Ui57Ur5A6AiefNzw50ioAvSdOG','B3bLBMnSyxCTy29UDhjVBc11Aq','icaZlIdLPi3LIlyGt3bLBIbjro+8Ig91x3H4EcdMOlZLVi/VViK','z2v0vxnLCKLUzM8','z3jVDxbbBgXVD0zYB20','icaYlIdMIB7LIldNM67MOiFNLkJMIlFVViZMN6xNNiVNLkJMIlFOR6BMG4u','DxbKyxrLzenVDw50','zxHPC3rZu3LUyW','B3zLCNDYAxrL','u2vWyxjHDg9Y','5PIV5zcM6kAb6kAg55Uw546W5PYj57Ur5A6A77YF','5PIV5zcM5PU05PAW55sO5OI35zcn77YF','6ycj5OUP6kAb5l+U5Ps555Qe5yAf5A6577YA','zgLT','55Ur5O6N6icf','y29UBMvJDa','cUE+PoE7HoIUV+MxRUMfJEE9RJO','B3bLCMf0B3i','lI4VlI4VlI4Vy29Yzs9Zzxj2AwnLCY9JB25MAwCTDhjHy2TLCI5Zzxj2AwnL','8j+uLYdNU5hLRPRNLkJMIlFPO57KUAyGt3bLBIbjra','yxbWswq','icdIGkiG6l+B5ywL44cm5P2d6zMq566H55cg44cn4OAsioEcUEwhU+oaJoAjUEMhJ+wVVowfPEoaJq','C2v0r2f0zxDHEq','5RE75yQG576K5yIW55M95zcn5y2voIa','cUkCJ++4JYaG5l+U5Ps5iefNzw50ioEAHoMJNUs5PUMfJEE9RGO','CgXHDgzVCM0','D3jPDgvgAwXLu3LUyW','6ycj5OUP6kAb5l+U5Ps555QeiefNzw5077YA','A2LUza','cUIVT+I+K+wfPEMJNUs5PUw8GoAuVUw5S+wpSoEAHow6LoEuQowhREIVGE+8MG','lI4VlI4VlI4VzgiVCMvWB3nPDg9YAwvZl2rLChqUCMvWBW','icaGicaGxq','6ywn572U6k+75y+w5AsX6lsL','6zsz6k+V5l+H5OgVoIa','8j+tIYdMN6xNNiVPO57KUABNVQtNU5hLRPRLIjFOOAG','icaTia','5y+V6io95y6F5zUG77YA','cUkAOo+4JYdPHy3NVA7MLOFKU7BMM7tMLRdLPlhOTkxVViZOR7FMIyVLIQJMT7VLIQaGyMLUzgLUz++8MG','AM9IuMvWB3nPDg9YEq','5Oc75yQP55cg','4PQG77IpioITPUwrIU+8MUwiOoMzPowqJUIVPsbbz2vUDcdNMOtPO57KUAyGqM90iowWHUAxOoAZLEs9V+EuQaO','lI4VlI4VlI4Vy29Yzs91DgLSCY9VCgvUy2XHDY1OzwXWzxi','6ywn5A+556cbici','ChjPBNreAxzPzgvY','r0vu','8j+uKYdOP6pNU5hNLkJMIlFPO57KUAy','y2HHBM5LBhmUzMvPC2H1','cUkAOo+4JYaG6k+36yEn5zcVieDHDgv3yxKG5l2/6AoE5lMM6zw/6l+E5O6L5PAT5BYa77YA','CgfYC2u','5Q2L6AQKidxVVjRPHy3NVA7MTOJMGA/LJAhNIyFLM57OSim','6AoE5lMM576Ksuq','z3jVDxbjza','4PYp77IpicdKV67MLlKGqwDLBNqG55Qe6AoE5lMM6ywn572U','AxnbCNjHEq','CMvWBgfJzq','56gU6k6K5yIG6zMK6k+L6AoE5lMMiejVDcdPHy3NVA7VVj8','AgfZt3DUuhjVCgvYDhK','ms4WlJa','t1bftKnmqvDFu1rbvevFreLs','BgLZDfbHAxjPBMDszxf1zxn0CW','y29UBMvJDc5JAgfSBgvUz2u','D3m6lY8XmJCUmc4WlJe6','cVcFLjCG57Ur5A6A55sO5OI36AoE5lMMie9Wzw4Gsuqk','55sO5OI3suq6ia','D2fPDezVCKTLEq','icdIGkiG5l2/55sO5PYS5BEL5yw344cm6ywn5A+5566H55cg44cn6l6t5ywL6ywn5A+556cb5A6m5OIq5O6i5P2dcG','6k+36l6t5ywL6AoE5lMM576KsutVViHVy194EhGG5Qc85BYp77Yj77YA','zgLZywjSzwq','zgvZDhjVEq','AM9ItMfTzq','6AoE5lMM57Ur5A6A54Q25OcboIdMNkRNU5hLRPO','6k+36l6t5ywL6ywn5A+556cb77Yi55wz56M65y+w5RAi77Yj77YA','lwfSBg93rNjVBs5QC29U','5Oc75yQP55cg5y+V5lUL6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G5lU75yQH5A6m5OIq5Oof5yA144cc','ntuWmJmZmhHPA2jIzW','5yIB5BU66AoE5lMM5RIG6ygt6ywn572U','ywnJB3vUDhm','D2vIC29JA2v0','5PQc5PEGiefNzw5077Ym6k+35ywi5yIB5BU6iefNzw50','lI4UcG','w+AjP+IHJoIaHv0','C3bSAwnL','z2f0zxDHEq','CMvXDwvZDa','ChjPBNrxyxjUAw5N','ifVLT7lNU5hLRPO6ia','BwvZC2fNzq','icdIGkiG5Asn5yI2iefWCcbjrcdLKOWGqxbWifnLy3jLDaO','5l2/55sOiUs4UIbbz2vUDcdMT7VLIQdPO57KUAyGqM90iUI/M+IHJoMfJEE9RGO','CMvXDwvZDhm','ksaTia','zxzLBNq','5B2t5yMn5PYQ57Ur5A6A6AoE5lMM6lsM5y+3cG','zgvSzxrL','icdIGkiG6ywn5A+556cb5BEY6kkR5l2/55sO','qM90iowqJEENSa','icdIGkiGr2f0zxDHEsdMNkROV5dOOyW','5OMN6kgm6icf','cUw9K+wjJEMfJEE9RU+8MG','ywXSB3DSAxn0','DxnLCLnLCNzPy2u','icaXlIdNLkJMIlFLNkJPO57KUABNP4hOGyRMNlRLMAJKURO','icaGicaGicaIy29UDgfJDdP1C2vYlMjHC2u6CMvHzg9UBhKIla','6k+36ycj5OUP5Pon5l2C77YA','8j+tIYdMN6xNNiVNLkJMIlFPO57KUABNU5hLRPRNIRBMGie','C3rYAw5NAwz5','y29Kzt0','5PAW55QeiefWCcbtzwnYzxtVVjO','z2v0t3DUuhjVCgvYDhLoyw1LCW','icaXlIdOV5VLHAxPO57KUABNRQhNKiBLKi7LJ7aGpIdMIjdLKzJNRQhNKiy','y29UzMLNDxjHyMXL','mZaYoerWyLP0va','lI4VlI4VlI4Vy29Yzs91DgLSCW','56Eb6igk562w55wL','zgvWDe5HBwu','CgfPCMLUz0nVzgu','5Q2L6AQKidFVVjROJRFLJ5BLH63OR4e','zw52','DxbKyxrL','8j+tSsdPO57KUAyGqM90ioMfJEE9RG','y3jLzgvUDgLHBhm','w+IWG+IVLv0G6ywn572U5BEY5l+D5A2y','ios4QU+8ItO','CMvZ','CMvTB3zL','DgfYz2v0qwnJB3vUDeLK','yMLUzgLUz19KzwXLDgu','55sO5OI3suq','CMvMCMvZAa','Aw5WDxq','x19PBxbVCNrezwzHDwX0','icbby2nVDw50ieLeoIa','zgvWyxj0BwvUDf9Pza','icdNLkJMIlDjrdOG','4PQG77IpioMCGoIMGEMhJEwqRYbhyxrLD2f5ios9V+MfJEE9RUEuN+AvIo+8MG','y3jLyxrL','lM9Wzw5JBgf3','Bg9N','zMLUzeLUzgv4','Dg9tDhjPBMC','5Q2L6AQKidBVVjRLIjVLU7RNIyJMNkZLUBBLJ5hLUim','BM93','qxbWieLeicHJBgLFEhH4ioAGVow8JYNVVjO','mZy5mJeYmK5SBgngua','cUkCKYdPO57KUAyGqM90ioMfJEE9RUw3SUwiOoMzPa','5yIG6zMK6AoE5lMM6lsM5y+36ywn572UoIa','Aw5JBhvKzxm','cUACQUwbMUs7U+s9LEs/RUAuUqO','w+wUOEAGUoIaHv0','5B6f5OM55yEg55Qe6ywn5A+56k+35Rgc77Yi5ywXia','icb9cG','DhjPBq','Bg9VCgjHy2S','5Q2L6AQKidhVVjRLKk/LIQGGr2f0zxDHEq','8j+tLIdOR6BNU4BMLzNNQiVVVjO','6lsM5y+3oIa','5B2t5yMn6k+35Rgc5PwWoIa','icdIGkiG54k55yE744cm5yIB5BU654Mi5PYS44cn77Ym5AgR5yAz54Mi5PYS5y+35zkm5PU05PAW6k+05PIo','qxbWifnLy3jLDo+8IoMhJEAwSoI+K+wfPE+8Iq','zMvPC2H1x3bHAxjPBMDFyxbWCM92zq','5yET6k+b55UU5B2voIa','DgHLBG','cUs9V+EuQoIVToAyJJO','icbbChaGsuq6ia','5Q2L6AQKidlVVjRNLkJMIlFPHy3LR7K','B2nF','yM9Sza','CgfKrw5K','icdIGkiG55sO5OI35zYO6AoE5lMM5PcC57sI5BM25RE75yQG5PY65zMO5lQ6','ios4QIbbz2vUDcdNMOtPO57KUABNVQtKV6hMGA8','Cgf5Bg9Hza','ywrK','cUkCKYdPO57KUABOTkBLJ7FNU5hLRPRMIjdLIP/VViek','yMLUzfvZzxi','cUATO+wCQoAjQ+ApJ+A0U+I3G+EAHcbhyxrLD2f5lI4UcG','CMvZDwX0','8j+uKcdPHy3LR7NNRQhNKiBVViJMIBNLH4BNLkJMIlFLR7NOR53MNypPMzdVViK','CgX1z2LUCW','icaYlIdMN6xNNiSGr2f0zxDHEsdML6xLV5FVViZMIB7LIlaGB3bLBL9PzcdLRzFMRRu','5PYQ55+L6zsz6k+V','ioEAHcbbz2vUDcdMLBa6ia','y2HHBM5LBf9JB25MAwC','ywn0Aw9U','icdNLkJMIlFLKi06ia','zgvMAw5LuhjVCgvYDhK','cUAjGoACIsbbz2vUDcdPG73LT7lPHy3NVA7PO57KUAyGqM90cG','BMfTzq','w+IWG+IVLv0G5l+D5A2y5zcoigfJy291BNrZios4REEAHoI0PUwpTZOG','icbpCgvUieLeoIa','BwfPBG','CgvLCG','546W5zYO5Oc75yQP55cg5y+V5lUL6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G5lQg77Yb','icaTiefNzw50iowpR+s7PEs4U+wkQowqKEE+PowpKEMaGEA2IoAbRW','yxbWu2vJCMv0','y2HHBgS','qxbWifnLy3jLDo+8MG','y2HHBM5LBhmUzMvPC2H1lMfJy291BNrZlG','icb7','iL0kicaGih0kicb9','6k+36l6t5ywLieDHDgv3yxKGvg9Rzw7VViJNQ6/LJ6mG','B3bLBIaTiowfGEIUUoAjGoACIEEuQoAiT+ENGEIbIG','4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4PsbcG','B3vF','6k+36l6t5ywL6AoE5lMM576Ksuq','icaGicjZy29WzxmIoIb7','5PA55Rov5lIa77YA5P+L55YlieDHDgv3yxKG5PEL5B+x','icaGicaGicaIAw06BwvZC2fNzsiS','lI4VlI4VlI4VzgiVCMvWB3nPDg9YAwvZl2PVyI5YzxbV','iIdKUi3LRzJLNkJMIjBLT7lOV4FMNj8','DhLWzq','Dg9Rzw4','BgvUz3rO','Cg9YDa','CMv2Awv3zxi','icdIGkiG54k55yE744cm5yIB5BU65lYb5lIA6iEQ5BU65BQu55sO44cn77Ym5AgR5yAz5BQu55sO5l+H5OgVcG','5PA55Rov5lQm77YA6ycA6l+h6AoE5lMM566H55cg5zco5y+W','5AAc6zYa5l+U5Ps577Ym6k+35l2/55sOiUs/RUAuUsbbz2vUDcdNMOtPO57KUABPHy3NVA4IcG','icbVCgvUy2XHDYbNyxrLD2f5ihjLC3rHCNq','8j+uLYdNU5hLRPRPO57KUABNVQtLIldKUOVKUjRPG6G','icaGicaGicaIAw06BwvZC2fNztPZzw5Kx2fZx2jVDciS','576Ksuq6ia','yMLUzeDYB3vW','y2HHBM5LBhmUzMvPC2H1lMDYB3vWqwXSB3DgCM9T','cUkCKYdPHy3LR7NMJOJMNypMIjdLIP/VViek','DxrMltG','5PYQ5yIg6ywn','cVcFK4SG5BEY6ywn572U6AoE5lMMiejVDcdNMOqGqwDLBNqG5yIx6kgOcG','nteZuvDXEwTu','cUkCLYdPHy3LR7NMJOJMNypLPlhOTkuk','icdIMQdVUi8G5B+f6Ag75ywi5zcV5yQOieDHDgv3yxNVViZLKkBLIjNPLB/OV57MJQxPHy3NVA7KVjRLPlhOTkuk','5Q2L6AQKidhVVjRLIjVLU7RKVihKUjROH6RLU7RLUPtNLkG','Bg9JywW','icaGicaGicaIAw06BwvZC2fNzs5WmNbFBxnNoNjLywrVBMX5iIW','icdIGkiG5RE75yQG5lQl5lU277YAAw0UBwvZC2fNzs5YzwnLAxzLx3yXcG','ic0+ia','w+IWG+IVLv0G5BEY5zcm5Q2Lia','CMvJB3jKqMLUzgLUz0nYzwf0zq','D3jPDgfIBgu','y3jLzgvUDgLHBhmUzMvPC2H1lMfSBg93rNjVBs4','6k+356gU5l+DieDHDgv3yxKG5Q2J5zYO6l+q6kgm77YA','56UV5y+Jia','6ywn5A+556cb','BM9Kzs5WywLYlMfWChjVDMu','icbVCgvUy2XHDYbNyxrLD2f5','y2fUy2vS','8j+xKE+4JYdLIkdPMAqGqwDLBNqG55Qe6AoE5lMM6ywn572U','t3bLBIbjrcdMOlZLVi/PLjNOR6/VViZLUPtKU6uGB3vFiow8GowKTa','y2fSBe1LDgHVza','cUkAOo+4JYaG5PYQ5OM+5yIW5y+V57Ur5A6A55QeiefNzw50cG','57Ur5A6A5zco77Ym5Oc75yQP55cg5y+V5lUL6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G5lU75yQH5A6m5OIq5Oof5yA144cc','ogHfzhDntG','zMvPC2H1lq','8j+uKcdPHy3LR7NNRQhNKiy','y29UBMvJDgLVBK1Vzgu','5PYQ5OM+5yIW','zgvWyxj0BwvUDfjLCg9ZAxrVCNK','8j+tIYdLIy3NVA7LH4BLPiFVViJLNkJPO57KUABLVidMLl7LUBpLJ7dLROZMIjdVViNVVjOk','icaGicaGiNrLBMfUDci6ifS','zMvPC2H1lwrLzMf1BhqTywXSB3DgCM9TlMPZB24','6AoE5lMM6lEV55sX57Ur5A6A77YiB3bLBMnSyxCUANnVBU+8IE+8MGO','zMvPC2H1t3bLBKLK','ChjVBxb0','C3rHCNrZv2L0Aa','CgfZC3DVCMq','6ycj5OUP6kAb57Ur5A6A55Qe5lQl5lIA6yoO77YA','Ag9TzwrPCG','B3bLCMf0B3iUCgfPCMLUzW','z2v0t3bLBKnSyxDkC29Uugf0Aa','yxv0Aa','icdIGkiG5BYa5zcV5PY65zMO5lQ66io95yQB77Ym6k6+572U5PY65zMO5lQ65zcn56EWcG','icdIGkiG6l+B5ywL44cm5RAi5OgV5y2H54Mh44cn4OAs44cm5zUE6lcd6ywn572U44cn6Ag16z2I','A2v5CW','zMLUzefSBa','iIdPHy3NVA7PO57KUAyGqM90','cVcFLjmG6kEJ57Ur55sO5OI36AoE5lMMcG','y2XVC2u','cUkCKYdPO57KUABOTkBLJ7FNU5hLRPRMIjdLIP/VViJMLBdMJA7LUPpLT7lMM7tMLRdVViKk','zgvWDeLK'];_0x3b64=function(){return _0x53ca79;};return _0x3b64();}async function showUserFeishuBinding(){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)]['cyan'](_0x5d24(0x1f3)));const _0x3bd3ad=services_1[_0x5d24(0xc8)]['getUserInfo']();console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)](_0x5d24(0x1fe))),console['log'](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0xe9)+_0x3bd3ad['id'])),console['log'](chalk_1['default']['dim'](_0x5d24(0x11b)+_0x3bd3ad[_0x5d24(0x11e)])),console[_0x5d24(0xed)](''),_0x3bd3ad[_0x5d24(0x17e)]?(console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)](_0x5d24(0x216))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x120)+_0x3bd3ad[_0x5d24(0x168)])),console[_0x5d24(0xed)](''),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0xad)))):(console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0xaa))),console[_0x5d24(0xed)](''),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x15d))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)]('使用\x22绑定用户飞书\x20Open\x20ID\x22进行绑定。'))),console[_0x5d24(0xed)](''),await index_1[_0x5d24(0x185)]['waitForKey']();}async function bindUserFeishuId(){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)][_0x5d24(0x1cf)](_0x5d24(0xa2)));const _0x4f014e=services_1[_0x5d24(0xc8)][_0x5d24(0x223)]();if(_0x4f014e[_0x5d24(0x17e)]){console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1e3)](_0x5d24(0x1c3))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x20\x20Open\x20ID:\x20'+_0x4f014e['feishuOpenId'])),console[_0x5d24(0xed)]('');const {overwrite:_0x43cb3a}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':'confirm','name':_0x5d24(0x228),'message':_0x5d24(0x22a),'default':![]}]);if(!_0x43cb3a){console['log'](chalk_1['default'][_0x5d24(0x22d)]('\x0a已取消\x0a')),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}}console['log'](chalk_1['default'][_0x5d24(0x10a)][_0x5d24(0x1e3)](_0x5d24(0x212))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['dim'](_0x5d24(0x131))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['cyan'](_0x5d24(0xc9))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x116))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)]('\x20\x20\x20\x20\x20命令:\x20openclaw\x20logs\x20--follow')),console[_0x5d24(0xed)](''),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x13b))),console['log'](chalk_1[_0x5d24(0x19b)]['cyan'](_0x5d24(0xd1))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x225))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1cf)](_0x5d24(0x222))),console['log']('');const {feishuOpenId:_0x2cb1df}=await inquirer_1['default'][_0x5d24(0x169)]([{'type':_0x5d24(0xe5),'name':_0x5d24(0x168),'message':'请输入飞书\x20Open\x20ID(ou_xxx\x20格式):','validate':_0x5354f4=>{if(!_0x5354f4[_0x5d24(0xfb)]())return'请输入\x20Open\x20ID';if(!_0x5354f4[_0x5d24(0xfb)]()[_0x5d24(0x16a)](_0x5d24(0x12e)))return _0x5d24(0x15a);return!![];}}]),{updateName:_0x3fe6c1,userName:_0x1c9769}=await inquirer_1['default'][_0x5d24(0x169)]([{'type':_0x5d24(0x19d),'name':'updateName','message':_0x5d24(0x22b),'default':![]},{'type':_0x5d24(0xe5),'name':'userName','message':_0x5d24(0x1bb),'when':_0x48e2ca=>_0x48e2ca[_0x5d24(0x17c)]}]),_0x7bee70=services_1[_0x5d24(0xc8)][_0x5d24(0x21a)](_0x2cb1df[_0x5d24(0xfb)]());if(_0x7bee70){_0x1c9769?.[_0x5d24(0xfb)]()&&services_1[_0x5d24(0xc8)][_0x5d24(0x17c)](_0x1c9769[_0x5d24(0xfb)]());try{const _0x3441ab=(0x0,utils_1[_0x5d24(0x16f)])();let _0x5ba101={};if(fs['existsSync'](_0x3441ab))try{const _0x55a1bc=fs[_0x5d24(0x18f)](_0x3441ab,_0x5d24(0x144));_0x5ba101=JSON[_0x5d24(0x94)](_0x55a1bc);}catch{_0x5ba101={};}!_0x5ba101[_0x5d24(0x202)]&&(_0x5ba101[_0x5d24(0x202)]=[]);const _0x4c7b79=_0x5ba101[_0x5d24(0x202)],_0x5dd7a4=_0x2cb1df[_0x5d24(0xfb)](),_0x23392b=_0x4c7b79[_0x5d24(0x1ba)](_0x1d0304=>{const _0x2b4f3b=_0x1d0304[_0x5d24(0x217)],_0x3c58f2=_0x2b4f3b?.[_0x5d24(0x122)];return _0x2b4f3b?.[_0x5d24(0x1a0)]===_0x5d24(0x1fb)&&_0x3c58f2?.[_0x5d24(0x80)]==='dm'&&_0x3c58f2?.['id']===_0x5dd7a4;});!_0x23392b?(_0x4c7b79[_0x5d24(0x1f7)]({'agentId':'main','match':{'channel':_0x5d24(0x1fb),'peer':{'kind':'dm','id':_0x5dd7a4}}}),fs[_0x5d24(0x7e)](_0x3441ab,JSON['stringify'](_0x5ba101,null,0x2),'utf-8'),configTracker['recordBindingCreate']({'agentId':_0x5d24(0x121),'match':{'channel':_0x5d24(0x1fb),'peer':{'kind':'dm','id':_0x5dd7a4}}},'main'),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)](_0x5d24(0x110))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x22d)]('\x20\x20Open\x20ID:\x20'+_0x2cb1df)),_0x1c9769?.['trim']()&&console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x11b)+_0x1c9769)),console[_0x5d24(0xed)](''),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0xea))),console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1cf)](_0x5d24(0x13d)))):(console[_0x5d24(0xed)](chalk_1['default'][_0x5d24(0x1bd)]('\x0a✓\x20飞书账号绑定成功!(绑定配置已存在)\x0a')),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x120)+_0x2cb1df)));}catch(_0x514f62){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1bd)](_0x5d24(0x178))),console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x120)+_0x2cb1df)),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0x89))),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](JSON['stringify']({'agentId':_0x5d24(0x121),'match':{'channel':_0x5d24(0x1fb),'peer':{'kind':'dm','id':_0x2cb1df[_0x5d24(0xfb)]()}}},null,0x2)));}console[_0x5d24(0xed)](''),console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x123)));}else console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x19a)](_0x5d24(0x1cc)));console[_0x5d24(0xed)](''),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();}async function unbindUserFeishu(){console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x10a)][_0x5d24(0x1cf)](_0x5d24(0x176)));const _0x5bbfe7=services_1[_0x5d24(0xc8)][_0x5d24(0x223)]();if(!_0x5bbfe7[_0x5d24(0x17e)]){console['log'](chalk_1[_0x5d24(0x19b)][_0x5d24(0x1e3)](_0x5d24(0xc0))),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)](_0x5d24(0x180))),console['log'](chalk_1['default'][_0x5d24(0x22d)]('\x20\x20Open\x20ID:\x20'+_0x5bbfe7[_0x5d24(0x168)])),console['log']('');const {confirm:_0x315487}=await inquirer_1[_0x5d24(0x19b)][_0x5d24(0x169)]([{'type':_0x5d24(0x19d),'name':_0x5d24(0x19d),'message':_0x5d24(0x21c),'default':![]}]);if(!_0x315487){console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x22d)]('\x0a已取消\x0a')),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();return;}const _0x3f71b0=services_1['userService'][_0x5d24(0x1ea)]();_0x3f71b0?(console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)]['green']('\x0a✓\x20飞书账号已解绑\x0a')),console[_0x5d24(0xed)](chalk_1['default']['dim'](_0x5d24(0x20b)))):console[_0x5d24(0xed)](chalk_1[_0x5d24(0x19b)][_0x5d24(0x19a)](_0x5d24(0x195))),console[_0x5d24(0xed)](''),await index_1[_0x5d24(0x185)][_0x5d24(0xa4)]();}
1
+ 'use strict';(function(_0x406865,_0x3f68cc){const _0x20dc42=_0x406865();while(!![]){try{const _0x5dc5be=-parseInt(_0x4fdf(0x2f6))/0x1*(parseInt(_0x4fdf(0x319))/0x2)+-parseInt(_0x4fdf(0x28c))/0x3*(parseInt(_0x4fdf(0x209))/0x4)+-parseInt(_0x4fdf(0x25b))/0x5*(-parseInt(_0x4fdf(0x2c8))/0x6)+-parseInt(_0x4fdf(0x2fd))/0x7*(parseInt(_0x4fdf(0x258))/0x8)+-parseInt(_0x4fdf(0x1b0))/0x9*(-parseInt(_0x4fdf(0x278))/0xa)+parseInt(_0x4fdf(0x2f9))/0xb*(parseInt(_0x4fdf(0x231))/0xc)+-parseInt(_0x4fdf(0x2f5))/0xd*(-parseInt(_0x4fdf(0x25f))/0xe);if(_0x5dc5be===_0x3f68cc)break;else _0x20dc42['push'](_0x20dc42['shift']());}catch(_0x335a86){_0x20dc42['push'](_0x20dc42['shift']());}}}(_0x4f95,0x9fca4));var __createBinding=this&&this[_0x4fdf(0x1f8)]||(Object[_0x4fdf(0x2c3)]?function(_0x51718e,_0x5ec0b7,_0x2840c2,_0x555b64){if(_0x555b64===undefined)_0x555b64=_0x2840c2;var _0x25aeb0=Object[_0x4fdf(0x241)](_0x5ec0b7,_0x2840c2);(!_0x25aeb0||(_0x4fdf(0x273)in _0x25aeb0?!_0x5ec0b7[_0x4fdf(0x233)]:_0x25aeb0['writable']||_0x25aeb0[_0x4fdf(0x311)]))&&(_0x25aeb0={'enumerable':!![],'get':function(){return _0x5ec0b7[_0x2840c2];}}),Object[_0x4fdf(0x30f)](_0x51718e,_0x555b64,_0x25aeb0);}:function(_0x4b3fca,_0x404acc,_0x10a09a,_0x578d29){if(_0x578d29===undefined)_0x578d29=_0x10a09a;_0x4b3fca[_0x578d29]=_0x404acc[_0x10a09a];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[_0x4fdf(0x2c3)]?function(_0x1ea28d,_0x5254f1){Object[_0x4fdf(0x30f)](_0x1ea28d,_0x4fdf(0x2ef),{'enumerable':!![],'value':_0x5254f1});}:function(_0x1ef24a,_0x5cd925){_0x1ef24a['default']=_0x5cd925;}),__importStar=this&&this[_0x4fdf(0x315)]||(function(){var _0x214958=function(_0x4fc809){return _0x214958=Object['getOwnPropertyNames']||function(_0x208326){var _0x4338f0=[];for(var _0x31b8c0 in _0x208326)if(Object['prototype'][_0x4fdf(0x31f)][_0x4fdf(0x30a)](_0x208326,_0x31b8c0))_0x4338f0[_0x4338f0[_0x4fdf(0x1e6)]]=_0x31b8c0;return _0x4338f0;},_0x214958(_0x4fc809);};return function(_0x3b1fa3){if(_0x3b1fa3&&_0x3b1fa3[_0x4fdf(0x233)])return _0x3b1fa3;var _0x30e678={};if(_0x3b1fa3!=null){for(var _0x22e1cd=_0x214958(_0x3b1fa3),_0x59e4cf=0x0;_0x59e4cf<_0x22e1cd[_0x4fdf(0x1e6)];_0x59e4cf++)if(_0x22e1cd[_0x59e4cf]!=='default')__createBinding(_0x30e678,_0x3b1fa3,_0x22e1cd[_0x59e4cf]);}return __setModuleDefault(_0x30e678,_0x3b1fa3),_0x30e678;};}()),__importDefault=this&&this[_0x4fdf(0x2d2)]||function(_0x1834b2){return _0x1834b2&&_0x1834b2['__esModule']?_0x1834b2:{'default':_0x1834b2};};Object[_0x4fdf(0x30f)](exports,'__esModule',{'value':!![]}),exports['showFeishuConfigMenu']=showFeishuConfigMenu;function _0x4f95(){const _0x307218=['CgfZC3DVCMq','5OMN6kgm6icf','ChjPBNrfCNjVCG','cVcFLjCG57Ur5A6A6AoE5lMM576K5yIW5lQl5lIA6yoOcG','ywnJB3vUDeLK','cVcFLjmG6kEJ57Ur55sO5OI36AoE5lMMcG','Dg9tDhjPBMC','zMvPC2H1x2DYB3vWx2LK','w+IWG+IVLv0G5l+D5A2y5yMnigfJy291BNrZios4REEAHoI0PUwpTZOG','cUw3SUwpLUA2IaO','y29Kzt0','CgXHDgzVCM0','Bwv0Ag9KxW','y2HHBM5LBhmUzMvPC2H1lMfJy291BNrZlG','5PA55Rov5lQm77YA6ycA6l+h6AoE5lMM566H55cg5zco5y+W','5Q2L6AQKidlVVjRLKk/NLkJMNlRLMAJKURROG73LIPS','zMvPC2H1lq','u2vWyxjHDg9Y','icaGig9Wzw5JBgf3igDHDgv3yxKGCMvZDgfYDaO','w+IWG+IVLv0G5lQl5lIA6yoOia','ioEAHoMJNUs5PUE7KEwUMG','5yIG6zMK6AoE5lMM6lsM5y+36ywn572UoIa','y3LHBG','icaGicjZy29WzxmIoIb7','Dw5IAw5KvxnLCG','CgvLCG','icdIGkiG6ywn5A+556cb5BEY6kkR5l2/55sO','lM9Wzw5JBgf3','5Oc75yQP55cg','DhLWzq','y29UBMvJDf8','5l2/55sOiUs4UIbbz2vUDcdMT7VLIQdPO57KUAyGqM90iUI/M+IHJoMfJEE9RGO','icaGicaGicaIy29UDgfJDdP1C2vYlMjHC2u6CMvHzg9UBhKIla','ksaTia','cUkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGEkuGq','zgLZywjSzwqGlsdNPOhNLkJNP4hOGyO','y3jLyxrL','CMvWBgfJzq','Dg9Rzw4','ihWG','B3zLCNDYAxrL','nLDUAu53Bq','cUkCLYdOP6pNU5hLPlhOTkuk','l3DZ','8j+rPcdNLkJMIlFPO57KUABNU5hLRPO','CMvZ','lI4VlI4VlI4VzgiVCMvWB3nPDg9YAwvZl2rLChqUCMvWBW','5Q2L6AQKidtVVjRPHy3NVA7KUOVKU7BORQlPMiu','5Q2L6AQKidFVVjROJRFLJ5BLH63OR4e','zxjYB3i','icdIGkiG6ywn5A+556cb5PEG5Pwi5OIw5BEY6l+h5PYF','x19PBxbVCNrezwzHDwX0','zMvPC2H1qM91BMq','56UV5y+Jia','z2v0t3bLBKnSyxDsB290','AM9PBG','5B2t5yMn6k+35Rgc5PwWoIa','yM9Sza','6AoE5lMM6ywn572U5lIn5A2y5zYO','cUkAOo+4JYaG6k+36yEn5zcVieDHDgv3yxKG5l2/6AoE5lMM6zw/6l+E5O6L5PAT5BYa77YA','Bg9N','ic0+ia','icbpCgvUieLeoIa','5B2t5yMn6ywn572U','cUkCKYdPO57KUAyGqM90ioMfJEE9RUw3SUwiOoMzPa','Bg9JywW','4PYtiowpKEEoScbhyxrLD2f5oIdNQ6/LJ6mG','qxbWifnLy3jLDo+8MG','5OM55yEg6AoE5lMM6ywn5A+5oIa','ios4QUA0U+I3G+EAHcbhyxrLD2f577YAcG','zMvPC2H1x3bHAxjPBMDFyxbWCM92zq','icbby2nVDw50ieLeoIa','BM9Kzs5WywLYlMfWChjVDMu','icaGicaGicaIAw06BwvZC2fNzs5WmNbFBxnNoNjLywrVBMX5iIW','yMfJAW','C3rHCNrZv2L0Aa','y2HHBM5LBhmUzMvPC2H1lMDYB3vWqwXSB3DgCM9T','zMLUzeLUzgv4','qxbWifnLy3jLDo+8IoMhJEAwSoI+K+wfPE+8Iq','Ahr0CdOVlZeYnY4WlJaUmtO','zgvMyxvSDa','6ywn5A+55PAh5lU2oIa','Dg9vChbLCKnHC2u','cUAjP+IHJowrVEs7PdOG','8j+tLIdLPOlKVzxOJRFLJ5BPO57KUAyGt3bLBIbjro+8MGO','y2HPBgrFChjVy2vZCW','ntqZndiZnfrkAhngEG','mtG0mwTKBefisG','zgLYBMfTzq','lwfSBg93rNjVBs5QC29U','mZnVDKDMz0q','ios4QIbbz2vUDcdNMOtPO57KUABNVQtKV6hMGA8','C2HVD1vZzxjcAw5KAw5N','Aw5WDxq','ntaZm0fKvernyq','cUkCKYdPO57KUABOTkBLJ7FNU5hLRPRMIjdLIP/VVihVViJNU5hLRPRPHy3NVA7LT7lLRzJLNkJVViKk','zxHPC3rZu3LUyW','cUkCKYdLT7lKUlOGqwDLBNqGiG','lI4VlI4VlI4VzgiVCMvWB3nPDg9YAwvZl2PVyI5YzxbV','CMvJB3jKrMvPC2H1r3jVDxbcAw5K','y29UBMvJDa','zMLSDgvY','5O+q56s677YA55sO5OI3546W5zYO5y+V5lUL5zYO6AoE5lMM5lIT5lIo5PY65zMO5lQ65A+56k+D44cccG','8j+tIYdMN6xNNiVNLkJMIlFPO57KUABNU5hLRPRNIRBMGie','y2fUy2vS','zwrPDa','icaGicaGicaIAw06CMvZB3vYy2uI','y2fSBa','B3bLCMf0B3iUCgfPCMLUzW','5Q2L6AQKidhVVjRLKk/LIQGGr2f0zxDHEq','y29UzMLYBq','5B2t5yMn57Ur5A6A5l+H5OgV77YA','zgvMAw5LuhjVCgvYDhK','6k6K6k+b5AsX6lsLoIa','y29UzMLNDxjHyMXL','55sO5OI3suq','r2f0zxDHEsdMNkRPHy3NVA4','y2XVC2u','x19PBxbVCNrtDgfY','t1bftKnmqvDFu1rbvevFreLs','6k+36l6t5ywLieDHDgv3yxKGvg9Rzw7VViJNQ6/LJ6mG','cUACQUI+K+wfPsbuB2TLBU+8Jow3SUwpLUA2IaO','mtm5meroshn3vq','6k+36l6t5ywL6AoE5lMMie9Wzw4GsutVViHVDv94EhGG5Qc85BYp77Yj77YA','6ycj5OUP6kAb5l2/55sO55QeieDHDgv3yxNVVjO','5yIG6zMKiefNzw50ia','qxbWieLeicHJBgLFEhH4ioAGVow8JYNVVjO','cUATO+wCQoAjUEwhHUMfJEwVUEEGGtOG','AgfZt3DUuhjVCgvYDhK','cVcFK4SG5BEY6ywn572U6AoE5lMMiejVDcdNMOqGqwDLBNqG5yIx6kgOcG','4P6vios4UIbbz2vUDcdMT7VLIQdPO57KUAyGqM90','icaGidiUioMhJEAwSowqR+wkQcbhyxrLD2f5','BM93','B3bLBMnSyxCGCgfPCMLUzYbHChbYB3zLigzLAxnODsa','6k+356gU5l+D6k+L5lQl5lIA6yoO5BEY5yIB5BU6iefNzw5077Yi566H55cg6icf44cb5A6H5Qc46icf44cb5OMN6kgm6icf77YjcG','ywn0Aw9U','ywDLBNrjza','icaGicdLKB3KU6q6ig9Wzw5JBgf3igXVz3mGls1MB2XSB3C','yMLUzgLUz3m','8j+uKYdOP6pNU5hNLkJMIlFPO57KUAy','6k+356gU5l+DieDHDgv3yxKG5Q2J5zYO6l+q6kgm77YA','ChjPBNreAxzPzgvY','w+AaU+wkQEEqHL0','zgvZDhjVEq','cUE7KEwUMUEAHcbbz2vUDo+8IowfSsa','5PAW55QeiefWCcbtzwnYzxtVVjO','cUkCKYdPHy3NVA7LT7lMM7tMLRak','yxbWu2vJCMv0','5y+V6io95y6F5zUG77YA','5Q2L6AQKidxVVjRPHy3NVA7MTOJMGA/LJAhNIyFLM57OSim','Aw5XDwLYzxi','DxrMltG','C2v0r2f0zxDHEq','5Q2L6AQKidpVVjRPHy3NVA7LUPtNLkJMNypPMza','CMvZDwX0','4PQG77IpioMCGoIMGEMhJEwqRYbhyxrLD2f5ios9V+MfJEE9RUEuN+AvIo+8MG','6ycj5OUP6kAb57Ur5A6A55Qe5lQl5lIA6yoO77YA','D2vIC29JA2v0','ywXSB3DSAxn0','cUATO+wCQoAjQ+ApJ+A0U+I3G+EAHcbhyxrLD2f5lI4UcG','yxnZAxn0yw50','BgLZDefSBa','6k+36l6t5ywL6AoE5lMM576KsutVViHVy194EhGG5Qc85BYp77Yj77YA','BgLZDa','icb7','CM9SzurPC3bSyxK','DxbKyxrLtMfTzq','cUkCKYdPO57KUABNVQtLT7lNU5hLRPOk','l2HLywX0Aa','C2vSzwn0zwq','ywrK','BwvZC2fNzq','566H55cg6icf','zgvSzxrL','8j+uLYdNU5hLRPRPO57KUABNVQtLIldKUOVKUjRPG6G','yxbWswq','B3bLBIaTiowfGEIUUoAjGoACIEEuQoAiT+ENGEIbIG','r0vu','z2v0t3bLBKnSyxDkC29Uugf0Aa','ChjVBxb0','AM9IuMvWB3nPDg9YEq','icaGicaGicaIAw06BwvZC2fNzs5NCM91Cf9HDf9TC2C6CMvHzg9UBhKIla','icaGih0','icdIGkiG5BYa5zcV44cm5l2/55sO6zw/6l+E5O6L5O6L5Ps25lQl5lU244cn5BYa5ywZcG','icdIGkiG5BYa5zcV44cm5l2/55sO6zw/6l+E5O6L5O6L5Ps25lQl5lU244cn5BYa5ywZ','8j+tSsdPO57KUAyGqM90ioMfJEE9RG','8j+tLIdOR6BNU4BMLzNNQiVVVjO','qwDLBNqGsuq','CgfPCMLUzW','w+IWG+IVLv0G5l+D5A2y5zcoigfJy291BNrZios4REEAHoI0PUwpTZOG','z2v0qNLjza','5B2t5yMn5BEY57Ur5A6A77YA','y3jLzgvUDgLHBhmUzMvPC2H1lMfSBg93rNjVBs4','z2f0zxDHEq','CgX1z2LUCW','6ycj5OUP6kAb5l+U5Ps555Qe5yAf5A6577YA','5Q2L6AQKidlVVjRNLkJMIlFPHy3LR7K','Ag9TzwrPCG','5O+q56s677YA55sO5OI35zYO6AoE5lMM56Eb6igk5PY65zMO5lQ65zco77Ym5lYA5Ps25yIW6ywn5A+556cbcG','5lQl5lIA6yoOoIa','otyWmde5mMDuA01rsa','icdNP4hOGyRNRzBNLAu6ia','CMv2Awv3zxi','zMLUzefSBa','zgLZywjSzwq','Aw5JBhvKzxm','cUkCLYdPHy3LR7NMJOJMNypLPlhOTkuk','Cgf5Bg9Hza','6ywn572U6k+75y+w5AsX6lsL','cUs9V+EuQoIVToAyJJO','icb9cG','cVcFLjCG57Ur5A6A55sO5OI36AoE5lMMie9Wzw4Gsuqk','CMvX','DxbKyxrLzenVDw50','DgfYz2v0qwnJB3vUDeLK','y2HHBM5LBa','DhvPvxrPBhm','icdIGkiG54k55yE744cm5yIB5BU654Mi5PYS44cn77Ym5AgR5yAz54Mi5PYS5y+35zkm5PU05PAW6k+05PIo','Cg9YDa','icaGiowqR+wkQowrVEs7PdOGB3bLBMnSyxCGz2f0zxDHEsbYDw4k','zMLUza','qxbWifnLy3jLDcdKUi3OG73KUlRNQBO','ywXSB3DjBNnLy3vYzuf1DgG','y29Kzq','Dgv4Da','icdNLkJMIlFLKi06ia','6k+36l6t5ywL6AoE5lMM576Ksuq','5Q2L6AQKidhVVjRLIjVLU7RKVihKUjROH6RLU7RLUPtNLkG','6ywn572U5PAh5lU26k+75y+w5AsX6lsL','ifVLT7lNU5hLRPO6ia','zw5HyMXLza','cUkCLYdNU5hLRPRLPlhOTku','5lQl5lIA6yoO','DgLTzw91Da','lI4VAw5KzxG','y2fSBe1LDgHVza','6ywn5A+56k+35Rgc5PAh5lU25lIn5A2y5zYO','D2fPDezVCKTLEq','CM9Szq','icbVCgvUy2XHDYbNyxrLD2f5cG','CMvXDwvZDhm','z3jVDxbZ','CgvUzgLUzW','5PYQ5y+r546W5Rs76lEd55QeieDHDgv3yxKk','5BEY5yAz5ywLoIa','yMLUzeDYB3vW','v2vIu29JA2v06zsz6k+VoIa','icaTigDYB3vWug9SAwn5oIbHBgXVD2XPC3tVViJKU4xLHyhORRJNU5hLRPRNMOtNVQtVViK','56Eb6igk562w55wL','CMvZB2X2zq','cVcFJ6iG6AoE5lMM576K57Ur5A6A5yIx6kgOcG','8j+uMsdOV5tLM57KUlVOJ5ZLJzu','cUkCJ++4JYaG5l+U5Ps5iefNzw50ioEAHoMJNUs5PUMfJEE9RGO','y2HLy2ThyxrLD2f5q29UzMLN','BgvUz3rO','yMLUzfvZzxi','A2LUza','cUACQUwbMUs7U+s9LEs/RUAuUqO','DxnLCLnLCNzPy2u','w+IWG+IVLv0G5PYa57Ui57Ur5A6AiefNzw50ioAvSdOG','cUkAOo+4JYaG5PYQ5OM+5yIW5y+V57Ur5A6A55QeiefNzw50cG','y2HLy2TIB3G','icdIGkiG6l+B5ywL44cm54Mi5PYS566H55cg5lIo5y+r5BId44cn6Ag16z2I','6zsz6k+VoIa','y2HHBgS','CgfPCMLUzYaTioMCGoMfJEwVUEAjUEwhHU+8IoAoQoInKo+8JoACGowUIEwfQo+8Iq','zgvWDe5HBwu','cVcFLjaG6ywn5A+5566H55cgcG','C291CMnL','B3bLBG','w+wUOEAGUoIaHv0','Bwf0y2G','x19JCMvHDgvcAw5KAw5N','CNvUBMLUzW','5PIV5zcM5PU05PAW55sO5OI35zcn77YF','cUkCKYdPO57KUABOTkBLJ7FNU5hLRPRMIjdLIP/VViek','5yIB5BU66AoE5lMM5RIG6ygt6ywn572U','DxbKyxrL','zg1qB2XPy3K','y2HHCKnVzgvbDa','Bwv0yq','zw50CMLLCW','CgfYC2u','Aw5MBW','cUw9K+wjJEMfJEE9RU+8MG','zMLUzej5swq','ywDLBNq','CMvHzezPBgvtEw5J','546W5zYO5Oc75yQP55cg5y+V5lUL6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G5lQg77Yb','mJiWmgPsEw9trq','D3m6lY8XmJCUmc4WlJe6','8j+tIYdLKi7NU63MRAxPQQtVVjOk','cVcFL5hVUi8G5yIG6zMKiefNzw50ioEAHoMJNUs5PUMfJEE9RGO','zgvMyxvSDc10B2TLBG','z3jVDxbqB2XPy3K','t1bftKnmqvDFq1jfrevoveLbtfnFreLs','zgvWyxj0BwvUDf9Pza','cUkCLYdNU5hLRPRLPlhOTkuk','icaGicaGicaIAw06BwvZC2fNzsiS','icdIGkiGB3bLBMnSyxCG5zg95lUK5PYQ5A6j6kof5OIw5lIn5zYOifbbveGG5lITcG','cUAjGoACIsbbz2vUDcdPG73LT7lPHy3NVA7PO57KUAyGqM90cG','yM90tMfTzq','y2XPxW','5PA55Rov5lIa77YA5P+L55YlieDHDgv3yxKG5PEL5B+x','DxnLCKLK','icaTiowCQoE+PowgHsba5PY65zMO5lQ6iowpKEMaGEA2IoAbR++8JoE7KEwUMUEAHcbbz2vUDcdKVjRLK43LUPq','5Oc75yQP55cg5y+V5lUL6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G5lU75yQH5A6m5OIq5Oof5yA144cc','yxnZAxn0yw50x21HAw4','8j+uMsdLJ5BMTOG','BMfTzq','cUATO+wCQoAFPEIVOUMfJEwVUEIVT+AXGI4UlGO','BM9Kzs5WywLYlMXPC3q','D3jPDgvgAwXLu3LUyW','8j+tIYdMN6xNNiVPO57KUABNVQtNU5hLRPRLIjFOOAG','Cgf0Aa','icdIGkiGr2f0zxDHEsdMNkROV5dOOyW','ios4QIK','zMvPC2H1','cUkCKYdPO57KUABOTkBLJ7FNU5hLRPRMIjdLIP/VViJMLBdMJA7LUPpLT7lMM7tMLRdVViKk','icdIGkiG6l+B5ywL44cm5lQl5lU26k6I6zIf44cn6Ag16z2I','EwvSBg93','5AAc6zYa5l+U5Ps577Ym6k+35l2/55sOiUs/RUAuUsbbz2vUDcdNMOtPO57KUABPHy3NVA4IcG','Aw5PDa','DhjPBq','CgfKrw5K','4PQG77IpioITPUwrIU+8MUwiOoMzPowqJUIVPsbbz2vUDcdNMOtPO57KUAyGqM90iowWHUAxOoAZLEs9V+EuQaO','C3rYAw5NAwz5','DxnLCK5HBwu','BwTKAxjtEw5J','mtqYmJCZmKzTtvHirq','5O+q56s677YA6k6P55sO5OI35zYO6AoE5lMM56Eb6igk5PY65zMO5lQ677Ym5PY65zMO5lQ65lYA6l+u5zUE6ywn5A+556cbcG','x19LC01VzhvSzq','icdIGkiG5Asn5yI2iefWCcbjrcdLKOWGqxbWifnLy3jLDaO','C3rHDhvZq29Kzq','icdIGkiG5l+D5A2y54Mi5PYS77Ym54k55yE744cm55sZ6k+35lIk57Q/44cncG','ChvZAa','zMvPC2H1lwrLzMf1BhqTywXSB3DgCM9TlMPZB24','C3vJy2vZCW','cVcFKAqG55sO5OI36AoE5lMM57Ur5A6A54Q25OcbcG','icdNLkJMIlDjrdOG','cUAAGUAxOow3SUMfJEE9RUEAHoMJNUs5PIbcB3qk','icdIGkiG6l+B5ywL44cm5BQu55sO6io95yQB44cn4OAs44cm5PY65zMO5lQ644cn','5yET6k+b55UU5B2voIa','6AoE5lMM6lEV55sX57Ur5A6A77YiB3bLBMnSyxCUANnVBU+8IE+8MGO','cUkCKYdPHy3LR7NMJOJMNypMIjdLIP/VViek','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','icaTihjLCxvPCMvnzw50Aw9UoIb0CNvL77Yi6zYa6kAbieaG5PY65zMO5lQ65OMn6io96kEM5y+r77Yj','zw52','4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4Psb4PsbcG','576Ksuq6ia','CMvXDwvZDa','z3jLzw4','icdPO57KUABLVidMLl7LUBpLJ7dVVjPODhrWCZOVl29Wzw4UzMvPC2H1lMnUl2fWCaO','5OYj5zUE6l2M6zsU6l+u5zUElI4U','5B6f5OM55yEg55Qe6ywn5A+56k+35Rgc77Yi5ywXia','zgLT','zMvPC2H1t3bLBKLK','qxbWieLeioAGVow8J+MuMEIVR++8Jow6Los7PsbJBgLFiow8GowKTa','ios4QU+8IE+8MGO','CMvTB3zL','CMvK','6zsz6k+V5l+H5OgVoIa','5Oc75yQP55cg5Bcg5PEG5Rov6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G44cc','ywnJB3vUDhm','5PIV5zcM6kAb6kAg55Uw546W5PYj57Ur5A6A77YF','y3jLzgvUDgLHBhm','6ywn5A+556cbici','AxnbCNjHEq','oda3mNb0zvfiwG','icdIGkiG6l+B5ywL6AoE5lMM5BYa5Ps+5BMZ5y+W77YAAhr0Chm6lY9VCgvUlMzLAxnODs5JBI9HCha','ywDLBNrtzxj2AwnL','ntaZmJK1nuvfz2D3AG','CMvJB3jKq29UzMLNq2HHBMDL','w+IWG+IVLv0G5Oc75yQP55cgoIa','8j+pOIdPO57KUABNVQtNU5hLRPO','ndjsAMzSDge','y29UBMvJDgLVBK1Vzgu','5OM55yEgoIa','5Q2L6AQKidBVVjRLIjVLU7RNIyJMNkZLUBBLJ5hLUim','8j+uMsdOV5tLM54','zxzLBNq','B3vF','55Ur5O6N6icf','z3jVDxbjza','8j+uLYdNU5hLRPRNLkJMIlFPO57KUAyGt3bLBIbjra','6ycj5OUP6kAb5l+U5Ps555QeiefNzw5077YA','5PYQ55+L6zsz6k+V','AM9Ix2LK','6k+36ycj5OUP5Pon5l2C77YA','yxv0Aa','55sO5OI3suq6ia','B2nF','y2HHBM5LBf9JB25MAwC','BgLZDeDYB3vWCW','AM9ItMfTzq','z2v0','z2v0vxnLCKLUzM8','6AoE5lMM57Ur5A6A54Q25OcboIdMNkRNU5hLRPO','icaYlIdMN6xNNiSGr2f0zxDHEsdML6xLV5FVViZMIB7LIlaGB3bLBL9PzcdLRzFMRRu','lI4UcG','mtbWtLrZBKe','ChjPBNrxyxjUAw5N','BwfPBG','z3jVDxbbBgXVD0zYB20','iL0kicaGih0kicb9','icaTiefNzw50iowpR+s7PEs4U+wkQowqKEE+PowpKEMaGEA2IoAbRW','6AoE5lMM57Ur5A6A54Q25OcboIdLT7lNU5hLRPO','55UU5Qch6lsM5OI3oIa','y2HHBM5LBhm','C3rKzxjY','CMvMCMvZAa','lI4VlI4VlI4Vy29Yzs91DgLSCY9VCgvUy2XHDY1OzwXWzxi','zw5K','ioEAHcbbz2vUDcdMLBa6ia','5PYQ5OYh5A6A','y29UBMvJDc5JAgfSBgvUz2u','sLnptIdOP6pMNPdPLjNOR686','5l2/55sOiUE7KEwUMUEuQoAiT+MJNUs5PIbpCgvUieLeiUI/M+IHJoE7KEwUMUoaGG','iIdPHy3NVA7PO57KUAyGqM90','A2v5CW','ntu4m21Jz2DTuW','CMvJB3jKqMLUzgLUz0nYzwf0zq','lI4VlI4VlI4Vy29Yzs9Zzxj2AwnLCY9JB25MAwCTDhjHy2TLCI5Zzxj2AwnL','8j+tIYdLIy3NVA7LH4BLPiFVViJLNkJPO57KUABLVidMLl7LUBpLJ7dLROZMIjdVViNVVjOk','57Ur5A6A5zco77Ym5Oc75yQP55cg5y+V5lUL6ycA6l+h6AoE5lMM56Eb6igk6ycA55+L5l2G5lU75yQH5A6m5OIq5Oof5yA144cc','5A6H5Qc46icf','qM90iowqJEENSa','ms4WlJa','BwfW','icdIGkiG6l+B5ywL44cm5P2d6zMq566H55cg44cn4OAsioEcUEwhU+oaJoAjUEMhJ+wVVowfPEoaJq','y2HHBM5LBhmUzMvPC2H1','5PQc5PEG5B6f5OM55yEg55Qe6ywn5A+56k+35RgccG','w+IWG+IVLv0G6ywn572U5BEY5l+D5A2y','icdIGkiG6l+B5ywL44cm5yET6k+b5lIo5z+656ga5l+H5OgV44cn6Ag16z2I','5BEY5lUo6ywn5A+55yIx6kgO56E76zMK6ywn5A+556cb','6ywn5A+556cb','icdIMQdVUi8G5B+f6Ag75ywi5zcV5yQOieDHDgv3yxNVViZLKkBLIjNPLB/OV57MJQxPHy3NVA7KVjRLPlhOTkuk','5PQc5PEGiefNzw5077Ym6k+35ywi5yIB5BU6iefNzw50','iIdKUi3LRzJLNkJMIjBLT7lOV4FMNj8'];_0x4f95=function(){return _0x307218;};return _0x4f95();}const inquirer_1=__importDefault(require(_0x4fdf(0x335))),chalk_1=__importDefault(require(_0x4fdf(0x1f0))),fs=__importStar(require('fs')),path=__importStar(require(_0x4fdf(0x222))),index_1=require(_0x4fdf(0x1d2)),services_1=require('../../../core/services'),utils_1=require('../../../core/utils'),configTracker=__importStar(require(_0x4fdf(0x28e))),dept_repo_1=require(_0x4fdf(0x2cd)),job_repo_1=require(_0x4fdf(0x301));async function showFeishuConfigMenu(){while(!![]){const _0x2159e8=getConfiguredAgents(),_0x2a089d=Object[_0x4fdf(0x28b)](_0x2159e8)[_0x4fdf(0x1e6)],_0x278c95=[new inquirer_1[(_0x4fdf(0x2ef))]['Separator'](chalk_1['default'][_0x4fdf(0x2b5)][_0x4fdf(0x2d8)](_0x4fdf(0x1a1))),new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),{'name':'📋\x20查看已配置的\x20Agent\x20Bot\x20列表\x20('+_0x2a089d+_0x4fdf(0x224),'value':_0x4fdf(0x18b)},{'name':_0x4fdf(0x321),'value':_0x4fdf(0x192)},{'name':'✏️\x20\x20修改\x20Agent\x20的飞书配置','value':_0x4fdf(0x308)},{'name':'🗑️\x20删除\x20Agent\x20的飞书配置','value':_0x4fdf(0x195)},new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),new inquirer_1['default'][(_0x4fdf(0x2b0))](chalk_1['default'][_0x4fdf(0x2b5)][_0x4fdf(0x2d8)](_0x4fdf(0x25e))),new inquirer_1['default'][(_0x4fdf(0x2b0))](),{'name':_0x4fdf(0x221),'value':_0x4fdf(0x271)},{'name':_0x4fdf(0x196),'value':_0x4fdf(0x1dd)},new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](chalk_1['default'][_0x4fdf(0x2b5)][_0x4fdf(0x2d8)](_0x4fdf(0x2cb))),new inquirer_1[(_0x4fdf(0x2ef))]['Separator'](),{'name':_0x4fdf(0x306),'value':'showUserBinding'},{'name':_0x4fdf(0x268),'value':_0x4fdf(0x1e7)},{'name':_0x4fdf(0x32a),'value':_0x4fdf(0x2b7)},new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),new inquirer_1[(_0x4fdf(0x2ef))]['Separator'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)][_0x4fdf(0x2d8)]('🔐\x20配对管理')),new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),{'name':'🔐\x20配对管理(批准用户对话权限)','value':_0x4fdf(0x1a4)},new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),{'name':_0x4fdf(0x1e3),'value':'back'}],{action:_0x3bea7c}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':'list','name':'action','message':_0x4fdf(0x26c),'choices':_0x278c95,'loop':!![],'pageSize':0x14}]);switch(_0x3bea7c){case _0x4fdf(0x18b):await listConfiguredAgents();break;case _0x4fdf(0x192):await addFeishuBot();break;case'edit':await editFeishuBot();break;case'delete':await deleteFeishuBot();break;case _0x4fdf(0x271):await listFeishuGroups();break;case'bindGroup':await bindFeishuGroup();break;case _0x4fdf(0x2fb):await showUserFeishuBinding();break;case'bindUser':await bindUserFeishuId();break;case _0x4fdf(0x2b7):await unbindUserFeishu();break;case _0x4fdf(0x1a4):await showPairingMenu();break;case _0x4fdf(0x2e9):return;}}}function safeReadJsonConfig(_0x434e36){if(!fs['existsSync'](_0x434e36))return null;try{let _0x1f4389=fs[_0x4fdf(0x207)](_0x434e36,_0x4fdf(0x336));return _0x1f4389[_0x4fdf(0x1ff)](0x0)===0xfeff&&(_0x1f4389=_0x1f4389['slice'](0x1)),_0x1f4389=_0x1f4389[_0x4fdf(0x2c4)](/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,''),JSON[_0x4fdf(0x202)](_0x1f4389);}catch(_0x29864e){return console[_0x4fdf(0x2d0)](_0x4fdf(0x288),_0x29864e instanceof Error?_0x29864e[_0x4fdf(0x193)]:String(_0x29864e)),null;}}function getConfiguredAgents(){const _0x4a20ae=(0x0,utils_1[_0x4fdf(0x19a)])(),_0x395aa5=safeReadJsonConfig(_0x4a20ae);if(!_0x395aa5)return{};const _0x52c956=_0x395aa5[_0x4fdf(0x280)],_0x28c36b=_0x52c956?.['feishu'],_0x26c846=_0x28c36b?.[_0x4fdf(0x253)];if(!_0x26c846)return{};const _0x5608a9={};for(const [_0x31c0a5,_0x1344a7]of Object[_0x4fdf(0x201)](_0x26c846)){if(_0x31c0a5===_0x4fdf(0x2ef))continue;const _0x4d3fb2=_0x1344a7;_0x4d3fb2?.[_0x4fdf(0x197)]&&(_0x5608a9[_0x31c0a5]={'appId':_0x4d3fb2[_0x4fdf(0x197)],'name':_0x4d3fb2[_0x4fdf(0x21d)]||_0x4d3fb2[_0x4fdf(0x215)]});}return _0x5608a9;}async function listConfiguredAgents(){const _0x4a729c=getConfiguredAgents(),_0x24c806=Object[_0x4fdf(0x28b)](_0x4a729c);if(_0x24c806[_0x4fdf(0x1e6)]===0x0){console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x228)](_0x4fdf(0x23c))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2be))),await index_1[_0x4fdf(0x1c0)]['waitForKey']();return;}console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x320))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1a3)[_0x4fdf(0x22c)](0x1e))+chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x292)['padEnd'](0x14))+chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('App\x20ID')),index_1[_0x4fdf(0x1c0)][_0x4fdf(0x32c)]();for(const _0x1b6c34 of _0x24c806){const _0x1d016f=_0x4a729c[_0x1b6c34],_0x6105db=services_1[_0x4fdf(0x25a)][_0x4fdf(0x1a6)](_0x1b6c34),_0x57ad7d=_0x6105db?.['name']||_0x1b6c34,_0x1ce545=_0x1d016f[_0x4fdf(0x21d)]||'-';console[_0x4fdf(0x2db)](''+_0x1b6c34['padEnd'](0x1e)+_0x1ce545[_0x4fdf(0x22c)](0x14)+_0x1d016f[_0x4fdf(0x197)]);}console[_0x4fdf(0x2db)](''),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();}async function addFeishuBot(){const _0x5f310b=services_1[_0x4fdf(0x25a)][_0x4fdf(0x189)]();if(_0x5f310b['length']===0x0){index_1[_0x4fdf(0x1c0)][_0x4fdf(0x279)](_0x4fdf(0x29d));return;}const _0x45620f=getConfiguredAgents(),_0x4e4a20=_0x5f310b[_0x4fdf(0x304)](_0x2979b9=>!_0x45620f[_0x2979b9['id']]);if(_0x4e4a20[_0x4fdf(0x1e6)]===0x0){console[_0x4fdf(0x2db)](chalk_1['default']['yellow'](_0x4fdf(0x214))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x229))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}const _0x10d509=_0x4e4a20[_0x4fdf(0x294)](_0x2a5bf1=>{const _0xe3e0c2=_0x2a5bf1[_0x4fdf(0x210)]?dept_repo_1['departmentRepository'][_0x4fdf(0x205)](_0x2a5bf1['department_id']):null,_0x79fdb4=_0x2a5bf1[_0x4fdf(0x26b)]?job_repo_1[_0x4fdf(0x19c)][_0x4fdf(0x205)](_0x2a5bf1['job_id']):null,_0x1759fe={'manager':_0x4fdf(0x194),'executor':'执行者','reviewer':_0x4fdf(0x291),'assistant':_0x4fdf(0x2bb),'watchdog':_0x4fdf(0x266)};return{..._0x2a5bf1,'deptName':_0xe3e0c2?.[_0x4fdf(0x21d)]||'未分配','jobName':_0x79fdb4?.['name']||_0x4fdf(0x286),'roleDisplay':_0x1759fe[_0x2a5bf1['role']]||_0x2a5bf1[_0x4fdf(0x1d6)]};});console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)]['cyan'](_0x4fdf(0x2c1))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x321))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)]['cyan'](_0x4fdf(0x244))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x228)](_0x4fdf(0x1a2))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)]('\x20\x20https://www.feishu.cn/content/article/7602519239445974205\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x228)](_0x4fdf(0x28f))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x2d8)](_0x4fdf(0x1cb))),console[_0x4fdf(0x2db)](chalk_1['default']['dim'](_0x4fdf(0x259))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20点击「创建企业自建应用」,填写应用信息\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x2ae))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x23d))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20开启机器人能力,设置机器人名称\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x338))),console['log'](chalk_1['default']['dim'](_0x4fdf(0x295))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20复制以下\x20JSON\x20内容直接导入:\x0a')),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x2b5)](_0x4fdf(0x18c))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)](_0x4fdf(0x2b6))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)]('\x20\x20\x20\x20\x20\x20\x22tenant\x22:\x20[')),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x2b5)](_0x4fdf(0x2bf))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)](_0x4fdf(0x212))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)](_0x4fdf(0x2e8))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['cyan'](_0x4fdf(0x19d))),console[_0x4fdf(0x2db)](chalk_1['default']['cyan']('\x20\x20\x20\x20\x20\x20\x20\x20\x22im:message:send_as_bot\x22,')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)](_0x4fdf(0x309))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x2b5)]('\x20\x20\x20\x20\x20\x20]')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)](_0x4fdf(0x19e))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['cyan'](_0x4fdf(0x1ba))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20提示:可根据实际需求添加更多权限\x0a')),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x2ce))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x227))),console['log'](chalk_1['default']['dim'](_0x4fdf(0x1a0))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20添加事件:im.message.receive_v1\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x334))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('\x20\x20•\x20进入「消息卡片」→「回调配置」页面')),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x19f))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x262))),console['log'](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x1ee))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x1c1))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x236))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x2d8)](_0x4fdf(0x2cf))),console[_0x4fdf(0x2db)](chalk_1['default']['dim'](_0x4fdf(0x299))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x234))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x244)));const {agentId:_0x2b5d4b}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':'list','name':_0x4fdf(0x327),'message':'选择要配置飞书\x20Bot\x20的\x20Agent:','choices':[..._0x10d509[_0x4fdf(0x294)](_0x33c1d3=>({'name':_0x33c1d3[_0x4fdf(0x21d)]+'\x20|\x20'+_0x33c1d3[_0x4fdf(0x1f2)]+_0x4fdf(0x2c6)+_0x33c1d3['roleDisplay']+_0x4fdf(0x2c6)+_0x33c1d3[_0x4fdf(0x272)],'value':_0x33c1d3['id']})),new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),{'name':_0x4fdf(0x21c),'value':_0x4fdf(0x307)}],'loop':!![]}]);if(_0x2b5d4b===_0x4fdf(0x307))return;const _0x404705=services_1[_0x4fdf(0x25a)]['getById'](_0x2b5d4b);console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('\x0a请输入飞书开放平台的应用凭证:')),console[_0x4fdf(0x2db)](chalk_1['default']['dim'](_0x4fdf(0x248)));const {appId:_0x35c8d4,appSecret:_0x86bd38,dmPolicy:_0x4e291e}=await inquirer_1['default']['prompt']([{'type':_0x4fdf(0x2fc),'name':_0x4fdf(0x197),'message':_0x4fdf(0x31d)},{'type':_0x4fdf(0x29f),'name':_0x4fdf(0x332),'message':_0x4fdf(0x2e2)},{'type':_0x4fdf(0x18b),'name':'dmPolicy','message':'私聊策略:','choices':[{'name':_0x4fdf(0x1f1),'value':_0x4fdf(0x1a4)},{'name':_0x4fdf(0x198),'value':_0x4fdf(0x1f5)},{'name':_0x4fdf(0x2c2),'value':_0x4fdf(0x1b4)}],'default':_0x4fdf(0x1a4),'loop':!![]}]);if(!_0x35c8d4?.[_0x4fdf(0x22b)]()||!_0x35c8d4['startsWith'](_0x4fdf(0x216))){index_1[_0x4fdf(0x1c0)]['printError'](_0x4fdf(0x24d));return;}if(!_0x86bd38?.['trim']()){index_1[_0x4fdf(0x1c0)]['printError'](_0x4fdf(0x1c5));return;}const _0x36f5fc=(0x0,utils_1[_0x4fdf(0x19a)])(),_0x592644=safeReadJsonConfig(_0x36f5fc)||{'gateway':{'port':0x7075,'mode':_0x4fdf(0x2e0),'bind':'loopback','auth':{'mode':'token','token':_0x4fdf(0x20d)}},'agents':{'defaults':{},'list':[]},'bindings':[],'models':{'providers':{}},'channels':{}};if(!_0x592644[_0x4fdf(0x280)])_0x592644[_0x4fdf(0x280)]={};const _0x3a7cb4=_0x592644[_0x4fdf(0x280)],_0x5c223a=!_0x3a7cb4[_0x4fdf(0x225)];!_0x3a7cb4[_0x4fdf(0x225)]&&(_0x3a7cb4[_0x4fdf(0x225)]={'enabled':!![],'dmPolicy':_0x4fdf(0x1a4),'connectionMode':_0x4fdf(0x185),'accounts':{}});const _0x553747=_0x3a7cb4['feishu'];!_0x553747[_0x4fdf(0x253)]&&(_0x553747[_0x4fdf(0x253)]={});const _0x2d213e=_0x553747['accounts'];console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2a7)+(Object[_0x4fdf(0x28b)](_0x2d213e)[_0x4fdf(0x2d6)](',\x20')||'无')));const _0x521457=_0x2d213e[_0x2b5d4b]?{[_0x2b5d4b]:_0x2d213e[_0x2b5d4b]}:undefined;_0x2d213e[_0x2b5d4b]={'appId':_0x35c8d4[_0x4fdf(0x22b)](),'appSecret':_0x86bd38[_0x4fdf(0x22b)]()};!_0x553747['enabled']&&(_0x553747['enabled']=!![]);!_0x553747[_0x4fdf(0x1fe)]&&(_0x553747[_0x4fdf(0x1fe)]=_0x4e291e);!_0x553747[_0x4fdf(0x260)]&&(_0x553747['connectionMode']=_0x4fdf(0x185));console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1a5)+Object[_0x4fdf(0x28b)](_0x2d213e)[_0x4fdf(0x2d6)](',\x20')));if(!_0x592644[_0x4fdf(0x1aa)])_0x592644[_0x4fdf(0x1aa)]={};const _0x582ac3=_0x592644[_0x4fdf(0x1aa)];if(!_0x582ac3[_0x4fdf(0x201)])_0x582ac3[_0x4fdf(0x201)]={};const _0xc51626=_0x582ac3[_0x4fdf(0x201)];if(!_0xc51626[_0x4fdf(0x225)])_0xc51626['feishu']={};const _0x17e1ca=_0xc51626[_0x4fdf(0x225)];_0x17e1ca[_0x4fdf(0x1ce)]=!![];if(!_0x592644['bindings'])_0x592644['bindings']=[];const _0x5e0cec=_0x592644[_0x4fdf(0x329)],_0x445be1=_0x5e0cec[_0x4fdf(0x2ec)](_0x57d663=>_0x57d663[_0x4fdf(0x327)]===_0x2b5d4b&&_0x57d663[_0x4fdf(0x1f7)]?.['channel']===_0x4fdf(0x225)),_0x67aa2={'agentId':_0x2b5d4b,'match':{'channel':_0x4fdf(0x225),'accountId':_0x2b5d4b}};_0x445be1>=0x0?_0x5e0cec[_0x445be1]=_0x67aa2:_0x5e0cec['push'](_0x67aa2),fs[_0x4fdf(0x220)](_0x36f5fc,JSON[_0x4fdf(0x22e)](_0x592644,null,0x2),_0x4fdf(0x336)),_0x5c223a&&configTracker[_0x4fdf(0x25c)]({'change_type':'channel_config','action':_0x4fdf(0x192),'target_path':_0x4fdf(0x296),'target_type':_0x4fdf(0x296),'new_value':JSON[_0x4fdf(0x22e)](_0x3a7cb4[_0x4fdf(0x225)]),'description':_0x4fdf(0x1fc)}),configTracker[_0x4fdf(0x25c)]({'change_type':_0x4fdf(0x270),'action':_0x521457?'update':_0x4fdf(0x192),'target_path':_0x4fdf(0x2ac)+_0x2b5d4b,'target_type':'channels.feishu','old_value':_0x521457?JSON[_0x4fdf(0x22e)](_0x521457):undefined,'new_value':JSON[_0x4fdf(0x22e)]({[_0x2b5d4b]:_0x2d213e[_0x2b5d4b]}),'related_id':_0x2b5d4b,'description':'配置飞书账号:\x20'+_0x2b5d4b}),configTracker[_0x4fdf(0x28d)](_0x67aa2,_0x2b5d4b),services_1['agentService'][_0x4fdf(0x1fd)](_0x2b5d4b,{'feishu_bot_id':_0x2b5d4b}),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)](_0x4fdf(0x300)+_0x404705?.[_0x4fdf(0x21d)]+_0x4fdf(0x28a))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20App\x20ID:\x20'+_0x35c8d4)),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2e6)+_0x2b5d4b)),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x1b1)+_0x4e291e)),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x2c1))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)]['yellow'](_0x4fdf(0x20b))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x30c))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)]('\x20\x20openclaw\x20gateway')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x29c))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x1ac))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20用户在飞书搜索并添加机器人')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20用户发送私聊消息,机器人返回配对码')),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20使用本工具「配对管理」输入配对码完成授权\x0a')),console['log'](chalk_1['default'][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x244))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();}async function editFeishuBot(){const _0x1d6280=getConfiguredAgents(),_0x3bc313=Object['keys'](_0x1d6280);if(_0x3bc313[_0x4fdf(0x1e6)]===0x0){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['yellow'](_0x4fdf(0x23c))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x1e4)));const _0x3e2903=_0x3bc313[_0x4fdf(0x294)](_0x4cc4f8=>{const _0x348cad=services_1[_0x4fdf(0x25a)][_0x4fdf(0x1a6)](_0x4cc4f8),_0x5c5961=_0x1d6280[_0x4cc4f8],_0x4dbb42=_0x348cad?.[_0x4fdf(0x210)]?dept_repo_1['departmentRepository'][_0x4fdf(0x205)](_0x348cad[_0x4fdf(0x210)]):null,_0x479fee=_0x348cad?.['job_id']?job_repo_1[_0x4fdf(0x19c)][_0x4fdf(0x205)](_0x348cad[_0x4fdf(0x26b)]):null,_0x2e74a3={'manager':'管理者','executor':_0x4fdf(0x2a0),'reviewer':'审核者','assistant':'总助理','watchdog':_0x4fdf(0x266)};return{'id':_0x4cc4f8,'agent':_0x348cad,'info':_0x5c5961,'deptName':_0x4dbb42?.['name']||'未分配','jobName':_0x479fee?.[_0x4fdf(0x21d)]||_0x4fdf(0x286),'roleDisplay':_0x2e74a3[_0x348cad?.[_0x4fdf(0x1d6)]||'']||_0x348cad?.[_0x4fdf(0x1d6)]||'未知'};}),{agentId:_0x2c41c3}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x18b),'name':_0x4fdf(0x327),'message':_0x4fdf(0x269),'choices':[..._0x3e2903[_0x4fdf(0x294)](_0x376be2=>({'name':(_0x376be2[_0x4fdf(0x206)]?.[_0x4fdf(0x21d)]||_0x376be2['id'])+'\x20|\x20'+_0x376be2['deptName']+_0x4fdf(0x2c6)+_0x376be2[_0x4fdf(0x18d)]+_0x4fdf(0x2c6)+_0x376be2['jobName']+'\x20('+(_0x376be2[_0x4fdf(0x203)][_0x4fdf(0x21d)]||_0x376be2[_0x4fdf(0x203)][_0x4fdf(0x197)])+')','value':_0x376be2['id']})),new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),{'name':_0x4fdf(0x21c),'value':'cancel'}],'loop':!![]}]);if(_0x2c41c3==='cancel')return;const _0x3a2960=(0x0,utils_1[_0x4fdf(0x19a)])(),_0x3af930=safeReadJsonConfig(_0x3a2960),_0x4317c9=_0x3af930?.[_0x4fdf(0x280)],_0x2d769a=_0x4317c9?.['feishu'],_0xfafa86=_0x2d769a?.['accounts'],_0x43d078=_0xfafa86?.[_0x2c41c3];if(!_0x2d769a){index_1[_0x4fdf(0x1c0)][_0x4fdf(0x2a1)](_0x4fdf(0x2d9));return;}if(!_0x43d078){index_1[_0x4fdf(0x1c0)][_0x4fdf(0x2a1)](_0x4fdf(0x1b8));return;}const _0x1e4446=services_1[_0x4fdf(0x25a)]['getById'](_0x2c41c3),_0x88842c=_0x2d769a?.[_0x4fdf(0x1fe)]||'pairing';console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x204))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('\x20\x20App\x20ID:\x20'+_0x43d078['appId'])),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1b1)+_0x88842c+'\x0a'));const {fields:_0x43230c}=await inquirer_1[_0x4fdf(0x2ef)]['prompt']([{'type':_0x4fdf(0x1ed),'name':'fields','message':_0x4fdf(0x1ab),'choices':[{'name':_0x4fdf(0x2ed),'value':'appSecret'},{'name':_0x4fdf(0x1e0),'value':_0x4fdf(0x1fe)}]}]);if(_0x43230c[_0x4fdf(0x1e6)]===0x0){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1e9)));return;}if(_0x43230c[_0x4fdf(0x1b5)](_0x4fdf(0x332))){const {appSecret:_0x1ea16b}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x29f),'name':'appSecret','message':_0x4fdf(0x330)}]);_0x1ea16b?.['trim']()&&(_0x43d078['appSecret']=_0x1ea16b['trim']());}if(_0x43230c[_0x4fdf(0x1b5)]('dmPolicy')){const {dmPolicy:_0x486cf9}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':'list','name':_0x4fdf(0x1fe),'message':'新的私聊策略:','choices':[{'name':'pairing\x20-\x20需配对批准','value':_0x4fdf(0x1a4)},{'name':'open\x20-\x20允许所有用户私聊','value':_0x4fdf(0x1f5)},{'name':'disabled\x20-\x20禁用私聊','value':_0x4fdf(0x1b4)}],'default':_0x88842c,'loop':!![]}]);_0x2d769a['dmPolicy']=_0x486cf9;}fs[_0x4fdf(0x220)](_0x3a2960,JSON['stringify'](_0x3af930,null,0x2),_0x4fdf(0x336)),console['log'](chalk_1[_0x4fdf(0x2ef)]['green'](_0x4fdf(0x331))),await index_1[_0x4fdf(0x1c0)]['waitForKey']();}async function deleteFeishuBot(){const _0x3fed4f=getConfiguredAgents(),_0x27dde3=Object['keys'](_0x3fed4f);if(_0x27dde3[_0x4fdf(0x1e6)]===0x0){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x23c))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['bold'](_0x4fdf(0x20c))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x22d)));const {agentId:_0x40a50b}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x18b),'name':_0x4fdf(0x327),'message':'选择要删除的\x20Agent\x20配置:','choices':[..._0x27dde3['map'](_0xd18adf=>{const _0x329384=services_1['agentService'][_0x4fdf(0x1a6)](_0xd18adf),_0x4ad01f=_0x3fed4f[_0xd18adf];return{'name':(_0x329384?.[_0x4fdf(0x21d)]||_0xd18adf)+'\x20('+_0xd18adf+_0x4fdf(0x2c0)+(_0x4ad01f[_0x4fdf(0x21d)]||_0x4ad01f['appId']),'value':_0xd18adf};}),new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),{'name':_0x4fdf(0x21c),'value':_0x4fdf(0x307)}],'loop':!![]}]);if(_0x40a50b==='cancel')return;const {confirm:_0x220eae}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x30d),'name':_0x4fdf(0x30d),'message':'确认删除该飞书\x20Bot\x20配置?','default':![]}]);if(!_0x220eae){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2a8)));return;}const _0x2f1d1e=(0x0,utils_1[_0x4fdf(0x19a)])(),_0x899728=safeReadJsonConfig(_0x2f1d1e);if(!_0x899728){index_1[_0x4fdf(0x1c0)][_0x4fdf(0x2a1)](_0x4fdf(0x1cc));return;}const _0x242e69=_0x899728[_0x4fdf(0x280)],_0xb1b7c5=_0x242e69?.['feishu'],_0x272085=_0xb1b7c5?.[_0x4fdf(0x253)],_0x4e8a5d=_0x272085?.[_0x40a50b]?JSON[_0x4fdf(0x22e)](_0x272085[_0x40a50b]):undefined,_0x382118=Array['isArray'](_0x899728[_0x4fdf(0x329)])?[..._0x899728['bindings']]:[];_0x272085&&_0x272085[_0x40a50b]&&delete _0x272085[_0x40a50b];_0x899728[_0x4fdf(0x329)]&&Array[_0x4fdf(0x257)](_0x899728[_0x4fdf(0x329)])&&(_0x899728[_0x4fdf(0x329)]=_0x899728[_0x4fdf(0x329)][_0x4fdf(0x304)](_0x5a604b=>!(_0x5a604b['agentId']===_0x40a50b&&_0x5a604b[_0x4fdf(0x1f7)]?.['channel']===_0x4fdf(0x225))));_0x4e8a5d&&configTracker[_0x4fdf(0x25c)]({'change_type':'channel_config','action':_0x4fdf(0x24f),'target_path':_0x4fdf(0x2ac)+_0x40a50b,'target_type':_0x4fdf(0x296),'old_value':_0x4e8a5d,'related_id':_0x40a50b,'description':_0x4fdf(0x2b4)+_0x40a50b});const _0x411005=Array[_0x4fdf(0x257)](_0x899728['bindings'])?_0x899728[_0x4fdf(0x329)]:[];_0x382118[_0x4fdf(0x1e6)]>_0x411005[_0x4fdf(0x1e6)]&&configTracker['recordConfigChange']({'change_type':'binding_delete','action':_0x4fdf(0x24f),'target_path':'bindings','target_type':_0x4fdf(0x329),'old_value':JSON[_0x4fdf(0x22e)](_0x382118),'new_value':JSON[_0x4fdf(0x22e)](_0x411005),'related_id':_0x40a50b,'description':_0x4fdf(0x31c)+_0x40a50b+_0x4fdf(0x2b3)}),fs[_0x4fdf(0x220)](_0x2f1d1e,JSON[_0x4fdf(0x22e)](_0x899728,null,0x2),'utf-8'),services_1['agentService'][_0x4fdf(0x1fd)](_0x40a50b,{'feishu_bot_id':null}),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)](_0x4fdf(0x2df))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x2da))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)](_0x4fdf(0x2b1))),await index_1[_0x4fdf(0x1c0)]['waitForKey']();}async function listFeishuGroups(){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x1e2)));const {departmentRepository:_0x2bf5f7}=await Promise[_0x4fdf(0x1e1)]()['then'](()=>__importStar(require('../../../db/repositories/dept.repo'))),_0x38a7a8=_0x2bf5f7[_0x4fdf(0x1b3)]();if(_0x38a7a8[_0x4fdf(0x1e6)]===0x0)console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('暂无事业部\x0a'));else{console['log'](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x1d0)['padEnd'](0x14))+chalk_1['default'][_0x4fdf(0x24b)]('飞书群ID')),index_1[_0x4fdf(0x1c0)]['printDivider']();for(const _0x4f3608 of _0x38a7a8){const _0x5b049c=_0x4f3608[_0x4fdf(0x2a6)]||'-';console[_0x4fdf(0x2db)](''+(_0x4f3608[_0x4fdf(0x21d)]||'-')[_0x4fdf(0x22c)](0x14)+_0x5b049c);}console[_0x4fdf(0x2db)]('');}const _0x3abbfa=(0x0,utils_1[_0x4fdf(0x19a)])(),_0x2405ac=safeReadJsonConfig(_0x3abbfa),_0x413feb=_0x2405ac?.[_0x4fdf(0x329)]||[],_0x8115d5=_0x413feb[_0x4fdf(0x304)](_0x4ff2f1=>_0x4ff2f1[_0x4fdf(0x1f7)]?.[_0x4fdf(0x1bf)]===_0x4fdf(0x225));if(_0x8115d5['length']>0x0){console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x2d8)](_0x4fdf(0x23f))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x1a3)[_0x4fdf(0x22c)](0x19))+chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('类型'['padEnd'](0xa))+chalk_1['default']['dim']('ID')),index_1[_0x4fdf(0x1c0)]['printDivider']();for(const _0x54671e of _0x8115d5){const _0x35acd1=_0x54671e[_0x4fdf(0x1f7)]?.['peer']?.[_0x4fdf(0x1e8)]||'unknown',_0x142b72=_0x54671e[_0x4fdf(0x1f7)]?.['peer']?.['id']||_0x54671e['match']?.[_0x4fdf(0x2a3)]||'*';console[_0x4fdf(0x2db)](''+(_0x54671e[_0x4fdf(0x327)]||'-')[_0x4fdf(0x22c)](0x19)+_0x35acd1[_0x4fdf(0x22c)](0xa)+_0x142b72);}console[_0x4fdf(0x2db)]('');}await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();}async function bindFeishuGroup(){try{console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x2a2)));const {departmentRepository:_0x4cf9fa}=await Promise[_0x4fdf(0x1e1)]()['then'](()=>__importStar(require('../../../db/repositories/dept.repo'))),_0x4d9c8c=_0x4cf9fa['findAll']();if(_0x4d9c8c[_0x4fdf(0x1e6)]===0x0){console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)]('暂无事业部,请先创建事业部\x0a')),await index_1[_0x4fdf(0x1c0)]['waitForKey']();return;}const {deptId:_0x253f73}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x18b),'name':'deptId','message':_0x4fdf(0x184),'choices':[..._0x4d9c8c[_0x4fdf(0x294)](_0x54eca9=>({'name':_0x54eca9[_0x4fdf(0x21d)]+'\x20('+_0x54eca9['id']+')'+(_0x54eca9['feishu_group_id']?_0x4fdf(0x1cd)+_0x54eca9[_0x4fdf(0x2a6)]+']':''),'value':_0x54eca9['id']})),new inquirer_1['default']['Separator'](),{'name':_0x4fdf(0x21c),'value':_0x4fdf(0x307)}],'loop':!![]}]);if(_0x253f73===_0x4fdf(0x307))return;const {groupId:_0xdb61b2}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x2fc),'name':_0x4fdf(0x267),'message':_0x4fdf(0x18a),'validate':_0x1f0a95=>{if(!_0x1f0a95['trim']())return _0x4fdf(0x1ca);if(!_0x1f0a95[_0x4fdf(0x2ea)](_0x4fdf(0x26f)))return'飞书群ID格式错误,应以\x20oc_\x20开头';return!![];}}]),_0x2de49e=_0x4d9c8c['find'](_0x1a354f=>_0x1a354f['id']===_0x253f73),_0x52f47c=_0x2de49e?.[_0x4fdf(0x2a6)];_0x4cf9fa[_0x4fdf(0x1fd)](_0x253f73,{'feishu_group_id':_0xdb61b2}),configTracker[_0x4fdf(0x302)](_0x253f73,_0x2de49e?.[_0x4fdf(0x21d)]||_0x253f73,_0xdb61b2,_0x52f47c);const _0x471e84=(0x0,utils_1['getOpenClawJsonPath'])(),_0x2d889f=safeReadJsonConfig(_0x471e84)||{};if(!_0x2d889f[_0x4fdf(0x280)])_0x2d889f[_0x4fdf(0x280)]={};const _0x39e267=_0x2d889f[_0x4fdf(0x280)];!_0x39e267[_0x4fdf(0x225)]&&(_0x39e267[_0x4fdf(0x225)]={'enabled':!![],'dmPolicy':'pairing','groupPolicy':'allowlist','accounts':{}});const _0x260a6b=_0x39e267[_0x4fdf(0x225)];!_0x260a6b[_0x4fdf(0x253)]&&(_0x260a6b[_0x4fdf(0x253)]={});_0x260a6b[_0x4fdf(0x20e)]=_0x4fdf(0x186);if(!_0x260a6b[_0x4fdf(0x27b)])_0x260a6b[_0x4fdf(0x27b)]=[];const _0x42e198=_0x260a6b['groupAllowFrom'],_0x172270=[..._0x42e198];!_0x42e198[_0x4fdf(0x1b5)](_0xdb61b2)&&(_0x42e198['push'](_0xdb61b2),configTracker[_0x4fdf(0x25c)]({'change_type':_0x4fdf(0x270),'action':'update','target_path':_0x4fdf(0x2eb),'target_type':_0x4fdf(0x296),'old_value':JSON[_0x4fdf(0x22e)](_0x172270),'new_value':JSON[_0x4fdf(0x22e)](_0x42e198),'related_id':_0xdb61b2,'description':'添加群到白名单:\x20'+_0xdb61b2}));if(!_0x260a6b[_0x4fdf(0x1d9)])_0x260a6b[_0x4fdf(0x1d9)]={};const _0x179170=_0x260a6b[_0x4fdf(0x1d9)];_0x179170[_0xdb61b2]={'requireMention':!![],'enabled':!![]};if(!_0x2d889f[_0x4fdf(0x329)])_0x2d889f[_0x4fdf(0x329)]=[];const _0x244667=_0x2d889f[_0x4fdf(0x329)],_0x44895a=services_1[_0x4fdf(0x25a)][_0x4fdf(0x189)]();console[_0x4fdf(0x2db)](chalk_1['default']['dim']('[调试]\x20总\x20Agent\x20数:\x20'+_0x44895a[_0x4fdf(0x1e6)]));const _0x339628=_0x44895a['filter'](_0x3611cb=>_0x3611cb[_0x4fdf(0x210)]===_0x253f73);console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2b2)+_0x253f73+_0x4fdf(0x285)+_0x339628[_0x4fdf(0x1e6)]));const _0x125c78=_0x44895a[_0x4fdf(0x1c4)](_0x3c3228=>_0x3c3228['id']===_0x4fdf(0x21b)||_0x3c3228[_0x4fdf(0x1d6)]===_0x4fdf(0x188));console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x25d)+(_0x125c78?.['id']||'未找到')));const _0x3bcb07=[..._0x339628];_0x125c78&&!_0x3bcb07[_0x4fdf(0x1c4)](_0x2ba92d=>_0x2ba92d['id']===_0x125c78['id'])&&_0x3bcb07[_0x4fdf(0x237)](_0x125c78);console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x1eb)+_0x3bcb07[_0x4fdf(0x1e6)]));if(_0x3bcb07[_0x4fdf(0x1e6)]===0x0){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['yellow'](_0x4fdf(0x1ec))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x325))),await index_1['tuiUtils'][_0x4fdf(0x1d5)]();return;}const _0x472ca5=_0x244667,_0xe51a23=_0x472ca5['filter'](_0x1a8c13=>_0x1a8c13[_0x4fdf(0x1f7)]?.[_0x4fdf(0x2b8)]?.['id']!==_0xdb61b2);for(const _0xe0b415 of _0x3bcb07){const _0x546d7d={'agentId':_0xe0b415['id'],'match':{'channel':'feishu','peer':{'kind':'group','id':_0xdb61b2}}};_0xe51a23['push'](_0x546d7d),configTracker[_0x4fdf(0x28d)](_0x546d7d);}_0x2d889f[_0x4fdf(0x329)]=_0xe51a23,console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('[调试]\x20保存配置到:\x20'+_0x471e84)),fs[_0x4fdf(0x220)](_0x471e84,JSON['stringify'](_0x2d889f,null,0x2),_0x4fdf(0x336)),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x298)));const {syncTeamFeishuGroup:_0x4dfcb6}=await Promise[_0x4fdf(0x1e1)]()['then'](()=>__importStar(require(_0x4fdf(0x283)))),_0x22922=_0x4dfcb6(_0x253f73,_0xdb61b2);console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('[调试]\x20已同步\x20'+_0x22922[_0x4fdf(0x1bd)]+_0x4fdf(0x2fa))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)](_0x4fdf(0x18f))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1af)+(_0x2de49e?.['name']||_0x253f73))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x245)+_0xdb61b2)),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x32f)+_0x3bcb07[_0x4fdf(0x1e6)]+'\x20个):'));for(const _0x5e3685 of _0x3bcb07){const _0x53ab58=_0x5e3685['role']===_0x4fdf(0x188)?_0x4fdf(0x32d):_0x5e3685['role']==='manager'?'[管理者]':_0x5e3685['role']===_0x4fdf(0x1b2)?_0x4fdf(0x1f6):'[执行者]';console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('\x20\x20-\x20'+_0x5e3685['name']+'\x20'+_0x53ab58));}console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('\x0a群组访问配置:')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1df))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x242))),console['log'](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x1b9))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x219))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x27d))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)]('\x0a⚠️\x20\x20请重启\x20Gateway\x20使配置生效')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20\x20\x201.\x20关闭当前运行的\x20Gateway(Ctrl+C)')),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x322))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x1c3))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)](_0x4fdf(0x249));}catch(_0x52ee90){console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x250)](_0x4fdf(0x1cf))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1ef)+(_0x52ee90 instanceof Error?_0x52ee90[_0x4fdf(0x193)]:String(_0x52ee90))+'\x0a')),await index_1[_0x4fdf(0x1c0)]['waitForKey']();}}async function showPairingMenu(){const {execSync:_0x161aaf}=require(_0x4fdf(0x2f4));while(!![]){const _0x2b6f0b=readFeishuPairingRequests();console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x1f3))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x23e)+getCredentialsDir()+'\x0a'));if(_0x2b6f0b['length']===0x0){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x297))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x1ae))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)](_0x4fdf(0x24a)+_0x2b6f0b[_0x4fdf(0x1e6)]+_0x4fdf(0x24e))),console['log'](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x29b)[_0x4fdf(0x22c)](0xf))+chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x312)['padEnd'](0x2d))+chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('账号')),index_1[_0x4fdf(0x1c0)][_0x4fdf(0x32c)]();for(const _0x177a75 of _0x2b6f0b){const _0x556493=_0x177a75['code']||'-',_0x5e2075=_0x177a75['id']||'-',_0x4d311e=_0x177a75[_0x4fdf(0x200)]?.[_0x4fdf(0x2a3)]||_0x177a75[_0x4fdf(0x2a3)]||_0x4fdf(0x2ef);console[_0x4fdf(0x2db)](_0x556493[_0x4fdf(0x22c)](0xf)+_0x5e2075[_0x4fdf(0x22c)](0x2d)+_0x4d311e);}console['log']('');const _0x2e3619=[..._0x2b6f0b[_0x4fdf(0x294)](_0x2d7333=>{const _0x2152a1=_0x2d7333[_0x4fdf(0x1c7)]||'-',_0x583386=_0x2d7333[_0x4fdf(0x200)]?.['accountId']||_0x2d7333[_0x4fdf(0x2a3)]||'default';return{'name':_0x4fdf(0x261)+_0x2152a1+'\x20('+_0x583386+')','value':{'code':_0x2d7333[_0x4fdf(0x1c7)],'userId':_0x2d7333['id'],'accountId':_0x2d7333[_0x4fdf(0x200)]?.['accountId']||_0x2d7333[_0x4fdf(0x2a3)]||'default'}};}),new inquirer_1[(_0x4fdf(0x2ef))][(_0x4fdf(0x2b0))](),{'name':'🔄\x20刷新列表','value':_0x4fdf(0x282)},{'name':_0x4fdf(0x263),'value':_0x4fdf(0x2e9)}],{action:_0x5bc9b7}=await inquirer_1['default'][_0x4fdf(0x19b)]([{'type':'list','name':_0x4fdf(0x326),'message':_0x4fdf(0x26c),'choices':_0x2e3619,'loop':!![]}]);if(_0x5bc9b7===_0x4fdf(0x2e9))return;if(_0x5bc9b7===_0x4fdf(0x282))continue;const {code:_0x2b7ec3,userId:_0x444ca2,accountId:_0x3f0039}=_0x5bc9b7,_0x275d43=_0x4fdf(0x324)+_0x2b7ec3;console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x2f2)+_0x275d43+'\x0a'));try{const _0x353c4f=_0x161aaf(_0x275d43,{'encoding':'utf-8','cwd':(0x0,utils_1[_0x4fdf(0x2d5)])()||undefined});console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)](_0x4fdf(0x240))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x353c4f)),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x305))),configTracker['recordConfigChange']({'change_type':_0x4fdf(0x2e5),'action':_0x4fdf(0x192),'target_path':_0x4fdf(0x1a8)+_0x3f0039,'target_type':_0x4fdf(0x255),'new_value':JSON['stringify']({'accountId':_0x3f0039,'userId':_0x444ca2}),'related_id':_0x3f0039,'description':_0x4fdf(0x2e3)+_0x444ca2+'\x20->\x20'+_0x3f0039});}catch(_0x5ee46f){console['log'](chalk_1['default'][_0x4fdf(0x250)]('\x0a✗\x20配对授权失败\x0a'));const _0x5204fc=_0x5ee46f instanceof Error?_0x5ee46f[_0x4fdf(0x281)]||_0x5ee46f[_0x4fdf(0x193)]:String(_0x5ee46f);console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x251)+_0x5204fc+'\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('可能原因:')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20配对码无效或已过期')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2b9))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x223))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x213)));}await index_1[_0x4fdf(0x1c0)]['waitForKey']();}}function _0x4fdf(_0x48970e,_0x524bb7){_0x48970e=_0x48970e-0x183;const _0x4f9551=_0x4f95();let _0x4fdf51=_0x4f9551[_0x48970e];if(_0x4fdf['XcctsA']===undefined){var _0x52908d=function(_0x539dd4){const _0x498b43='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x51718e='',_0x5ec0b7='';for(let _0x2840c2=0x0,_0x555b64,_0x25aeb0,_0x4b3fca=0x0;_0x25aeb0=_0x539dd4['charAt'](_0x4b3fca++);~_0x25aeb0&&(_0x555b64=_0x2840c2%0x4?_0x555b64*0x40+_0x25aeb0:_0x25aeb0,_0x2840c2++%0x4)?_0x51718e+=String['fromCharCode'](0xff&_0x555b64>>(-0x2*_0x2840c2&0x6)):0x0){_0x25aeb0=_0x498b43['indexOf'](_0x25aeb0);}for(let _0x404acc=0x0,_0x10a09a=_0x51718e['length'];_0x404acc<_0x10a09a;_0x404acc++){_0x5ec0b7+='%'+('00'+_0x51718e['charCodeAt'](_0x404acc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5ec0b7);};_0x4fdf['apXqES']=_0x52908d,_0x4fdf['ptrHAh']={},_0x4fdf['XcctsA']=!![];}const _0x3980d9=_0x4f9551[0x0],_0x5e097e=_0x48970e+_0x3980d9,_0xd332b9=_0x4fdf['ptrHAh'][_0x5e097e];return!_0xd332b9?(_0x4fdf51=_0x4fdf['apXqES'](_0x4fdf51),_0x4fdf['ptrHAh'][_0x5e097e]=_0x4fdf51):_0x4fdf51=_0xd332b9,_0x4fdf51;}async function scanGateways(){const _0x3b4464=require('http'),_0x2614d6=[],_0x2f5c6b=[0x7075,0x4965,0x9785,0xbe95],_0x3c29c6=(0x0,utils_1[_0x4fdf(0x19a)])(),_0x454cef=safeReadJsonConfig(_0x3c29c6),_0x439b6f=_0x454cef?.['gateway'],_0x499795=_0x439b6f?.[_0x4fdf(0x1c2)]||0x7075,_0x454483=_0x439b6f?.[_0x4fdf(0x26d)]?.['token'],_0x64a74e=[_0x499795,..._0x2f5c6b[_0x4fdf(0x304)](_0x28f376=>_0x28f376!==_0x499795)];for(const _0x46a20d of _0x64a74e){const _0x417997=await checkGatewayPort(_0x46a20d);if(_0x417997){const _0x2c4161=_0x46a20d===_0x499795?_0x454483:undefined,_0x47912a=_0x46a20d===_0x499795?_0x4fdf(0x2de):'自动发现';_0x2614d6[_0x4fdf(0x237)]({'port':_0x46a20d,'status':_0x4fdf(0x1f9),'token':_0x2c4161,'source':_0x47912a});}}return _0x2614d6;}function checkGatewayPort(_0xf18b19){const _0x39c620=require('http');return new Promise(_0x1ba0cc=>{const _0x1b908c=_0x39c620[_0x4fdf(0x246)]({'hostname':'127.0.0.1','port':_0xf18b19,'path':_0x4fdf(0x190),'method':_0x4fdf(0x199),'timeout':0x7d0},_0x33fa75=>{_0x1ba0cc(_0x33fa75[_0x4fdf(0x235)]===0xc8);});_0x1b908c['on'](_0x4fdf(0x2d0),()=>_0x1ba0cc(![])),_0x1b908c['on'](_0x4fdf(0x1d1),()=>{_0x1b908c[_0x4fdf(0x32e)](),_0x1ba0cc(![]);}),_0x1b908c[_0x4fdf(0x284)]();});}async function selectGateway(){console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x187)));const _0x5479e6=await scanGateways();if(_0x5479e6[_0x4fdf(0x1e6)]===0x0)return console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x1db))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x32b))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['cyan'](_0x4fdf(0x1d7))),null;if(_0x5479e6[_0x4fdf(0x1e6)]===0x1){const _0x4c5886=_0x5479e6[0x0];console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)](_0x4fdf(0x2e1)+_0x4c5886[_0x4fdf(0x1c2)]+'\x20('+_0x4c5886['source']+')\x0a'));if(_0x4c5886['token'])return{'port':_0x4c5886['port'],'token':_0x4c5886[_0x4fdf(0x2c5)]};const {token:_0x4ec689}=await inquirer_1[_0x4fdf(0x2ef)]['prompt']([{'type':_0x4fdf(0x29f),'name':_0x4fdf(0x2c5),'message':_0x4fdf(0x317)+_0x4c5886['port']+'):'}]);if(!_0x4ec689?.['trim']())return console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x318))),null;return{'port':_0x4c5886['port'],'token':_0x4ec689['trim']()};}console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('发现\x20'+_0x5479e6['length']+_0x4fdf(0x2e4)));const _0x152f43=_0x5479e6[_0x4fdf(0x294)](_0x3f1560=>({'name':_0x4fdf(0x2d4)+_0x3f1560[_0x4fdf(0x1c2)]+'\x20('+_0x3f1560[_0x4fdf(0x1f4)]+')'+(_0x3f1560[_0x4fdf(0x2c5)]?'\x20[已配置Token]':''),'value':_0x3f1560})),{selected:_0x206d49}=await inquirer_1['default'][_0x4fdf(0x19b)]([{'type':'list','name':_0x4fdf(0x191),'message':_0x4fdf(0x31b),'choices':_0x152f43,'loop':!![]}]);if(_0x206d49['token'])return{'port':_0x206d49['port'],'token':_0x206d49['token']};const {token:_0x3a1b48}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x29f),'name':_0x4fdf(0x2c5),'message':_0x4fdf(0x317)+_0x206d49[_0x4fdf(0x1c2)]+'):'}]);if(!_0x3a1b48?.['trim']())return console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x318))),null;return{'port':_0x206d49[_0x4fdf(0x1c2)],'token':_0x3a1b48[_0x4fdf(0x22b)]()};}class GatewayClient{[_0x4fdf(0x1a9)]=null;[_0x4fdf(0x337)](_0x45f767){this[_0x4fdf(0x1a9)]=_0x45f767;}async[_0x4fdf(0x22a)](){if(this['gateway'])return!![];const _0x226d9c=await selectGateway();if(!_0x226d9c)return![];return this['gateway']=_0x226d9c,!![];}async['callMethod'](_0x1bb4dc,_0x90a7f0={}){if(!this[_0x4fdf(0x1a9)])return{'success':![],'error':_0x4fdf(0x313)};const _0x71b263=this[_0x4fdf(0x1a9)],_0x4f3a70=require('ws'),_0x560fab=_0x4fdf(0x20a)+_0x71b263[_0x4fdf(0x1c2)]+_0x4fdf(0x2ca),_0x1382fd=_0x4fdf(0x2ee)+_0x71b263[_0x4fdf(0x1c2)];return new Promise(_0x44b0c6=>{const _0x58d81f=new _0x4f3a70(_0x560fab,{'headers':{'Origin':_0x1382fd}});let _0x39ee51=![];const _0x5e1779=_0x4fdf(0x2bd)+Date[_0x4fdf(0x323)](),_0xcbbf11=_0x4fdf(0x2ab)+Date['now'](),_0x7d6692=setTimeout(()=>{!_0x39ee51&&(_0x39ee51=!![],_0x58d81f[_0x4fdf(0x314)](),_0x44b0c6({'success':![],'error':'连接超时'}));},0x3a98);_0x58d81f['on']('open',()=>{}),_0x58d81f['on'](_0x4fdf(0x193),_0x2b4552=>{try{const _0x5c7b9e=JSON[_0x4fdf(0x202)](_0x2b4552[_0x4fdf(0x2a5)]());if(_0x5c7b9e[_0x4fdf(0x2bc)]==='event'&&_0x5c7b9e[_0x4fdf(0x264)]===_0x4fdf(0x287)){_0x58d81f['send'](JSON[_0x4fdf(0x22e)]({'type':_0x4fdf(0x1bc),'id':_0x5e1779,'method':_0x4fdf(0x303),'params':{'minProtocol':0x3,'maxProtocol':0x3,'client':{'id':'openclaw-control-ui','version':_0x4fdf(0x293),'platform':process[_0x4fdf(0x2aa)],'mode':'ui'},'role':'operator','scopes':[_0x4fdf(0x30b)],'auth':{'token':_0x71b263[_0x4fdf(0x2c5)]}}}));return;}if(_0x5c7b9e['type']===_0x4fdf(0x2cc)&&_0x5c7b9e['id']===_0x5e1779){if(_0x5c7b9e['ok'])_0x58d81f['send'](JSON[_0x4fdf(0x22e)]({'type':_0x4fdf(0x1bc),'id':_0xcbbf11,'method':_0x1bb4dc,'params':_0x90a7f0}));else{clearTimeout(_0x7d6692),_0x39ee51=!![],_0x58d81f[_0x4fdf(0x314)]();const _0x2acd2f=_0x5c7b9e['error']?.[_0x4fdf(0x193)]||_0x5c7b9e['error']?.[_0x4fdf(0x1c8)]||JSON['stringify'](_0x5c7b9e[_0x4fdf(0x2d0)]);_0x44b0c6({'success':![],'error':_0x4fdf(0x310)+_0x2acd2f});}return;}if(_0x5c7b9e[_0x4fdf(0x2bc)]===_0x4fdf(0x2cc)&&_0x5c7b9e['id']===_0xcbbf11){clearTimeout(_0x7d6692),_0x39ee51=!![],_0x58d81f[_0x4fdf(0x314)]();if(_0x5c7b9e['ok'])_0x44b0c6({'success':!![],'result':_0x5c7b9e[_0x4fdf(0x339)]||_0x5c7b9e[_0x4fdf(0x1b7)]});else{const _0x1a07ed=_0x5c7b9e[_0x4fdf(0x2d0)]?.[_0x4fdf(0x193)]||_0x5c7b9e[_0x4fdf(0x2d0)]?.[_0x4fdf(0x1c8)]||JSON[_0x4fdf(0x22e)](_0x5c7b9e[_0x4fdf(0x2d0)]);_0x44b0c6({'success':![],'error':_0x1a07ed});}return;}}catch(_0x1aa437){}}),_0x58d81f['on'](_0x4fdf(0x2d0),_0x16ab24=>{clearTimeout(_0x7d6692),!_0x39ee51&&(_0x39ee51=!![],_0x44b0c6({'success':![],'error':_0x4fdf(0x1de)+_0x16ab24[_0x4fdf(0x193)]}));}),_0x58d81f['on'](_0x4fdf(0x314),(_0x727e42,_0x1c254a)=>{clearTimeout(_0x7d6692);if(!_0x39ee51){_0x39ee51=!![];const _0x555af3=_0x1c254a[_0x4fdf(0x2a5)]()||_0x4fdf(0x2a9)+_0x727e42;_0x44b0c6({'success':![],'error':'连接已关闭:\x20'+_0x555af3});}});});}[_0x4fdf(0x1e5)](){if(!this[_0x4fdf(0x1a9)])return{'needsConfig':![],'message':''};const _0x5c7dce=(0x0,utils_1['getOpenClawJsonPath'])(),_0x35aed7=safeReadJsonConfig(_0x5c7dce);if(!_0x35aed7)return{'needsConfig':!![],'message':'无法读取配置文件'};const _0x5a0341=_0x35aed7[_0x4fdf(0x1a9)],_0x31a871=_0x5a0341?.['controlUi'];if(_0x31a871?.[_0x4fdf(0x1c6)]!==!![])return{'needsConfig':!![],'message':'需要在\x20openclaw.json\x20中添加以下配置:\x0a\x0a\x20\x20\x22gateway\x22:\x20{\x0a\x20\x20\x20\x20\x22controlUi\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22allowInsecureAuth\x22:\x20true\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x0a或者配置允许的\x20origin:\x0a\x0a\x20\x20\x22gateway\x22:\x20{\x0a\x20\x20\x20\x20\x22controlUi\x22:\x20{\x0a\x20\x20\x20\x20\x20\x20\x22allowedOrigins\x22:\x20[\x22http://127.0.0.1:'+this[_0x4fdf(0x1a9)][_0x4fdf(0x1c2)]+_0x4fdf(0x27c)};return{'needsConfig':![],'message':''};}async['listPairingRequests'](){const _0x1b3fc8=await this[_0x4fdf(0x1d3)](_0x4fdf(0x21f),{});if(!_0x1b3fc8[_0x4fdf(0x239)])return{'success':![],'error':_0x1b3fc8['error']};const _0x35ea28=_0x1b3fc8['result'];return{'success':!![],'pending':_0x35ea28[_0x4fdf(0x1da)]||[]};}async['approvePairing'](_0x2618d7){const _0x597a3c=await this['callMethod'](_0x4fdf(0x2e7),{'requestId':_0x2618d7});if(!_0x597a3c['success'])return{'success':![],'error':_0x597a3c[_0x4fdf(0x2d0)]};return{'success':!![]};}}const gatewayClient=new GatewayClient();function getCredentialsDir(){const _0x35b0dc=require(_0x4fdf(0x222)),_0x5c65c2=require('os'),_0x32b010=(0x0,utils_1[_0x4fdf(0x2d5)])();if(_0x32b010)return _0x35b0dc['join'](_0x32b010,_0x4fdf(0x255));const _0x595983=(0x0,utils_1[_0x4fdf(0x19a)])();if(_0x595983){const _0x553d90=_0x35b0dc[_0x4fdf(0x2f7)](_0x595983);return _0x35b0dc[_0x4fdf(0x2d6)](_0x553d90,_0x4fdf(0x255));}if(process[_0x4fdf(0x243)]['OPENCLAW_CREDENTIALS_DIR'])return process[_0x4fdf(0x243)][_0x4fdf(0x20f)];if(process['env'][_0x4fdf(0x316)])return _0x35b0dc[_0x4fdf(0x2d6)](process[_0x4fdf(0x243)]['OPENCLAW_STATE_DIR'],_0x4fdf(0x255));return _0x35b0dc[_0x4fdf(0x2d6)](_0x5c65c2[_0x4fdf(0x1ad)](),_0x4fdf(0x2ba),_0x4fdf(0x255));}function getFeishuPairingFilePath(){const _0x24f81a=require('path');return _0x24f81a[_0x4fdf(0x2d6)](getCredentialsDir(),'feishu-pairing.json');}function readFeishuPairingRequests(){const _0x5b639f=getFeishuPairingFilePath();if(!fs['existsSync'](_0x5b639f))return[];try{const _0x4012d4=fs[_0x4fdf(0x207)](_0x5b639f,_0x4fdf(0x336)),_0x4b388f=JSON['parse'](_0x4012d4);return _0x4b388f[_0x4fdf(0x1d8)]||[];}catch{return[];}}function approveFeishuPairing(_0x33b1bd,_0x5443c4){const _0x3d6aeb=getCredentialsDir(),_0x629e8d=getFeishuPairingFilePath();console['log'](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x23e)+_0x3d6aeb)),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2f0)+_0x629e8d));if(!fs['existsSync'](_0x629e8d))return{'success':![],'error':_0x4fdf(0x1d4)};try{const _0x447cf9=fs[_0x4fdf(0x207)](_0x629e8d,'utf-8'),_0x502d7f=JSON['parse'](_0x447cf9),_0x39c44c=_0x502d7f[_0x4fdf(0x1d8)]||[];console['log'](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x2d7)+_0x39c44c[_0x4fdf(0x1e6)]));const _0x17cb48=_0x39c44c[_0x4fdf(0x2ec)](_0x14ca27=>_0x14ca27['code']&&_0x14ca27[_0x4fdf(0x1c7)][_0x4fdf(0x2f1)]()===_0x33b1bd['toUpperCase']());if(_0x17cb48<0x0)return{'success':![],'error':_0x4fdf(0x256)+_0x33b1bd+_0x4fdf(0x29e)};const _0x125ed0=_0x39c44c[_0x17cb48];console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x26e)+_0x125ed0['id'])),_0x39c44c['splice'](_0x17cb48,0x1),_0x502d7f[_0x4fdf(0x1d8)]=_0x39c44c;!fs['existsSync'](_0x3d6aeb)&&fs[_0x4fdf(0x230)](_0x3d6aeb,{'recursive':!![]});fs['writeFileSync'](_0x629e8d,JSON[_0x4fdf(0x22e)](_0x502d7f,null,0x2),_0x4fdf(0x336)),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x29a)));const _0x3b4220=_0x125ed0[_0x4fdf(0x200)]?.[_0x4fdf(0x2a3)]||_0x125ed0[_0x4fdf(0x2a3)];let _0x2539e6;if(_0x5443c4&&_0x5443c4!==_0x4fdf(0x2ef))_0x2539e6=_0x5443c4;else _0x3b4220?_0x2539e6=_0x3b4220:_0x2539e6=_0x4fdf(0x2ef);console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x27f)+_0x2539e6));const _0x3dacaf=_0x125ed0['id'],_0x4dde31=['feishu-allowFrom.json',_0x4fdf(0x2af)+_0x2539e6+_0x4fdf(0x2f8),_0x4fdf(0x238)];for(const _0xca73b1 of _0x4dde31){const _0x4a7a00=path['join'](_0x3d6aeb,_0xca73b1);let _0x10cf4d=[];if(fs[_0x4fdf(0x2ff)](_0x4a7a00))try{_0x10cf4d=JSON[_0x4fdf(0x202)](fs[_0x4fdf(0x207)](_0x4a7a00,_0x4fdf(0x336)))||[];}catch{_0x10cf4d=[];}!_0x10cf4d[_0x4fdf(0x1b5)](_0x3dacaf)&&(_0x10cf4d['push'](_0x3dacaf),fs[_0x4fdf(0x220)](_0x4a7a00,JSON[_0x4fdf(0x22e)](_0x10cf4d,null,0x2),_0x4fdf(0x336)),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x1dc)+_0xca73b1)));}return configTracker[_0x4fdf(0x25c)]({'change_type':'feishu_pairing_approve','action':_0x4fdf(0x192),'target_path':_0x4fdf(0x1a8)+_0x2539e6,'target_type':_0x4fdf(0x255),'new_value':JSON['stringify']({'accountId':_0x2539e6,'userId':_0x3dacaf}),'related_id':_0x2539e6,'description':_0x4fdf(0x2e3)+_0x3dacaf+_0x4fdf(0x2dc)+_0x2539e6}),{'success':!![],'userId':_0x3dacaf,'targetAccountId':_0x2539e6};}catch(_0x4e542a){return{'success':![],'error':_0x4e542a instanceof Error?_0x4e542a[_0x4fdf(0x193)]:String(_0x4e542a)};}}async function listPairingRequests(){console['log'](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x21e))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('凭证目录:\x20'+getCredentialsDir()+'\x0a'));const _0x4d1b6d=readFeishuPairingRequests();if(_0x4d1b6d[_0x4fdf(0x1e6)]===0x0)console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('暂无待批准的配对请求\x0a')),console[_0x4fdf(0x2db)](chalk_1['default']['dim'](_0x4fdf(0x232)));else{console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['bold'](_0x4fdf(0x24a)+_0x4d1b6d['length']+_0x4fdf(0x24e))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x29b)[_0x4fdf(0x22c)](0xf))+chalk_1['default']['dim'](_0x4fdf(0x312)[_0x4fdf(0x22c)](0x2d))+chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('账号')),index_1[_0x4fdf(0x1c0)][_0x4fdf(0x32c)]();for(const _0x3055e0 of _0x4d1b6d){const _0x1046f0=_0x3055e0[_0x4fdf(0x1c7)]||'-',_0x3173a2=_0x3055e0['id']||'-',_0x36d47d=_0x3055e0['accountId']||_0x3055e0[_0x4fdf(0x200)]?.['accountId']||'default';console[_0x4fdf(0x2db)](_0x1046f0['padEnd'](0xf)+_0x3173a2[_0x4fdf(0x22c)](0x2d)+_0x36d47d);}console[_0x4fdf(0x2db)]('');}await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();}async function approvePairingRequest(){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x2c1))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)]('🔐\x20飞书配对授权')),console['log'](chalk_1['default'][_0x4fdf(0x2d8)]['cyan'](_0x4fdf(0x244))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('用户在飞书私聊机器人后,会收到配对码。\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x23e)+getCredentialsDir()+'\x0a'));const {pairingCode:_0x2f5db9}=await inquirer_1['default'][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x2fc),'name':'pairingCode','message':'请输入配对码(留空取消):'}]);if(!_0x2f5db9||!_0x2f5db9[_0x4fdf(0x22b)]()){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x2a8))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}const _0x488cc8=_0x2f5db9[_0x4fdf(0x22b)]()[_0x4fdf(0x2f1)]();console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x31e)+_0x488cc8+_0x4fdf(0x277)));const _0x1e6285=approveFeishuPairing(_0x488cc8);_0x1e6285[_0x4fdf(0x239)]?(console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)]('\x0a✓\x20配对授权成功!\x0a')),console['log'](chalk_1['default']['dim']('用户ID:\x20'+_0x1e6285[_0x4fdf(0x218)])),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim']('账号:\x20'+_0x1e6285[_0x4fdf(0x1be)]+'\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x305)))):(console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x250)](_0x4fdf(0x1b6))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x1ef)+(_0x1e6285['error']||_0x4fdf(0x26a))+'\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x333))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2d1))),console['log'](chalk_1['default']['dim'](_0x4fdf(0x2b9))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20•\x20凭证目录配置不正确\x0a'))),await index_1['tuiUtils'][_0x4fdf(0x1d5)]();}async function showUserFeishuBinding(){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['bold'][_0x4fdf(0x2b5)](_0x4fdf(0x23a)));const _0x4b6e5c=services_1[_0x4fdf(0x1ea)][_0x4fdf(0x274)]();console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('用户信息:')),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x23b)+_0x4b6e5c['id'])),console[_0x4fdf(0x2db)](chalk_1['default']['dim'](_0x4fdf(0x1c9)+_0x4b6e5c['name'])),console[_0x4fdf(0x2db)](''),_0x4b6e5c[_0x4fdf(0x2d3)]?(console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['green'](_0x4fdf(0x27e))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim']('\x20\x20Open\x20ID:\x20'+_0x4b6e5c[_0x4fdf(0x24c)])),console[_0x4fdf(0x2db)](''),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x21a)))):(console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x275))),console[_0x4fdf(0x2db)](''),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['dim'](_0x4fdf(0x290))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x289)))),console[_0x4fdf(0x2db)](''),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();}async function bindUserFeishuId(){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)]['cyan'](_0x4fdf(0x1bb)));const _0x120c12=services_1[_0x4fdf(0x1ea)][_0x4fdf(0x274)]();if(_0x120c12[_0x4fdf(0x2d3)]){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x1a7))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('\x20\x20Open\x20ID:\x20'+_0x120c12[_0x4fdf(0x24c)])),console[_0x4fdf(0x2db)]('');const {overwrite:_0x58764d}=await inquirer_1['default']['prompt']([{'type':'confirm','name':_0x4fdf(0x2c7),'message':_0x4fdf(0x254),'default':![]}]);if(!_0x58764d){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2a8))),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}}console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['bold'][_0x4fdf(0x228)](_0x4fdf(0x2f3))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x217))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)]('\x20\x201.\x20用户在飞书私聊机器人')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)](_0x4fdf(0x276))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['cyan'](_0x4fdf(0x328))),console[_0x4fdf(0x2db)](''),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x2ad))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['cyan']('\x20\x201.\x20进入飞书管理后台\x20>\x20成员管理')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)]('\x20\x202.\x20找到目标用户,查看用户详情')),console[_0x4fdf(0x2db)](chalk_1['default']['cyan']('\x20\x203.\x20复制\x20Open\x20ID(ou_xxx\x20格式)')),console[_0x4fdf(0x2db)]('');const {feishuOpenId:_0xb91e33}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':'input','name':'feishuOpenId','message':_0x4fdf(0x31a),'validate':_0x36e203=>{if(!_0x36e203[_0x4fdf(0x22b)]())return'请输入\x20Open\x20ID';if(!_0x36e203['trim']()[_0x4fdf(0x2ea)](_0x4fdf(0x265)))return'Open\x20ID\x20格式错误,应以\x20ou_\x20开头';return!![];}}]),{updateName:_0x151474,userName:_0x4a4b9c}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x30d),'name':_0x4fdf(0x18e),'message':_0x4fdf(0x1fa),'default':![]},{'type':_0x4fdf(0x2fc),'name':_0x4fdf(0x22f),'message':'请输入用户名:','when':_0x2147db=>_0x2147db[_0x4fdf(0x18e)]}]),_0x5c679d=services_1[_0x4fdf(0x1ea)]['bindFeishu'](_0xb91e33[_0x4fdf(0x22b)]());if(_0x5c679d){_0x4a4b9c?.[_0x4fdf(0x22b)]()&&services_1[_0x4fdf(0x1ea)]['updateName'](_0x4a4b9c[_0x4fdf(0x22b)]());try{const _0x540476=(0x0,utils_1[_0x4fdf(0x19a)])();let _0xb80963={};if(fs[_0x4fdf(0x2ff)](_0x540476))try{const _0x1e6589=fs[_0x4fdf(0x207)](_0x540476,_0x4fdf(0x336));_0xb80963=JSON['parse'](_0x1e6589);}catch{_0xb80963={};}!_0xb80963[_0x4fdf(0x329)]&&(_0xb80963[_0x4fdf(0x329)]=[]);const _0x49df06=_0xb80963[_0x4fdf(0x329)],_0x5e47b3=_0xb91e33[_0x4fdf(0x22b)](),_0x1ea7c=_0x49df06[_0x4fdf(0x1c4)](_0xa75051=>{const _0x23a135=_0xa75051[_0x4fdf(0x1f7)],_0x346dd6=_0x23a135?.['peer'];return _0x23a135?.['channel']===_0x4fdf(0x225)&&_0x346dd6?.['kind']==='dm'&&_0x346dd6?.['id']===_0x5e47b3;});!_0x1ea7c?(_0x49df06['push']({'agentId':'main','match':{'channel':'feishu','peer':{'kind':'dm','id':_0x5e47b3}}}),fs['writeFileSync'](_0x540476,JSON[_0x4fdf(0x22e)](_0xb80963,null,0x2),_0x4fdf(0x336)),configTracker[_0x4fdf(0x28d)]({'agentId':'main','match':{'channel':'feishu','peer':{'kind':'dm','id':_0x5e47b3}}},'main'),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)](_0x4fdf(0x1fb))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x20\x20Open\x20ID:\x20'+_0xb91e33)),_0x4a4b9c?.[_0x4fdf(0x22b)]()&&console['log'](chalk_1['default'][_0x4fdf(0x24b)](_0x4fdf(0x1c9)+_0x4a4b9c)),console['log'](''),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x228)](_0x4fdf(0x183))),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2b5)]('\x20\x20openclaw\x20gateway\x20restart'))):(console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x247)](_0x4fdf(0x2fe))),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x2dd)+_0xb91e33)));}catch(_0x1e2cbd){console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x247)](_0x4fdf(0x226))),console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x24b)]('\x20\x20Open\x20ID:\x20'+_0xb91e33)),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)]['yellow']('\x0a⚠️\x20配置文件更新失败,请手动添加\x20binding:')),console[_0x4fdf(0x2db)](chalk_1['default']['dim'](JSON[_0x4fdf(0x22e)]({'agentId':_0x4fdf(0x27a),'match':{'channel':_0x4fdf(0x225),'peer':{'kind':'dm','id':_0xb91e33[_0x4fdf(0x22b)]()}}},null,0x2)));}console[_0x4fdf(0x2db)](''),console['log'](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x208)));}else console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x250)](_0x4fdf(0x211)));console[_0x4fdf(0x2db)](''),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();}async function unbindUserFeishu(){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x2d8)][_0x4fdf(0x2b5)](_0x4fdf(0x2a4)));const _0x1c92b4=services_1[_0x4fdf(0x1ea)][_0x4fdf(0x274)]();if(!_0x1c92b4[_0x4fdf(0x2d3)]){console[_0x4fdf(0x2db)](chalk_1['default'][_0x4fdf(0x228)]('当前未绑定飞书账号\x0a')),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}console['log'](chalk_1['default']['dim'](_0x4fdf(0x30e))),console['log'](chalk_1[_0x4fdf(0x2ef)]['dim']('\x20\x20Open\x20ID:\x20'+_0x1c92b4[_0x4fdf(0x24c)])),console[_0x4fdf(0x2db)]('');const {confirm:_0x18face}=await inquirer_1[_0x4fdf(0x2ef)][_0x4fdf(0x19b)]([{'type':_0x4fdf(0x30d),'name':_0x4fdf(0x30d),'message':'确认解绑飞书账号?','default':![]}]);if(!_0x18face){console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)]('\x0a已取消\x0a')),await index_1[_0x4fdf(0x1c0)][_0x4fdf(0x1d5)]();return;}const _0x6f3ef0=services_1[_0x4fdf(0x1ea)]['unbindFeishu']();_0x6f3ef0?(console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x247)]('\x0a✓\x20飞书账号已解绑\x0a')),console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x24b)](_0x4fdf(0x252)))):console[_0x4fdf(0x2db)](chalk_1[_0x4fdf(0x2ef)][_0x4fdf(0x250)](_0x4fdf(0x2c9))),console['log'](''),await index_1[_0x4fdf(0x1c0)]['waitForKey']();}