woozlit 2.1.4 → 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/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a20_0x3a9bb2=a20_0x19bb;(function(_0x55c33f,_0xa2adff){const _0x20bafe=a20_0x19bb,_0x57914c=_0x55c33f();while(!![]){try{const _0x17505a=-parseInt(_0x20bafe(0x108))/0x1*(parseInt(_0x20bafe(0xa5))/0x2)+parseInt(_0x20bafe(0x97))/0x3+parseInt(_0x20bafe(0xed))/0x4*(-parseInt(_0x20bafe(0xb2))/0x5)+parseInt(_0x20bafe(0xe7))/0x6*(-parseInt(_0x20bafe(0xdc))/0x7)+parseInt(_0x20bafe(0xd3))/0x8+parseInt(_0x20bafe(0xf3))/0x9*(parseInt(_0x20bafe(0x8f))/0xa)+parseInt(_0x20bafe(0xa8))/0xb;if(_0x17505a===_0xa2adff)break;else _0x57914c['push'](_0x57914c['shift']());}catch(_0x64de0){_0x57914c['push'](_0x57914c['shift']());}}}(a20_0x3b74,0x8e97a));import{Command}from'commander';import a20_0x1ace54 from'chalk';import{login,logout,isLoggedIn}from'./auth/login.js';import{startChat}from'./chat/agent.js';import{selectModel,getSelectedModel}from'./ui/select.js';function a20_0x19bb(_0x34c0cb,_0x58e35a){_0x34c0cb=_0x34c0cb-0x81;const _0x3b7495=a20_0x3b74();let _0x19bb08=_0x3b7495[_0x34c0cb];return _0x19bb08;}import{listRules,addRule,clearRules}from'./tools/rules.js';import{getUser}from'./utils/storage.js';import{addMcpServer,addMcpHttpServer,removeMcpServer,clearMcpServers,getMcpServers,ensureDefaultServers,getConfigFilePath}from'./config/mcp.js';import{createFile,listDirectory}from'./tools/file.js';import*as a20_0x45c461 from'./ui/output.js';const VERSION=a20_0x3a9bb2(0x95),program=new Command();process[a20_0x3a9bb2(0xe6)]['NODE_TLS_REJECT_UNAUTHORIZED']='0',program['name'](a20_0x3a9bb2(0xf9))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0xf4))[a20_0x3a9bb2(0xf0)](VERSION)[a20_0x3a9bb2(0x116)](async()=>{const _0xdf196f=a20_0x3a9bb2;ensureDefaultServers();const {botManager:_0x47e619}=await import(_0xdf196f(0x117));await _0x47e619[_0xdf196f(0xb6)]();const {checkForUpdates:_0x1346d8}=await import(_0xdf196f(0x91));_0x1346d8(VERSION)['catch'](()=>{}),a20_0x45c461[_0xdf196f(0x90)](VERSION);if(!isLoggedIn()){a20_0x45c461[_0xdf196f(0xc1)](_0xdf196f(0x106)),a20_0x45c461[_0xdf196f(0xda)](''),a20_0x45c461[_0xdf196f(0xb3)]('Opening\x20browser\x20for\x20login...');const _0x59fd30=a20_0x45c461[_0xdf196f(0xd6)](_0xdf196f(0xb8));_0x59fd30[_0xdf196f(0x9a)]();const _0x4e70f9=await login();_0x59fd30[_0xdf196f(0xd7)]();if(!_0x4e70f9){a20_0x45c461['error'](_0xdf196f(0xe2));return;}const _0x190fa9=getUser();a20_0x45c461['success'](_0xdf196f(0xc7)+(_0x190fa9[_0xdf196f(0x8a)]||_0x190fa9[_0xdf196f(0xca)]));}await startChat();}),program['command'](a20_0x3a9bb2(0xa4))[a20_0x3a9bb2(0xd2)]('Login\x20with\x20your\x20Woozlit\x20account')['action'](async()=>{const _0x4ca4d9=a20_0x3a9bb2;if(isLoggedIn()){const _0x54b93f=getUser();a20_0x45c461[_0x4ca4d9(0xb3)](_0x4ca4d9(0x103)+_0x54b93f[_0x4ca4d9(0xca)]);return;}a20_0x45c461['info'](_0x4ca4d9(0x8b));const _0x3ad093=a20_0x45c461['createSpinner'](_0x4ca4d9(0xb8));_0x3ad093[_0x4ca4d9(0x9a)]();const _0xdd7344=await login();_0x3ad093[_0x4ca4d9(0xd7)]();if(_0xdd7344){const _0x4879c3=getUser();a20_0x45c461['success'](_0x4ca4d9(0xc7)+(_0x4879c3[_0x4ca4d9(0x8a)]||_0x4879c3[_0x4ca4d9(0xca)]));}else a20_0x45c461['error'](_0x4ca4d9(0xe2));}),program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xc9))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0xfd))[a20_0x3a9bb2(0x116)](()=>{const _0x5863b4=a20_0x3a9bb2;logout(),a20_0x45c461[_0x5863b4(0xcb)](_0x5863b4(0x104));}),program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xdf))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0x115))[a20_0x3a9bb2(0x116)](()=>{const _0x4f4346=a20_0x3a9bb2;if(!isLoggedIn()){a20_0x45c461[_0x4f4346(0xc1)](_0x4f4346(0x101));return;}const _0x22c9da=getUser();a20_0x45c461[_0x4f4346(0xf2)](_0x4f4346(0x10f)),a20_0x45c461[_0x4f4346(0xb3)]('Name:\x20'+(_0x22c9da[_0x4f4346(0x8a)]||'N/A')),a20_0x45c461['info'](_0x4f4346(0xd9)+(_0x22c9da[_0x4f4346(0xca)]||_0x4f4346(0xe5))),a20_0x45c461[_0x4f4346(0xb3)](_0x4f4346(0x10b)+getSelectedModel());}),program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x9d))[a20_0x3a9bb2(0xd2)]('Start\x20an\x20AI\x20chat\x20session')[a20_0x3a9bb2(0x116)](async _0xa83258=>{const _0x972fe6=a20_0x3a9bb2;a20_0x45c461[_0x972fe6(0x90)](VERSION);if(!isLoggedIn()){a20_0x45c461[_0x972fe6(0xc1)](_0x972fe6(0x106)),a20_0x45c461['dim'](''),a20_0x45c461[_0x972fe6(0xb3)](_0x972fe6(0x8b));const _0x5af0b7=a20_0x45c461[_0x972fe6(0xd6)](_0x972fe6(0xb8));_0x5af0b7[_0x972fe6(0x9a)]();const _0x108c7=await login();_0x5af0b7[_0x972fe6(0xd7)]();if(!_0x108c7){a20_0x45c461[_0x972fe6(0x93)](_0x972fe6(0xe2));return;}const _0x2d7533=getUser();a20_0x45c461[_0x972fe6(0xcb)](_0x972fe6(0xc7)+(_0x2d7533[_0x972fe6(0x8a)]||_0x2d7533[_0x972fe6(0xca)]));}await startChat(_0xa83258);}),program['command']('ask\x20<message>')[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0x9b))[a20_0x3a9bb2(0x116)](async _0x53e422=>{const _0x4adaac=a20_0x3a9bb2;a20_0x45c461[_0x4adaac(0x90)](VERSION);if(!isLoggedIn()){a20_0x45c461[_0x4adaac(0xc1)](_0x4adaac(0x106)),a20_0x45c461['dim'](''),a20_0x45c461[_0x4adaac(0xb3)](_0x4adaac(0x8b));const _0x3aa02d=a20_0x45c461[_0x4adaac(0xd6)](_0x4adaac(0xb8));_0x3aa02d[_0x4adaac(0x9a)]();const _0x2cabd2=await login();_0x3aa02d['stop']();if(!_0x2cabd2){a20_0x45c461['error'](_0x4adaac(0xe2));return;}const _0x229af6=getUser();a20_0x45c461['success'](_0x4adaac(0xc7)+(_0x229af6['displayName']||_0x229af6['email']));}await startChat(_0x53e422);});const configCmd=program[a20_0x3a9bb2(0xec)]('config')[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0xbf));function a20_0x3b74(){const _0x2df433=['Manage\x20Discord\x20integration','URL:\x20','Logout\x20from\x20your\x20Woozlit\x20account','Removed\x20MCP\x20server:\x20','services','Select\x20UI\x20theme\x20(alias\x20for\x20config\x20theme)','Not\x20logged\x20in.\x20Use\x20\x27woozlit\x20login\x27\x20to\x20authenticate.','init','Already\x20logged\x20in\x20as\x20','Logged\x20out\x20successfully','github\x20[subcmd]','You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.','\x0aUse\x20\x27woozlit\x20<service>\x20setup\x27\x20to\x20configure\x20services.','214261LmCUFZ','@inquirer/prompts','stdout','Model:\x20','Initialize\x20Woozlit\x20in\x20current\x20directory','setup','add\x20<rule>','Current\x20User','bold','theme','getStatus','Theme\x20set\x20to:\x20','Refresh\x20cancelled.','Show\x20current\x20user\x20info','action','./services/bot-manager.js','.woozlit','Please\x20restart\x20the\x20CLI.','Manage\x20Telegram\x20integration','Remove\x20all\x20MCP\x20servers','model','Select\x20AI\x20model','Show\x20status\x20of\x20background\x20services/bots','refresh','delete','telegram','displayName','Opening\x20browser\x20for\x20login...','parse','Configure\x20Discord\x20Bot\x20Token','All\x20data,\x20configs,\x20and\x20MCP\x20servers\x20have\x20been\x20wiped.','766320CrJVfT','showLogo','./utils/updater.js','No\x20rules\x20defined','error','delete-all','2.1.4','Remove\x20an\x20MCP\x20server','1807209mpwSSI','All\x20rules\x20cleared','gray','start','Ask\x20a\x20single\x20question','Manage\x20AI\x20behavior\x20rules','chat\x20[message]','remove\x20<name>','Configure\x20email\x20credentials','#\x20Project\x20Rules\x0a\x0aAdd\x20your\x20project-specific\x20rules\x20here.\x0a','reset','Select\x20UI\x20theme',':\x20[stdio]\x20','login','2OZhDrb','Operation\x20cancelled','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20ALL\x20MCP\x20servers?','1670724frQDwA','clean','Config\x20file:\x20','some','entries','List\x20all\x20MCP\x20servers','list','add\x20<name>\x20<command>\x20[args...]','streamable-http','length','665soAjpp','info','Created\x20.woozlit/rules.md\x20and\x20.woozlit/context.md','Stopped','startAllConfigured','./email/index.js','Waiting\x20for\x20authentication...','./ui/themes.js','./utils/storage.js','MCP\x20server\x20\x27','discord','configured','type','Configure\x20CLI\x20settings','Default\x20servers\x20will\x20be\x20restored\x20on\x20next\x20restart\x20unless\x20you\x20remove\x20them\x20again.','warn','yellow','keys','aliases','args','./github/index.js','Logged\x20in\x20as\x20','Model\x20set\x20to:\x20','logout','email','success','Manage\x20MCP\x20servers','You\x20can\x20also\x20update\x20manually\x20from\x20https://cli.woozlit.com','Running','No\x20MCP\x20servers\x20configured','url','name','description','1276216XYGISD','Background\x20Services','Added\x20rule:\x20','createSpinner','stop','join','Email:\x20','dim','Add\x20a\x20stdio\x20MCP\x20server','63819UaIJza','.woozlit/context.md','Update\x20Woozlit\x20CLI\x20to\x20the\x20latest\x20version','whoami','.woozlit/rules.md','running','Login\x20failed\x20or\x20timed\x20out','Rules','Added\x20HTTP\x20MCP\x20server:\x20','N/A','env','30drhScW','Not\x20Configured','add-http\x20<name>\x20<url>','Add\x20a\x20new\x20rule','All\x20MCP\x20servers\x20removed','command','6712JiMvqe','List\x20all\x20rules','./config/mcp.js','version','Are\x20you\x20sure\x20you\x20want\x20to\x20completely\x20WIPE\x20all\x20CLI\x20data,\x20rules,\x20and\x20configs?','header','18ataLBF','Woozlit\x20AI\x20-\x20Agentic\x20Coding\x20Assistant','MCP\x20Servers','remove-all','./discord/index.js','Initialized\x20Woozlit\x20in\x20current\x20directory','woozlit','#\x20Project\x20Context\x0a\x0aDescribe\x20your\x20project\x20here.\x0a'];a20_0x3b74=function(){return _0x2df433;};return a20_0x3b74();}configCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x84))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0x85))[a20_0x3a9bb2(0x116)](async()=>{const _0x358ef9=a20_0x3a9bb2,_0x27cefa=await selectModel();a20_0x45c461[_0x358ef9(0xcb)](_0x358ef9(0xc8)+_0x27cefa);}),configCmd[a20_0x3a9bb2(0xec)]('theme')['description'](a20_0x3a9bb2(0xa2))[a20_0x3a9bb2(0x116)](async()=>{const _0x4b202b=a20_0x3a9bb2,{selectTheme:_0xbea121}=await import(_0x4b202b(0xb9)),_0xa4c7b9=await _0xbea121();a20_0x45c461[_0x4b202b(0xcb)](_0x4b202b(0x113)+_0xa4c7b9);}),program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x111))['description'](a20_0x3a9bb2(0x100))[a20_0x3a9bb2(0x116)](async()=>{const _0x24832e=a20_0x3a9bb2,{selectTheme:_0xeb4002}=await import('./ui/themes.js'),_0x453b38=await _0xeb4002();a20_0x45c461['success'](_0x24832e(0x113)+_0x453b38);});const rulesCmd=program[a20_0x3a9bb2(0xec)]('rules')['description'](a20_0x3a9bb2(0x9c));rulesCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xae))['description'](a20_0x3a9bb2(0xee))[a20_0x3a9bb2(0x116)](()=>{const _0x4c874a=a20_0x3a9bb2,_0x134e6b=listRules();if(_0x134e6b[_0x4c874a(0xb1)]===0x0){a20_0x45c461[_0x4c874a(0xb3)](_0x4c874a(0x92));return;}a20_0x45c461[_0x4c874a(0xf2)](_0x4c874a(0xe3)),_0x134e6b['forEach']((_0x4a6b04,_0x2b8c38)=>{const _0x6a9bb2=_0x4c874a;process[_0x6a9bb2(0x10a)]['write'](_0x2b8c38+0x1+'.\x20'+_0x4a6b04+'\x0a');});}),rulesCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x10e))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0xea))[a20_0x3a9bb2(0x116)](_0x3163ff=>{const _0x59801a=a20_0x3a9bb2;addRule(_0x3163ff),a20_0x45c461['success'](_0x59801a(0xd5)+_0x3163ff);})['action'](()=>{const _0x3bc6c1=a20_0x3a9bb2;clearRules(),a20_0x45c461[_0x3bc6c1(0xcb)](_0x3bc6c1(0x98));});const mcpCmd=program['command']('mcp')[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0xcc));mcpCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xae))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0xad))[a20_0x3a9bb2(0x116)](()=>{const _0x4211a8=a20_0x3a9bb2,_0x5c1c13=getMcpServers(),_0x292ad2=Object[_0x4211a8(0xc3)](_0x5c1c13);if(_0x292ad2['length']===0x0){a20_0x45c461['info'](_0x4211a8(0xcf)),a20_0x45c461[_0x4211a8(0xda)](_0x4211a8(0xaa)+getConfigFilePath());return;}a20_0x45c461[_0x4211a8(0xf2)](_0x4211a8(0xf5)),_0x292ad2['forEach'](_0x12b146=>{const _0x589b52=_0x4211a8,_0x1f3791=_0x5c1c13[_0x12b146];_0x1f3791[_0x589b52(0xbe)]===_0x589b52(0xb0)?a20_0x45c461[_0x589b52(0xb3)]('-\x20'+_0x12b146+':\x20[HTTP]\x20'+_0x1f3791[_0x589b52(0xd0)]):a20_0x45c461['info']('-\x20'+_0x12b146+_0x589b52(0xa3)+_0x1f3791[_0x589b52(0xec)]+'\x20'+(_0x1f3791[_0x589b52(0xc5)]?.[_0x589b52(0xd8)]('\x20')||''));}),a20_0x45c461['dim']('\x0aConfig\x20file:\x20'+getConfigFilePath()),a20_0x45c461[_0x4211a8(0xda)]('You\x20can\x20also\x20add\x20servers\x20via\x20mcp.json\x20in\x20your\x20project\x20directory');}),mcpCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xaf))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0xdb))[a20_0x3a9bb2(0x116)]((_0x2ee64d,_0x51af1b,_0x4315ef)=>{const _0xb9d304=a20_0x3a9bb2;addMcpServer(_0x2ee64d,_0x51af1b,_0x4315ef),a20_0x45c461[_0xb9d304(0xcb)]('Added\x20stdio\x20MCP\x20server:\x20'+_0x2ee64d);}),mcpCmd['command'](a20_0x3a9bb2(0xe9))[a20_0x3a9bb2(0xd2)]('Add\x20an\x20HTTP\x20MCP\x20server\x20(streamable-http)')[a20_0x3a9bb2(0x116)]((_0x3362bc,_0x4c667c)=>{const _0x57478f=a20_0x3a9bb2;addMcpHttpServer(_0x3362bc,_0x4c667c),a20_0x45c461[_0x57478f(0xcb)](_0x57478f(0xe4)+_0x3362bc),a20_0x45c461[_0x57478f(0xda)](_0x57478f(0xfc)+_0x4c667c);}),mcpCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x9e))[a20_0x3a9bb2(0xc4)]([a20_0x3a9bb2(0x88),'rm'])[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0x96))[a20_0x3a9bb2(0x116)](_0xd70125=>{const _0x27a02c=a20_0x3a9bb2;removeMcpServer(_0xd70125)?a20_0x45c461['success'](_0x27a02c(0xfe)+_0xd70125):a20_0x45c461[_0x27a02c(0x93)](_0x27a02c(0xbb)+_0xd70125+'\x27\x20not\x20found');}),mcpCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xf6))[a20_0x3a9bb2(0xc4)]([a20_0x3a9bb2(0x94),'clear'])['description'](a20_0x3a9bb2(0x83))[a20_0x3a9bb2(0x116)](async()=>{const _0x30c885=a20_0x3a9bb2,{confirm:_0x20f367}=await import(_0x30c885(0x109)),{getTheme:_0x2f4af6}=await import(_0x30c885(0xba)),{getInquirerTheme:_0xc5449}=await import(_0x30c885(0xb9)),_0x135f96=await _0x20f367({'message':_0x30c885(0xa7),'default':![],'theme':_0xc5449(_0x2f4af6())});_0x135f96?(clearMcpServers(),a20_0x45c461['success'](_0x30c885(0xeb)),a20_0x45c461[_0x30c885(0xda)](_0x30c885(0xc0))):a20_0x45c461[_0x30c885(0xb3)](_0x30c885(0xa6));}),program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x87))['aliases']([a20_0x3a9bb2(0xa1),'wipe',a20_0x3a9bb2(0xa9)])[a20_0x3a9bb2(0xd2)]('Wipe\x20all\x20data,\x20rules,\x20settings,\x20and\x20MCP\x20configs')[a20_0x3a9bb2(0x116)](async()=>{const _0x55298c=a20_0x3a9bb2,{confirm:_0x54bc23}=await import(_0x55298c(0x109)),{getTheme:_0x55bb3c}=await import(_0x55298c(0xba)),{getInquirerTheme:_0xbdcf27}=await import(_0x55298c(0xb9)),_0x354123=_0x55bb3c(),_0xa8770f=_0xbdcf27(_0x354123),_0xda8d61=await _0x54bc23({'message':a20_0x1ace54[_0x55298c(0x110)](_0x55298c(0xf1)),'default':![],'theme':_0xa8770f});if(_0xda8d61){const {wipeAll:_0x3b936c}=await import(_0x55298c(0xba));_0x3b936c();try{const {clearMcpServers:_0x10698c}=await import(_0x55298c(0xef));_0x10698c();}catch(_0xb455e8){}a20_0x45c461[_0x55298c(0xcb)](_0x55298c(0x8e)),a20_0x45c461[_0x55298c(0xda)](_0x55298c(0x81));}else a20_0x45c461[_0x55298c(0xb3)](_0x55298c(0x114));}),program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x102))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0x10c))[a20_0x3a9bb2(0x116)](()=>{const _0xa1505e=a20_0x3a9bb2,_0x4e9024=listDirectory('.'),_0x18c709=_0x4e9024[_0xa1505e(0xac)]?.[_0xa1505e(0xab)](_0x5ad140=>_0x5ad140[_0xa1505e(0xd1)]===_0xa1505e(0x118));if(_0x18c709){a20_0x45c461[_0xa1505e(0xc1)]('Woozlit\x20already\x20initialized\x20in\x20this\x20directory');return;}createFile(_0xa1505e(0xe0),_0xa1505e(0xa0)),createFile(_0xa1505e(0xdd),_0xa1505e(0xfa)),a20_0x45c461['success'](_0xa1505e(0xf8)),a20_0x45c461[_0xa1505e(0xda)](_0xa1505e(0xb4));}),program['command'](a20_0x3a9bb2(0xff))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0x86))[a20_0x3a9bb2(0x116)](async()=>{const _0x395b5a=a20_0x3a9bb2,{botManager:_0xa77ccc}=await import(_0x395b5a(0x117)),_0x22c45b=_0xa77ccc[_0x395b5a(0x112)]();a20_0x45c461['header'](_0x395b5a(0xd4));if(_0x22c45b[_0x395b5a(0xb1)]===0x0){a20_0x45c461['info']('No\x20services\x20registered.');return;}_0x22c45b['forEach'](_0x4f6783=>{const _0x1ed3ee=_0x395b5a,_0x578167=_0x4f6783[_0x1ed3ee(0xe1)]?a20_0x1ace54['green'](_0x1ed3ee(0xce)):_0x4f6783[_0x1ed3ee(0xbd)]?a20_0x1ace54[_0x1ed3ee(0xc2)](_0x1ed3ee(0xb5)):a20_0x1ace54[_0x1ed3ee(0x99)](_0x1ed3ee(0xe8));a20_0x45c461[_0x1ed3ee(0xb3)]('-\x20'+_0x4f6783[_0x1ed3ee(0xd1)]+':\x20'+_0x578167);}),a20_0x45c461[_0x395b5a(0xda)](_0x395b5a(0x107));});const discordCmd=program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xbc))['description'](a20_0x3a9bb2(0xfb));discordCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x10d))['description'](a20_0x3a9bb2(0x8d))[a20_0x3a9bb2(0x116)](async()=>{const _0x54ae4e=a20_0x3a9bb2,{setupDiscord:_0x306a70}=await import(_0x54ae4e(0xf7));await _0x306a70();});const githubCmd=program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x105))[a20_0x3a9bb2(0xd2)]('Manage\x20GitHub\x20tool\x20integration')[a20_0x3a9bb2(0x116)](async _0x5f1434=>{const _0x2ce4e0=a20_0x3a9bb2,{handleGitHubCommand:_0x21444a}=await import(_0x2ce4e0(0xc6));await _0x21444a(_0x5f1434||'');}),telegramCmd=program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x89))['description'](a20_0x3a9bb2(0x82));telegramCmd['command'](a20_0x3a9bb2(0x10d))[a20_0x3a9bb2(0xd2)]('Configure\x20Telegram\x20Bot\x20Token')[a20_0x3a9bb2(0x116)](async()=>{const {setupTelegram:_0x117d4d}=await import('./telegram/index.js');await _0x117d4d();});const emailCmd=program[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0xca))[a20_0x3a9bb2(0xd2)]('Manage\x20Email\x20integration');emailCmd[a20_0x3a9bb2(0xec)](a20_0x3a9bb2(0x10d))[a20_0x3a9bb2(0xd2)](a20_0x3a9bb2(0x9f))[a20_0x3a9bb2(0x116)](async()=>{const _0x30dc1e=a20_0x3a9bb2,{setupEmail:_0xc3b7e0}=await import(_0x30dc1e(0xb7));await _0xc3b7e0();}),program[a20_0x3a9bb2(0xec)]('update')['description'](a20_0x3a9bb2(0xde))['action'](async()=>{const _0x44a7ba=a20_0x3a9bb2,{performUpdate:_0x32480b}=await import(_0x44a7ba(0x91)),_0x33bc6b=await _0x32480b();!_0x33bc6b&&a20_0x45c461[_0x44a7ba(0xda)](_0x44a7ba(0xcd));}),program[a20_0x3a9bb2(0x8c)]();
|
|
2
|
+
const a20_0x206a81=a20_0x4654;(function(_0x712bb0,_0x455d56){const _0x3a15a2=a20_0x4654,_0x1c75a2=_0x712bb0();while(!![]){try{const _0x5ad497=parseInt(_0x3a15a2(0x95))/0x1+-parseInt(_0x3a15a2(0xc0))/0x2*(parseInt(_0x3a15a2(0xe9))/0x3)+parseInt(_0x3a15a2(0xae))/0x4+-parseInt(_0x3a15a2(0x8e))/0x5*(-parseInt(_0x3a15a2(0x9b))/0x6)+-parseInt(_0x3a15a2(0xf5))/0x7*(parseInt(_0x3a15a2(0xb2))/0x8)+parseInt(_0x3a15a2(0xfa))/0x9*(parseInt(_0x3a15a2(0x8a))/0xa)+parseInt(_0x3a15a2(0xc7))/0xb*(parseInt(_0x3a15a2(0x98))/0xc);if(_0x5ad497===_0x455d56)break;else _0x1c75a2['push'](_0x1c75a2['shift']());}catch(_0x270d7d){_0x1c75a2['push'](_0x1c75a2['shift']());}}}(a20_0x24a7,0xa4976));import{Command}from'commander';import a20_0x285d48 from'chalk';function a20_0x4654(_0x36c6a3,_0x59f890){_0x36c6a3=_0x36c6a3-0x7a;const _0x24a7a2=a20_0x24a7();let _0x465442=_0x24a7a2[_0x36c6a3];return _0x465442;}import{login,logout,isLoggedIn}from'./auth/login.js';import{startChat}from'./chat/agent.js';import{selectModel,getSelectedModel}from'./ui/select.js';import{listRules,addRule,clearRules}from'./tools/rules.js';import{listKnowledge,addKnowledge,clearKnowledge}from'./tools/knowledge.js';import{getUser}from'./utils/storage.js';function a20_0x24a7(){const _0x42f516=['\x27\x20not\x20found','running','remove\x20<name>','Current\x20User','delete-all','aliases','Added\x20stdio\x20MCP\x20server:\x20','Woozlit\x20already\x20initialized\x20in\x20this\x20directory','startAllConfigured','Show\x20current\x20user\x20info','createSpinner','bold','Are\x20you\x20sure\x20you\x20want\x20to\x20completely\x20WIPE\x20all\x20CLI\x20data,\x20rules,\x20and\x20configs?','stdout','version','action','discord','Model:\x20','Select\x20UI\x20theme\x20(alias\x20for\x20config\x20theme)','Show\x20status\x20of\x20background\x20services/bots','No\x20services\x20registered.','refresh','All\x20MCP\x20servers\x20removed','theme','name','Login\x20with\x20your\x20Woozlit\x20account','./utils/updater.js','Added\x20HTTP\x20MCP\x20server:\x20','email','22330OxeiFp','command','List\x20all\x20rules','info','75fjfjXw','description','Initialize\x20Woozlit\x20in\x20current\x20directory','Login\x20failed\x20or\x20timed\x20out','Not\x20logged\x20in.\x20Use\x20\x27woozlit\x20login\x27\x20to\x20authenticate.','logout','N/A','224191lRaSBE','All\x20data,\x20configs,\x20and\x20MCP\x20servers\x20have\x20been\x20wiped.','join','12qjMoba','Manage\x20Telegram\x20integration','type','171438dzcjBG','keys','./services/bot-manager.js','./discord/index.js','forEach','Running','Manage\x20MCP\x20servers','Manage\x20AI\x20knowledge\x20presets','Already\x20logged\x20in\x20as\x20','List\x20all\x20MCP\x20servers','update','Remove\x20an\x20MCP\x20server','remove-all','length',':\x20[stdio]\x20','green','clean','configured','You\x20can\x20also\x20add\x20servers\x20via\x20mcp.json\x20in\x20your\x20project\x20directory','2831916xXXdvF','./github/index.js','All\x20rules\x20cleared','Rules','8jiLwRl','init','\x0aConfig\x20file:\x20','Knowledge\x20Presets','env','.woozlit/rules.md','Select\x20AI\x20model','showLogo','wipe','URL:\x20','list','some','displayName','Created\x20.woozlit/rules.md\x20and\x20.woozlit/context.md','2bVWPkr','Default\x20servers\x20will\x20be\x20restored\x20on\x20next\x20restart\x20unless\x20you\x20remove\x20them\x20again.','Initialized\x20Woozlit\x20in\x20current\x20directory','header','Update\x20Woozlit\x20CLI\x20to\x20the\x20latest\x20version','dim','Stopped','132121VvAzKZ','getStatus','No\x20knowledge\x20presets\x20defined','Please\x20restart\x20the\x20CLI.','parse','Add\x20a\x20stdio\x20MCP\x20server','Added\x20knowledge\x20preset:\x20','Name:\x20','Waiting\x20for\x20authentication...','knowledge','Add\x20a\x20new\x20knowledge\x20preset','Opening\x20browser\x20for\x20login...','Add\x20a\x20new\x20rule','Logout\x20from\x20your\x20Woozlit\x20account','clear','You\x20can\x20also\x20update\x20manually\x20from\x20https://cli.woozlit.com','List\x20all\x20knowledge\x20presets','catch','No\x20MCP\x20servers\x20configured','Woozlit\x20AI\x20-\x20Agentic\x20Coding\x20Assistant','MCP\x20server\x20\x27','Configure\x20email\x20credentials','./utils/storage.js','start','telegram','delete','stop','args','write','chat\x20[message]','Not\x20Configured','Remove\x20all\x20MCP\x20servers','services','ask\x20<message>','2225766RJaJfS','add\x20<rule>','.woozlit','Added\x20rule:\x20','success','github\x20[subcmd]','No\x20rules\x20defined','add\x20<name>\x20<command>\x20[args...]','Theme\x20set\x20to:\x20','rules','error','Email:\x20','8965999oasNag','./ui/themes.js','woozlit','Refresh\x20cancelled.','Manage\x20Email\x20integration','5337hNNlUM','Manage\x20AI\x20behavior\x20rules','Operation\x20cancelled','Config\x20file:\x20','setup','./email/index.js','add-http\x20<name>\x20<url>','Logged\x20in\x20as\x20','You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.','Logged\x20out\x20successfully','warn'];a20_0x24a7=function(){return _0x42f516;};return a20_0x24a7();}import{addMcpServer,addMcpHttpServer,removeMcpServer,clearMcpServers,getMcpServers,ensureDefaultServers,getConfigFilePath}from'./config/mcp.js';import{createFile,listDirectory}from'./tools/file.js';import*as a20_0x5e5bb0 from'./ui/output.js';const VERSION='2.2.0',program=new Command();process[a20_0x206a81(0xb6)]['NODE_TLS_REJECT_UNAUTHORIZED']='0',program[a20_0x206a81(0x85)](a20_0x206a81(0xf7))[a20_0x206a81(0x8f)](a20_0x206a81(0xda))[a20_0x206a81(0x7b)](VERSION)[a20_0x206a81(0x7c)](async()=>{const _0x37176e=a20_0x206a81;ensureDefaultServers();const {botManager:_0x3c84a7}=await import('./services/bot-manager.js');await _0x3c84a7[_0x37176e(0x10d)]();const {checkForUpdates:_0xedebd5}=await import(_0x37176e(0x87));_0xedebd5(VERSION)[_0x37176e(0xd8)](()=>{}),a20_0x5e5bb0[_0x37176e(0xb9)](VERSION);if(!isLoggedIn()){a20_0x5e5bb0[_0x37176e(0x104)](_0x37176e(0x102)),a20_0x5e5bb0[_0x37176e(0xc5)](''),a20_0x5e5bb0['info'](_0x37176e(0xd2));const _0x5d6564=a20_0x5e5bb0[_0x37176e(0x10f)](_0x37176e(0xcf));_0x5d6564['start']();const _0x5609d3=await login();_0x5d6564[_0x37176e(0xe1)]();if(!_0x5609d3){a20_0x5e5bb0['error'](_0x37176e(0x91));return;}const _0x5f5db4=getUser();a20_0x5e5bb0[_0x37176e(0xed)]('Logged\x20in\x20as\x20'+(_0x5f5db4[_0x37176e(0xbe)]||_0x5f5db4[_0x37176e(0x89)]));}await startChat();}),program[a20_0x206a81(0x8b)]('login')[a20_0x206a81(0x8f)](a20_0x206a81(0x86))[a20_0x206a81(0x7c)](async()=>{const _0x1aff73=a20_0x206a81;if(isLoggedIn()){const _0xd2902c=getUser();a20_0x5e5bb0[_0x1aff73(0x8d)](_0x1aff73(0xa3)+_0xd2902c[_0x1aff73(0x89)]);return;}a20_0x5e5bb0[_0x1aff73(0x8d)](_0x1aff73(0xd2));const _0x1e75e5=a20_0x5e5bb0[_0x1aff73(0x10f)](_0x1aff73(0xcf));_0x1e75e5[_0x1aff73(0xde)]();const _0x131202=await login();_0x1e75e5[_0x1aff73(0xe1)]();if(_0x131202){const _0x12042e=getUser();a20_0x5e5bb0['success']('Logged\x20in\x20as\x20'+(_0x12042e[_0x1aff73(0xbe)]||_0x12042e[_0x1aff73(0x89)]));}else a20_0x5e5bb0['error'](_0x1aff73(0x91));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0x93))[a20_0x206a81(0x8f)](a20_0x206a81(0xd4))['action'](()=>{const _0x25570c=a20_0x206a81;logout(),a20_0x5e5bb0[_0x25570c(0xed)](_0x25570c(0x103));}),program[a20_0x206a81(0x8b)]('whoami')['description'](a20_0x206a81(0x10e))['action'](()=>{const _0x1997b2=a20_0x206a81;if(!isLoggedIn()){a20_0x5e5bb0[_0x1997b2(0x104)](_0x1997b2(0x92));return;}const _0x42d635=getUser();a20_0x5e5bb0[_0x1997b2(0xc3)](_0x1997b2(0x108)),a20_0x5e5bb0[_0x1997b2(0x8d)](_0x1997b2(0xce)+(_0x42d635[_0x1997b2(0xbe)]||'N/A')),a20_0x5e5bb0[_0x1997b2(0x8d)](_0x1997b2(0xf4)+(_0x42d635[_0x1997b2(0x89)]||_0x1997b2(0x94))),a20_0x5e5bb0[_0x1997b2(0x8d)](_0x1997b2(0x7e)+getSelectedModel());}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xe4))[a20_0x206a81(0x8f)]('Start\x20an\x20AI\x20chat\x20session')[a20_0x206a81(0x7c)](async _0x55bdcc=>{const _0x401ee4=a20_0x206a81;a20_0x5e5bb0[_0x401ee4(0xb9)](VERSION);if(!isLoggedIn()){a20_0x5e5bb0[_0x401ee4(0x104)](_0x401ee4(0x102)),a20_0x5e5bb0[_0x401ee4(0xc5)](''),a20_0x5e5bb0[_0x401ee4(0x8d)](_0x401ee4(0xd2));const _0x282f96=a20_0x5e5bb0[_0x401ee4(0x10f)]('Waiting\x20for\x20authentication...');_0x282f96[_0x401ee4(0xde)]();const _0x4f0eed=await login();_0x282f96[_0x401ee4(0xe1)]();if(!_0x4f0eed){a20_0x5e5bb0[_0x401ee4(0xf3)](_0x401ee4(0x91));return;}const _0x5d90dc=getUser();a20_0x5e5bb0[_0x401ee4(0xed)]('Logged\x20in\x20as\x20'+(_0x5d90dc[_0x401ee4(0xbe)]||_0x5d90dc[_0x401ee4(0x89)]));}await startChat(_0x55bdcc);}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xe8))[a20_0x206a81(0x8f)]('Ask\x20a\x20single\x20question')[a20_0x206a81(0x7c)](async _0x2a3496=>{const _0x5204ee=a20_0x206a81;a20_0x5e5bb0['showLogo'](VERSION);if(!isLoggedIn()){a20_0x5e5bb0['warn'](_0x5204ee(0x102)),a20_0x5e5bb0[_0x5204ee(0xc5)](''),a20_0x5e5bb0['info'](_0x5204ee(0xd2));const _0x33abf7=a20_0x5e5bb0[_0x5204ee(0x10f)](_0x5204ee(0xcf));_0x33abf7[_0x5204ee(0xde)]();const _0xb0b640=await login();_0x33abf7[_0x5204ee(0xe1)]();if(!_0xb0b640){a20_0x5e5bb0['error'](_0x5204ee(0x91));return;}const _0x30ebe4=getUser();a20_0x5e5bb0[_0x5204ee(0xed)](_0x5204ee(0x101)+(_0x30ebe4[_0x5204ee(0xbe)]||_0x30ebe4[_0x5204ee(0x89)]));}await startChat(_0x2a3496);});const configCmd=program[a20_0x206a81(0x8b)]('config')[a20_0x206a81(0x8f)]('Configure\x20CLI\x20settings');configCmd[a20_0x206a81(0x8b)]('model')[a20_0x206a81(0x8f)](a20_0x206a81(0xb8))['action'](async()=>{const _0x32eaab=a20_0x206a81,_0x2559d0=await selectModel();a20_0x5e5bb0[_0x32eaab(0xed)]('Model\x20set\x20to:\x20'+_0x2559d0);}),configCmd['command'](a20_0x206a81(0x84))[a20_0x206a81(0x8f)]('Select\x20UI\x20theme')[a20_0x206a81(0x7c)](async()=>{const _0x5cb413=a20_0x206a81,{selectTheme:_0x3c85fe}=await import(_0x5cb413(0xf6)),_0x539d28=await _0x3c85fe();a20_0x5e5bb0['success'](_0x5cb413(0xf1)+_0x539d28);}),program[a20_0x206a81(0x8b)](a20_0x206a81(0x84))[a20_0x206a81(0x8f)](a20_0x206a81(0x7f))[a20_0x206a81(0x7c)](async()=>{const _0x56ab68=a20_0x206a81,{selectTheme:_0x5ea87e}=await import(_0x56ab68(0xf6)),_0x553596=await _0x5ea87e();a20_0x5e5bb0[_0x56ab68(0xed)](_0x56ab68(0xf1)+_0x553596);});const rulesCmd=program[a20_0x206a81(0x8b)](a20_0x206a81(0xf2))['description'](a20_0x206a81(0xfb));rulesCmd['command'](a20_0x206a81(0xbc))['description'](a20_0x206a81(0x8c))[a20_0x206a81(0x7c)](()=>{const _0x2b9049=a20_0x206a81,_0x324a3e=listRules();if(_0x324a3e[_0x2b9049(0xa8)]===0x0){a20_0x5e5bb0['info'](_0x2b9049(0xef));return;}a20_0x5e5bb0[_0x2b9049(0xc3)](_0x2b9049(0xb1)),_0x324a3e[_0x2b9049(0x9f)]((_0x3eb18c,_0x5900dd)=>{const _0x1257cf=_0x2b9049;process[_0x1257cf(0x7a)][_0x1257cf(0xe3)](_0x5900dd+0x1+'.\x20'+_0x3eb18c+'\x0a');});}),rulesCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xea))[a20_0x206a81(0x8f)](a20_0x206a81(0xd3))['action'](_0x29a159=>{const _0x3cfea0=a20_0x206a81;addRule(_0x29a159),a20_0x5e5bb0[_0x3cfea0(0xed)](_0x3cfea0(0xec)+_0x29a159);})[a20_0x206a81(0x7c)](()=>{const _0x25a880=a20_0x206a81;clearRules(),a20_0x5e5bb0[_0x25a880(0xed)](_0x25a880(0xb0));});const knowledgeCmd=program[a20_0x206a81(0x8b)](a20_0x206a81(0xd0))[a20_0x206a81(0x8f)](a20_0x206a81(0xa2));knowledgeCmd['command'](a20_0x206a81(0xbc))['description'](a20_0x206a81(0xd7))[a20_0x206a81(0x7c)](()=>{const _0xe8b8f=a20_0x206a81,_0xebf3fd=listKnowledge();if(_0xebf3fd[_0xe8b8f(0xa8)]===0x0){a20_0x5e5bb0[_0xe8b8f(0x8d)](_0xe8b8f(0xc9));return;}a20_0x5e5bb0[_0xe8b8f(0xc3)](_0xe8b8f(0xb5)),_0xebf3fd['forEach']((_0x3377ae,_0x5069b7)=>{const _0x967e5e=_0xe8b8f;process[_0x967e5e(0x7a)]['write'](_0x5069b7+0x1+'.\x20'+_0x3377ae+'\x0a');});}),knowledgeCmd[a20_0x206a81(0x8b)]('add\x20<preset>')[a20_0x206a81(0x8f)](a20_0x206a81(0xd1))[a20_0x206a81(0x7c)](_0x1a91e4=>{const _0x2baf81=a20_0x206a81;addKnowledge(_0x1a91e4),a20_0x5e5bb0[_0x2baf81(0xed)](_0x2baf81(0xcd)+_0x1a91e4);}),knowledgeCmd['command'](a20_0x206a81(0xd5))[a20_0x206a81(0x8f)]('Clear\x20all\x20knowledge\x20presets')['action'](()=>{const _0x5e7d89=a20_0x206a81;clearKnowledge(),a20_0x5e5bb0[_0x5e7d89(0xed)]('All\x20knowledge\x20presets\x20cleared');});const mcpCmd=program['command']('mcp')[a20_0x206a81(0x8f)](a20_0x206a81(0xa1));mcpCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xbc))[a20_0x206a81(0x8f)](a20_0x206a81(0xa4))[a20_0x206a81(0x7c)](()=>{const _0x48d45b=a20_0x206a81,_0x22abcf=getMcpServers(),_0x26a3ba=Object[_0x48d45b(0x9c)](_0x22abcf);if(_0x26a3ba['length']===0x0){a20_0x5e5bb0['info'](_0x48d45b(0xd9)),a20_0x5e5bb0[_0x48d45b(0xc5)](_0x48d45b(0xfd)+getConfigFilePath());return;}a20_0x5e5bb0[_0x48d45b(0xc3)]('MCP\x20Servers'),_0x26a3ba[_0x48d45b(0x9f)](_0x3592b3=>{const _0x224087=_0x48d45b,_0x36bd8a=_0x22abcf[_0x3592b3];_0x36bd8a[_0x224087(0x9a)]==='streamable-http'?a20_0x5e5bb0[_0x224087(0x8d)]('-\x20'+_0x3592b3+':\x20[HTTP]\x20'+_0x36bd8a['url']):a20_0x5e5bb0[_0x224087(0x8d)]('-\x20'+_0x3592b3+_0x224087(0xa9)+_0x36bd8a[_0x224087(0x8b)]+'\x20'+(_0x36bd8a[_0x224087(0xe2)]?.[_0x224087(0x97)]('\x20')||''));}),a20_0x5e5bb0[_0x48d45b(0xc5)](_0x48d45b(0xb4)+getConfigFilePath()),a20_0x5e5bb0[_0x48d45b(0xc5)](_0x48d45b(0xad));}),mcpCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xf0))['description'](a20_0x206a81(0xcc))[a20_0x206a81(0x7c)]((_0x3e9ba7,_0x44cd0f,_0x7ae946)=>{const _0x5202ad=a20_0x206a81;addMcpServer(_0x3e9ba7,_0x44cd0f,_0x7ae946),a20_0x5e5bb0[_0x5202ad(0xed)](_0x5202ad(0x10b)+_0x3e9ba7);}),mcpCmd[a20_0x206a81(0x8b)](a20_0x206a81(0x100))[a20_0x206a81(0x8f)]('Add\x20an\x20HTTP\x20MCP\x20server\x20(streamable-http)')[a20_0x206a81(0x7c)]((_0x10739f,_0x42bb68)=>{const _0x58abd0=a20_0x206a81;addMcpHttpServer(_0x10739f,_0x42bb68),a20_0x5e5bb0['success'](_0x58abd0(0x88)+_0x10739f),a20_0x5e5bb0[_0x58abd0(0xc5)](_0x58abd0(0xbb)+_0x42bb68);}),mcpCmd['command'](a20_0x206a81(0x107))[a20_0x206a81(0x10a)]([a20_0x206a81(0xe0),'rm'])['description'](a20_0x206a81(0xa6))[a20_0x206a81(0x7c)](_0x28a142=>{const _0x50e41c=a20_0x206a81;removeMcpServer(_0x28a142)?a20_0x5e5bb0[_0x50e41c(0xed)]('Removed\x20MCP\x20server:\x20'+_0x28a142):a20_0x5e5bb0['error'](_0x50e41c(0xdb)+_0x28a142+_0x50e41c(0x105));}),mcpCmd['command'](a20_0x206a81(0xa7))['aliases']([a20_0x206a81(0x109),a20_0x206a81(0xd5)])[a20_0x206a81(0x8f)](a20_0x206a81(0xe6))['action'](async()=>{const _0x3be57d=a20_0x206a81,{confirm:_0x5e3829}=await import('@inquirer/prompts'),{getTheme:_0x1ceee3}=await import(_0x3be57d(0xdd)),{getInquirerTheme:_0x410b6a}=await import(_0x3be57d(0xf6)),_0x240a8d=await _0x5e3829({'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20ALL\x20MCP\x20servers?','default':![],'theme':_0x410b6a(_0x1ceee3())});_0x240a8d?(clearMcpServers(),a20_0x5e5bb0[_0x3be57d(0xed)](_0x3be57d(0x83)),a20_0x5e5bb0[_0x3be57d(0xc5)](_0x3be57d(0xc1))):a20_0x5e5bb0[_0x3be57d(0x8d)](_0x3be57d(0xfc));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0x82))[a20_0x206a81(0x10a)](['reset',a20_0x206a81(0xba),a20_0x206a81(0xab)])[a20_0x206a81(0x8f)]('Wipe\x20all\x20data,\x20rules,\x20settings,\x20and\x20MCP\x20configs')[a20_0x206a81(0x7c)](async()=>{const _0x1c7766=a20_0x206a81,{confirm:_0x2fa8fb}=await import('@inquirer/prompts'),{getTheme:_0x53e42b}=await import('./utils/storage.js'),{getInquirerTheme:_0x47355c}=await import(_0x1c7766(0xf6)),_0x82ef4a=_0x53e42b(),_0x173765=_0x47355c(_0x82ef4a),_0x1d1906=await _0x2fa8fb({'message':a20_0x285d48[_0x1c7766(0x110)](_0x1c7766(0x111)),'default':![],'theme':_0x173765});if(_0x1d1906){const {wipeAll:_0x52de7e}=await import(_0x1c7766(0xdd));_0x52de7e();try{const {clearMcpServers:_0x312422}=await import('./config/mcp.js');_0x312422();}catch(_0x19a618){}a20_0x5e5bb0[_0x1c7766(0xed)](_0x1c7766(0x96)),a20_0x5e5bb0[_0x1c7766(0xc5)](_0x1c7766(0xca));}else a20_0x5e5bb0[_0x1c7766(0x8d)](_0x1c7766(0xf8));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xb3))['description'](a20_0x206a81(0x90))['action'](()=>{const _0x2a9de8=a20_0x206a81,_0x394fd5=listDirectory('.'),_0x2d4880=_0x394fd5['entries']?.[_0x2a9de8(0xbd)](_0xe9194e=>_0xe9194e[_0x2a9de8(0x85)]===_0x2a9de8(0xeb));if(_0x2d4880){a20_0x5e5bb0[_0x2a9de8(0x104)](_0x2a9de8(0x10c));return;}createFile(_0x2a9de8(0xb7),'#\x20Project\x20Rules\x0a\x0aAdd\x20your\x20project-specific\x20rules\x20here.\x0a'),createFile('.woozlit/context.md','#\x20Project\x20Context\x0a\x0aDescribe\x20your\x20project\x20here.\x0a'),a20_0x5e5bb0[_0x2a9de8(0xed)](_0x2a9de8(0xc2)),a20_0x5e5bb0[_0x2a9de8(0xc5)](_0x2a9de8(0xbf));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xe7))['description'](a20_0x206a81(0x80))[a20_0x206a81(0x7c)](async()=>{const _0x4df6f6=a20_0x206a81,{botManager:_0x482654}=await import(_0x4df6f6(0x9d)),_0x313493=_0x482654[_0x4df6f6(0xc8)]();a20_0x5e5bb0[_0x4df6f6(0xc3)]('Background\x20Services');if(_0x313493[_0x4df6f6(0xa8)]===0x0){a20_0x5e5bb0[_0x4df6f6(0x8d)](_0x4df6f6(0x81));return;}_0x313493[_0x4df6f6(0x9f)](_0x2985e5=>{const _0x440ea1=_0x4df6f6,_0x10b7a5=_0x2985e5[_0x440ea1(0x106)]?a20_0x285d48[_0x440ea1(0xaa)](_0x440ea1(0xa0)):_0x2985e5[_0x440ea1(0xac)]?a20_0x285d48['yellow'](_0x440ea1(0xc6)):a20_0x285d48['gray'](_0x440ea1(0xe5));a20_0x5e5bb0['info']('-\x20'+_0x2985e5[_0x440ea1(0x85)]+':\x20'+_0x10b7a5);}),a20_0x5e5bb0['dim']('\x0aUse\x20\x27woozlit\x20<service>\x20setup\x27\x20to\x20configure\x20services.');});const discordCmd=program['command'](a20_0x206a81(0x7d))['description']('Manage\x20Discord\x20integration');discordCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xfe))[a20_0x206a81(0x8f)]('Configure\x20Discord\x20Bot\x20Token')[a20_0x206a81(0x7c)](async()=>{const _0x1f87e7=a20_0x206a81,{setupDiscord:_0x23cdd7}=await import(_0x1f87e7(0x9e));await _0x23cdd7();});const githubCmd=program[a20_0x206a81(0x8b)](a20_0x206a81(0xee))['description']('Manage\x20GitHub\x20tool\x20integration')[a20_0x206a81(0x7c)](async _0x24f187=>{const _0x2d3e38=a20_0x206a81,{handleGitHubCommand:_0x657ff9}=await import(_0x2d3e38(0xaf));await _0x657ff9(_0x24f187||'');}),telegramCmd=program['command'](a20_0x206a81(0xdf))['description'](a20_0x206a81(0x99));telegramCmd['command'](a20_0x206a81(0xfe))['description']('Configure\x20Telegram\x20Bot\x20Token')[a20_0x206a81(0x7c)](async()=>{const {setupTelegram:_0x243352}=await import('./telegram/index.js');await _0x243352();});const emailCmd=program['command'](a20_0x206a81(0x89))[a20_0x206a81(0x8f)](a20_0x206a81(0xf9));emailCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xfe))[a20_0x206a81(0x8f)](a20_0x206a81(0xdc))[a20_0x206a81(0x7c)](async()=>{const _0x320500=a20_0x206a81,{setupEmail:_0x4093c8}=await import(_0x320500(0xff));await _0x4093c8();}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xa5))['description'](a20_0x206a81(0xc4))[a20_0x206a81(0x7c)](async()=>{const _0x43b333=a20_0x206a81,{performUpdate:_0x4eb21d}=await import(_0x43b333(0x87)),_0xa8e51e=await _0x4eb21d();!_0xa8e51e&&a20_0x5e5bb0[_0x43b333(0xc5)](_0x43b333(0xd6));}),program[a20_0x206a81(0xcb)]();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x3d7268=a21_0x447d;(function(_0x4a9833,_0x2f034c){const _0x293790=a21_0x447d,_0x5a7da4=_0x4a9833();while(!![]){try{const _0x43047f=parseInt(_0x293790(0xc3))/0x1+-parseInt(_0x293790(0xc6))/0x2+parseInt(_0x293790(0xa0))/0x3*(parseInt(_0x293790(0x9b))/0x4)+parseInt(_0x293790(0xd5))/0x5+parseInt(_0x293790(0xac))/0x6+parseInt(_0x293790(0x9a))/0x7+-parseInt(_0x293790(0xae))/0x8;if(_0x43047f===_0x2f034c)break;else _0x5a7da4['push'](_0x5a7da4['shift']());}catch(_0x3ab861){_0x5a7da4['push'](_0x5a7da4['shift']());}}}(a21_0x4e96,0x8e2b6));import{Server}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema}from'@modelcontextprotocol/sdk/types.js';import{Jimp}from'jimp';import{createRequire}from'module';const require=createRequire(import.meta.url);let robot;function a21_0x4e96(){const _0x4942eb=['computer-use','computer_type','Click\x20the\x20mouse\x20button.','width','computer_screenshot','@hurdlegroup/robotjs','Y\x20coordinate','Screen\x20size:\x20','text','Move\x20the\x20mouse\x20cursor\x20to\x20specific\x20coordinates.','3675480WkZtLT','object','17302272XTMHnF','number','Screenshot\x20taken.','Moved\x20mouse\x20to\x20','length','right','string','getBuffer','getScreenSize','keyTap','command','middle','Type\x20a\x20string\x20of\x20text.','computer_mouse_move','height','left','computer_screen_size','mouseClick','capture','data','X\x20coordinate','1052148tAqSfg','image','Take\x20a\x20screenshot\x20of\x20the\x20primary\x20display.\x20Returns\x20base64\x20encoded\x20image.','169834IsAQiC','join','moveMouse','Unknown\x20tool:\x20','Error:\x20','image/jpeg','with\x20','computer_mouse_click','Tap\x20a\x20single\x20key\x20with\x20optional\x20modifiers.','Tapped\x20key:\x20','bitmap','Clicked\x20','alt','computer_key_tap','params','1913495rEvmXn','3418114xaphmg','31816VDsYVV','resize','boolean','connect','\x20button','111JUwGcY','\x20(double)'];a21_0x4e96=function(){return _0x4942eb;};return a21_0x4e96();}try{robot=require(a21_0x3d7268(0xa7));}catch(a21_0x36deb6){}function a21_0x447d(_0x115aee,_0x38ecb2){_0x115aee=_0x115aee-0x9a;const _0x4e964a=a21_0x4e96();let _0x447d3c=_0x4e964a[_0x115aee];return _0x447d3c;}const AUTO=-0x1,MIME_JPEG=a21_0x3d7268(0xcb),server=new Server({'name':a21_0x3d7268(0xa2),'version':'1.0.0'},{'capabilities':{'tools':{}}});server['setRequestHandler'](ListToolsRequestSchema,async()=>{const _0x53f815=a21_0x3d7268;return{'tools':[{'name':'computer_screenshot','description':_0x53f815(0xc5),'inputSchema':{'type':_0x53f815(0xad),'properties':{}}},{'name':'computer_mouse_move','description':_0x53f815(0xab),'inputSchema':{'type':_0x53f815(0xad),'properties':{'x':{'type':_0x53f815(0xaf),'description':_0x53f815(0xc2)},'y':{'type':_0x53f815(0xaf),'description':_0x53f815(0xa8)}},'required':['x','y']}},{'name':_0x53f815(0xcd),'description':_0x53f815(0xa4),'inputSchema':{'type':_0x53f815(0xad),'properties':{'button':{'type':_0x53f815(0xb4),'enum':['left',_0x53f815(0xb3),_0x53f815(0xb9)],'default':_0x53f815(0xbd)},'double':{'type':_0x53f815(0x9d),'default':![]}}}},{'name':_0x53f815(0xa3),'description':_0x53f815(0xba),'inputSchema':{'type':_0x53f815(0xad),'properties':{'text':{'type':_0x53f815(0xb4),'description':'Text\x20to\x20type'}},'required':[_0x53f815(0xaa)]}},{'name':_0x53f815(0xd3),'description':_0x53f815(0xce),'inputSchema':{'type':_0x53f815(0xad),'properties':{'key':{'type':_0x53f815(0xb4),'description':'Key\x20to\x20tap\x20(e.g.\x20\x27enter\x27,\x20\x27a\x27,\x20\x27backspace\x27)'},'modifiers':{'type':'array','items':{'type':_0x53f815(0xb4),'enum':[_0x53f815(0xd2),_0x53f815(0xb8),'control','shift']},'description':'Modifier\x20keys'}},'required':['key']}},{'name':_0x53f815(0xbe),'description':'Get\x20the\x20screen\x20resolution.','inputSchema':{'type':'object','properties':{}}}]};}),server['setRequestHandler'](CallToolRequestSchema,async _0x28043f=>{const _0x53c214=a21_0x3d7268,{name:_0x3f8efd,arguments:_0x435a6d}=_0x28043f[_0x53c214(0xd4)];try{if(_0x3f8efd===_0x53c214(0xa6)){const _0x256a9d=robot[_0x53c214(0xb6)](),_0xa3f2cb=robot['screen'][_0x53c214(0xc0)](0x0,0x0,_0x256a9d[_0x53c214(0xa5)],_0x256a9d[_0x53c214(0xbc)]),_0x28d49c=new Jimp({'width':_0xa3f2cb[_0x53c214(0xa5)],'height':_0xa3f2cb['height']});for(let _0x3c7e1e=0x0;_0x3c7e1e<_0xa3f2cb[_0x53c214(0xc4)][_0x53c214(0xb2)];_0x3c7e1e+=0x4){_0x28d49c[_0x53c214(0xd0)][_0x53c214(0xc1)][_0x3c7e1e]=_0xa3f2cb[_0x53c214(0xc4)][_0x3c7e1e+0x2],_0x28d49c['bitmap'][_0x53c214(0xc1)][_0x3c7e1e+0x1]=_0xa3f2cb[_0x53c214(0xc4)][_0x3c7e1e+0x1],_0x28d49c[_0x53c214(0xd0)][_0x53c214(0xc1)][_0x3c7e1e+0x2]=_0xa3f2cb['image'][_0x3c7e1e],_0x28d49c[_0x53c214(0xd0)][_0x53c214(0xc1)][_0x3c7e1e+0x3]=_0xa3f2cb[_0x53c214(0xc4)][_0x3c7e1e+0x3];}_0x28d49c[_0x53c214(0xd0)][_0x53c214(0xa5)]>0x400&&_0x28d49c[_0x53c214(0x9c)]({'w':0x400});const _0x73daca=await _0x28d49c[_0x53c214(0xb5)](MIME_JPEG),_0x16a4bf=_0x73daca['toString']('base64');return{'content':[{'type':'text','text':_0x53c214(0xb0)},{'type':'image','data':_0x16a4bf,'mimeType':_0x53c214(0xcb)}]};}if(_0x3f8efd===_0x53c214(0xbb)){const {x:_0x4a84c4,y:_0x537796}=_0x435a6d;return robot[_0x53c214(0xc8)](_0x4a84c4,_0x537796),{'content':[{'type':_0x53c214(0xaa),'text':_0x53c214(0xb1)+_0x4a84c4+',\x20'+_0x537796}]};}if(_0x3f8efd===_0x53c214(0xcd)){const {button:button='left',double:double=![]}=_0x435a6d;return robot[_0x53c214(0xbf)](button,double),{'content':[{'type':'text','text':_0x53c214(0xd1)+button+_0x53c214(0x9f)+(double?_0x53c214(0xa1):'')}]};}if(_0x3f8efd==='computer_type'){const {text:_0x2a5c0d}=_0x435a6d;return robot['typeString'](_0x2a5c0d),{'content':[{'type':_0x53c214(0xaa),'text':'Typed:\x20\x22'+_0x2a5c0d+'\x22'}]};}if(_0x3f8efd===_0x53c214(0xd3)){const {key:_0x314def,modifiers:_0xcd0c15}=_0x435a6d;return robot[_0x53c214(0xb7)](_0x314def,_0xcd0c15),{'content':[{'type':'text','text':_0x53c214(0xcf)+_0x314def+'\x20'+(_0xcd0c15?_0x53c214(0xcc)+_0xcd0c15[_0x53c214(0xc7)]('+'):'')}]};}if(_0x3f8efd===_0x53c214(0xbe)){const _0x1b70ee=robot[_0x53c214(0xb6)]();return{'content':[{'type':_0x53c214(0xaa),'text':_0x53c214(0xa9)+_0x1b70ee[_0x53c214(0xa5)]+'x'+_0x1b70ee[_0x53c214(0xbc)]}]};}throw new Error(_0x53c214(0xc9)+_0x3f8efd);}catch(_0x4fc3a7){return{'content':[{'type':_0x53c214(0xaa),'text':_0x53c214(0xca)+_0x4fc3a7}],'isError':!![]};}});const transport=new StdioServerTransport();await server[a21_0x3d7268(0x9e)](transport);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x5ee292=a22_0x4d5f;(function(_0x2adfcd,_0x26e369){const _0x51397c=a22_0x4d5f,_0x43973b=_0x2adfcd();while(!![]){try{const _0x50c35d=-parseInt(_0x51397c(0x79))/0x1*(-parseInt(_0x51397c(0x87))/0x2)+-parseInt(_0x51397c(0x8a))/0x3+parseInt(_0x51397c(0x80))/0x4*(parseInt(_0x51397c(0x81))/0x5)+-parseInt(_0x51397c(0x6d))/0x6+-parseInt(_0x51397c(0x78))/0x7*(-parseInt(_0x51397c(0x77))/0x8)+parseInt(_0x51397c(0x85))/0x9*(-parseInt(_0x51397c(0x7c))/0xa)+-parseInt(_0x51397c(0x86))/0xb*(-parseInt(_0x51397c(0x70))/0xc);if(_0x50c35d===_0x26e369)break;else _0x43973b['push'](_0x43973b['shift']());}catch(_0xf43177){_0x43973b['push'](_0x43973b['shift']());}}}(a22_0x82e6,0x19831));import*as a22_0x299005 from'../telegram/index.js';function a22_0x4d5f(_0x4fe65b,_0x56b58a){_0x4fe65b=_0x4fe65b-0x6b;const _0x82e61f=a22_0x82e6();let _0x4d5fcd=_0x82e61f[_0x4fe65b];return _0x4d5fcd;}import*as a22_0x5c7500 from'../discord/index.js';import*as a22_0x25ac97 from'../email/index.js';import*as a22_0x3b8a64 from'../ui/output.js';class BotManager{[a22_0x5ee292(0x6f)]=[];constructor(){const _0x537190=a22_0x5ee292;this[_0x537190(0x6f)]['push']({'name':_0x537190(0x7a),'start':a22_0x299005[_0x537190(0x71)],'stop':a22_0x299005[_0x537190(0x75)],'isRunning':a22_0x299005[_0x537190(0x76)],'isConfigured':a22_0x299005['isConfigured']}),this[_0x537190(0x6f)][_0x537190(0x82)]({'name':_0x537190(0x7e),'start':a22_0x5c7500['startBot'],'stop':a22_0x5c7500[_0x537190(0x75)],'isRunning':a22_0x5c7500[_0x537190(0x76)],'isConfigured':a22_0x5c7500[_0x537190(0x7f)]}),this[_0x537190(0x6f)][_0x537190(0x82)]({'name':_0x537190(0x6e),'start':a22_0x25ac97[_0x537190(0x71)],'stop':a22_0x25ac97[_0x537190(0x75)],'isRunning':a22_0x25ac97[_0x537190(0x76)],'isConfigured':a22_0x25ac97[_0x537190(0x7f)]});}async[a22_0x5ee292(0x72)](){const _0x588c5c=a22_0x5ee292,_0x364159=this['services'][_0x588c5c(0x8b)](_0x3be626=>_0x3be626['isConfigured']());if(_0x364159[_0x588c5c(0x88)]===0x0)return;a22_0x3b8a64[_0x588c5c(0x6c)](_0x588c5c(0x84));const _0x12ea75=await Promise[_0x588c5c(0x89)](_0x364159[_0x588c5c(0x73)](async _0x2f562f=>{const _0x263314=_0x588c5c;try{if(_0x2f562f['isRunning']())return!![];const _0x5c148f=await _0x2f562f['start']();return _0x5c148f;}catch(_0x349876){return a22_0x3b8a64['error'](_0x263314(0x7b)+_0x2f562f[_0x263314(0x6b)]+':\x20'+_0x349876),![];}})),_0x263c73=_0x12ea75[_0x588c5c(0x8b)](_0x5d825a=>_0x5d825a)[_0x588c5c(0x88)];_0x263c73>0x0&&a22_0x3b8a64['success']('[Bot\x20Manager]\x20'+_0x263c73+'/'+_0x364159[_0x588c5c(0x88)]+'\x20services\x20active\x20in\x20background');}['stopAll'](){const _0x372b94=a22_0x5ee292;this[_0x372b94(0x6f)][_0x372b94(0x7d)](_0x3623a1=>{_0x3623a1['isRunning']()&&_0x3623a1['stop']();});}[a22_0x5ee292(0x83)](){const _0x5dfde6=a22_0x5ee292;return this['services'][_0x5dfde6(0x73)](_0x572194=>({'name':_0x572194[_0x5dfde6(0x6b)],'running':_0x572194[_0x5dfde6(0x74)](),'configured':_0x572194[_0x5dfde6(0x7f)]()}));}}export const botManager=new BotManager();function a22_0x82e6(){const _0x382945=['443272PxFJwz','21AGHuCJ','381yXmrQu','Telegram','Failed\x20to\x20start\x20','10mihizj','forEach','Discord','isConfigured','73016BjNaiE','5HPYJkt','push','getStatus','\x0a[Bot\x20Manager]\x20Starting\x20background\x20services...','123381aQbzkT','1201321iXYxCS','176MILRmE','length','all','431892gQpxmh','filter','name','dim','390300WtlShO','Email','services','12DjgKdU','startBot','startAllConfigured','map','isRunning','stopBot','isBotRunning'];a22_0x82e6=function(){return _0x382945;};return a22_0x82e6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4801eb,_0x7efb2e){const _0x5729c8=a23_0x3cd9,_0x15ffec=_0x4801eb();while(!![]){try{const _0x3702e4=-parseInt(_0x5729c8(0x106))/0x1*(parseInt(_0x5729c8(0x112))/0x2)+-parseInt(_0x5729c8(0x10e))/0x3*(parseInt(_0x5729c8(0x104))/0x4)+-parseInt(_0x5729c8(0x110))/0x5*(parseInt(_0x5729c8(0x111))/0x6)+parseInt(_0x5729c8(0x10b))/0x7*(-parseInt(_0x5729c8(0x101))/0x8)+parseInt(_0x5729c8(0xfe))/0x9*(parseInt(_0x5729c8(0x10f))/0xa)+parseInt(_0x5729c8(0x109))/0xb+parseInt(_0x5729c8(0x100))/0xc;if(_0x3702e4===_0x7efb2e)break;else _0x15ffec['push'](_0x15ffec['shift']());}catch(_0x6b458e){_0x15ffec['push'](_0x15ffec['shift']());}}}(a23_0x2048,0xf4235));function a23_0x2048(){const _0x475645=['Task\x20Complete\x0a\x0a','map','5501949ZDYrTk','110qukBib','28105SrXtkj','798Txozhq','4MWtCZx','send','length','type','join','122841WwfxGR','sendMessage','49071636OVMbHF','8TSoHYy','api','\x0a\x0aActions:\x0a','4pyFSTr','cache','574691frZYaO','size','filter','13621036zBRQeb','channels','5227397DtjROh'];a23_0x2048=function(){return _0x475645;};return a23_0x2048();}const targets=[];let telegramBot=null,discordClient=null,telegramChatIds=[];export function registerTelegramBot(_0x12fc41,_0x4d4e16){telegramBot=_0x12fc41,telegramChatIds=_0x4d4e16;}export function registerDiscordClient(_0x40a014){discordClient=_0x40a014;}export async function notifyTaskComplete(_0x46b14d,_0xa5b08){const _0x303421=a23_0x3cd9,_0xd4cf49=_0x303421(0x10c)+_0x46b14d+_0x303421(0x103)+_0xa5b08[_0x303421(0x10d)](_0x375632=>'-\x20'+_0x375632)[_0x303421(0xfd)]('\x0a');if(telegramBot&&telegramChatIds[_0x303421(0xfb)]>0x0)for(const _0x4933f8 of telegramChatIds){try{await telegramBot[_0x303421(0x102)][_0x303421(0xff)](_0x4933f8,_0xd4cf49);}catch{}}if(discordClient)try{const _0x36bfb5=discordClient[_0x303421(0x10a)]?.[_0x303421(0x105)]?.[_0x303421(0x108)](_0x254ea3=>_0x254ea3[_0x303421(0xfc)]===0x1);if(_0x36bfb5?.[_0x303421(0x107)]>0x0){const _0x8f8aed=_0x36bfb5['first']();await _0x8f8aed?.[_0x303421(0xfa)](_0xd4cf49);}}catch{}}function a23_0x3cd9(_0x280866,_0x5bc19b){_0x280866=_0x280866-0xfa;const _0x2048a7=a23_0x2048();let _0x3cd931=_0x2048a7[_0x280866];return _0x3cd931;}export async function notifyMessage(_0x38d6d6){const _0xc892ea=a23_0x3cd9;if(telegramBot&&telegramChatIds['length']>0x0)for(const _0x4230ff of telegramChatIds){try{await telegramBot[_0xc892ea(0x102)][_0xc892ea(0xff)](_0x4230ff,_0x38d6d6);}catch{}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x316fb2,_0x160fa9){const _0x541b90=a24_0x5ae7,_0x5bcf6c=_0x316fb2();while(!![]){try{const _0x2765f7=parseInt(_0x541b90(0x1c6))/0x1+parseInt(_0x541b90(0x1b9))/0x2*(-parseInt(_0x541b90(0x1c8))/0x3)+parseInt(_0x541b90(0x1bd))/0x4+parseInt(_0x541b90(0x1c2))/0x5+parseInt(_0x541b90(0x1ca))/0x6*(-parseInt(_0x541b90(0x1bb))/0x7)+parseInt(_0x541b90(0x1c4))/0x8+-parseInt(_0x541b90(0x1c5))/0x9*(-parseInt(_0x541b90(0x1c3))/0xa);if(_0x2765f7===_0x160fa9)break;else _0x5bcf6c['push'](_0x5bcf6c['shift']());}catch(_0x3fc973){_0x5bcf6c['push'](_0x5bcf6c['shift']());}}}(a24_0x380f,0x2b219));import{GoogleGenerativeAI}from'@google/generative-ai';import{promises as a24_0x151484}from'fs';import*as a24_0x5149d0 from'../ui/output.js';import a24_0x2530c6 from'conf';const config=new a24_0x2530c6({'projectName':'woozlit-cli-voice'});function a24_0x5ae7(_0x669832,_0x2e236c){_0x669832=_0x669832-0x1b5;const _0x380f6c=a24_0x380f();let _0x5ae79b=_0x380f6c[_0x669832];return _0x5ae79b;}export function setGeminiKey(_0x2fa277){const _0x3ae98d=a24_0x5ae7;config[_0x3ae98d(0x1c7)](_0x3ae98d(0x1b8),_0x2fa277);}function a24_0x380f(){const _0x451b85=['get','message','response','gemini-2.0-flash-exp','error','geminiKey','768zGKQtT','readFile','14eleXBp','getGenerativeModel','389736URsGlW','audio/ogg','Gemini\x20API\x20Key\x20not\x20configured.\x20Run\x20\x27/voice\x20setup\x27\x20first.','text','Voice\x20processing\x20failed:\x20','170600dYJOoZ','2226710ASukpV','364064Rvppww','9mcZRdF','38294mqebLq','set','1920rlYRHp','Listen\x20to\x20this\x20audio\x20and\x20respond\x20helpfully.\x20If\x20it\x27s\x20a\x20command,\x20execute\x20it\x20or\x20say\x20you\x20can\x27t.','46806WkkxHx'];a24_0x380f=function(){return _0x451b85;};return a24_0x380f();}export function getGeminiKey(){const _0x10c123=a24_0x5ae7;return config[_0x10c123(0x1cb)](_0x10c123(0x1b8))||'';}export async function processVoiceMessage(_0x3cc8fe){const _0x538e86=a24_0x5ae7,_0x2e905a=getGeminiKey();if(!_0x2e905a)throw new Error(_0x538e86(0x1bf));const _0x4a9aed=new GoogleGenerativeAI(_0x2e905a),_0x55bf78=_0x4a9aed[_0x538e86(0x1bc)]({'model':_0x538e86(0x1b6)});try{const _0x1ad1c2=await a24_0x151484[_0x538e86(0x1ba)](_0x3cc8fe),_0x2ca948=_0x1ad1c2['toString']('base64'),_0x274709=_0x538e86(0x1be),_0x1c1b9d=await _0x55bf78['generateContent']([_0x538e86(0x1c9),{'inlineData':{'mimeType':_0x274709,'data':_0x2ca948}}]),_0xd91261=_0x1c1b9d[_0x538e86(0x1b5)][_0x538e86(0x1c0)]();return{'text':_0xd91261};}catch(_0x491eb2){a24_0x5149d0[_0x538e86(0x1b7)](_0x538e86(0x1c1)+_0x491eb2[_0x538e86(0x1cc)]);throw _0x491eb2;}}
|
package/dist/telegram/bot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x927568=a25_0x2889;(function(_0x4ead2b,_0x4b6120){const _0x34c1ff=a25_0x2889,_0x209054=_0x4ead2b();while(!![]){try{const _0x23c710=parseInt(_0x34c1ff(0xf0))/0x1*(parseInt(_0x34c1ff(0x154))/0x2)+-parseInt(_0x34c1ff(0xfa))/0x3*(-parseInt(_0x34c1ff(0x133))/0x4)+-parseInt(_0x34c1ff(0x10a))/0x5*(parseInt(_0x34c1ff(0x18d))/0x6)+-parseInt(_0x34c1ff(0xcd))/0x7*(parseInt(_0x34c1ff(0x14b))/0x8)+parseInt(_0x34c1ff(0xe5))/0x9*(parseInt(_0x34c1ff(0xc5))/0xa)+-parseInt(_0x34c1ff(0xf8))/0xb*(-parseInt(_0x34c1ff(0x18c))/0xc)+parseInt(_0x34c1ff(0x164))/0xd*(-parseInt(_0x34c1ff(0x185))/0xe);if(_0x23c710===_0x4b6120)break;else _0x209054['push'](_0x209054['shift']());}catch(_0x3e9706){_0x209054['push'](_0x209054['shift']());}}}(a25_0x7379,0x8f663));import{Bot,InputFile}from'grammy';import{promises as a25_0x24c506}from'fs';import{tmpdir}from'os';import{join,resolve,basename}from'path';import*as a25_0x46cb62 from'./config.js';import{checkReminders,scheduleReminder}from'./reminders.js';import{sendChatMessage}from'../utils/api.js';import{getSelectedModel}from'../utils/storage.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess,deleteFile,renameFile,copyFile,fileInfo,readFileLines}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile as a25_0x4505ca}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{registerTelegramBot}from'../services/notifications.js';function a25_0x7379(){const _0x1285d7=['Voice\x20error:\x20','package.json','git_status','1528461VAKKAA','dim','type','repo','/project','path','replyWithPhoto','Desktop','actionSummary','env','Cleared','2LPUxkD','unzip_files','editMessageText','search','401','find_files','Bot\x20start\x20failed:\x20','screenshot','10307xNQwCq','system','6jXsNRr','set','Tool\x20result\x20for\x20','head','Error','../tools/file.js','message:voice','.woozlit','grep_recursive','pnpm\x20init','first_name','PIN\x20required','getAllowedChatIds','output','cwd','Editing\x20file:\x20','13220nqWaCO','github_read_file','clipboard_read','/run\x20','includes','Invalid\x20bot\x20token.','files','[Telegram]\x20','read_file','base64','info','delayMinutes','getScreenSize','bitmap','extensions','Changed\x20to:\x20','api','screen','capture','tree','/cd\x20','delete','\x0aProcesses:\x20','../github/api.js','message_id','split','unknown','document','TOOL\x20JSON:\x20','image','/newchat','parse','script','robotjs\x20not\x20available\x20to\x20capture\x20photo','match','[Telegram]\x20Iteration\x20','\x0a\x0aCommands:\x0a/newchat\x20-\x20New\x20session\x0a/clear\x20-\x20Reset\x20history\x0a/status\x20-\x20System\x20info\x0a/screen\x20-\x20Screenshot\x0a/run\x20<cmd>\x20-\x20Execute\x20command\x0a/files\x20[path]\x20-\x20Browse\x20files\x0a/project\x20-\x20Project\x20overview\x0a/cd\x20<path>\x20-\x20Change\x20directory\x0a/kill\x20-\x20Stop\x20process','USERPROFILE','/files','replace','\x0aModel:\x20','1295732WHciWl','success','.ogg','/screen','copy_file','file_path','pids','Unknown\x20tool:\x20','[D]','branchName','New\x20chat\x20session\x20started.\x20How\x20can\x20I\x20help?','git_commit','Dir:\x20','pattern','branch','Stopped\x20(max\x20steps)','from','error','.jpeg','voice','github_create_pr','Screenshot\x20failed:\x20','pid','edit_file','104iBsVSv','screenshot_','\x20bytes)\x20saved\x20to\x20','start','/start','sendMessage','values','Failed:\x20','Telegram\x20bot\x20started!','990694qoWJNu','join','get','sendDocument','owner','Voice\x20processing\x20error:\x20','substring','~30s','send_input','rename_file','sendPhoto','trim','/screenshot','~2s','message','fromBranch','2784652Tqfsoc','~1s','You\x20are\x20Woozlit\x20AI.\x20Complete\x20tasks\x20autonomously.\x0a\x0aCRITICAL\x20RULES:\x0a1.\x20**EXECUTE\x20IMMEDIATELY**:\x20When\x20user\x20requests\x20an\x20action,\x20execute\x20the\x20tool\x20FIRST,\x20explain\x20NEVER.\x0a2.\x20**NO\x20EMOJIS**:\x20Never\x20use\x20emojis\x20in\x20any\x20response.\x0a3.\x20**NO\x20CONVERSATIONAL\x20ERRORS**:\x20If\x20a\x20browser\x20command\x20cannot\x20be\x20executed,\x20just\x20execute\x20it\x20anyway.\x20Never\x20explain\x20limitations.\x0a4.\x20**CONCISE**:\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x20No\x20filler.\x0a5.\x20**TOOL\x20FORMAT**:\x20Use\x20THREE\x20backticks\x20(```)\x20NOT\x20asterisks\x20(***)\x20for\x20tool\x20blocks.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait\x20(ms,\x20default\x2030000),\x20background\x20(bool)}\x0a-\x20read_terminal:\x20{}\x20-\x20check\x20running\x20process\x20output\x0a-\x20send_input:\x20{input}\x20-\x20answer\x20prompts\x0a-\x20terminate:\x20{}\x20-\x20kill\x20stuck\x20process\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-\x20screenshot:\x20{}\x20-\x20capture\x20desktop\x0a-\x20send_file:\x20{path}\x20-\x20send\x20a\x20file\x20to\x20the\x20user\x20via\x20Telegram\x0a-\x20schedule_reminder:\x20{delayMinutes:\x20number,\x20message:\x20string}\x0a-\x20git_status:\x20{}\x0a-\x20git_diff:\x20{path?}\x0a-\x20git_log:\x20{count?}\x0a-\x20git_add:\x20{path}\x0a-\x20git_commit:\x20{message}\x0a-\x20git_branch:\x20{}\x0a-\x20fetch_url:\x20{url}\x0a-\x20download_file:\x20{url,\x20path}\x0a-\x20get_env:\x20{name}\x0a-\x20set_env:\x20{name,\x20value}\x0a-\x20get_system_info:\x20{}\x0a-\x20clipboard_read:\x20{}\x0a-\x20clipboard_write:\x20{text}\x0a-\x20tree:\x20{path?,\x20depth?}\x0a-\x20grep_recursive:\x20{path?,\x20pattern,\x20extensions?}\x0a-\x20replace_in_files:\x20{path?,\x20search,\x20replace,\x20extensions?}\x0a-\x20powershell_run:\x20{script}\x0a-\x20zip_files:\x20{files,\x20output}\x0a-\x20unzip_files:\x20{path,\x20output}\x0a-\x20write_json:\x20{path,\x20data}\x0a-\x20read_json:\x20{path}\x0a-\x20patch_file:\x20{path,\x20patches:\x20[{search,\x20replace}]}\x0a-\x20open_in_editor:\x20{path}\x0a-\x20github_read_file:\x20{owner,\x20repo,\x20path,\x20branch}\x0a-\x20github_create_branch:\x20{owner,\x20repo,\x20branchName,\x20fromBranch}\x0a-\x20github_create_pr:\x20{owner,\x20repo,\x20title,\x20head,\x20base,\x20body}\x0a-\x20browser_open:\x20{url}\x0a-\x20browser_click:\x20{selector}\x0a-\x20browser_fill:\x20{selector,\x20value}\x0a-\x20browser_screenshot:\x20{}\x0a-\x20browser_snapshot:\x20{}\x0a\x0aBROWSER\x20COMMANDS\x20-\x20EXECUTE\x20IMMEDIATELY:\x0aWhen\x20user\x20says\x20\x22open\x20[site]\x22,\x20\x22go\x20to\x20[url]\x22,\x20\x22navigate\x20to\x20[url]\x22:\x0a```tool\x0a{\x22name\x22:\x22browser_open\x22,\x22args\x22:{\x22url\x22:\x22https://example.com\x22}}\x0a```\x0a\x0aDO\x20NOT\x20respond\x20with:\x0a-\x20\x22I\x20understand\x20you\x27d\x20like\x20me\x20to...\x22\x0a-\x20\x22I\x20need\x20the\x20extension\x20to\x20be\x20connected...\x22\x0a-\x20\x22Apologies\x20for\x20the\x20inconvenience\x22\x0a-\x20Any\x20explanation\x20about\x20what\x20you\x27re\x20about\x20to\x20do\x0a\x0aJUST\x20EXECUTE\x20THE\x20TOOL.\x0a\x0aEXAMPLE:\x0aUser:\x20\x22open\x20discord\x22\x0aYou:\x0a```tool\x0a{\x22name\x22:\x22browser_open\x22,\x22args\x22:{\x22url\x22:\x22https://discord.com\x22}}\x0a```','reply','getBotToken','Sorry,\x20I\x20couldn\x27t\x20understand\x20that\x20audio.','command','Verified','zip_files','\x0a\x0aTask\x20Summary:\x0a','terminate','file_id','readFile','build','delete_file','content','clear','map','entries','add','depth','get_env','read_json','\x0aProject:\x20','[Telegram]\x20Starting\x20tool\x20','has','file_name','pnpm\x20install','fetch_url','getFile','filter','read_file_lines','args','140COiLkK','Done\x20in\x20','startsWith','run_command','patch_file','replyWithChatAction','end','7428CuxtyR','222LcbVNJ','schedule_reminder','~1\x20min','\x20User\x20says:\x20','url','Woozlit\x20Remote\x20v2.1.4\x0a\x0aConnected:\x20','[F]','browser_click','user','npm\x20install','sendChatAction',':\x0a\x0a','slice','now','git\x20clone','[File\x20received:\x20','https://api.telegram.org/file/bot','read_terminal','git_log','...','width','catch','No\x20Telegram\x20bot\x20token.\x20Run\x20/telegram\x20setup\x20first.','browser_snapshot','Clean','directory','create_file','File\x20save\x20failed:\x20','~1-2\x20min','chat','height','addAllowedChatId','isAllowedChatId','count','file_info','\x20(Voice):\x20','Telegram\x20bot\x20already\x20running.','push','writeFile','set_env','selector','stringify','then','title','arrayBuffer','text','60krPWYL','git_branch','/kill','caption','replace_in_files','send_file','version','../browser/index.js','220934fdsLzg','exitCode','Taking\x20screenshot...','browser_close','mkdir','list_directory','length','Usage:\x20/run\x20<command>','size','\x20bytes)','data','unlink','resize','assistant','/clear','Browser\x20Screenshot','typing','git_diff','write_json','name','[Voice\x20Message]:\x20'];a25_0x7379=function(){return _0x1285d7;};return a25_0x7379();}import{processVoiceMessage}from'../services/voice-agent.js';import*as a25_0x9fd998 from'../ui/output.js';import{createRequire}from'module';import{Jimp}from'jimp';const require=createRequire(import.meta.url);let bot=null,isRunning=![];function a25_0x2889(_0x58522d,_0x5e4600){_0x58522d=_0x58522d-0xbb;const _0x7379f1=a25_0x7379();let _0x288921=_0x7379f1[_0x58522d];return _0x288921;}const verifiedSessions=new Set(),statusMessages=new Map(),chatHistories=new Map(),WOOZLIT_DIR=join(process[a25_0x927568(0xee)][a25_0x927568(0x12f)]||process['env']['HOME']||'.',a25_0x927568(0x101)),HISTORY_FILE=join(WOOZLIT_DIR,'history.json');async function ensureWoozlitDir(){const _0x21e95c=a25_0x927568;try{await a25_0x24c506[_0x21e95c(0xd1)](WOOZLIT_DIR,{'recursive':!![]});}catch{}}async function getTaskHistory(){const _0xcb673c=a25_0x927568;try{const _0x5abc19=await a25_0x24c506[_0xcb673c(0x170)](HISTORY_FILE,'utf-8');return JSON[_0xcb673c(0x129)](_0x5abc19);}catch{return[];}}async function saveTaskHistory(_0x154256,_0x64983d){const _0x1aa80c=a25_0x927568;await ensureWoozlitDir();const _0x3e1345=await getTaskHistory();_0x3e1345[_0x1aa80c(0xbc)]({'timestamp':Date[_0x1aa80c(0x19a)](),'request':_0x154256,'actionSummary':_0x64983d});if(_0x3e1345[_0x1aa80c(0xd3)]>0x14)_0x3e1345['shift']();await a25_0x24c506[_0x1aa80c(0xbd)](HISTORY_FILE,JSON['stringify'](_0x3e1345,null,0x2));}function formatHistoryForPrompt(_0x52411a){const _0x36f996=a25_0x927568;if(_0x52411a[_0x36f996(0xd3)]===0x0)return'';return'\x0a\x0aRECENT\x20TASK\x20HISTORY\x20(Use\x20this\x20context):\x0a'+_0x52411a[_0x36f996(0x199)](-0x5)[_0x36f996(0x175)](_0x4dccb9=>'-\x20Request:\x20\x22'+_0x4dccb9['request']+'\x22\x0a\x20\x20Actions:\x20'+_0x4dccb9[_0x36f996(0xed)][_0x36f996(0x155)](',\x20'))['join']('\x0a');}function getSystemPrompt(_0x1716e8){const _0x202f1e=a25_0x927568;return _0x202f1e(0x166)+_0x1716e8;}async function getOrCreateHistory(_0x23cf8d){const _0x293c11=a25_0x927568;if(!chatHistories[_0x293c11(0x17d)](_0x23cf8d)){const _0x1e679a='';chatHistories['set'](_0x23cf8d,[{'role':_0x293c11(0xf9),'content':getSystemPrompt(_0x1e679a)}]);}return chatHistories[_0x293c11(0x156)](_0x23cf8d);}async function updateStatus(_0x49412c,_0x3255b8){const _0x3976d3=a25_0x927568;if(!bot)return;const _0x5e6705=statusMessages[_0x3976d3(0x156)](_0x49412c);if(_0x5e6705)try{await bot[_0x3976d3(0x11a)][_0x3976d3(0xf2)](_0x49412c,_0x5e6705,_0x3255b8);return;}catch(_0x4682af){if(_0x4682af[_0x3976d3(0x162)]&&_0x4682af[_0x3976d3(0x162)][_0x3976d3(0x10e)]('message\x20is\x20not\x20modified'))return;statusMessages[_0x3976d3(0x11f)](_0x49412c);}try{const _0x276be7=await bot[_0x3976d3(0x11a)][_0x3976d3(0x150)](_0x49412c,_0x3255b8);statusMessages[_0x3976d3(0xfb)](_0x49412c,_0x276be7[_0x3976d3(0x122)]);}catch(_0x5cde15){}}async function takeScreenshot(){const _0x40a278=a25_0x927568,_0x2d454e=_0x40a278(0x14c)+Date['now']()+_0x40a278(0x145),_0x49b8a1=join(tmpdir(),_0x2d454e);let _0x270a11;try{_0x270a11=require('@hurdlegroup/robotjs');const _0x813fd0=_0x270a11[_0x40a278(0x116)](),_0x1cb5e2=_0x270a11[_0x40a278(0x11b)][_0x40a278(0x11c)](0x0,0x0,_0x813fd0['width'],_0x813fd0[_0x40a278(0x1ab)]),_0xc29bc3=new Jimp({'width':_0x1cb5e2[_0x40a278(0x1a1)],'height':_0x1cb5e2[_0x40a278(0x1ab)]});for(let _0x469b55=0x0;_0x469b55<_0x1cb5e2[_0x40a278(0x127)][_0x40a278(0xd3)];_0x469b55+=0x4){_0xc29bc3[_0x40a278(0x117)][_0x40a278(0xd7)][_0x469b55]=_0x1cb5e2[_0x40a278(0x127)][_0x469b55+0x2],_0xc29bc3['bitmap'][_0x40a278(0xd7)][_0x469b55+0x1]=_0x1cb5e2[_0x40a278(0x127)][_0x469b55+0x1],_0xc29bc3[_0x40a278(0x117)][_0x40a278(0xd7)][_0x469b55+0x2]=_0x1cb5e2['image'][_0x469b55],_0xc29bc3[_0x40a278(0x117)][_0x40a278(0xd7)][_0x469b55+0x3]=_0x1cb5e2[_0x40a278(0x127)][_0x469b55+0x3];}_0xc29bc3['bitmap']['width']>0x500&&_0xc29bc3[_0x40a278(0xd9)]({'w':0x500});const _0x314e94=await _0xc29bc3['getBuffer']('image/jpeg');await a25_0x24c506[_0x40a278(0xbd)](_0x49b8a1,_0x314e94);}catch(_0x437a1c){throw new Error(_0x40a278(0x12b));}return _0x49b8a1;}async function executeToolCall(_0x171711,_0x34699b,_0x33dd73){const _0x5a3be4=a25_0x927568;switch(_0x171711){case _0x5a3be4(0xf7):try{statusMessages['delete'](_0x33dd73);const _0x53fae9=await takeScreenshot();return await bot?.['api'][_0x5a3be4(0x15e)](_0x33dd73,new InputFile(_0x53fae9),{'caption':'Desktop'}),await a25_0x24c506[_0x5a3be4(0xd8)](_0x53fae9)[_0x5a3be4(0x1a2)](()=>{}),{'success':!![],'sent':!![]};}catch(_0x4cb8ef){return{'error':_0x5a3be4(0x148)+_0x4cb8ef};}case _0x5a3be4(0x19e):return readTerminalOutput(_0x34699b[_0x5a3be4(0x149)]);case _0x5a3be4(0x15c):return sendTerminalInput(_0x34699b['input'],_0x34699b[_0x5a3be4(0x149)]);case'terminate':return terminateProcess(_0x34699b[_0x5a3be4(0x149)]);case'create_file':return createFile(_0x34699b['path'],_0x34699b[_0x5a3be4(0x173)]);case _0x5a3be4(0x112):return readFile(_0x34699b[_0x5a3be4(0xea)]);case _0x5a3be4(0xd2):return listDirectory(_0x34699b[_0x5a3be4(0xea)]||'.');case _0x5a3be4(0x14a):return editFile(_0x34699b[_0x5a3be4(0xea)],_0x34699b[_0x5a3be4(0xf3)],_0x34699b[_0x5a3be4(0x131)]);case'search_file':return searchFile(_0x34699b[_0x5a3be4(0xea)],_0x34699b[_0x5a3be4(0x140)]);case'run_command':const {command:_0xc252a5,background:_0x374e87,wait:_0x228608}=_0x34699b,_0x4ac897=await runCommand(_0xc252a5,undefined,_0x374e87||![],_0x228608||0x7530);return _0x4ac897;case _0x5a3be4(0x18e):return scheduleReminder(_0x33dd73,_0x34699b[_0x5a3be4(0x115)],_0x34699b[_0x5a3be4(0x162)]);case _0x5a3be4(0x10b):{const {readFile:_0x58051b}=await import(_0x5a3be4(0x121));return _0x58051b(_0x34699b[_0x5a3be4(0x158)],_0x34699b['repo'],_0x34699b[_0x5a3be4(0xea)],_0x34699b[_0x5a3be4(0x141)]);}case'github_create_branch':{const {createBranch:_0x1275e5}=await import(_0x5a3be4(0x121));return _0x1275e5(_0x34699b[_0x5a3be4(0x158)],_0x34699b[_0x5a3be4(0xe8)],_0x34699b[_0x5a3be4(0x13c)],_0x34699b[_0x5a3be4(0x163)]);}case _0x5a3be4(0x147):{const {createPullRequest:_0x2604c8}=await import(_0x5a3be4(0x121));return _0x2604c8(_0x34699b[_0x5a3be4(0x158)],_0x34699b['repo'],_0x34699b[_0x5a3be4(0xc2)],_0x34699b[_0x5a3be4(0xfd)],_0x34699b['base'],_0x34699b['body']);}case'browser_open':{const {browserOpen:_0xe05329,startBrowserServer:_0x19dca1,isBrowserServerRunning:_0x1dadc8}=await import(_0x5a3be4(0xcc));return!_0x1dadc8()&&await _0x19dca1(),_0xe05329(_0x34699b[_0x5a3be4(0x191)]);}case _0x5a3be4(0x194):{const {browserClick:_0x4bf580}=await import(_0x5a3be4(0xcc));return _0x4bf580(_0x34699b[_0x5a3be4(0xbf)]);}case'browser_fill':{const {browserFill:_0x4655a0}=await import(_0x5a3be4(0xcc));return _0x4655a0(_0x34699b[_0x5a3be4(0xbf)],_0x34699b['value']);}case _0x5a3be4(0x1a4):{const {browserSnapshot:_0x5d43e5}=await import(_0x5a3be4(0xcc));return _0x5d43e5();}case'browser_screenshot':{const {browserScreenshot:_0x1eb6bc}=await import(_0x5a3be4(0xcc)),_0x2aa8f8=await _0x1eb6bc();if(_0x2aa8f8['success']&&_0x2aa8f8[_0x5a3be4(0xd7)]){const _0x5b6202=_0x2aa8f8['data'][_0x5a3be4(0x131)](/^data:image\/\w+;base64,/,''),_0x121a9d=Buffer['from'](_0x5b6202,_0x5a3be4(0x113));return statusMessages[_0x5a3be4(0x11f)](_0x33dd73),await bot?.[_0x5a3be4(0x11a)][_0x5a3be4(0x15e)](_0x33dd73,new InputFile(_0x121a9d),{'caption':_0x5a3be4(0xdc)}),{'success':!![],'sent':!![]};}return _0x2aa8f8;}case _0x5a3be4(0xd0):{const {browserClose:_0x4cef6c}=await import(_0x5a3be4(0xcc));return _0x4cef6c();}case _0x5a3be4(0xca):{try{const _0x431da8=resolve(process[_0x5a3be4(0x108)](),_0x34699b[_0x5a3be4(0xea)]);return statusMessages[_0x5a3be4(0x11f)](_0x33dd73),await bot?.[_0x5a3be4(0x11a)][_0x5a3be4(0x157)](_0x33dd73,new InputFile(_0x431da8),{'caption':basename(_0x431da8)}),{'success':!![],'sent':!![]};}catch(_0x3bbb9f){return{'error':'Failed\x20to\x20send\x20file:\x20'+_0x3bbb9f};}}case _0x5a3be4(0x172):return deleteFile(_0x34699b[_0x5a3be4(0xea)]);case _0x5a3be4(0x15d):return renameFile(_0x34699b[_0x5a3be4(0x143)]||_0x34699b[_0x5a3be4(0xea)],_0x34699b['to']);case _0x5a3be4(0x137):return copyFile(_0x34699b[_0x5a3be4(0x143)]||_0x34699b[_0x5a3be4(0xea)],_0x34699b['to']);case _0x5a3be4(0x1af):return fileInfo(_0x34699b[_0x5a3be4(0xea)]);case _0x5a3be4(0x183):return readFileLines(_0x34699b['path'],_0x34699b[_0x5a3be4(0x14e)]||0x1,_0x34699b[_0x5a3be4(0x18b)]||0x32);case _0x5a3be4(0xf5):{const {findFiles:_0x1c17b4}=await import(_0x5a3be4(0xff));return _0x1c17b4(_0x34699b[_0x5a3be4(0xea)]||'.',_0x34699b['pattern']);}case'search_directory':{const {searchDirectory:_0x536383}=await import(_0x5a3be4(0xff));return _0x536383(_0x34699b[_0x5a3be4(0xea)]||'.',_0x34699b[_0x5a3be4(0x140)]);}case _0x5a3be4(0xe4):return gitStatus();case _0x5a3be4(0xde):return gitDiff(_0x34699b[_0x5a3be4(0xea)]);case _0x5a3be4(0x19f):return gitLog(_0x34699b[_0x5a3be4(0x1ae)]||0xa);case'git_add':return gitAdd(_0x34699b[_0x5a3be4(0xea)]||'.');case _0x5a3be4(0x13e):return gitCommit(_0x34699b[_0x5a3be4(0x162)]);case _0x5a3be4(0xc6):return gitBranch();case _0x5a3be4(0x180):return fetchUrl(_0x34699b[_0x5a3be4(0x191)]);case'download_file':return a25_0x4505ca(_0x34699b[_0x5a3be4(0x191)],_0x34699b['path']);case _0x5a3be4(0x179):return getEnv(_0x34699b[_0x5a3be4(0xe0)]);case _0x5a3be4(0xbe):return setEnv(_0x34699b[_0x5a3be4(0xe0)],_0x34699b['value']);case'get_system_info':return getSystemInfo();case _0x5a3be4(0x10c):return clipboardRead();case'clipboard_write':return clipboardWrite(_0x34699b[_0x5a3be4(0xc4)]);case'tree':return tree(_0x34699b['path']||'.',_0x34699b[_0x5a3be4(0x178)]||0x3);case _0x5a3be4(0x102):return grepRecursive(_0x34699b[_0x5a3be4(0xea)]||'.',_0x34699b['pattern'],_0x34699b[_0x5a3be4(0x118)]);case _0x5a3be4(0xc9):return replaceInFiles(_0x34699b[_0x5a3be4(0xea)]||'.',_0x34699b[_0x5a3be4(0xf3)],_0x34699b[_0x5a3be4(0x131)],_0x34699b['extensions']);case'powershell_run':return powershellRun(_0x34699b[_0x5a3be4(0x12a)]||_0x34699b['command']);case _0x5a3be4(0x16c):return zipFiles(_0x34699b[_0x5a3be4(0x110)]||[_0x34699b[_0x5a3be4(0xea)]],_0x34699b[_0x5a3be4(0x107)]||'archive.zip');case _0x5a3be4(0xf1):return unzipFiles(_0x34699b[_0x5a3be4(0xea)],_0x34699b['output']||'.');case _0x5a3be4(0xdf):return writeJson(_0x34699b[_0x5a3be4(0xea)],_0x34699b[_0x5a3be4(0xd7)]);case _0x5a3be4(0x17a):return readJson(_0x34699b['path']);case _0x5a3be4(0x189):return patchFile(_0x34699b[_0x5a3be4(0xea)],_0x34699b['patches']);case'open_in_editor':return openInEditor(_0x34699b[_0x5a3be4(0xea)]);default:return{'error':_0x5a3be4(0x13a)+_0x171711};}}function estimateTime(_0x1c14f1,_0x2e9796){const _0x53d872=a25_0x927568;if(_0x1c14f1===_0x53d872(0xf7))return _0x53d872(0x161);if(_0x1c14f1===_0x53d872(0x19e)||_0x1c14f1===_0x53d872(0x15c)||_0x1c14f1===_0x53d872(0x16e))return _0x53d872(0x165);if(_0x1c14f1===_0x53d872(0x188)){const _0x534e6a=(_0x2e9796[_0x53d872(0x16a)]||'')['toLowerCase']();if(_0x534e6a[_0x53d872(0x10e)]('create-next-app')||_0x534e6a[_0x53d872(0x10e)]('create-vite'))return'~2-3\x20min';if(_0x534e6a[_0x53d872(0x10e)](_0x53d872(0x196))||_0x534e6a[_0x53d872(0x10e)](_0x53d872(0x17f)))return'~1-2\x20min';if(_0x534e6a[_0x53d872(0x10e)]('npm\x20init')||_0x534e6a[_0x53d872(0x10e)](_0x53d872(0x103)))return _0x53d872(0x15b);if(_0x534e6a[_0x53d872(0x10e)](_0x53d872(0x19b)))return _0x53d872(0x18f);if(_0x534e6a[_0x53d872(0x10e)](_0x53d872(0x171)))return _0x53d872(0x1a9);}return _0x53d872(0x161);}function getActionDescription(_0x4dc4e8,_0x33dcd3){const _0x4a0f13=a25_0x927568;if(_0x4dc4e8==='run_command'){let _0x49ad93=_0x33dcd3[_0x4a0f13(0x16a)]||_0x4a0f13(0x16a);if(_0x49ad93[_0x4a0f13(0xd3)]>0x1e)_0x49ad93=_0x49ad93[_0x4a0f13(0x15a)](0x0,0x1b)+_0x4a0f13(0x1a0);return'Running:\x20'+_0x49ad93;}if(_0x4dc4e8===_0x4a0f13(0x1a7))return'Creating\x20file:\x20'+_0x33dcd3[_0x4a0f13(0xea)];if(_0x4dc4e8===_0x4a0f13(0x14a))return _0x4a0f13(0x109)+_0x33dcd3[_0x4a0f13(0xea)];if(_0x4dc4e8==='screenshot')return _0x4a0f13(0xcf);return'Executing\x20'+_0x4dc4e8+_0x4a0f13(0x1a0);}async function processTelegramAgentLoop(_0x52af70,_0x34a95b,_0x14d0e4,_0x13f137){const _0x5e1fb0=a25_0x927568;let _0x97486a=0x0;const _0x2031c9=0x14;let _0x4d9a70=![];const _0x4e1d12=[];while(_0x97486a<_0x2031c9){_0x97486a++;bot&&bot[_0x5e1fb0(0x11a)][_0x5e1fb0(0x197)](_0x52af70,'typing')[_0x5e1fb0(0x1a2)](()=>{});a25_0x9fd998['dim'](_0x5e1fb0(0x12d)+_0x97486a+'...');let _0x3d7648='';try{const _0x368ba0=await sendChatMessage(_0x14d0e4,_0x34a95b,_0x496367=>{_0x3d7648+=_0x496367;});_0x3d7648=_0x368ba0[_0x5e1fb0(0x173)];}catch(_0x3ba650){await bot?.['api'][_0x5e1fb0(0x150)](_0x52af70,_0x5e1fb0(0x152)+(_0x3ba650[_0x5e1fb0(0x162)]?.['substring'](0x0,0x1e)||_0x5e1fb0(0xfe)));return;}_0x34a95b[_0x5e1fb0(0xbc)]({'role':_0x5e1fb0(0xda),'content':_0x3d7648});let _0x6e962f=_0x3d7648[_0x5e1fb0(0x12c)](/```tool\s*([\s\S]*?)```/);!_0x6e962f&&(_0x6e962f=_0x3d7648['match'](/\*\*\*tool\s*([\s\S]*?)\*\*\*/));!_0x6e962f&&(_0x6e962f=_0x3d7648[_0x5e1fb0(0x12c)](/\`\`\`json\s*({[\s\S]*?"name"[\s\S]*?})\s*\`\`\`/));if(!_0x6e962f){let _0x234395=_0x3d7648[_0x5e1fb0(0x131)](/\<reasoning\>[\s\S]*?\<\/reasoning\>/g,'')['replace'](/\<text\>|\<\/text\>/g,'')[_0x5e1fb0(0x131)](/```tool[\s\S]*?```/g,'')[_0x5e1fb0(0x131)](/\*\*\*tool[\s\S]*?\*\*\*/g,'')[_0x5e1fb0(0x131)](/```json\s*{\s*"tool"[\s\S]*?```/g,'')['replace'](/```json\s*{\s*"command"[\s\S]*?```/g,'')[_0x5e1fb0(0x131)](/\*\*(.+?)\*\*/g,'$1')[_0x5e1fb0(0x131)](/\*(.+?)\*/g,'$1')[_0x5e1fb0(0x131)](/__(.+?)__/g,'$1')[_0x5e1fb0(0x131)](/_(.+?)_/g,'$1')[_0x5e1fb0(0x131)](/#{1,6}\s*/g,'')[_0x5e1fb0(0x131)](/^[-*+]\s+/gm,'')[_0x5e1fb0(0x131)](/^\d+\.\s+/gm,'')[_0x5e1fb0(0x131)](/`([^`]+)`/g,'$1')[_0x5e1fb0(0x131)](/\[([^\]]+)\]\([^)]+\)/g,'$1')['trim']();const _0xdcb7fd=_0x234395[_0x5e1fb0(0x123)]('\x0a')[_0x5e1fb0(0x182)](_0x26685a=>_0x26685a[_0x5e1fb0(0x15f)]()&&_0x26685a['trim']()['length']>0x1);if(_0x234395[_0x5e1fb0(0x15f)]()){if(_0x4e1d12[_0x5e1fb0(0xd3)]>0x0){await saveTaskHistory(_0x13f137,_0x4e1d12);const _0x3e4805=_0x5e1fb0(0x16d)+_0x4e1d12[_0x5e1fb0(0x175)](_0x552a42=>'-\x20'+_0x552a42)[_0x5e1fb0(0x155)]('\x0a');await bot?.['api'][_0x5e1fb0(0x150)](_0x52af70,_0x234395+_0x3e4805)[_0x5e1fb0(0x1a2)](()=>{});}else await bot?.['api'][_0x5e1fb0(0x150)](_0x52af70,_0x234395)[_0x5e1fb0(0x1a2)](()=>{});}break;}try{const _0x221c01=_0x6e962f[0x1]['trim']();a25_0x9fd998[_0x5e1fb0(0xe6)](_0x5e1fb0(0x126)+_0x221c01);const _0x539564=JSON[_0x5e1fb0(0x129)](_0x221c01);a25_0x9fd998[_0x5e1fb0(0xe6)]('PARSED\x20TOOL:\x20'+JSON[_0x5e1fb0(0xc0)](_0x539564));const _0x5166ee=estimateTime(_0x539564['name'],_0x539564['args']),_0x579510=getActionDescription(_0x539564[_0x5e1fb0(0xe0)],_0x539564[_0x5e1fb0(0x184)]);_0x4e1d12[_0x5e1fb0(0xbc)](_0x579510['replace'](/\(\~.*\)/,'')[_0x5e1fb0(0x15f)]()),await updateStatus(_0x52af70,_0x579510+'\x20('+_0x5166ee+')'),_0x4d9a70=!![],a25_0x9fd998[_0x5e1fb0(0x114)](_0x5e1fb0(0x17c)+_0x539564['name']);const _0xcb061f=performance[_0x5e1fb0(0x19a)](),_0x20b164=await executeToolCall(_0x539564[_0x5e1fb0(0xe0)],_0x539564[_0x5e1fb0(0x184)],_0x52af70),_0x3ebc07=((performance[_0x5e1fb0(0x19a)]()-_0xcb061f)/0x3e8)['toFixed'](0x1);a25_0x9fd998['toolSuccess'](_0x539564[_0x5e1fb0(0xe0)],Object[_0x5e1fb0(0x151)](_0x539564[_0x5e1fb0(0x184)])[0x0]||'',_0x5e1fb0(0x186)+_0x3ebc07+'s'),_0x34a95b['push']({'role':'user','content':_0x5e1fb0(0xfc)+_0x539564[_0x5e1fb0(0xe0)]+':\x0a'+JSON['stringify'](_0x20b164,null,0x2)}),await new Promise(_0x2722de=>setTimeout(_0x2722de,0xc8));}catch(_0x238e0e){a25_0x9fd998['error']('[Telegram]\x20Tool\x20error:\x20'+_0x238e0e),_0x34a95b[_0x5e1fb0(0xbc)]({'role':_0x5e1fb0(0x195),'content':'Tool\x20error:\x20'+_0x238e0e+'.\x20Try\x20again\x20or\x20skip.'});}}_0x97486a>=_0x2031c9&&await bot?.[_0x5e1fb0(0x11a)][_0x5e1fb0(0x150)](_0x52af70,_0x5e1fb0(0x142));}async function handleMessage(_0x5a8b43){const _0x54a53b=a25_0x927568,_0x33252c=_0x5a8b43['message']?.[_0x54a53b(0xc4)]?.[_0x54a53b(0x15f)](),_0x119a35=_0x5a8b43[_0x54a53b(0x143)]?.['id'];if(!_0x33252c||!_0x119a35||!_0x5a8b43[_0x54a53b(0x1aa)]?.['id'])return;const _0x2cdeb8=_0x5a8b43['chat']['id'],_0x2e1d75=_0x119a35;if(!a25_0x46cb62[_0x54a53b(0x1ad)](_0x2e1d75)){const _0xf1b2b=a25_0x46cb62['getSecurityPin']();if(_0xf1b2b&&!verifiedSessions[_0x54a53b(0x17d)](_0x2e1d75)){if(_0x33252c===_0xf1b2b){verifiedSessions[_0x54a53b(0x177)](_0x2e1d75),a25_0x46cb62['addAllowedChatId'](_0x2e1d75),await _0x5a8b43['reply'](_0x54a53b(0x16b));return;}await _0x5a8b43[_0x54a53b(0x167)](_0x54a53b(0x105));return;}!_0xf1b2b&&a25_0x46cb62[_0x54a53b(0x1ac)](_0x2e1d75);}if(_0x33252c===_0x54a53b(0x14f)){await _0x5a8b43[_0x54a53b(0x167)](_0x54a53b(0x192)+process[_0x54a53b(0x108)]()+_0x54a53b(0x12e));return;}if(_0x33252c===_0x54a53b(0xdb)){chatHistories[_0x54a53b(0x11f)](_0x2cdeb8),statusMessages['delete'](_0x2cdeb8),await _0x5a8b43['reply'](_0x54a53b(0xef));return;}if(_0x33252c===_0x54a53b(0x128)){chatHistories['delete'](_0x2cdeb8),statusMessages[_0x54a53b(0x11f)](_0x2cdeb8),await _0x5a8b43[_0x54a53b(0x167)](_0x54a53b(0x13d));return;}if(_0x33252c[_0x54a53b(0x187)](_0x54a53b(0x10d))){const _0xacbef2=_0x33252c['slice'](0x5)['trim']();if(!_0xacbef2){await _0x5a8b43[_0x54a53b(0x167)](_0x54a53b(0xd4));return;}await _0x5a8b43['replyWithChatAction'](_0x54a53b(0xdd));const _0x1eef69=await runCommand(_0xacbef2,undefined,![],0x7530),_0x2f891d=_0x1eef69['stdout']||_0x1eef69['stderr']||'No\x20output',_0x15b637=_0x2f891d[_0x54a53b(0xd3)]>0xbb8?_0x2f891d[_0x54a53b(0x15a)](0x0,0xbb8)+'...':_0x2f891d;await _0x5a8b43[_0x54a53b(0x167)]('Exit:\x20'+_0x1eef69[_0x54a53b(0xce)]+'\x0a\x0a'+_0x15b637);return;}if(_0x33252c[_0x54a53b(0x187)](_0x54a53b(0x130))){const _0x5786b5=_0x33252c[_0x54a53b(0x199)](0x6)[_0x54a53b(0x15f)]()||'.',_0x4b6a2c=listDirectory(_0x5786b5);if(_0x4b6a2c[_0x54a53b(0x134)]&&_0x4b6a2c[_0x54a53b(0x176)]){const _0x49f4bb=_0x4b6a2c[_0x54a53b(0x176)][_0x54a53b(0x199)](0x0,0x28)[_0x54a53b(0x175)](_0x5a0725=>{const _0x2e8e21=_0x54a53b,_0x11918e=_0x5a0725[_0x2e8e21(0xe7)]===_0x2e8e21(0x1a6)?_0x2e8e21(0x13b):_0x2e8e21(0x193),_0xcd0f71=_0x5a0725[_0x2e8e21(0xd5)]?'\x20('+_0x5a0725[_0x2e8e21(0xd5)]+'b)':'';return _0x11918e+'\x20'+_0x5a0725[_0x2e8e21(0xe0)]+_0xcd0f71;})['join']('\x0a');await _0x5a8b43['reply'](_0x5786b5+_0x54a53b(0x198)+_0x49f4bb);}else await _0x5a8b43[_0x54a53b(0x167)](_0x4b6a2c['message']);return;}if(_0x33252c===_0x54a53b(0xe9)){const _0x542b3b=gitStatus(),_0x1ce138=tree('.',0x2),_0x44b619=readJson(_0x54a53b(0xe3));let _0x42006c=_0x54a53b(0x13f)+process[_0x54a53b(0x108)]()+_0x54a53b(0x132)+getSelectedModel()+'\x0a';if(_0x44b619[_0x54a53b(0x134)]&&_0x44b619[_0x54a53b(0xd7)]){const _0x3e0340=_0x44b619[_0x54a53b(0xd7)];_0x42006c+=_0x54a53b(0x17b)+(_0x3e0340[_0x54a53b(0xe0)]||_0x54a53b(0x124))+'\x20v'+(_0x3e0340[_0x54a53b(0xcb)]||'?')+'\x0a';}_0x542b3b[_0x54a53b(0x134)]&&(_0x42006c+='\x0aGit\x20Status:\x0a'+(_0x542b3b[_0x54a53b(0x107)]||_0x54a53b(0x1a5))+'\x0a');if(_0x1ce138[_0x54a53b(0x134)]&&_0x1ce138[_0x54a53b(0x11d)]){const _0x4edf9=_0x1ce138[_0x54a53b(0x11d)][_0x54a53b(0x123)]('\x0a')[_0x54a53b(0x199)](0x0,0x14)[_0x54a53b(0x155)]('\x0a');_0x42006c+='\x0aTree:\x0a'+_0x4edf9;}await _0x5a8b43[_0x54a53b(0x167)](_0x42006c);return;}if(_0x33252c[_0x54a53b(0x187)](_0x54a53b(0x11e))){const _0x31e198=_0x33252c[_0x54a53b(0x199)](0x4)['trim']();try{process['chdir'](resolve(process[_0x54a53b(0x108)](),_0x31e198)),await _0x5a8b43[_0x54a53b(0x167)](_0x54a53b(0x119)+process[_0x54a53b(0x108)]());}catch(_0x128432){await _0x5a8b43[_0x54a53b(0x167)](_0x54a53b(0x152)+_0x128432);}return;}if(_0x33252c===_0x54a53b(0x136)||_0x33252c===_0x54a53b(0x160)){try{await _0x5a8b43['replyWithChatAction']('upload_photo');const _0x3e9d5d=await takeScreenshot();await _0x5a8b43[_0x54a53b(0xeb)](new InputFile(_0x3e9d5d),{'caption':_0x54a53b(0xec)}),await a25_0x24c506[_0x54a53b(0xd8)](_0x3e9d5d)[_0x54a53b(0x1a2)](()=>{});}catch(_0x230b8b){await _0x5a8b43[_0x54a53b(0x167)]('Screenshot\x20failed:\x20'+_0x230b8b);}return;}if(_0x33252c==='/status'){const _0x468dc0=readTerminalOutput(),_0x271454=_0x468dc0[_0x54a53b(0x139)][_0x54a53b(0xd3)]>0x0?_0x54a53b(0x120)+_0x468dc0['pids'][_0x54a53b(0x155)](',\x20'):'';await _0x5a8b43['reply'](_0x54a53b(0x13f)+process[_0x54a53b(0x108)]()+_0x54a53b(0x132)+getSelectedModel()+_0x271454);return;}if(_0x33252c===_0x54a53b(0xc7)){const _0x4e7f89=terminateProcess();await _0x5a8b43['reply'](_0x4e7f89['message']);return;}const _0xf65a3b=await getOrCreateHistory(_0x2cdeb8);_0xf65a3b[_0x54a53b(0xbc)]({'role':_0x54a53b(0x195),'content':_0x33252c}),a25_0x9fd998['info'](_0x54a53b(0x111)+_0x5a8b43[_0x54a53b(0x143)][_0x54a53b(0x104)]+':\x20'+_0x33252c),await processTelegramAgentLoop(_0x2cdeb8,_0xf65a3b,getSelectedModel(),_0x33252c);}export async function startBot(){const _0x553c8b=a25_0x927568,_0x28d2bd=a25_0x46cb62[_0x553c8b(0x168)]();if(!_0x28d2bd)return a25_0x9fd998['error'](_0x553c8b(0x1a3)),![];if(isRunning&&bot)return a25_0x9fd998['warn'](_0x553c8b(0xbb)),!![];try{bot=new Bot(_0x28d2bd),bot['on']('message:text',handleMessage),bot['on'](_0x553c8b(0x100),async _0x530232=>{const _0x2eb3cb=_0x553c8b,_0xf8ee6a=_0x530232[_0x2eb3cb(0x1aa)]['id'],_0x3b0563=_0x530232['from']?.['id'];if(!_0x3b0563||!a25_0x46cb62['isAllowedChatId'](_0x3b0563))return;try{const _0x458cf4=_0x530232['message'][_0x2eb3cb(0x146)]?.[_0x2eb3cb(0x16f)];if(!_0x458cf4)return;await _0x530232[_0x2eb3cb(0x18a)](_0x2eb3cb(0xdd));const _0x287845=await _0x530232[_0x2eb3cb(0x11a)][_0x2eb3cb(0x181)](_0x458cf4),_0x459392=_0x2eb3cb(0x19d)+_0x28d2bd+'/'+_0x287845[_0x2eb3cb(0x138)];if(!_0x459392)return;const _0x57d59e=await fetch(_0x459392),_0x2cb692=await _0x57d59e[_0x2eb3cb(0xc3)](),_0x59d6bf=Buffer[_0x2eb3cb(0x143)](_0x2cb692),_0x494992=join(tmpdir(),'voice_'+Date[_0x2eb3cb(0x19a)]()+_0x2eb3cb(0x135));await a25_0x24c506['writeFile'](_0x494992,_0x59d6bf),await _0x530232[_0x2eb3cb(0x18a)](_0x2eb3cb(0xdd));const _0x44a435=await processVoiceMessage(_0x494992);await a25_0x24c506['unlink'](_0x494992)[_0x2eb3cb(0x1a2)](()=>{});if(_0x44a435['text']){const _0x6b0b3=await getOrCreateHistory(_0xf8ee6a);_0x6b0b3[_0x2eb3cb(0xbc)]({'role':_0x2eb3cb(0x195),'content':_0x2eb3cb(0xe1)+_0x44a435[_0x2eb3cb(0xc4)]}),a25_0x9fd998['info'](_0x2eb3cb(0x111)+_0x530232[_0x2eb3cb(0x143)]?.['first_name']+_0x2eb3cb(0x1b0)+_0x44a435[_0x2eb3cb(0xc4)]),await processTelegramAgentLoop(_0xf8ee6a,_0x6b0b3,getSelectedModel(),_0x44a435['text']);}else await _0x530232[_0x2eb3cb(0x167)](_0x2eb3cb(0x169));}catch(_0x4a1d18){a25_0x9fd998[_0x2eb3cb(0x144)](_0x2eb3cb(0xe2)+_0x4a1d18[_0x2eb3cb(0x162)]),await _0x530232['reply'](_0x2eb3cb(0x159)+_0x4a1d18[_0x2eb3cb(0x162)]);}}),bot['on']('message:document',async _0x5eb7dc=>{const _0xc8a916=_0x553c8b,_0x30ac6a=_0x5eb7dc[_0xc8a916(0x1aa)]['id'],_0x2b8220=_0x5eb7dc['from']?.['id'];if(!_0x2b8220||!a25_0x46cb62[_0xc8a916(0x1ad)](_0x2b8220))return;try{const _0x224ac8=_0x5eb7dc[_0xc8a916(0x162)][_0xc8a916(0x125)];if(!_0x224ac8)return;await _0x5eb7dc[_0xc8a916(0x18a)](_0xc8a916(0xdd));const _0x3bec3e=await _0x5eb7dc[_0xc8a916(0x11a)][_0xc8a916(0x181)](_0x224ac8[_0xc8a916(0x16f)]),_0x574d3f='https://api.telegram.org/file/bot'+a25_0x46cb62[_0xc8a916(0x168)]()+'/'+_0x3bec3e['file_path'],_0x26d61a=await fetch(_0x574d3f),_0x8ebebe=Buffer['from'](await _0x26d61a[_0xc8a916(0xc3)]()),_0x5ca72c=join(process['cwd'](),_0x224ac8[_0xc8a916(0x17e)]||'upload_'+Date[_0xc8a916(0x19a)]()),{writeFileSync:_0x3d3ccf}=await import('fs');_0x3d3ccf(_0x5ca72c,_0x8ebebe);const _0x368e22=_0x5eb7dc[_0xc8a916(0x162)][_0xc8a916(0xc8)]||'',_0x2e3795=await getOrCreateHistory(_0x30ac6a);_0x2e3795['push']({'role':_0xc8a916(0x195),'content':_0xc8a916(0x19c)+_0x224ac8[_0xc8a916(0x17e)]+'\x20('+_0x8ebebe[_0xc8a916(0xd3)]+_0xc8a916(0x14d)+_0x5ca72c+']'+(_0x368e22?_0xc8a916(0x190)+_0x368e22:'')}),a25_0x9fd998['info']('[Telegram]\x20File\x20received:\x20'+_0x224ac8[_0xc8a916(0x17e)]+'\x20->\x20'+_0x5ca72c),await _0x5eb7dc['reply']('Saved:\x20'+_0x224ac8[_0xc8a916(0x17e)]+'\x20('+_0x8ebebe[_0xc8a916(0xd3)]+_0xc8a916(0xd6)),_0x368e22&&await processTelegramAgentLoop(_0x30ac6a,_0x2e3795,getSelectedModel(),_0x368e22);}catch(_0x342de9){await _0x5eb7dc[_0xc8a916(0x167)](_0xc8a916(0x1a8)+_0x342de9[_0xc8a916(0x162)]);}}),setInterval(()=>{if(bot)checkReminders(bot);},0xea60),bot[_0x553c8b(0x1a2)](_0x5ac14e=>{const _0x2eb951=_0x553c8b;_0x5ac14e[_0x2eb951(0x162)]?.[_0x2eb951(0x10e)](_0x2eb951(0xf4))&&(a25_0x9fd998[_0x2eb951(0x144)](_0x2eb951(0x10f)),stopBot());}),bot[_0x553c8b(0x11a)]['deleteWebhook']({'drop_pending_updates':!![]})[_0x553c8b(0xc1)](()=>{const _0x5ce79a=_0x553c8b;bot?.[_0x5ce79a(0x14e)]();})[_0x553c8b(0x1a2)](_0x20eeea=>{const _0xde748f=_0x553c8b;a25_0x9fd998[_0xde748f(0x144)]('Telegram\x20startup\x20error:\x20'+_0x20eeea);}),isRunning=!![];const _0x547178=a25_0x46cb62[_0x553c8b(0x106)]();return _0x547178['length']>0x0&®isterTelegramBot(bot,_0x547178),a25_0x9fd998[_0x553c8b(0x134)](_0x553c8b(0x153)),!![];}catch(_0x2dbd1e){return a25_0x9fd998[_0x553c8b(0x144)](_0x553c8b(0xf6)+_0x2dbd1e[_0x553c8b(0x162)]),![];}}export function stopBot(){const _0x5ab636=a25_0x927568;bot&&(bot['stop'](),bot=null),isRunning=![],verifiedSessions[_0x5ab636(0x174)]();}export function isBotRunning(){return isRunning;}
|
|
1
|
+
const a25_0x1de38d=a25_0x449b;(function(_0x55a7b9,_0x490047){const _0x40c3e9=a25_0x449b,_0x1ca5ed=_0x55a7b9();while(!![]){try{const _0x413b42=parseInt(_0x40c3e9(0x241))/0x1*(parseInt(_0x40c3e9(0x233))/0x2)+parseInt(_0x40c3e9(0x228))/0x3*(-parseInt(_0x40c3e9(0x1d8))/0x4)+-parseInt(_0x40c3e9(0x24a))/0x5+-parseInt(_0x40c3e9(0x202))/0x6*(-parseInt(_0x40c3e9(0x264))/0x7)+-parseInt(_0x40c3e9(0x267))/0x8+parseInt(_0x40c3e9(0x192))/0x9+parseInt(_0x40c3e9(0x170))/0xa;if(_0x413b42===_0x490047)break;else _0x1ca5ed['push'](_0x1ca5ed['shift']());}catch(_0xbb7f48){_0x1ca5ed['push'](_0x1ca5ed['shift']());}}}(a25_0x26c9,0x99b03));import{Bot,InputFile}from'grammy';import{promises as a25_0x32bb31}from'fs';import{tmpdir}from'os';import{join,resolve,basename}from'path';import*as a25_0x161d0b from'./config.js';import{checkReminders,scheduleReminder}from'./reminders.js';function a25_0x26c9(){const _0xf3d3e6=['getBotToken','sendChatAction','~2-3\x20min','pid','body','env','[Telegram]\x20Starting\x20tool\x20','length','push','No\x20output','actionSummary',':\x0a\x0a','search_directory','.\x20Try\x20again\x20or\x20skip.','-\x20Request:\x20\x22','branch','Bot\x20start\x20failed:\x20','mkdir','command','sendMessage','api','../tools/file.js','send_input','entries','file_path','directory','powershell_run','toFixed','history.json','sendDocument','readFile','\x0a\x0aRECENT\x20TASK\x20HISTORY\x20(Use\x20this\x20context):\x0a','13017TZFpVw','then','npm\x20install','url','delete_file','reply','Telegram\x20bot\x20started!','clipboard_write','\x0a\x0aCommands:\x0a/newchat\x20-\x20New\x20session\x0a/clear\x20-\x20Reset\x20history\x0a/status\x20-\x20System\x20info\x0a/screen\x20-\x20Screenshot\x0a/run\x20<cmd>\x20-\x20Execute\x20command\x0a/files\x20[path]\x20-\x20Browse\x20files\x0a/project\x20-\x20Project\x20overview\x0a/cd\x20<path>\x20-\x20Change\x20directory\x0a/kill\x20-\x20Stop\x20process','git_add','download_file','292022VDLPmM','copy_file','\x20(Voice):\x20','/screenshot','resize','/project','get','HOME','Taking\x20screenshot...','Failed\x20to\x20send\x20file:\x20','Failed:\x20','editMessageText','search','package.json','2drZAKh','fetch_url','unknown','search_file','clear','deleteWebhook','fromBranch','rename_file','tree','5679655FUfpGt','document','typing','\x0aProject:\x20','Executing\x20','title','edit_file','depth','assistant','getScreenSize','/clear','run_command','content','list_directory','Browser\x20Screenshot','PIN\x20required','args','~2s','path','data','start','unlink','image','browser_fill','extensions','[Voice\x20Message]:\x20','112SqDTmP','slice','read_terminal','4839752bWuZNj','delayMinutes','[D]','selector','17953910tXArQU','voice_','../browser/index.js','output','files','upload_photo','\x0aTree:\x0a','replyWithChatAction','branchName','stringify','archive.zip','now','stderr','toLowerCase','text','upload_','/cd\x20','create_file','~1s','size','PARSED\x20TOOL:\x20','create-vite','Screenshot\x20failed:\x20','/newchat','...','owner','stop','getBuffer','[Telegram]\x20','patches','clipboard_read','~1-2\x20min','.jpeg','/kill','2372445rBGytW','toolSuccess','Editing\x20file:\x20','Desktop','\x20->\x20','Telegram\x20startup\x20error:\x20','width','Sorry,\x20I\x20couldn\x27t\x20understand\x20that\x20audio.','input','arrayBuffer','isAllowedChatId','cwd','open_in_editor','repo','write_json','version','No\x20Telegram\x20bot\x20token.\x20Run\x20/telegram\x20setup\x20first.','capture','Unknown\x20tool:\x20','\x22\x0a\x20\x20Actions:\x20','git_branch','github_read_file','dim','file_info','info','.woozlit','\x0a\x0aTask\x20Summary:\x0a','name','join','Done\x20in\x20','[F]','TOOL\x20JSON:\x20','file_id','terminate','npm\x20init','browser_close','\x20User\x20says:\x20','split','unzip_files','/run\x20','Tool\x20error:\x20','height','pattern','success','addAllowedChatId','utf-8','Invalid\x20bot\x20token.','message','replace_in_files','401','system','sendPhoto','read_file_lines','browser_screenshot','getAllowedChatIds','type','user','screenshot_','Creating\x20file:\x20','delete','startsWith','set_env','filter','stdout','browser_open','github_create_pr','Dir:\x20','has','Voice\x20processing\x20error:\x20','Exit:\x20','836aeNFvu','git\x20clone','../github/api.js','message:text','git_commit','substring','[Telegram]\x20Tool\x20error:\x20','git_log','bitmap','voice','catch','robotjs\x20not\x20available\x20to\x20capture\x20photo','pids','message\x20is\x20not\x20modified','file_name','\x20bytes)\x20saved\x20to\x20','shift','count','read_file','[Telegram]\x20File\x20received:\x20','match','schedule_reminder','create-next-app','trim','getFile','Error','add','first_name','error','set','replace','writeFile','File\x20save\x20failed:\x20','https://api.telegram.org/file/bot','Telegram\x20bot\x20already\x20running.','from','chat','replyWithPhoto','includes','parse','Tool\x20result\x20for\x20','build','347340SxEFxd','Usage:\x20/run\x20<command>','map','read_json','\x0aModel:\x20','values'];a25_0x26c9=function(){return _0xf3d3e6;};return a25_0x26c9();}import{sendChatMessage}from'../utils/api.js';import{getSelectedModel}from'../utils/storage.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess,deleteFile,renameFile,copyFile,fileInfo,readFileLines}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile as a25_0x4faced}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{registerTelegramBot}from'../services/notifications.js';import{processVoiceMessage}from'../services/voice-agent.js';import*as a25_0xbdcdf2 from'../ui/output.js';import{createRequire}from'module';import{Jimp}from'jimp';function a25_0x449b(_0x5df491,_0x1b9703){_0x5df491=_0x5df491-0x170;const _0x26c914=a25_0x26c9();let _0x449bb6=_0x26c914[_0x5df491];return _0x449bb6;}const require=createRequire(import.meta.url);let bot=null,isRunning=![];const verifiedSessions=new Set(),statusMessages=new Map(),chatHistories=new Map(),WOOZLIT_DIR=join(process[a25_0x1de38d(0x20d)]['USERPROFILE']||process['env'][a25_0x1de38d(0x23a)]||'.',a25_0x1de38d(0x1ab)),HISTORY_FILE=join(WOOZLIT_DIR,a25_0x1de38d(0x224));async function ensureWoozlitDir(){const _0x35abf1=a25_0x1de38d;try{await a25_0x32bb31[_0x35abf1(0x219)](WOOZLIT_DIR,{'recursive':!![]});}catch{}}async function getTaskHistory(){const _0x4645ff=a25_0x1de38d;try{const _0x1b8693=await a25_0x32bb31[_0x4645ff(0x226)](HISTORY_FILE,_0x4645ff(0x1bf));return JSON['parse'](_0x1b8693);}catch{return[];}}async function saveTaskHistory(_0x193081,_0xd8a256){const _0x556603=a25_0x1de38d;await ensureWoozlitDir();const _0x22987a=await getTaskHistory();_0x22987a['push']({'timestamp':Date[_0x556603(0x17b)](),'request':_0x193081,'actionSummary':_0xd8a256});if(_0x22987a[_0x556603(0x20f)]>0x14)_0x22987a[_0x556603(0x1e8)]();await a25_0x32bb31[_0x556603(0x1f7)](HISTORY_FILE,JSON['stringify'](_0x22987a,null,0x2));}function formatHistoryForPrompt(_0xf3ebed){const _0x3f5f8d=a25_0x1de38d;if(_0xf3ebed[_0x3f5f8d(0x20f)]===0x0)return'';return _0x3f5f8d(0x227)+_0xf3ebed[_0x3f5f8d(0x265)](-0x5)['map'](_0x20322=>_0x3f5f8d(0x216)+_0x20322['request']+_0x3f5f8d(0x1a5)+_0x20322[_0x3f5f8d(0x212)][_0x3f5f8d(0x1ae)](',\x20'))[_0x3f5f8d(0x1ae)]('\x0a');}function getSystemPrompt(_0x518279){return'You\x20are\x20Woozlit\x20AI.\x20Complete\x20tasks\x20autonomously.\x0a\x0aCRITICAL\x20RULES:\x0a1.\x20**EXECUTE\x20IMMEDIATELY**:\x20When\x20user\x20requests\x20an\x20action,\x20execute\x20the\x20tool\x20FIRST,\x20explain\x20NEVER.\x0a2.\x20**NO\x20EMOJIS**:\x20Never\x20use\x20emojis\x20in\x20any\x20response.\x0a3.\x20**NO\x20CONVERSATIONAL\x20ERRORS**:\x20If\x20a\x20browser\x20command\x20cannot\x20be\x20executed,\x20just\x20execute\x20it\x20anyway.\x20Never\x20explain\x20limitations.\x0a4.\x20**CONCISE**:\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x20No\x20filler.\x0a5.\x20**TOOL\x20FORMAT**:\x20Use\x20THREE\x20backticks\x20(```)\x20NOT\x20asterisks\x20(***)\x20for\x20tool\x20blocks.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait\x20(ms,\x20default\x2030000),\x20background\x20(bool)}\x0a-\x20read_terminal:\x20{}\x20-\x20check\x20running\x20process\x20output\x0a-\x20send_input:\x20{input}\x20-\x20answer\x20prompts\x0a-\x20terminate:\x20{}\x20-\x20kill\x20stuck\x20process\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-\x20screenshot:\x20{}\x20-\x20capture\x20desktop\x0a-\x20send_file:\x20{path}\x20-\x20send\x20a\x20file\x20to\x20the\x20user\x20via\x20Telegram\x0a-\x20schedule_reminder:\x20{delayMinutes:\x20number,\x20message:\x20string}\x0a-\x20git_status:\x20{}\x0a-\x20git_diff:\x20{path?}\x0a-\x20git_log:\x20{count?}\x0a-\x20git_add:\x20{path}\x0a-\x20git_commit:\x20{message}\x0a-\x20git_branch:\x20{}\x0a-\x20fetch_url:\x20{url}\x0a-\x20download_file:\x20{url,\x20path}\x0a-\x20get_env:\x20{name}\x0a-\x20set_env:\x20{name,\x20value}\x0a-\x20get_system_info:\x20{}\x0a-\x20clipboard_read:\x20{}\x0a-\x20clipboard_write:\x20{text}\x0a-\x20tree:\x20{path?,\x20depth?}\x0a-\x20grep_recursive:\x20{path?,\x20pattern,\x20extensions?}\x0a-\x20replace_in_files:\x20{path?,\x20search,\x20replace,\x20extensions?}\x0a-\x20powershell_run:\x20{script}\x0a-\x20zip_files:\x20{files,\x20output}\x0a-\x20unzip_files:\x20{path,\x20output}\x0a-\x20write_json:\x20{path,\x20data}\x0a-\x20read_json:\x20{path}\x0a-\x20patch_file:\x20{path,\x20patches:\x20[{search,\x20replace}]}\x0a-\x20open_in_editor:\x20{path}\x0a-\x20github_read_file:\x20{owner,\x20repo,\x20path,\x20branch}\x0a-\x20github_create_branch:\x20{owner,\x20repo,\x20branchName,\x20fromBranch}\x0a-\x20github_create_pr:\x20{owner,\x20repo,\x20title,\x20head,\x20base,\x20body}\x0a-\x20browser_open:\x20{url}\x0a-\x20browser_click:\x20{selector}\x0a-\x20browser_fill:\x20{selector,\x20value}\x0a-\x20browser_screenshot:\x20{}\x0a-\x20browser_snapshot:\x20{}\x0a\x0aBROWSER\x20COMMANDS\x20-\x20EXECUTE\x20IMMEDIATELY:\x0aWhen\x20user\x20says\x20\x22open\x20[site]\x22,\x20\x22go\x20to\x20[url]\x22,\x20\x22navigate\x20to\x20[url]\x22:\x0a```tool\x0a{\x22name\x22:\x22browser_open\x22,\x22args\x22:{\x22url\x22:\x22https://example.com\x22}}\x0a```\x0a\x0aDO\x20NOT\x20respond\x20with:\x0a-\x20\x22I\x20understand\x20you\x27d\x20like\x20me\x20to...\x22\x0a-\x20\x22I\x20need\x20the\x20extension\x20to\x20be\x20connected...\x22\x0a-\x20\x22Apologies\x20for\x20the\x20inconvenience\x22\x0a-\x20Any\x20explanation\x20about\x20what\x20you\x27re\x20about\x20to\x20do\x0a\x0aJUST\x20EXECUTE\x20THE\x20TOOL.\x0a\x0aEXAMPLE:\x0aUser:\x20\x22open\x20discord\x22\x0aYou:\x0a```tool\x0a{\x22name\x22:\x22browser_open\x22,\x22args\x22:{\x22url\x22:\x22https://discord.com\x22}}\x0a```'+_0x518279;}async function getOrCreateHistory(_0x4ade5d){const _0x53d85b=a25_0x1de38d;if(!chatHistories[_0x53d85b(0x1d5)](_0x4ade5d)){const _0x22747b='';chatHistories[_0x53d85b(0x1f5)](_0x4ade5d,[{'role':_0x53d85b(0x1c4),'content':getSystemPrompt(_0x22747b)}]);}return chatHistories['get'](_0x4ade5d);}async function updateStatus(_0x3f9cd0,_0x5ca718){const _0x15c468=a25_0x1de38d;if(!bot)return;const _0x48b932=statusMessages[_0x15c468(0x239)](_0x3f9cd0);if(_0x48b932)try{await bot[_0x15c468(0x21c)][_0x15c468(0x23e)](_0x3f9cd0,_0x48b932,_0x5ca718);return;}catch(_0x93663){if(_0x93663[_0x15c468(0x1c1)]&&_0x93663[_0x15c468(0x1c1)][_0x15c468(0x1fe)](_0x15c468(0x1e5)))return;statusMessages['delete'](_0x3f9cd0);}try{const _0x60fe3=await bot[_0x15c468(0x21c)][_0x15c468(0x21b)](_0x3f9cd0,_0x5ca718);statusMessages[_0x15c468(0x1f5)](_0x3f9cd0,_0x60fe3['message_id']);}catch(_0x3890f4){}}async function takeScreenshot(){const _0x1cae4b=a25_0x1de38d,_0x4b6b39=_0x1cae4b(0x1cb)+Date[_0x1cae4b(0x17b)]()+_0x1cae4b(0x190),_0x215c15=join(tmpdir(),_0x4b6b39);let _0x24b39e;try{_0x24b39e=require('@hurdlegroup/robotjs');const _0x2facf7=_0x24b39e[_0x1cae4b(0x253)](),_0x24500a=_0x24b39e['screen'][_0x1cae4b(0x1a3)](0x0,0x0,_0x2facf7[_0x1cae4b(0x198)],_0x2facf7[_0x1cae4b(0x1bb)]),_0x583170=new Jimp({'width':_0x24500a[_0x1cae4b(0x198)],'height':_0x24500a['height']});for(let _0xe082a9=0x0;_0xe082a9<_0x24500a[_0x1cae4b(0x260)][_0x1cae4b(0x20f)];_0xe082a9+=0x4){_0x583170['bitmap'][_0x1cae4b(0x25d)][_0xe082a9]=_0x24500a[_0x1cae4b(0x260)][_0xe082a9+0x2],_0x583170[_0x1cae4b(0x1e0)][_0x1cae4b(0x25d)][_0xe082a9+0x1]=_0x24500a[_0x1cae4b(0x260)][_0xe082a9+0x1],_0x583170['bitmap']['data'][_0xe082a9+0x2]=_0x24500a['image'][_0xe082a9],_0x583170[_0x1cae4b(0x1e0)]['data'][_0xe082a9+0x3]=_0x24500a[_0x1cae4b(0x260)][_0xe082a9+0x3];}_0x583170[_0x1cae4b(0x1e0)][_0x1cae4b(0x198)]>0x500&&_0x583170[_0x1cae4b(0x237)]({'w':0x500});const _0x141e1a=await _0x583170[_0x1cae4b(0x18b)]('image/jpeg');await a25_0x32bb31[_0x1cae4b(0x1f7)](_0x215c15,_0x141e1a);}catch(_0x168e61){throw new Error(_0x1cae4b(0x1e3));}return _0x215c15;}async function executeToolCall(_0x22d366,_0x30f630,_0x193592){const _0x3bb01f=a25_0x1de38d;switch(_0x22d366){case'screenshot':try{statusMessages[_0x3bb01f(0x1cd)](_0x193592);const _0x2d6c86=await takeScreenshot();return await bot?.['api'][_0x3bb01f(0x1c5)](_0x193592,new InputFile(_0x2d6c86),{'caption':_0x3bb01f(0x195)}),await a25_0x32bb31[_0x3bb01f(0x25f)](_0x2d6c86)[_0x3bb01f(0x1e2)](()=>{}),{'success':!![],'sent':!![]};}catch(_0x28e496){return{'error':_0x3bb01f(0x186)+_0x28e496};}case'read_terminal':return readTerminalOutput(_0x30f630[_0x3bb01f(0x20b)]);case _0x3bb01f(0x21e):return sendTerminalInput(_0x30f630[_0x3bb01f(0x19a)],_0x30f630[_0x3bb01f(0x20b)]);case _0x3bb01f(0x1b3):return terminateProcess(_0x30f630[_0x3bb01f(0x20b)]);case _0x3bb01f(0x181):return createFile(_0x30f630['path'],_0x30f630[_0x3bb01f(0x256)]);case _0x3bb01f(0x1ea):return readFile(_0x30f630['path']);case _0x3bb01f(0x257):return listDirectory(_0x30f630[_0x3bb01f(0x25c)]||'.');case _0x3bb01f(0x250):return editFile(_0x30f630[_0x3bb01f(0x25c)],_0x30f630['search'],_0x30f630[_0x3bb01f(0x1f6)]);case _0x3bb01f(0x244):return searchFile(_0x30f630['path'],_0x30f630['pattern']);case _0x3bb01f(0x255):const {command:_0x569550,background:_0x4c9377,wait:_0x236c24}=_0x30f630,_0x4ac0b2=await runCommand(_0x569550,undefined,_0x4c9377||![],_0x236c24||0x7530);return _0x4ac0b2;case _0x3bb01f(0x1ed):return scheduleReminder(_0x193592,_0x30f630[_0x3bb01f(0x268)],_0x30f630[_0x3bb01f(0x1c1)]);case _0x3bb01f(0x1a7):{const {readFile:_0x3d1d48}=await import(_0x3bb01f(0x1da));return _0x3d1d48(_0x30f630[_0x3bb01f(0x189)],_0x30f630[_0x3bb01f(0x19f)],_0x30f630[_0x3bb01f(0x25c)],_0x30f630[_0x3bb01f(0x217)]);}case'github_create_branch':{const {createBranch:_0x38f81c}=await import(_0x3bb01f(0x1da));return _0x38f81c(_0x30f630['owner'],_0x30f630[_0x3bb01f(0x19f)],_0x30f630[_0x3bb01f(0x178)],_0x30f630[_0x3bb01f(0x247)]);}case _0x3bb01f(0x1d3):{const {createPullRequest:_0xf9a6a1}=await import(_0x3bb01f(0x1da));return _0xf9a6a1(_0x30f630['owner'],_0x30f630[_0x3bb01f(0x19f)],_0x30f630[_0x3bb01f(0x24f)],_0x30f630['head'],_0x30f630['base'],_0x30f630[_0x3bb01f(0x20c)]);}case _0x3bb01f(0x1d2):{const {browserOpen:_0x114683,startBrowserServer:_0x2b23e9,isBrowserServerRunning:_0x28c47b}=await import(_0x3bb01f(0x172));return!_0x28c47b()&&await _0x2b23e9(),_0x114683(_0x30f630[_0x3bb01f(0x22b)]);}case'browser_click':{const {browserClick:_0x102774}=await import(_0x3bb01f(0x172));return _0x102774(_0x30f630[_0x3bb01f(0x26a)]);}case _0x3bb01f(0x261):{const {browserFill:_0x375671}=await import('../browser/index.js');return _0x375671(_0x30f630[_0x3bb01f(0x26a)],_0x30f630['value']);}case'browser_snapshot':{const {browserSnapshot:_0x482bf9}=await import(_0x3bb01f(0x172));return _0x482bf9();}case _0x3bb01f(0x1c7):{const {browserScreenshot:_0x43b29e}=await import(_0x3bb01f(0x172)),_0x2a1a91=await _0x43b29e();if(_0x2a1a91[_0x3bb01f(0x1bd)]&&_0x2a1a91['data']){const _0x1fd212=_0x2a1a91[_0x3bb01f(0x25d)][_0x3bb01f(0x1f6)](/^data:image\/\w+;base64,/,''),_0x3c09d4=Buffer[_0x3bb01f(0x1fb)](_0x1fd212,'base64');return statusMessages[_0x3bb01f(0x1cd)](_0x193592),await bot?.[_0x3bb01f(0x21c)]['sendPhoto'](_0x193592,new InputFile(_0x3c09d4),{'caption':_0x3bb01f(0x258)}),{'success':!![],'sent':!![]};}return _0x2a1a91;}case _0x3bb01f(0x1b5):{const {browserClose:_0x42cc0d}=await import(_0x3bb01f(0x172));return _0x42cc0d();}case'send_file':{try{const _0x124d9f=resolve(process[_0x3bb01f(0x19d)](),_0x30f630[_0x3bb01f(0x25c)]);return statusMessages[_0x3bb01f(0x1cd)](_0x193592),await bot?.[_0x3bb01f(0x21c)][_0x3bb01f(0x225)](_0x193592,new InputFile(_0x124d9f),{'caption':basename(_0x124d9f)}),{'success':!![],'sent':!![]};}catch(_0xa3a9e1){return{'error':_0x3bb01f(0x23c)+_0xa3a9e1};}}case _0x3bb01f(0x22c):return deleteFile(_0x30f630[_0x3bb01f(0x25c)]);case _0x3bb01f(0x248):return renameFile(_0x30f630[_0x3bb01f(0x1fb)]||_0x30f630[_0x3bb01f(0x25c)],_0x30f630['to']);case _0x3bb01f(0x234):return copyFile(_0x30f630[_0x3bb01f(0x1fb)]||_0x30f630[_0x3bb01f(0x25c)],_0x30f630['to']);case _0x3bb01f(0x1a9):return fileInfo(_0x30f630[_0x3bb01f(0x25c)]);case _0x3bb01f(0x1c6):return readFileLines(_0x30f630[_0x3bb01f(0x25c)],_0x30f630[_0x3bb01f(0x25e)]||0x1,_0x30f630['end']||0x32);case'find_files':{const {findFiles:_0x505cbf}=await import(_0x3bb01f(0x21d));return _0x505cbf(_0x30f630[_0x3bb01f(0x25c)]||'.',_0x30f630[_0x3bb01f(0x1bc)]);}case _0x3bb01f(0x214):{const {searchDirectory:_0x23d473}=await import(_0x3bb01f(0x21d));return _0x23d473(_0x30f630[_0x3bb01f(0x25c)]||'.',_0x30f630['pattern']);}case'git_status':return gitStatus();case'git_diff':return gitDiff(_0x30f630[_0x3bb01f(0x25c)]);case _0x3bb01f(0x1df):return gitLog(_0x30f630[_0x3bb01f(0x1e9)]||0xa);case _0x3bb01f(0x231):return gitAdd(_0x30f630['path']||'.');case _0x3bb01f(0x1dc):return gitCommit(_0x30f630[_0x3bb01f(0x1c1)]);case _0x3bb01f(0x1a6):return gitBranch();case _0x3bb01f(0x242):return fetchUrl(_0x30f630[_0x3bb01f(0x22b)]);case _0x3bb01f(0x232):return a25_0x4faced(_0x30f630['url'],_0x30f630[_0x3bb01f(0x25c)]);case'get_env':return getEnv(_0x30f630[_0x3bb01f(0x1ad)]);case _0x3bb01f(0x1cf):return setEnv(_0x30f630[_0x3bb01f(0x1ad)],_0x30f630['value']);case'get_system_info':return getSystemInfo();case _0x3bb01f(0x18e):return clipboardRead();case _0x3bb01f(0x22f):return clipboardWrite(_0x30f630[_0x3bb01f(0x17e)]);case _0x3bb01f(0x249):return tree(_0x30f630[_0x3bb01f(0x25c)]||'.',_0x30f630[_0x3bb01f(0x251)]||0x3);case'grep_recursive':return grepRecursive(_0x30f630[_0x3bb01f(0x25c)]||'.',_0x30f630[_0x3bb01f(0x1bc)],_0x30f630[_0x3bb01f(0x262)]);case _0x3bb01f(0x1c2):return replaceInFiles(_0x30f630['path']||'.',_0x30f630[_0x3bb01f(0x23f)],_0x30f630[_0x3bb01f(0x1f6)],_0x30f630[_0x3bb01f(0x262)]);case _0x3bb01f(0x222):return powershellRun(_0x30f630['script']||_0x30f630[_0x3bb01f(0x21a)]);case'zip_files':return zipFiles(_0x30f630[_0x3bb01f(0x174)]||[_0x30f630[_0x3bb01f(0x25c)]],_0x30f630[_0x3bb01f(0x173)]||_0x3bb01f(0x17a));case _0x3bb01f(0x1b8):return unzipFiles(_0x30f630['path'],_0x30f630['output']||'.');case _0x3bb01f(0x1a0):return writeJson(_0x30f630[_0x3bb01f(0x25c)],_0x30f630[_0x3bb01f(0x25d)]);case _0x3bb01f(0x205):return readJson(_0x30f630[_0x3bb01f(0x25c)]);case'patch_file':return patchFile(_0x30f630[_0x3bb01f(0x25c)],_0x30f630[_0x3bb01f(0x18d)]);case _0x3bb01f(0x19e):return openInEditor(_0x30f630[_0x3bb01f(0x25c)]);default:return{'error':_0x3bb01f(0x1a4)+_0x22d366};}}function estimateTime(_0x244c84,_0x3d549f){const _0x4129ee=a25_0x1de38d;if(_0x244c84==='screenshot')return _0x4129ee(0x25b);if(_0x244c84===_0x4129ee(0x266)||_0x244c84===_0x4129ee(0x21e)||_0x244c84==='terminate')return _0x4129ee(0x182);if(_0x244c84==='run_command'){const _0x548652=(_0x3d549f['command']||'')[_0x4129ee(0x17d)]();if(_0x548652[_0x4129ee(0x1fe)](_0x4129ee(0x1ee))||_0x548652['includes'](_0x4129ee(0x185)))return _0x4129ee(0x20a);if(_0x548652[_0x4129ee(0x1fe)](_0x4129ee(0x22a))||_0x548652[_0x4129ee(0x1fe)]('pnpm\x20install'))return _0x4129ee(0x18f);if(_0x548652['includes'](_0x4129ee(0x1b4))||_0x548652['includes']('pnpm\x20init'))return'~30s';if(_0x548652[_0x4129ee(0x1fe)](_0x4129ee(0x1d9)))return'~1\x20min';if(_0x548652[_0x4129ee(0x1fe)](_0x4129ee(0x201)))return _0x4129ee(0x18f);}return _0x4129ee(0x25b);}function getActionDescription(_0xfaf6bc,_0x24882c){const _0x3c097f=a25_0x1de38d;if(_0xfaf6bc===_0x3c097f(0x255)){let _0x3b1714=_0x24882c[_0x3c097f(0x21a)]||_0x3c097f(0x21a);if(_0x3b1714[_0x3c097f(0x20f)]>0x1e)_0x3b1714=_0x3b1714[_0x3c097f(0x1dd)](0x0,0x1b)+_0x3c097f(0x188);return'Running:\x20'+_0x3b1714;}if(_0xfaf6bc===_0x3c097f(0x181))return _0x3c097f(0x1cc)+_0x24882c[_0x3c097f(0x25c)];if(_0xfaf6bc===_0x3c097f(0x250))return _0x3c097f(0x194)+_0x24882c[_0x3c097f(0x25c)];if(_0xfaf6bc==='screenshot')return _0x3c097f(0x23b);return _0x3c097f(0x24e)+_0xfaf6bc+_0x3c097f(0x188);}async function processTelegramAgentLoop(_0x3e2049,_0x41db4a,_0x228b7e,_0x14dbf4){const _0x36fe57=a25_0x1de38d;let _0x1bf96b=0x0;const _0x57205b=0x14;let _0x502fd7=![];const _0x18d4a8=[];while(_0x1bf96b<_0x57205b){_0x1bf96b++;bot&&bot['api'][_0x36fe57(0x209)](_0x3e2049,'typing')[_0x36fe57(0x1e2)](()=>{});a25_0xbdcdf2[_0x36fe57(0x1a8)]('[Telegram]\x20Iteration\x20'+_0x1bf96b+_0x36fe57(0x188));let _0x5c9588='';try{const _0x17f5a4=await sendChatMessage(_0x228b7e,_0x41db4a,_0x31ba27=>{_0x5c9588+=_0x31ba27;});_0x5c9588=_0x17f5a4[_0x36fe57(0x256)];}catch(_0x1801f3){await bot?.[_0x36fe57(0x21c)][_0x36fe57(0x21b)](_0x3e2049,_0x36fe57(0x23d)+(_0x1801f3[_0x36fe57(0x1c1)]?.[_0x36fe57(0x1dd)](0x0,0x1e)||_0x36fe57(0x1f1)));return;}_0x41db4a[_0x36fe57(0x210)]({'role':_0x36fe57(0x252),'content':_0x5c9588});let _0x9e562=_0x5c9588[_0x36fe57(0x1ec)](/```tool\s*([\s\S]*?)```/);!_0x9e562&&(_0x9e562=_0x5c9588['match'](/\*\*\*tool\s*([\s\S]*?)\*\*\*/));!_0x9e562&&(_0x9e562=_0x5c9588[_0x36fe57(0x1ec)](/\`\`\`json\s*({[\s\S]*?"name"[\s\S]*?})\s*\`\`\`/));if(!_0x9e562){let _0x46ff5a=_0x5c9588['replace'](/\<reasoning\>[\s\S]*?\<\/reasoning\>/g,'')['replace'](/\<text\>|\<\/text\>/g,'')[_0x36fe57(0x1f6)](/```tool[\s\S]*?```/g,'')[_0x36fe57(0x1f6)](/\*\*\*tool[\s\S]*?\*\*\*/g,'')[_0x36fe57(0x1f6)](/```json\s*{\s*"tool"[\s\S]*?```/g,'')[_0x36fe57(0x1f6)](/```json\s*{\s*"command"[\s\S]*?```/g,'')[_0x36fe57(0x1f6)](/\*\*(.+?)\*\*/g,'$1')[_0x36fe57(0x1f6)](/\*(.+?)\*/g,'$1')[_0x36fe57(0x1f6)](/__(.+?)__/g,'$1')['replace'](/_(.+?)_/g,'$1')[_0x36fe57(0x1f6)](/#{1,6}\s*/g,'')[_0x36fe57(0x1f6)](/^[-*+]\s+/gm,'')[_0x36fe57(0x1f6)](/^\d+\.\s+/gm,'')[_0x36fe57(0x1f6)](/`([^`]+)`/g,'$1')['replace'](/\[([^\]]+)\]\([^)]+\)/g,'$1')['trim']();const _0x2d8b79=_0x46ff5a[_0x36fe57(0x1b7)]('\x0a')[_0x36fe57(0x1d0)](_0xfc5016=>_0xfc5016[_0x36fe57(0x1ef)]()&&_0xfc5016[_0x36fe57(0x1ef)]()['length']>0x1);if(_0x46ff5a[_0x36fe57(0x1ef)]()){if(_0x18d4a8[_0x36fe57(0x20f)]>0x0){await saveTaskHistory(_0x14dbf4,_0x18d4a8);const _0x14800a=_0x36fe57(0x1ac)+_0x18d4a8['map'](_0x877f38=>'-\x20'+_0x877f38)[_0x36fe57(0x1ae)]('\x0a');await bot?.[_0x36fe57(0x21c)][_0x36fe57(0x21b)](_0x3e2049,_0x46ff5a+_0x14800a)['catch'](()=>{});}else await bot?.[_0x36fe57(0x21c)][_0x36fe57(0x21b)](_0x3e2049,_0x46ff5a)[_0x36fe57(0x1e2)](()=>{});}break;}try{const _0x32dca7=_0x9e562[0x1][_0x36fe57(0x1ef)]();a25_0xbdcdf2[_0x36fe57(0x1a8)](_0x36fe57(0x1b1)+_0x32dca7);const _0x2ca96a=JSON[_0x36fe57(0x1ff)](_0x32dca7);a25_0xbdcdf2[_0x36fe57(0x1a8)](_0x36fe57(0x184)+JSON[_0x36fe57(0x179)](_0x2ca96a));const _0x2479a9=estimateTime(_0x2ca96a[_0x36fe57(0x1ad)],_0x2ca96a[_0x36fe57(0x25a)]),_0x1b9556=getActionDescription(_0x2ca96a[_0x36fe57(0x1ad)],_0x2ca96a[_0x36fe57(0x25a)]);_0x18d4a8[_0x36fe57(0x210)](_0x1b9556[_0x36fe57(0x1f6)](/\(\~.*\)/,'')['trim']()),await updateStatus(_0x3e2049,_0x1b9556+'\x20('+_0x2479a9+')'),_0x502fd7=!![],a25_0xbdcdf2[_0x36fe57(0x1aa)](_0x36fe57(0x20e)+_0x2ca96a[_0x36fe57(0x1ad)]);const _0x1b0026=performance['now'](),_0x77882f=await executeToolCall(_0x2ca96a[_0x36fe57(0x1ad)],_0x2ca96a[_0x36fe57(0x25a)],_0x3e2049),_0x2d47b8=((performance[_0x36fe57(0x17b)]()-_0x1b0026)/0x3e8)[_0x36fe57(0x223)](0x1);a25_0xbdcdf2[_0x36fe57(0x193)](_0x2ca96a[_0x36fe57(0x1ad)],Object[_0x36fe57(0x207)](_0x2ca96a[_0x36fe57(0x25a)])[0x0]||'',_0x36fe57(0x1af)+_0x2d47b8+'s'),_0x41db4a[_0x36fe57(0x210)]({'role':_0x36fe57(0x1ca),'content':_0x36fe57(0x200)+_0x2ca96a[_0x36fe57(0x1ad)]+':\x0a'+JSON[_0x36fe57(0x179)](_0x77882f,null,0x2)}),await new Promise(_0x1c18d2=>setTimeout(_0x1c18d2,0xc8));}catch(_0x40bf3c){a25_0xbdcdf2[_0x36fe57(0x1f4)](_0x36fe57(0x1de)+_0x40bf3c),_0x41db4a['push']({'role':'user','content':_0x36fe57(0x1ba)+_0x40bf3c+_0x36fe57(0x215)});}}_0x1bf96b>=_0x57205b&&await bot?.[_0x36fe57(0x21c)][_0x36fe57(0x21b)](_0x3e2049,'Stopped\x20(max\x20steps)');}async function handleMessage(_0x13fb98){const _0x11b923=a25_0x1de38d,_0x57041f=_0x13fb98[_0x11b923(0x1c1)]?.['text']?.[_0x11b923(0x1ef)](),_0x33217a=_0x13fb98[_0x11b923(0x1fb)]?.['id'];if(!_0x57041f||!_0x33217a||!_0x13fb98[_0x11b923(0x1fc)]?.['id'])return;const _0x5d8713=_0x13fb98[_0x11b923(0x1fc)]['id'],_0x304534=_0x33217a;if(!a25_0x161d0b['isAllowedChatId'](_0x304534)){const _0x2c8605=a25_0x161d0b['getSecurityPin']();if(_0x2c8605&&!verifiedSessions[_0x11b923(0x1d5)](_0x304534)){if(_0x57041f===_0x2c8605){verifiedSessions[_0x11b923(0x1f2)](_0x304534),a25_0x161d0b[_0x11b923(0x1be)](_0x304534),await _0x13fb98[_0x11b923(0x22d)]('Verified');return;}await _0x13fb98[_0x11b923(0x22d)](_0x11b923(0x259));return;}!_0x2c8605&&a25_0x161d0b[_0x11b923(0x1be)](_0x304534);}if(_0x57041f==='/start'){await _0x13fb98[_0x11b923(0x22d)]('Woozlit\x20Remote\x20v2.2.0\x0a\x0aConnected:\x20'+process[_0x11b923(0x19d)]()+_0x11b923(0x230));return;}if(_0x57041f===_0x11b923(0x254)){chatHistories['delete'](_0x5d8713),statusMessages[_0x11b923(0x1cd)](_0x5d8713),await _0x13fb98['reply']('Cleared');return;}if(_0x57041f===_0x11b923(0x187)){chatHistories[_0x11b923(0x1cd)](_0x5d8713),statusMessages[_0x11b923(0x1cd)](_0x5d8713),await _0x13fb98[_0x11b923(0x22d)]('New\x20chat\x20session\x20started.\x20How\x20can\x20I\x20help?');return;}if(_0x57041f[_0x11b923(0x1ce)](_0x11b923(0x1b9))){const _0x578450=_0x57041f[_0x11b923(0x265)](0x5)[_0x11b923(0x1ef)]();if(!_0x578450){await _0x13fb98[_0x11b923(0x22d)](_0x11b923(0x203));return;}await _0x13fb98['replyWithChatAction'](_0x11b923(0x24c));const _0x4eb635=await runCommand(_0x578450,undefined,![],0x7530),_0x14b104=_0x4eb635[_0x11b923(0x1d1)]||_0x4eb635[_0x11b923(0x17c)]||_0x11b923(0x211),_0x2ecb4a=_0x14b104[_0x11b923(0x20f)]>0xbb8?_0x14b104[_0x11b923(0x1dd)](0x0,0xbb8)+_0x11b923(0x188):_0x14b104;await _0x13fb98[_0x11b923(0x22d)](_0x11b923(0x1d7)+_0x4eb635['exitCode']+'\x0a\x0a'+_0x2ecb4a);return;}if(_0x57041f[_0x11b923(0x1ce)]('/files')){const _0x1b0675=_0x57041f[_0x11b923(0x265)](0x6)[_0x11b923(0x1ef)]()||'.',_0x2079b7=listDirectory(_0x1b0675);if(_0x2079b7[_0x11b923(0x1bd)]&&_0x2079b7['entries']){const _0x21a7b2=_0x2079b7[_0x11b923(0x21f)]['slice'](0x0,0x28)[_0x11b923(0x204)](_0x10aeb2=>{const _0xe5e9a9=_0x11b923,_0x4b8ba0=_0x10aeb2[_0xe5e9a9(0x1c9)]===_0xe5e9a9(0x221)?_0xe5e9a9(0x269):_0xe5e9a9(0x1b0),_0x571f72=_0x10aeb2[_0xe5e9a9(0x183)]?'\x20('+_0x10aeb2[_0xe5e9a9(0x183)]+'b)':'';return _0x4b8ba0+'\x20'+_0x10aeb2[_0xe5e9a9(0x1ad)]+_0x571f72;})[_0x11b923(0x1ae)]('\x0a');await _0x13fb98[_0x11b923(0x22d)](_0x1b0675+_0x11b923(0x213)+_0x21a7b2);}else await _0x13fb98[_0x11b923(0x22d)](_0x2079b7[_0x11b923(0x1c1)]);return;}if(_0x57041f===_0x11b923(0x238)){const _0xfe0b61=gitStatus(),_0x33d274=tree('.',0x2),_0x25d86a=readJson(_0x11b923(0x240));let _0x80ce8d=_0x11b923(0x1d4)+process[_0x11b923(0x19d)]()+_0x11b923(0x206)+getSelectedModel()+'\x0a';if(_0x25d86a['success']&&_0x25d86a[_0x11b923(0x25d)]){const _0x54ce6e=_0x25d86a[_0x11b923(0x25d)];_0x80ce8d+=_0x11b923(0x24d)+(_0x54ce6e[_0x11b923(0x1ad)]||_0x11b923(0x243))+'\x20v'+(_0x54ce6e[_0x11b923(0x1a1)]||'?')+'\x0a';}_0xfe0b61['success']&&(_0x80ce8d+='\x0aGit\x20Status:\x0a'+(_0xfe0b61[_0x11b923(0x173)]||'Clean')+'\x0a');if(_0x33d274[_0x11b923(0x1bd)]&&_0x33d274[_0x11b923(0x249)]){const _0x4a0e99=_0x33d274['tree'][_0x11b923(0x1b7)]('\x0a')['slice'](0x0,0x14)['join']('\x0a');_0x80ce8d+=_0x11b923(0x176)+_0x4a0e99;}await _0x13fb98[_0x11b923(0x22d)](_0x80ce8d);return;}if(_0x57041f['startsWith'](_0x11b923(0x180))){const _0x5d0b9b=_0x57041f['slice'](0x4)[_0x11b923(0x1ef)]();try{process['chdir'](resolve(process[_0x11b923(0x19d)](),_0x5d0b9b)),await _0x13fb98[_0x11b923(0x22d)]('Changed\x20to:\x20'+process[_0x11b923(0x19d)]());}catch(_0x13a7c2){await _0x13fb98[_0x11b923(0x22d)](_0x11b923(0x23d)+_0x13a7c2);}return;}if(_0x57041f==='/screen'||_0x57041f===_0x11b923(0x236)){try{await _0x13fb98[_0x11b923(0x177)](_0x11b923(0x175));const _0x3eeca8=await takeScreenshot();await _0x13fb98[_0x11b923(0x1fd)](new InputFile(_0x3eeca8),{'caption':_0x11b923(0x195)}),await a25_0x32bb31[_0x11b923(0x25f)](_0x3eeca8)[_0x11b923(0x1e2)](()=>{});}catch(_0x176e60){await _0x13fb98['reply']('Screenshot\x20failed:\x20'+_0x176e60);}return;}if(_0x57041f==='/status'){const _0x34e447=readTerminalOutput(),_0x2f3187=_0x34e447[_0x11b923(0x1e4)]['length']>0x0?'\x0aProcesses:\x20'+_0x34e447[_0x11b923(0x1e4)][_0x11b923(0x1ae)](',\x20'):'';await _0x13fb98[_0x11b923(0x22d)](_0x11b923(0x1d4)+process[_0x11b923(0x19d)]()+_0x11b923(0x206)+getSelectedModel()+_0x2f3187);return;}if(_0x57041f===_0x11b923(0x191)){const _0x485aa1=terminateProcess();await _0x13fb98['reply'](_0x485aa1[_0x11b923(0x1c1)]);return;}const _0x467f75=await getOrCreateHistory(_0x5d8713);_0x467f75[_0x11b923(0x210)]({'role':_0x11b923(0x1ca),'content':_0x57041f}),a25_0xbdcdf2[_0x11b923(0x1aa)](_0x11b923(0x18c)+_0x13fb98[_0x11b923(0x1fb)][_0x11b923(0x1f3)]+':\x20'+_0x57041f),await processTelegramAgentLoop(_0x5d8713,_0x467f75,getSelectedModel(),_0x57041f);}export async function startBot(){const _0x599954=a25_0x1de38d,_0x3cb864=a25_0x161d0b[_0x599954(0x208)]();if(!_0x3cb864)return a25_0xbdcdf2[_0x599954(0x1f4)](_0x599954(0x1a2)),![];if(isRunning&&bot)return a25_0xbdcdf2['warn'](_0x599954(0x1fa)),!![];try{bot=new Bot(_0x3cb864),bot['on'](_0x599954(0x1db),handleMessage),bot['on']('message:voice',async _0x3e945d=>{const _0x234293=_0x599954,_0xc46f80=_0x3e945d[_0x234293(0x1fc)]['id'],_0x3d2401=_0x3e945d['from']?.['id'];if(!_0x3d2401||!a25_0x161d0b[_0x234293(0x19c)](_0x3d2401))return;try{const _0x4696cc=_0x3e945d[_0x234293(0x1c1)][_0x234293(0x1e1)]?.[_0x234293(0x1b2)];if(!_0x4696cc)return;await _0x3e945d['replyWithChatAction'](_0x234293(0x24c));const _0x2739e1=await _0x3e945d[_0x234293(0x21c)][_0x234293(0x1f0)](_0x4696cc),_0x58df5b=_0x234293(0x1f9)+_0x3cb864+'/'+_0x2739e1[_0x234293(0x220)];if(!_0x58df5b)return;const _0x3a42c5=await fetch(_0x58df5b),_0x5f038b=await _0x3a42c5[_0x234293(0x19b)](),_0x5c392f=Buffer[_0x234293(0x1fb)](_0x5f038b),_0x160cef=join(tmpdir(),_0x234293(0x171)+Date['now']()+'.ogg');await a25_0x32bb31['writeFile'](_0x160cef,_0x5c392f),await _0x3e945d[_0x234293(0x177)](_0x234293(0x24c));const _0x108562=await processVoiceMessage(_0x160cef);await a25_0x32bb31[_0x234293(0x25f)](_0x160cef)[_0x234293(0x1e2)](()=>{});if(_0x108562[_0x234293(0x17e)]){const _0x2e7ad5=await getOrCreateHistory(_0xc46f80);_0x2e7ad5[_0x234293(0x210)]({'role':_0x234293(0x1ca),'content':_0x234293(0x263)+_0x108562[_0x234293(0x17e)]}),a25_0xbdcdf2[_0x234293(0x1aa)](_0x234293(0x18c)+_0x3e945d[_0x234293(0x1fb)]?.[_0x234293(0x1f3)]+_0x234293(0x235)+_0x108562['text']),await processTelegramAgentLoop(_0xc46f80,_0x2e7ad5,getSelectedModel(),_0x108562[_0x234293(0x17e)]);}else await _0x3e945d[_0x234293(0x22d)](_0x234293(0x199));}catch(_0x5f12ee){a25_0xbdcdf2[_0x234293(0x1f4)]('Voice\x20error:\x20'+_0x5f12ee['message']),await _0x3e945d[_0x234293(0x22d)](_0x234293(0x1d6)+_0x5f12ee[_0x234293(0x1c1)]);}}),bot['on']('message:document',async _0x4197a2=>{const _0x1975c4=_0x599954,_0x1de222=_0x4197a2[_0x1975c4(0x1fc)]['id'],_0x38888c=_0x4197a2[_0x1975c4(0x1fb)]?.['id'];if(!_0x38888c||!a25_0x161d0b[_0x1975c4(0x19c)](_0x38888c))return;try{const _0x16b8e2=_0x4197a2['message'][_0x1975c4(0x24b)];if(!_0x16b8e2)return;await _0x4197a2[_0x1975c4(0x177)](_0x1975c4(0x24c));const _0xe9d553=await _0x4197a2['api'][_0x1975c4(0x1f0)](_0x16b8e2[_0x1975c4(0x1b2)]),_0x922e51='https://api.telegram.org/file/bot'+a25_0x161d0b['getBotToken']()+'/'+_0xe9d553[_0x1975c4(0x220)],_0x350b24=await fetch(_0x922e51),_0x4c3c14=Buffer[_0x1975c4(0x1fb)](await _0x350b24[_0x1975c4(0x19b)]()),_0x50042d=join(process[_0x1975c4(0x19d)](),_0x16b8e2[_0x1975c4(0x1e6)]||_0x1975c4(0x17f)+Date[_0x1975c4(0x17b)]()),{writeFileSync:_0x5844d0}=await import('fs');_0x5844d0(_0x50042d,_0x4c3c14);const _0x4473d6=_0x4197a2['message']['caption']||'',_0x273d5f=await getOrCreateHistory(_0x1de222);_0x273d5f[_0x1975c4(0x210)]({'role':'user','content':'[File\x20received:\x20'+_0x16b8e2['file_name']+'\x20('+_0x4c3c14[_0x1975c4(0x20f)]+_0x1975c4(0x1e7)+_0x50042d+']'+(_0x4473d6?_0x1975c4(0x1b6)+_0x4473d6:'')}),a25_0xbdcdf2[_0x1975c4(0x1aa)](_0x1975c4(0x1eb)+_0x16b8e2[_0x1975c4(0x1e6)]+_0x1975c4(0x196)+_0x50042d),await _0x4197a2[_0x1975c4(0x22d)]('Saved:\x20'+_0x16b8e2[_0x1975c4(0x1e6)]+'\x20('+_0x4c3c14[_0x1975c4(0x20f)]+'\x20bytes)'),_0x4473d6&&await processTelegramAgentLoop(_0x1de222,_0x273d5f,getSelectedModel(),_0x4473d6);}catch(_0x20214b){await _0x4197a2[_0x1975c4(0x22d)](_0x1975c4(0x1f8)+_0x20214b[_0x1975c4(0x1c1)]);}}),setInterval(()=>{if(bot)checkReminders(bot);},0xea60),bot[_0x599954(0x1e2)](_0x4a5679=>{const _0x4e03d7=_0x599954;_0x4a5679[_0x4e03d7(0x1c1)]?.[_0x4e03d7(0x1fe)](_0x4e03d7(0x1c3))&&(a25_0xbdcdf2[_0x4e03d7(0x1f4)](_0x4e03d7(0x1c0)),stopBot());}),bot[_0x599954(0x21c)][_0x599954(0x246)]({'drop_pending_updates':!![]})[_0x599954(0x229)](()=>{const _0x43d19c=_0x599954;bot?.[_0x43d19c(0x25e)]();})[_0x599954(0x1e2)](_0x46f1b7=>{const _0x4ae98f=_0x599954;a25_0xbdcdf2[_0x4ae98f(0x1f4)](_0x4ae98f(0x197)+_0x46f1b7);}),isRunning=!![];const _0x10b68f=a25_0x161d0b[_0x599954(0x1c8)]();return _0x10b68f['length']>0x0&®isterTelegramBot(bot,_0x10b68f),a25_0xbdcdf2[_0x599954(0x1bd)](_0x599954(0x22e)),!![];}catch(_0x46522f){return a25_0xbdcdf2[_0x599954(0x1f4)](_0x599954(0x218)+_0x46522f[_0x599954(0x1c1)]),![];}}export function stopBot(){const _0x10ee2d=a25_0x1de38d;bot&&(bot[_0x10ee2d(0x18a)](),bot=null),isRunning=![],verifiedSessions[_0x10ee2d(0x245)]();}export function isBotRunning(){return isRunning;}
|
package/dist/telegram/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x4520b6=a26_0x5506;(function(_0x58fd68,_0x2a29ae){const _0x461c51=a26_0x5506,_0xda345c=_0x58fd68();while(!![]){try{const _0x5cdbf5=-parseInt(_0x461c51(0x17d))/0x1+-parseInt(_0x461c51(0x180))/0x2*(parseInt(_0x461c51(0x179))/0x3)+parseInt(_0x461c51(0x189))/0x4+parseInt(_0x461c51(0x185))/0x5*(parseInt(_0x461c51(0x190))/0x6)+parseInt(_0x461c51(0x174))/0x7*(-parseInt(_0x461c51(0x176))/0x8)+-parseInt(_0x461c51(0x173))/0x9+parseInt(_0x461c51(0x17b))/0xa;if(_0x5cdbf5===_0x2a29ae)break;else _0xda345c['push'](_0xda345c['shift']());}catch(_0x5f1555){_0xda345c['push'](_0xda345c['shift']());}}}(a26_0x1b31,0x7cad6));function a26_0x1b31(){const _0x568ed0=['get','54150dRAEdd','enabled','aes-256-cbc','push','1079732Kmtgvl','update','split','digest','woozlit-cli-telegram','createHash','randomBytes','84dGtSGU','set','6234408fPQwFG','2422gFiNpF','includes','15784hNBChg','from','createCipheriv','3375vdjqEK','length','21271040VmGehE','utf8','416234mCrLBO','botToken','hex','438jrAdWE','final','sha256','allowedChatIds'];a26_0x1b31=function(){return _0x568ed0;};return a26_0x1b31();}import a26_0x3be5db from'conf';import a26_0x63ba04 from'crypto';const config=new a26_0x3be5db({'projectName':a26_0x4520b6(0x18d),'defaults':{'botToken':'','allowedChatIds':[],'securityPin':'','enabled':![]}}),ENCRYPTION_KEY='woozlit_telegram_secure_key_2026';function encrypt(_0x5897ba){const _0x50ef9f=a26_0x4520b6,_0x3e4612=a26_0x63ba04[_0x50ef9f(0x18f)](0x10),_0x2a6b09=a26_0x63ba04[_0x50ef9f(0x18e)](_0x50ef9f(0x182))['update'](ENCRYPTION_KEY)[_0x50ef9f(0x18c)](),_0x1784f9=a26_0x63ba04[_0x50ef9f(0x178)]('aes-256-cbc',_0x2a6b09,_0x3e4612);let _0x42d116=_0x1784f9[_0x50ef9f(0x18a)](_0x5897ba,_0x50ef9f(0x17c),_0x50ef9f(0x17f));return _0x42d116+=_0x1784f9[_0x50ef9f(0x181)](_0x50ef9f(0x17f)),_0x3e4612['toString'](_0x50ef9f(0x17f))+':'+_0x42d116;}function decrypt(_0x3378cc){const _0x5a7abf=a26_0x4520b6;try{const [_0x26d94a,_0x218ad9]=_0x3378cc[_0x5a7abf(0x18b)](':');if(!_0x26d94a||!_0x218ad9)return'';const _0x53e570=Buffer[_0x5a7abf(0x177)](_0x26d94a,_0x5a7abf(0x17f)),_0x42c8bf=a26_0x63ba04['createHash'](_0x5a7abf(0x182))['update'](ENCRYPTION_KEY)['digest'](),_0x202976=a26_0x63ba04['createDecipheriv'](_0x5a7abf(0x187),_0x42c8bf,_0x53e570);let _0x2d938e=_0x202976[_0x5a7abf(0x18a)](_0x218ad9,_0x5a7abf(0x17f),_0x5a7abf(0x17c));return _0x2d938e+=_0x202976[_0x5a7abf(0x181)]('utf8'),_0x2d938e;}catch{return'';}}export function setBotToken(_0x28b45){const _0x59e462=a26_0x4520b6;config[_0x59e462(0x172)](_0x59e462(0x17e),encrypt(_0x28b45));}export function getBotToken(){const _0x47cc6a=a26_0x4520b6,_0x501828=config[_0x47cc6a(0x184)]('botToken');if(!_0x501828)return'';return decrypt(_0x501828);}export function setSecurityPin(_0x247b83){const _0x4d00b7=a26_0x4520b6;config[_0x4d00b7(0x172)]('securityPin',encrypt(_0x247b83));}export function getSecurityPin(){const _0x183915=a26_0x4520b6,_0x524a57=config[_0x183915(0x184)]('securityPin');if(!_0x524a57)return'';return decrypt(_0x524a57);}export function addAllowedChatId(_0x4be6ce){const _0x180cff=a26_0x4520b6,_0xd23a01=config['get']('allowedChatIds');!_0xd23a01['includes'](_0x4be6ce)&&(_0xd23a01[_0x180cff(0x188)](_0x4be6ce),config['set'](_0x180cff(0x183),_0xd23a01));}export function removeAllowedChatId(_0x367fd9){const _0x4de4e0=a26_0x4520b6,_0x4967e7=config[_0x4de4e0(0x184)]('allowedChatIds');config[_0x4de4e0(0x172)](_0x4de4e0(0x183),_0x4967e7['filter'](_0x592ee6=>_0x592ee6!==_0x367fd9));}export function getAllowedChatIds(){const _0x242984=a26_0x4520b6;return config[_0x242984(0x184)]('allowedChatIds');}export function isAllowedChatId(_0x385080){const _0x53cf6d=a26_0x4520b6,_0x4261a5=config[_0x53cf6d(0x184)](_0x53cf6d(0x183));return _0x4261a5[_0x53cf6d(0x17a)]===0x0||_0x4261a5[_0x53cf6d(0x175)](_0x385080);}export function setEnabled(_0x29dfcd){const _0x42bc78=a26_0x4520b6;config[_0x42bc78(0x172)](_0x42bc78(0x186),_0x29dfcd);}export function isEnabled(){const _0x21f90a=a26_0x4520b6;return config[_0x21f90a(0x184)](_0x21f90a(0x186));}export function isConfigured(){return!!getBotToken();}function a26_0x5506(_0x123dc8,_0x3338c3){_0x123dc8=_0x123dc8-0x172;const _0x1b3171=a26_0x1b31();let _0x550635=_0x1b3171[_0x123dc8];return _0x550635;}export function clearConfig(){config['clear']();}
|
package/dist/telegram/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1696e1,_0x42cad5){var _0x10bf72=a27_0xd70d,_0x35dc07=_0x1696e1();while(!![]){try{var _0x4bae9a=parseInt(_0x10bf72(0x1e3))/0x1*(parseInt(_0x10bf72(0x1dc))/0x2)+-parseInt(_0x10bf72(0x1e0))/0x3+-parseInt(_0x10bf72(0x1da))/0x4+parseInt(_0x10bf72(0x1df))/0x5*(parseInt(_0x10bf72(0x1e2))/0x6)+-parseInt(_0x10bf72(0x1db))/0x7+-parseInt(_0x10bf72(0x1e4))/0x8*(-parseInt(_0x10bf72(0x1dd))/0x9)+-parseInt(_0x10bf72(0x1e1))/0xa*(-parseInt(_0x10bf72(0x1de))/0xb);if(_0x4bae9a===_0x42cad5)break;else _0x35dc07['push'](_0x35dc07['shift']());}catch(_0x213479){_0x35dc07['push'](_0x35dc07['shift']());}}}(a27_0x8c65,0x705e9));export*from'./config.js';function a27_0x8c65(){var _0x5ae0c5=['20cPxKnr','1953582xlmsoc','43sgQrbt','4016naFcWR','2284452mtcQtx','1644293pUpcGv','19956DdNMLV','14436Eafitk','380875DsJtgf','10slYDjD','2065287pmwpzX'];a27_0x8c65=function(){return _0x5ae0c5;};return a27_0x8c65();}function a27_0xd70d(_0x27e281,_0x15be6e){_0x27e281=_0x27e281-0x1da;var _0x8c652a=a27_0x8c65();var _0xd70dc6=_0x8c652a[_0x27e281];return _0xd70dc6;}export{startBot,stopBot,isBotRunning}from'./bot.js';export{setupTelegram}from'./setup.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x9613(_0x55ec12,_0x44b69d){_0x55ec12=_0x55ec12-0x15a;const _0x20c528=a28_0x20c5();let _0x9613cc=_0x20c528[_0x55ec12];return _0x9613cc;}const a28_0xcd85f3=a28_0x9613;(function(_0x2276df,_0x1e2557){const _0x3277bc=a28_0x9613,_0x3256c1=_0x2276df();while(!![]){try{const _0x552b53=-parseInt(_0x3277bc(0x15d))/0x1+-parseInt(_0x3277bc(0x177))/0x2*(-parseInt(_0x3277bc(0x173))/0x3)+parseInt(_0x3277bc(0x160))/0x4*(-parseInt(_0x3277bc(0x16f))/0x5)+-parseInt(_0x3277bc(0x170))/0x6+parseInt(_0x3277bc(0x175))/0x7*(-parseInt(_0x3277bc(0x16e))/0x8)+-parseInt(_0x3277bc(0x166))/0x9+parseInt(_0x3277bc(0x15e))/0xa;if(_0x552b53===_0x1e2557)break;else _0x3256c1['push'](_0x3256c1['shift']());}catch(_0xdb2fbb){_0x3256c1['push'](_0x3256c1['shift']());}}}(a28_0x20c5,0x424c1));import{promises as a28_0x3e9ff2}from'fs';import{join}from'path';const WOOZLIT_DIR=join(process['env'][a28_0xcd85f3(0x171)]||process[a28_0xcd85f3(0x172)][a28_0xcd85f3(0x174)]||'.',a28_0xcd85f3(0x163)),REMINDERS_FILE=join(WOOZLIT_DIR,'reminders.json');function a28_0x20c5(){const _0x367568=['3001068lcNChW','random','now','message','utf-8','readFile','Failed\x20to\x20send\x20reminder\x20to\x20','filter','1540600yAdLIU','141930cJPIFV','2128584vlatkx','USERPROFILE','env','3qdjsef','HOME','7GsxcvP','toLocaleTimeString','97754VYXoPq',':\x20\x22','push','parse','sendMessage','chatId','297997AsrFhi','18272540WINVcD','length','60gsUPvf','writeFile','substring','.woozlit','api','timestamp'];a28_0x20c5=function(){return _0x367568;};return a28_0x20c5();}let reminders=[];export async function loadReminders(){const _0x3da3a4=a28_0xcd85f3;try{const _0x5083bb=await a28_0x3e9ff2[_0x3da3a4(0x16b)](REMINDERS_FILE,_0x3da3a4(0x16a));reminders=JSON[_0x3da3a4(0x15a)](_0x5083bb);}catch{reminders=[];}}export async function saveReminders(){const _0x462e97=a28_0xcd85f3;try{await a28_0x3e9ff2['mkdir'](WOOZLIT_DIR,{'recursive':!![]}),await a28_0x3e9ff2[_0x462e97(0x161)](REMINDERS_FILE,JSON['stringify'](reminders,null,0x2));}catch{}}export async function scheduleReminder(_0x589a24,_0x198cb6,_0x12993f){const _0x588b28=a28_0xcd85f3,_0x272add=Date['now']()+_0x198cb6*0x3c*0x3e8,_0x5040cd={'id':Math[_0x588b28(0x167)]()['toString'](0x24)[_0x588b28(0x162)](0x7),'chatId':_0x589a24,'timestamp':_0x272add,'message':_0x12993f};if(reminders[_0x588b28(0x15f)]===0x0)await loadReminders();reminders[_0x588b28(0x179)](_0x5040cd),await saveReminders();const _0xaec851=new Date(_0x272add)[_0x588b28(0x176)]();return'Reminder\x20set\x20for\x20'+_0xaec851+_0x588b28(0x178)+_0x12993f+'\x22';}export async function checkReminders(_0x33b58a){const _0x1ee2ab=a28_0xcd85f3;if(reminders[_0x1ee2ab(0x15f)]===0x0)await loadReminders();const _0x49b62a=Date[_0x1ee2ab(0x168)](),_0x1efede=reminders['filter'](_0x303164=>_0x303164['timestamp']>_0x49b62a),_0x51d281=reminders[_0x1ee2ab(0x16d)](_0x1ccc24=>_0x1ccc24[_0x1ee2ab(0x165)]<=_0x49b62a);if(_0x51d281[_0x1ee2ab(0x15f)]>0x0){for(const _0x27697b of _0x51d281){try{await _0x33b58a[_0x1ee2ab(0x164)][_0x1ee2ab(0x15b)](_0x27697b[_0x1ee2ab(0x15c)],'⏰\x20REMINDER:\x20'+_0x27697b[_0x1ee2ab(0x169)]);}catch(_0xb44909){console['error'](_0x1ee2ab(0x16c)+_0x27697b[_0x1ee2ab(0x15c)],_0xb44909);}}reminders=_0x1efede,await saveReminders();}}
|
package/dist/telegram/setup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x508231,_0x1fe51b){const _0x15281a=a29_0x483d,_0x47032e=_0x508231();while(!![]){try{const _0x4066db=parseInt(_0x15281a(0xc6))/0x1*(-parseInt(_0x15281a(0xbe))/0x2)+parseInt(_0x15281a(0xc5))/0x3+parseInt(_0x15281a(0xbd))/0x4*(parseInt(_0x15281a(0xba))/0x5)+parseInt(_0x15281a(0xbc))/0x6+parseInt(_0x15281a(0xc2))/0x7+parseInt(_0x15281a(0xc3))/0x8+parseInt(_0x15281a(0xc1))/0x9*(-parseInt(_0x15281a(0xb0))/0xa);if(_0x4066db===_0x1fe51b)break;else _0x47032e['push'](_0x47032e['shift']());}catch(_0x5d9e51){_0x47032e['push'](_0x47032e['shift']());}}}(a29_0x2cee,0xdc5ce));function a29_0x483d(_0x5bfa86,_0x2502da){_0x5bfa86=_0x5bfa86-0xb0;const _0x2ceeeb=a29_0x2cee();let _0x483dc9=_0x2ceeeb[_0x5bfa86];return _0x483dc9;}import{input}from'@inquirer/prompts';import*as a29_0xf9d5fd from'./config.js';import*as a29_0xe10f70 from'../ui/output.js';export async function setupTelegram(){const _0x18f20b=a29_0x483d;a29_0xe10f70['info'](_0x18f20b(0xbb)),a29_0xe10f70[_0x18f20b(0xb6)](_0x18f20b(0xb5));const _0x2f8a08=await input({'message':'Bot\x20Token:','validate':_0x12e8bf=>_0x12e8bf[_0x18f20b(0xc0)](':')?!![]:_0x18f20b(0xb2)});a29_0xf9d5fd['setBotToken'](_0x2f8a08),a29_0xe10f70['warn'](_0x18f20b(0xc4));const _0xe3912=await input({'message':_0x18f20b(0xb1)});_0xe3912?a29_0xf9d5fd[_0x18f20b(0xbf)](parseInt(_0xe3912)):a29_0xe10f70['info'](_0x18f20b(0xb4)),a29_0xe10f70[_0x18f20b(0xb7)](_0x18f20b(0xb9)),a29_0xe10f70[_0x18f20b(0xb8)](_0x18f20b(0xb3));}function a29_0x2cee(){const _0x547129=['dim','success','info','Telegram\x20configuration\x20saved!','5bekzPK','Setup\x20Telegram\x20Bot','7148190FSxnEp','5126692tyKRiQ','36402bPeFvX','addAllowedChatId','includes','2871999rmsGOb','10022824fquicF','5035120rWxVqW','You\x20also\x20need\x20to\x20allow\x20your\x20Telegram\x20User\x20ID.','1514163dQPndP','87DQGndO','80qMZWuA','Your\x20Telegram\x20Chat\x20ID\x20(numeric).\x20Leave\x20empty\x20if\x20unknown:','Invalid\x20token\x20format','Restart\x20the\x20CLI\x20to\x20start\x20the\x20bot.','You\x20can\x20add\x20your\x20Chat\x20ID\x20later\x20using\x20/telegram\x20allow\x20<id>\x20inside\x20the\x20CLI.','Get\x20your\x20token\x20from\x20@BotFather\x20on\x20Telegram.'];a29_0x2cee=function(){return _0x547129;};return a29_0x2cee();}
|
package/dist/tools/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1eb483,_0x27cc57){const _0x55785a=a30_0x3396,_0x2f1962=_0x1eb483();while(!![]){try{const _0x29bcd9=parseInt(_0x55785a(0xd6))/0x1*(-parseInt(_0x55785a(0xbc))/0x2)+parseInt(_0x55785a(0xc2))/0x3+parseInt(_0x55785a(0xb5))/0x4+parseInt(_0x55785a(0xd3))/0x5*(parseInt(_0x55785a(0xd8))/0x6)+parseInt(_0x55785a(0xc1))/0x7+-parseInt(_0x55785a(0xc9))/0x8*(parseInt(_0x55785a(0xba))/0x9)+-parseInt(_0x55785a(0xda))/0xa;if(_0x29bcd9===_0x27cc57)break;else _0x2f1962['push'](_0x2f1962['shift']());}catch(_0x5bbd66){_0x2f1962['push'](_0x2f1962['shift']());}}}(a30_0x49da,0xb161d));import{spawn}from'child_process';const activeProcesses=new Map();function a30_0x49da(){const _0x53bf2a=['27bzBFda','get','20OaVYIr','unref','env','error','\x0a[Process\x20running\x20in\x20background,\x20PID:\x20','9407356qSGzAb','1703088cjvmLj','No\x20active\x20processes','cwd','close','keys','pid','delete','1977272LcsPIV','[PID\x20','message','kill','slice','set','size','child','Sent\x20to\x20PID\x20','from','1210855rsUXlw','platform','output','15027FHmDjL','stdout','12ojZsOF','stdin','8168990VjwWZR','length','data','cmd.exe','win32','157028uYGpBn','write','/bin/sh','has','toString'];a30_0x49da=function(){return _0x53bf2a;};return a30_0x49da();}export async function runCommand(_0x47ee17,_0x31416c,_0x269aa2=![],_0xea30bf=0x7530){return new Promise(_0x222209=>{const _0x4241ef=a30_0x3396,_0x2ae7ba=process[_0x4241ef(0xd4)]===_0x4241ef(0xb4),_0x9a531e=_0x2ae7ba?_0x4241ef(0xb3):_0x4241ef(0xb7),_0x1d2088=_0x2ae7ba?'/c':'-c',_0x38bfec=spawn(_0x9a531e,[_0x1d2088,_0x47ee17],{'cwd':process[_0x4241ef(0xc4)](),'env':process[_0x4241ef(0xbe)],'detached':_0x269aa2,'stdio':'pipe'}),_0x52f6ed=_0x38bfec[_0x4241ef(0xc7)]||0x0;let _0x1a3eb5='',_0x320f96='',_0x1a749d=![];_0x52f6ed&&activeProcesses[_0x4241ef(0xce)](_0x52f6ed,{'child':_0x38bfec,'output':''});const _0xa8670d=setTimeout(()=>{const _0x2ad469=_0x4241ef;if(!_0x1a749d){_0x1a749d=!![];if(_0x269aa2&&_0x38bfec[_0x2ad469(0xbd)])_0x38bfec['unref']();_0x222209({'success':!![],'stdout':_0x1a3eb5+(_0x2ad469(0xc0)+_0x52f6ed+']'),'stderr':_0x320f96,'exitCode':0x0,'pid':_0x52f6ed});}},_0xea30bf);_0x38bfec[_0x4241ef(0xd7)]?.['on'](_0x4241ef(0xb2),_0x22510e=>{const _0x36e592=_0x4241ef,_0x19e796=_0x22510e['toString']();_0x1a3eb5+=_0x19e796;if(_0x52f6ed&&activeProcesses[_0x36e592(0xb8)](_0x52f6ed)){const _0x1943ef=activeProcesses[_0x36e592(0xbb)](_0x52f6ed);_0x1943ef[_0x36e592(0xd5)]+=_0x19e796;}if(!_0x1a749d&&_0x31416c)_0x31416c(_0x19e796);}),_0x38bfec['stderr']?.['on'](_0x4241ef(0xb2),_0x36def9=>{const _0x5b19dd=_0x4241ef,_0x212022=_0x36def9[_0x5b19dd(0xb9)]();_0x320f96+=_0x212022;if(_0x52f6ed&&activeProcesses[_0x5b19dd(0xb8)](_0x52f6ed)){const _0x311135=activeProcesses[_0x5b19dd(0xbb)](_0x52f6ed);_0x311135[_0x5b19dd(0xd5)]+=_0x212022;}if(!_0x1a749d&&_0x31416c)_0x31416c(_0x212022);}),_0x38bfec['on'](_0x4241ef(0xc5),_0x3f1669=>{const _0x3ad9b0=_0x4241ef;clearTimeout(_0xa8670d);if(_0x52f6ed)activeProcesses[_0x3ad9b0(0xc8)](_0x52f6ed);!_0x1a749d&&(_0x1a749d=!![],_0x222209({'success':_0x3f1669===0x0,'stdout':_0x1a3eb5,'stderr':_0x320f96,'exitCode':_0x3f1669||0x0,'pid':_0x52f6ed}));}),_0x38bfec['on'](_0x4241ef(0xbf),_0x41d532=>{const _0x334b06=_0x4241ef;clearTimeout(_0xa8670d);if(_0x52f6ed)activeProcesses[_0x334b06(0xc8)](_0x52f6ed);!_0x1a749d&&(_0x1a749d=!![],_0x222209({'success':![],'stdout':_0x1a3eb5,'stderr':_0x41d532[_0x334b06(0xcb)],'exitCode':0x1,'pid':_0x52f6ed}));});});}function a30_0x3396(_0x31d8d0,_0x493f73){_0x31d8d0=_0x31d8d0-0xb1;const _0x49da6f=a30_0x49da();let _0x3396b4=_0x49da6f[_0x31d8d0];return _0x3396b4;}export function readTerminalOutput(_0x4951ae){const _0x1e265b=a30_0x3396,_0x267197=Array[_0x1e265b(0xd2)](activeProcesses['keys']());if(_0x4951ae&&activeProcesses[_0x1e265b(0xb8)](_0x4951ae)){const _0x458ca7=activeProcesses[_0x1e265b(0xbb)](_0x4951ae);return{'output':_0x458ca7[_0x1e265b(0xd5)][_0x1e265b(0xcd)](-0x7d0),'running':!![],'pids':_0x267197};}let _0x55c3d0='';for(const [_0x51e3f1,_0x40f29d]of activeProcesses){_0x55c3d0+=_0x1e265b(0xca)+_0x51e3f1+']\x0a'+_0x40f29d[_0x1e265b(0xd5)]['slice'](-0x3e8)+'\x0a';}return{'output':_0x55c3d0||_0x1e265b(0xc3),'running':_0x267197[_0x1e265b(0xb1)]>0x0,'pids':_0x267197};}export function sendTerminalInput(_0x238fd8,_0x486a21){const _0x455179=a30_0x3396;if(_0x486a21&&activeProcesses[_0x455179(0xb8)](_0x486a21)){const _0x2d8626=activeProcesses[_0x455179(0xbb)](_0x486a21);return _0x2d8626['child']['stdin']?.[_0x455179(0xb6)](_0x238fd8+'\x0a'),{'success':!![],'message':_0x455179(0xd1)+_0x486a21};}for(const [_0x1a2752,_0x5685ba]of activeProcesses){return _0x5685ba[_0x455179(0xd0)][_0x455179(0xd9)]?.[_0x455179(0xb6)](_0x238fd8+'\x0a'),{'success':!![],'message':_0x455179(0xd1)+_0x1a2752};}return{'success':![],'message':'No\x20active\x20processes'};}export function terminateProcess(_0x3f9dbf){const _0x28455c=a30_0x3396;if(_0x3f9dbf&&activeProcesses['has'](_0x3f9dbf)){const _0x1d191c=activeProcesses[_0x28455c(0xbb)](_0x3f9dbf);return _0x1d191c[_0x28455c(0xd0)][_0x28455c(0xcc)](),activeProcesses[_0x28455c(0xc8)](_0x3f9dbf),{'success':!![],'message':'Terminated\x20PID\x20'+_0x3f9dbf};}if(activeProcesses[_0x28455c(0xcf)]>0x0)for(const [_0x1f5806,_0x353bec]of activeProcesses){return _0x353bec[_0x28455c(0xd0)]['kill'](),activeProcesses[_0x28455c(0xc8)](_0x1f5806),{'success':!![],'message':'Terminated\x20PID\x20'+_0x1f5806};}return{'success':![],'message':_0x28455c(0xc3)};}export function getActiveProcesses(){const _0x3c73aa=a30_0x3396;return Array[_0x3c73aa(0xd2)](activeProcesses[_0x3c73aa(0xc6)]());}
|