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.
- package/README.md +28 -0
- package/dist/auth/login.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/server.js +1 -1
- package/dist/browser/tools.js +1 -1
- package/dist/chat/agent.js +1 -1
- package/dist/config/mcp.js +1 -1
- package/dist/config/settings.js +1 -1
- package/dist/discord/client.js +1 -1
- package/dist/discord/config.js +1 -1
- package/dist/discord/index.js +1 -1
- package/dist/discord/setup.js +1 -1
- package/dist/email/config.js +1 -1
- package/dist/email/index.js +1 -1
- package/dist/email/service.js +1 -1
- package/dist/email/setup.js +1 -1
- package/dist/github/api.js +1 -1
- package/dist/github/auth.js +1 -1
- package/dist/github/auto-setup.js +1 -1
- package/dist/github/index.js +1 -1
- package/dist/github/manual-setup.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-servers/computer-use.js +1 -1
- package/dist/services/bot-manager.js +1 -1
- package/dist/services/notifications.js +1 -1
- package/dist/services/voice-agent.js +1 -1
- package/dist/telegram/bot.js +1 -1
- package/dist/telegram/config.js +1 -1
- package/dist/telegram/index.js +1 -1
- package/dist/telegram/reminders.js +1 -1
- package/dist/telegram/setup.js +1 -1
- package/dist/tools/command.js +1 -1
- package/dist/tools/file.d.ts +8 -0
- package/dist/tools/file.js +1 -1
- package/dist/tools/git.js +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/knowledge.d.ts +4 -0
- package/dist/tools/knowledge.js +1 -0
- package/dist/tools/mcp.js +1 -1
- package/dist/tools/network.js +1 -1
- package/dist/tools/project.js +1 -1
- package/dist/tools/rollback.js +1 -1
- package/dist/tools/rules.js +1 -1
- package/dist/tools/system.js +1 -1
- package/dist/twilio/config.js +1 -1
- package/dist/twilio/index.js +1 -1
- package/dist/twilio/server.js +1 -1
- package/dist/twilio/setup.js +1 -1
- package/dist/ui/output.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/themes.js +1 -1
- package/dist/utils/api.d.ts +1 -1
- package/dist/utils/api.js +1 -1
- package/dist/utils/chat-history.js +1 -1
- package/dist/utils/history.js +1 -1
- package/dist/utils/mcp-installer.js +1 -1
- package/dist/utils/platform.js +1 -1
- package/dist/utils/storage.d.ts +3 -0
- package/dist/utils/storage.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/dist/utils/updater.js +1 -1
- package/dist/verify_repro.js +1 -1
- package/package.json +1 -1
package/dist/discord/client.js
CHANGED
|
@@ -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;}
|
package/dist/discord/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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)]();}
|
package/dist/discord/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
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';
|
package/dist/discord/setup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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));}
|
package/dist/email/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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));}
|
package/dist/email/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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();}
|
package/dist/email/service.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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';
|
package/dist/email/setup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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));}
|
package/dist/github/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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;}}
|
package/dist/github/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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(
|
|
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);}}
|
package/dist/github/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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
|
|
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);}}
|