woozlit 2.1.5 → 2.2.0

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 (64) hide show
  1. package/README.md +28 -0
  2. package/dist/auth/login.js +1 -1
  3. package/dist/browser/index.js +1 -1
  4. package/dist/browser/server.js +1 -1
  5. package/dist/browser/tools.js +1 -1
  6. package/dist/chat/agent.js +1 -1
  7. package/dist/config/mcp.js +1 -1
  8. package/dist/config/settings.js +1 -1
  9. package/dist/discord/client.js +1 -1
  10. package/dist/discord/config.js +1 -1
  11. package/dist/discord/index.js +1 -1
  12. package/dist/discord/setup.js +1 -1
  13. package/dist/email/config.js +1 -1
  14. package/dist/email/index.js +1 -1
  15. package/dist/email/service.js +1 -1
  16. package/dist/email/setup.js +1 -1
  17. package/dist/github/api.js +1 -1
  18. package/dist/github/auth.js +1 -1
  19. package/dist/github/auto-setup.js +1 -1
  20. package/dist/github/index.js +1 -1
  21. package/dist/github/manual-setup.js +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/mcp-servers/computer-use.js +1 -1
  24. package/dist/services/bot-manager.js +1 -1
  25. package/dist/services/notifications.js +1 -1
  26. package/dist/services/voice-agent.js +1 -1
  27. package/dist/telegram/bot.js +1 -1
  28. package/dist/telegram/config.js +1 -1
  29. package/dist/telegram/index.js +1 -1
  30. package/dist/telegram/reminders.js +1 -1
  31. package/dist/telegram/setup.js +1 -1
  32. package/dist/tools/command.js +1 -1
  33. package/dist/tools/file.d.ts +8 -0
  34. package/dist/tools/file.js +1 -1
  35. package/dist/tools/git.js +1 -1
  36. package/dist/tools/index.d.ts +1 -1
  37. package/dist/tools/index.js +1 -1
  38. package/dist/tools/knowledge.d.ts +4 -0
  39. package/dist/tools/knowledge.js +1 -0
  40. package/dist/tools/mcp.js +1 -1
  41. package/dist/tools/network.js +1 -1
  42. package/dist/tools/project.js +1 -1
  43. package/dist/tools/rollback.js +1 -1
  44. package/dist/tools/rules.js +1 -1
  45. package/dist/tools/system.js +1 -1
  46. package/dist/twilio/config.js +1 -1
  47. package/dist/twilio/index.js +1 -1
  48. package/dist/twilio/server.js +1 -1
  49. package/dist/twilio/setup.js +1 -1
  50. package/dist/ui/output.js +1 -1
  51. package/dist/ui/select.js +1 -1
  52. package/dist/ui/themes.js +1 -1
  53. package/dist/utils/api.d.ts +1 -1
  54. package/dist/utils/api.js +1 -1
  55. package/dist/utils/chat-history.js +1 -1
  56. package/dist/utils/history.js +1 -1
  57. package/dist/utils/mcp-installer.js +1 -1
  58. package/dist/utils/platform.js +1 -1
  59. package/dist/utils/storage.d.ts +3 -0
  60. package/dist/utils/storage.js +1 -1
  61. package/dist/utils/update-check.js +1 -1
  62. package/dist/utils/updater.js +1 -1
  63. package/dist/verify_repro.js +1 -1
  64. package/package.json +1 -1
@@ -1 +1 @@
1
- const a7_0x4ba179=a7_0x41c0;(function(_0x58808c,_0x55bc03){const _0x1032c1=a7_0x41c0,_0x5cee78=_0x58808c();while(!![]){try{const _0x580a57=parseInt(_0x1032c1(0x1f7))/0x1+parseInt(_0x1032c1(0x1fa))/0x2+parseInt(_0x1032c1(0x21e))/0x3*(-parseInt(_0x1032c1(0x20b))/0x4)+-parseInt(_0x1032c1(0x23c))/0x5+-parseInt(_0x1032c1(0x232))/0x6+parseInt(_0x1032c1(0x1f6))/0x7*(-parseInt(_0x1032c1(0x244))/0x8)+parseInt(_0x1032c1(0x1fc))/0x9*(parseInt(_0x1032c1(0x23f))/0xa);if(_0x580a57===_0x55bc03)break;else _0x5cee78['push'](_0x5cee78['shift']());}catch(_0xcd4f23){_0x5cee78['push'](_0x5cee78['shift']());}}}(a7_0x2827,0xba836));import{Client,GatewayIntentBits,ChannelType,Partials,AttachmentBuilder}from'discord.js';import{join,resolve,basename}from'path';import*as a7_0x1ad614 from'./config.js';import*as a7_0x3fa607 from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess,deleteFile,renameFile,copyFile,fileInfo,readFileLines,findFiles,searchDirectory}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile as a7_0x4d9295}from'../tools/network.js';import{getEnv,setEnv,getSystemInfo,clipboardRead,clipboardWrite}from'../tools/system.js';function a7_0x2827(){const _0x21dcce=['\x0aProject:\x20','end','getBotToken','send','success','patches','sendTyping','pids','args','ready','once','open_in_editor','push','[D]','copy_file','read_file','catch','name','get_system_info','head','user','get_env','Usage:\x20/run\x20<command>','match','No\x20output','Guilds','terminate','system','author','!newchat','replace','destroy','1778567PEitON','824121UHdiUs','create_file','owner','2361536ISjMwb','count','27leHofa','login','entries','Dir:\x20','extensions','repo','trim','pattern','browser_snapshot','depth','fromBranch','set_env','!cd\x20','/cd\x20','!clear','4968nwWdrN','patch_file','\x0aModel:\x20','!run\x20','slice','path','base','__Sending\x20file:\x20','output','bot','substring','github_create_branch','from','/run\x20','join','background','size','You\x20are\x20Woozlit\x20AI,\x20an\x20autonomous\x20agent\x20connected\x20via\x20Discord.\x20Complete\x20tasks\x20immediately.\x0a\x0aRULES:\x0a1.\x20Execute\x20tools\x20FIRST,\x20explain\x20NEVER.\x20Be\x20concise.\x0a2.\x20No\x20emojis.\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x0a3.\x20Use\x20tool\x20blocks\x20to\x20execute\x20actions.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait,\x20background}\x0a-\x20read_terminal:\x20{}\x0a-\x20send_input:\x20{input}\x0a-\x20terminate:\x20{}\x0a-\x20create_file:\x20{path,\x20content}\x0a-\x20read_file:\x20{path}\x0a-\x20list_directory:\x20{path}\x0a-\x20edit_file:\x20{path,\x20search,\x20replace}\x0a-\x20delete_file:\x20{path}\x0a-\x20rename_file:\x20{from,\x20to}\x0a-\x20copy_file:\x20{from,\x20to}\x0a-\x20file_info:\x20{path}\x0a-\x20read_file_lines:\x20{path,\x20start,\x20end}\x0a-\x20find_files:\x20{path,\x20pattern}\x0a-\x20search_directory:\x20{path,\x20pattern}\x0a-\x20send_file:\x20{path}\x20-\x20send\x20file\x20to\x20Discord\x0a-\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20fetch_url:\x20{url}\x0a-\x20download_file:\x20{url,\x20path}\x0a-\x20get_env:\x20{name},\x20set_env:\x20{name,\x20value}\x0a-\x20get_system_info:\x20{}\x0a-\x20clipboard_read,\x20clipboard_write:\x20{text}\x0a-\x20tree:\x20{path,\x20depth}\x0a-\x20grep_recursive:\x20{path,\x20pattern}\x0a-\x20replace_in_files:\x20{path,\x20search,\x20replace}\x0a-\x20powershell_run:\x20{script}\x0a-\x20zip_files:\x20{files,\x20output},\x20unzip_files:\x20{path,\x20output}\x0a-\x20write_json:\x20{path,\x20data},\x20read_json:\x20{path}\x0a-\x20patch_file:\x20{path,\x20patches}\x0a-\x20open_in_editor:\x20{path}\x0a-\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_screenshot,\x20browser_snapshot,\x20browser_close\x0a\x0aTOOL\x20FORMAT:\x0a```tool\x0a{\x22name\x22:\x22tool_name\x22,\x22args\x22:{\x22key\x22:\x22value\x22}}\x0a```','package.json','498dUJGyG','/files','read_json','git_status','Tool\x20error:\x20','read_terminal','GuildMessages','\x0a```','/newchat','value','files','title','git_diff','send_file','mentions','clipboard_write','url','map','...','../github/api.js','3760806IQuVKW','set','archive.zip','/status','pid','Tool\x20result\x20for\x20','github_read_file','send_input','browser_screenshot','startsWith','1358425sEAJSQ','guildId','Failed\x20to\x20send\x20file:\x20','3780440ITvabl','../browser/index.js','info','text','wait','40yJKwpg','channel','directory','message','Unknown\x20tool:\x20','length','selector','[Discord]\x20Connected\x20as\x20','.\x20Try\x20again\x20or\x20skip.','file_info','powershell_run','!status','[Discord]\x20Tool:\x20','search_file','username',':\x0a\x0a','delete_file','attachments','data','search','command','\x20bytes)\x20saved\x20to\x20','File\x20will\x20be\x20attached\x20separately','content','has','upload_','channelId','exitCode','[Discord]\x20Failed\x20to\x20start:\x20','error','browser_fill','github_create_pr','[Discord]\x20','\x0a```\x0a','type','MessageContent','reply','parse','\x0aGit:\x20','download_file','now','Failed:\x20','browser_click','get','find_files','script','delete','/clear','edit_file','!files\x20','/project','tag','tree','cwd','version','arrayBuffer','Exit:\x20','body','\x0aProcesses:\x20'];a7_0x2827=function(){return _0x21dcce;};return a7_0x2827();}import{tree,grepRecursive,replaceInFiles,openInEditor,zipFiles,unzipFiles,writeJson,readJson,patchFile,powershellRun}from'../tools/project.js';import{registerDiscordClient}from'../services/notifications.js';let client=null,isRunning=![];const chatHistories=new Map(),SYSTEM_PROMPT=a7_0x4ba179(0x21c);async function executeToolCall(_0x4a21b3,_0xed54da,_0x7b73ca){const _0x408d08=a7_0x4ba179;switch(_0x4a21b3){case'run_command':{const _0x4dc19d=await runCommand(_0xed54da[_0x408d08(0x258)],undefined,_0xed54da[_0x408d08(0x21a)]||![],_0xed54da[_0x408d08(0x243)]||0x7530);return _0x4dc19d;}case _0x408d08(0x223):return readTerminalOutput(_0xed54da[_0x408d08(0x236)]);case _0x408d08(0x239):return sendTerminalInput(_0xed54da['input'],_0xed54da['pid']);case _0x408d08(0x1f0):return terminateProcess(_0xed54da['pid']);case _0x408d08(0x1f8):return createFile(_0xed54da[_0x408d08(0x210)],_0xed54da[_0x408d08(0x25b)]);case _0x408d08(0x1e5):return readFile(_0xed54da[_0x408d08(0x210)]);case'list_directory':return listDirectory(_0xed54da[_0x408d08(0x210)]||'.');case _0x408d08(0x1cb):return editFile(_0xed54da[_0x408d08(0x210)],_0xed54da[_0x408d08(0x257)],_0xed54da[_0x408d08(0x1f4)]);case _0x408d08(0x251):return searchFile(_0xed54da[_0x408d08(0x210)],_0xed54da['pattern']);case _0x408d08(0x254):return deleteFile(_0xed54da['path']);case'rename_file':return renameFile(_0xed54da[_0x408d08(0x217)]||_0xed54da['path'],_0xed54da['to']);case _0x408d08(0x1e4):return copyFile(_0xed54da[_0x408d08(0x217)]||_0xed54da[_0x408d08(0x210)],_0xed54da['to']);case _0x408d08(0x24d):return fileInfo(_0xed54da[_0x408d08(0x210)]);case'read_file_lines':return readFileLines(_0xed54da[_0x408d08(0x210)],_0xed54da['start']||0x1,_0xed54da[_0x408d08(0x1d7)]||0x32);case _0x408d08(0x1c7):return findFiles(_0xed54da[_0x408d08(0x210)]||'.',_0xed54da[_0x408d08(0x203)]);case'search_directory':return searchDirectory(_0xed54da['path']||'.',_0xed54da[_0x408d08(0x203)]);case _0x408d08(0x22b):{try{const _0x326fc1=resolve(process[_0x408d08(0x1d0)](),_0xed54da[_0x408d08(0x210)]);return await _0x7b73ca(_0x408d08(0x212)+basename(_0x326fc1)+'__'),{'success':!![],'sent':!![],'note':_0x408d08(0x25a)};}catch(_0x2bad98){return{'error':_0x408d08(0x23e)+_0x2bad98};}}case _0x408d08(0x221):return gitStatus();case _0x408d08(0x22a):return gitDiff(_0xed54da[_0x408d08(0x210)]);case'git_log':return gitLog(_0xed54da[_0x408d08(0x1fb)]||0xa);case'git_add':return gitAdd(_0xed54da[_0x408d08(0x210)]||'.');case'git_commit':return gitCommit(_0xed54da['message']);case'git_branch':return gitBranch();case'fetch_url':return fetchUrl(_0xed54da[_0x408d08(0x22e)]);case _0x408d08(0x26b):return a7_0x4d9295(_0xed54da[_0x408d08(0x22e)],_0xed54da[_0x408d08(0x210)]);case _0x408d08(0x1eb):return getEnv(_0xed54da[_0x408d08(0x1e7)]);case _0x408d08(0x207):return setEnv(_0xed54da[_0x408d08(0x1e7)],_0xed54da[_0x408d08(0x227)]);case _0x408d08(0x1e8):return getSystemInfo();case'clipboard_read':return clipboardRead();case _0x408d08(0x22d):return clipboardWrite(_0xed54da[_0x408d08(0x242)]);case'tree':return tree(_0xed54da['path']||'.',_0xed54da[_0x408d08(0x205)]||0x3);case'grep_recursive':return grepRecursive(_0xed54da['path']||'.',_0xed54da[_0x408d08(0x203)],_0xed54da[_0x408d08(0x200)]);case'replace_in_files':return replaceInFiles(_0xed54da['path']||'.',_0xed54da[_0x408d08(0x257)],_0xed54da['replace'],_0xed54da[_0x408d08(0x200)]);case _0x408d08(0x24e):return powershellRun(_0xed54da[_0x408d08(0x1c8)]||_0xed54da[_0x408d08(0x258)]);case'zip_files':return zipFiles(_0xed54da[_0x408d08(0x228)]||[_0xed54da[_0x408d08(0x210)]],_0xed54da['output']||_0x408d08(0x234));case'unzip_files':return unzipFiles(_0xed54da[_0x408d08(0x210)],_0xed54da[_0x408d08(0x213)]||'.');case'write_json':return writeJson(_0xed54da[_0x408d08(0x210)],_0xed54da['data']);case _0x408d08(0x220):return readJson(_0xed54da[_0x408d08(0x210)]);case _0x408d08(0x20c):return patchFile(_0xed54da[_0x408d08(0x210)],_0xed54da[_0x408d08(0x1db)]);case _0x408d08(0x1e1):return openInEditor(_0xed54da[_0x408d08(0x210)]);case _0x408d08(0x238):{const {readFile:_0x56f48e}=await import(_0x408d08(0x231));return _0x56f48e(_0xed54da[_0x408d08(0x1f9)],_0xed54da['repo'],_0xed54da['path'],_0xed54da['branch']);}case _0x408d08(0x216):{const {createBranch:_0xba12c8}=await import(_0x408d08(0x231));return _0xba12c8(_0xed54da[_0x408d08(0x1f9)],_0xed54da[_0x408d08(0x201)],_0xed54da['branchName'],_0xed54da[_0x408d08(0x206)]);}case _0x408d08(0x263):{const {createPullRequest:_0x1e8aad}=await import('../github/api.js');return _0x1e8aad(_0xed54da[_0x408d08(0x1f9)],_0xed54da[_0x408d08(0x201)],_0xed54da[_0x408d08(0x229)],_0xed54da[_0x408d08(0x1e9)],_0xed54da[_0x408d08(0x211)],_0xed54da[_0x408d08(0x1d4)]);}case'browser_open':{const {browserOpen:_0x519397,startBrowserServer:_0x519487,isBrowserServerRunning:_0x1df9d3}=await import('../browser/index.js');if(!_0x1df9d3())await _0x519487();return _0x519397(_0xed54da[_0x408d08(0x22e)]);}case _0x408d08(0x1c5):{const {browserClick:_0x464686}=await import(_0x408d08(0x240));return _0x464686(_0xed54da[_0x408d08(0x24a)]);}case _0x408d08(0x262):{const {browserFill:_0x24cb9d}=await import(_0x408d08(0x240));return _0x24cb9d(_0xed54da[_0x408d08(0x24a)],_0xed54da[_0x408d08(0x227)]);}case _0x408d08(0x204):{const {browserSnapshot:_0x16b2a3}=await import(_0x408d08(0x240));return _0x16b2a3();}case _0x408d08(0x23a):{const {browserScreenshot:_0x36543c}=await import('../browser/index.js');return _0x36543c();}case'browser_close':{const {browserClose:_0x1096ae}=await import('../browser/index.js');return _0x1096ae();}default:return{'error':_0x408d08(0x248)+_0x4a21b3};}}async function processDiscordAgentLoop(_0x18b226,_0x3fe168,_0x3e6315,_0x4a4705){const _0x308969=a7_0x4ba179;let _0x354a56=0x0;const _0x4fd74d=0x14;while(_0x354a56<_0x4fd74d){_0x354a56++;let _0x5364b8='';try{const _0x5db7e8=await sendChatMessage(_0x3fe168,_0x18b226,_0x30bb70=>{_0x5364b8+=_0x30bb70;});_0x5364b8=_0x5db7e8[_0x308969(0x25b)];}catch(_0x3e109f){await _0x3e6315(_0x308969(0x1c4)+(_0x3e109f[_0x308969(0x247)]?.[_0x308969(0x215)](0x0,0x64)||'Error'));return;}_0x18b226['push']({'role':'assistant','content':_0x5364b8});let _0x1baba5=_0x5364b8['match'](/```tool\s*([\s\S]*?)```/);if(!_0x1baba5)_0x1baba5=_0x5364b8['match'](/\*\*\*tool\s*([\s\S]*?)\*\*\*/);if(!_0x1baba5)_0x1baba5=_0x5364b8['match'](/```json\s*({[\s\S]*?"name"[\s\S]*?})\s*```/);if(!_0x1baba5){let _0x2ae910=_0x5364b8[_0x308969(0x1f4)](/<reasoning>[\s\S]*?<\/reasoning>/g,'')['replace'](/<text>|<\/text>/g,'')['replace'](/```tool[\s\S]*?```/g,'')['replace'](/\*\*\*tool[\s\S]*?\*\*\*/g,'')['replace'](/#{1,6}\s*/g,'')[_0x308969(0x202)]();if(_0x2ae910){if(_0x2ae910[_0x308969(0x249)]>0x7d0){const _0x1fb055=_0x2ae910[_0x308969(0x1ed)](/[\s\S]{1,2000}/g)||[];for(const _0x5150fa of _0x1fb055)await _0x3e6315(_0x5150fa);}else await _0x3e6315(_0x2ae910);}break;}try{const _0x3a0be7=JSON[_0x308969(0x269)](_0x1baba5[0x1][_0x308969(0x202)]());a7_0x3fa607[_0x308969(0x241)](_0x308969(0x250)+_0x3a0be7[_0x308969(0x1e7)]);const _0x132e1e=await executeToolCall(_0x3a0be7[_0x308969(0x1e7)],_0x3a0be7['args'],_0x3e6315);_0x3a0be7['name']===_0x308969(0x22b)&&_0x3a0be7[_0x308969(0x1de)][_0x308969(0x210)]&&await _0x4a4705(resolve(process['cwd'](),_0x3a0be7['args'][_0x308969(0x210)])),_0x18b226['push']({'role':_0x308969(0x1ea),'content':_0x308969(0x237)+_0x3a0be7['name']+':\x0a'+JSON['stringify'](_0x132e1e,null,0x2)}),await new Promise(_0x20868d=>setTimeout(_0x20868d,0xc8));}catch(_0x2cc2a7){_0x18b226[_0x308969(0x1e2)]({'role':_0x308969(0x1ea),'content':_0x308969(0x222)+_0x2cc2a7+_0x308969(0x24c)});}}}function getOrCreateHistory(_0x1053c6){const _0x416784=a7_0x4ba179;return!chatHistories['has'](_0x1053c6)&&chatHistories[_0x416784(0x233)](_0x1053c6,[{'role':_0x416784(0x1f1),'content':SYSTEM_PROMPT}]),chatHistories[_0x416784(0x1c6)](_0x1053c6);}export async function startBot(){const _0x26db99=a7_0x4ba179,_0x16d189=a7_0x1ad614[_0x26db99(0x1d8)]();if(!_0x16d189)return![];if(isRunning)return!![];try{return client=new Client({'intents':[GatewayIntentBits[_0x26db99(0x1ef)],GatewayIntentBits[_0x26db99(0x224)],GatewayIntentBits[_0x26db99(0x267)],GatewayIntentBits['DirectMessages']],'partials':[Partials['Channel']]}),client[_0x26db99(0x1e0)](_0x26db99(0x1df),()=>{const _0x256098=_0x26db99;a7_0x3fa607[_0x256098(0x1da)](_0x256098(0x24b)+client?.[_0x256098(0x1ea)]?.[_0x256098(0x1ce)]),isRunning=!![];if(client)registerDiscordClient(client);}),client['on']('messageCreate',async _0xe74c8d=>{const _0x37f6e4=_0x26db99;if(_0xe74c8d['author'][_0x37f6e4(0x214)])return;const _0x4e9288=_0xe74c8d[_0x37f6e4(0x245)]['type']===ChannelType['DM'],_0x4aeeac=client?.['user']&&_0xe74c8d[_0x37f6e4(0x22c)][_0x37f6e4(0x25c)](client[_0x37f6e4(0x1ea)]);if(!_0x4e9288&&!_0x4aeeac)return;const _0x1f0a8e=_0xe74c8d[_0x37f6e4(0x25b)][_0x37f6e4(0x1f4)](/<@!?[0-9]+>/g,'')[_0x37f6e4(0x202)](),_0x53227d=_0xe74c8d['author']['id'],_0x4480cb=(_0xe74c8d[_0x37f6e4(0x23d)]||'dm')+'-'+_0xe74c8d[_0x37f6e4(0x25e)]+'-'+_0x53227d,_0x1ebd0e=async _0x444f2c=>{const _0x2378ca=_0x37f6e4;await _0xe74c8d['channel'][_0x2378ca(0x1d9)](_0x444f2c)['catch'](()=>{});},_0x4735d5=async _0x704fd3=>{const _0x59c8cc=_0x37f6e4;try{const _0x48d7e9=new AttachmentBuilder(_0x704fd3);await _0xe74c8d['channel'][_0x59c8cc(0x1d9)]({'files':[_0x48d7e9]});}catch{}};if(_0x1f0a8e===_0x37f6e4(0x226)||_0x1f0a8e===_0x37f6e4(0x1f3)){chatHistories[_0x37f6e4(0x1c9)](_0x4480cb),await _0xe74c8d[_0x37f6e4(0x268)]('New\x20chat\x20session\x20started.');return;}if(_0x1f0a8e===_0x37f6e4(0x1ca)||_0x1f0a8e===_0x37f6e4(0x20a)){chatHistories['delete'](_0x4480cb),await _0xe74c8d[_0x37f6e4(0x268)]('Cleared.');return;}if(_0x1f0a8e===_0x37f6e4(0x235)||_0x1f0a8e===_0x37f6e4(0x24f)){const _0x3f51f2=readTerminalOutput(),_0x57c21f=_0x3f51f2[_0x37f6e4(0x1dd)][_0x37f6e4(0x249)]>0x0?_0x37f6e4(0x1d5)+_0x3f51f2[_0x37f6e4(0x1dd)][_0x37f6e4(0x219)](',\x20'):'';await _0xe74c8d[_0x37f6e4(0x268)](_0x37f6e4(0x1ff)+process[_0x37f6e4(0x1d0)]()+_0x37f6e4(0x20d)+getSelectedModel()+_0x57c21f);return;}if(_0x1f0a8e===_0x37f6e4(0x1cd)||_0x1f0a8e==='!project'){const _0x54cc77=gitStatus(),_0x590d03=tree('.',0x2),_0xa56e93=readJson(_0x37f6e4(0x21d));let _0x52244f='Dir:\x20'+process[_0x37f6e4(0x1d0)]()+_0x37f6e4(0x20d)+getSelectedModel()+'\x0a';if(_0xa56e93[_0x37f6e4(0x1da)]&&_0xa56e93[_0x37f6e4(0x256)]){const _0x366539=_0xa56e93[_0x37f6e4(0x256)];_0x52244f+=_0x37f6e4(0x1d6)+(_0x366539['name']||'?')+'\x20v'+(_0x366539[_0x37f6e4(0x1d1)]||'?')+'\x0a';}if(_0x54cc77['success'])_0x52244f+=_0x37f6e4(0x26a)+(_0x54cc77['output']||'Clean')+'\x0a';_0x590d03[_0x37f6e4(0x1da)]&&_0x590d03[_0x37f6e4(0x1cf)]&&(_0x52244f+='\x0aTree:\x0a'+_0x590d03[_0x37f6e4(0x1cf)]['split']('\x0a')[_0x37f6e4(0x20f)](0x0,0xf)[_0x37f6e4(0x219)]('\x0a'));if(_0x52244f['length']>0x7d0)_0x52244f=_0x52244f[_0x37f6e4(0x215)](0x0,0x7cd)+_0x37f6e4(0x230);await _0xe74c8d['reply'](_0x52244f);return;}if(_0x1f0a8e[_0x37f6e4(0x23b)]('/files\x20')||_0x1f0a8e[_0x37f6e4(0x23b)](_0x37f6e4(0x1cc))||_0x1f0a8e===_0x37f6e4(0x21f)||_0x1f0a8e==='!files'){const _0x1f33b7=_0x1f0a8e['replace'](/^[!/]files\s*/,'')[_0x37f6e4(0x202)]()||'.',_0x509dd5=listDirectory(_0x1f33b7);if(_0x509dd5[_0x37f6e4(0x1da)]&&_0x509dd5[_0x37f6e4(0x1fe)]){const _0x4db068=_0x509dd5[_0x37f6e4(0x1fe)][_0x37f6e4(0x20f)](0x0,0x1e)[_0x37f6e4(0x22f)](_0x217287=>{const _0x3d86fd=_0x37f6e4,_0x5a9493=_0x217287[_0x3d86fd(0x266)]===_0x3d86fd(0x246)?_0x3d86fd(0x1e3):'[F]';return _0x5a9493+'\x20'+_0x217287['name'];})[_0x37f6e4(0x219)]('\x0a');await _0xe74c8d['reply'](_0x1f33b7+_0x37f6e4(0x253)+_0x4db068);}else await _0xe74c8d['reply'](_0x509dd5[_0x37f6e4(0x247)]);return;}if(_0x1f0a8e['startsWith'](_0x37f6e4(0x218))||_0x1f0a8e[_0x37f6e4(0x23b)](_0x37f6e4(0x20e))){const _0x340e7c=_0x1f0a8e[_0x37f6e4(0x1f4)](/^[!/]run\s+/,'')[_0x37f6e4(0x202)]();if(!_0x340e7c){await _0xe74c8d['reply'](_0x37f6e4(0x1ec));return;}await _0xe74c8d[_0x37f6e4(0x245)][_0x37f6e4(0x1dc)]()[_0x37f6e4(0x1e6)](()=>{});const _0x17b73f=await runCommand(_0x340e7c,undefined,![],0x7530),_0x54be96=(_0x17b73f['stdout']||_0x17b73f['stderr']||_0x37f6e4(0x1ee))[_0x37f6e4(0x215)](0x0,0x76c);await _0xe74c8d[_0x37f6e4(0x268)](_0x37f6e4(0x1d3)+_0x17b73f[_0x37f6e4(0x25f)]+_0x37f6e4(0x265)+_0x54be96+_0x37f6e4(0x225));return;}if(_0x1f0a8e[_0x37f6e4(0x23b)](_0x37f6e4(0x209))||_0x1f0a8e[_0x37f6e4(0x23b)](_0x37f6e4(0x208))){const _0x1bfcd2=_0x1f0a8e[_0x37f6e4(0x1f4)](/^[!/]cd\s+/,'')[_0x37f6e4(0x202)]();try{process['chdir'](resolve(process[_0x37f6e4(0x1d0)](),_0x1bfcd2)),await _0xe74c8d[_0x37f6e4(0x268)]('Changed\x20to:\x20'+process[_0x37f6e4(0x1d0)]());}catch(_0x5cc615){await _0xe74c8d[_0x37f6e4(0x268)](_0x37f6e4(0x1c4)+_0x5cc615);}return;}if(!_0x1f0a8e)return;await _0xe74c8d[_0x37f6e4(0x245)][_0x37f6e4(0x1dc)]()['catch'](()=>{});const _0xd3ba90=getOrCreateHistory(_0x4480cb);_0xd3ba90['push']({'role':_0x37f6e4(0x1ea),'content':_0x1f0a8e}),a7_0x3fa607[_0x37f6e4(0x241)](_0x37f6e4(0x264)+_0xe74c8d[_0x37f6e4(0x1f2)][_0x37f6e4(0x252)]+':\x20'+_0x1f0a8e),await processDiscordAgentLoop(_0xd3ba90,getSelectedModel(),_0x1ebd0e,_0x4735d5);if(_0xe74c8d[_0x37f6e4(0x255)][_0x37f6e4(0x21b)]>0x0)for(const [,_0x4eaede]of _0xe74c8d[_0x37f6e4(0x255)]){try{const _0x3842b9=await fetch(_0x4eaede['url']),_0x7f4a1e=Buffer[_0x37f6e4(0x217)](await _0x3842b9[_0x37f6e4(0x1d2)]()),_0x56fc15=join(process[_0x37f6e4(0x1d0)](),_0x4eaede[_0x37f6e4(0x1e7)]||_0x37f6e4(0x25d)+Date[_0x37f6e4(0x1c3)]()),{writeFileSync:_0x41ff05}=await import('fs');_0x41ff05(_0x56fc15,_0x7f4a1e),_0xd3ba90['push']({'role':_0x37f6e4(0x1ea),'content':'[File\x20received:\x20'+_0x4eaede[_0x37f6e4(0x1e7)]+'\x20('+_0x7f4a1e['length']+_0x37f6e4(0x259)+_0x56fc15+']'}),await _0xe74c8d[_0x37f6e4(0x268)]('Saved:\x20'+_0x4eaede[_0x37f6e4(0x1e7)]);}catch{}}}),await client[_0x26db99(0x1fd)](_0x16d189),!![];}catch(_0x4a62a8){return a7_0x3fa607[_0x26db99(0x261)](_0x26db99(0x260)+_0x4a62a8[_0x26db99(0x247)]),![];}}function a7_0x41c0(_0x4cab1d,_0x5437e7){_0x4cab1d=_0x4cab1d-0x1c3;const _0x2827b3=a7_0x2827();let _0x41c02d=_0x2827b3[_0x4cab1d];return _0x41c02d;}export function stopBot(){const _0x5966b5=a7_0x4ba179;client&&(client[_0x5966b5(0x1f5)](),client=null),isRunning=![];}export function isBotRunning(){return isRunning;}
1
+ const a7_0x11290b=a7_0x3ed2;(function(_0x1173fa,_0x3d078e){const _0x2442ea=a7_0x3ed2,_0x162e5d=_0x1173fa();while(!![]){try{const _0x3958a4=-parseInt(_0x2442ea(0x10c))/0x1+-parseInt(_0x2442ea(0xad))/0x2+-parseInt(_0x2442ea(0xd8))/0x3*(parseInt(_0x2442ea(0x102))/0x4)+parseInt(_0x2442ea(0xd3))/0x5+-parseInt(_0x2442ea(0x10e))/0x6+parseInt(_0x2442ea(0xde))/0x7*(parseInt(_0x2442ea(0xd1))/0x8)+parseInt(_0x2442ea(0x67))/0x9;if(_0x3958a4===_0x3d078e)break;else _0x162e5d['push'](_0x162e5d['shift']());}catch(_0x1e66ae){_0x162e5d['push'](_0x162e5d['shift']());}}}(a7_0x560a,0xc2ad5));import{Client,GatewayIntentBits,ChannelType,Partials,AttachmentBuilder}from'discord.js';import{join,resolve,basename}from'path';import*as a7_0x3ae594 from'./config.js';function a7_0x560a(){const _0x586168=['rename_file','open_in_editor','/clear','browser_snapshot','browser_screenshot','/run\x20','GuildMessages','Channel','once','path','read_json','channelId','\x0a```','bot','background','send','join','author','copy_file','[D]','search_directory','pid','get','terminate','fromBranch','branchName','info','attachments','\x0aTree:\x0a','fetch_url','get_env','search','guildId','success','tree','8uUqebm','browser_fill','You\x20are\x20Woozlit\x20AI,\x20an\x20autonomous\x20agent\x20connected\x20via\x20Discord.\x20Complete\x20tasks\x20immediately.\x0a\x0aRULES:\x0a1.\x20Execute\x20tools\x20FIRST,\x20explain\x20NEVER.\x20Be\x20concise.\x0a2.\x20No\x20emojis.\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x0a3.\x20Use\x20tool\x20blocks\x20to\x20execute\x20actions.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait,\x20background}\x0a-\x20read_terminal:\x20{}\x0a-\x20send_input:\x20{input}\x0a-\x20terminate:\x20{}\x0a-\x20create_file:\x20{path,\x20content}\x0a-\x20read_file:\x20{path}\x0a-\x20list_directory:\x20{path}\x0a-\x20edit_file:\x20{path,\x20search,\x20replace}\x0a-\x20delete_file:\x20{path}\x0a-\x20rename_file:\x20{from,\x20to}\x0a-\x20copy_file:\x20{from,\x20to}\x0a-\x20file_info:\x20{path}\x0a-\x20read_file_lines:\x20{path,\x20start,\x20end}\x0a-\x20find_files:\x20{path,\x20pattern}\x0a-\x20search_directory:\x20{path,\x20pattern}\x0a-\x20send_file:\x20{path}\x20-\x20send\x20file\x20to\x20Discord\x0a-\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20fetch_url:\x20{url}\x0a-\x20download_file:\x20{url,\x20path}\x0a-\x20get_env:\x20{name},\x20set_env:\x20{name,\x20value}\x0a-\x20get_system_info:\x20{}\x0a-\x20clipboard_read,\x20clipboard_write:\x20{text}\x0a-\x20tree:\x20{path,\x20depth}\x0a-\x20grep_recursive:\x20{path,\x20pattern}\x0a-\x20replace_in_files:\x20{path,\x20search,\x20replace}\x0a-\x20powershell_run:\x20{script}\x0a-\x20zip_files:\x20{files,\x20output},\x20unzip_files:\x20{path,\x20output}\x0a-\x20write_json:\x20{path,\x20data},\x20read_json:\x20{path}\x0a-\x20patch_file:\x20{path,\x20patches}\x0a-\x20open_in_editor:\x20{path}\x0a-\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_screenshot,\x20browser_snapshot,\x20browser_close\x0a\x0aTOOL\x20FORMAT:\x0a```tool\x0a{\x22name\x22:\x22tool_name\x22,\x22args\x22:{\x22key\x22:\x22value\x22}}\x0a```','reply','search_file','message','username','...','../github/api.js','powershell_run','1021539JAZFef','!status','1288524LSjcbp',':\x0a\x0a','chdir','branch','files','parse','MessageContent','read_file','has','arrayBuffer','16685442udVxzl','git_status','trim','stderr','assistant','Saved:\x20','!newchat','grep_recursive','!files','.\x20Try\x20again\x20or\x20skip.','end','url','/newchat','Cleared.','git_commit','tag','Exit:\x20','browser_close','length','set_env','Failed:\x20','args','file_info','login','entries','browser_open','../browser/index.js','write_json','value','substring','\x0a```\x0a','title','delete','Clean','patches','slice','git_log','list_directory','zip_files','extensions','replace','unzip_files','git_branch','match','patch_file','name','owner','type','Tool\x20error:\x20','DirectMessages','!files\x20','wait','\x0aProject:\x20','content','Unknown\x20tool:\x20','send_input','now','[Discord]\x20Tool:\x20','send_file','cwd','depth','\x20bytes)\x20saved\x20to\x20','push','startsWith','github_create_branch','New\x20chat\x20session\x20started.','repo','data','script','selector','3028734YVltVt','pids','File\x20will\x20be\x20attached\x20separately','start','[F]','input','sendTyping','system','catch','from','channel','read_file_lines','pattern','error','user','!run\x20','stringify','head','/files','[Discord]\x20','find_files','directory','!cd\x20','split','base','output','\x0aModel:\x20','[Discord]\x20Connected\x20as\x20','run_command','/status','Failed\x20to\x20send\x20file:\x20','command','size','/cd\x20','map','package.json','72stSnSg','version','5442945MecSwA','mentions','exitCode','create_file','!project','103206jmKVLb','/project','stdout','git_add','Tool\x20result\x20for\x20','No\x20output','524482xVpdDI'];a7_0x560a=function(){return _0x586168;};return a7_0x560a();}import*as a7_0x59554f from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess,deleteFile,renameFile,copyFile,fileInfo,readFileLines,findFiles,searchDirectory}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile as a7_0x510ba5}from'../tools/network.js';import{getEnv,setEnv,getSystemInfo,clipboardRead,clipboardWrite}from'../tools/system.js';import{tree,grepRecursive,replaceInFiles,openInEditor,zipFiles,unzipFiles,writeJson,readJson,patchFile,powershellRun}from'../tools/project.js';import{registerDiscordClient}from'../services/notifications.js';let client=null,isRunning=![];const chatHistories=new Map(),SYSTEM_PROMPT=a7_0x11290b(0x104);function a7_0x3ed2(_0x449c2f,_0x3f0391){_0x449c2f=_0x449c2f-0x66;const _0x560aaf=a7_0x560a();let _0x3ed25d=_0x560aaf[_0x449c2f];return _0x3ed25d;}async function executeToolCall(_0x136817,_0x1a01c8,_0x394669){const _0x444412=a7_0x11290b;switch(_0x136817){case _0x444412(0xc9):{const _0x19c918=await runCommand(_0x1a01c8[_0x444412(0xcc)],undefined,_0x1a01c8[_0x444412(0xed)]||![],_0x1a01c8[_0x444412(0x9a)]||0x7530);return _0x19c918;}case'read_terminal':return readTerminalOutput(_0x1a01c8[_0x444412(0xf4)]);case _0x444412(0x9e):return sendTerminalInput(_0x1a01c8[_0x444412(0xb2)],_0x1a01c8[_0x444412(0xf4)]);case _0x444412(0xf6):return terminateProcess(_0x1a01c8[_0x444412(0xf4)]);case _0x444412(0xd6):return createFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0x9c)]);case _0x444412(0x115):return readFile(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0x8c):return listDirectory(_0x1a01c8[_0x444412(0xe8)]||'.');case'edit_file':return editFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8['search'],_0x1a01c8[_0x444412(0x8f)]);case _0x444412(0x106):return searchFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8['pattern']);case'delete_file':return deleteFile(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0xdf):return renameFile(_0x1a01c8[_0x444412(0xb6)]||_0x1a01c8[_0x444412(0xe8)],_0x1a01c8['to']);case _0x444412(0xf1):return copyFile(_0x1a01c8[_0x444412(0xb6)]||_0x1a01c8['path'],_0x1a01c8['to']);case _0x444412(0x7d):return fileInfo(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0xb8):return readFileLines(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0xb0)]||0x1,_0x1a01c8[_0x444412(0x71)]||0x32);case _0x444412(0xc1):return findFiles(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xb9)]);case _0x444412(0xf3):return searchDirectory(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xb9)]);case _0x444412(0xa1):{try{const _0x1b1f29=resolve(process[_0x444412(0xa2)](),_0x1a01c8[_0x444412(0xe8)]);return await _0x394669('__Sending\x20file:\x20'+basename(_0x1b1f29)+'__'),{'success':!![],'sent':!![],'note':_0x444412(0xaf)};}catch(_0x1b63f9){return{'error':_0x444412(0xcb)+_0x1b63f9};}}case _0x444412(0x68):return gitStatus();case'git_diff':return gitDiff(_0x1a01c8['path']);case _0x444412(0x8b):return gitLog(_0x1a01c8['count']||0xa);case _0x444412(0xdb):return gitAdd(_0x1a01c8[_0x444412(0xe8)]||'.');case _0x444412(0x75):return gitCommit(_0x1a01c8[_0x444412(0x107)]);case _0x444412(0x91):return gitBranch();case _0x444412(0xfc):return fetchUrl(_0x1a01c8[_0x444412(0x72)]);case'download_file':return a7_0x510ba5(_0x1a01c8['url'],_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0xfd):return getEnv(_0x1a01c8[_0x444412(0x94)]);case _0x444412(0x7a):return setEnv(_0x1a01c8[_0x444412(0x94)],_0x1a01c8['value']);case'get_system_info':return getSystemInfo();case'clipboard_read':return clipboardRead();case'clipboard_write':return clipboardWrite(_0x1a01c8['text']);case'tree':return tree(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xa3)]||0x3);case _0x444412(0x6e):return grepRecursive(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xb9)],_0x1a01c8[_0x444412(0x8e)]);case'replace_in_files':return replaceInFiles(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xfe)],_0x1a01c8[_0x444412(0x8f)],_0x1a01c8[_0x444412(0x8e)]);case _0x444412(0x10b):return powershellRun(_0x1a01c8[_0x444412(0xab)]||_0x1a01c8['command']);case _0x444412(0x8d):return zipFiles(_0x1a01c8[_0x444412(0x112)]||[_0x1a01c8[_0x444412(0xe8)]],_0x1a01c8[_0x444412(0xc6)]||'archive.zip');case _0x444412(0x90):return unzipFiles(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0xc6)]||'.');case _0x444412(0x82):return writeJson(_0x1a01c8['path'],_0x1a01c8['data']);case _0x444412(0xe9):return readJson(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0x93):return patchFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0x89)]);case _0x444412(0xe0):return openInEditor(_0x1a01c8[_0x444412(0xe8)]);case'github_read_file':{const {readFile:_0x28f013}=await import(_0x444412(0x10a));return _0x28f013(_0x1a01c8[_0x444412(0x95)],_0x1a01c8['repo'],_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0x111)]);}case _0x444412(0xa7):{const {createBranch:_0x2f0cb7}=await import('../github/api.js');return _0x2f0cb7(_0x1a01c8[_0x444412(0x95)],_0x1a01c8[_0x444412(0xa9)],_0x1a01c8[_0x444412(0xf8)],_0x1a01c8[_0x444412(0xf7)]);}case'github_create_pr':{const {createPullRequest:_0x4869f1}=await import(_0x444412(0x10a));return _0x4869f1(_0x1a01c8[_0x444412(0x95)],_0x1a01c8['repo'],_0x1a01c8[_0x444412(0x86)],_0x1a01c8[_0x444412(0xbe)],_0x1a01c8[_0x444412(0xc5)],_0x1a01c8['body']);}case _0x444412(0x80):{const {browserOpen:_0x40527f,startBrowserServer:_0x32f366,isBrowserServerRunning:_0x395476}=await import(_0x444412(0x81));if(!_0x395476())await _0x32f366();return _0x40527f(_0x1a01c8['url']);}case'browser_click':{const {browserClick:_0x2abae4}=await import('../browser/index.js');return _0x2abae4(_0x1a01c8[_0x444412(0xac)]);}case _0x444412(0x103):{const {browserFill:_0x471644}=await import(_0x444412(0x81));return _0x471644(_0x1a01c8[_0x444412(0xac)],_0x1a01c8[_0x444412(0x83)]);}case _0x444412(0xe2):{const {browserSnapshot:_0x3cd5aa}=await import(_0x444412(0x81));return _0x3cd5aa();}case _0x444412(0xe3):{const {browserScreenshot:_0x601cd4}=await import(_0x444412(0x81));return _0x601cd4();}case _0x444412(0x78):{const {browserClose:_0x45abc1}=await import('../browser/index.js');return _0x45abc1();}default:return{'error':_0x444412(0x9d)+_0x136817};}}async function processDiscordAgentLoop(_0x4e8a92,_0x262736,_0x464a6e,_0x56ba90){const _0x39e4ee=a7_0x11290b;let _0x401b11=0x0;const _0x5f50f9=0x14;while(_0x401b11<_0x5f50f9){_0x401b11++;let _0x1a76ba='';try{const _0x9df16e=await sendChatMessage(_0x262736,_0x4e8a92,_0x31afb6=>{_0x1a76ba+=_0x31afb6;});_0x1a76ba=_0x9df16e[_0x39e4ee(0x9c)];}catch(_0x54d422){await _0x464a6e(_0x39e4ee(0x7b)+(_0x54d422[_0x39e4ee(0x107)]?.[_0x39e4ee(0x84)](0x0,0x64)||'Error'));return;}_0x4e8a92[_0x39e4ee(0xa5)]({'role':_0x39e4ee(0x6b),'content':_0x1a76ba});let _0x293d5f=_0x1a76ba[_0x39e4ee(0x92)](/```tool\s*([\s\S]*?)```/);if(!_0x293d5f)_0x293d5f=_0x1a76ba['match'](/\*\*\*tool\s*([\s\S]*?)\*\*\*/);if(!_0x293d5f)_0x293d5f=_0x1a76ba[_0x39e4ee(0x92)](/```json\s*({[\s\S]*?"name"[\s\S]*?})\s*```/);if(!_0x293d5f){let _0x2f1703=_0x1a76ba['replace'](/<reasoning>[\s\S]*?<\/reasoning>/g,'')[_0x39e4ee(0x8f)](/<text>|<\/text>/g,'')['replace'](/```tool[\s\S]*?```/g,'')[_0x39e4ee(0x8f)](/\*\*\*tool[\s\S]*?\*\*\*/g,'')[_0x39e4ee(0x8f)](/#{1,6}\s*/g,'')[_0x39e4ee(0x69)]();if(_0x2f1703){if(_0x2f1703[_0x39e4ee(0x79)]>0x7d0){const _0x355a3c=_0x2f1703['match'](/[\s\S]{1,2000}/g)||[];for(const _0x14edf0 of _0x355a3c)await _0x464a6e(_0x14edf0);}else await _0x464a6e(_0x2f1703);}break;}try{const _0x7b2c9f=JSON[_0x39e4ee(0x113)](_0x293d5f[0x1]['trim']());a7_0x59554f[_0x39e4ee(0xf9)](_0x39e4ee(0xa0)+_0x7b2c9f['name']);const _0x571cff=await executeToolCall(_0x7b2c9f[_0x39e4ee(0x94)],_0x7b2c9f[_0x39e4ee(0x7c)],_0x464a6e);_0x7b2c9f[_0x39e4ee(0x94)]==='send_file'&&_0x7b2c9f[_0x39e4ee(0x7c)][_0x39e4ee(0xe8)]&&await _0x56ba90(resolve(process[_0x39e4ee(0xa2)](),_0x7b2c9f[_0x39e4ee(0x7c)][_0x39e4ee(0xe8)])),_0x4e8a92[_0x39e4ee(0xa5)]({'role':_0x39e4ee(0xbb),'content':_0x39e4ee(0xdc)+_0x7b2c9f[_0x39e4ee(0x94)]+':\x0a'+JSON[_0x39e4ee(0xbd)](_0x571cff,null,0x2)}),await new Promise(_0x1ec02d=>setTimeout(_0x1ec02d,0xc8));}catch(_0x22b659){_0x4e8a92[_0x39e4ee(0xa5)]({'role':_0x39e4ee(0xbb),'content':_0x39e4ee(0x97)+_0x22b659+_0x39e4ee(0x70)});}}}function getOrCreateHistory(_0x15bdc5){const _0x32a79c=a7_0x11290b;return!chatHistories['has'](_0x15bdc5)&&chatHistories['set'](_0x15bdc5,[{'role':_0x32a79c(0xb4),'content':SYSTEM_PROMPT}]),chatHistories[_0x32a79c(0xf5)](_0x15bdc5);}export async function startBot(){const _0x42266a=a7_0x11290b,_0x380c72=a7_0x3ae594['getBotToken']();if(!_0x380c72)return![];if(isRunning)return!![];try{return client=new Client({'intents':[GatewayIntentBits['Guilds'],GatewayIntentBits[_0x42266a(0xe5)],GatewayIntentBits[_0x42266a(0x114)],GatewayIntentBits[_0x42266a(0x98)]],'partials':[Partials[_0x42266a(0xe6)]]}),client[_0x42266a(0xe7)]('ready',()=>{const _0x3bdee1=_0x42266a;a7_0x59554f[_0x3bdee1(0x100)](_0x3bdee1(0xc8)+client?.[_0x3bdee1(0xbb)]?.[_0x3bdee1(0x76)]),isRunning=!![];if(client)registerDiscordClient(client);}),client['on']('messageCreate',async _0x31e421=>{const _0x201516=_0x42266a;if(_0x31e421['author'][_0x201516(0xec)])return;const _0x5b689c=_0x31e421[_0x201516(0xb7)]['type']===ChannelType['DM'],_0xd89f54=client?.[_0x201516(0xbb)]&&_0x31e421[_0x201516(0xd4)][_0x201516(0x116)](client[_0x201516(0xbb)]);if(!_0x5b689c&&!_0xd89f54)return;const _0x37907a=_0x31e421[_0x201516(0x9c)][_0x201516(0x8f)](/<@!?[0-9]+>/g,'')['trim'](),_0x53ae96=_0x31e421[_0x201516(0xf0)]['id'],_0x5800e2=(_0x31e421[_0x201516(0xff)]||'dm')+'-'+_0x31e421[_0x201516(0xea)]+'-'+_0x53ae96,_0x2dd836=async _0x3f9d5c=>{const _0xc9e4aa=_0x201516;await _0x31e421[_0xc9e4aa(0xb7)]['send'](_0x3f9d5c)[_0xc9e4aa(0xb5)](()=>{});},_0x3799ba=async _0x264374=>{const _0x30ba77=_0x201516;try{const _0x1e927c=new AttachmentBuilder(_0x264374);await _0x31e421['channel'][_0x30ba77(0xee)]({'files':[_0x1e927c]});}catch{}};if(_0x37907a===_0x201516(0x73)||_0x37907a===_0x201516(0x6d)){chatHistories[_0x201516(0x87)](_0x5800e2),await _0x31e421[_0x201516(0x105)](_0x201516(0xa8));return;}if(_0x37907a===_0x201516(0xe1)||_0x37907a==='!clear'){chatHistories[_0x201516(0x87)](_0x5800e2),await _0x31e421[_0x201516(0x105)](_0x201516(0x74));return;}if(_0x37907a===_0x201516(0xca)||_0x37907a===_0x201516(0x10d)){const _0x402774=readTerminalOutput(),_0x3380b9=_0x402774[_0x201516(0xae)][_0x201516(0x79)]>0x0?'\x0aProcesses:\x20'+_0x402774[_0x201516(0xae)]['join'](',\x20'):'';await _0x31e421[_0x201516(0x105)]('Dir:\x20'+process['cwd']()+_0x201516(0xc7)+getSelectedModel()+_0x3380b9);return;}if(_0x37907a===_0x201516(0xd9)||_0x37907a===_0x201516(0xd7)){const _0x307628=gitStatus(),_0xad9206=tree('.',0x2),_0x4f7411=readJson(_0x201516(0xd0));let _0x3a4fee='Dir:\x20'+process[_0x201516(0xa2)]()+_0x201516(0xc7)+getSelectedModel()+'\x0a';if(_0x4f7411[_0x201516(0x100)]&&_0x4f7411['data']){const _0x19d405=_0x4f7411[_0x201516(0xaa)];_0x3a4fee+=_0x201516(0x9b)+(_0x19d405['name']||'?')+'\x20v'+(_0x19d405[_0x201516(0xd2)]||'?')+'\x0a';}if(_0x307628['success'])_0x3a4fee+='\x0aGit:\x20'+(_0x307628[_0x201516(0xc6)]||_0x201516(0x88))+'\x0a';_0xad9206[_0x201516(0x100)]&&_0xad9206[_0x201516(0x101)]&&(_0x3a4fee+=_0x201516(0xfb)+_0xad9206['tree'][_0x201516(0xc4)]('\x0a')[_0x201516(0x8a)](0x0,0xf)[_0x201516(0xef)]('\x0a'));if(_0x3a4fee[_0x201516(0x79)]>0x7d0)_0x3a4fee=_0x3a4fee[_0x201516(0x84)](0x0,0x7cd)+_0x201516(0x109);await _0x31e421[_0x201516(0x105)](_0x3a4fee);return;}if(_0x37907a[_0x201516(0xa6)]('/files\x20')||_0x37907a['startsWith'](_0x201516(0x99))||_0x37907a===_0x201516(0xbf)||_0x37907a===_0x201516(0x6f)){const _0x3057bd=_0x37907a['replace'](/^[!/]files\s*/,'')[_0x201516(0x69)]()||'.',_0x44f40f=listDirectory(_0x3057bd);if(_0x44f40f[_0x201516(0x100)]&&_0x44f40f[_0x201516(0x7f)]){const _0x4a2922=_0x44f40f[_0x201516(0x7f)][_0x201516(0x8a)](0x0,0x1e)[_0x201516(0xcf)](_0x7857a0=>{const _0x3720ef=_0x201516,_0x3f2f08=_0x7857a0[_0x3720ef(0x96)]===_0x3720ef(0xc2)?_0x3720ef(0xf2):_0x3720ef(0xb1);return _0x3f2f08+'\x20'+_0x7857a0['name'];})[_0x201516(0xef)]('\x0a');await _0x31e421[_0x201516(0x105)](_0x3057bd+_0x201516(0x10f)+_0x4a2922);}else await _0x31e421[_0x201516(0x105)](_0x44f40f['message']);return;}if(_0x37907a['startsWith'](_0x201516(0xe4))||_0x37907a[_0x201516(0xa6)](_0x201516(0xbc))){const _0x52ff8f=_0x37907a[_0x201516(0x8f)](/^[!/]run\s+/,'')['trim']();if(!_0x52ff8f){await _0x31e421['reply']('Usage:\x20/run\x20<command>');return;}await _0x31e421[_0x201516(0xb7)][_0x201516(0xb3)]()['catch'](()=>{});const _0x177984=await runCommand(_0x52ff8f,undefined,![],0x7530),_0x260ce2=(_0x177984[_0x201516(0xda)]||_0x177984[_0x201516(0x6a)]||_0x201516(0xdd))[_0x201516(0x84)](0x0,0x76c);await _0x31e421[_0x201516(0x105)](_0x201516(0x77)+_0x177984[_0x201516(0xd5)]+_0x201516(0x85)+_0x260ce2+_0x201516(0xeb));return;}if(_0x37907a[_0x201516(0xa6)](_0x201516(0xce))||_0x37907a[_0x201516(0xa6)](_0x201516(0xc3))){const _0x594ea1=_0x37907a[_0x201516(0x8f)](/^[!/]cd\s+/,'')[_0x201516(0x69)]();try{process[_0x201516(0x110)](resolve(process[_0x201516(0xa2)](),_0x594ea1)),await _0x31e421[_0x201516(0x105)]('Changed\x20to:\x20'+process['cwd']());}catch(_0x39a16b){await _0x31e421[_0x201516(0x105)](_0x201516(0x7b)+_0x39a16b);}return;}if(!_0x37907a)return;await _0x31e421[_0x201516(0xb7)][_0x201516(0xb3)]()[_0x201516(0xb5)](()=>{});const _0x19c88f=getOrCreateHistory(_0x5800e2);_0x19c88f[_0x201516(0xa5)]({'role':'user','content':_0x37907a}),a7_0x59554f[_0x201516(0xf9)](_0x201516(0xc0)+_0x31e421[_0x201516(0xf0)][_0x201516(0x108)]+':\x20'+_0x37907a),await processDiscordAgentLoop(_0x19c88f,getSelectedModel(),_0x2dd836,_0x3799ba);if(_0x31e421['attachments'][_0x201516(0xcd)]>0x0)for(const [,_0x4f04e4]of _0x31e421[_0x201516(0xfa)]){try{const _0x5393d2=await fetch(_0x4f04e4[_0x201516(0x72)]),_0x372f27=Buffer[_0x201516(0xb6)](await _0x5393d2[_0x201516(0x66)]()),_0x25b950=join(process['cwd'](),_0x4f04e4[_0x201516(0x94)]||'upload_'+Date[_0x201516(0x9f)]()),{writeFileSync:_0x401ef7}=await import('fs');_0x401ef7(_0x25b950,_0x372f27),_0x19c88f['push']({'role':_0x201516(0xbb),'content':'[File\x20received:\x20'+_0x4f04e4[_0x201516(0x94)]+'\x20('+_0x372f27[_0x201516(0x79)]+_0x201516(0xa4)+_0x25b950+']'}),await _0x31e421[_0x201516(0x105)](_0x201516(0x6c)+_0x4f04e4[_0x201516(0x94)]);}catch{}}}),await client[_0x42266a(0x7e)](_0x380c72),!![];}catch(_0xbc16ab){return a7_0x59554f[_0x42266a(0xba)]('[Discord]\x20Failed\x20to\x20start:\x20'+_0xbc16ab['message']),![];}}export function stopBot(){client&&(client['destroy'](),client=null),isRunning=![];}export function isBotRunning(){return isRunning;}
@@ -1 +1 @@
1
- const a8_0x11868f=a8_0xf4b6;(function(_0x15d227,_0x45e1cb){const _0x258304=a8_0xf4b6,_0x103cbf=_0x15d227();while(!![]){try{const _0x293d2b=-parseInt(_0x258304(0x7b))/0x1*(-parseInt(_0x258304(0x77))/0x2)+parseInt(_0x258304(0x8c))/0x3+parseInt(_0x258304(0x85))/0x4+-parseInt(_0x258304(0x7f))/0x5*(parseInt(_0x258304(0x86))/0x6)+parseInt(_0x258304(0x81))/0x7+-parseInt(_0x258304(0x8d))/0x8+-parseInt(_0x258304(0x7e))/0x9*(parseInt(_0x258304(0x80))/0xa);if(_0x293d2b===_0x45e1cb)break;else _0x103cbf['push'](_0x103cbf['shift']());}catch(_0x392243){_0x103cbf['push'](_0x103cbf['shift']());}}}(a8_0x16b1,0x2b41b));function a8_0x16b1(){const _0x6d0e1=['toString','7ntHXPq','get','botToken','9eQdwRO','168890WFJlgx','484910gDBjnS','1084013nEXPuH','split','hex','final','1248284aDNYPe','36CVvEAg','aes-256-cbc','update','utf8','from','sha256','200595UICwTE','2398496YAjsBK','createHash','55530tuHjXV','woozlit_discord_secure_key','digest'];a8_0x16b1=function(){return _0x6d0e1;};return a8_0x16b1();}import a8_0x27d346 from'conf';import a8_0x43d3f9 from'crypto';const config=new a8_0x27d346({'projectName':'woozlit-cli-discord','defaults':{'botToken':'','commandPrefix':'!','enabled':![]}}),ENCRYPTION_KEY=a8_0x11868f(0x78);function encrypt(_0x440e1b){const _0x35a5bf=a8_0x11868f;if(!_0x440e1b)return'';const _0x341fbe=a8_0x43d3f9['randomBytes'](0x10),_0xcd94b6=a8_0x43d3f9[_0x35a5bf(0x8e)](_0x35a5bf(0x8b))[_0x35a5bf(0x88)](ENCRYPTION_KEY)[_0x35a5bf(0x79)](),_0x4e1e36=a8_0x43d3f9['createCipheriv'](_0x35a5bf(0x87),_0xcd94b6,_0x341fbe);let _0x44a090=_0x4e1e36[_0x35a5bf(0x88)](_0x440e1b,_0x35a5bf(0x89),_0x35a5bf(0x83));return _0x44a090+=_0x4e1e36[_0x35a5bf(0x84)](_0x35a5bf(0x83)),_0x341fbe[_0x35a5bf(0x7a)]('hex')+':'+_0x44a090;}function decrypt(_0x4c6f0e){const _0x2ca41a=a8_0x11868f;if(!_0x4c6f0e)return'';try{const [_0x2c920,_0x36461e]=_0x4c6f0e[_0x2ca41a(0x82)](':');if(!_0x2c920||!_0x36461e)return'';const _0x28f512=Buffer[_0x2ca41a(0x8a)](_0x2c920,_0x2ca41a(0x83)),_0x58fff9=a8_0x43d3f9[_0x2ca41a(0x8e)](_0x2ca41a(0x8b))[_0x2ca41a(0x88)](ENCRYPTION_KEY)[_0x2ca41a(0x79)](),_0x5ef06a=a8_0x43d3f9['createDecipheriv'](_0x2ca41a(0x87),_0x58fff9,_0x28f512);let _0x2c640d=_0x5ef06a['update'](_0x36461e,_0x2ca41a(0x83),_0x2ca41a(0x89));return _0x2c640d+=_0x5ef06a[_0x2ca41a(0x84)]('utf8'),_0x2c640d;}catch{return'';}}export function setBotToken(_0xb9b69f){const _0x471df2=a8_0x11868f;config['set'](_0x471df2(0x7d),encrypt(_0xb9b69f));}export function getBotToken(){const _0x278e0e=a8_0x11868f;return decrypt(config[_0x278e0e(0x7c)](_0x278e0e(0x7d)));}export function isEnabled(){return!!getBotToken();}function a8_0xf4b6(_0x2ee733,_0xbcd860){_0x2ee733=_0x2ee733-0x77;const _0x16b1fb=a8_0x16b1();let _0xf4b60c=_0x16b1fb[_0x2ee733];return _0xf4b60c;}export function isConfigured(){return!!getBotToken();}export function clearConfig(){config['clear']();}
1
+ const a8_0x59332c=a8_0x303e;(function(_0x418672,_0x21c36e){const _0x3c21a5=a8_0x303e,_0xfd98fd=_0x418672();while(!![]){try{const _0x3fd0ef=-parseInt(_0x3c21a5(0xb5))/0x1+-parseInt(_0x3c21a5(0xbe))/0x2+-parseInt(_0x3c21a5(0xcd))/0x3*(parseInt(_0x3c21a5(0xc5))/0x4)+-parseInt(_0x3c21a5(0xba))/0x5*(-parseInt(_0x3c21a5(0xcc))/0x6)+parseInt(_0x3c21a5(0xbb))/0x7*(parseInt(_0x3c21a5(0xd1))/0x8)+-parseInt(_0x3c21a5(0xd2))/0x9*(-parseInt(_0x3c21a5(0xc4))/0xa)+-parseInt(_0x3c21a5(0xce))/0xb*(-parseInt(_0x3c21a5(0xcb))/0xc);if(_0x3fd0ef===_0x21c36e)break;else _0xfd98fd['push'](_0xfd98fd['shift']());}catch(_0x3c2ee6){_0xfd98fd['push'](_0xfd98fd['shift']());}}}(a8_0x4f7a,0x4ab02));import a8_0x53a47d from'conf';import a8_0x2dd0f7 from'crypto';const config=new a8_0x53a47d({'projectName':a8_0x59332c(0xc9),'defaults':{'botToken':'','commandPrefix':'!','enabled':![]}}),ENCRYPTION_KEY=a8_0x59332c(0xcf);function encrypt(_0x31188c){const _0x3bd7ca=a8_0x59332c;if(!_0x31188c)return'';const _0x8e8c2d=a8_0x2dd0f7[_0x3bd7ca(0xc1)](0x10),_0x242cc6=a8_0x2dd0f7['createHash']('sha256')[_0x3bd7ca(0xb9)](ENCRYPTION_KEY)[_0x3bd7ca(0xc2)](),_0x2cb3fc=a8_0x2dd0f7[_0x3bd7ca(0xb7)]('aes-256-cbc',_0x242cc6,_0x8e8c2d);let _0xb3780=_0x2cb3fc[_0x3bd7ca(0xb9)](_0x31188c,'utf8',_0x3bd7ca(0xb8));return _0xb3780+=_0x2cb3fc[_0x3bd7ca(0xbd)](_0x3bd7ca(0xb8)),_0x8e8c2d['toString']('hex')+':'+_0xb3780;}function decrypt(_0x13ff21){const _0x6491df=a8_0x59332c;if(!_0x13ff21)return'';try{const [_0x4fef03,_0x392200]=_0x13ff21[_0x6491df(0xca)](':');if(!_0x4fef03||!_0x392200)return'';const _0x5680df=Buffer['from'](_0x4fef03,_0x6491df(0xb8)),_0xc42161=a8_0x2dd0f7[_0x6491df(0xc7)](_0x6491df(0xc8))['update'](ENCRYPTION_KEY)[_0x6491df(0xc2)](),_0x254c5c=a8_0x2dd0f7[_0x6491df(0xc0)](_0x6491df(0xb6),_0xc42161,_0x5680df);let _0x2d623c=_0x254c5c[_0x6491df(0xb9)](_0x392200,_0x6491df(0xb8),_0x6491df(0xc6));return _0x2d623c+=_0x254c5c[_0x6491df(0xbd)](_0x6491df(0xc6)),_0x2d623c;}catch{return'';}}export function setBotToken(_0x245f40){const _0xff497e=a8_0x59332c;config[_0xff497e(0xbc)](_0xff497e(0xc3),encrypt(_0x245f40));}function a8_0x4f7a(){const _0x3076ce=['clear','8QqWPLL','13743jCTtzY','588357lrfVFH','aes-256-cbc','createCipheriv','hex','update','328510vrwTOd','2175628Zdocxo','set','final','183764MlcRxg','get','createDecipheriv','randomBytes','digest','botToken','1130UmIXtd','17648oZtPiV','utf8','createHash','sha256','woozlit-cli-discord','split','3484068yzbVxd','36tRcHVN','321KihCqa','22KBBpmD','woozlit_discord_secure_key'];a8_0x4f7a=function(){return _0x3076ce;};return a8_0x4f7a();}export function getBotToken(){const _0x462b3a=a8_0x59332c;return decrypt(config[_0x462b3a(0xbf)](_0x462b3a(0xc3)));}export function isEnabled(){return!!getBotToken();}function a8_0x303e(_0x5b62cc,_0x4ea4dd){_0x5b62cc=_0x5b62cc-0xb5;const _0x4f7a49=a8_0x4f7a();let _0x303e57=_0x4f7a49[_0x5b62cc];return _0x303e57;}export function isConfigured(){return!!getBotToken();}export function clearConfig(){const _0x2df665=a8_0x59332c;config[_0x2df665(0xd0)]();}
@@ -1 +1 @@
1
- function a9_0xe57c(){var _0x1384d7=['8dsnZDx','2500440jSTcFy','388339uzGngk','6xFpqcW','4904711BcbpOL','1341558gQIqEK','8546544tKBFKp','2825360XNxPSt','232818QRBMKB'];a9_0xe57c=function(){return _0x1384d7;};return a9_0xe57c();}(function(_0x4f6139,_0x501317){var _0x12f235=a9_0x2f70,_0x3a507b=_0x4f6139();while(!![]){try{var _0x43d90c=parseInt(_0x12f235(0x1c0))/0x1+parseInt(_0x12f235(0x1ba))/0x2+-parseInt(_0x12f235(0x1bd))/0x3*(-parseInt(_0x12f235(0x1be))/0x4)+parseInt(_0x12f235(0x1bc))/0x5+-parseInt(_0x12f235(0x1c1))/0x6*(parseInt(_0x12f235(0x1b9))/0x7)+parseInt(_0x12f235(0x1bf))/0x8+-parseInt(_0x12f235(0x1bb))/0x9;if(_0x43d90c===_0x501317)break;else _0x3a507b['push'](_0x3a507b['shift']());}catch(_0x3cc79c){_0x3a507b['push'](_0x3a507b['shift']());}}}(a9_0xe57c,0x6bd44));export*from'./config.js';function a9_0x2f70(_0xf01dfa,_0x47758d){_0xf01dfa=_0xf01dfa-0x1b9;var _0xe57c6d=a9_0xe57c();var _0x2f70b4=_0xe57c6d[_0xf01dfa];return _0x2f70b4;}export{startBot,stopBot,isBotRunning}from'./client.js';export{setupDiscord}from'./setup.js';
1
+ function a9_0x463d(){var _0x24f237=['3469929XVslaU','474132cMiLML','10NctMpF','10cPotVg','63230ZbHcqQ','32834796kIEwsN','7fCyVse','6325443YMnjYO','9WYFVYV','1574392CMmTlu','1423796dplHrl','4zViEtQ'];a9_0x463d=function(){return _0x24f237;};return a9_0x463d();}(function(_0x275e60,_0xcd6a4e){var _0x1fe6b4=a9_0x2f78,_0x2ee064=_0x275e60();while(!![]){try{var _0xe20220=parseInt(_0x1fe6b4(0x1a2))/0x1*(parseInt(_0x1fe6b4(0x19e))/0x2)+parseInt(_0x1fe6b4(0x1a6))/0x3*(-parseInt(_0x1fe6b4(0x1a5))/0x4)+parseInt(_0x1fe6b4(0x1a8))/0x5*(-parseInt(_0x1fe6b4(0x1a7))/0x6)+parseInt(_0x1fe6b4(0x1a0))/0x7*(-parseInt(_0x1fe6b4(0x1a3))/0x8)+-parseInt(_0x1fe6b4(0x1a1))/0x9*(parseInt(_0x1fe6b4(0x19d))/0xa)+-parseInt(_0x1fe6b4(0x1a4))/0xb+parseInt(_0x1fe6b4(0x19f))/0xc;if(_0xe20220===_0xcd6a4e)break;else _0x2ee064['push'](_0x2ee064['shift']());}catch(_0x5d6876){_0x2ee064['push'](_0x2ee064['shift']());}}}(a9_0x463d,0xa549b));export*from'./config.js';function a9_0x2f78(_0x1bdd23,_0x590584){_0x1bdd23=_0x1bdd23-0x19d;var _0x463ddf=a9_0x463d();var _0x2f7815=_0x463ddf[_0x1bdd23];return _0x2f7815;}export{startBot,stopBot,isBotRunning}from'./client.js';export{setupDiscord}from'./setup.js';
@@ -1 +1 @@
1
- (function(_0x520442,_0xd8eccc){const _0x33ed00=a10_0x3662,_0x51c063=_0x520442();while(!![]){try{const _0x44d7b9=parseInt(_0x33ed00(0x1be))/0x1*(parseInt(_0x33ed00(0x1bc))/0x2)+-parseInt(_0x33ed00(0x1ba))/0x3*(-parseInt(_0x33ed00(0x1ae))/0x4)+-parseInt(_0x33ed00(0x1af))/0x5+-parseInt(_0x33ed00(0x1bf))/0x6+-parseInt(_0x33ed00(0x1b3))/0x7*(-parseInt(_0x33ed00(0x1bb))/0x8)+parseInt(_0x33ed00(0x1b8))/0x9+parseInt(_0x33ed00(0x1b9))/0xa*(-parseInt(_0x33ed00(0x1b4))/0xb);if(_0x44d7b9===_0xd8eccc)break;else _0x51c063['push'](_0x51c063['shift']());}catch(_0xb66fc7){_0x51c063['push'](_0x51c063['shift']());}}}(a10_0x1bea,0x8b0f5));function a10_0x3662(_0x1633f9,_0x5b13fb){_0x1633f9=_0x1633f9-0x1ae;const _0x1beadb=a10_0x1bea();let _0x36623c=_0x1beadb[_0x1633f9];return _0x36623c;}import{input}from'@inquirer/prompts';import*as a10_0x5ae48e from'./config.js';import*as a10_0x267330 from'../ui/output.js';export async function setupDiscord(){const _0x3919d2=a10_0x3662;a10_0x267330[_0x3919d2(0x1b6)]('Setup\x20Woozlit\x20Discord\x20Bot'),a10_0x267330['dim']('You\x20need\x20a\x20Bot\x20Token\x20from\x20the\x20Discord\x20Developer\x20Portal.');const _0x2ea12f=await input({'message':_0x3919d2(0x1b5),'validate':_0x443706=>_0x443706['length']>0xa?!![]:_0x3919d2(0x1b7)}),_0x49e05e=await input({'message':_0x3919d2(0x1b2),'default':'!'});a10_0x5ae48e['setBotToken'](_0x2ea12f),a10_0x267330[_0x3919d2(0x1b1)](_0x3919d2(0x1bd)),a10_0x267330['info'](_0x3919d2(0x1b0));}function a10_0x1bea(){const _0x2de539=['4hhBadg','2919390tRLXYK','Restart\x20the\x20CLI\x20to\x20start\x20the\x20Discord\x20Bot.','success','Command\x20Prefix\x20(optional,\x20default\x20\x27!\x27):','5685379wSRDmj','11dGhEQy','Bot\x20Token:','info','Token\x20seems\x20too\x20short','2763918ueRBFh','14077270ZSNhZb','3177003IEHKfX','8nOPrFp','8cnxDzF','Discord\x20configuration\x20saved!','105946AOUjgu','245340LhJswo'];a10_0x1bea=function(){return _0x2de539;};return a10_0x1bea();}
1
+ (function(_0x2a2a28,_0x19d368){const _0x1cb1eb=a10_0x542f,_0x65ed6c=_0x2a2a28();while(!![]){try{const _0xce55a8=parseInt(_0x1cb1eb(0x15e))/0x1*(parseInt(_0x1cb1eb(0x15c))/0x2)+-parseInt(_0x1cb1eb(0x15a))/0x3+-parseInt(_0x1cb1eb(0x156))/0x4*(parseInt(_0x1cb1eb(0x150))/0x5)+-parseInt(_0x1cb1eb(0x161))/0x6*(-parseInt(_0x1cb1eb(0x14f))/0x7)+-parseInt(_0x1cb1eb(0x154))/0x8*(-parseInt(_0x1cb1eb(0x151))/0x9)+parseInt(_0x1cb1eb(0x15d))/0xa+-parseInt(_0x1cb1eb(0x15b))/0xb;if(_0xce55a8===_0x19d368)break;else _0x65ed6c['push'](_0x65ed6c['shift']());}catch(_0x540122){_0x65ed6c['push'](_0x65ed6c['shift']());}}}(a10_0x4861,0x2f17f));function a10_0x4861(){const _0x5811fb=['6648uoxVvX','Token\x20seems\x20too\x20short','3268YRKmhn','Restart\x20the\x20CLI\x20to\x20start\x20the\x20Discord\x20Bot.','You\x20need\x20a\x20Bot\x20Token\x20from\x20the\x20Discord\x20Developer\x20Portal.','success','628743aYVWmm','4007443RbwdUX','636428kPletA','3719390BhshbV','1iyEOIT','Discord\x20configuration\x20saved!','dim','144JQyVSR','17332pSQzpm','805hXOyzr','1611gmCPNE','info','Setup\x20Woozlit\x20Discord\x20Bot'];a10_0x4861=function(){return _0x5811fb;};return a10_0x4861();}import{input}from'@inquirer/prompts';import*as a10_0x23807f from'./config.js';import*as a10_0x511f7f from'../ui/output.js';function a10_0x542f(_0x599898,_0x1d44e7){_0x599898=_0x599898-0x14f;const _0x486172=a10_0x4861();let _0x542fd3=_0x486172[_0x599898];return _0x542fd3;}export async function setupDiscord(){const _0x44f7e8=a10_0x542f;a10_0x511f7f['info'](_0x44f7e8(0x153)),a10_0x511f7f[_0x44f7e8(0x160)](_0x44f7e8(0x158));const _0x126866=await input({'message':'Bot\x20Token:','validate':_0xccf8c8=>_0xccf8c8['length']>0xa?!![]:_0x44f7e8(0x155)}),_0x1e5fd8=await input({'message':'Command\x20Prefix\x20(optional,\x20default\x20\x27!\x27):','default':'!'});a10_0x23807f['setBotToken'](_0x126866),a10_0x511f7f[_0x44f7e8(0x159)](_0x44f7e8(0x15f)),a10_0x511f7f[_0x44f7e8(0x152)](_0x44f7e8(0x157));}
@@ -1 +1 @@
1
- const a11_0x537d0c=a11_0xe240;(function(_0x13351d,_0x545daa){const _0x2e8e5b=a11_0xe240,_0x58d7ed=_0x13351d();while(!![]){try{const _0x4a3322=parseInt(_0x2e8e5b(0x14d))/0x1*(-parseInt(_0x2e8e5b(0x162))/0x2)+parseInt(_0x2e8e5b(0x147))/0x3+parseInt(_0x2e8e5b(0x15b))/0x4+-parseInt(_0x2e8e5b(0x149))/0x5*(-parseInt(_0x2e8e5b(0x168))/0x6)+-parseInt(_0x2e8e5b(0x150))/0x7+parseInt(_0x2e8e5b(0x165))/0x8*(parseInt(_0x2e8e5b(0x146))/0x9)+-parseInt(_0x2e8e5b(0x158))/0xa;if(_0x4a3322===_0x545daa)break;else _0x58d7ed['push'](_0x58d7ed['shift']());}catch(_0x298cdc){_0x58d7ed['push'](_0x58d7ed['shift']());}}}(a11_0xe88e,0x9d77b));import a11_0x5acdf1 from'conf';import a11_0x30b38a from'crypto';function a11_0xe88e(){const _0x56540e=['enabled','createDecipheriv','createHash','update','342764aukEDx','woozlit_email_secure_key','aes-256-cbc','2407696reJhIn','smtp.gmail.com','get','143802LqbYTP','allowedSenders','push','smtpUser','imap','digest','27suVesf','3397254kRGqcA','woozlit-cli-email','15GdWuAH','utf8','hex','imap.gmail.com','6cFRceD','from','sha256','5456031vhcddQ','checkInterval','password','imapPass','randomBytes','final','user','smtpPass','7888300aIFPpY','imapHost','imapUser','4537348TzLqZI','split','set'];a11_0xe88e=function(){return _0x56540e;};return a11_0xe88e();}const config=new a11_0x5acdf1({'projectName':a11_0x537d0c(0x148),'defaults':{'imapHost':a11_0x537d0c(0x14c),'imapPort':0x3e1,'imapUser':'','imapPass':'','smtpHost':a11_0x537d0c(0x166),'smtpPort':0x24b,'smtpUser':'','smtpPass':'','checkInterval':0x5,'allowedSenders':[],'enabled':![]}}),ENCRYPTION_KEY=a11_0x537d0c(0x163);function encrypt(_0x15cc6e){const _0x5451ed=a11_0x537d0c;if(!_0x15cc6e)return'';const _0x20d851=a11_0x30b38a[_0x5451ed(0x154)](0x10),_0x1bbf96=a11_0x30b38a[_0x5451ed(0x160)](_0x5451ed(0x14f))[_0x5451ed(0x161)](ENCRYPTION_KEY)[_0x5451ed(0x145)](),_0x3ba7b6=a11_0x30b38a['createCipheriv'](_0x5451ed(0x164),_0x1bbf96,_0x20d851);let _0x38ed3f=_0x3ba7b6[_0x5451ed(0x161)](_0x15cc6e,_0x5451ed(0x14a),_0x5451ed(0x14b));return _0x38ed3f+=_0x3ba7b6[_0x5451ed(0x155)](_0x5451ed(0x14b)),_0x20d851['toString'](_0x5451ed(0x14b))+':'+_0x38ed3f;}function decrypt(_0x54bf28){const _0x1b013c=a11_0x537d0c;if(!_0x54bf28)return'';try{const [_0x76d784,_0x377042]=_0x54bf28[_0x1b013c(0x15c)](':');if(!_0x76d784||!_0x377042)return'';const _0x31d891=Buffer[_0x1b013c(0x14e)](_0x76d784,_0x1b013c(0x14b)),_0x358e72=a11_0x30b38a[_0x1b013c(0x160)]('sha256')[_0x1b013c(0x161)](ENCRYPTION_KEY)[_0x1b013c(0x145)](),_0x3988d8=a11_0x30b38a[_0x1b013c(0x15f)](_0x1b013c(0x164),_0x358e72,_0x31d891);let _0x3e1a4c=_0x3988d8[_0x1b013c(0x161)](_0x377042,'hex','utf8');return _0x3e1a4c+=_0x3988d8[_0x1b013c(0x155)](_0x1b013c(0x14a)),_0x3e1a4c;}catch{return'';}}export function setCredentials(_0x1d9654,_0x4b316c,_0x30aee6,_0x32281f){const _0x508ce0=a11_0x537d0c;config[_0x508ce0(0x15d)](_0x508ce0(0x15a),_0x1d9654),config[_0x508ce0(0x15d)](_0x508ce0(0x153),encrypt(_0x4b316c)),config[_0x508ce0(0x15d)]('smtpUser',_0x1d9654),config[_0x508ce0(0x15d)](_0x508ce0(0x157),encrypt(_0x4b316c));if(_0x30aee6)config[_0x508ce0(0x15d)](_0x508ce0(0x159),_0x30aee6);}export function getConfig(){const _0x1b8245=a11_0x537d0c;return{'imap':{'user':config[_0x1b8245(0x167)](_0x1b8245(0x15a)),'password':decrypt(config[_0x1b8245(0x167)](_0x1b8245(0x153))),'host':config[_0x1b8245(0x167)](_0x1b8245(0x159)),'port':config['get']('imapPort'),'tls':!![],'tlsOptions':{'rejectUnauthorized':![]},'authTimeout':0xbb8},'smtp':{'host':config[_0x1b8245(0x167)]('smtpHost'),'port':config[_0x1b8245(0x167)]('smtpPort'),'auth':{'user':config[_0x1b8245(0x167)](_0x1b8245(0x16b)),'pass':decrypt(config[_0x1b8245(0x167)](_0x1b8245(0x157)))},'tls':{'rejectUnauthorized':![]}},'interval':config['get'](_0x1b8245(0x151)),'allowedSenders':config['get'](_0x1b8245(0x169))||[],'enabled':config[_0x1b8245(0x167)](_0x1b8245(0x15e))};}export function isConfigured(){const _0x1e0850=a11_0x537d0c,_0x2e12f4=getConfig();return!!_0x2e12f4[_0x1e0850(0x144)][_0x1e0850(0x156)]&&!!_0x2e12f4[_0x1e0850(0x144)][_0x1e0850(0x152)];}function a11_0xe240(_0x32583,_0x565fc4){_0x32583=_0x32583-0x144;const _0xe88e1d=a11_0xe88e();let _0xe240b0=_0xe88e1d[_0x32583];return _0xe240b0;}export function setEnabled(_0x19309e){const _0x49a21e=a11_0x537d0c;config[_0x49a21e(0x15d)](_0x49a21e(0x15e),_0x19309e);}export function addAllowedSender(_0x437106){const _0x5c6dbd=a11_0x537d0c,_0x3fdecd=config[_0x5c6dbd(0x167)](_0x5c6dbd(0x169))||[];!_0x3fdecd['includes'](_0x437106)&&(_0x3fdecd[_0x5c6dbd(0x16a)](_0x437106),config[_0x5c6dbd(0x15d)](_0x5c6dbd(0x169),_0x3fdecd));}
1
+ const a11_0x5a163f=a11_0x3f67;function a11_0xe7e4(){const _0x331ca8=['woozlit_email_secure_key','allowedSenders','imapPass','set','hex','smtpPort','from','6160tjmPAV','split','20cggOzf','enabled','digest','smtpUser','createDecipheriv','232RdBKEx','password','get','createHash','update','sha256','final','includes','784644MoBHpz','user','imapUser','76DRKhcd','imapPort','aes-256-cbc','427516jRoMjh','woozlit-cli-email','1681575ACRhBa','2671526VghzSi','38010nCLfsg','4131369VRxzcR','smtpPass','60GVmTNU','imap.gmail.com','imapHost','createCipheriv','smtpHost','utf8'];a11_0xe7e4=function(){return _0x331ca8;};return a11_0xe7e4();}(function(_0x7a552a,_0x8da68c){const _0x499b1f=a11_0x3f67,_0x3707c3=_0x7a552a();while(!![]){try{const _0x4e9762=parseInt(_0x499b1f(0x1ac))/0x1*(-parseInt(_0x499b1f(0x19a))/0x2)+-parseInt(_0x499b1f(0x1b1))/0x3+-parseInt(_0x499b1f(0x1af))/0x4+-parseInt(_0x499b1f(0x19c))/0x5*(parseInt(_0x499b1f(0x1a9))/0x6)+parseInt(_0x499b1f(0x1b3))/0x7*(-parseInt(_0x499b1f(0x1a1))/0x8)+parseInt(_0x499b1f(0x1b4))/0x9+-parseInt(_0x499b1f(0x1b6))/0xa*(-parseInt(_0x499b1f(0x1b2))/0xb);if(_0x4e9762===_0x8da68c)break;else _0x3707c3['push'](_0x3707c3['shift']());}catch(_0x256f03){_0x3707c3['push'](_0x3707c3['shift']());}}}(a11_0xe7e4,0x5196b));import a11_0x3c1887 from'conf';import a11_0x5eaf1d from'crypto';const config=new a11_0x3c1887({'projectName':a11_0x5a163f(0x1b0),'defaults':{'imapHost':a11_0x5a163f(0x1b7),'imapPort':0x3e1,'imapUser':'','imapPass':'','smtpHost':'smtp.gmail.com','smtpPort':0x24b,'smtpUser':'','smtpPass':'','checkInterval':0x5,'allowedSenders':[],'enabled':![]}}),ENCRYPTION_KEY=a11_0x5a163f(0x1bc);function encrypt(_0x2c14c1){const _0x2a91d0=a11_0x5a163f;if(!_0x2c14c1)return'';const _0x5daef5=a11_0x5eaf1d['randomBytes'](0x10),_0x17cd8a=a11_0x5eaf1d[_0x2a91d0(0x1a4)](_0x2a91d0(0x1a6))['update'](ENCRYPTION_KEY)[_0x2a91d0(0x19e)](),_0x411e3d=a11_0x5eaf1d[_0x2a91d0(0x1b9)](_0x2a91d0(0x1ae),_0x17cd8a,_0x5daef5);let _0xce8657=_0x411e3d[_0x2a91d0(0x1a5)](_0x2c14c1,_0x2a91d0(0x1bb),_0x2a91d0(0x1c0));return _0xce8657+=_0x411e3d['final'](_0x2a91d0(0x1c0)),_0x5daef5['toString'](_0x2a91d0(0x1c0))+':'+_0xce8657;}function decrypt(_0x51d6a2){const _0x4ef55d=a11_0x5a163f;if(!_0x51d6a2)return'';try{const [_0x58f16d,_0x3394be]=_0x51d6a2[_0x4ef55d(0x19b)](':');if(!_0x58f16d||!_0x3394be)return'';const _0x2f389b=Buffer[_0x4ef55d(0x199)](_0x58f16d,_0x4ef55d(0x1c0)),_0xe8f6b0=a11_0x5eaf1d[_0x4ef55d(0x1a4)]('sha256')['update'](ENCRYPTION_KEY)[_0x4ef55d(0x19e)](),_0x40e409=a11_0x5eaf1d[_0x4ef55d(0x1a0)](_0x4ef55d(0x1ae),_0xe8f6b0,_0x2f389b);let _0x5990de=_0x40e409[_0x4ef55d(0x1a5)](_0x3394be,_0x4ef55d(0x1c0),'utf8');return _0x5990de+=_0x40e409[_0x4ef55d(0x1a7)](_0x4ef55d(0x1bb)),_0x5990de;}catch{return'';}}function a11_0x3f67(_0x44d01e,_0x1832a9){_0x44d01e=_0x44d01e-0x198;const _0xe7e4c=a11_0xe7e4();let _0x3f6751=_0xe7e4c[_0x44d01e];return _0x3f6751;}export function setCredentials(_0x4c0eb7,_0x2d0c96,_0x36b4c4,_0x2d844a){const _0xa124fb=a11_0x5a163f;config['set'](_0xa124fb(0x1ab),_0x4c0eb7),config[_0xa124fb(0x1bf)](_0xa124fb(0x1be),encrypt(_0x2d0c96)),config[_0xa124fb(0x1bf)](_0xa124fb(0x19f),_0x4c0eb7),config[_0xa124fb(0x1bf)](_0xa124fb(0x1b5),encrypt(_0x2d0c96));if(_0x36b4c4)config[_0xa124fb(0x1bf)](_0xa124fb(0x1b8),_0x36b4c4);}export function getConfig(){const _0x2db6b1=a11_0x5a163f;return{'imap':{'user':config[_0x2db6b1(0x1a3)]('imapUser'),'password':decrypt(config[_0x2db6b1(0x1a3)]('imapPass')),'host':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1b8)),'port':config['get'](_0x2db6b1(0x1ad)),'tls':!![],'tlsOptions':{'rejectUnauthorized':![]},'authTimeout':0xbb8},'smtp':{'host':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1ba)),'port':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x198)),'auth':{'user':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x19f)),'pass':decrypt(config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1b5)))},'tls':{'rejectUnauthorized':![]}},'interval':config['get']('checkInterval'),'allowedSenders':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1bd))||[],'enabled':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x19d))};}export function isConfigured(){const _0x37bec8=a11_0x5a163f,_0x1a95ba=getConfig();return!!_0x1a95ba['imap'][_0x37bec8(0x1aa)]&&!!_0x1a95ba['imap'][_0x37bec8(0x1a2)];}export function setEnabled(_0x2565df){config['set']('enabled',_0x2565df);}export function addAllowedSender(_0x50292a){const _0x20851d=a11_0x5a163f,_0x255309=config[_0x20851d(0x1a3)]('allowedSenders')||[];!_0x255309[_0x20851d(0x1a8)](_0x50292a)&&(_0x255309['push'](_0x50292a),config['set']('allowedSenders',_0x255309));}
@@ -1 +1 @@
1
- (function(_0x4e8df4,_0x492e20){var _0x348418=a12_0x3f97,_0x2edae3=_0x4e8df4();while(!![]){try{var _0x3885a2=parseInt(_0x348418(0x130))/0x1+parseInt(_0x348418(0x12e))/0x2+-parseInt(_0x348418(0x132))/0x3*(parseInt(_0x348418(0x12f))/0x4)+parseInt(_0x348418(0x131))/0x5*(-parseInt(_0x348418(0x12d))/0x6)+-parseInt(_0x348418(0x135))/0x7+-parseInt(_0x348418(0x12c))/0x8+parseInt(_0x348418(0x134))/0x9*(parseInt(_0x348418(0x133))/0xa);if(_0x3885a2===_0x492e20)break;else _0x2edae3['push'](_0x2edae3['shift']());}catch(_0x375f4b){_0x2edae3['push'](_0x2edae3['shift']());}}}(a12_0x4556,0x8d238));export*from'./config.js';function a12_0x4556(){var _0x4ac584=['7089968MkoTNN','2007912HdMuDN','637672oYyHwc','8WdaBOy','256894PvDLyn','10TRGFFZ','499971wUGJnE','13820tDfkgf','13635qBnrBX','1417444VuHCxB'];a12_0x4556=function(){return _0x4ac584;};return a12_0x4556();}export{startBot,stopBot,isBotRunning}from'./service.js';function a12_0x3f97(_0x3e1b09,_0x3d8e35){_0x3e1b09=_0x3e1b09-0x12c;var _0x45566f=a12_0x4556();var _0x3f97ec=_0x45566f[_0x3e1b09];return _0x3f97ec;}export{setupEmail}from'./setup.js';
1
+ (function(_0x1bc5e7,_0x2281ce){var _0xe21656=a12_0x1105,_0x2eb13e=_0x1bc5e7();while(!![]){try{var _0x518238=-parseInt(_0xe21656(0xd9))/0x1+parseInt(_0xe21656(0xe1))/0x2+parseInt(_0xe21656(0xe2))/0x3+parseInt(_0xe21656(0xdd))/0x4+parseInt(_0xe21656(0xda))/0x5*(-parseInt(_0xe21656(0xde))/0x6)+parseInt(_0xe21656(0xdc))/0x7*(parseInt(_0xe21656(0xe0))/0x8)+-parseInt(_0xe21656(0xdf))/0x9*(parseInt(_0xe21656(0xdb))/0xa);if(_0x518238===_0x2281ce)break;else _0x2eb13e['push'](_0x2eb13e['shift']());}catch(_0x54fd9c){_0x2eb13e['push'](_0x2eb13e['shift']());}}}(a12_0xb0e9,0x1cd23));export*from'./config.js';export{startBot,stopBot,isBotRunning}from'./service.js';function a12_0x1105(_0x267c29,_0x5e6eb1){_0x267c29=_0x267c29-0xd9;var _0xb0e98f=a12_0xb0e9();var _0x110507=_0xb0e98f[_0x267c29];return _0x110507;}export{setupEmail}from'./setup.js';function a12_0xb0e9(){var _0x28b27e=['10yvaNqs','217MpBySz','662060NllnYm','211902moeWVx','814833lAmIlx','43672gyDscB','167896nqFkcJ','463941oNdqCC','188166nTEgiS','25rXvsfi'];a12_0xb0e9=function(){return _0x28b27e;};return a12_0xb0e9();}
@@ -1 +1 @@
1
- function a13_0x4c8f(_0x26e99b,_0x2e792c){_0x26e99b=_0x26e99b-0x1b6;const _0x1478b3=a13_0x1478();let _0x4c8f98=_0x1478b3[_0x26e99b];return _0x4c8f98;}(function(_0x95913b,_0x202d6e){const _0x2832b4=a13_0x4c8f,_0x219eb9=_0x95913b();while(!![]){try{const _0x4759c4=-parseInt(_0x2832b4(0x1c2))/0x1*(parseInt(_0x2832b4(0x1b6))/0x2)+-parseInt(_0x2832b4(0x1d1))/0x3+-parseInt(_0x2832b4(0x1bb))/0x4*(parseInt(_0x2832b4(0x1b9))/0x5)+parseInt(_0x2832b4(0x1c1))/0x6*(parseInt(_0x2832b4(0x1c4))/0x7)+-parseInt(_0x2832b4(0x1e2))/0x8*(parseInt(_0x2832b4(0x1e0))/0x9)+-parseInt(_0x2832b4(0x1db))/0xa+parseInt(_0x2832b4(0x1d6))/0xb;if(_0x4759c4===_0x202d6e)break;else _0x219eb9['push'](_0x219eb9['shift']());}catch(_0x2f5fc5){_0x219eb9['push'](_0x219eb9['shift']());}}}(a13_0x1478,0x713d5));import a13_0x661174 from'imap-simple';import a13_0x11b6f7 from'nodemailer';import*as a13_0x124f90 from'./config.js';import*as a13_0x401e5d from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';let intervalId=null,isRunning=![];async function checkEmails(){const _0x3fbb2d=a13_0x4c8f,_0x39c687=a13_0x124f90[_0x3fbb2d(0x1dc)]();try{const _0x5bc69d=await a13_0x661174[_0x3fbb2d(0x1c9)]({'imap':_0x39c687[_0x3fbb2d(0x1d9)]});await _0x5bc69d[_0x3fbb2d(0x1de)](_0x3fbb2d(0x1d4));const _0x19f258=[_0x3fbb2d(0x1d2)],_0x56d44f={'bodies':[_0x3fbb2d(0x1d0),_0x3fbb2d(0x1b7)],'markSeen':!![]},_0x56a2df=await _0x5bc69d[_0x3fbb2d(0x1c0)](_0x19f258,_0x56d44f);_0x56a2df[_0x3fbb2d(0x1d3)]>0x0&&a13_0x401e5d[_0x3fbb2d(0x1e4)](_0x3fbb2d(0x1cb)+_0x56a2df['length']+_0x3fbb2d(0x1bc));for(const _0x578a41 of _0x56a2df){const _0x12fd66=_0x578a41[_0x3fbb2d(0x1dd)][_0x3fbb2d(0x1da)](_0x4d7910=>_0x4d7910[_0x3fbb2d(0x1ca)]==='HEADER'),_0x35b577=_0x12fd66[_0x3fbb2d(0x1cd)][_0x3fbb2d(0x1c6)]?.[0x0]||'',_0xe908b6=_0x12fd66[_0x3fbb2d(0x1cd)][_0x3fbb2d(0x1df)]?.[0x0]||_0x3fbb2d(0x1c8);if(_0x39c687[_0x3fbb2d(0x1bf)][_0x3fbb2d(0x1d3)]>0x0){const _0x253782=_0x35b577[_0x3fbb2d(0x1e3)](/<(.+)>/)?.[0x1]||_0x35b577;if(!_0x39c687[_0x3fbb2d(0x1bf)][_0x3fbb2d(0x1bd)](_0x253782)){a13_0x401e5d['dim']('[Email]\x20Ignored\x20mail\x20from\x20'+_0x35b577+'\x20(not\x20allowed)');continue;}}const _0xb46ae7=_0x578a41['parts'][_0x3fbb2d(0x1da)](_0x305923=>_0x305923[_0x3fbb2d(0x1ca)]==='TEXT'),_0x1f51ba=_0xb46ae7?.[_0x3fbb2d(0x1cd)]||'';a13_0x401e5d['info'](_0x3fbb2d(0x1ba)+_0x35b577+_0x3fbb2d(0x1c7)+_0xe908b6);try{const _0x545496='You\x20received\x20an\x20email\x20from\x20'+_0x35b577+_0x3fbb2d(0x1cf)+_0xe908b6+'\x0aBody:\x0a'+_0x1f51ba+_0x3fbb2d(0x1e8),_0x4aeaae=await sendChatMessage(getSelectedModel(),[{'role':_0x3fbb2d(0x1e7),'content':_0x545496}]),_0x272f32=a13_0x11b6f7[_0x3fbb2d(0x1c3)](_0x39c687['smtp']);await _0x272f32[_0x3fbb2d(0x1cc)]({'from':_0x39c687[_0x3fbb2d(0x1c5)][_0x3fbb2d(0x1e9)]['user'],'to':_0x35b577,'subject':_0x3fbb2d(0x1e6)+_0xe908b6,'text':_0x4aeaae[_0x3fbb2d(0x1b8)]}),a13_0x401e5d[_0x3fbb2d(0x1be)]('[Email]\x20Reply\x20sent\x20to\x20'+_0x35b577);}catch(_0xf0e634){a13_0x401e5d[_0x3fbb2d(0x1d8)](_0x3fbb2d(0x1e5)+_0xf0e634[_0x3fbb2d(0x1ce)]);}}_0x5bc69d[_0x3fbb2d(0x1d7)]();}catch(_0x358c6f){}}function a13_0x1478(){const _0x32a4fd=['find','6062920NSernZ','getConfig','parts','openBox','subject','4261077ylWDWN','NODE_TLS_REJECT_UNAUTHORIZED','8YqyStq','match','info','[Email]\x20Processing/Reply\x20error:\x20','Re:\x20','user','\x0a\x0aDraft\x20a\x20helpful\x20reply.\x20Structure\x20it\x20clearly.','auth','1555382KabGVS','TEXT','content','5hQsNoC','[Email]\x20From:\x20','1670056FsvIhb','\x20new\x20messages','includes','success','allowedSenders','search','5135214ilFfAZ','1IjgOjF','createTransport','7vmGcSh','smtp','from','\x20|\x20Subj:\x20','No\x20Subject','connect','which','[Email]\x20Found\x20','sendMail','body','message',':\x0aSubject:\x20','HEADER','283293HlZBky','UNSEEN','length','INBOX','env','21750751yrkDOD','end','error','imap'];a13_0x1478=function(){return _0x32a4fd;};return a13_0x1478();}export async function startBot(){const _0xc0f403=a13_0x4c8f;if(!a13_0x124f90['isConfigured']())return![];if(isRunning)return!![];process[_0xc0f403(0x1d5)][_0xc0f403(0x1e1)]='0',checkEmails();const _0x36f12a=a13_0x124f90[_0xc0f403(0x1dc)]()['interval']||0x5;return intervalId=setInterval(checkEmails,_0x36f12a*0x3c*0x3e8),isRunning=!![],!![];}export function stopBot(){intervalId&&(clearInterval(intervalId),intervalId=null),isRunning=![];}export function isBotRunning(){return isRunning;}export{isConfigured}from'./config.js';
1
+ (function(_0x4c1d00,_0x39f5da){const _0x3882f8=a13_0x13f2,_0x398dc8=_0x4c1d00();while(!![]){try{const _0x4ed48d=-parseInt(_0x3882f8(0x108))/0x1*(parseInt(_0x3882f8(0xfa))/0x2)+parseInt(_0x3882f8(0xef))/0x3*(parseInt(_0x3882f8(0xfc))/0x4)+parseInt(_0x3882f8(0xfe))/0x5*(parseInt(_0x3882f8(0xf9))/0x6)+parseInt(_0x3882f8(0xfd))/0x7*(parseInt(_0x3882f8(0xdf))/0x8)+parseInt(_0x3882f8(0xe7))/0x9+-parseInt(_0x3882f8(0xf3))/0xa+-parseInt(_0x3882f8(0x102))/0xb;if(_0x4ed48d===_0x39f5da)break;else _0x398dc8['push'](_0x398dc8['shift']());}catch(_0x5a2636){_0x398dc8['push'](_0x398dc8['shift']());}}}(a13_0x50c0,0xe1a33));import a13_0x33c0b1 from'imap-simple';import a13_0x2b7379 from'nodemailer';import*as a13_0x3d8536 from'./config.js';import*as a13_0x793ae4 from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';let intervalId=null,isRunning=![];async function checkEmails(){const _0x59245d=a13_0x13f2,_0x468978=a13_0x3d8536[_0x59245d(0xea)]();try{const _0x11a183=await a13_0x33c0b1['connect']({'imap':_0x468978['imap']});await _0x11a183[_0x59245d(0xee)](_0x59245d(0xd9));const _0x508afa=['UNSEEN'],_0x15471d={'bodies':['HEADER',_0x59245d(0xf8)],'markSeen':!![]},_0x2df097=await _0x11a183['search'](_0x508afa,_0x15471d);_0x2df097['length']>0x0&&a13_0x793ae4[_0x59245d(0xe6)]('[Email]\x20Found\x20'+_0x2df097[_0x59245d(0xde)]+_0x59245d(0xdc));for(const _0x46589e of _0x2df097){const _0x3e5996=_0x46589e[_0x59245d(0x107)]['find'](_0x46b21b=>_0x46b21b[_0x59245d(0xfb)]===_0x59245d(0x10d)),_0x3b2a4f=_0x3e5996['body'][_0x59245d(0xe2)]?.[0x0]||'',_0x2b000d=_0x3e5996[_0x59245d(0xdb)][_0x59245d(0xe4)]?.[0x0]||_0x59245d(0xec);if(_0x468978[_0x59245d(0xf7)][_0x59245d(0xde)]>0x0){const _0x2770e9=_0x3b2a4f[_0x59245d(0x109)](/<(.+)>/)?.[0x1]||_0x3b2a4f;if(!_0x468978[_0x59245d(0xf7)][_0x59245d(0xe1)](_0x2770e9)){a13_0x793ae4[_0x59245d(0x106)](_0x59245d(0xe5)+_0x3b2a4f+_0x59245d(0x100));continue;}}const _0x1afbe2=_0x46589e[_0x59245d(0x107)][_0x59245d(0x10b)](_0x40f626=>_0x40f626[_0x59245d(0xfb)]===_0x59245d(0xf8)),_0x4a2a73=_0x1afbe2?.[_0x59245d(0xdb)]||'';a13_0x793ae4[_0x59245d(0xe6)](_0x59245d(0xf4)+_0x3b2a4f+_0x59245d(0xf2)+_0x2b000d);try{const _0x12bbfb=_0x59245d(0xe9)+_0x3b2a4f+_0x59245d(0x105)+_0x2b000d+_0x59245d(0xdd)+_0x4a2a73+_0x59245d(0xed),_0x10a35b=await sendChatMessage(getSelectedModel(),[{'role':'user','content':_0x12bbfb}]),_0x49ebd9=a13_0x2b7379[_0x59245d(0x103)](_0x468978[_0x59245d(0xf0)]);await _0x49ebd9[_0x59245d(0xe0)]({'from':_0x468978['smtp'][_0x59245d(0xeb)][_0x59245d(0x10c)],'to':_0x3b2a4f,'subject':_0x59245d(0xe8)+_0x2b000d,'text':_0x10a35b[_0x59245d(0x10a)]}),a13_0x793ae4[_0x59245d(0xe3)]('[Email]\x20Reply\x20sent\x20to\x20'+_0x3b2a4f);}catch(_0x70039d){a13_0x793ae4['error'](_0x59245d(0xf5)+_0x70039d[_0x59245d(0x101)]);}}_0x11a183[_0x59245d(0xda)]();}catch(_0x57f4b9){}}export async function startBot(){const _0x5cec9a=a13_0x13f2;if(!a13_0x3d8536[_0x5cec9a(0xf6)]())return![];if(isRunning)return!![];process[_0x5cec9a(0xf1)][_0x5cec9a(0xff)]='0',checkEmails();const _0x2260b9=a13_0x3d8536[_0x5cec9a(0xea)]()[_0x5cec9a(0x104)]||0x5;return intervalId=setInterval(checkEmails,_0x2260b9*0x3c*0x3e8),isRunning=!![],!![];}function a13_0x50c0(){const _0x1010d2=['find','user','HEADER','INBOX','end','body','\x20new\x20messages','\x0aBody:\x0a','length','369592UGjEUw','sendMail','includes','from','success','subject','[Email]\x20Ignored\x20mail\x20from\x20','info','9503613Wimxgu','Re:\x20','You\x20received\x20an\x20email\x20from\x20','getConfig','auth','No\x20Subject','\x0a\x0aDraft\x20a\x20helpful\x20reply.\x20Structure\x20it\x20clearly.','openBox','75AaXSry','smtp','env','\x20|\x20Subj:\x20','15165900jtdGZb','[Email]\x20From:\x20','[Email]\x20Processing/Reply\x20error:\x20','isConfigured','allowedSenders','TEXT','5232594yegTFv','2302oOWiWz','which','269736wmZSQJ','245khvkeJ','5IDeyOj','NODE_TLS_REJECT_UNAUTHORIZED','\x20(not\x20allowed)','message','29627246ygULnc','createTransport','interval',':\x0aSubject:\x20','dim','parts','84hvrFvF','match','content'];a13_0x50c0=function(){return _0x1010d2;};return a13_0x50c0();}export function stopBot(){intervalId&&(clearInterval(intervalId),intervalId=null),isRunning=![];}export function isBotRunning(){return isRunning;}function a13_0x13f2(_0x5eb7fe,_0x4ec4c8){_0x5eb7fe=_0x5eb7fe-0xd9;const _0x50c0de=a13_0x50c0();let _0x13f2bf=_0x50c0de[_0x5eb7fe];return _0x13f2bf;}export{isConfigured}from'./config.js';
@@ -1 +1 @@
1
- function a14_0x2291(_0x260594,_0x52a599){_0x260594=_0x260594-0x18b;const _0x234041=a14_0x2340();let _0x229122=_0x234041[_0x260594];return _0x229122;}(function(_0x140789,_0x492652){const _0x2f878d=a14_0x2291,_0x5390c3=_0x140789();while(!![]){try{const _0x2c31a9=-parseInt(_0x2f878d(0x18b))/0x1*(parseInt(_0x2f878d(0x199))/0x2)+-parseInt(_0x2f878d(0x198))/0x3*(-parseInt(_0x2f878d(0x18c))/0x4)+parseInt(_0x2f878d(0x19e))/0x5+-parseInt(_0x2f878d(0x1a1))/0x6+-parseInt(_0x2f878d(0x18f))/0x7+parseInt(_0x2f878d(0x1a0))/0x8+parseInt(_0x2f878d(0x19f))/0x9*(parseInt(_0x2f878d(0x19b))/0xa);if(_0x2c31a9===_0x492652)break;else _0x5390c3['push'](_0x5390c3['shift']());}catch(_0x18a478){_0x5390c3['push'](_0x5390c3['shift']());}}}(a14_0x2340,0x3d318));import{password,input,confirm}from'@inquirer/prompts';import*as a14_0x30d2bd from'./config.js';import*as a14_0xa65db2 from'../ui/output.js';export async function setupEmail(){const _0x502d99=a14_0x2291;a14_0xa65db2[_0x502d99(0x197)]('This\x20setup\x20will\x20configure\x20Woozlit\x20to\x20check\x20your\x20email\x20and\x20reply.'),a14_0xa65db2[_0x502d99(0x191)]('Use\x20an\x20App\x20Password\x20if\x20you\x20are\x20using\x20Gmail\x20(2FA\x20enabled).');const _0x3ca6b7=await input({'message':_0x502d99(0x1a2),'default':_0x502d99(0x18e)}),_0x220cb1=await input({'message':_0x502d99(0x1a6)}),_0x3f2197=await password({'message':'Password\x20(or\x20App\x20Password):'});let _0x3af496='imap.gmail.com',_0x468422=0x3e1,_0x223e9e=_0x502d99(0x19a),_0x4bac3f=0x24b;if(_0x3ca6b7[_0x502d99(0x194)]()!==_0x502d99(0x18e)){const _0x4ff38a=await confirm({'message':'Configure\x20advanced\x20server\x20settings?','default':![]});if(_0x4ff38a){_0x3af496=await input({'message':_0x502d99(0x1a7),'default':_0x3af496});const _0x264a8e=await input({'message':_0x502d99(0x190),'default':_0x502d99(0x18d)});_0x468422=parseInt(_0x264a8e),_0x223e9e=await input({'message':_0x502d99(0x1a3),'default':_0x223e9e});const _0x4755b8=await input({'message':_0x502d99(0x1a5),'default':_0x502d99(0x19d)});_0x4bac3f=parseInt(_0x4755b8);}}a14_0x30d2bd[_0x502d99(0x193)](_0x220cb1,_0x3f2197,_0x3af496,_0x468422),a14_0x30d2bd['setEnabled'](!![]);const _0x40a448=await confirm({'message':_0x502d99(0x19c),'default':!![]});if(_0x40a448){a14_0x30d2bd[_0x502d99(0x1a4)](_0x220cb1);const _0x37d897=await input({'message':_0x502d99(0x195)});if(_0x37d897)a14_0x30d2bd[_0x502d99(0x1a4)](_0x37d897);}a14_0xa65db2[_0x502d99(0x196)](_0x502d99(0x192)),a14_0xa65db2['info']('Restart\x20the\x20CLI\x20to\x20start\x20the\x20Email\x20Agent.');}function a14_0x2340(){const _0x4dd512=['820505zNfFDW','IMAP\x20Port:','warn','Email\x20configuration\x20saved!','setCredentials','toLowerCase','Your\x20personal\x20email\x20(that\x20you\x20will\x20send\x20FROM):','success','info','57Yftnjk','2PwCgGF','smtp.gmail.com','2399370cgGbuu','Only\x20allow\x20emails\x20from\x20yourself\x20(recommended)?','587','470310lGxFuU','18vQvsIC','673808HqrbaW','2050656RUuGJS','Email\x20Provider\x20(gmail/outlook/other):','SMTP\x20Host:','addAllowedSender','SMTP\x20Port:','Email\x20Address:','IMAP\x20Host:','432415swHkNk','101872GcfkXk','993','gmail'];a14_0x2340=function(){return _0x4dd512;};return a14_0x2340();}
1
+ (function(_0x37db06,_0x57114b){const _0x187b7e=a14_0xefdc,_0x3c7b63=_0x37db06();while(!![]){try{const _0x3c9b3c=-parseInt(_0x187b7e(0x1d0))/0x1*(parseInt(_0x187b7e(0x1dd))/0x2)+-parseInt(_0x187b7e(0x1c5))/0x3*(parseInt(_0x187b7e(0x1cc))/0x4)+parseInt(_0x187b7e(0x1dc))/0x5*(-parseInt(_0x187b7e(0x1ce))/0x6)+parseInt(_0x187b7e(0x1e0))/0x7+parseInt(_0x187b7e(0x1c3))/0x8*(parseInt(_0x187b7e(0x1d5))/0x9)+-parseInt(_0x187b7e(0x1d4))/0xa+parseInt(_0x187b7e(0x1c2))/0xb;if(_0x3c9b3c===_0x57114b)break;else _0x3c7b63['push'](_0x3c7b63['shift']());}catch(_0x6277c8){_0x3c7b63['push'](_0x3c7b63['shift']());}}}(a14_0x5dee,0xc713f));function a14_0x5dee(){const _0xc455fe=['1532742zXaFjd','addAllowedSender','4StEVuW','Your\x20personal\x20email\x20(that\x20you\x20will\x20send\x20FROM):','success','gmail','14588920bOAlWi','7906617SSgkPA','Restart\x20the\x20CLI\x20to\x20start\x20the\x20Email\x20Agent.','imap.gmail.com','Configure\x20advanced\x20server\x20settings?','SMTP\x20Port:','IMAP\x20Host:','Email\x20Provider\x20(gmail/outlook/other):','5wZepso','751486ZwiyFK','smtp.gmail.com','Email\x20configuration\x20saved!','5738348yiNVpD','info','setEnabled','Password\x20(or\x20App\x20Password):','43075615MTtBEb','8IilXKo','This\x20setup\x20will\x20configure\x20Woozlit\x20to\x20check\x20your\x20email\x20and\x20reply.','81wvTZEE','587','Email\x20Address:','SMTP\x20Host:','993','Only\x20allow\x20emails\x20from\x20yourself\x20(recommended)?','IMAP\x20Port:','234296DGMiwB','toLowerCase'];a14_0x5dee=function(){return _0xc455fe;};return a14_0x5dee();}import{password,input,confirm}from'@inquirer/prompts';import*as a14_0x49c584 from'./config.js';import*as a14_0x156ff2 from'../ui/output.js';function a14_0xefdc(_0x3598fa,_0x23d415){_0x3598fa=_0x3598fa-0x1c1;const _0x5dee05=a14_0x5dee();let _0xefdccc=_0x5dee05[_0x3598fa];return _0xefdccc;}export async function setupEmail(){const _0x2164d0=a14_0xefdc;a14_0x156ff2[_0x2164d0(0x1e1)](_0x2164d0(0x1c4)),a14_0x156ff2['warn']('Use\x20an\x20App\x20Password\x20if\x20you\x20are\x20using\x20Gmail\x20(2FA\x20enabled).');const _0x36df0e=await input({'message':_0x2164d0(0x1db),'default':_0x2164d0(0x1d3)}),_0x3a83f3=await input({'message':_0x2164d0(0x1c7)}),_0x572b86=await password({'message':_0x2164d0(0x1c1)});let _0xcf7ea0=_0x2164d0(0x1d7),_0x12a716=0x3e1,_0x510740=_0x2164d0(0x1de),_0x4c3b62=0x24b;if(_0x36df0e[_0x2164d0(0x1cd)]()!==_0x2164d0(0x1d3)){const _0x415b97=await confirm({'message':_0x2164d0(0x1d8),'default':![]});if(_0x415b97){_0xcf7ea0=await input({'message':_0x2164d0(0x1da),'default':_0xcf7ea0});const _0x3aa800=await input({'message':_0x2164d0(0x1cb),'default':_0x2164d0(0x1c9)});_0x12a716=parseInt(_0x3aa800),_0x510740=await input({'message':_0x2164d0(0x1c8),'default':_0x510740});const _0x3c99d2=await input({'message':_0x2164d0(0x1d9),'default':_0x2164d0(0x1c6)});_0x4c3b62=parseInt(_0x3c99d2);}}a14_0x49c584['setCredentials'](_0x3a83f3,_0x572b86,_0xcf7ea0,_0x12a716),a14_0x49c584[_0x2164d0(0x1e2)](!![]);const _0x47731f=await confirm({'message':_0x2164d0(0x1ca),'default':!![]});if(_0x47731f){a14_0x49c584['addAllowedSender'](_0x3a83f3);const _0x56570a=await input({'message':_0x2164d0(0x1d1)});if(_0x56570a)a14_0x49c584[_0x2164d0(0x1cf)](_0x56570a);}a14_0x156ff2[_0x2164d0(0x1d2)](_0x2164d0(0x1df)),a14_0x156ff2[_0x2164d0(0x1e1)](_0x2164d0(0x1d6));}
@@ -1 +1 @@
1
- const a15_0x1a79cd=a15_0x3eea;(function(_0x477540,_0x5c7347){const _0x3230d2=a15_0x3eea,_0x45e312=_0x477540();while(!![]){try{const _0x1664f4=-parseInt(_0x3230d2(0x1ee))/0x1+parseInt(_0x3230d2(0x1f9))/0x2+-parseInt(_0x3230d2(0x216))/0x3+parseInt(_0x3230d2(0x1fb))/0x4*(-parseInt(_0x3230d2(0x1fd))/0x5)+-parseInt(_0x3230d2(0x1ff))/0x6*(-parseInt(_0x3230d2(0x1f4))/0x7)+-parseInt(_0x3230d2(0x1fe))/0x8*(parseInt(_0x3230d2(0x215))/0x9)+parseInt(_0x3230d2(0x1f7))/0xa;if(_0x1664f4===_0x5c7347)break;else _0x45e312['push'](_0x45e312['shift']());}catch(_0x265ce5){_0x45e312['push'](_0x45e312['shift']());}}}(a15_0x45d3,0x2052e));import{getGitHubToken}from'./auth.js';async function githubRequest(_0x54b3b1,_0x4efef2={}){const _0x67b651=a15_0x3eea,_0x7abf03=await getGitHubToken();if(!_0x7abf03)throw new Error('Not\x20authenticated\x20with\x20GitHub.\x20Run\x20\x27/github\x20login\x27\x20first.');const _0x235e9e=await fetch(_0x67b651(0x214)+_0x54b3b1,{..._0x4efef2,'headers':{'Authorization':_0x67b651(0x200)+_0x7abf03,'Accept':_0x67b651(0x208),'X-GitHub-Api-Version':'2022-11-28',..._0x4efef2[_0x67b651(0x206)]}});if(!_0x235e9e['ok']){const _0x5095a9=await _0x235e9e[_0x67b651(0x20f)]();throw new Error(_0x67b651(0x207)+_0x235e9e[_0x67b651(0x219)]+_0x67b651(0x21b)+_0x5095a9);}return _0x235e9e[_0x67b651(0x205)]();}export async function listRepos(){const _0x148f3a=a15_0x3eea;return githubRequest(_0x148f3a(0x204));}export async function getRepo(_0x5ba951,_0x2a14d9){const _0x578cdd=a15_0x3eea;return githubRequest(_0x578cdd(0x1f5)+_0x5ba951+'/'+_0x2a14d9);}export async function readFile(_0x115977,_0x1d5fc2,_0x2217f3,_0x355e20=a15_0x1a79cd(0x1f6)){const _0x5e899d=a15_0x1a79cd,_0x55da74=await githubRequest(_0x5e899d(0x1f5)+_0x115977+'/'+_0x1d5fc2+'/contents/'+_0x2217f3+_0x5e899d(0x1ef)+_0x355e20),_0x13c3da=Buffer[_0x5e899d(0x201)](_0x55da74[_0x5e899d(0x21a)],_0x5e899d(0x1f2))[_0x5e899d(0x218)](_0x5e899d(0x20a));return _0x13c3da;}export async function createOrUpdateFile(_0xcf8cd1,_0x30fe9f,_0x28d1d3,_0x3ea6ec,_0x7a8483,_0x39a093='main',_0x314d56){const _0x6c4081=a15_0x1a79cd,_0xa0a2b6=Buffer[_0x6c4081(0x201)](_0x3ea6ec)[_0x6c4081(0x218)](_0x6c4081(0x1f2));return githubRequest(_0x6c4081(0x1f5)+_0xcf8cd1+'/'+_0x30fe9f+_0x6c4081(0x1f3)+_0x28d1d3,{'method':'PUT','body':JSON[_0x6c4081(0x211)]({'message':_0x7a8483,'content':_0xa0a2b6,'branch':_0x39a093,..._0x314d56&&{'sha':_0x314d56}})});}export async function createPullRequest(_0x2e717d,_0x36eab6,_0x16e0ce,_0x81e26,_0x28cd3b='main',_0x19a78d){const _0x3691a=a15_0x1a79cd;return githubRequest(_0x3691a(0x1f5)+_0x2e717d+'/'+_0x36eab6+_0x3691a(0x1fc),{'method':'POST','body':JSON[_0x3691a(0x211)]({'title':_0x16e0ce,'head':_0x81e26,'base':_0x28cd3b,'body':_0x19a78d||''})});}function a15_0x3eea(_0x4e4b91,_0x487958){_0x4e4b91=_0x4e4b91-0x1ee;const _0x45d30e=a15_0x45d3();let _0x3eeadf=_0x45d30e[_0x4e4b91];return _0x3eeadf;}export async function listPullRequests(_0x34fa14,_0xd8688b,_0x501f51='open'){const _0x3180ec=a15_0x1a79cd;return githubRequest(_0x3180ec(0x1f5)+_0x34fa14+'/'+_0xd8688b+_0x3180ec(0x212)+_0x501f51+'&per_page=50');}export async function commentOnPR(_0x1854ce,_0xd2f54e,_0x1e5750,_0x1cea3e){const _0x24ea5f=a15_0x1a79cd;return githubRequest(_0x24ea5f(0x1f5)+_0x1854ce+'/'+_0xd2f54e+_0x24ea5f(0x1fa)+_0x1e5750+_0x24ea5f(0x209),{'method':_0x24ea5f(0x1f0),'body':JSON['stringify']({'body':_0x1cea3e})});}export async function createBranch(_0x28d0ad,_0x3a07ec,_0x17b0dd,_0x250301=a15_0x1a79cd(0x1f6)){const _0x74ff45=a15_0x1a79cd,_0x30e31f=await githubRequest(_0x74ff45(0x1f5)+_0x28d0ad+'/'+_0x3a07ec+_0x74ff45(0x1f1)+_0x250301);return githubRequest('/repos/'+_0x28d0ad+'/'+_0x3a07ec+_0x74ff45(0x210),{'method':_0x74ff45(0x1f0),'body':JSON[_0x74ff45(0x211)]({'ref':_0x74ff45(0x202)+_0x17b0dd,'sha':_0x30e31f['object'][_0x74ff45(0x203)]})});}export async function getAppStatus(){const _0x2b4037=a15_0x1a79cd;try{const _0xa8dd9e=await githubRequest(_0x2b4037(0x213)),_0x54a5a8=_0xa8dd9e[_0x2b4037(0x20c)];let _0xa68412=_0x2b4037(0x20e);return _0xa8dd9e[_0x2b4037(0x1f8)]&&_0xa8dd9e[_0x2b4037(0x1f8)][_0x2b4037(0x217)]>0x0&&(_0xa68412=_0xa8dd9e[_0x2b4037(0x1f8)][0x0][_0x2b4037(0x20b)][_0x2b4037(0x20d)]),{'valid':!![],'repoCount':_0x54a5a8,'accountName':_0xa68412};}catch(_0x314113){throw _0x314113;}}function a15_0x45d3(){const _0x1c5845=['GitHub\x20App','text','/git/refs','stringify','/pulls?state=','/installation/repositories?per_page=1','https://api.github.com','1620dPpOVA','265095kYkUSJ','length','toString','status','content','\x20-\x20','57848dMBjxg','?ref=','POST','/git/ref/heads/','base64','/contents/','98RBysSC','/repos/','main','4246300itaeZJ','repositories','99934sjYALW','/issues/','292AhcgIc','/pulls','12650VAwkdA','9528FitpWG','87036oqTqjT','Bearer\x20','from','refs/heads/','sha','/user/repos?per_page=100&sort=updated','json','headers','GitHub\x20API\x20error:\x20','application/vnd.github+json','/comments','utf-8','owner','total_count','login'];a15_0x45d3=function(){return _0x1c5845;};return a15_0x45d3();}
1
+ const a15_0x28091d=a15_0x2226;(function(_0x310352,_0x569529){const _0x3339c5=a15_0x2226,_0x70cc44=_0x310352();while(!![]){try{const _0x13b024=-parseInt(_0x3339c5(0xe3))/0x1+parseInt(_0x3339c5(0xe2))/0x2+parseInt(_0x3339c5(0xc6))/0x3+-parseInt(_0x3339c5(0xba))/0x4*(parseInt(_0x3339c5(0xc3))/0x5)+-parseInt(_0x3339c5(0xbe))/0x6+parseInt(_0x3339c5(0xe0))/0x7*(-parseInt(_0x3339c5(0xe1))/0x8)+-parseInt(_0x3339c5(0xcc))/0x9*(-parseInt(_0x3339c5(0xc9))/0xa);if(_0x13b024===_0x569529)break;else _0x70cc44['push'](_0x70cc44['shift']());}catch(_0x5212c9){_0x70cc44['push'](_0x70cc44['shift']());}}}(a15_0x4e93,0x9ddc6));function a15_0x4e93(){const _0x192147=['text','headers','toString','stringify','total_count','/comments','open','json','654241TVzAna','24hklGiQ','435400NvskGi','751537pPNJUG','2022-11-28','content','20UBXhYx','https://api.github.com','/pulls?state=','/contents/','4299168oyKpAX','POST','main','/installation/repositories?per_page=1','base64','47225LidktG','/pulls','GitHub\x20App','371916kEFVTq','Not\x20authenticated\x20with\x20GitHub.\x20Run\x20\x27/github\x20login\x27\x20first.','from','1235650ifhUXu','/issues/','Bearer\x20','153VMfmay','refs/heads/','/repos/','login','sha','length','?ref=','repositories','GitHub\x20API\x20error:\x20','owner','/user/repos?per_page=100&sort=updated','&per_page=50'];a15_0x4e93=function(){return _0x192147;};return a15_0x4e93();}import{getGitHubToken}from'./auth.js';function a15_0x2226(_0x42cf12,_0xda7111){_0x42cf12=_0x42cf12-0xb9;const _0x4e9330=a15_0x4e93();let _0x2226d4=_0x4e9330[_0x42cf12];return _0x2226d4;}async function githubRequest(_0x3988f6,_0xaae04c={}){const _0x2b055f=a15_0x2226,_0xe1eb0a=await getGitHubToken();if(!_0xe1eb0a)throw new Error(_0x2b055f(0xc7));const _0x51bfc6=await fetch(_0x2b055f(0xbb)+_0x3988f6,{..._0xaae04c,'headers':{'Authorization':_0x2b055f(0xcb)+_0xe1eb0a,'Accept':'application/vnd.github+json','X-GitHub-Api-Version':_0x2b055f(0xe4),..._0xaae04c[_0x2b055f(0xd9)]}});if(!_0x51bfc6['ok']){const _0x519a06=await _0x51bfc6[_0x2b055f(0xd8)]();throw new Error(_0x2b055f(0xd4)+_0x51bfc6['status']+'\x20-\x20'+_0x519a06);}return _0x51bfc6[_0x2b055f(0xdf)]();}export async function listRepos(){const _0x3f63d3=a15_0x2226;return githubRequest(_0x3f63d3(0xd6));}export async function getRepo(_0x13a9d8,_0x280e1b){return githubRequest('/repos/'+_0x13a9d8+'/'+_0x280e1b);}export async function readFile(_0x4a5722,_0xd01f1d,_0xc99581,_0x719aba=a15_0x28091d(0xc0)){const _0x2f4792=a15_0x28091d,_0x3d78fc=await githubRequest(_0x2f4792(0xce)+_0x4a5722+'/'+_0xd01f1d+_0x2f4792(0xbd)+_0xc99581+_0x2f4792(0xd2)+_0x719aba),_0x1931ac=Buffer[_0x2f4792(0xc8)](_0x3d78fc[_0x2f4792(0xb9)],_0x2f4792(0xc2))[_0x2f4792(0xda)]('utf-8');return _0x1931ac;}export async function createOrUpdateFile(_0x28120f,_0x455a2a,_0x18b074,_0x3ae261,_0x1b336c,_0x20739f=a15_0x28091d(0xc0),_0x47feec){const _0x305d7a=a15_0x28091d,_0x21343f=Buffer['from'](_0x3ae261)[_0x305d7a(0xda)](_0x305d7a(0xc2));return githubRequest(_0x305d7a(0xce)+_0x28120f+'/'+_0x455a2a+_0x305d7a(0xbd)+_0x18b074,{'method':'PUT','body':JSON[_0x305d7a(0xdb)]({'message':_0x1b336c,'content':_0x21343f,'branch':_0x20739f,..._0x47feec&&{'sha':_0x47feec}})});}export async function createPullRequest(_0x485fc7,_0x2b4f96,_0x17e312,_0x59ca0f,_0x4665c9=a15_0x28091d(0xc0),_0x343735){const _0x238494=a15_0x28091d;return githubRequest(_0x238494(0xce)+_0x485fc7+'/'+_0x2b4f96+_0x238494(0xc4),{'method':_0x238494(0xbf),'body':JSON[_0x238494(0xdb)]({'title':_0x17e312,'head':_0x59ca0f,'base':_0x4665c9,'body':_0x343735||''})});}export async function listPullRequests(_0x585a79,_0x2aef12,_0x2b46c0=a15_0x28091d(0xde)){const _0x340ec0=a15_0x28091d;return githubRequest(_0x340ec0(0xce)+_0x585a79+'/'+_0x2aef12+_0x340ec0(0xbc)+_0x2b46c0+_0x340ec0(0xd7));}export async function commentOnPR(_0x1a40e2,_0x583f11,_0x24e010,_0x6d4750){const _0x4ef9f6=a15_0x28091d;return githubRequest(_0x4ef9f6(0xce)+_0x1a40e2+'/'+_0x583f11+_0x4ef9f6(0xca)+_0x24e010+_0x4ef9f6(0xdd),{'method':_0x4ef9f6(0xbf),'body':JSON[_0x4ef9f6(0xdb)]({'body':_0x6d4750})});}export async function createBranch(_0x2206ca,_0x43ad08,_0x1c6e44,_0x45d770=a15_0x28091d(0xc0)){const _0x17dbfd=a15_0x28091d,_0xc9ef42=await githubRequest(_0x17dbfd(0xce)+_0x2206ca+'/'+_0x43ad08+'/git/ref/heads/'+_0x45d770);return githubRequest(_0x17dbfd(0xce)+_0x2206ca+'/'+_0x43ad08+'/git/refs',{'method':_0x17dbfd(0xbf),'body':JSON[_0x17dbfd(0xdb)]({'ref':_0x17dbfd(0xcd)+_0x1c6e44,'sha':_0xc9ef42['object'][_0x17dbfd(0xd0)]})});}export async function getAppStatus(){const _0x1fde24=a15_0x28091d;try{const _0x322f67=await githubRequest(_0x1fde24(0xc1)),_0x2c76aa=_0x322f67[_0x1fde24(0xdc)];let _0x39b0da=_0x1fde24(0xc5);return _0x322f67[_0x1fde24(0xd3)]&&_0x322f67['repositories'][_0x1fde24(0xd1)]>0x0&&(_0x39b0da=_0x322f67[_0x1fde24(0xd3)][0x0][_0x1fde24(0xd5)][_0x1fde24(0xcf)]),{'valid':!![],'repoCount':_0x2c76aa,'accountName':_0x39b0da};}catch(_0x2d0ac0){throw _0x2d0ac0;}}
@@ -1 +1 @@
1
- const a16_0x2c021e=a16_0x51d9;(function(_0x3dd56a,_0x192cd2){const _0x1b7c16=a16_0x51d9,_0x1dd5f7=_0x3dd56a();while(!![]){try{const _0x248d95=parseInt(_0x1b7c16(0xdc))/0x1*(-parseInt(_0x1b7c16(0xe1))/0x2)+-parseInt(_0x1b7c16(0xd6))/0x3+parseInt(_0x1b7c16(0xeb))/0x4+-parseInt(_0x1b7c16(0xd7))/0x5*(-parseInt(_0x1b7c16(0xd1))/0x6)+-parseInt(_0x1b7c16(0xd0))/0x7*(parseInt(_0x1b7c16(0xe2))/0x8)+parseInt(_0x1b7c16(0xcf))/0x9*(-parseInt(_0x1b7c16(0xdd))/0xa)+parseInt(_0x1b7c16(0xd3))/0xb;if(_0x248d95===_0x192cd2)break;else _0x1dd5f7['push'](_0x1dd5f7['shift']());}catch(_0x276760){_0x1dd5f7['push'](_0x1dd5f7['shift']());}}}(a16_0x2b87,0xd1d9b));import{promises as a16_0x1fa9f3}from'fs';import{join}from'path';import{createAppAuth}from'@octokit/auth-app';import{homedir}from'os';const GLOBAL_CONFIG_DIR=join(homedir(),'.woozlit'),CONFIG_FILE=join(GLOBAL_CONFIG_DIR,'github-app-config.json'),KEY_FILE=join(GLOBAL_CONFIG_DIR,a16_0x2c021e(0xd9));let appAuth=null,installationToken=null;function a16_0x51d9(_0x1be596,_0x3513a0){_0x1be596=_0x1be596-0xcd;const _0x2b8743=a16_0x2b87();let _0x51d9af=_0x2b8743[_0x1be596];return _0x51d9af;}function a16_0x2b87(){const _0x2935c3=['2794588OwrRLu','unlink','installationId','installation','✓\x20GitHub\x20App\x20authenticated!','1611UYdFAS','28xFzMUA','88650WsJyFq','GitHub\x20App\x20not\x20configured.\x20Run\x20/github\x20setup','55459382wVCGQe','error','Error\x20clearing\x20session:','4044540FJOkIQ','120rUUtqv','parse','github-app.pem','You\x20can\x20now\x20access\x20private\x20repositories','Try\x20running\x20/github\x20setup\x20again','4pzIwRJ','73420eDWyqB','then','Run\x20/github\x20setup\x20to\x20configure\x20automatically','catch','819976MmDrjh','1866224hjgNAZ','\x0a❌\x20GitHub\x20App\x20not\x20configured','expiresAt','token','readFile','utf8','✓\x20GitHub\x20session\x20cleared','access','log'];a16_0x2b87=function(){return _0x2935c3;};return a16_0x2b87();}async function getGitHubAppConfig(){const _0x4d325b=a16_0x2c021e;try{const _0x4e06e7=await a16_0x1fa9f3['access'](CONFIG_FILE)[_0x4d325b(0xde)](()=>!![])[_0x4d325b(0xe0)](()=>![]),_0x5509aa=await a16_0x1fa9f3[_0x4d325b(0xe9)](KEY_FILE)[_0x4d325b(0xde)](()=>!![])['catch'](()=>![]);if(!_0x4e06e7||!_0x5509aa)return null;const _0x218593=await a16_0x1fa9f3[_0x4d325b(0xe6)](CONFIG_FILE,'utf8'),{appId:_0x59d103,installationId:_0x12fd6a}=JSON[_0x4d325b(0xd8)](_0x218593),_0x4c1f27=await a16_0x1fa9f3[_0x4d325b(0xe6)](KEY_FILE,_0x4d325b(0xe7));if(!_0x59d103||!_0x12fd6a||!_0x4c1f27)return null;return{'appId':_0x59d103,'privateKey':_0x4c1f27,'installationId':_0x12fd6a};}catch(_0x2eeb08){return null;}}async function initAppAuth(){const _0x5a3cfb=a16_0x2c021e;if(appAuth)return;const _0x288835=await getGitHubAppConfig();if(!_0x288835)throw new Error(_0x5a3cfb(0xd2));appAuth=createAppAuth({'appId':_0x288835['appId'],'privateKey':_0x288835['privateKey'],'installationId':_0x288835[_0x5a3cfb(0xed)]});}async function getInstallationToken(){const _0x31d057=a16_0x2c021e;await initAppAuth();if(installationToken&&installationToken[_0x31d057(0xe4)]>new Date())return installationToken[_0x31d057(0xe5)];const {token:_0x6cbb4a,expiresAt:_0x5d0c16}=await appAuth({'type':_0x31d057(0xcd)});return installationToken={'token':_0x6cbb4a,'expiresAt':new Date(_0x5d0c16)},_0x6cbb4a;}export async function getGitHubToken(){const _0x2e4570=a16_0x2c021e;try{return await getInstallationToken();}catch(_0x33c1df){return console[_0x2e4570(0xd4)]('GitHub\x20App\x20auth\x20failed:',_0x33c1df),null;}}export async function isGitHubAuthenticated(){const _0x2ab37e=await getGitHubAppConfig();return _0x2ab37e!==null;}export async function loginGitHub(){const _0x2b9eaa=a16_0x2c021e,_0x1e0d70=await getGitHubAppConfig();if(!_0x1e0d70){console['log'](_0x2b9eaa(0xe3)),console[_0x2b9eaa(0xea)](_0x2b9eaa(0xdf));return;}try{const _0x51f7fe=await getInstallationToken();console['log'](_0x2b9eaa(0xce)),console['log'](_0x2b9eaa(0xda));}catch(_0x3180dc){console[_0x2b9eaa(0xd4)]('❌\x20Authentication\x20failed:',_0x3180dc),console['log'](_0x2b9eaa(0xdb));}}export async function logoutGitHub(){const _0x478127=a16_0x2c021e;try{await a16_0x1fa9f3[_0x478127(0xec)](CONFIG_FILE)[_0x478127(0xe0)](()=>{}),await a16_0x1fa9f3[_0x478127(0xec)](KEY_FILE)[_0x478127(0xe0)](()=>{}),installationToken=null,appAuth=null,console['log'](_0x478127(0xe8));}catch(_0x2153f4){console[_0x478127(0xd4)](_0x478127(0xd5),_0x2153f4);}}
1
+ const a16_0xa4fc44=a16_0x14b3;(function(_0x1517f4,_0x2341fa){const _0x53ab9e=a16_0x14b3,_0x416662=_0x1517f4();while(!![]){try{const _0x2a964e=parseInt(_0x53ab9e(0x124))/0x1+-parseInt(_0x53ab9e(0x131))/0x2+-parseInt(_0x53ab9e(0x128))/0x3*(-parseInt(_0x53ab9e(0x11b))/0x4)+parseInt(_0x53ab9e(0x11f))/0x5*(-parseInt(_0x53ab9e(0x12d))/0x6)+parseInt(_0x53ab9e(0x117))/0x7+-parseInt(_0x53ab9e(0x122))/0x8*(parseInt(_0x53ab9e(0x12e))/0x9)+parseInt(_0x53ab9e(0x123))/0xa;if(_0x2a964e===_0x2341fa)break;else _0x416662['push'](_0x416662['shift']());}catch(_0x36abd6){_0x416662['push'](_0x416662['shift']());}}}(a16_0x52d5,0x38db8));import{promises as a16_0x48dbc3}from'fs';function a16_0x14b3(_0x4a07e6,_0x5dcbc2){_0x4a07e6=_0x4a07e6-0x116;const _0x52d5bc=a16_0x52d5();let _0x14b3cc=_0x52d5bc[_0x4a07e6];return _0x14b3cc;}import{join}from'path';import{createAppAuth}from'@octokit/auth-app';import{homedir}from'os';const GLOBAL_CONFIG_DIR=join(homedir(),a16_0xa4fc44(0x12f)),CONFIG_FILE=join(GLOBAL_CONFIG_DIR,'github-app-config.json'),KEY_FILE=join(GLOBAL_CONFIG_DIR,a16_0xa4fc44(0x12c));let appAuth=null,installationToken=null;function a16_0x52d5(){const _0x9d8d0f=['then','550478ntmNTO','expiresAt','error','unlink','installationId','GitHub\x20App\x20not\x20configured.\x20Run\x20/github\x20setup','795424mghKMs','token','You\x20can\x20now\x20access\x20private\x20repositories','✓\x20GitHub\x20App\x20authenticated!','244tdvDxU','log','Error\x20clearing\x20session:','access','611215hppLRa','privateKey','utf8','24XhzYqf','4434780DBCBHb','156651ExBKto','installation','Run\x20/github\x20setup\x20to\x20configure\x20automatically','appId','846cPoWzW','readFile','Try\x20running\x20/github\x20setup\x20again','catch','github-app.pem','6WeDfdS','301779AoROUu','.woozlit'];a16_0x52d5=function(){return _0x9d8d0f;};return a16_0x52d5();}async function getGitHubAppConfig(){const _0x182443=a16_0xa4fc44;try{const _0x2f4c1d=await a16_0x48dbc3[_0x182443(0x11e)](CONFIG_FILE)[_0x182443(0x130)](()=>!![])[_0x182443(0x12b)](()=>![]),_0x2543c2=await a16_0x48dbc3[_0x182443(0x11e)](KEY_FILE)[_0x182443(0x130)](()=>!![])[_0x182443(0x12b)](()=>![]);if(!_0x2f4c1d||!_0x2543c2)return null;const _0x48cf5a=await a16_0x48dbc3[_0x182443(0x129)](CONFIG_FILE,'utf8'),{appId:_0x4e0210,installationId:_0x4955a5}=JSON['parse'](_0x48cf5a),_0x4e499f=await a16_0x48dbc3[_0x182443(0x129)](KEY_FILE,_0x182443(0x121));if(!_0x4e0210||!_0x4955a5||!_0x4e499f)return null;return{'appId':_0x4e0210,'privateKey':_0x4e499f,'installationId':_0x4955a5};}catch(_0x191c7b){return null;}}async function initAppAuth(){const _0x2c9a5b=a16_0xa4fc44;if(appAuth)return;const _0x260ddb=await getGitHubAppConfig();if(!_0x260ddb)throw new Error(_0x2c9a5b(0x116));appAuth=createAppAuth({'appId':_0x260ddb[_0x2c9a5b(0x127)],'privateKey':_0x260ddb[_0x2c9a5b(0x120)],'installationId':_0x260ddb[_0x2c9a5b(0x135)]});}async function getInstallationToken(){const _0x8c90f6=a16_0xa4fc44;await initAppAuth();if(installationToken&&installationToken[_0x8c90f6(0x132)]>new Date())return installationToken[_0x8c90f6(0x118)];const {token:_0x1c6511,expiresAt:_0x438f0c}=await appAuth({'type':_0x8c90f6(0x125)});return installationToken={'token':_0x1c6511,'expiresAt':new Date(_0x438f0c)},_0x1c6511;}export async function getGitHubToken(){const _0x457e2a=a16_0xa4fc44;try{return await getInstallationToken();}catch(_0x593c7b){return console[_0x457e2a(0x133)]('GitHub\x20App\x20auth\x20failed:',_0x593c7b),null;}}export async function isGitHubAuthenticated(){const _0x277265=await getGitHubAppConfig();return _0x277265!==null;}export async function loginGitHub(){const _0x1b50d6=a16_0xa4fc44,_0x3df2f6=await getGitHubAppConfig();if(!_0x3df2f6){console['log']('\x0a❌\x20GitHub\x20App\x20not\x20configured'),console['log'](_0x1b50d6(0x126));return;}try{const _0x1c6282=await getInstallationToken();console[_0x1b50d6(0x11c)](_0x1b50d6(0x11a)),console[_0x1b50d6(0x11c)](_0x1b50d6(0x119));}catch(_0x5a1e8c){console[_0x1b50d6(0x133)]('❌\x20Authentication\x20failed:',_0x5a1e8c),console[_0x1b50d6(0x11c)](_0x1b50d6(0x12a));}}export async function logoutGitHub(){const _0x1b856f=a16_0xa4fc44;try{await a16_0x48dbc3[_0x1b856f(0x134)](CONFIG_FILE)['catch'](()=>{}),await a16_0x48dbc3[_0x1b856f(0x134)](KEY_FILE)[_0x1b856f(0x12b)](()=>{}),installationToken=null,appAuth=null,console[_0x1b856f(0x11c)]('✓\x20GitHub\x20session\x20cleared');}catch(_0x54cbd1){console[_0x1b856f(0x133)](_0x1b856f(0x11d),_0x54cbd1);}}
@@ -1 +1 @@
1
- (function(_0x5c8345,_0x397773){const _0x3a485d=a17_0x52cc,_0x44a909=_0x5c8345();while(!![]){try{const _0x6fa5ab=parseInt(_0x3a485d(0x17b))/0x1*(parseInt(_0x3a485d(0x183))/0x2)+parseInt(_0x3a485d(0x178))/0x3+parseInt(_0x3a485d(0x16f))/0x4*(-parseInt(_0x3a485d(0x196))/0x5)+parseInt(_0x3a485d(0x19f))/0x6*(-parseInt(_0x3a485d(0x1b8))/0x7)+parseInt(_0x3a485d(0x19e))/0x8+-parseInt(_0x3a485d(0x174))/0x9+parseInt(_0x3a485d(0x1b1))/0xa;if(_0x6fa5ab===_0x397773)break;else _0x44a909['push'](_0x44a909['shift']());}catch(_0x2b7c84){_0x44a909['push'](_0x44a909['shift']());}}}(a17_0x3a69,0xe6cbd));import{promises as a17_0x1ea5c8}from'fs';import{join}from'path';import*as a17_0x2ed2b7 from'../ui/output.js';import{createServer}from'http';function a17_0x3a69(){const _0x3d3378=['close','5aNdERU','Failed\x20to\x20exchange\x20code:\x20','length','error','Browser\x20opened!\x20Please\x20click\x20\x22Create\x20GitHub\x20App\x22\x20on\x20the\x20page.','write','POST','writeFile','10598688abeFmN','50064mOrVUt','App\x20Name:\x20','Press\x20Enter\x20after\x20you\x20have\x20installed\x20the\x20app...','\x0awaiting\x20for\x20browser\x20callback...','\x0aStep\x204:\x20Saving\x20configuration...','http://127.0.0.1:3000','Failed\x20to\x20open\x20browser\x20automatically.','utf8','/conversions','.woozlit','Configuration\x20saved\x20globally\x20to\x20~/.woozlit/','trim','Step\x201:\x20Opening\x20GitHub\x20to\x20create\x20App...','/installations/new','listen','dim','Opened:\x20','hook','14313230WEdcLA','end','mkdir','(If\x20nothing\x20happens,\x20copy\x20the\x20\x22code\x22\x20parameter\x20from\x20the\x20browser\x20URL\x20address\x20bar\x20and\x20paste\x20it\x20below,\x20or\x20simply\x20press\x20Enter\x20to\x20start\x20manual\x20entry)','now','application/vnd.github+json','No\x20code\x20found','896ZBLrpB','html_url','http://127.0.0.1:3000/webhook','\x0aStep\x202:\x20Registering\x20GitHub\x20App...','4559948hXbyte','exit','127.0.0.1','\x0a✓\x20GitHub\x20App\x20setup\x20complete!','Please\x20install\x20the\x20app\x20on\x20your\x20account/repositories.','2410848vIhIUD','stringify','<h1>Setup\x20Complete!</h1><p>You\x20can\x20close\x20this\x20tab\x20and\x20return\x20to\x20the\x20terminal.</p>','Please\x20visit\x20this\x20URL\x20manually:\x0a','6006NYBVcF','App\x20created\x20but\x20not\x20installed\x20yet.','\x0a✓\x20GitHub\x20App\x20created!','663071OCEknK','toString','Paste\x20code\x20(or\x20wait\x20for\x20automatic\x20redirect):','url','destroy','code','GET','/favicon.ico','2undqns','info','Received\x20request:\x20','get','https://github.com/settings/apps/new?','stdin','pem','success','text','\x0aStep\x203:\x20Checking\x20installation...','json','name','writeHead','/app/installations','github-app-config.json','Could\x20not\x20find\x20installation.\x20Please\x20try\x20again.','access','searchParams'];a17_0x3a69=function(){return _0x3d3378;};return a17_0x3a69();}import a17_0x55e693 from'open';import{homedir}from'os';import{createAppAuth}from'@octokit/auth-app';import{input}from'@inquirer/prompts';async function createGitHubAppManifestFlow(){return new Promise(async(_0x522964,_0x2133b3)=>{const _0x3f9d88=a17_0x52cc;let _0x22f67d=![];const _0x4c95f3=createServer(async(_0x2ace03,_0x5b0e57)=>{const _0x1fe04c=a17_0x52cc;if(_0x2ace03[_0x1fe04c(0x17e)]===_0x1fe04c(0x182)){_0x5b0e57[_0x1fe04c(0x18f)](0x194),_0x5b0e57[_0x1fe04c(0x1b2)]();return;}a17_0x2ed2b7[_0x1fe04c(0x1ae)](_0x1fe04c(0x185)+_0x2ace03['method']+'\x20'+_0x2ace03[_0x1fe04c(0x17e)]);const _0x4f57e0=new URL(_0x2ace03[_0x1fe04c(0x17e)]||'/',_0x1fe04c(0x1a4)),_0x573d86=_0x4f57e0[_0x1fe04c(0x194)][_0x1fe04c(0x186)](_0x1fe04c(0x180));_0x573d86?(_0x5b0e57['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x5b0e57[_0x1fe04c(0x1b2)](_0x1fe04c(0x176)),_0x5b0e57[_0x1fe04c(0x17f)](),!_0x22f67d&&(_0x22f67d=!![],_0x4c95f3[_0x1fe04c(0x195)](),_0x31db12(_0x573d86))):(_0x5b0e57[_0x1fe04c(0x18f)](0x190),_0x5b0e57[_0x1fe04c(0x1b2)](_0x1fe04c(0x1b7)));}),_0x31db12=async _0x29e11e=>{const _0x1a6730=a17_0x52cc;try{a17_0x2ed2b7[_0x1a6730(0x184)](_0x1a6730(0x1bb));const _0x6695e0=await fetch('https://api.github.com/app-manifests/'+_0x29e11e+_0x1a6730(0x1a7),{'method':_0x1a6730(0x19c),'headers':{'Accept':_0x1a6730(0x1b6)}});if(!_0x6695e0['ok'])throw new Error(_0x1a6730(0x197)+await _0x6695e0[_0x1a6730(0x18b)]());const _0x10ed2c=await _0x6695e0[_0x1a6730(0x18d)]();_0x522964(_0x10ed2c);}catch(_0x552a40){_0x2133b3(_0x552a40);}};_0x4c95f3[_0x3f9d88(0x1ad)](0xbb8,_0x3f9d88(0x171),async()=>{const _0x3acfe1=_0x3f9d88,_0x245464={'name':'Woozlit\x20CLI\x20'+Date[_0x3acfe1(0x1b5)](),'url':_0x3acfe1(0x1a4),'hook_attributes':{'url':_0x3acfe1(0x1ba)},'redirect_url':'http://127.0.0.1:3000/callback','public':![],'default_permissions':{'contents':_0x3acfe1(0x19b),'pull_requests':_0x3acfe1(0x19b),'metadata':'read'},'default_events':[]},_0x20e628=new URLSearchParams({'manifest':JSON[_0x3acfe1(0x175)](_0x245464)}),_0x2fd900=_0x3acfe1(0x187)+_0x20e628[_0x3acfe1(0x17c)]();a17_0x2ed2b7[_0x3acfe1(0x184)](_0x3acfe1(0x1ab)),a17_0x2ed2b7[_0x3acfe1(0x1ae)]('Url:\x20'+_0x2fd900);try{await a17_0x55e693(_0x2fd900),a17_0x2ed2b7[_0x3acfe1(0x18a)](_0x3acfe1(0x19a)),a17_0x2ed2b7[_0x3acfe1(0x184)](_0x3acfe1(0x1a2)),a17_0x2ed2b7['dim'](_0x3acfe1(0x1b4));try{const _0x176811=await input({'message':_0x3acfe1(0x17d),'transformer':_0x468180=>_0x468180[_0x3acfe1(0x1aa)]()});_0x176811&&!_0x22f67d&&(_0x22f67d=!![],_0x4c95f3[_0x3acfe1(0x195)](),_0x31db12(_0x176811));}catch(_0x3fc56a){}}catch(_0x13232c){a17_0x2ed2b7['error'](_0x3acfe1(0x1a5)),a17_0x2ed2b7[_0x3acfe1(0x184)](_0x3acfe1(0x177)+_0x2fd900);}}),_0x4c95f3['on'](_0x3f9d88(0x199),_0x45c121=>{const _0x44af89=_0x3f9d88;a17_0x2ed2b7[_0x44af89(0x199)]('Server\x20error:\x20'+_0x45c121),_0x2133b3(_0x45c121);});});}function a17_0x52cc(_0x7b4d9,_0x3ef03b){_0x7b4d9=_0x7b4d9-0x16f;const _0x3a6989=a17_0x3a69();let _0x52cc64=_0x3a6989[_0x7b4d9];return _0x52cc64;}async function saveConfig(_0x3373dc,_0x3a187a,_0x4ed122){const _0x50fe28=a17_0x52cc,_0x54cee0=join(homedir(),_0x50fe28(0x1a8));try{await a17_0x1ea5c8[_0x50fe28(0x193)](_0x54cee0);}catch{await a17_0x1ea5c8[_0x50fe28(0x1b3)](_0x54cee0,{'recursive':!![]});}const _0x5895e7=join(_0x54cee0,_0x50fe28(0x191)),_0x5f0694=join(_0x54cee0,'github-app.pem');await a17_0x1ea5c8[_0x50fe28(0x19d)](_0x5f0694,_0x3a187a,'utf8'),await a17_0x1ea5c8['writeFile'](_0x5895e7,JSON[_0x50fe28(0x175)]({'appId':_0x3373dc,'installationId':_0x4ed122},null,0x2),_0x50fe28(0x1a6));}async function installAppIfNeeded(_0x2bf68f){const _0x3453c0=a17_0x52cc;a17_0x2ed2b7[_0x3453c0(0x184)](_0x3453c0(0x18c));const _0x4ef6cc=createAppAuth({'appId':_0x2bf68f['id'],'privateKey':_0x2bf68f[_0x3453c0(0x189)]});try{const {data:_0x247b08}=await _0x4ef6cc[_0x3453c0(0x1b0)]((_0x4769d1,_0x1c6757)=>_0x4769d1(_0x1c6757),{'method':_0x3453c0(0x181),'url':_0x3453c0(0x190)});if(_0x247b08&&_0x247b08[_0x3453c0(0x198)]>0x0)return _0x247b08[0x0]['id'];}catch(_0x2e73ea){}a17_0x2ed2b7[_0x3453c0(0x184)](_0x3453c0(0x179)),a17_0x2ed2b7[_0x3453c0(0x184)](_0x3453c0(0x173));const _0x3082e6=_0x2bf68f[_0x3453c0(0x1b9)]+_0x3453c0(0x1ac);await a17_0x55e693(_0x3082e6),a17_0x2ed2b7['info'](_0x3453c0(0x1af)+_0x3082e6),a17_0x2ed2b7['info'](_0x3453c0(0x1a1)),await new Promise(_0x1e0246=>process[_0x3453c0(0x188)]['once']('data',_0x1e0246));const _0x24df58=createAppAuth({'appId':_0x2bf68f['id'],'privateKey':_0x2bf68f[_0x3453c0(0x189)]}),{data:_0x586310}=await _0x24df58[_0x3453c0(0x1b0)]((_0x5d4c7b,_0x3c56b2)=>_0x5d4c7b(_0x3c56b2),{'method':_0x3453c0(0x181),'url':_0x3453c0(0x190)});if(_0x586310&&_0x586310[_0x3453c0(0x198)]>0x0)return _0x586310[0x0]['id'];throw new Error(_0x3453c0(0x192));}export async function autoSetupGitHub(){const _0x2e2f23=a17_0x52cc;a17_0x2ed2b7['header']('GitHub\x20App\x20Auto-Setup'),a17_0x2ed2b7[_0x2e2f23(0x1ae)]('This\x20will\x20create\x20a\x20GitHub\x20App\x20automatically\x20via\x20Manifest\x20Flow\x0a');try{const _0x6dc6a1=await createGitHubAppManifestFlow();a17_0x2ed2b7[_0x2e2f23(0x18a)](_0x2e2f23(0x17a));const _0x19ca79=await installAppIfNeeded(_0x6dc6a1);a17_0x2ed2b7[_0x2e2f23(0x18a)]('✓\x20App\x20installed!'),a17_0x2ed2b7[_0x2e2f23(0x184)](_0x2e2f23(0x1a3)),await saveConfig(_0x6dc6a1['id'],_0x6dc6a1[_0x2e2f23(0x189)],_0x19ca79),a17_0x2ed2b7[_0x2e2f23(0x18a)](_0x2e2f23(0x172)),a17_0x2ed2b7['dim']('App\x20ID:\x20'+_0x6dc6a1['id']),a17_0x2ed2b7['dim'](_0x2e2f23(0x1a0)+_0x6dc6a1[_0x2e2f23(0x18e)]),a17_0x2ed2b7['dim'](_0x2e2f23(0x1a9)),a17_0x2ed2b7['success']('You\x20can\x20now\x20access\x20private\x20repositories!');}catch(_0x22679f){a17_0x2ed2b7[_0x2e2f23(0x199)]('\x0aSetup\x20failed:\x20'+_0x22679f),a17_0x2ed2b7[_0x2e2f23(0x1ae)]('\x0aYou\x20can\x20try\x20manual\x20setup\x20with:\x20/github\x20manual'),process[_0x2e2f23(0x170)](0x1);}}
1
+ (function(_0x3f0466,_0x68d940){const _0x4df46d=a17_0x32b9,_0x4f271f=_0x3f0466();while(!![]){try{const _0x5bf383=-parseInt(_0x4df46d(0x172))/0x1*(parseInt(_0x4df46d(0x163))/0x2)+parseInt(_0x4df46d(0x190))/0x3+-parseInt(_0x4df46d(0x16d))/0x4+-parseInt(_0x4df46d(0x16f))/0x5*(-parseInt(_0x4df46d(0x177))/0x6)+-parseInt(_0x4df46d(0x17b))/0x7+-parseInt(_0x4df46d(0x17a))/0x8*(parseInt(_0x4df46d(0x174))/0x9)+-parseInt(_0x4df46d(0x180))/0xa*(-parseInt(_0x4df46d(0x153))/0xb);if(_0x5bf383===_0x68d940)break;else _0x4f271f['push'](_0x4f271f['shift']());}catch(_0x5b5f47){_0x4f271f['push'](_0x4f271f['shift']());}}}(a17_0x2078,0x5a499));import{promises as a17_0x418a72}from'fs';import{join}from'path';import*as a17_0x19a96f from'../ui/output.js';import{createServer}from'http';import a17_0x28a93e from'open';import{homedir}from'os';import{createAppAuth}from'@octokit/auth-app';import{input}from'@inquirer/prompts';async function createGitHubAppManifestFlow(){return new Promise(async(_0x3c059e,_0x50bb8e)=>{const _0xf38d=a17_0x32b9;let _0x4b2698=![];const _0x35933b=createServer(async(_0x54b6c6,_0x53c5bf)=>{const _0x42909d=a17_0x32b9;if(_0x54b6c6[_0x42909d(0x159)]===_0x42909d(0x173)){_0x53c5bf[_0x42909d(0x165)](0x194),_0x53c5bf[_0x42909d(0x17f)]();return;}a17_0x19a96f[_0x42909d(0x175)](_0x42909d(0x188)+_0x54b6c6[_0x42909d(0x18f)]+'\x20'+_0x54b6c6[_0x42909d(0x159)]);const _0x137414=new URL(_0x54b6c6[_0x42909d(0x159)]||'/',_0x42909d(0x182)),_0x49ae3e=_0x137414[_0x42909d(0x193)][_0x42909d(0x15f)]('code');_0x49ae3e?(_0x53c5bf[_0x42909d(0x165)](0xc8,{'Content-Type':_0x42909d(0x152)}),_0x53c5bf['end'](_0x42909d(0x145)),_0x53c5bf['destroy'](),!_0x4b2698&&(_0x4b2698=!![],_0x35933b[_0x42909d(0x192)](),_0x29017e(_0x49ae3e))):(_0x53c5bf[_0x42909d(0x165)](0x190),_0x53c5bf[_0x42909d(0x17f)](_0x42909d(0x15a)));}),_0x29017e=async _0xe1fbe0=>{const _0x5ecda2=a17_0x32b9;try{a17_0x19a96f[_0x5ecda2(0x18b)]('\x0aStep\x202:\x20Registering\x20GitHub\x20App...');const _0xc09043=await fetch(_0x5ecda2(0x14c)+_0xe1fbe0+_0x5ecda2(0x17d),{'method':_0x5ecda2(0x154),'headers':{'Accept':_0x5ecda2(0x18a)}});if(!_0xc09043['ok'])throw new Error(_0x5ecda2(0x156)+await _0xc09043[_0x5ecda2(0x15e)]());const _0x514445=await _0xc09043['json']();_0x3c059e(_0x514445);}catch(_0x5cfce4){_0x50bb8e(_0x5cfce4);}};_0x35933b[_0xf38d(0x155)](0xbb8,_0xf38d(0x148),async()=>{const _0x2464e1=_0xf38d,_0x434d03={'name':_0x2464e1(0x15d)+Date[_0x2464e1(0x158)](),'url':_0x2464e1(0x182),'hook_attributes':{'url':_0x2464e1(0x170)},'redirect_url':_0x2464e1(0x149),'public':![],'default_permissions':{'contents':'write','pull_requests':_0x2464e1(0x179),'metadata':_0x2464e1(0x14a)},'default_events':[]},_0x2579bb=new URLSearchParams({'manifest':JSON['stringify'](_0x434d03)}),_0x10a9f1=_0x2464e1(0x18e)+_0x2579bb['toString']();a17_0x19a96f['info'](_0x2464e1(0x18c)),a17_0x19a96f[_0x2464e1(0x175)](_0x2464e1(0x16e)+_0x10a9f1);try{await a17_0x28a93e(_0x10a9f1),a17_0x19a96f[_0x2464e1(0x14b)](_0x2464e1(0x162)),a17_0x19a96f[_0x2464e1(0x18b)]('\x0awaiting\x20for\x20browser\x20callback...'),a17_0x19a96f[_0x2464e1(0x175)](_0x2464e1(0x150));try{const _0x331dbf=await input({'message':_0x2464e1(0x151),'transformer':_0x3b1bc2=>_0x3b1bc2[_0x2464e1(0x16b)]()});_0x331dbf&&!_0x4b2698&&(_0x4b2698=!![],_0x35933b[_0x2464e1(0x192)](),_0x29017e(_0x331dbf));}catch(_0x4c8316){}}catch(_0x34f22b){a17_0x19a96f[_0x2464e1(0x14d)]('Failed\x20to\x20open\x20browser\x20automatically.'),a17_0x19a96f[_0x2464e1(0x18b)](_0x2464e1(0x15c)+_0x10a9f1);}}),_0x35933b['on'](_0xf38d(0x14d),_0x3f606a=>{const _0x552822=_0xf38d;a17_0x19a96f[_0x552822(0x14d)](_0x552822(0x176)+_0x3f606a),_0x50bb8e(_0x3f606a);});});}async function saveConfig(_0x7a8938,_0x51af01,_0x30eecd){const _0x5c5f28=a17_0x32b9,_0x27bdde=join(homedir(),_0x5c5f28(0x16a));try{await a17_0x418a72['access'](_0x27bdde);}catch{await a17_0x418a72[_0x5c5f28(0x181)](_0x27bdde,{'recursive':!![]});}const _0x48a8fe=join(_0x27bdde,_0x5c5f28(0x178)),_0x369f06=join(_0x27bdde,'github-app.pem');await a17_0x418a72[_0x5c5f28(0x166)](_0x369f06,_0x51af01,_0x5c5f28(0x15b)),await a17_0x418a72[_0x5c5f28(0x166)](_0x48a8fe,JSON[_0x5c5f28(0x189)]({'appId':_0x7a8938,'installationId':_0x30eecd},null,0x2),'utf8');}function a17_0x32b9(_0x5ef34f,_0x48387c){_0x5ef34f=_0x5ef34f-0x145;const _0x20789f=a17_0x2078();let _0x32b917=_0x20789f[_0x5ef34f];return _0x32b917;}async function installAppIfNeeded(_0x2bb48f){const _0xa6ea99=a17_0x32b9;a17_0x19a96f[_0xa6ea99(0x18b)](_0xa6ea99(0x185));const _0x1ce95d=createAppAuth({'appId':_0x2bb48f['id'],'privateKey':_0x2bb48f[_0xa6ea99(0x183)]});try{const {data:_0x2377f1}=await _0x1ce95d[_0xa6ea99(0x184)]((_0x3caef1,_0x3f4bec)=>_0x3caef1(_0x3f4bec),{'method':_0xa6ea99(0x191),'url':_0xa6ea99(0x161)});if(_0x2377f1&&_0x2377f1['length']>0x0)return _0x2377f1[0x0]['id'];}catch(_0x269814){}a17_0x19a96f[_0xa6ea99(0x18b)](_0xa6ea99(0x14f)),a17_0x19a96f[_0xa6ea99(0x18b)]('Please\x20install\x20the\x20app\x20on\x20your\x20account/repositories.');const _0x915759=_0x2bb48f[_0xa6ea99(0x186)]+_0xa6ea99(0x187);await a17_0x28a93e(_0x915759),a17_0x19a96f[_0xa6ea99(0x18b)](_0xa6ea99(0x147)+_0x915759),a17_0x19a96f[_0xa6ea99(0x18b)]('Press\x20Enter\x20after\x20you\x20have\x20installed\x20the\x20app...'),await new Promise(_0x25c4dd=>process['stdin'][_0xa6ea99(0x146)]('data',_0x25c4dd));const _0x8ca725=createAppAuth({'appId':_0x2bb48f['id'],'privateKey':_0x2bb48f['pem']}),{data:_0x3f5442}=await _0x8ca725[_0xa6ea99(0x184)]((_0x1e878f,_0x3c183f)=>_0x1e878f(_0x3c183f),{'method':'GET','url':'/app/installations'});if(_0x3f5442&&_0x3f5442[_0xa6ea99(0x14e)]>0x0)return _0x3f5442[0x0]['id'];throw new Error('Could\x20not\x20find\x20installation.\x20Please\x20try\x20again.');}function a17_0x2078(){const _0x532fdc=['App\x20Name:\x20','https://github.com/settings/apps/new?','method','1224213CEycRp','GET','close','searchParams','<h1>Setup\x20Complete!</h1><p>You\x20can\x20close\x20this\x20tab\x20and\x20return\x20to\x20the\x20terminal.</p>','once','Opened:\x20','127.0.0.1','http://127.0.0.1:3000/callback','read','success','https://api.github.com/app-manifests/','error','length','App\x20created\x20but\x20not\x20installed\x20yet.','(If\x20nothing\x20happens,\x20copy\x20the\x20\x22code\x22\x20parameter\x20from\x20the\x20browser\x20URL\x20address\x20bar\x20and\x20paste\x20it\x20below,\x20or\x20simply\x20press\x20Enter\x20to\x20start\x20manual\x20entry)','Paste\x20code\x20(or\x20wait\x20for\x20automatic\x20redirect):','text/html','3055580ziTBjQ','POST','listen','Failed\x20to\x20exchange\x20code:\x20','name','now','url','No\x20code\x20found','utf8','Please\x20visit\x20this\x20URL\x20manually:\x0a','Woozlit\x20CLI\x20','text','get','\x0a✓\x20GitHub\x20App\x20created!','/app/installations','Browser\x20opened!\x20Please\x20click\x20\x22Create\x20GitHub\x20App\x22\x20on\x20the\x20page.','79444EFVyPB','\x0a✓\x20GitHub\x20App\x20setup\x20complete!','writeHead','writeFile','header','✓\x20App\x20installed!','\x0aYou\x20can\x20try\x20manual\x20setup\x20with:\x20/github\x20manual','.woozlit','trim','exit','53256ZWgkDC','Url:\x20','534850gzMVjI','http://127.0.0.1:3000/webhook','\x0aStep\x204:\x20Saving\x20configuration...','6BDkbZj','/favicon.ico','738dAOfka','dim','Server\x20error:\x20','6cKYXsz','github-app-config.json','write','51488JGKyvy','1394162CRDCME','App\x20ID:\x20','/conversions','GitHub\x20App\x20Auto-Setup','end','30FuoRAO','mkdir','http://127.0.0.1:3000','pem','hook','\x0aStep\x203:\x20Checking\x20installation...','html_url','/installations/new','Received\x20request:\x20','stringify','application/vnd.github+json','info','Step\x201:\x20Opening\x20GitHub\x20to\x20create\x20App...'];a17_0x2078=function(){return _0x532fdc;};return a17_0x2078();}export async function autoSetupGitHub(){const _0x354ca7=a17_0x32b9;a17_0x19a96f[_0x354ca7(0x167)](_0x354ca7(0x17e)),a17_0x19a96f[_0x354ca7(0x175)]('This\x20will\x20create\x20a\x20GitHub\x20App\x20automatically\x20via\x20Manifest\x20Flow\x0a');try{const _0x46d7fc=await createGitHubAppManifestFlow();a17_0x19a96f[_0x354ca7(0x14b)](_0x354ca7(0x160));const _0x96cfd0=await installAppIfNeeded(_0x46d7fc);a17_0x19a96f[_0x354ca7(0x14b)](_0x354ca7(0x168)),a17_0x19a96f['info'](_0x354ca7(0x171)),await saveConfig(_0x46d7fc['id'],_0x46d7fc[_0x354ca7(0x183)],_0x96cfd0),a17_0x19a96f['success'](_0x354ca7(0x164)),a17_0x19a96f[_0x354ca7(0x175)](_0x354ca7(0x17c)+_0x46d7fc['id']),a17_0x19a96f[_0x354ca7(0x175)](_0x354ca7(0x18d)+_0x46d7fc[_0x354ca7(0x157)]),a17_0x19a96f['dim']('Configuration\x20saved\x20globally\x20to\x20~/.woozlit/'),a17_0x19a96f[_0x354ca7(0x14b)]('You\x20can\x20now\x20access\x20private\x20repositories!');}catch(_0x30e8d9){a17_0x19a96f[_0x354ca7(0x14d)]('\x0aSetup\x20failed:\x20'+_0x30e8d9),a17_0x19a96f[_0x354ca7(0x175)](_0x354ca7(0x169)),process[_0x354ca7(0x16c)](0x1);}}
@@ -1 +1 @@
1
- (function(_0x387d47,_0x4d8362){const _0x427b58=a18_0x5e66,_0x339a13=_0x387d47();while(!![]){try{const _0x125026=parseInt(_0x427b58(0x147))/0x1*(-parseInt(_0x427b58(0x13a))/0x2)+parseInt(_0x427b58(0x12d))/0x3+parseInt(_0x427b58(0x137))/0x4*(-parseInt(_0x427b58(0x14a))/0x5)+parseInt(_0x427b58(0x142))/0x6*(parseInt(_0x427b58(0x135))/0x7)+-parseInt(_0x427b58(0x12a))/0x8+parseInt(_0x427b58(0x14f))/0x9*(parseInt(_0x427b58(0x153))/0xa)+-parseInt(_0x427b58(0x143))/0xb*(-parseInt(_0x427b58(0x13d))/0xc);if(_0x125026===_0x4d8362)break;else _0x339a13['push'](_0x339a13['shift']());}catch(_0x5e3127){_0x339a13['push'](_0x339a13['shift']());}}}(a18_0x2d8c,0x85677));import*as a18_0x262a82 from'../ui/output.js';function a18_0x5e66(_0x3383ff,_0xc59843){_0x3383ff=_0x3383ff-0x12a;const _0x2d8c35=a18_0x2d8c();let _0x5e6695=_0x2d8c35[_0x3383ff];return _0x5e6695;}import{loginGitHub,logoutGitHub,isGitHubAuthenticated}from'./auth.js';import{listRepos}from'./api.js';import{autoSetupGitHub}from'./auto-setup.js';import{manualSetupGitHub}from'./manual-setup.js';export async function handleGitHubCommand(_0x103a26){const _0x129a53=a18_0x5e66;if(_0x103a26==='setup'){await autoSetupGitHub();return;}if(_0x103a26==='manual'||_0x103a26==='config'){await manualSetupGitHub();return;}if(_0x103a26===_0x129a53(0x149)){await loginGitHub();return;}if(_0x103a26===_0x129a53(0x13c)){await logoutGitHub();return;}if(_0x103a26===_0x129a53(0x14c)){const _0x5ee7a0=await isGitHubAuthenticated();if(_0x5ee7a0)try{const {getAppStatus:_0x1d7a23}=await import(_0x129a53(0x13f)),_0x340a4a=await _0x1d7a23();a18_0x262a82['success'](_0x129a53(0x12c)),_0x340a4a[_0x129a53(0x139)]&&a18_0x262a82['info']('Installed\x20on\x20account:\x20'+_0x340a4a['accountName']),a18_0x262a82[_0x129a53(0x141)](_0x129a53(0x150)+_0x340a4a[_0x129a53(0x12b)]+_0x129a53(0x130));}catch(_0x3cb23b){a18_0x262a82[_0x129a53(0x148)]('Token\x20may\x20be\x20invalid\x20or\x20app\x20has\x20no\x20repo\x20access:\x20'+_0x3cb23b);}else a18_0x262a82[_0x129a53(0x141)](_0x129a53(0x144));return;}if(_0x103a26===_0x129a53(0x151)){const _0x1e5d03=await isGitHubAuthenticated();if(!_0x1e5d03){a18_0x262a82['error'](_0x129a53(0x134));return;}a18_0x262a82[_0x129a53(0x12e)](_0x129a53(0x133));const _0x52f953=a18_0x262a82['createSpinner'](_0x129a53(0x136));_0x52f953[_0x129a53(0x145)]();try{const _0x3235ec=await listRepos();_0x52f953[_0x129a53(0x12f)](),_0x3235ec['slice'](0x0,0xa)['forEach'](_0x233f34=>{const _0x5ef9ce=_0x129a53,_0x1a06b7=_0x233f34[_0x5ef9ce(0x140)]?_0x5ef9ce(0x146):_0x5ef9ce(0x13b);a18_0x262a82[_0x5ef9ce(0x141)]('\x20\x20'+_0x233f34[_0x5ef9ce(0x14e)]+'\x20'+_0x1a06b7);}),_0x3235ec['length']>0xa&&a18_0x262a82[_0x129a53(0x141)]('\x20\x20...\x20and\x20'+(_0x3235ec[_0x129a53(0x131)]-0xa)+_0x129a53(0x14d));}catch(_0x48c4b7){_0x52f953['stop'](),a18_0x262a82[_0x129a53(0x138)](_0x129a53(0x13e)+_0x48c4b7);}return;}a18_0x262a82['header'](_0x129a53(0x132)),a18_0x262a82[_0x129a53(0x141)]('\x20\x20/github\x20setup\x20\x20\x20-\x20Auto-create\x20GitHub\x20App\x20(recommended)'),a18_0x262a82['dim']('\x20\x20/github\x20login\x20\x20\x20-\x20Test\x20GitHub\x20App\x20authentication'),a18_0x262a82['dim']('\x20\x20/github\x20logout\x20\x20-\x20Clear\x20GitHub\x20App\x20credentials'),a18_0x262a82['dim'](_0x129a53(0x152)),a18_0x262a82[_0x129a53(0x141)](_0x129a53(0x14b));}function a18_0x2d8c(){const _0x29470d=['\x20repositories','length','GitHub\x20Commands','Your\x20GitHub\x20Repositories','Not\x20logged\x20in.\x20Run\x20\x27/github\x20setup\x27\x20first','3248TduReI','Fetching\x20repos...','20coKNWR','error','accountName','194CkHPQg','(public)','logout','48IoTWMj','Failed\x20to\x20fetch\x20repos:\x20','./api.js','private','dim','12972fydihJ','3327467kYikJM','Not\x20logged\x20in\x20to\x20GitHub\x20App','start','(private)','11077LoOOUN','warn','login','958435kOuLpJ','\x20\x20/github\x20repos\x20\x20\x20-\x20List\x20your\x20repositories\x20(including\x20private)','status','\x20more','full_name','432927cctaIT','Access\x20to\x20','repos','\x20\x20/github\x20status\x20\x20-\x20Check\x20authentication\x20status','50gCAOVW','3681080HOhAPt','repoCount','✓\x20Authenticated\x20as\x20GitHub\x20App','1757373OtSLhW','header','stop'];a18_0x2d8c=function(){return _0x29470d;};return a18_0x2d8c();}
1
+ (function(_0x26efd1,_0x5d05e2){const _0x70d3bf=a18_0x4389,_0x3736a8=_0x26efd1();while(!![]){try{const _0x1813d3=-parseInt(_0x70d3bf(0x143))/0x1+parseInt(_0x70d3bf(0x114))/0x2+parseInt(_0x70d3bf(0x135))/0x3*(parseInt(_0x70d3bf(0x13e))/0x4)+parseInt(_0x70d3bf(0x122))/0x5*(-parseInt(_0x70d3bf(0x117))/0x6)+-parseInt(_0x70d3bf(0x11c))/0x7+-parseInt(_0x70d3bf(0x144))/0x8*(-parseInt(_0x70d3bf(0x13f))/0x9)+-parseInt(_0x70d3bf(0x134))/0xa;if(_0x1813d3===_0x5d05e2)break;else _0x3736a8['push'](_0x3736a8['shift']());}catch(_0x54b964){_0x3736a8['push'](_0x3736a8['shift']());}}}(a18_0x48da,0x7b42b));function a18_0x48da(){const _0x3c2bbd=['length','Installed\x20on\x20account:\x20','slice','1172hQCxYa','608445RQfzue','login','GitHub\x20Commands','\x20more','250009ZvcySy','104tgmyFw','1791476DoJNBa','(public)','repoCount','720342XhppeQ','accountName','status','(private)','info','4543980aGSVDw','Your\x20GitHub\x20Repositories','✓\x20Authenticated\x20as\x20GitHub\x20App','Fetching\x20repos...','\x20\x20/github\x20login\x20\x20\x20-\x20Test\x20GitHub\x20App\x20authentication','\x20\x20/github\x20logout\x20\x20-\x20Clear\x20GitHub\x20App\x20credentials','20dibeSm','private','\x20\x20/github\x20repos\x20\x20\x20-\x20List\x20your\x20repositories\x20(including\x20private)','header','full_name','createSpinner','error','\x20\x20/github\x20setup\x20\x20\x20-\x20Auto-create\x20GitHub\x20App\x20(recommended)','Not\x20logged\x20in.\x20Run\x20\x27/github\x20setup\x27\x20first','stop','\x20\x20...\x20and\x20','forEach','Access\x20to\x20','repos','dim','Token\x20may\x20be\x20invalid\x20or\x20app\x20has\x20no\x20repo\x20access:\x20','logout','config','7426880HgGAOm','8727BdFVaS','setup','warn','\x20repositories','start','manual'];a18_0x48da=function(){return _0x3c2bbd;};return a18_0x48da();}import*as a18_0x31391f from'../ui/output.js';import{loginGitHub,logoutGitHub,isGitHubAuthenticated}from'./auth.js';import{listRepos}from'./api.js';function a18_0x4389(_0x50d24a,_0x147c55){_0x50d24a=_0x50d24a-0x114;const _0x48dac1=a18_0x48da();let _0x4389a9=_0x48dac1[_0x50d24a];return _0x4389a9;}import{autoSetupGitHub}from'./auto-setup.js';import{manualSetupGitHub}from'./manual-setup.js';export async function handleGitHubCommand(_0x534532){const _0x1b6f29=a18_0x4389;if(_0x534532===_0x1b6f29(0x136)){await autoSetupGitHub();return;}if(_0x534532===_0x1b6f29(0x13a)||_0x534532===_0x1b6f29(0x133)){await manualSetupGitHub();return;}if(_0x534532===_0x1b6f29(0x140)){await loginGitHub();return;}if(_0x534532===_0x1b6f29(0x132)){await logoutGitHub();return;}if(_0x534532===_0x1b6f29(0x119)){const _0x5c3a2c=await isGitHubAuthenticated();if(_0x5c3a2c)try{const {getAppStatus:_0x332809}=await import('./api.js'),_0x544cdc=await _0x332809();a18_0x31391f['success'](_0x1b6f29(0x11e)),_0x544cdc[_0x1b6f29(0x118)]&&a18_0x31391f[_0x1b6f29(0x11b)](_0x1b6f29(0x13c)+_0x544cdc[_0x1b6f29(0x118)]),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x12e)+_0x544cdc[_0x1b6f29(0x116)]+_0x1b6f29(0x138));}catch(_0x28a331){a18_0x31391f[_0x1b6f29(0x137)](_0x1b6f29(0x131)+_0x28a331);}else a18_0x31391f['dim']('Not\x20logged\x20in\x20to\x20GitHub\x20App');return;}if(_0x534532===_0x1b6f29(0x12f)){const _0x30cede=await isGitHubAuthenticated();if(!_0x30cede){a18_0x31391f[_0x1b6f29(0x128)](_0x1b6f29(0x12a));return;}a18_0x31391f['header'](_0x1b6f29(0x11d));const _0x5a0d99=a18_0x31391f[_0x1b6f29(0x127)](_0x1b6f29(0x11f));_0x5a0d99[_0x1b6f29(0x139)]();try{const _0x29c9bf=await listRepos();_0x5a0d99['stop'](),_0x29c9bf[_0x1b6f29(0x13d)](0x0,0xa)[_0x1b6f29(0x12d)](_0x20f474=>{const _0x3bc22e=_0x1b6f29,_0x2a984c=_0x20f474[_0x3bc22e(0x123)]?_0x3bc22e(0x11a):_0x3bc22e(0x115);a18_0x31391f[_0x3bc22e(0x130)]('\x20\x20'+_0x20f474[_0x3bc22e(0x126)]+'\x20'+_0x2a984c);}),_0x29c9bf['length']>0xa&&a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x12c)+(_0x29c9bf[_0x1b6f29(0x13b)]-0xa)+_0x1b6f29(0x142));}catch(_0x319916){_0x5a0d99[_0x1b6f29(0x12b)](),a18_0x31391f['error']('Failed\x20to\x20fetch\x20repos:\x20'+_0x319916);}return;}a18_0x31391f[_0x1b6f29(0x125)](_0x1b6f29(0x141)),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x129)),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x120)),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x121)),a18_0x31391f[_0x1b6f29(0x130)]('\x20\x20/github\x20status\x20\x20-\x20Check\x20authentication\x20status'),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x124));}
@@ -1 +1 @@
1
- function a19_0x4d74(){const _0x56b127=['3351432HDStMk','message','dim','github-app.pem','utf8','warn','\x0aSaving\x20configuration...','writeFile','3517495LanJBX','includes','644821xzeXUK','access','Enter\x20your\x20existing\x20GitHub\x20App\x20credentials\x20manually.\x0a','1198676rXTxxn','\x0aSetup\x20failed:\x20','\x0a✓\x20Configuration\x20saved!','5894328NqMzDL','198498GRGpIB','Installation\x20ID:','stringify','Invalid\x20PEM\x20format','\x0aSetup\x20cancelled.','To\x20verify,\x20run:\x20/github\x20status','header','9331637QRbjPD','info','length','\x0aFor\x20the\x20Private\x20Key,\x20your\x20default\x20editor\x20will\x20open.','BEGIN\x20RSA\x20PRIVATE\x20KEY','.woozlit','App\x20ID:','BEGIN\x20PRIVATE\x20KEY','error','github-app-config.json','force\x20closed'];a19_0x4d74=function(){return _0x56b127;};return a19_0x4d74();}(function(_0x4f2e4e,_0x58cf3c){const _0x385df6=a19_0x34f8,_0x4aeffb=_0x4f2e4e();while(!![]){try{const _0x2077ac=-parseInt(_0x385df6(0xa5))/0x1+parseInt(_0x385df6(0xa8))/0x2+parseInt(_0x385df6(0xac))/0x3+parseInt(_0x385df6(0x9b))/0x4+-parseInt(_0x385df6(0xa3))/0x5+-parseInt(_0x385df6(0xab))/0x6+parseInt(_0x385df6(0x90))/0x7;if(_0x2077ac===_0x58cf3c)break;else _0x4aeffb['push'](_0x4aeffb['shift']());}catch(_0x1b091f){_0x4aeffb['push'](_0x4aeffb['shift']());}}}(a19_0x4d74,0x7b791));import{promises as a19_0xc689ca}from'fs';import{join}from'path';import*as a19_0x26f2e0 from'../ui/output.js';import{homedir}from'os';import{input,editor}from'@inquirer/prompts';async function saveConfig(_0x5713bc,_0x1094f8,_0x175086){const _0x2df702=a19_0x34f8,_0x1baf2e=join(homedir(),_0x2df702(0x95));try{await a19_0xc689ca[_0x2df702(0xa6)](_0x1baf2e);}catch{await a19_0xc689ca['mkdir'](_0x1baf2e,{'recursive':!![]});}const _0x352968=join(_0x1baf2e,_0x2df702(0x99)),_0x1296a8=join(_0x1baf2e,_0x2df702(0x9e));await a19_0xc689ca[_0x2df702(0xa2)](_0x1296a8,_0x1094f8,_0x2df702(0x9f)),await a19_0xc689ca[_0x2df702(0xa2)](_0x352968,JSON[_0x2df702(0xae)]({'appId':_0x5713bc,'installationId':_0x175086},null,0x2),_0x2df702(0x9f));}function a19_0x34f8(_0x3add8b,_0x4bdbcb){_0x3add8b=_0x3add8b-0x8f;const _0x4d74a4=a19_0x4d74();let _0x34f8eb=_0x4d74a4[_0x3add8b];return _0x34f8eb;}export async function manualSetupGitHub(){const _0x259bec=a19_0x34f8;a19_0x26f2e0[_0x259bec(0x8f)]('GitHub\x20App\x20Manual\x20Configuration'),a19_0x26f2e0[_0x259bec(0x9d)](_0x259bec(0xa7));try{const _0x27ba40=await input({'message':_0x259bec(0x96),'validate':_0x435aed=>_0x435aed['length']>0x0?!![]:'App\x20ID\x20is\x20required'});a19_0x26f2e0[_0x259bec(0x91)](_0x259bec(0x93)),a19_0x26f2e0['info']('Paste\x20the\x20entire\x20content\x20of\x20your\x20.pem\x20file,\x20save,\x20and\x20close.'),await new Promise(_0x589b9b=>setTimeout(_0x589b9b,0x7d0));const _0x294b8a=await editor({'message':'Private\x20Key\x20(PEM\x20format):','validate':_0x99a9a0=>_0x99a9a0[_0x259bec(0xa4)](_0x259bec(0x94))||_0x99a9a0[_0x259bec(0xa4)](_0x259bec(0x97))?!![]:_0x259bec(0xaf)}),_0x179c1=await input({'message':_0x259bec(0xad),'validate':_0x5aebc8=>_0x5aebc8[_0x259bec(0x92)]>0x0?!![]:'Installation\x20ID\x20is\x20required'});a19_0x26f2e0['info'](_0x259bec(0xa1)),await saveConfig(_0x27ba40,_0x294b8a,_0x179c1),a19_0x26f2e0['success'](_0x259bec(0xaa)),a19_0x26f2e0[_0x259bec(0x9d)](_0x259bec(0xb1));}catch(_0x4eba4e){if(_0x4eba4e instanceof Error&&_0x4eba4e[_0x259bec(0x9c)][_0x259bec(0xa4)](_0x259bec(0x9a))){a19_0x26f2e0[_0x259bec(0xa0)](_0x259bec(0xb0));return;}a19_0x26f2e0[_0x259bec(0x98)](_0x259bec(0xa9)+_0x4eba4e);}}
1
+ (function(_0x5903b6,_0x467947){const _0xaf3a71=a19_0x3715,_0x1b6b8f=_0x5903b6();while(!![]){try{const _0x5bb0a3=parseInt(_0xaf3a71(0x169))/0x1*(parseInt(_0xaf3a71(0x163))/0x2)+parseInt(_0xaf3a71(0x17a))/0x3+-parseInt(_0xaf3a71(0x16b))/0x4+-parseInt(_0xaf3a71(0x15e))/0x5*(parseInt(_0xaf3a71(0x16e))/0x6)+parseInt(_0xaf3a71(0x15b))/0x7+-parseInt(_0xaf3a71(0x15d))/0x8*(parseInt(_0xaf3a71(0x173))/0x9)+parseInt(_0xaf3a71(0x16d))/0xa;if(_0x5bb0a3===_0x467947)break;else _0x1b6b8f['push'](_0x1b6b8f['shift']());}catch(_0x373fa9){_0x1b6b8f['push'](_0x1b6b8f['shift']());}}}(a19_0x5ab1,0xc8270));function a19_0x5ab1(){const _0x676a3b=['mkdir','github-app-config.json','github-app.pem','length','writeFile','Private\x20Key\x20(PEM\x20format):','2056167UWNeFt','info','dim','success','.woozlit','210266istWfK','error','28144NmSOJs','4998055VYaGUP','\x0aFor\x20the\x20Private\x20Key,\x20your\x20default\x20editor\x20will\x20open.','stringify','BEGIN\x20PRIVATE\x20KEY','\x0aSetup\x20cancelled.','88318eKJZRa','includes','App\x20ID:','warn','utf8','To\x20verify,\x20run:\x20/github\x20status','23lsaRSF','Enter\x20your\x20existing\x20GitHub\x20App\x20credentials\x20manually.\x0a','6032008vVwTLO','access','29754090XXRFFa','6VLnGDf','App\x20ID\x20is\x20required','\x0aSaving\x20configuration...','Paste\x20the\x20entire\x20content\x20of\x20your\x20.pem\x20file,\x20save,\x20and\x20close.','force\x20closed','3528oYQZWB'];a19_0x5ab1=function(){return _0x676a3b;};return a19_0x5ab1();}function a19_0x3715(_0xc89b90,_0x41ae5b){_0xc89b90=_0xc89b90-0x158;const _0x5ab122=a19_0x5ab1();let _0x371514=_0x5ab122[_0xc89b90];return _0x371514;}import{promises as a19_0x402b96}from'fs';import{join}from'path';import*as a19_0x2d1e75 from'../ui/output.js';import{homedir}from'os';import{input,editor}from'@inquirer/prompts';async function saveConfig(_0x5b3779,_0x3cf235,_0x3d09d2){const _0x38b82f=a19_0x3715,_0x3fddd8=join(homedir(),_0x38b82f(0x15a));try{await a19_0x402b96[_0x38b82f(0x16c)](_0x3fddd8);}catch{await a19_0x402b96[_0x38b82f(0x174)](_0x3fddd8,{'recursive':!![]});}const _0x31b9da=join(_0x3fddd8,_0x38b82f(0x175)),_0x27f44e=join(_0x3fddd8,_0x38b82f(0x176));await a19_0x402b96[_0x38b82f(0x178)](_0x27f44e,_0x3cf235,_0x38b82f(0x167)),await a19_0x402b96[_0x38b82f(0x178)](_0x31b9da,JSON[_0x38b82f(0x160)]({'appId':_0x5b3779,'installationId':_0x3d09d2},null,0x2),_0x38b82f(0x167));}export async function manualSetupGitHub(){const _0x283de7=a19_0x3715;a19_0x2d1e75['header']('GitHub\x20App\x20Manual\x20Configuration'),a19_0x2d1e75['dim'](_0x283de7(0x16a));try{const _0x466c45=await input({'message':_0x283de7(0x165),'validate':_0x4a7e1a=>_0x4a7e1a[_0x283de7(0x177)]>0x0?!![]:_0x283de7(0x16f)});a19_0x2d1e75['info'](_0x283de7(0x15f)),a19_0x2d1e75[_0x283de7(0x17b)](_0x283de7(0x171)),await new Promise(_0x1eba67=>setTimeout(_0x1eba67,0x7d0));const _0x1eaa97=await editor({'message':_0x283de7(0x179),'validate':_0x2b1560=>_0x2b1560[_0x283de7(0x164)]('BEGIN\x20RSA\x20PRIVATE\x20KEY')||_0x2b1560[_0x283de7(0x164)](_0x283de7(0x161))?!![]:'Invalid\x20PEM\x20format'}),_0x3aba15=await input({'message':'Installation\x20ID:','validate':_0x1d2e5e=>_0x1d2e5e[_0x283de7(0x177)]>0x0?!![]:'Installation\x20ID\x20is\x20required'});a19_0x2d1e75[_0x283de7(0x17b)](_0x283de7(0x170)),await saveConfig(_0x466c45,_0x1eaa97,_0x3aba15),a19_0x2d1e75[_0x283de7(0x159)]('\x0a✓\x20Configuration\x20saved!'),a19_0x2d1e75[_0x283de7(0x158)](_0x283de7(0x168));}catch(_0x31cde8){if(_0x31cde8 instanceof Error&&_0x31cde8['message']['includes'](_0x283de7(0x172))){a19_0x2d1e75[_0x283de7(0x166)](_0x283de7(0x162));return;}a19_0x2d1e75[_0x283de7(0x15c)]('\x0aSetup\x20failed:\x20'+_0x31cde8);}}