woozlit 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/auth/login.js +1 -1
  2. package/dist/browser/index.js +1 -1
  3. package/dist/browser/server.js +1 -1
  4. package/dist/browser/tools.js +1 -1
  5. package/dist/chat/agent.js +1 -1
  6. package/dist/config/mcp.js +1 -1
  7. package/dist/config/settings.js +1 -1
  8. package/dist/discord/client.js +1 -1
  9. package/dist/discord/config.js +1 -1
  10. package/dist/discord/index.js +1 -1
  11. package/dist/discord/setup.js +1 -1
  12. package/dist/email/config.js +1 -1
  13. package/dist/email/index.js +1 -1
  14. package/dist/email/service.js +1 -1
  15. package/dist/email/setup.js +1 -1
  16. package/dist/github/api.js +1 -1
  17. package/dist/github/auth.js +1 -1
  18. package/dist/github/auto-setup.js +1 -1
  19. package/dist/github/index.js +1 -1
  20. package/dist/github/manual-setup.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/mcp-servers/computer-use.js +1 -1
  23. package/dist/services/bot-manager.js +1 -1
  24. package/dist/services/notifications.js +1 -1
  25. package/dist/services/voice-agent.js +1 -1
  26. package/dist/telegram/bot.js +1 -1
  27. package/dist/telegram/config.js +1 -1
  28. package/dist/telegram/index.js +1 -1
  29. package/dist/telegram/reminders.js +1 -1
  30. package/dist/telegram/setup.js +1 -1
  31. package/dist/tools/command.js +1 -1
  32. package/dist/tools/file.js +1 -1
  33. package/dist/tools/git.js +1 -1
  34. package/dist/tools/index.js +1 -1
  35. package/dist/tools/mcp.js +1 -1
  36. package/dist/tools/network.js +1 -1
  37. package/dist/tools/project.js +1 -1
  38. package/dist/tools/rollback.js +1 -1
  39. package/dist/tools/rules.js +1 -1
  40. package/dist/tools/system.js +1 -1
  41. package/dist/twilio/config.js +1 -1
  42. package/dist/twilio/index.js +1 -1
  43. package/dist/twilio/server.js +1 -1
  44. package/dist/twilio/setup.js +1 -1
  45. package/dist/ui/output.js +1 -1
  46. package/dist/ui/select.js +1 -1
  47. package/dist/ui/themes.d.ts +13 -0
  48. package/dist/ui/themes.js +1 -1
  49. package/dist/utils/api.js +1 -1
  50. package/dist/utils/chat-history.js +1 -1
  51. package/dist/utils/history.js +1 -1
  52. package/dist/utils/mcp-installer.js +1 -1
  53. package/dist/utils/platform.js +1 -1
  54. package/dist/utils/storage.js +1 -1
  55. package/dist/utils/update-check.js +1 -1
  56. package/dist/utils/updater.d.ts +2 -0
  57. package/dist/utils/updater.js +1 -0
  58. package/dist/verify_repro.js +1 -1
  59. package/package.json +2 -1
@@ -1 +1 @@
1
- (function(_0x3f042b,_0x86b5db){const _0x7e5c76=a0_0x22be,_0x552190=_0x3f042b();while(!![]){try{const _0x52c96b=-parseInt(_0x7e5c76(0x7d))/0x1*(-parseInt(_0x7e5c76(0x90))/0x2)+-parseInt(_0x7e5c76(0x7a))/0x3+parseInt(_0x7e5c76(0x7f))/0x4+parseInt(_0x7e5c76(0x89))/0x5+parseInt(_0x7e5c76(0x82))/0x6*(parseInt(_0x7e5c76(0x87))/0x7)+-parseInt(_0x7e5c76(0x7b))/0x8*(parseInt(_0x7e5c76(0x92))/0x9)+-parseInt(_0x7e5c76(0x8e))/0xa*(parseInt(_0x7e5c76(0x93))/0xb);if(_0x52c96b===_0x86b5db)break;else _0x552190['push'](_0x552190['shift']());}catch(_0x4c0853){_0x552190['push'](_0x552190['shift']());}}}(a0_0x1275,0x72547));import a0_0x3ea3b2 from'open';import{createServer}from'http';import{getApiUrl}from'../config/settings.js';function a0_0x22be(_0x1df57f,_0xd9cf70){_0x1df57f=_0x1df57f-0x79;const _0x127513=a0_0x1275();let _0x22be3f=_0x127513[_0x1df57f];return _0x22be3f;}import{setToken,setUser,isLoggedIn,logout as a0_0x90eabb}from'../utils/storage.js';export async function login(){const _0x4b6b6e=getApiUrl(),_0x1fb54b=0x2694;return new Promise(_0x1e2e29=>{const _0x2a5059=createServer(async(_0x168d15,_0xc51cea)=>{const _0x3070f5=a0_0x22be,_0xb45c95=new URL(_0x168d15[_0x3070f5(0x8d)]||'',_0x3070f5(0x84)+_0x1fb54b);if(_0xb45c95[_0x3070f5(0x79)]===_0x3070f5(0x85)){const _0x2d172c=_0xb45c95[_0x3070f5(0x88)][_0x3070f5(0x81)](_0x3070f5(0x8b)),_0x48088c=_0xb45c95[_0x3070f5(0x88)][_0x3070f5(0x81)](_0x3070f5(0x91)),_0x5b8eef=_0xb45c95[_0x3070f5(0x88)]['get']('email'),_0x260861=_0xb45c95[_0x3070f5(0x88)][_0x3070f5(0x81)](_0x3070f5(0x86));_0x2d172c&&_0x48088c?(setToken(_0x2d172c),setUser(_0x48088c,_0x5b8eef||'',_0x260861||''),_0xc51cea[_0x3070f5(0x83)](0xc8,{'Content-Type':_0x3070f5(0x8a)}),_0xc51cea['end'](_0x3070f5(0x7c)),_0x2a5059[_0x3070f5(0x8c)](),_0x1e2e29(!![])):(_0xc51cea[_0x3070f5(0x83)](0x190,{'Content-Type':_0x3070f5(0x8a)}),_0xc51cea[_0x3070f5(0x8f)](_0x3070f5(0x80)),_0x2a5059[_0x3070f5(0x8c)](),_0x1e2e29(![]));}});_0x2a5059['listen'](_0x1fb54b,()=>{const _0x3e2bde=a0_0x22be,_0x17eac1=_0x4b6b6e+_0x3e2bde(0x7e)+_0x1fb54b+_0x3e2bde(0x85);a0_0x3ea3b2(_0x17eac1);}),setTimeout(()=>{const _0x2a7b63=a0_0x22be;_0x2a5059[_0x2a7b63(0x8c)](),_0x1e2e29(![]);},0x1d4c0);});}function a0_0x1275(){const _0x566b98=['982917pkXkHa','536BrnzDN','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<!DOCTYPE\x20html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<title>Woozlit\x20CLI</title>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\x20system-ui,\x20-apple-system,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20100vh;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20#0a0a0a;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20#fff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.container\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x202rem;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20h1\x20{\x20color:\x20#10b981;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p\x20{\x20color:\x20#9ca3af;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h1>Login\x20Successful</h1>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','71977oMbZAh','/auth/cli?callback=http://localhost:','3147316GNHznI','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<!DOCTYPE\x20html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<head><title>Woozlit\x20CLI</title></head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<body\x20style=\x22font-family:\x20sans-serif;\x20text-align:\x20center;\x20padding:\x202rem;\x20background:\x20#0a0a0a;\x20color:\x20#fff;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h1\x20style=\x22color:\x20#ef4444;\x22>Login\x20Failed</h1>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Missing\x20authentication\x20data.\x20Please\x20try\x20again.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','get','470700cgiepB','writeHead','http://localhost:','/callback','displayName','14qrPaHL','searchParams','611840kOKxiW','text/html','token','close','url','4030nINLIp','end','6UfSXXc','userId','14031soEDRM','10417ooCBxU','pathname'];a0_0x1275=function(){return _0x566b98;};return a0_0x1275();}export function logout(){a0_0x90eabb();}export{isLoggedIn};
1
+ function a0_0x5b2f(){const _0x3965fa=['searchParams','126840GSYnMu','end','/callback','close','1500443zVYDhS','listen','get','email','pathname','2727052gofJeL','displayName','writeHead','4487451SlRbnv','7421250QQOENJ','text/html','userId','http://localhost:','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<!DOCTYPE\x20html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<title>Woozlit\x20CLI</title>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\x20system-ui,\x20-apple-system,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20100vh;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20#0a0a0a;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20#fff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.container\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x202rem;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20h1\x20{\x20color:\x20#10b981;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p\x20{\x20color:\x20#9ca3af;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h1>Login\x20Successful</h1>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','4303910lvlGSO','url','9077019CrfWIO'];a0_0x5b2f=function(){return _0x3965fa;};return a0_0x5b2f();}(function(_0x51678b,_0x33bcff){const _0x3e4549=a0_0x3605,_0x2c07ef=_0x51678b();while(!![]){try{const _0x462362=parseInt(_0x3e4549(0x1cd))/0x1+parseInt(_0x3e4549(0x1d2))/0x2+parseInt(_0x3e4549(0x1d5))/0x3+parseInt(_0x3e4549(0x1c9))/0x4+-parseInt(_0x3e4549(0x1db))/0x5+-parseInt(_0x3e4549(0x1d6))/0x6+-parseInt(_0x3e4549(0x1c7))/0x7;if(_0x462362===_0x33bcff)break;else _0x2c07ef['push'](_0x2c07ef['shift']());}catch(_0x477ed3){_0x2c07ef['push'](_0x2c07ef['shift']());}}}(a0_0x5b2f,0xf3702));import a0_0x15c413 from'open';import{createServer}from'http';import{getApiUrl}from'../config/settings.js';import{setToken,setUser,isLoggedIn,logout as a0_0x230ff6}from'../utils/storage.js';export async function login(){const _0x1b3c77=getApiUrl(),_0x2f67bd=0x2694;return new Promise(_0x1fc115=>{const _0x23173a=a0_0x3605,_0x4e337b=createServer(async(_0x10aea2,_0x147ef5)=>{const _0x3b2aea=a0_0x3605,_0x1032c2=new URL(_0x10aea2[_0x3b2aea(0x1dc)]||'',_0x3b2aea(0x1d9)+_0x2f67bd);if(_0x1032c2[_0x3b2aea(0x1d1)]===_0x3b2aea(0x1cb)){const _0x261d0a=_0x1032c2[_0x3b2aea(0x1c8)][_0x3b2aea(0x1cf)]('token'),_0x3bab9d=_0x1032c2[_0x3b2aea(0x1c8)][_0x3b2aea(0x1cf)](_0x3b2aea(0x1d8)),_0x33cebf=_0x1032c2[_0x3b2aea(0x1c8)]['get'](_0x3b2aea(0x1d0)),_0x2e7662=_0x1032c2[_0x3b2aea(0x1c8)][_0x3b2aea(0x1cf)](_0x3b2aea(0x1d3));_0x261d0a&&_0x3bab9d?(setToken(_0x261d0a),setUser(_0x3bab9d,_0x33cebf||'',_0x2e7662||''),_0x147ef5[_0x3b2aea(0x1d4)](0xc8,{'Content-Type':_0x3b2aea(0x1d7)}),_0x147ef5[_0x3b2aea(0x1ca)](_0x3b2aea(0x1da)),_0x4e337b[_0x3b2aea(0x1cc)](),_0x1fc115(!![])):(_0x147ef5[_0x3b2aea(0x1d4)](0x190,{'Content-Type':'text/html'}),_0x147ef5[_0x3b2aea(0x1ca)]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<!DOCTYPE\x20html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<head><title>Woozlit\x20CLI</title></head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<body\x20style=\x22font-family:\x20sans-serif;\x20text-align:\x20center;\x20padding:\x202rem;\x20background:\x20#0a0a0a;\x20color:\x20#fff;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h1\x20style=\x22color:\x20#ef4444;\x22>Login\x20Failed</h1>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Missing\x20authentication\x20data.\x20Please\x20try\x20again.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'),_0x4e337b[_0x3b2aea(0x1cc)](),_0x1fc115(![]));}});_0x4e337b[_0x23173a(0x1ce)](_0x2f67bd,()=>{const _0x4d1e3b=_0x23173a,_0x2a13bb=_0x1b3c77+'/auth/cli?callback=http://localhost:'+_0x2f67bd+_0x4d1e3b(0x1cb);a0_0x15c413(_0x2a13bb);}),setTimeout(()=>{const _0x5d6f68=_0x23173a;_0x4e337b[_0x5d6f68(0x1cc)](),_0x1fc115(![]);},0x1d4c0);});}export function logout(){a0_0x230ff6();}function a0_0x3605(_0x5915f5,_0xb0356b){_0x5915f5=_0x5915f5-0x1c7;const _0x5b2f2d=a0_0x5b2f();let _0x36054e=_0x5b2f2d[_0x5915f5];return _0x36054e;}export{isLoggedIn};
@@ -1 +1 @@
1
- function a1_0xeaa8(_0x233bd6,_0x5755de){_0x233bd6=_0x233bd6-0xeb;const _0xae3172=a1_0xae31();let _0xeaa80c=_0xae3172[_0x233bd6];return _0xeaa80c;}function a1_0xae31(){const _0x446a72=['Click\x20an\x20element\x20on\x20the\x20page','browser_fill','bottom','Tab\x20ID\x20from\x20browser_open\x20or\x20browser_snapshot','string','807081VVurtb','287860ZvhtYK','Text\x20to\x20fill','direction','10321752iWxUrh','top','4674754cVBawU','query','number','Fill\x20a\x20form\x20field\x20or\x20input\x20element','Optional:\x20if\x20multiple\x20elements\x20match,\x20click\x20the\x20Nth\x20one\x20(0-indexed)','down','6OyBjbc','CSS\x20selector\x20for\x20the\x20element','12858435ytIsyj','text','1214293PMXnYm','tabId','150lVFrQV','3190860ipSYtb','object','Scroll\x20the\x20page\x20up\x20or\x20down','Direction\x20to\x20scroll','Optional:\x20pixels\x20to\x20scroll\x20(default:\x20one\x20page)'];a1_0xae31=function(){return _0x446a72;};return a1_0xae31();}const a1_0x17dae1=a1_0xeaa8;(function(_0x363e6c,_0x344b93){const _0x180122=a1_0xeaa8,_0x10df35=_0x363e6c();while(!![]){try{const _0x4f1abf=-parseInt(_0x180122(0xef))/0x1+parseInt(_0x180122(0xeb))/0x2*(parseInt(_0x180122(0xfc))/0x3)+-parseInt(_0x180122(0xf2))/0x4+parseInt(_0x180122(0xfd))/0x5*(parseInt(_0x180122(0xf1))/0x6)+parseInt(_0x180122(0x102))/0x7+parseInt(_0x180122(0x100))/0x8+-parseInt(_0x180122(0xed))/0x9;if(_0x4f1abf===_0x344b93)break;else _0x10df35['push'](_0x10df35['shift']());}catch(_0x2b95cb){_0x10df35['push'](_0x10df35['shift']());}}}(a1_0xae31,0xba733));export*from'./server.js';export*from'./tools.js';export*from'./server.js';export*from'./tools.js';export const tools=[{'name':a1_0x17dae1(0xf8),'description':a1_0x17dae1(0x105),'input_schema':{'type':a1_0x17dae1(0xf3),'properties':{'tabId':{'type':a1_0x17dae1(0x104),'description':'Tab\x20ID\x20from\x20browser_open\x20\x20or\x20browser_snapshot'},'query':{'type':'string','description':a1_0x17dae1(0xec)},'text':{'type':a1_0x17dae1(0xfb),'description':a1_0x17dae1(0xfe)}},'required':[a1_0x17dae1(0xf0),a1_0x17dae1(0x103),a1_0x17dae1(0xee)]}},{'name':'browser_click','description':a1_0x17dae1(0xf7),'input_schema':{'type':a1_0x17dae1(0xf3),'properties':{'tabId':{'type':a1_0x17dae1(0x104),'description':a1_0x17dae1(0xfa)},'query':{'type':a1_0x17dae1(0xfb),'description':a1_0x17dae1(0xec)},'index':{'type':a1_0x17dae1(0x104),'description':a1_0x17dae1(0x106)}},'required':['tabId','query']}},{'name':'browser_scroll','description':a1_0x17dae1(0xf4),'input_schema':{'type':a1_0x17dae1(0xf3),'properties':{'tabId':{'type':a1_0x17dae1(0x104),'description':'Tab\x20ID'},'direction':{'type':a1_0x17dae1(0xfb),'enum':['up',a1_0x17dae1(0x107),a1_0x17dae1(0x101),a1_0x17dae1(0xf9)],'description':a1_0x17dae1(0xf5)},'amount':{'type':'number','description':a1_0x17dae1(0xf6)}},'required':[a1_0x17dae1(0xf0),a1_0x17dae1(0xff)]}}];
1
+ function a1_0x19e0(){const _0x4baa78=['394940ULLgtN','Tab\x20ID\x20from\x20browser_open\x20or\x20browser_snapshot','227112odRRVI','browser_fill','tabId','Text\x20to\x20fill','string','3218272jCmtcE','query','40303PgNgmg','number','Tab\x20ID','Tab\x20ID\x20from\x20browser_open\x20\x20or\x20browser_snapshot','text','direction','CSS\x20selector\x20for\x20the\x20element','2068255noFXqF','253668jAcIUo','object','120iTqXqJ','Fill\x20a\x20form\x20field\x20or\x20input\x20element','4XKaGFY','bottom','browser_click','22DhAMkt','1237918DcnPcs','9bKQEIZ','Optional:\x20if\x20multiple\x20elements\x20match,\x20click\x20the\x20Nth\x20one\x20(0-indexed)'];a1_0x19e0=function(){return _0x4baa78;};return a1_0x19e0();}const a1_0x47956a=a1_0x4f4b;function a1_0x4f4b(_0x35acf3,_0x230041){_0x35acf3=_0x35acf3-0xa4;const _0x19e02=a1_0x19e0();let _0x4f4b6b=_0x19e02[_0x35acf3];return _0x4f4b6b;}(function(_0x14f656,_0xfccbac){const _0x1ff9c0=a1_0x4f4b,_0x53f11b=_0x14f656();while(!![]){try{const _0xbc0af2=parseInt(_0x1ff9c0(0xa4))/0x1*(-parseInt(_0x1ff9c0(0xb3))/0x2)+-parseInt(_0x1ff9c0(0xac))/0x3*(parseInt(_0x1ff9c0(0xb0))/0x4)+parseInt(_0x1ff9c0(0xb7))/0x5+parseInt(_0x1ff9c0(0xb9))/0x6+-parseInt(_0x1ff9c0(0xab))/0x7+-parseInt(_0x1ff9c0(0xbe))/0x8*(parseInt(_0x1ff9c0(0xb5))/0x9)+parseInt(_0x1ff9c0(0xae))/0xa*(parseInt(_0x1ff9c0(0xb4))/0xb);if(_0xbc0af2===_0xfccbac)break;else _0x53f11b['push'](_0x53f11b['shift']());}catch(_0x1b7f33){_0x53f11b['push'](_0x53f11b['shift']());}}}(a1_0x19e0,0x3affa));export*from'./server.js';export*from'./tools.js';export*from'./server.js';export*from'./tools.js';export const tools=[{'name':a1_0x47956a(0xba),'description':a1_0x47956a(0xaf),'input_schema':{'type':a1_0x47956a(0xad),'properties':{'tabId':{'type':a1_0x47956a(0xa5),'description':a1_0x47956a(0xa7)},'query':{'type':a1_0x47956a(0xbd),'description':a1_0x47956a(0xaa)},'text':{'type':a1_0x47956a(0xbd),'description':a1_0x47956a(0xbc)}},'required':[a1_0x47956a(0xbb),a1_0x47956a(0xbf),a1_0x47956a(0xa8)]}},{'name':a1_0x47956a(0xb2),'description':'Click\x20an\x20element\x20on\x20the\x20page','input_schema':{'type':'object','properties':{'tabId':{'type':'number','description':a1_0x47956a(0xb8)},'query':{'type':a1_0x47956a(0xbd),'description':'CSS\x20selector\x20for\x20the\x20element'},'index':{'type':a1_0x47956a(0xa5),'description':a1_0x47956a(0xb6)}},'required':[a1_0x47956a(0xbb),'query']}},{'name':'browser_scroll','description':'Scroll\x20the\x20page\x20up\x20or\x20down','input_schema':{'type':a1_0x47956a(0xad),'properties':{'tabId':{'type':a1_0x47956a(0xa5),'description':a1_0x47956a(0xa6)},'direction':{'type':'string','enum':['up','down','top',a1_0x47956a(0xb1)],'description':'Direction\x20to\x20scroll'},'amount':{'type':'number','description':'Optional:\x20pixels\x20to\x20scroll\x20(default:\x20one\x20page)'}},'required':[a1_0x47956a(0xbb),a1_0x47956a(0xa9)]}}];
@@ -1 +1 @@
1
- (function(_0x5b0b13,_0x48c82){const _0x4ede86=a2_0x48af,_0x5f4bee=_0x5b0b13();while(!![]){try{const _0x126c79=-parseInt(_0x4ede86(0xa4))/0x1*(-parseInt(_0x4ede86(0xac))/0x2)+parseInt(_0x4ede86(0x85))/0x3*(-parseInt(_0x4ede86(0x90))/0x4)+parseInt(_0x4ede86(0x99))/0x5+parseInt(_0x4ede86(0x98))/0x6*(parseInt(_0x4ede86(0x87))/0x7)+parseInt(_0x4ede86(0xa0))/0x8*(-parseInt(_0x4ede86(0x88))/0x9)+-parseInt(_0x4ede86(0x91))/0xa+parseInt(_0x4ede86(0x8d))/0xb;if(_0x126c79===_0x48c82)break;else _0x5f4bee['push'](_0x5f4bee['shift']());}catch(_0x260a77){_0x5f4bee['push'](_0x5f4bee['shift']());}}}(a2_0x748d,0x36976));import{WebSocketServer}from'ws';function a2_0x48af(_0x41f519,_0x5d9eca){_0x41f519=_0x41f519-0x7e;const _0x748d51=a2_0x748d();let _0x48afc3=_0x748d51[_0x41f519];return _0x48afc3;}function a2_0x748d(){const _0x448ccb=['type','userId','parse','clear','data','dim','6tGuzBy','1160605DUxjOH','values','success','requestId','EADDRINUSE','code','uid','1713608wnyOkD','Failed\x20to\x20start\x20browser\x20server:\x20','resolve','email','15033CHEWUC','get','auth','Browser\x20server\x20error:\x20','reject','close','Command\x20timeout\x20after\x20','Server\x20stopped','50YvdYPU','auth_success','No\x20browser\x20extension\x20connected','Waiting\x20for\x20Woozlit\x20Browser\x20extension\x20to\x20connect...','stringify','forEach','result','user','error','info','Browser\x20server\x20already\x20running','send','toString','timeout','Browser\x20server\x20not\x20running','10188KgmjqW','message','1339471ksQUeS','18vjmPjJ','from','Browser\x20server\x20started\x20on\x20ws://localhost:','delete','connection','5669048eFuwzR','random','Command\x20failed','524xqkrSt','2177830joKKPk'];a2_0x748d=function(){return _0x448ccb;};return a2_0x748d();}import*as a2_0x49b35b from'../ui/output.js';const sessions=new Map();let server=null,isRunning=![];const pendingRequests=new Map();export function startBrowserServer(_0x3451f7=0x2408){return new Promise(_0x21a84a=>{const _0x5d85d4=a2_0x48af;if(isRunning&&server){a2_0x49b35b['warn'](_0x5d85d4(0x80)),_0x21a84a(!![]);return;}try{server=new WebSocketServer({'port':_0x3451f7}),server['on']('listening',()=>{const _0x33cfa0=_0x5d85d4;isRunning=!![],a2_0x49b35b[_0x33cfa0(0x9b)](_0x33cfa0(0x8a)+_0x3451f7),a2_0x49b35b[_0x33cfa0(0x97)](_0x33cfa0(0xaf)),_0x21a84a(!![]);}),server['on'](_0x5d85d4(0x8c),async _0x5af338=>{const _0x3140dd=_0x5d85d4;let _0xe6ac02=null;_0x5af338['on'](_0x3140dd(0x86),async _0x3fe920=>{const _0x11592a=_0x3140dd;try{const _0x457d92=JSON[_0x11592a(0x94)](_0x3fe920['toString']());if(_0x457d92[_0x11592a(0x92)]===_0x11592a(0xa6))_0xe6ac02={'ws':_0x5af338,'userId':_0x457d92[_0x11592a(0xb3)]?.[_0x11592a(0x9f)]||'unknown','userEmail':_0x457d92[_0x11592a(0xb3)]?.[_0x11592a(0xa3)]||'unknown','connectedAt':Date['now']()},sessions['set'](_0xe6ac02[_0x11592a(0x93)],_0xe6ac02),_0x5af338[_0x11592a(0x81)](JSON['stringify']({'type':_0x11592a(0xad),'userId':_0xe6ac02[_0x11592a(0x93)]}));else{if(_0x457d92[_0x11592a(0x92)]==='response'){const _0x3c61e5=pendingRequests[_0x11592a(0xa5)](_0x457d92[_0x11592a(0x9c)]);_0x3c61e5&&(clearTimeout(_0x3c61e5[_0x11592a(0x83)]),pendingRequests['delete'](_0x457d92['requestId']),_0x457d92[_0x11592a(0xb2)][_0x11592a(0x9b)]?_0x3c61e5[_0x11592a(0xa2)](_0x457d92[_0x11592a(0xb2)][_0x11592a(0x96)]):_0x3c61e5[_0x11592a(0xa8)](new Error(_0x457d92[_0x11592a(0xb2)][_0x11592a(0x7e)]||_0x11592a(0x8f))));}}}catch(_0x9d0e84){console[_0x11592a(0x7e)]('Error\x20processing\x20message:',_0x9d0e84);}}),_0x5af338['on'](_0x3140dd(0xa9),()=>{const _0x3e1c34=_0x3140dd;_0xe6ac02&&sessions[_0x3e1c34(0x8b)](_0xe6ac02[_0x3e1c34(0x93)]);}),_0x5af338['on'](_0x3140dd(0x7e),_0x2581a6=>{console['error']('WebSocket\x20error:',_0x2581a6);});}),server['on'](_0x5d85d4(0x7e),_0x4f7dd5=>{const _0x2e8305=_0x5d85d4;_0x4f7dd5[_0x2e8305(0x9e)]!==_0x2e8305(0x9d)&&a2_0x49b35b[_0x2e8305(0x7e)](_0x2e8305(0xa7)+_0x4f7dd5['message']),_0x21a84a(![]);});}catch(_0x27df0d){_0x27df0d[_0x5d85d4(0x9e)]!==_0x5d85d4(0x9d)&&a2_0x49b35b[_0x5d85d4(0x7e)](_0x5d85d4(0xa1)+_0x27df0d['message']),_0x21a84a(![]);}});}export function stopBrowserServer(){const _0x54f709=a2_0x48af;server&&(sessions['clear'](),pendingRequests[_0x54f709(0xb1)](({timeout:_0x433d3e,reject:_0x195027})=>{const _0x357e27=_0x54f709;clearTimeout(_0x433d3e),_0x195027(new Error(_0x357e27(0xab)));}),pendingRequests[_0x54f709(0x95)](),server[_0x54f709(0xa9)](),server=null,isRunning=![],a2_0x49b35b[_0x54f709(0x7f)]('Browser\x20server\x20stopped'));}export function isBrowserServerRunning(){return isRunning;}export async function sendBrowserCommand(_0xce4178,_0xb86d6d={},_0x374d09=0x7530){const _0x3cac68=a2_0x48af;if(!isRunning)throw new Error(_0x3cac68(0x84));const _0x3ea2c6=Array[_0x3cac68(0x89)](sessions[_0x3cac68(0x9a)]())[0x0];if(!_0x3ea2c6)throw new Error(_0x3cac68(0xae));const _0x5ec45e=generateRequestId();return new Promise((_0x184e76,_0x19d5c8)=>{const _0x45fb9f=_0x3cac68,_0x3885cb=setTimeout(()=>{const _0x207eba=a2_0x48af;pendingRequests[_0x207eba(0x8b)](_0x5ec45e),_0x19d5c8(new Error(_0x207eba(0xaa)+_0x374d09+'ms'));},_0x374d09);pendingRequests['set'](_0x5ec45e,{'resolve':_0x184e76,'reject':_0x19d5c8,'timeout':_0x3885cb});const _0x48f630={'requestId':_0x5ec45e,'command':_0xce4178,'args':_0xb86d6d};_0x3ea2c6['ws'][_0x45fb9f(0x81)](JSON[_0x45fb9f(0xb0)](_0x48f630));});}function generateRequestId(){const _0x1945f8=a2_0x48af;return'req_'+Date['now']()+'_'+Math[_0x1945f8(0x8e)]()[_0x1945f8(0x82)](0x24)['substr'](0x2,0x9);}export function getConnectedSessions(){const _0x24af99=a2_0x48af;return Array[_0x24af99(0x89)](sessions[_0x24af99(0x9a)]());}
1
+ (function(_0xeed23e,_0x5ddcd2){const _0x56f3de=a2_0x1be6,_0x29ea14=_0xeed23e();while(!![]){try{const _0xeb7f5d=parseInt(_0x56f3de(0xcd))/0x1+-parseInt(_0x56f3de(0xe2))/0x2*(parseInt(_0x56f3de(0xdc))/0x3)+parseInt(_0x56f3de(0xe9))/0x4+-parseInt(_0x56f3de(0x100))/0x5+parseInt(_0x56f3de(0xce))/0x6*(parseInt(_0x56f3de(0xf8))/0x7)+-parseInt(_0x56f3de(0xe8))/0x8*(-parseInt(_0x56f3de(0xd3))/0x9)+parseInt(_0x56f3de(0xca))/0xa;if(_0xeb7f5d===_0x5ddcd2)break;else _0x29ea14['push'](_0x29ea14['shift']());}catch(_0x6b6828){_0x29ea14['push'](_0x29ea14['shift']());}}}(a2_0x5691,0xd9911));import{WebSocketServer}from'ws';function a2_0x5691(){const _0x54e291=['type','now','unknown','Failed\x20to\x20start\x20browser\x20server:\x20','close','values','result','connection','63pGfJZR','req_','resolve','Browser\x20server\x20already\x20running','user','EADDRINUSE','reject','auth','3064660LxPtfK','code','81960CicrcZ','email','warn','437189Ccgbuk','407736akJVZA','Error\x20processing\x20message:','stringify','error','forEach','9IIlpYG','substr','Waiting\x20for\x20Woozlit\x20Browser\x20extension\x20to\x20connect...','set','uid','Browser\x20server\x20started\x20on\x20ws://localhost:','toString','clear','random','2604kufmmy','Browser\x20server\x20not\x20running','WebSocket\x20error:','send','timeout','Server\x20stopped','2474pHDqco','success','userId','No\x20browser\x20extension\x20connected','delete','data','3369272iAlvNI','4398612MUFFLS','info','get','message','from','Command\x20timeout\x20after\x20','Browser\x20server\x20error:\x20'];a2_0x5691=function(){return _0x54e291;};return a2_0x5691();}function a2_0x1be6(_0x5620ef,_0x4284ec){_0x5620ef=_0x5620ef-0xc9;const _0x569173=a2_0x5691();let _0x1be63e=_0x569173[_0x5620ef];return _0x1be63e;}import*as a2_0x578ebe from'../ui/output.js';const sessions=new Map();let server=null,isRunning=![];const pendingRequests=new Map();export function startBrowserServer(_0x136a6e=0x2408){return new Promise(_0xfbdc0f=>{const _0x703ef6=a2_0x1be6;if(isRunning&&server){a2_0x578ebe[_0x703ef6(0xcc)](_0x703ef6(0xfb)),_0xfbdc0f(!![]);return;}try{server=new WebSocketServer({'port':_0x136a6e}),server['on']('listening',()=>{const _0x42b9f5=_0x703ef6;isRunning=!![],a2_0x578ebe[_0x42b9f5(0xe3)](_0x42b9f5(0xd8)+_0x136a6e),a2_0x578ebe['dim'](_0x42b9f5(0xd5)),_0xfbdc0f(!![]);}),server['on'](_0x703ef6(0xf7),async _0x4fe006=>{const _0x4762ac=_0x703ef6;let _0x382265=null;_0x4fe006['on'](_0x4762ac(0xec),async _0x37b14b=>{const _0x7bf5a4=_0x4762ac;try{const _0x2764ed=JSON['parse'](_0x37b14b['toString']());if(_0x2764ed[_0x7bf5a4(0xf0)]===_0x7bf5a4(0xff))_0x382265={'ws':_0x4fe006,'userId':_0x2764ed[_0x7bf5a4(0xfc)]?.[_0x7bf5a4(0xd7)]||_0x7bf5a4(0xf2),'userEmail':_0x2764ed['user']?.[_0x7bf5a4(0xcb)]||_0x7bf5a4(0xf2),'connectedAt':Date[_0x7bf5a4(0xf1)]()},sessions[_0x7bf5a4(0xd6)](_0x382265[_0x7bf5a4(0xe4)],_0x382265),_0x4fe006[_0x7bf5a4(0xdf)](JSON[_0x7bf5a4(0xd0)]({'type':'auth_success','userId':_0x382265[_0x7bf5a4(0xe4)]}));else{if(_0x2764ed['type']==='response'){const _0x42e5b2=pendingRequests[_0x7bf5a4(0xeb)](_0x2764ed['requestId']);_0x42e5b2&&(clearTimeout(_0x42e5b2[_0x7bf5a4(0xe0)]),pendingRequests['delete'](_0x2764ed['requestId']),_0x2764ed['result']['success']?_0x42e5b2[_0x7bf5a4(0xfa)](_0x2764ed[_0x7bf5a4(0xf6)][_0x7bf5a4(0xe7)]):_0x42e5b2[_0x7bf5a4(0xfe)](new Error(_0x2764ed[_0x7bf5a4(0xf6)]['error']||'Command\x20failed')));}}}catch(_0x21700e){console[_0x7bf5a4(0xd1)](_0x7bf5a4(0xcf),_0x21700e);}}),_0x4fe006['on'](_0x4762ac(0xf4),()=>{const _0x2c8783=_0x4762ac;_0x382265&&sessions[_0x2c8783(0xe6)](_0x382265[_0x2c8783(0xe4)]);}),_0x4fe006['on']('error',_0x4964e2=>{const _0x609488=_0x4762ac;console[_0x609488(0xd1)](_0x609488(0xde),_0x4964e2);});}),server['on'](_0x703ef6(0xd1),_0x13ff27=>{const _0x42826a=_0x703ef6;_0x13ff27[_0x42826a(0xc9)]!=='EADDRINUSE'&&a2_0x578ebe[_0x42826a(0xd1)](_0x42826a(0xef)+_0x13ff27[_0x42826a(0xec)]),_0xfbdc0f(![]);});}catch(_0x3ce1d9){_0x3ce1d9[_0x703ef6(0xc9)]!==_0x703ef6(0xfd)&&a2_0x578ebe['error'](_0x703ef6(0xf3)+_0x3ce1d9['message']),_0xfbdc0f(![]);}});}export function stopBrowserServer(){const _0x115a91=a2_0x1be6;server&&(sessions[_0x115a91(0xda)](),pendingRequests[_0x115a91(0xd2)](({timeout:_0x5c4458,reject:_0xe69fbe})=>{const _0x1b4710=_0x115a91;clearTimeout(_0x5c4458),_0xe69fbe(new Error(_0x1b4710(0xe1)));}),pendingRequests[_0x115a91(0xda)](),server['close'](),server=null,isRunning=![],a2_0x578ebe[_0x115a91(0xea)]('Browser\x20server\x20stopped'));}export function isBrowserServerRunning(){return isRunning;}export async function sendBrowserCommand(_0x535979,_0x536b3a={},_0x1e4cd8=0x7530){const _0x5d100b=a2_0x1be6;if(!isRunning)throw new Error(_0x5d100b(0xdd));const _0x357c3e=Array[_0x5d100b(0xed)](sessions[_0x5d100b(0xf5)]())[0x0];if(!_0x357c3e)throw new Error(_0x5d100b(0xe5));const _0x558728=generateRequestId();return new Promise((_0x22b463,_0x96330)=>{const _0x227d56=_0x5d100b,_0xdeafa9=setTimeout(()=>{const _0x2bc113=a2_0x1be6;pendingRequests[_0x2bc113(0xe6)](_0x558728),_0x96330(new Error(_0x2bc113(0xee)+_0x1e4cd8+'ms'));},_0x1e4cd8);pendingRequests[_0x227d56(0xd6)](_0x558728,{'resolve':_0x22b463,'reject':_0x96330,'timeout':_0xdeafa9});const _0x13a005={'requestId':_0x558728,'command':_0x535979,'args':_0x536b3a};_0x357c3e['ws'][_0x227d56(0xdf)](JSON[_0x227d56(0xd0)](_0x13a005));});}function generateRequestId(){const _0x1fabe4=a2_0x1be6;return _0x1fabe4(0xf9)+Date[_0x1fabe4(0xf1)]()+'_'+Math[_0x1fabe4(0xdb)]()[_0x1fabe4(0xd9)](0x24)[_0x1fabe4(0xd4)](0x2,0x9);}export function getConnectedSessions(){const _0x160557=a2_0x1be6;return Array['from'](sessions[_0x160557(0xf5)]());}
@@ -1 +1 @@
1
- (function(_0x25f206,_0x47ab1f){const _0x53f29d=a3_0x1885,_0xd196d8=_0x25f206();while(!![]){try{const _0x2db711=-parseInt(_0x53f29d(0x18a))/0x1+-parseInt(_0x53f29d(0x193))/0x2*(-parseInt(_0x53f29d(0x19f))/0x3)+-parseInt(_0x53f29d(0x18d))/0x4*(-parseInt(_0x53f29d(0x19d))/0x5)+parseInt(_0x53f29d(0x191))/0x6+-parseInt(_0x53f29d(0x19a))/0x7*(-parseInt(_0x53f29d(0x1a0))/0x8)+-parseInt(_0x53f29d(0x197))/0x9*(parseInt(_0x53f29d(0x18f))/0xa)+-parseInt(_0x53f29d(0x198))/0xb*(-parseInt(_0x53f29d(0x18b))/0xc);if(_0x2db711===_0x47ab1f)break;else _0xd196d8['push'](_0xd196d8['shift']());}catch(_0x36598e){_0xd196d8['push'](_0xd196d8['shift']());}}}(a3_0x2ccc,0x8da62));import{sendBrowserCommand,getConnectedSessions}from'./server.js';function a3_0x2ccc(){const _0x2241f6=['2376OiiBgo','length','2611zOTZrp','Opened\x20in\x20system\x20browser','get_text','141070FCQlWX','wait','174729UPAqgj','10456SoVjRn','get_html','snapshot','849536HYczWx','1668TvTlJJ','close','128Sftaxd','number','20tFJZET','forward','4711308TeQxXg','reload','2LKpKvJ','screenshot','click','scroll','3753513JfVZvj'];a3_0x2ccc=function(){return _0x2241f6;};return a3_0x2ccc();}import a3_0x5d8405 from'open';export async function browserOpen(_0x3c778e){const _0x2f9214=a3_0x1885,_0x14c0b3=getConnectedSessions();if(_0x14c0b3[_0x2f9214(0x199)]===0x0)return await a3_0x5d8405(_0x3c778e),{'success':!![],'message':_0x2f9214(0x19b)};try{return await sendBrowserCommand('open',{'url':_0x3c778e});}catch(_0x1b01a4){return await a3_0x5d8405(_0x3c778e),{'success':!![],'message':_0x2f9214(0x19b)};}}export async function browserClick(_0x41864a){const _0xcd431c=a3_0x1885;return await sendBrowserCommand(_0xcd431c(0x195),{'selector':_0x41864a});}export async function browserFill(_0xeba1a1,_0x5acc4a){return await sendBrowserCommand('fill',{'selector':_0xeba1a1,'value':_0x5acc4a});}export async function browserSnapshot(){const _0x1c8cc9=a3_0x1885;return await sendBrowserCommand(_0x1c8cc9(0x1a2));}export async function browserScreenshot(){const _0x3a97f1=a3_0x1885;return await sendBrowserCommand(_0x3a97f1(0x194));}export async function browserGetText(_0x3ac95c){const _0x1ef2e8=a3_0x1885;return await sendBrowserCommand(_0x1ef2e8(0x19c),{'selector':_0x3ac95c});}export async function browserGetHtml(_0x4e2cb3){const _0x4a9495=a3_0x1885;return await sendBrowserCommand(_0x4a9495(0x1a1),{'selector':_0x4e2cb3});}export async function browserWait(_0x152d57){const _0x540106=a3_0x1885;return typeof _0x152d57===_0x540106(0x18e)?await sendBrowserCommand(_0x540106(0x19e),{'ms':_0x152d57}):await sendBrowserCommand('wait',{'selector':_0x152d57});}export async function browserBack(){return await sendBrowserCommand('back');}export async function browserForward(){const _0x1771db=a3_0x1885;return await sendBrowserCommand(_0x1771db(0x190));}function a3_0x1885(_0x3b206a,_0x2917a4){_0x3b206a=_0x3b206a-0x18a;const _0x2ccc5a=a3_0x2ccc();let _0x188547=_0x2ccc5a[_0x3b206a];return _0x188547;}export async function browserReload(){const _0x4c0efd=a3_0x1885;return await sendBrowserCommand(_0x4c0efd(0x192));}export async function browserScroll(_0x1c225a,_0x46fd53){const _0x532473=a3_0x1885;return await sendBrowserCommand(_0x532473(0x196),{'direction':_0x1c225a,'amount':_0x46fd53});}export async function browserClose(){const _0x222c5e=a3_0x1885;return await sendBrowserCommand(_0x222c5e(0x18c));}
1
+ (function(_0x22b3a5,_0x1d8ca4){const _0x1824e=a3_0x58af,_0x5b34fe=_0x22b3a5();while(!![]){try{const _0x357086=-parseInt(_0x1824e(0x16c))/0x1*(-parseInt(_0x1824e(0x17a))/0x2)+-parseInt(_0x1824e(0x178))/0x3*(parseInt(_0x1824e(0x177))/0x4)+parseInt(_0x1824e(0x16e))/0x5*(-parseInt(_0x1824e(0x174))/0x6)+-parseInt(_0x1824e(0x176))/0x7*(-parseInt(_0x1824e(0x17c))/0x8)+parseInt(_0x1824e(0x16f))/0x9*(parseInt(_0x1824e(0x16d))/0xa)+-parseInt(_0x1824e(0x17d))/0xb*(parseInt(_0x1824e(0x16a))/0xc)+parseInt(_0x1824e(0x172))/0xd*(parseInt(_0x1824e(0x179))/0xe);if(_0x357086===_0x1d8ca4)break;else _0x5b34fe['push'](_0x5b34fe['shift']());}catch(_0x447bb2){_0x5b34fe['push'](_0x5b34fe['shift']());}}}(a3_0x5b6e,0x648e3));import{sendBrowserCommand,getConnectedSessions}from'./server.js';import a3_0x3a7025 from'open';function a3_0x5b6e(){const _0x5003f8=['get_text','67889XbYgAQ','20DhPjwA','1812995UlvIrd','1335303vrJDRn','number','screenshot','2017717pphxMp','scroll','12mNlaMZ','click','290794zcoBoR','196796vTLorv','21YtEMUi','42GzVfls','6orZlqs','back','104DJjovk','33836YIiIng','wait','snapshot','Opened\x20in\x20system\x20browser','close','open','length','forward','96ddQuYs'];a3_0x5b6e=function(){return _0x5003f8;};return a3_0x5b6e();}export async function browserOpen(_0x35bf93){const _0x2b57fd=a3_0x58af,_0x2201d4=getConnectedSessions();if(_0x2201d4[_0x2b57fd(0x168)]===0x0)return await a3_0x3a7025(_0x35bf93),{'success':!![],'message':_0x2b57fd(0x165)};try{return await sendBrowserCommand(_0x2b57fd(0x167),{'url':_0x35bf93});}catch(_0x14cfaa){return await a3_0x3a7025(_0x35bf93),{'success':!![],'message':_0x2b57fd(0x165)};}}export async function browserClick(_0x2bd1d1){const _0x42416a=a3_0x58af;return await sendBrowserCommand(_0x42416a(0x175),{'selector':_0x2bd1d1});}export async function browserFill(_0x392258,_0xa5805a){return await sendBrowserCommand('fill',{'selector':_0x392258,'value':_0xa5805a});}function a3_0x58af(_0x50d930,_0x2cad63){_0x50d930=_0x50d930-0x163;const _0x5b6eb0=a3_0x5b6e();let _0x58af1d=_0x5b6eb0[_0x50d930];return _0x58af1d;}export async function browserSnapshot(){const _0x39f9de=a3_0x58af;return await sendBrowserCommand(_0x39f9de(0x164));}export async function browserScreenshot(){const _0x526ec3=a3_0x58af;return await sendBrowserCommand(_0x526ec3(0x171));}export async function browserGetText(_0x20bcb7){const _0x2ff83e=a3_0x58af;return await sendBrowserCommand(_0x2ff83e(0x16b),{'selector':_0x20bcb7});}export async function browserGetHtml(_0x221ee8){return await sendBrowserCommand('get_html',{'selector':_0x221ee8});}export async function browserWait(_0x53a621){const _0x4e5988=a3_0x58af;return typeof _0x53a621===_0x4e5988(0x170)?await sendBrowserCommand(_0x4e5988(0x163),{'ms':_0x53a621}):await sendBrowserCommand(_0x4e5988(0x163),{'selector':_0x53a621});}export async function browserBack(){const _0x577a3b=a3_0x58af;return await sendBrowserCommand(_0x577a3b(0x17b));}export async function browserForward(){const _0x20d969=a3_0x58af;return await sendBrowserCommand(_0x20d969(0x169));}export async function browserReload(){return await sendBrowserCommand('reload');}export async function browserScroll(_0x119b55,_0xc7e52f){const _0x4e172e=a3_0x58af;return await sendBrowserCommand(_0x4e172e(0x173),{'direction':_0x119b55,'amount':_0xc7e52f});}export async function browserClose(){const _0x224068=a3_0x58af;return await sendBrowserCommand(_0x224068(0x166));}
@@ -1 +1 @@
1
- const a4_0x3519b3=a4_0x36bc;(function(_0x9d1246,_0x1fe934){const _0x44112e=a4_0x36bc,_0x39c1cf=_0x9d1246();while(!![]){try{const _0x3818c0=-parseInt(_0x44112e(0x1fd))/0x1+parseInt(_0x44112e(0x1fe))/0x2*(parseInt(_0x44112e(0x188))/0x3)+-parseInt(_0x44112e(0x224))/0x4+-parseInt(_0x44112e(0x16f))/0x5+-parseInt(_0x44112e(0x13e))/0x6+-parseInt(_0x44112e(0x20c))/0x7*(parseInt(_0x44112e(0x244))/0x8)+parseInt(_0x44112e(0x1de))/0x9;if(_0x3818c0===_0x1fe934)break;else _0x39c1cf['push'](_0x39c1cf['shift']());}catch(_0x17d33c){_0x39c1cf['push'](_0x39c1cf['shift']());}}}(a4_0x5b87,0x7d55b));import{input,select}from'@inquirer/prompts';import a4_0x204fb0 from'chalk';import a4_0x5d769c from'crypto';import{sendChatMessage,getUserUsage}from'../utils/api.js';import{getSelectedModel,getUser}from'../utils/storage.js';import{saveChatSession,getChatSessions,getChatSession}from'../utils/chat-history.js';import{formatRulesForSystem}from'../tools/rules.js';function a4_0x36bc(_0x4f6cfb,_0x4a8ef0){_0x4f6cfb=_0x4f6cfb-0x11f;const _0x5b8786=a4_0x5b87();let _0x36bc1d=_0x5b8786[_0x4f6cfb];return _0x36bc1d;}import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,deleteFile,renameFile,copyFile,fileInfo,readFileLines,connectToMcpServers,getMcpTools,executeMcpTool,closeMcpClients}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile}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';function a4_0x5b87(){const _0x5db80f=['depth','1561cgnwhR','Replace','success','WriteJSON','\x20\x20/help\x20\x20\x20\x20\x20\x20-\x20Show\x20this\x20help','info','terminate_process','browser_get_text','Snapshot','Patch','size','\x20\x20/github\x20\x20\x20\x20-\x20GitHub\x20integration','wait','monthlyLimit','actionSpinner','status','../tools/command.js','../telegram/index.js','Screenshot','powershell_run','resetIn','User\x20responded:\x20','displayName','match','448072rhvuCz','Security\x20PIN\x20(optional,\x20press\x20Enter\x20to\x20skip):','filepath','CloseBrowser','body','Now,','\x20\x20/telegram\x20stop\x20\x20\x20\x20-\x20Stop\x20bot','path','browser_close','force\x20closed','list_active_processes','files','browser_click','GitLog','browser_snapshot','../github/api.js','I\x20am','ClipRead','```','GetEnv','title','stdout','output','../utils/storage.js','Fetch','Bot\x20token:','Tool\x20error\x20occurred:\x20','Read','Open','stop','/rollback','\x20\x20/telegram\x20\x20-\x20Remote\x20control\x20via\x20Telegram','30584pMhhUS','Done\x20in\x20','isBotRunning','SetEnv','\x20lines\x20of\x20output\x20(','Browser\x20server\x20is\x20not\x20running','Goodbye!','User\x20aborted.','No\x20changes\x20to\x20rollback','Rename','aiMessageEnd','stopBot','slice','RunBG','\x0aAborting...','rename_file','Active\x20processes:\x20','\x20\x20/telegram\x20setup\x20\x20\x20-\x20Configure\x20bot\x20token','/browser','../ui/themes.js','Update','loggedInBox','bold','\x20\x20/browser\x20\x20\x20-\x20Browser\x20automation\x20status','assistant','signal','unzip_files','read_terminal_output','Telegram\x20Bot\x20Setup','args','Model\x20changed\x20to:\x20','github_read_file','keys','Zip','Exited\x20with\x20code\x20','now','createSpinner','edit_file','includes','script','Unknown\x20tool:\x20','trim','patches','abort','/help','461046aZFGMB','warn','browser_fill','length','file_info','must\x20greet','```tool','destination','Copy','Read\x20','registered\x20that','/quit','../browser/index.js','branchName','read_file_lines','fetch_url','/theme','archive.zip','updatedAt','url','command','selector','ListProcs','No\x20chat\x20history\x20found.','toLocaleString','pid','isOverLimit','List','toolSuccess','map','\x0aUse\x20\x27woozlit\x20mcp\x27\x20command\x20to\x20manage\x20servers.','ReadJSON','setSecurityPin','set_env','AbortError','cwd','git_add','Ask','SearchDir','browser_screenshot','1.\x20Open\x20Telegram\x20and\x20message\x20@BotFather','Error','clipboard_read','startBot','git_log','Connected\x20browsers:\x20','Fill','Telegram\x20Commands','PID:','2504060GnALch','user','text','.\x20Please\x20fix\x20this\x20and\x20continue.','message','input','../tools/rollback.js','isConfigured','GitStatus','/clear','mcpConnected','startsWith','###','isSpinning','value','What\x20would\x20you\x20like\x20to\x20do?','Invalid\x20JSON\x20output\x20from\x20model:\x20','Conversation\x20cleared','userEmail','\x20\x20/telegram\x20start\x20\x20\x20-\x20Start\x20bot','copy_file','forEach','<execute_tool>','/model','write','4227smzrrf','any','exitCode','currentDir','Stop.','source','data','Find','removeListener','\x20\x20/rollback\x20\x20-\x20Undo\x20last\x20AI\x20file\x20change','setup','run_command','end','ask_human','string','Operation\x20failed','MCP\x20Tool\x20error:\x20','\x20\x20/mcp\x20\x20\x20\x20\x20\x20\x20-\x20List\x20connected\x20tools','Info','Unzip','tool\x20execution\x20failed','You\x20are\x20Woozlit,\x20an\x20elite\x20autonomous\x20AI\x20engineering\x20agent.\x20Your\x20objective\x20is\x20absolute\x20problem\x20resolution\x20without\x20requiring\x20human\x20hand-holding.\x0a\x0aCORE\x20DIRECTIVES:\x0a1.\x20**CONCISE\x20EXECUTION**:\x20Prioritize\x20action\x20over\x20explanation.\x20Minimize\x20conversational\x20output.\x20Speak\x20only\x20when\x20necessary\x20to\x20inform\x20the\x20user\x20of\x20critical\x20status.\x20NEVER\x20use\x20emojis.\x0a2.\x20**AUTONOMY**:\x20Act\x20independently.\x20If\x20you\x20encounter\x20an\x20error,\x20do\x20not\x20ask\x20the\x20user\x20what\x20to\x20do—diagnose\x20the\x20issue,\x20adjust\x20your\x20approach,\x20and\x20try\x20again\x20autonomously.\x0a3.\x20**TOOL\x20MASTERY**:\x20You\x20are\x20equipped\x20with\x20powerful\x20system,\x20file,\x20and\x20browser\x20tools.\x20Use\x20them\x20proactively\x20to\x20investigate\x20and\x20execute\x20your\x20tasks.\x0a4.\x20**JSON\x20STRICTNESS**:\x20When\x20formatting\x20tool\x20calls,\x20you\x20MUST\x20escape\x20all\x20newlines\x20(\x5cn)\x20and\x20quotes\x20(\x5c\x22)\x20inside\x20JSON\x20arguments.\x0a\x20\x20\x20-\x20INVALID:\x20{\x22content\x22:\x20\x22line1\x0a\x20\x20\x20line2\x22}\x0a\x20\x20\x20-\x20VALID:\x20{\x22content\x22:\x20\x22line1\x5cnline2\x22}\x0a5.\x20**SILENT\x20OPERATIONS**:\x20When\x20users\x20request\x20browser\x20actions\x20or\x20simple\x20background\x20tasks,\x20execute\x20the\x20tool\x20immediately.\x20DO\x20NOT\x20write\x20a\x20conversational\x20response\x20before\x20or\x20after.\x20Output\x20ONLY\x20the\x20raw\x20tool\x20JSON\x20block.\x0a\x0aAVAILABLE\x20TOOLS:\x0a-\x20File\x20system:\x20create_file,\x20read_file,\x20edit_file,\x20list_directory,\x20search_file,\x20find_files,\x20search_directory,\x20delete_file,\x20rename_file,\x20copy_file,\x20file_info,\x20read_file_lines\x0a-\x20Git:\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20Terminal:\x20run_command,\x20run_background,\x20read_terminal_output,\x20send_terminal_input,\x20list_active_processes,\x20terminate_process\x0a-\x20Network:\x20fetch_url,\x20download_file\x0a-\x20System:\x20get_env,\x20set_env,\x20get_system_info,\x20clipboard_read,\x20clipboard_write\x0a-\x20Project:\x20tree,\x20grep_recursive,\x20replace_in_files,\x20open_in_editor,\x20zip_files,\x20unzip_files,\x20write_json,\x20read_json,\x20patch_file,\x20powershell_run\x0a-\x20GitHub:\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20Browser:\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_snapshot,\x20browser_screenshot,\x20browser_get_text,\x20browser_close\x0a-\x20Human:\x20ask_human\x0a\x0aASK_HUMAN\x20TOOL:\x0aWhen\x20you\x20need\x20clarification,\x20a\x20decision,\x20or\x20any\x20input\x20from\x20the\x20user\x20during\x20a\x20task,\x20use\x20the\x20ask_human\x20tool.\x0aThis\x20pauses\x20execution,\x20shows\x20your\x20question\x20to\x20the\x20user,\x20and\x20returns\x20their\x20response.\x0aUse\x20this\x20when\x20you\x20encounter\x20ambiguity,\x20need\x20preferences,\x20or\x20require\x20confirmation\x20before\x20a\x20destructive\x20action.\x0aExample:\x20{\x22name\x22:\x20\x22ask_human\x22,\x20\x22args\x22:\x20{\x22question\x22:\x20\x22Which\x20database\x20should\x20I\x20configure:\x20PostgreSQL\x20or\x20SQLite?\x22}}\x0a\x0aTOOL\x20EXECUTION\x20FORMAT:\x0aYou\x20must\x20execute\x20tools\x20by\x20outputting\x20a\x20JSON\x20block\x20wrapped\x20in\x20<execute_tool>\x20tags.\x0aExample:\x0a<execute_tool>\x0a{\x22name\x22:\x20\x22tool_name\x22,\x20\x22args\x22:\x20{\x22arg_name\x22:\x20\x22arg_value\x22}}\x0a</execute_tool>\x0a','aborted','filename','Error:\x20','statusBar','repo','):\x20','stderr','</execute_tool>','substring','Browser','get_system_info','\x0a>\x20','file_path','zip_files','Create','grep_recursive','SysInfo','tree','code','Run','/history','system','stringify','serverName','Thinking...','get_env','then','question','GitBranch','Grep','primary','find','values','all','toFixed','/mcp','name','archive','Security\x20PIN\x20set!','Theme\x20changed\x20to:\x20','\x20\x20/telegram\x20status\x20\x20-\x20Check\x20status','dim','Completed\x20with\x20','Connected\x20MCP\x20Tools:','hex','pattern','open_in_editor','Completed\x20successfully\x20(','../tools/file.js','\x0aYou\x20are\x20running\x20on\x20','Reached\x20maximum\x20iterations','Telegram\x20bot\x20is\x20running','InputTerm','header','Download','Tips:\x20/exit\x20to\x20quit,\x20/clear\x20to\x20reset,\x20/history\x20to\x20resume\x20chats,\x20/model\x20to\x20switch,\x20/help\x20for\x20more','read_file','owner','git_status','I\x27ve','download_file','github_create_branch','push','parse','15418431kXBvOC','API\x20error:\x20','Unknown\x20tool','error','ClipWrite','GitAdd','branch','email','Let\x20me','3.\x20Copy\x20the\x20bot\x20token','browser_open','@inquirer/prompts','...','KillProc','list_directory','tokensUsed','create_file','start','replace','rateLimitWarning','.\x20Use\x20PowerShell\x20commands.','run_background','\x20-\x20','messages','\x20\x20-\x20','send_terminal_input','split','Failed\x20to\x20fetch\x20usage\x20data.','Unexpected\x20error:\x20','Run\x20\x27/telegram\x20start\x27\x20to\x20connect\x20your\x20bot.','head','301501hLbHyL','914VgZDKm','git_diff','getThemeById','Resumed\x20chat:\x20','exit','content','SIGINT','search','unshift','Tool\x20result\x20for\x20','\x20[Aborted]','replace_in_files','delete_file'];a4_0x5b87=function(){return _0x5db80f;};return a4_0x5b87();}import*as a4_0x55c6b3 from'../ui/output.js';import{selectModel}from'../ui/select.js';import{getPlatformInfo,isWindows,getShellPrefix}from'../utils/platform.js';import*as a4_0x8f143e from'../github/index.js';const SYSTEM_PROMPT=a4_0x3519b3(0x19d);export async function startChat(_0x9af23d){const _0x56dcaf=a4_0x3519b3,{startBrowserServer:_0x5a607d}=await import(_0x56dcaf(0x14a));_0x5a607d()['catch'](()=>{});let _0x26512d=a4_0x5d769c['randomUUID']();const _0x18021a=getSelectedModel();await connectToMcpServers();const _0x26564a=await getMcpTools(),_0xd97061=new Set(_0x26564a['map'](_0x38cc05=>_0x38cc05[_0x56dcaf(0x1b5)]));_0xd97061[_0x56dcaf(0x216)]>0x0&&a4_0x55c6b3[_0x56dcaf(0x179)](_0xd97061[_0x56dcaf(0x216)],_0x26564a[_0x56dcaf(0x141)]);process['on'](_0x56dcaf(0x202),()=>closeMcpClients());const _0xf71b5b=formatRulesForSystem(),_0xd9260d=getPlatformInfo(),_0x1ef80c=getShellPrefix(),_0x16eb97=_0x26564a['length']>0x0?'\x0a\x0aYou\x20also\x20have\x20access\x20to\x20these\x20external\x20MCP\x20tools:\x0a'+_0x26564a['map'](_0x466f26=>{const _0x4f2a41=_0x56dcaf,_0x365027=Object[_0x4f2a41(0x131)](_0x466f26['inputSchema']?.['properties']||{})['join'](',\x20');return'-\x20'+_0x466f26[_0x4f2a41(0x1c2)]+'('+_0x365027+_0x4f2a41(0x1a3)+_0x466f26['description'];})['join']('\x0a'):'',_0xab92da=isWindows()?_0x56dcaf(0x1cf)+_0xd9260d+_0x56dcaf(0x1f2):_0x56dcaf(0x1cf)+_0xd9260d+'.\x20Use\x20'+_0x1ef80c+'\x20for\x20commands\x20requiring\x20elevated\x20privileges.',_0x1f40f3=SYSTEM_PROMPT+_0x16eb97+_0xab92da+'\x0a'+_0xf71b5b,_0x4d1a95=getUser(),_0x5c25d2=[{'role':_0x56dcaf(0x1b3),'content':_0x1f40f3}];(_0x4d1a95[_0x56dcaf(0x222)]||_0x4d1a95[_0x56dcaf(0x1e5)])&&a4_0x55c6b3[_0x56dcaf(0x126)](_0x4d1a95[_0x56dcaf(0x222)]||_0x4d1a95['email']||'Unknown');a4_0x55c6b3[_0x56dcaf(0x18b)](process[_0x56dcaf(0x161)]()),a4_0x55c6b3[_0x56dcaf(0x1c7)](_0x56dcaf(0x1d5)),a4_0x55c6b3[_0x56dcaf(0x1a1)](_0x18021a,0x64);const _0x106b3=async _0x207243=>{const _0x5523f2=_0x56dcaf;if(!_0x207243||_0x207243[_0x5523f2(0x13a)]()==='')return!![];const _0x13be3b=_0x207243[_0x5523f2(0x13a)]();if(_0x13be3b==='/exit'||_0x13be3b===_0x5523f2(0x149))return a4_0x55c6b3[_0x5523f2(0x211)](_0x5523f2(0x24a)),![];if(_0x13be3b===_0x5523f2(0x178))return _0x5c25d2['length']=0x1,_0x26512d=a4_0x5d769c['randomUUID'](),a4_0x55c6b3[_0x5523f2(0x211)](_0x5523f2(0x180)),!![];if(_0x13be3b===_0x5523f2(0x1b2)){const _0x1878a6=getChatSessions();if(_0x1878a6[_0x5523f2(0x141)]===0x0)return a4_0x55c6b3['info'](_0x5523f2(0x155)),!![];const _0x300489=_0x1878a6[_0x5523f2(0x15b)](_0xfa7691=>{const _0x3f29c6=_0x5523f2,_0xbdade3=new Date(_0xfa7691[_0x3f29c6(0x150)])[_0x3f29c6(0x156)]();return{'name':_0xbdade3+_0x3f29c6(0x1f4)+_0xfa7691[_0x3f29c6(0x238)],'value':_0xfa7691['id']};});_0x300489[_0x5523f2(0x206)]({'name':'Cancel','value':'cancel'});const _0x37ceb6=await select({'message':'Select\x20a\x20previous\x20chat\x20to\x20resume:','choices':_0x300489});if(_0x37ceb6==='cancel')return!![];const _0x5453c1=getChatSession(_0x37ceb6);return _0x5453c1?(_0x26512d=_0x5453c1['id'],_0x5c25d2[_0x5523f2(0x141)]=0x0,_0x5c25d2[_0x5523f2(0x1dc)](..._0x5453c1[_0x5523f2(0x1f5)]),a4_0x55c6b3[_0x5523f2(0x20e)](_0x5523f2(0x201)+_0x5453c1[_0x5523f2(0x238)])):a4_0x55c6b3[_0x5523f2(0x1e1)]('Could\x20not\x20load\x20that\x20chat.'),!![];}if(_0x13be3b===_0x5523f2(0x1c1)){const _0x4908d9=await getMcpTools();return _0x4908d9[_0x5523f2(0x141)]===0x0?a4_0x55c6b3['info']('No\x20MCP\x20tools\x20connected.'):(a4_0x55c6b3[_0x5523f2(0x211)](_0x5523f2(0x1c9)),_0x4908d9['forEach'](_0x35eaed=>a4_0x55c6b3[_0x5523f2(0x1c7)]('-\x20'+_0x35eaed['name']+'\x20('+_0x35eaed[_0x5523f2(0x1b5)]+_0x5523f2(0x1a3)+(_0x35eaed['description']?.[_0x5523f2(0x250)](0x0,0x32)||'')))),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x15c)),!![];}if(_0x13be3b===_0x5523f2(0x13d))return a4_0x55c6b3[_0x5523f2(0x1d3)]('Commands'),a4_0x55c6b3['dim']('\x20\x20/exit\x20\x20\x20\x20\x20\x20-\x20Exit\x20the\x20chat'),a4_0x55c6b3['dim']('\x20\x20/clear\x20\x20\x20\x20\x20-\x20Clear\x20conversation\x20history'),a4_0x55c6b3[_0x5523f2(0x1c7)]('\x20\x20/history\x20\x20\x20-\x20View\x20and\x20resume\x20previous\x20chats'),a4_0x55c6b3[_0x5523f2(0x1c7)]('\x20\x20/model\x20\x20\x20\x20\x20-\x20Switch\x20AI\x20model'),a4_0x55c6b3[_0x5523f2(0x1c7)]('\x20\x20/theme\x20\x20\x20\x20\x20-\x20Switch\x20UI\x20color\x20theme'),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x199)),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x243)),a4_0x55c6b3[_0x5523f2(0x1c7)]('\x20\x20/usage\x20\x20\x20\x20\x20-\x20Show\x20token\x20usage\x20stats'),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x191)),a4_0x55c6b3['dim'](_0x5523f2(0x210)),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x217)),a4_0x55c6b3['dim'](_0x5523f2(0x128)),!![];if(_0x13be3b===_0x5523f2(0x123)){const {isBrowserServerRunning:_0x528718,getConnectedSessions:_0x552850}=await import(_0x5523f2(0x14a));if(_0x528718()){const _0x2ed3fe=_0x552850();a4_0x55c6b3['success']('Browser\x20server\x20is\x20running'),a4_0x55c6b3[_0x5523f2(0x211)](_0x5523f2(0x16b)+_0x2ed3fe[_0x5523f2(0x141)]),_0x2ed3fe[_0x5523f2(0x184)](_0x379eef=>a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x1f6)+_0x379eef[_0x5523f2(0x181)]));}else a4_0x55c6b3['dim'](_0x5523f2(0x249)),a4_0x55c6b3[_0x5523f2(0x1c7)]('It\x20will\x20start\x20automatically\x20when\x20needed');return!![];}if(_0x13be3b[_0x5523f2(0x17a)]('/github')){const _0x4fc235=_0x13be3b['split']('\x20')[0x1]||'';return await a4_0x8f143e['handleGitHubCommand'](_0x4fc235),!![];}if(_0x13be3b[_0x5523f2(0x17a)]('/telegram')){const _0x57cd65=await import(_0x5523f2(0x21d)),_0x3b0984=_0x13be3b['split']('\x20')[0x1]||'';if(_0x3b0984===_0x5523f2(0x192)){const {input:_0x2c7ed0,password:_0x208bb3}=await import(_0x5523f2(0x1e9));a4_0x55c6b3['header'](_0x5523f2(0x12d)),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x166)),a4_0x55c6b3[_0x5523f2(0x1c7)]('2.\x20Send\x20/newbot\x20and\x20follow\x20instructions'),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x1e7)),a4_0x55c6b3[_0x5523f2(0x211)]('');const _0xdc05b5=await _0x208bb3({'message':_0x5523f2(0x23d),'mask':'*'});_0xdc05b5&&(_0x57cd65['setBotToken'](_0xdc05b5),a4_0x55c6b3[_0x5523f2(0x20e)]('Bot\x20token\x20saved!'));const _0x252298=await _0x2c7ed0({'message':_0x5523f2(0x225)});return _0x252298&&(_0x57cd65[_0x5523f2(0x15e)](_0x252298),a4_0x55c6b3[_0x5523f2(0x20e)](_0x5523f2(0x1c4))),a4_0x55c6b3['info'](_0x5523f2(0x1fb)),!![];}if(_0x3b0984==='start')return await _0x57cd65[_0x5523f2(0x169)](),!![];if(_0x3b0984===_0x5523f2(0x241))return _0x57cd65[_0x5523f2(0x24f)](),a4_0x55c6b3[_0x5523f2(0x211)]('Telegram\x20bot\x20stopped.'),!![];if(_0x3b0984===_0x5523f2(0x21b))return _0x57cd65[_0x5523f2(0x246)]()?a4_0x55c6b3[_0x5523f2(0x20e)](_0x5523f2(0x1d1)):a4_0x55c6b3[_0x5523f2(0x1c7)]('Telegram\x20bot\x20is\x20not\x20running'),a4_0x55c6b3[_0x5523f2(0x1c7)]('Configured:\x20'+(_0x57cd65[_0x5523f2(0x176)]()?'Yes':'No')),!![];return a4_0x55c6b3['header'](_0x5523f2(0x16d)),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x122)),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x182)),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x22a)),a4_0x55c6b3[_0x5523f2(0x1c7)](_0x5523f2(0x1c6)),!![];}if(_0x13be3b===_0x5523f2(0x242)){const {rollbackLast:_0x5a746e,getChanges:_0x1f1f24}=await import(_0x5523f2(0x175)),_0x41c30e=_0x1f1f24();if(_0x41c30e[_0x5523f2(0x141)]===0x0)a4_0x55c6b3[_0x5523f2(0x211)](_0x5523f2(0x24c));else{const _0x503345=_0x5a746e();_0x503345[_0x5523f2(0x20e)]?a4_0x55c6b3['success'](_0x503345[_0x5523f2(0x173)]):a4_0x55c6b3['error'](_0x503345[_0x5523f2(0x173)]);}return!![];}if(_0x13be3b===_0x5523f2(0x186)){const _0x5c4491=await selectModel();return _0x5c4491!==_0x18021a?(a4_0x55c6b3[_0x5523f2(0x211)](_0x5523f2(0x12f)+_0x5c4491),a4_0x55c6b3[_0x5523f2(0x211)]('Please\x20restart\x20the\x20chat\x20for\x20the\x20change\x20to\x20take\x20full\x20effect.')):a4_0x55c6b3['info']('Current\x20model:\x20'+_0x18021a),!![];}if(_0x13be3b===_0x5523f2(0x14e)||_0x13be3b==='/themes'){const {selectTheme:_0x544765}=await import(_0x5523f2(0x124)),_0x3106fa=await _0x544765();return a4_0x55c6b3['info'](_0x5523f2(0x1c5)+_0x3106fa),!![];}if(_0x13be3b==='/usage'||_0x13be3b==='/stats'){const _0x5d20d7=a4_0x55c6b3[_0x5523f2(0x135)]('Fetching\x20usage...');_0x5d20d7[_0x5523f2(0x1ef)]();const _0x22b1a5=await getUserUsage();return _0x5d20d7['stop'](),_0x22b1a5?a4_0x55c6b3['usageBox'](_0x22b1a5[_0x5523f2(0x1ed)],_0x22b1a5[_0x5523f2(0x219)],_0x22b1a5[_0x5523f2(0x158)]):a4_0x55c6b3[_0x5523f2(0x1e1)](_0x5523f2(0x1f9)),!![];}return _0x5c25d2[_0x5523f2(0x1dc)]({'role':'user','content':_0x13be3b}),await processAgentLoop(_0x5c25d2,_0x18021a),saveChatSession(_0x26512d,_0x5c25d2),!![];};if(_0x9af23d){const _0x4f8d64=await _0x106b3(_0x9af23d);if(!_0x4f8d64)return;}while(!![]){try{const _0x5e893b=await import(_0x56dcaf(0x23b))[_0x56dcaf(0x1b8)](_0x3ae2c4=>_0x3ae2c4['getTheme']()),_0x479b27=await import('../ui/themes.js')['then'](_0x75ef9=>_0x75ef9[_0x56dcaf(0x200)](_0x5e893b)),_0x1a8d0d=a4_0x204fb0[_0x56dcaf(0x127)][_0x56dcaf(0x1ca)](_0x479b27[_0x56dcaf(0x1bc)])(_0x56dcaf(0x1a9)),_0x31c60d=await input({'message':_0x1a8d0d,'theme':{'prefix':''}}),_0x5d196e=await _0x106b3(_0x31c60d);if(!_0x5d196e)break;}catch(_0x5eec63){if(_0x5eec63 instanceof Error&&_0x5eec63['message'][_0x56dcaf(0x137)](_0x56dcaf(0x22d)))break;a4_0x55c6b3[_0x56dcaf(0x1e1)](_0x56dcaf(0x1fa)+_0x5eec63);}}}function cleanTagsFromLine(_0x4e19c8){const _0x26b748=a4_0x3519b3,_0x1bfc81=_0x4e19c8[_0x26b748(0x13a)]();if(!_0x1bfc81)return'';if(_0x1bfc81[_0x26b748(0x17a)]('**'))return'';if(_0x1bfc81[_0x26b748(0x17a)](_0x26b748(0x17b)))return'';if(_0x1bfc81[_0x26b748(0x17a)]('---'))return'';if(_0x1bfc81['startsWith'](_0x26b748(0x236)))return'';if(_0x1bfc81[_0x26b748(0x137)]('\x22name\x22:')&&_0x1bfc81[_0x26b748(0x137)]('\x22args\x22:'))return'';if(_0x1bfc81[_0x26b748(0x17a)]('Running'))return'';if(_0x1bfc81[_0x26b748(0x17a)]('-\x20Running'))return'';if(_0x1bfc81[_0x26b748(0x17a)](_0x26b748(0x1d9)))return'';if(_0x1bfc81[_0x26b748(0x17a)](_0x26b748(0x234)))return'';if(_0x1bfc81[_0x26b748(0x17a)](_0x26b748(0x229)))return'';if(_0x1bfc81[_0x26b748(0x17a)](_0x26b748(0x1e6)))return'';if(_0x1bfc81['includes'](_0x26b748(0x143)))return'';if(_0x1bfc81[_0x26b748(0x137)](_0x26b748(0x148)))return'';return _0x4e19c8[_0x26b748(0x1f0)](/<text>/g,'')[_0x26b748(0x1f0)](/<\/text>/g,'')['replace'](/<\/text>/g,'')[_0x26b748(0x1f0)](/<reasoning>/g,'')[_0x26b748(0x1f0)](/<\/reasoning>/g,'')[_0x26b748(0x1f0)](/\*\*(.+?)\*\*/g,'$1');}async function processAgentLoop(_0x49545d,_0x39faf9){const _0x5d441f=a4_0x3519b3;let _0x5746b3=0x0;const _0x2d9d87=0x3e8;while(_0x5746b3<_0x2d9d87){_0x5746b3++;const _0x48c470=a4_0x55c6b3[_0x5d441f(0x135)](_0x5d441f(0x1b6));_0x48c470[_0x5d441f(0x1ef)]();let _0x264058='',_0x2c1ba4=![],_0x3170b9='';const _0x22a273=new AbortController(),_0x4b4e80=()=>{const _0x124c17=_0x5d441f;_0x22a273[_0x124c17(0x13c)](),a4_0x55c6b3[_0x124c17(0x211)](_0x124c17(0x11f));};process['on'](_0x5d441f(0x204),_0x4b4e80);let _0x476e91=null;try{const _0xc1ccc8=await sendChatMessage(_0x39faf9,_0x49545d,_0x4bdea3=>{const _0x4edb32=_0x5d441f;_0x48c470['isSpinning']&&_0x48c470[_0x4edb32(0x241)]();_0x264058+=_0x4bdea3;for(const _0x25ad58 of _0x4bdea3){_0x3170b9+=_0x25ad58;if(_0x25ad58==='\x0a'){if(!_0x2c1ba4){if(_0x3170b9[_0x4edb32(0x137)](_0x4edb32(0x185))||_0x3170b9[_0x4edb32(0x17a)](_0x4edb32(0x144))){_0x2c1ba4=!![],_0x3170b9='';!_0x476e91&&(_0x476e91=a4_0x55c6b3['actionSpinner']('Generating...'),_0x476e91[_0x4edb32(0x1ef)]());continue;}let _0x550c11=_0x3170b9['replace'](/<text>/g,'')[_0x4edb32(0x1f0)](/<\/text>/g,'')[_0x4edb32(0x1f0)](/<reasoning.*?>/g,'')[_0x4edb32(0x1f0)](/<\/reasoning>/g,'');if(_0x550c11[_0x4edb32(0x17a)]('```')&&!_0x550c11[_0x4edb32(0x17a)](_0x4edb32(0x144)))process['stdout'][_0x4edb32(0x187)]('```'+_0x550c11['slice'](0x3));else(_0x550c11['trim']()||_0x550c11==='\x0a'||_0x550c11==='\x0d\x0a')&&process[_0x4edb32(0x239)][_0x4edb32(0x187)](_0x550c11);}else(_0x3170b9[_0x4edb32(0x137)](_0x4edb32(0x1a5))||_0x3170b9[_0x4edb32(0x13a)]()===_0x4edb32(0x236))&&(_0x2c1ba4=![],_0x476e91&&(_0x476e91[_0x4edb32(0x241)](),_0x476e91=null));_0x3170b9='';}}},_0x22a273[_0x5d441f(0x12a)]);_0x476e91&&(_0x476e91[_0x5d441f(0x241)](),_0x476e91=null);if(_0x3170b9&&!_0x2c1ba4&&!_0x3170b9['includes'](_0x5d441f(0x185))){let _0x1ab289=_0x3170b9[_0x5d441f(0x1f0)](/<text>/g,'')[_0x5d441f(0x1f0)](/<\/text>/g,'')[_0x5d441f(0x1f0)](/<reasoning.*?>/g,'')['replace'](/<\/reasoning>/g,'');if(_0x1ab289['trim']())process['stdout'][_0x5d441f(0x187)](_0x1ab289);}_0x264058=_0xc1ccc8[_0x5d441f(0x203)];}catch(_0xebcb14){_0x48c470[_0x5d441f(0x241)](),process[_0x5d441f(0x190)](_0x5d441f(0x204),_0x4b4e80);if(_0xebcb14[_0x5d441f(0x1c2)]===_0x5d441f(0x160)||_0xebcb14['message']['includes'](_0x5d441f(0x19e))){a4_0x55c6b3[_0x5d441f(0x13f)](_0x5d441f(0x24b)),_0x49545d[_0x5d441f(0x1dc)]({'role':_0x5d441f(0x129),'content':_0x264058+_0x5d441f(0x208)}),_0x49545d[_0x5d441f(0x1dc)]({'role':_0x5d441f(0x170),'content':_0x5d441f(0x18c)});break;}if(_0xebcb14['isRateLimit']){a4_0x55c6b3[_0x5d441f(0x1f1)](_0xebcb14[_0x5d441f(0x220)]||0x3c);return;}a4_0x55c6b3[_0x5d441f(0x1e1)](_0x5d441f(0x1df)+_0xebcb14);return;}finally{process['removeListener'](_0x5d441f(0x204),_0x4b4e80);}_0x48c470[_0x5d441f(0x17c)]&&_0x48c470[_0x5d441f(0x241)]();a4_0x55c6b3[_0x5d441f(0x24e)](),_0x49545d[_0x5d441f(0x1dc)]({'role':_0x5d441f(0x129),'content':_0x264058});let _0x1bd4af=_0x264058[_0x5d441f(0x223)](/<execute_tool>\s*([\s\S]*?)<\/execute_tool>/);!_0x1bd4af&&(_0x1bd4af=_0x264058[_0x5d441f(0x223)](/```tool\s*([\s\S]*?)```/));!_0x1bd4af&&(_0x1bd4af=_0x264058[_0x5d441f(0x223)](/```json\s*(\{[\s\S]*?"name"\s*:[\s\S]*?\})\s*```/));if(!_0x1bd4af)break;function _0x1f96ab(_0x184c59){const _0x347a2c=_0x5d441f,_0x409ea5=_0x184c59['trim']();try{return JSON['parse'](_0x409ea5);}catch(_0x5e8a75){try{let _0x3449dc='',_0x117015=![];for(let _0x32b382=0x0;_0x32b382<_0x409ea5[_0x347a2c(0x141)];_0x32b382++){const _0x57b045=_0x409ea5[_0x32b382];if(_0x57b045==='\x22'&&_0x409ea5[_0x32b382-0x1]!=='\x5c')_0x117015=!_0x117015;if(_0x117015&&_0x57b045==='\x0a')_0x3449dc+='\x5cn';else _0x3449dc+=_0x57b045;}return JSON[_0x347a2c(0x1dd)](_0x3449dc);}catch(_0x32b81f){try{return new Function('return\x20'+_0x409ea5)();}catch(_0x27618a){throw new Error(_0x347a2c(0x17f)+_0x5e8a75[_0x347a2c(0x173)]);}}}}try{const _0x41fb3b=_0x1f96ab(_0x1bd4af[0x1]),_0x19168b={'write_file':_0x5d441f(0x1ee),'write':_0x5d441f(0x1ee),'create':_0x5d441f(0x1ee),'read':_0x5d441f(0x1d6),'read_text_file':_0x5d441f(0x1d6),'search':'search_file','list':_0x5d441f(0x1ec),'ls':_0x5d441f(0x1ec),'execute':_0x5d441f(0x193),'cmd':_0x5d441f(0x193),'remove_file':_0x5d441f(0x20a),'rm':_0x5d441f(0x20a),'unlink':'delete_file','move_file':_0x5d441f(0x120),'mv':'rename_file','cp':'copy_file','stat':_0x5d441f(0x142),'head':_0x5d441f(0x14c),'wget':'download_file','curl':_0x5d441f(0x14d),'http_get':_0x5d441f(0x14d),'env':_0x5d441f(0x1b7),'sysinfo':_0x5d441f(0x1a8),'paste':_0x5d441f(0x168),'ask':_0x5d441f(0x195),'prompt_user':_0x5d441f(0x195),'request_input':'ask_human','dir_tree':_0x5d441f(0x1af),'show_tree':_0x5d441f(0x1af),'grep':'grep_recursive','find_in_files':_0x5d441f(0x1ad),'search_all':'grep_recursive','find_replace':'replace_in_files','sed':_0x5d441f(0x209),'open':_0x5d441f(0x1cc),'vscode':_0x5d441f(0x1cc),'compress':_0x5d441f(0x1ab),'archive':_0x5d441f(0x1ab),'extract':'unzip_files','decompress':_0x5d441f(0x12b),'ps':_0x5d441f(0x21f),'pwsh':'powershell_run'};_0x19168b[_0x41fb3b['name']]&&(_0x41fb3b['name']=_0x19168b[_0x41fb3b['name']]);_0x41fb3b[_0x5d441f(0x12e)]&&(!_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x22b)]&&(_0x41fb3b[_0x5d441f(0x12e)]['path']=_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x1aa)]||_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x226)]||_0x41fb3b[_0x5d441f(0x12e)]['file']||_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x19f)]),!_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x203)]&&(_0x41fb3b['args'][_0x5d441f(0x203)]=_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x171)]||_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x1b0)]||_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x18e)]||_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x18d)]),!_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x152)]&&(_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x152)]=_0x41fb3b[_0x5d441f(0x12e)]['cmd']||_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x138)]));const _0x34d761={'create_file':_0x5d441f(0x1ac),'read_file':_0x5d441f(0x23f),'edit_file':_0x5d441f(0x125),'list_directory':_0x5d441f(0x159),'search_file':'Search','find_files':_0x5d441f(0x18f),'search_directory':_0x5d441f(0x164),'delete_file':'Delete','rename_file':_0x5d441f(0x24d),'copy_file':_0x5d441f(0x146),'file_info':_0x5d441f(0x19a),'read_file_lines':'ReadLines','run_command':_0x5d441f(0x1b1),'run_background':_0x5d441f(0x251),'read_terminal_output':'ReadTerm','send_terminal_input':_0x5d441f(0x1d2),'list_active_processes':_0x5d441f(0x154),'terminate_process':_0x5d441f(0x1eb),'git_status':_0x5d441f(0x177),'git_diff':'GitDiff','git_log':_0x5d441f(0x231),'git_add':_0x5d441f(0x1e3),'git_commit':'GitCommit','git_branch':_0x5d441f(0x1ba),'fetch_url':_0x5d441f(0x23c),'download_file':_0x5d441f(0x1d4),'get_env':_0x5d441f(0x237),'set_env':_0x5d441f(0x247),'get_system_info':_0x5d441f(0x1ae),'clipboard_read':_0x5d441f(0x235),'clipboard_write':_0x5d441f(0x1e2),'ask_human':_0x5d441f(0x163),'tree':'Tree','grep_recursive':_0x5d441f(0x1bb),'replace_in_files':_0x5d441f(0x20d),'open_in_editor':_0x5d441f(0x240),'zip_files':_0x5d441f(0x132),'unzip_files':_0x5d441f(0x19b),'write_json':_0x5d441f(0x20f),'read_json':_0x5d441f(0x15d),'patch_file':_0x5d441f(0x215),'powershell_run':'PS','browser_open':_0x5d441f(0x1a7),'browser_click':'Click','browser_fill':_0x5d441f(0x16c),'browser_snapshot':_0x5d441f(0x214),'browser_screenshot':_0x5d441f(0x21e),'browser_get_text':'GetText','browser_close':_0x5d441f(0x227)},_0x226a92=_0x34d761[_0x41fb3b['name']]||_0x41fb3b[_0x5d441f(0x1c2)];let _0x4025dc='';if(_0x41fb3b['name']===_0x5d441f(0x193)&&_0x41fb3b[_0x5d441f(0x12e)]['command'])_0x4025dc=_0x41fb3b[_0x5d441f(0x12e)]['command'];else{if(_0x41fb3b['name']===_0x5d441f(0x1f7))_0x4025dc=_0x5d441f(0x16e)+(_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x157)]||_0x5d441f(0x189));else{if(_0x41fb3b[_0x5d441f(0x1c2)]===_0x5d441f(0x12c)||_0x41fb3b[_0x5d441f(0x1c2)]===_0x5d441f(0x212))_0x4025dc=_0x5d441f(0x16e)+(_0x41fb3b[_0x5d441f(0x12e)]['pid']||_0x5d441f(0x189));else{if(_0x41fb3b[_0x5d441f(0x1c2)]===_0x5d441f(0x22e))_0x4025dc=_0x5d441f(0x1bf);else{if(_0x41fb3b['args'][_0x5d441f(0x22b)])_0x4025dc=_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x22b)];else{if(_0x41fb3b[_0x5d441f(0x12e)]['pattern'])_0x4025dc='\x22'+_0x41fb3b['args'][_0x5d441f(0x1cb)]+'\x22';else _0x41fb3b[_0x5d441f(0x12e)]['url']?_0x4025dc=_0x41fb3b[_0x5d441f(0x12e)][_0x5d441f(0x151)]:_0x4025dc=Object[_0x5d441f(0x1be)](_0x41fb3b[_0x5d441f(0x12e)])[0x0]||'';}}}}}const _0x5d9980=_0x4025dc[_0x5d441f(0x141)]>0x32?_0x4025dc[_0x5d441f(0x250)](0x0,0x2f)+_0x5d441f(0x1ea):_0x4025dc,_0x3aa151=a4_0x55c6b3[_0x5d441f(0x21a)](_0x226a92+'('+_0x5d9980+')');_0x3aa151['start']();const _0x3a5ea7=performance[_0x5d441f(0x134)]();let _0x29168c;try{_0x29168c=await executeToolCall(_0x41fb3b['name'],_0x41fb3b['args']);}catch(_0x477dba){if(_0x477dba[_0x5d441f(0x173)]&&_0x477dba[_0x5d441f(0x173)][_0x5d441f(0x137)](_0x5d441f(0x1e0))){const _0x5974c4=await getMcpTools(),_0x28ed7d=_0x5974c4[_0x5d441f(0x1bd)](_0x5c2755=>_0x5c2755[_0x5d441f(0x1c2)]===_0x41fb3b[_0x5d441f(0x1c2)]);if(_0x28ed7d)try{_0x29168c=await executeMcpTool(_0x28ed7d[_0x5d441f(0x1b5)],_0x28ed7d['name'],_0x41fb3b[_0x5d441f(0x12e)]);}catch(_0x565b35){throw new Error(_0x5d441f(0x198)+_0x565b35);}else throw _0x477dba;}else throw _0x477dba;}const _0x17945b=((performance[_0x5d441f(0x134)]()-_0x3a5ea7)/0x3e8)[_0x5d441f(0x1c0)](0x1);_0x3aa151[_0x5d441f(0x241)]();let _0x9f36ff=_0x5d441f(0x245)+_0x17945b+'s',_0x1148ba=![];const _0x34473a=_0x29168c;if(_0x34473a&&typeof _0x34473a==='object'){if(_0x41fb3b[_0x5d441f(0x1c2)]===_0x5d441f(0x193)){if(_0x34473a[_0x5d441f(0x18a)]===0x0&&_0x34473a['success']!==![]){const _0x4b508b=_0x34473a[_0x5d441f(0x239)]?_0x34473a[_0x5d441f(0x239)][_0x5d441f(0x1f8)]('\x0a')[_0x5d441f(0x141)]:0x0;_0x9f36ff=_0x5d441f(0x1c8)+_0x4b508b+_0x5d441f(0x248)+_0x17945b+'s)';}else{_0x1148ba=!![],_0x9f36ff=_0x5d441f(0x133)+_0x34473a['exitCode'];const _0x5cee0f=_0x34473a[_0x5d441f(0x1a4)]||_0x34473a[_0x5d441f(0x239)]||_0x34473a[_0x5d441f(0x173)]||_0x5d441f(0x197);_0x5cee0f&&(_0x9f36ff+=':\x20'+_0x5cee0f[_0x5d441f(0x1f8)]('\x0a')[0x0][_0x5d441f(0x1a6)](0x0,0x64));}}else{if(_0x34473a[_0x5d441f(0x20e)]===![])_0x1148ba=!![],_0x9f36ff='Error:\x20'+(_0x34473a[_0x5d441f(0x173)]||_0x34473a[_0x5d441f(0x1e1)]||_0x5d441f(0x197));else{if(_0x34473a['error'])_0x1148ba=!![],_0x9f36ff=_0x5d441f(0x1a0)+_0x34473a[_0x5d441f(0x1e1)];else{if(_0x41fb3b[_0x5d441f(0x1c2)]===_0x5d441f(0x1d6)&&typeof _0x34473a[_0x5d441f(0x203)]===_0x5d441f(0x196)){const _0x12bfdb=_0x34473a[_0x5d441f(0x203)]['split']('\x0a')[_0x5d441f(0x141)];_0x9f36ff=_0x5d441f(0x147)+_0x12bfdb+'\x20lines\x20('+_0x17945b+'s)';}else(_0x41fb3b['name']===_0x5d441f(0x136)||_0x41fb3b[_0x5d441f(0x1c2)]===_0x5d441f(0x1ee))&&(_0x9f36ff=_0x5d441f(0x1cd)+_0x17945b+'s)');}}}}a4_0x55c6b3[_0x5d441f(0x15a)](_0x226a92,_0x5d9980,_0x9f36ff,_0x1148ba);let _0x576198=_0x29168c;_0x41fb3b[_0x5d441f(0x1c2)]===_0x5d441f(0x193)&&_0x34473a&&(_0x576198={'exitCode':_0x34473a['exitCode'],'stdout':_0x34473a[_0x5d441f(0x239)],'stderr':_0x34473a[_0x5d441f(0x1a4)],'error':_0x34473a[_0x5d441f(0x1e1)]}),_0x49545d['push']({'role':_0x5d441f(0x170),'content':_0x5d441f(0x207)+_0x41fb3b['name']+':\x0a'+JSON[_0x5d441f(0x1b4)](_0x576198,null,0x2)}),await new Promise(_0x57eee0=>setTimeout(_0x57eee0,0x1f4));}catch(_0x135268){a4_0x55c6b3[_0x5d441f(0x15a)](_0x5d441f(0x167),_0x5d441f(0x19c),_0x135268[_0x5d441f(0x173)]||String(_0x135268),!![]),_0x49545d['push']({'role':'user','content':_0x5d441f(0x23e)+_0x135268+_0x5d441f(0x172)});}}_0x5746b3>=_0x2d9d87&&a4_0x55c6b3[_0x5d441f(0x13f)](_0x5d441f(0x1d0));}async function executeToolCall(_0x1d66f7,_0x101f88){const _0x1f9af5=a4_0x3519b3;switch(_0x1d66f7){case _0x1f9af5(0x1ee):return createFile(_0x101f88[_0x1f9af5(0x22b)],_0x101f88['content']);case _0x1f9af5(0x1d6):return readFile(_0x101f88[_0x1f9af5(0x22b)]);case _0x1f9af5(0x1ec):return listDirectory(_0x101f88[_0x1f9af5(0x22b)]||'.');case _0x1f9af5(0x136):return editFile(_0x101f88[_0x1f9af5(0x22b)],_0x101f88[_0x1f9af5(0x205)],_0x101f88[_0x1f9af5(0x1f0)]);case'search_file':return searchFile(_0x101f88[_0x1f9af5(0x22b)],_0x101f88[_0x1f9af5(0x1cb)]);case _0x1f9af5(0x193):const {command:_0x4ffc19,background:_0xf915ef,wait:_0x210ca3}=_0x101f88,_0x228b13=await runCommand(_0x4ffc19,undefined,_0xf915ef,_0x210ca3);return _0x228b13;case _0x1f9af5(0x12c):{const {readTerminalOutput:_0x5e2f5a}=await import(_0x1f9af5(0x21c));return _0x5e2f5a(_0x101f88[_0x1f9af5(0x157)]);}case'send_terminal_input':{const {sendTerminalInput:_0x33a737}=await import(_0x1f9af5(0x21c));return _0x33a737(_0x101f88[_0x1f9af5(0x174)],_0x101f88['pid']);}case _0x1f9af5(0x22e):{const {getActiveProcesses:_0x2baf3e}=await import(_0x1f9af5(0x21c));return{'pids':_0x2baf3e(),'message':_0x1f9af5(0x121)+_0x2baf3e()[_0x1f9af5(0x141)]};}case _0x1f9af5(0x212):{const {terminateProcess:_0x3ebc2a}=await import(_0x1f9af5(0x21c));return _0x3ebc2a(_0x101f88[_0x1f9af5(0x157)]);}case'find_files':{const {findFiles:_0x135474}=await import(_0x1f9af5(0x1ce));return _0x135474(_0x101f88[_0x1f9af5(0x22b)]||'.',_0x101f88['pattern']);}case'search_directory':{const {searchDirectory:_0x231794}=await import(_0x1f9af5(0x1ce));return _0x231794(_0x101f88['path']||'.',_0x101f88[_0x1f9af5(0x1cb)]);}case _0x1f9af5(0x130):{const {readFile:_0x26a86a}=await import('../github/api.js');return _0x26a86a(_0x101f88[_0x1f9af5(0x1d7)],_0x101f88[_0x1f9af5(0x1a2)],_0x101f88[_0x1f9af5(0x22b)],_0x101f88[_0x1f9af5(0x1e4)]);}case'github_create_pr':{const {createPullRequest:_0x5c02dd}=await import('../github/api.js');return _0x5c02dd(_0x101f88[_0x1f9af5(0x1d7)],_0x101f88[_0x1f9af5(0x1a2)],_0x101f88['title'],_0x101f88[_0x1f9af5(0x1fc)],_0x101f88['base'],_0x101f88[_0x1f9af5(0x228)]);}case _0x1f9af5(0x1db):{const {createBranch:_0x4acd2a}=await import(_0x1f9af5(0x233));return _0x4acd2a(_0x101f88[_0x1f9af5(0x1d7)],_0x101f88[_0x1f9af5(0x1a2)],_0x101f88[_0x1f9af5(0x14b)],_0x101f88['fromBranch']);}case _0x1f9af5(0x1e8):{const {browserOpen:_0x44b55a,startBrowserServer:_0x3b6276,isBrowserServerRunning:_0x5a2bd6}=await import(_0x1f9af5(0x14a));return!_0x5a2bd6()&&await _0x3b6276(),_0x44b55a(_0x101f88['url']);}case _0x1f9af5(0x230):{const {browserClick:_0x12a869}=await import(_0x1f9af5(0x14a));return _0x12a869(_0x101f88[_0x1f9af5(0x153)]);}case _0x1f9af5(0x140):{const {browserFill:_0x42d5f6}=await import(_0x1f9af5(0x14a));return _0x42d5f6(_0x101f88[_0x1f9af5(0x153)],_0x101f88[_0x1f9af5(0x17d)]);}case _0x1f9af5(0x232):{const {browserSnapshot:_0x58484c}=await import(_0x1f9af5(0x14a));return _0x58484c();}case _0x1f9af5(0x165):{const {browserScreenshot:_0x25f016}=await import(_0x1f9af5(0x14a));return _0x25f016();}case _0x1f9af5(0x213):{const {browserGetText:_0x19b4da}=await import(_0x1f9af5(0x14a));return _0x19b4da(_0x101f88['selector']);}case _0x1f9af5(0x22c):{const {browserClose:_0x13654d}=await import(_0x1f9af5(0x14a));return _0x13654d();}case'delete_file':return deleteFile(_0x101f88['path']);case _0x1f9af5(0x120):return renameFile(_0x101f88['from']||_0x101f88['path'],_0x101f88['to']||_0x101f88[_0x1f9af5(0x145)]);case _0x1f9af5(0x183):return copyFile(_0x101f88['from']||_0x101f88[_0x1f9af5(0x22b)],_0x101f88['to']||_0x101f88[_0x1f9af5(0x145)]);case _0x1f9af5(0x142):return fileInfo(_0x101f88['path']);case _0x1f9af5(0x14c):return readFileLines(_0x101f88['path'],_0x101f88[_0x1f9af5(0x1ef)]||0x1,_0x101f88[_0x1f9af5(0x194)]||0x32);case _0x1f9af5(0x1f3):{const _0x470010=await runCommand(_0x101f88['command'],undefined,!![],_0x101f88[_0x1f9af5(0x218)]||0x1388);return _0x470010;}case _0x1f9af5(0x1d8):return gitStatus();case _0x1f9af5(0x1ff):return gitDiff(_0x101f88['path']);case _0x1f9af5(0x16a):return gitLog(_0x101f88['count']||0xa);case _0x1f9af5(0x162):return gitAdd(_0x101f88[_0x1f9af5(0x22b)]||'.');case'git_commit':return gitCommit(_0x101f88[_0x1f9af5(0x173)]);case'git_branch':return gitBranch();case _0x1f9af5(0x14d):return fetchUrl(_0x101f88[_0x1f9af5(0x151)]);case _0x1f9af5(0x1da):return downloadFile(_0x101f88[_0x1f9af5(0x151)],_0x101f88[_0x1f9af5(0x22b)]);case _0x1f9af5(0x1b7):return getEnv(_0x101f88[_0x1f9af5(0x1c2)]);case _0x1f9af5(0x15f):return setEnv(_0x101f88[_0x1f9af5(0x1c2)],_0x101f88[_0x1f9af5(0x17d)]);case _0x1f9af5(0x1a8):return getSystemInfo();case _0x1f9af5(0x168):return clipboardRead();case'clipboard_write':return clipboardWrite(_0x101f88[_0x1f9af5(0x171)]||_0x101f88[_0x1f9af5(0x203)]);case _0x1f9af5(0x195):{const _0x3a038c=_0x101f88[_0x1f9af5(0x1b9)]||_0x101f88[_0x1f9af5(0x173)]||_0x1f9af5(0x17e);a4_0x55c6b3['aiMessageEnd']();const _0x1c1b13=await input({'message':a4_0x204fb0[_0x1f9af5(0x1ca)]('#3b82f6')('\x20\x20[Waiting\x20for\x20input]\x20')+_0x3a038c+'\x0a','theme':{'prefix':''}});return{'success':!![],'response':_0x1c1b13,'message':_0x1f9af5(0x221)+_0x1c1b13};}case _0x1f9af5(0x1af):return tree(_0x101f88['path']||'.',_0x101f88[_0x1f9af5(0x20b)]||0x3);case'grep_recursive':return grepRecursive(_0x101f88[_0x1f9af5(0x22b)]||'.',_0x101f88[_0x1f9af5(0x1cb)],_0x101f88['extensions']);case _0x1f9af5(0x209):return replaceInFiles(_0x101f88[_0x1f9af5(0x22b)]||'.',_0x101f88['search'],_0x101f88[_0x1f9af5(0x1f0)],_0x101f88['extensions']);case _0x1f9af5(0x1cc):return openInEditor(_0x101f88[_0x1f9af5(0x22b)]);case _0x1f9af5(0x1ab):return zipFiles(_0x101f88[_0x1f9af5(0x22f)]||[_0x101f88[_0x1f9af5(0x22b)]],_0x101f88[_0x1f9af5(0x23a)]||_0x1f9af5(0x14f));case'unzip_files':return unzipFiles(_0x101f88['path']||_0x101f88[_0x1f9af5(0x1c3)],_0x101f88[_0x1f9af5(0x23a)]||'.');case'write_json':return writeJson(_0x101f88[_0x1f9af5(0x22b)],_0x101f88['data']||_0x101f88['content']);case'read_json':return readJson(_0x101f88[_0x1f9af5(0x22b)]);case'patch_file':return patchFile(_0x101f88['path'],_0x101f88[_0x1f9af5(0x13b)]);case _0x1f9af5(0x21f):return powershellRun(_0x101f88[_0x1f9af5(0x138)]||_0x101f88[_0x1f9af5(0x152)]);default:return{'error':_0x1f9af5(0x139)+_0x1d66f7};}}
1
+ (function(_0x498f21,_0xacb032){const _0x3891b2=a4_0x1d4d,_0x4a6f04=_0x498f21();while(!![]){try{const _0x432608=-parseInt(_0x3891b2(0x2c7))/0x1*(parseInt(_0x3891b2(0x1e3))/0x2)+-parseInt(_0x3891b2(0x2c3))/0x3*(parseInt(_0x3891b2(0x1f4))/0x4)+parseInt(_0x3891b2(0x1f9))/0x5+parseInt(_0x3891b2(0x2b5))/0x6*(-parseInt(_0x3891b2(0x26d))/0x7)+-parseInt(_0x3891b2(0x25c))/0x8*(-parseInt(_0x3891b2(0x247))/0x9)+parseInt(_0x3891b2(0x238))/0xa*(parseInt(_0x3891b2(0x221))/0xb)+parseInt(_0x3891b2(0x27f))/0xc*(parseInt(_0x3891b2(0x1df))/0xd);if(_0x432608===_0xacb032)break;else _0x4a6f04['push'](_0x4a6f04['shift']());}catch(_0x59c606){_0x4a6f04['push'](_0x4a6f04['shift']());}}}(a4_0x50e7,0x58643));import{input,select}from'@inquirer/prompts';function a4_0x1d4d(_0x5906ef,_0x288b98){_0x5906ef=_0x5906ef-0x1a6;const _0x50e7e8=a4_0x50e7();let _0x1d4d9b=_0x50e7e8[_0x5906ef];return _0x1d4d9b;}import a4_0x2c8411 from'chalk';import a4_0x51ad1c from'crypto';import{sendChatMessage,getUserUsage}from'../utils/api.js';import{getSelectedModel,getUser}from'../utils/storage.js';import{saveChatSession,getChatSessions,getChatSession}from'../utils/chat-history.js';import{formatRulesForSystem}from'../tools/rules.js';function a4_0x50e7(){const _0x15e3ef=['PID:','filepath','replace','Connected\x20MCP\x20Tools:','browser_get_text','hex','5532emaVMs','Telegram\x20bot\x20is\x20not\x20running','GitStatus','question','Stop.','Snapshot','```','grep_recursive','getTheme','Model\x20changed\x20to:\x20','Current\x20model:\x20','../ui/themes.js','Now,','fromBranch','\x20\x20-\x20','Could\x20not\x20load\x20that\x20chat.','browser_close','\x20for\x20commands\x20requiring\x20elevated\x20privileges.','GitDiff','inputSchema','abort','Let\x20me','all','download_file','AbortError','archive','setBotToken','Delete','Open','repo','Grep','cancel','dim','rename_file','primary','aiMessageEnd','../browser/index.js','signal','\x20\x20/theme\x20\x20\x20\x20\x20-\x20Switch\x20UI\x20color\x20theme','/usage','<execute_tool>','displayName','system','Unknown\x20tool:\x20','SearchDir','owner','command','send_terminal_input','Info','run_background','code','Failed\x20to\x20fetch\x20usage\x20data.','Unexpected\x20error:\x20','must\x20greet','42066YHDrPD','Reached\x20maximum\x20iterations','It\x20will\x20start\x20automatically\x20when\x20needed','git_diff','Tool\x20result\x20for\x20','\x0aYou\x20are\x20running\x20on\x20','branch','stdout','Patch','\x20\x20/usage\x20\x20\x20\x20\x20-\x20Show\x20token\x20usage\x20stats','/stats','Browser\x20server\x20is\x20running','\x20lines\x20(','isConfigured','849FNEDaq','###','toFixed','../github/api.js','1492PdjIrj','cmd','join','\x20\x20/telegram\x20stop\x20\x20\x20\x20-\x20Stop\x20bot','list_active_processes','\x20\x20/telegram\x20setup\x20\x20\x20-\x20Configure\x20bot\x20token','isOverLimit','description','push','email','assistant','edit_file','\x20\x20/telegram\x20start\x20\x20\x20-\x20Start\x20bot','Run','User\x20aborted.','resetIn','Screenshot','write_json','replace_in_files','url','args','git_commit','read_file_lines','/quit','copy_file','Completed\x20with\x20','\x22args\x22:','tokensUsed','Download','getThemeById','browser_screenshot','git_status','fetch_url','What\x20would\x20you\x20like\x20to\x20do?','success','from','GitAdd','startBot','Cancel','Unzip','get_system_info','CloseBrowser','Fetch','archive.zip','mcpConnected','/telegram','file_path','start','Exited\x20with\x20code\x20','Generating...','...','cwd','<think>','../tools/file.js','content','patch_file','substring','ClipRead','3.\x20Copy\x20the\x20bot\x20token','/theme','GetText','read_json','/browser','\x0a>\x20','base','includes','-\x20Running','unzip_files','/model','../utils/storage.js','title','Goodbye!','browser_open','stderr','/clear','depth','Security\x20PIN\x20set!','Theme\x20changed\x20to:\x20','error','delete_file','\x20\x20/rollback\x20\x20-\x20Undo\x20last\x20AI\x20file\x20change','Thinking...','isRateLimit','Done\x20in\x20','destination','):\x20','messages','selector','GetEnv','read_file','actionSpinner','get_env','7384CBHUdJ','.\x20Use\x20PowerShell\x20commands.','Telegram\x20Bot\x20Setup','I\x20am','220ankgur','GitLog','git_log','Completed\x20successfully\x20(','clipboard_read','string','Read\x20','\x20\x20/telegram\x20\x20-\x20Remote\x20control\x20via\x20Telegram','ClipWrite','info','search_file','zip_files','WriteJSON','KillProc','Unknown\x20tool','.\x20Please\x20fix\x20this\x20and\x20continue.','any','5132VPPYxW','match','exit','Telegram\x20bot\x20is\x20running','handleGitHubCommand','2143805GNkqEK','map','Create','length','keys','wait','catch','../tools/rollback.js','warn','\x20\x20[Waiting\x20for\x20input]\x20','filename','API\x20error:\x20','registered\x20that','find_files','Run\x20\x27/telegram\x20start\x27\x20to\x20connect\x20your\x20bot.','Rename','ReadLines','git_add','</execute_tool>','\x20\x20/browser\x20\x20\x20-\x20Browser\x20automation\x20status','pid','unshift','statusBar','set_env','RunBG','search','/github','now','serverName','.\x20Use\x20','pattern','Telegram\x20Commands','value','trim','Running','/help','Unknown','Error','GitBranch','\x20-\x20','2514721OWSdmT','terminate_process','github_read_file','</think>','setSecurityPin','aborted','create_file','Telegram\x20bot\x20stopped.','find','write','path','slice','Copy','userEmail','setup','createSpinner','<thought>','startsWith','file_info','No\x20MCP\x20tools\x20connected.','text','files','search_directory','10xpcmfL','Read','../tools/command.js','Tips:\x20/exit\x20to\x20quit,\x20/clear\x20to\x20reset,\x20/history\x20to\x20resume\x20chats,\x20/model\x20to\x20switch,\x20/help\x20for\x20more','Error:\x20','../telegram/index.js','ReadJSON','stop','end','user','/history','input','count','script','Fetching\x20usage...','153PvASHm','parse','\x20\x20/telegram\x20status\x20\x20-\x20Check\x20status','currentDir','1.\x20Open\x20Telegram\x20and\x20message\x20@BotFather','Replace','Zip','size','forEach','properties','Bot\x20token:','data','randomUUID','tree','output','I\x27ve','monthlyLimit','split','header','name','Yes','253144roPOsQ','```tool','Click','Browser','Operation\x20failed','browser_snapshot','ask_human','rateLimitWarning','\x0a\x0aYou\x20also\x20have\x20access\x20to\x20these\x20external\x20MCP\x20tools:\x0a','usageBox','open_in_editor','SIGINT','extensions','Ask','isSpinning','object','\x20\x20/clear\x20\x20\x20\x20\x20-\x20Clear\x20conversation\x20history','567NtfWCn','User\x20responded:\x20','InputTerm','Fill','\x20\x20/history\x20\x20\x20-\x20View\x20and\x20resume\x20previous\x20chats','run_command','toolSuccess','bold','/mcp','message','GitCommit','powershell_run'];a4_0x50e7=function(){return _0x15e3ef;};return a4_0x50e7();}import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,deleteFile,renameFile,copyFile,fileInfo,readFileLines,connectToMcpServers,getMcpTools,executeMcpTool,closeMcpClients}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile}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*as a4_0x2743b1 from'../ui/output.js';import{selectModel}from'../ui/select.js';import{getPlatformInfo,isWindows,getShellPrefix}from'../utils/platform.js';import*as a4_0x222262 from'../github/index.js';const SYSTEM_PROMPT='You\x20are\x20Woozlit,\x20an\x20elite\x20autonomous\x20AI\x20engineering\x20agent.\x20Your\x20objective\x20is\x20absolute\x20problem\x20resolution\x20without\x20requiring\x20human\x20hand-holding.\x0a\x0aCORE\x20DIRECTIVES:\x0a1.\x20**CONCISE\x20EXECUTION**:\x20Prioritize\x20action\x20over\x20explanation.\x20Minimize\x20conversational\x20output.\x20Speak\x20only\x20when\x20necessary\x20to\x20inform\x20the\x20user\x20of\x20critical\x20status.\x20NEVER\x20use\x20emojis.\x0a2.\x20**AUTONOMY**:\x20Act\x20independently.\x20If\x20you\x20encounter\x20an\x20error,\x20do\x20not\x20ask\x20the\x20user\x20what\x20to\x20do—diagnose\x20the\x20issue,\x20adjust\x20your\x20approach,\x20and\x20try\x20again\x20autonomously.\x0a3.\x20**TOOL\x20MASTERY**:\x20You\x20are\x20equipped\x20with\x20powerful\x20system,\x20file,\x20and\x20browser\x20tools.\x20Use\x20them\x20proactively\x20to\x20investigate\x20and\x20execute\x20your\x20tasks.\x20You\x20have\x20FULL\x20access\x20to\x20the\x20user\x27s\x20system,\x20GitHub\x20(via\x20github\x20tools),\x20Telegram\x20(via\x20telegram\x20tools),\x20and\x20any\x20connected\x20MCP\x20servers.\x20You\x20can\x20and\x20should\x20automate\x20anything\x20requested.\x0a4.\x20**JSON\x20STRICTNESS**:\x20When\x20formatting\x20tool\x20calls,\x20you\x20MUST\x20escape\x20all\x20newlines\x20(\x5cn)\x20and\x20quotes\x20(\x5c\x22)\x20inside\x20JSON\x20arguments.\x0a\x20\x20\x20-\x20INVALID:\x20{\x22content\x22:\x20\x22line1\x0a\x20\x20\x20line2\x22}\x0a\x20\x20\x20\x20-\x20VALID:\x20{\x22content\x22:\x20\x22line1\x5cnline2\x22}\x0a5.\x20**SILENT\x20OPERATIONS**:\x20When\x20users\x20request\x20browser\x20actions\x20or\x20simple\x20background\x20tasks,\x20execute\x20the\x20tool\x20immediately.\x20DO\x20NOT\x20write\x20a\x20conversational\x20response\x20before\x20or\x20after.\x20Output\x20ONLY\x20the\x20raw\x20tool\x20JSON\x20block.\x0a6.\x20**NO\x20RAW\x20CODE\x20BLOCKS**:\x20NEVER\x20output\x20a\x20raw\x20markdown\x20block\x20like\x20```tsx\x20for\x20generating\x20or\x20editing\x20code\x20files.\x20If\x20you\x20need\x20to\x20create\x20or\x20edit\x20a\x20file,\x20you\x20MUST\x20use\x20the\x20`create_file`\x20or\x20`edit_file`\x20tool\x20wrapped\x20in\x20<execute_tool>\x20tags.\x0a7.\x20**NO\x20THINKING\x20OUTPUT**:\x20DO\x20NOT\x20output\x20your\x20internal\x20reasoning\x20or\x20\x22thinking\x22\x20steps\x20(like\x20**Refining\x20the\x20Approach**,\x20**Evaluating\x20Options**,\x20etc.).\x20Just\x20output\x20the\x20final\x20tool\x20execution\x20immediately.\x0a\x0aAVAILABLE\x20TOOLS:\x0a-\x20File\x20system:\x20create_file,\x20read_file,\x20edit_file,\x20list_directory,\x20search_file,\x20find_files,\x20search_directory,\x20delete_file,\x20rename_file,\x20copy_file,\x20file_info,\x20read_file_lines\x0a-\x20Git:\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20Terminal:\x20run_command,\x20run_background,\x20read_terminal_output,\x20send_terminal_input,\x20list_active_processes,\x20terminate_process\x0a-\x20Network:\x20fetch_url,\x20download_file\x0a-\x20System:\x20get_env,\x20set_env,\x20get_system_info,\x20clipboard_read,\x20clipboard_write\x0a-\x20Project:\x20tree,\x20grep_recursive,\x20replace_in_files,\x20open_in_editor,\x20zip_files,\x20unzip_files,\x20write_json,\x20read_json,\x20patch_file,\x20powershell_run\x0a-\x20GitHub:\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20Browser:\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_snapshot,\x20browser_screenshot,\x20browser_get_text,\x20browser_close\x0a-\x20Human:\x20ask_human\x0a\x0aASK_HUMAN\x20TOOL:\x0aWhen\x20you\x20need\x20clarification,\x20a\x20decision,\x20or\x20any\x20input\x20from\x20the\x20user\x20during\x20a\x20task,\x20use\x20the\x20ask_human\x20tool.\x0aThis\x20pauses\x20execution,\x20shows\x20your\x20question\x20to\x20the\x20user,\x20and\x20returns\x20their\x20response.\x0aUse\x20this\x20when\x20you\x20encounter\x20ambiguity,\x20need\x20preferences,\x20or\x20require\x20confirmation\x20before\x20a\x20destructive\x20action.\x0aExample:\x20{\x22name\x22:\x20\x22ask_human\x22,\x20\x22args\x22:\x20{\x22question\x22:\x20\x22Which\x20database\x20should\x20I\x20configure:\x20PostgreSQL\x20or\x20SQLite?\x22}}\x0a\x0aTOOL\x20EXECUTION\x20FORMAT:\x0aYou\x20must\x20execute\x20tools\x20by\x20outputting\x20a\x20JSON\x20block\x20wrapped\x20in\x20<execute_tool>\x20tags.\x0aExample:\x0a<execute_tool>\x0a{\x22name\x22:\x20\x22tool_name\x22,\x20\x22args\x22:\x20{\x22arg_name\x22:\x20\x22arg_value\x22}}\x0a</execute_tool>\x0a';export async function startChat(_0x5c5d9a){const _0xde3d45=a4_0x1d4d,{startBrowserServer:_0x20ab05}=await import(_0xde3d45(0x2a3));_0x20ab05()[_0xde3d45(0x1ff)](()=>{});let _0x2a619b=a4_0x51ad1c[_0xde3d45(0x253)]();const _0x1217d1=getSelectedModel();await connectToMcpServers();const _0x616a2a=await getMcpTools(),_0x4e814f=new Set(_0x616a2a[_0xde3d45(0x1fa)](_0x444a9c=>_0x444a9c[_0xde3d45(0x215)]));_0x4e814f[_0xde3d45(0x24e)]>0x0&&a4_0x2743b1[_0xde3d45(0x1af)](_0x4e814f['size'],_0x616a2a[_0xde3d45(0x1fc)]);process['on'](_0xde3d45(0x1f6),()=>closeMcpClients());const _0x2cb21f=formatRulesForSystem(),_0x5630ac=getPlatformInfo(),_0x36839c=getShellPrefix(),_0x279574=_0x616a2a[_0xde3d45(0x1fc)]>0x0?_0xde3d45(0x264)+_0x616a2a[_0xde3d45(0x1fa)](_0x33ffb1=>{const _0x472822=_0xde3d45,_0x32a347=Object[_0x472822(0x1fd)](_0x33ffb1[_0x472822(0x292)]?.[_0x472822(0x250)]||{})[_0x472822(0x2c9)](',\x20');return'-\x20'+_0x33ffb1['name']+'('+_0x32a347+_0x472822(0x1d8)+_0x33ffb1[_0x472822(0x2ce)];})[_0xde3d45(0x2c9)]('\x0a'):'',_0xedb7bd=isWindows()?_0xde3d45(0x2ba)+_0x5630ac+_0xde3d45(0x1e0):_0xde3d45(0x2ba)+_0x5630ac+_0xde3d45(0x216)+_0x36839c+_0xde3d45(0x290),_0x3126aa=SYSTEM_PROMPT+_0x279574+_0xedb7bd+'\x0a'+_0x2cb21f,_0x4663f5=getUser(),_0x19e11f=[{'role':_0xde3d45(0x2a9),'content':_0x3126aa}];(_0x4663f5[_0xde3d45(0x2a8)]||_0x4663f5[_0xde3d45(0x2d0)])&&a4_0x2743b1['loggedInBox'](_0x4663f5[_0xde3d45(0x2a8)]||_0x4663f5[_0xde3d45(0x2d0)]||_0xde3d45(0x21d));a4_0x2743b1[_0xde3d45(0x24a)](process[_0xde3d45(0x1b6)]()),a4_0x2743b1['dim'](_0xde3d45(0x23b)),a4_0x2743b1[_0xde3d45(0x20f)](_0x1217d1,0x64);const _0x329509=async _0x589d50=>{const _0x419211=_0xde3d45;if(!_0x589d50||_0x589d50[_0x419211(0x21a)]()==='')return!![];const _0x4e3b19=_0x589d50[_0x419211(0x21a)]();if(_0x4e3b19==='/exit'||_0x4e3b19===_0x419211(0x2de))return a4_0x2743b1[_0x419211(0x1ec)](_0x419211(0x1ca)),![];if(_0x4e3b19===_0x419211(0x1cd))return _0x19e11f[_0x419211(0x1fc)]=0x1,_0x2a619b=a4_0x51ad1c['randomUUID'](),a4_0x2743b1[_0x419211(0x1ec)]('Conversation\x20cleared'),!![];if(_0x4e3b19===_0x419211(0x242)){const _0x16db75=getChatSessions();if(_0x16db75[_0x419211(0x1fc)]===0x0)return a4_0x2743b1[_0x419211(0x1ec)]('No\x20chat\x20history\x20found.'),!![];const _0x3c13ba=_0x16db75[_0x419211(0x1fa)](_0x35b4f6=>{const _0x4bb9c7=_0x419211,_0x21373b=new Date(_0x35b4f6['updatedAt'])['toLocaleString']();return{'name':_0x21373b+_0x4bb9c7(0x220)+_0x35b4f6[_0x4bb9c7(0x1c9)],'value':_0x35b4f6['id']};});_0x3c13ba[_0x419211(0x20e)]({'name':_0x419211(0x1a9),'value':'cancel'});const {getTheme:_0x5e814f}=await import(_0x419211(0x1c8)),{getInquirerTheme:_0x33861b}=await import(_0x419211(0x28a)),_0x3953a8=_0x5e814f(),_0x29044c=await select({'message':'Select\x20a\x20previous\x20chat\x20to\x20resume:','choices':_0x3c13ba,'theme':_0x33861b(_0x3953a8)});if(_0x29044c===_0x419211(0x29e))return!![];const _0x496bdc=getChatSession(_0x29044c);return _0x496bdc?(_0x2a619b=_0x496bdc['id'],_0x19e11f['length']=0x0,_0x19e11f[_0x419211(0x2cf)](..._0x496bdc[_0x419211(0x1d9)]),a4_0x2743b1[_0x419211(0x2e9)]('Resumed\x20chat:\x20'+_0x496bdc['title'])):a4_0x2743b1[_0x419211(0x1d1)](_0x419211(0x28e)),!![];}if(_0x4e3b19===_0x419211(0x275)){const _0x6b4365=await getMcpTools();return _0x6b4365[_0x419211(0x1fc)]===0x0?a4_0x2743b1[_0x419211(0x1ec)](_0x419211(0x234)):(a4_0x2743b1[_0x419211(0x1ec)](_0x419211(0x27c)),_0x6b4365[_0x419211(0x24f)](_0x3d634f=>a4_0x2743b1[_0x419211(0x29f)]('-\x20'+_0x3d634f['name']+'\x20('+_0x3d634f['serverName']+'):\x20'+(_0x3d634f[_0x419211(0x2ce)]?.['slice'](0x0,0x32)||'')))),a4_0x2743b1[_0x419211(0x29f)]('\x0aUse\x20\x27woozlit\x20mcp\x27\x20command\x20to\x20manage\x20servers.'),!![];}if(_0x4e3b19===_0x419211(0x21c))return a4_0x2743b1['header']('Commands'),a4_0x2743b1['dim']('\x20\x20/exit\x20\x20\x20\x20\x20\x20-\x20Exit\x20the\x20chat'),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x26c)),a4_0x2743b1['dim'](_0x419211(0x271)),a4_0x2743b1[_0x419211(0x29f)]('\x20\x20/model\x20\x20\x20\x20\x20-\x20Switch\x20AI\x20model'),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x2a5)),a4_0x2743b1[_0x419211(0x29f)]('\x20\x20/mcp\x20\x20\x20\x20\x20\x20\x20-\x20List\x20connected\x20tools'),a4_0x2743b1['dim'](_0x419211(0x1ea)),a4_0x2743b1['dim'](_0x419211(0x2be)),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x1d3)),a4_0x2743b1[_0x419211(0x29f)]('\x20\x20/help\x20\x20\x20\x20\x20\x20-\x20Show\x20this\x20help'),a4_0x2743b1[_0x419211(0x29f)]('\x20\x20/github\x20\x20\x20\x20-\x20GitHub\x20integration'),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x20c)),!![];if(_0x4e3b19===_0x419211(0x1c1)){const {isBrowserServerRunning:_0x3cb174,getConnectedSessions:_0x47c750}=await import('../browser/index.js');if(_0x3cb174()){const _0x4c962b=_0x47c750();a4_0x2743b1[_0x419211(0x2e9)](_0x419211(0x2c0)),a4_0x2743b1[_0x419211(0x1ec)]('Connected\x20browsers:\x20'+_0x4c962b[_0x419211(0x1fc)]),_0x4c962b[_0x419211(0x24f)](_0x47ea8b=>a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x28d)+_0x47ea8b[_0x419211(0x22e)]));}else a4_0x2743b1[_0x419211(0x29f)]('Browser\x20server\x20is\x20not\x20running'),a4_0x2743b1['dim'](_0x419211(0x2b7));return!![];}if(_0x4e3b19[_0x419211(0x232)](_0x419211(0x213))){const _0x9fef85=_0x4e3b19[_0x419211(0x258)]('\x20')[0x1]||'';return await a4_0x222262[_0x419211(0x1f8)](_0x9fef85),!![];}if(_0x4e3b19[_0x419211(0x232)](_0x419211(0x1b0))){const _0x321566=await import(_0x419211(0x23d)),_0x42861a=_0x4e3b19['split']('\x20')[0x1]||'';if(_0x42861a===_0x419211(0x22f)){const {input:_0x3ae763,password:_0x2c4e2e}=await import('@inquirer/prompts');a4_0x2743b1['header'](_0x419211(0x1e1)),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x24b)),a4_0x2743b1[_0x419211(0x29f)]('2.\x20Send\x20/newbot\x20and\x20follow\x20instructions'),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x1bd)),a4_0x2743b1[_0x419211(0x1ec)]('');const {getTheme:_0x2ca69b}=await import(_0x419211(0x1c8)),{getInquirerTheme:_0x37e3b4}=await import('../ui/themes.js'),_0x500dba=_0x2ca69b(),_0x4da753=_0x37e3b4(_0x500dba),_0x45e342=await _0x2c4e2e({'message':_0x419211(0x251),'mask':'*','theme':_0x4da753});_0x45e342&&(_0x321566[_0x419211(0x299)](_0x45e342),a4_0x2743b1[_0x419211(0x2e9)]('Bot\x20token\x20saved!'));const _0x492779=await _0x3ae763({'message':'Security\x20PIN\x20(optional,\x20press\x20Enter\x20to\x20skip):','theme':_0x4da753});return _0x492779&&(_0x321566[_0x419211(0x225)](_0x492779),a4_0x2743b1[_0x419211(0x2e9)](_0x419211(0x1cf))),a4_0x2743b1[_0x419211(0x1ec)](_0x419211(0x207)),!![];}if(_0x42861a===_0x419211(0x1b2))return await _0x321566[_0x419211(0x1a8)](),!![];if(_0x42861a==='stop')return _0x321566['stopBot'](),a4_0x2743b1[_0x419211(0x1ec)](_0x419211(0x228)),!![];if(_0x42861a==='status')return _0x321566['isBotRunning']()?a4_0x2743b1[_0x419211(0x2e9)](_0x419211(0x1f7)):a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x280)),a4_0x2743b1['dim']('Configured:\x20'+(_0x321566[_0x419211(0x2c2)]()?_0x419211(0x25b):'No')),!![];return a4_0x2743b1[_0x419211(0x259)](_0x419211(0x218)),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x2cc)),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x2d3)),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x2ca)),a4_0x2743b1[_0x419211(0x29f)](_0x419211(0x249)),!![];}if(_0x4e3b19==='/rollback'){const {rollbackLast:_0x2c9269,getChanges:_0x492318}=await import(_0x419211(0x200)),_0x233314=_0x492318();if(_0x233314['length']===0x0)a4_0x2743b1[_0x419211(0x1ec)]('No\x20changes\x20to\x20rollback');else{const _0x57ae46=_0x2c9269();_0x57ae46[_0x419211(0x2e9)]?a4_0x2743b1['success'](_0x57ae46[_0x419211(0x276)]):a4_0x2743b1[_0x419211(0x1d1)](_0x57ae46[_0x419211(0x276)]);}return!![];}if(_0x4e3b19===_0x419211(0x1c7)){const _0x4efc34=await selectModel();return _0x4efc34!==_0x1217d1?(a4_0x2743b1[_0x419211(0x1ec)](_0x419211(0x288)+_0x4efc34),a4_0x2743b1[_0x419211(0x1ec)]('Please\x20restart\x20the\x20chat\x20for\x20the\x20change\x20to\x20take\x20full\x20effect.')):a4_0x2743b1['info'](_0x419211(0x289)+_0x1217d1),!![];}if(_0x4e3b19===_0x419211(0x1be)||_0x4e3b19==='/themes'){const {selectTheme:_0x23b498}=await import(_0x419211(0x28a)),_0x3774ea=await _0x23b498();return a4_0x2743b1['info'](_0x419211(0x1d0)+_0x3774ea),!![];}if(_0x4e3b19===_0x419211(0x2a6)||_0x4e3b19===_0x419211(0x2bf)){const _0x419d8a=a4_0x2743b1['createSpinner'](_0x419211(0x246));_0x419d8a[_0x419211(0x1b2)]();const _0x464239=await getUserUsage();return _0x419d8a['stop'](),_0x464239?a4_0x2743b1[_0x419211(0x265)](_0x464239[_0x419211(0x2e2)],_0x464239[_0x419211(0x257)],_0x464239[_0x419211(0x2cd)]):a4_0x2743b1['error'](_0x419211(0x2b2)),!![];}return _0x19e11f['push']({'role':_0x419211(0x241),'content':_0x4e3b19}),await processAgentLoop(_0x19e11f,_0x1217d1),saveChatSession(_0x2a619b,_0x19e11f),!![];};if(_0x5c5d9a){const _0x24a3e5=await _0x329509(_0x5c5d9a);if(!_0x24a3e5)return;}while(!![]){try{const _0x33f234=await import(_0xde3d45(0x1c8))['then'](_0x120d48=>_0x120d48[_0xde3d45(0x287)]()),_0x54ba14=await import(_0xde3d45(0x28a))['then'](_0x12bbad=>_0x12bbad[_0xde3d45(0x2e4)](_0x33f234)),{getInquirerTheme:_0x5e854c}=await import(_0xde3d45(0x28a)),_0x1633c5=a4_0x2c8411[_0xde3d45(0x274)]['hex'](_0x54ba14[_0xde3d45(0x2a1)])(_0xde3d45(0x1c2)),_0x29e25e=_0x5e854c(_0x33f234),_0x9fca5d=await input({'message':_0x1633c5,'theme':{..._0x29e25e,'prefix':''}}),_0x22ecfd=await _0x329509(_0x9fca5d);if(!_0x22ecfd)break;}catch(_0x53aee1){if(_0x53aee1 instanceof Error&&_0x53aee1[_0xde3d45(0x276)][_0xde3d45(0x1c4)]('force\x20closed'))break;a4_0x2743b1[_0xde3d45(0x1d1)](_0xde3d45(0x2b3)+_0x53aee1);}}}function cleanTagsFromLine(_0x46cda1){const _0x5a5a=a4_0x1d4d,_0x43354e=_0x46cda1[_0x5a5a(0x21a)]();if(!_0x43354e)return'';if(_0x43354e[_0x5a5a(0x232)]('**'))return'';if(_0x43354e[_0x5a5a(0x232)](_0x5a5a(0x2c4)))return'';if(_0x43354e[_0x5a5a(0x232)]('---'))return'';if(_0x43354e[_0x5a5a(0x232)]('```'))return'';if(_0x43354e[_0x5a5a(0x1c4)]('\x22name\x22:')&&_0x43354e[_0x5a5a(0x1c4)](_0x5a5a(0x2e1)))return'';if(_0x43354e[_0x5a5a(0x232)](_0x5a5a(0x21b)))return'';if(_0x43354e[_0x5a5a(0x232)](_0x5a5a(0x1c5)))return'';if(_0x43354e[_0x5a5a(0x232)](_0x5a5a(0x256)))return'';if(_0x43354e[_0x5a5a(0x232)](_0x5a5a(0x1e2)))return'';if(_0x43354e[_0x5a5a(0x232)](_0x5a5a(0x28b)))return'';if(_0x43354e[_0x5a5a(0x232)](_0x5a5a(0x294)))return'';if(_0x43354e[_0x5a5a(0x1c4)](_0x5a5a(0x2b4)))return'';if(_0x43354e['includes'](_0x5a5a(0x205)))return'';return _0x46cda1['replace'](/<text>/g,'')['replace'](/<\/text>/g,'')['replace'](/<\/text>/g,'')['replace'](/<reasoning>/g,'')[_0x5a5a(0x27b)](/<\/reasoning>/g,'')[_0x5a5a(0x27b)](/\*\*(.+?)\*\*/g,'$1');}async function processAgentLoop(_0x2cf203,_0x41582a){const _0x2b5108=a4_0x1d4d;let _0x45686e=0x0;const _0xed341c=0x3e8,_0x15c6b4=![];while(_0x45686e<_0xed341c){_0x45686e++;const _0x352965=a4_0x2743b1[_0x2b5108(0x230)](_0x2b5108(0x1d4));_0x352965[_0x2b5108(0x1b2)]();let _0x53e49a='',_0x26be1f=![],_0x349acc=![],_0x2b6cc4='';const _0x4b97cd=new AbortController(),_0x5e7cee=()=>{const _0x51d783=_0x2b5108;_0x4b97cd[_0x51d783(0x293)](),a4_0x2743b1['info']('\x0aAborting...');};process['on'](_0x2b5108(0x267),_0x5e7cee);let _0x10f11b=null;try{const _0x2dc717=await sendChatMessage(_0x41582a,_0x2cf203,_0x3de536=>{const _0x4d0a4c=_0x2b5108;_0x352965[_0x4d0a4c(0x26a)]&&_0x352965[_0x4d0a4c(0x23f)]();_0x53e49a+=_0x3de536;for(const _0x56cc77 of _0x3de536){_0x2b6cc4+=_0x56cc77;if(_0x56cc77==='\x0a'){_0x2b6cc4['includes'](_0x4d0a4c(0x1b7))&&(_0x349acc=!![]);_0x2b6cc4[_0x4d0a4c(0x1c4)](_0x4d0a4c(0x231))&&(_0x349acc=!![]);let _0x392540=!![];if(_0x349acc&&_0x15c6b4){_0x2b6cc4[_0x4d0a4c(0x1c4)](_0x4d0a4c(0x224))&&(_0x349acc=![]);_0x2b6cc4[_0x4d0a4c(0x1c4)]('</thought>')&&(_0x349acc=![]);if(!_0x26be1f){if(_0x2b6cc4['includes'](_0x4d0a4c(0x2a7))||_0x2b6cc4[_0x4d0a4c(0x232)](_0x4d0a4c(0x25d))){_0x26be1f=!![],_0x2b6cc4='';!_0x10f11b&&(_0x10f11b=a4_0x2743b1[_0x4d0a4c(0x1dd)](_0x4d0a4c(0x1b4)),_0x10f11b[_0x4d0a4c(0x1b2)]());continue;}let _0x4e5851=_0x2b6cc4[_0x4d0a4c(0x27b)](/<text>/g,'')[_0x4d0a4c(0x27b)](/<\/text>/g,'')['replace'](/<reasoning.*?>/g,'')[_0x4d0a4c(0x27b)](/<\/reasoning>/g,'');if(_0x392540){if(_0x349acc||_0x4e5851[_0x4d0a4c(0x1c4)](_0x4d0a4c(0x1b7))||_0x4e5851[_0x4d0a4c(0x1c4)](_0x4d0a4c(0x231)))process[_0x4d0a4c(0x2bc)]['write'](a4_0x2c8411[_0x4d0a4c(0x29f)]('│\x20'+_0x4e5851));else{if(_0x4e5851[_0x4d0a4c(0x232)](_0x4d0a4c(0x285))&&!_0x4e5851[_0x4d0a4c(0x232)]('```tool'))process[_0x4d0a4c(0x2bc)]['write'](_0x4d0a4c(0x285)+_0x4e5851[_0x4d0a4c(0x22c)](0x3));else(_0x4e5851[_0x4d0a4c(0x21a)]()||_0x4e5851==='\x0a'||_0x4e5851==='\x0d\x0a')&&process[_0x4d0a4c(0x2bc)][_0x4d0a4c(0x22a)](_0x4e5851);}}}else(_0x2b6cc4[_0x4d0a4c(0x1c4)](_0x4d0a4c(0x20b))||_0x2b6cc4[_0x4d0a4c(0x21a)]()===_0x4d0a4c(0x285))&&(_0x26be1f=![],_0x10f11b&&(_0x10f11b[_0x4d0a4c(0x23f)](),_0x10f11b=null));_0x2b6cc4='';}}}},_0x4b97cd[_0x2b5108(0x2a4)]);_0x10f11b&&(_0x10f11b['stop'](),_0x10f11b=null);if(_0x2b6cc4&&!_0x26be1f&&!_0x2b6cc4[_0x2b5108(0x1c4)](_0x2b5108(0x2a7))){let _0x2c87b6=_0x2b6cc4[_0x2b5108(0x27b)](/<text>/g,'')['replace'](/<\/text>/g,'')['replace'](/<reasoning.*?>/g,'')[_0x2b5108(0x27b)](/<\/reasoning>/g,''),_0x3383fa=!![];_0x2c87b6[_0x2b5108(0x1c4)](_0x2b5108(0x224))&&(_0x349acc=![]),_0x2c87b6['includes']('</thought>')&&(_0x349acc=![]),_0x3383fa&&_0x2c87b6[_0x2b5108(0x21a)]()&&(_0x349acc||_0x2c87b6[_0x2b5108(0x1c4)](_0x2b5108(0x1b7))||_0x2c87b6['includes'](_0x2b5108(0x231))?process[_0x2b5108(0x2bc)]['write'](a4_0x2c8411[_0x2b5108(0x29f)]('│\x20'+_0x2c87b6)):process[_0x2b5108(0x2bc)]['write'](_0x2c87b6));}_0x53e49a=_0x2dc717[_0x2b5108(0x1b9)];}catch(_0x419420){_0x352965[_0x2b5108(0x23f)](),process['removeListener'](_0x2b5108(0x267),_0x5e7cee);if(_0x419420[_0x2b5108(0x25a)]===_0x2b5108(0x297)||_0x419420[_0x2b5108(0x276)][_0x2b5108(0x1c4)](_0x2b5108(0x226))){a4_0x2743b1[_0x2b5108(0x201)](_0x2b5108(0x2d5)),_0x2cf203[_0x2b5108(0x2cf)]({'role':_0x2b5108(0x2d1),'content':_0x53e49a+'\x20[Aborted]'}),_0x2cf203[_0x2b5108(0x2cf)]({'role':_0x2b5108(0x241),'content':_0x2b5108(0x283)});break;}if(_0x419420[_0x2b5108(0x1d5)]){a4_0x2743b1[_0x2b5108(0x263)](_0x419420[_0x2b5108(0x2d6)]||0x3c);return;}a4_0x2743b1['error'](_0x2b5108(0x204)+_0x419420);return;}finally{process['removeListener'](_0x2b5108(0x267),_0x5e7cee);}_0x352965['isSpinning']&&_0x352965['stop']();a4_0x2743b1[_0x2b5108(0x2a2)](),_0x2cf203[_0x2b5108(0x2cf)]({'role':_0x2b5108(0x2d1),'content':_0x53e49a});let _0x47671=_0x53e49a[_0x2b5108(0x1f5)](/<execute_tool>\s*([\s\S]*?)<\/execute_tool>/);!_0x47671&&(_0x47671=_0x53e49a[_0x2b5108(0x1f5)](/```tool\s*([\s\S]*?)```/));!_0x47671&&(_0x47671=_0x53e49a[_0x2b5108(0x1f5)](/```json\s*(\{[\s\S]*?"name"\s*:[\s\S]*?\})\s*```/));if(!_0x47671){const _0x52e3da=_0x53e49a['match'](/\{[\s\S]*?"name"\s*:[\s\S]*?"args"\s*:[\s\S]*?\}/);if(_0x52e3da)_0x47671=[_0x52e3da[0x0],_0x52e3da[0x0]];}if(!_0x47671)break;function _0x5f3a8d(_0x556a0b){const _0x4c9ca3=_0x2b5108,_0x151c7b=_0x556a0b[_0x4c9ca3(0x21a)]();try{return JSON[_0x4c9ca3(0x248)](_0x151c7b);}catch(_0x1c30f2){try{let _0x537750='',_0x358991=![];for(let _0x10f13e=0x0;_0x10f13e<_0x151c7b['length'];_0x10f13e++){const _0x338907=_0x151c7b[_0x10f13e];if(_0x338907==='\x22'&&_0x151c7b[_0x10f13e-0x1]!=='\x5c')_0x358991=!_0x358991;if(_0x358991&&_0x338907==='\x0a')_0x537750+='\x5cn';else _0x537750+=_0x338907;}return JSON['parse'](_0x537750);}catch(_0x20be0c){try{return new Function('return\x20'+_0x151c7b)();}catch(_0x8183d3){throw new Error('Invalid\x20JSON\x20output\x20from\x20model:\x20'+_0x1c30f2['message']);}}}}try{const _0x3a99fa=_0x5f3a8d(_0x47671[0x1]),_0x1e2e6c={'write_file':_0x2b5108(0x227),'write':_0x2b5108(0x227),'create':_0x2b5108(0x227),'read':'read_file','read_text_file':_0x2b5108(0x1dc),'search':_0x2b5108(0x1ed),'list':'list_directory','ls':'list_directory','execute':'run_command','cmd':'run_command','remove_file':_0x2b5108(0x1d2),'rm':_0x2b5108(0x1d2),'unlink':'delete_file','move_file':_0x2b5108(0x2a0),'mv':_0x2b5108(0x2a0),'cp':_0x2b5108(0x2df),'stat':'file_info','head':_0x2b5108(0x2dd),'wget':_0x2b5108(0x296),'curl':_0x2b5108(0x2e7),'http_get':'fetch_url','env':_0x2b5108(0x1de),'sysinfo':_0x2b5108(0x1ab),'paste':_0x2b5108(0x1e7),'ask':_0x2b5108(0x262),'prompt_user':_0x2b5108(0x262),'request_input':'ask_human','dir_tree':_0x2b5108(0x254),'show_tree':'tree','grep':_0x2b5108(0x286),'find_in_files':_0x2b5108(0x286),'search_all':_0x2b5108(0x286),'find_replace':_0x2b5108(0x2d9),'sed':'replace_in_files','open':_0x2b5108(0x266),'vscode':_0x2b5108(0x266),'compress':_0x2b5108(0x1ee),'archive':_0x2b5108(0x1ee),'extract':'unzip_files','decompress':_0x2b5108(0x1c6),'ps':_0x2b5108(0x278),'pwsh':_0x2b5108(0x278)};_0x1e2e6c[_0x3a99fa[_0x2b5108(0x25a)]]&&(_0x3a99fa[_0x2b5108(0x25a)]=_0x1e2e6c[_0x3a99fa[_0x2b5108(0x25a)]]);_0x3a99fa[_0x2b5108(0x2db)]&&(!_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x22b)]&&(_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x22b)]=_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x1b1)]||_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x27a)]||_0x3a99fa[_0x2b5108(0x2db)]['file']||_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x203)]),!_0x3a99fa['args'][_0x2b5108(0x1b9)]&&(_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x1b9)]=_0x3a99fa['args'][_0x2b5108(0x235)]||_0x3a99fa['args'][_0x2b5108(0x2b1)]||_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x252)]||_0x3a99fa[_0x2b5108(0x2db)]['source']),!_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x2ad)]&&(_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x2ad)]=_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x2c8)]||_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x245)]));const _0x3e295d={'create_file':_0x2b5108(0x1fb),'read_file':_0x2b5108(0x239),'edit_file':'Update','list_directory':'List','search_file':'Search','find_files':'Find','search_directory':_0x2b5108(0x2ab),'delete_file':_0x2b5108(0x29a),'rename_file':_0x2b5108(0x208),'copy_file':_0x2b5108(0x22d),'file_info':_0x2b5108(0x2af),'read_file_lines':_0x2b5108(0x209),'run_command':_0x2b5108(0x2d4),'run_background':_0x2b5108(0x211),'read_terminal_output':'ReadTerm','send_terminal_input':_0x2b5108(0x26f),'list_active_processes':'ListProcs','terminate_process':_0x2b5108(0x1f0),'git_status':_0x2b5108(0x281),'git_diff':_0x2b5108(0x291),'git_log':_0x2b5108(0x1e4),'git_add':_0x2b5108(0x1a7),'git_commit':_0x2b5108(0x277),'git_branch':_0x2b5108(0x21f),'fetch_url':_0x2b5108(0x1ad),'download_file':_0x2b5108(0x2e3),'get_env':_0x2b5108(0x1db),'set_env':'SetEnv','get_system_info':'SysInfo','clipboard_read':_0x2b5108(0x1bc),'clipboard_write':_0x2b5108(0x1eb),'ask_human':_0x2b5108(0x269),'tree':'Tree','grep_recursive':_0x2b5108(0x29d),'replace_in_files':_0x2b5108(0x24c),'open_in_editor':_0x2b5108(0x29b),'zip_files':_0x2b5108(0x24d),'unzip_files':_0x2b5108(0x1aa),'write_json':_0x2b5108(0x1ef),'read_json':_0x2b5108(0x23e),'patch_file':_0x2b5108(0x2bd),'powershell_run':'PS','browser_open':_0x2b5108(0x25f),'browser_click':_0x2b5108(0x25e),'browser_fill':_0x2b5108(0x270),'browser_snapshot':_0x2b5108(0x284),'browser_screenshot':_0x2b5108(0x2d7),'browser_get_text':_0x2b5108(0x1bf),'browser_close':_0x2b5108(0x1ac)},_0x4246d7=_0x3e295d[_0x3a99fa[_0x2b5108(0x25a)]]||_0x3a99fa[_0x2b5108(0x25a)];let _0x161ef8='';if(_0x3a99fa['name']===_0x2b5108(0x272)&&_0x3a99fa['args']['command'])_0x161ef8=_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x2ad)];else{if(_0x3a99fa[_0x2b5108(0x25a)]===_0x2b5108(0x2ae))_0x161ef8=_0x2b5108(0x279)+(_0x3a99fa['args'][_0x2b5108(0x20d)]||_0x2b5108(0x1f3));else{if(_0x3a99fa[_0x2b5108(0x25a)]==='read_terminal_output'||_0x3a99fa[_0x2b5108(0x25a)]==='terminate_process')_0x161ef8=_0x2b5108(0x279)+(_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x20d)]||_0x2b5108(0x1f3));else{if(_0x3a99fa[_0x2b5108(0x25a)]===_0x2b5108(0x2cb))_0x161ef8=_0x2b5108(0x295);else{if(_0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x22b)])_0x161ef8=_0x3a99fa[_0x2b5108(0x2db)]['path'];else{if(_0x3a99fa[_0x2b5108(0x2db)]['pattern'])_0x161ef8='\x22'+_0x3a99fa[_0x2b5108(0x2db)]['pattern']+'\x22';else _0x3a99fa[_0x2b5108(0x2db)][_0x2b5108(0x2da)]?_0x161ef8=_0x3a99fa['args'][_0x2b5108(0x2da)]:_0x161ef8=Object['values'](_0x3a99fa[_0x2b5108(0x2db)])[0x0]||'';}}}}}const _0x977bc0=_0x161ef8[_0x2b5108(0x1fc)]>0x32?_0x161ef8[_0x2b5108(0x22c)](0x0,0x2f)+_0x2b5108(0x1b5):_0x161ef8,_0x458ca3=a4_0x2743b1[_0x2b5108(0x1dd)](_0x4246d7+'('+_0x977bc0+')');_0x458ca3[_0x2b5108(0x1b2)]();const _0x501771=performance[_0x2b5108(0x214)]();let _0x367ab9;try{_0x367ab9=await executeToolCall(_0x3a99fa['name'],_0x3a99fa['args']);}catch(_0x40b3ff){if(_0x40b3ff['message']&&_0x40b3ff[_0x2b5108(0x276)]['includes'](_0x2b5108(0x1f1))){const _0x94bc55=await getMcpTools(),_0x114428=_0x94bc55[_0x2b5108(0x229)](_0x589621=>_0x589621[_0x2b5108(0x25a)]===_0x3a99fa[_0x2b5108(0x25a)]);if(_0x114428)try{_0x367ab9=await executeMcpTool(_0x114428['serverName'],_0x114428[_0x2b5108(0x25a)],_0x3a99fa[_0x2b5108(0x2db)]);}catch(_0x603f00){throw new Error('MCP\x20Tool\x20error:\x20'+_0x603f00);}else throw _0x40b3ff;}else throw _0x40b3ff;}const _0x3d7fa7=((performance['now']()-_0x501771)/0x3e8)[_0x2b5108(0x2c5)](0x1);_0x458ca3['stop']();let _0x329628=_0x2b5108(0x1d6)+_0x3d7fa7+'s',_0x2bd2d3=![];const _0x3042ec=_0x367ab9;if(_0x3042ec&&typeof _0x3042ec===_0x2b5108(0x26b)){if(_0x3a99fa[_0x2b5108(0x25a)]==='run_command'){if(_0x3042ec['exitCode']===0x0&&_0x3042ec[_0x2b5108(0x2e9)]!==![]){const _0x4f8152=_0x3042ec[_0x2b5108(0x2bc)]?_0x3042ec[_0x2b5108(0x2bc)]['split']('\x0a')[_0x2b5108(0x1fc)]:0x0;_0x329628=_0x2b5108(0x2e0)+_0x4f8152+'\x20lines\x20of\x20output\x20('+_0x3d7fa7+'s)';}else{_0x2bd2d3=!![],_0x329628=_0x2b5108(0x1b3)+_0x3042ec['exitCode'];const _0x3bce41=_0x3042ec[_0x2b5108(0x1cc)]||_0x3042ec[_0x2b5108(0x2bc)]||_0x3042ec[_0x2b5108(0x276)]||'Operation\x20failed';_0x3bce41&&(_0x329628+=':\x20'+_0x3bce41[_0x2b5108(0x258)]('\x0a')[0x0][_0x2b5108(0x1bb)](0x0,0x64));}}else{if(_0x3042ec['success']===![])_0x2bd2d3=!![],_0x329628=_0x2b5108(0x23c)+(_0x3042ec['message']||_0x3042ec['error']||_0x2b5108(0x260));else{if(_0x3042ec[_0x2b5108(0x1d1)])_0x2bd2d3=!![],_0x329628=_0x2b5108(0x23c)+_0x3042ec[_0x2b5108(0x1d1)];else{if(_0x3a99fa['name']===_0x2b5108(0x1dc)&&typeof _0x3042ec[_0x2b5108(0x1b9)]===_0x2b5108(0x1e8)){const _0x4e2d91=_0x3042ec[_0x2b5108(0x1b9)][_0x2b5108(0x258)]('\x0a')[_0x2b5108(0x1fc)];_0x329628=_0x2b5108(0x1e9)+_0x4e2d91+_0x2b5108(0x2c1)+_0x3d7fa7+'s)';}else(_0x3a99fa[_0x2b5108(0x25a)]===_0x2b5108(0x2d2)||_0x3a99fa[_0x2b5108(0x25a)]==='create_file')&&(_0x329628=_0x2b5108(0x1e6)+_0x3d7fa7+'s)');}}}}a4_0x2743b1[_0x2b5108(0x273)](_0x4246d7,_0x977bc0,_0x329628,_0x2bd2d3);let _0x228799=_0x367ab9;_0x3a99fa[_0x2b5108(0x25a)]===_0x2b5108(0x272)&&_0x3042ec&&(_0x228799={'exitCode':_0x3042ec['exitCode'],'stdout':_0x3042ec['stdout'],'stderr':_0x3042ec['stderr'],'error':_0x3042ec[_0x2b5108(0x1d1)]}),_0x2cf203[_0x2b5108(0x2cf)]({'role':'user','content':_0x2b5108(0x2b9)+_0x3a99fa[_0x2b5108(0x25a)]+':\x0a'+JSON['stringify'](_0x228799,null,0x2)}),await new Promise(_0xd83dd5=>setTimeout(_0xd83dd5,0x1f4));}catch(_0x5d164f){a4_0x2743b1['toolSuccess'](_0x2b5108(0x21e),'tool\x20execution\x20failed',_0x5d164f[_0x2b5108(0x276)]||String(_0x5d164f),!![]),_0x2cf203['push']({'role':_0x2b5108(0x241),'content':'Tool\x20error\x20occurred:\x20'+_0x5d164f+_0x2b5108(0x1f2)});}}_0x45686e>=_0xed341c&&a4_0x2743b1[_0x2b5108(0x201)](_0x2b5108(0x2b6));}async function executeToolCall(_0x376805,_0x14599e){const _0x185ad3=a4_0x1d4d;switch(_0x376805){case _0x185ad3(0x227):return createFile(_0x14599e[_0x185ad3(0x22b)],_0x14599e['content']);case _0x185ad3(0x1dc):return readFile(_0x14599e[_0x185ad3(0x22b)]);case'list_directory':return listDirectory(_0x14599e[_0x185ad3(0x22b)]||'.');case'edit_file':return editFile(_0x14599e[_0x185ad3(0x22b)],_0x14599e[_0x185ad3(0x212)],_0x14599e[_0x185ad3(0x27b)]);case _0x185ad3(0x1ed):return searchFile(_0x14599e[_0x185ad3(0x22b)],_0x14599e[_0x185ad3(0x217)]);case'run_command':const {command:_0x1bf303,background:_0x3c122a,wait:_0x576e22}=_0x14599e,_0xb9b4d2=await runCommand(_0x1bf303,undefined,_0x3c122a,_0x576e22);return _0xb9b4d2;case'read_terminal_output':{const {readTerminalOutput:_0x23f809}=await import(_0x185ad3(0x23a));return _0x23f809(_0x14599e[_0x185ad3(0x20d)]);}case'send_terminal_input':{const {sendTerminalInput:_0x328a6f}=await import('../tools/command.js');return _0x328a6f(_0x14599e[_0x185ad3(0x243)],_0x14599e['pid']);}case'list_active_processes':{const {getActiveProcesses:_0x1783f4}=await import('../tools/command.js');return{'pids':_0x1783f4(),'message':'Active\x20processes:\x20'+_0x1783f4()['length']};}case _0x185ad3(0x222):{const {terminateProcess:_0x5d81f9}=await import(_0x185ad3(0x23a));return _0x5d81f9(_0x14599e[_0x185ad3(0x20d)]);}case _0x185ad3(0x206):{const {findFiles:_0x55c486}=await import(_0x185ad3(0x1b8));return _0x55c486(_0x14599e[_0x185ad3(0x22b)]||'.',_0x14599e[_0x185ad3(0x217)]);}case _0x185ad3(0x237):{const {searchDirectory:_0x5d9654}=await import('../tools/file.js');return _0x5d9654(_0x14599e[_0x185ad3(0x22b)]||'.',_0x14599e[_0x185ad3(0x217)]);}case _0x185ad3(0x223):{const {readFile:_0x4a2e05}=await import(_0x185ad3(0x2c6));return _0x4a2e05(_0x14599e['owner'],_0x14599e[_0x185ad3(0x29c)],_0x14599e[_0x185ad3(0x22b)],_0x14599e[_0x185ad3(0x2bb)]);}case'github_create_pr':{const {createPullRequest:_0x30ac0d}=await import(_0x185ad3(0x2c6));return _0x30ac0d(_0x14599e[_0x185ad3(0x2ac)],_0x14599e[_0x185ad3(0x29c)],_0x14599e[_0x185ad3(0x1c9)],_0x14599e['head'],_0x14599e[_0x185ad3(0x1c3)],_0x14599e['body']);}case'github_create_branch':{const {createBranch:_0x4b8d1d}=await import(_0x185ad3(0x2c6));return _0x4b8d1d(_0x14599e['owner'],_0x14599e[_0x185ad3(0x29c)],_0x14599e['branchName'],_0x14599e[_0x185ad3(0x28c)]);}case _0x185ad3(0x1cb):{const {browserOpen:_0x3645b3,startBrowserServer:_0x39d973,isBrowserServerRunning:_0x54075b}=await import(_0x185ad3(0x2a3));return!_0x54075b()&&await _0x39d973(),_0x3645b3(_0x14599e[_0x185ad3(0x2da)]);}case'browser_click':{const {browserClick:_0x294bf6}=await import(_0x185ad3(0x2a3));return _0x294bf6(_0x14599e[_0x185ad3(0x1da)]);}case'browser_fill':{const {browserFill:_0x3f89e8}=await import(_0x185ad3(0x2a3));return _0x3f89e8(_0x14599e[_0x185ad3(0x1da)],_0x14599e[_0x185ad3(0x219)]);}case _0x185ad3(0x261):{const {browserSnapshot:_0x4baf28}=await import('../browser/index.js');return _0x4baf28();}case _0x185ad3(0x2e5):{const {browserScreenshot:_0x40c4e4}=await import(_0x185ad3(0x2a3));return _0x40c4e4();}case _0x185ad3(0x27d):{const {browserGetText:_0x4b3de3}=await import(_0x185ad3(0x2a3));return _0x4b3de3(_0x14599e[_0x185ad3(0x1da)]);}case _0x185ad3(0x28f):{const {browserClose:_0x39a6ec}=await import(_0x185ad3(0x2a3));return _0x39a6ec();}case _0x185ad3(0x1d2):return deleteFile(_0x14599e[_0x185ad3(0x22b)]);case _0x185ad3(0x2a0):return renameFile(_0x14599e['from']||_0x14599e[_0x185ad3(0x22b)],_0x14599e['to']||_0x14599e[_0x185ad3(0x1d7)]);case _0x185ad3(0x2df):return copyFile(_0x14599e[_0x185ad3(0x1a6)]||_0x14599e[_0x185ad3(0x22b)],_0x14599e['to']||_0x14599e['destination']);case _0x185ad3(0x233):return fileInfo(_0x14599e[_0x185ad3(0x22b)]);case _0x185ad3(0x2dd):return readFileLines(_0x14599e[_0x185ad3(0x22b)],_0x14599e[_0x185ad3(0x1b2)]||0x1,_0x14599e[_0x185ad3(0x240)]||0x32);case _0x185ad3(0x2b0):{const _0x30fe9b=await runCommand(_0x14599e[_0x185ad3(0x2ad)],undefined,!![],_0x14599e[_0x185ad3(0x1fe)]||0x1388);return _0x30fe9b;}case _0x185ad3(0x2e6):return gitStatus();case _0x185ad3(0x2b8):return gitDiff(_0x14599e[_0x185ad3(0x22b)]);case _0x185ad3(0x1e5):return gitLog(_0x14599e[_0x185ad3(0x244)]||0xa);case _0x185ad3(0x20a):return gitAdd(_0x14599e['path']||'.');case _0x185ad3(0x2dc):return gitCommit(_0x14599e[_0x185ad3(0x276)]);case'git_branch':return gitBranch();case _0x185ad3(0x2e7):return fetchUrl(_0x14599e[_0x185ad3(0x2da)]);case'download_file':return downloadFile(_0x14599e['url'],_0x14599e[_0x185ad3(0x22b)]);case'get_env':return getEnv(_0x14599e[_0x185ad3(0x25a)]);case _0x185ad3(0x210):return setEnv(_0x14599e[_0x185ad3(0x25a)],_0x14599e[_0x185ad3(0x219)]);case _0x185ad3(0x1ab):return getSystemInfo();case _0x185ad3(0x1e7):return clipboardRead();case'clipboard_write':return clipboardWrite(_0x14599e[_0x185ad3(0x235)]||_0x14599e['content']);case _0x185ad3(0x262):{const _0x2a5b79=_0x14599e[_0x185ad3(0x282)]||_0x14599e[_0x185ad3(0x276)]||_0x185ad3(0x2e8);a4_0x2743b1[_0x185ad3(0x2a2)]();const _0x2e0011=await input({'message':a4_0x2c8411[_0x185ad3(0x27e)]('#3b82f6')(_0x185ad3(0x202))+_0x2a5b79+'\x0a','theme':{'prefix':''}});return{'success':!![],'response':_0x2e0011,'message':_0x185ad3(0x26e)+_0x2e0011};}case _0x185ad3(0x254):return tree(_0x14599e['path']||'.',_0x14599e[_0x185ad3(0x1ce)]||0x3);case _0x185ad3(0x286):return grepRecursive(_0x14599e['path']||'.',_0x14599e[_0x185ad3(0x217)],_0x14599e[_0x185ad3(0x268)]);case _0x185ad3(0x2d9):return replaceInFiles(_0x14599e[_0x185ad3(0x22b)]||'.',_0x14599e[_0x185ad3(0x212)],_0x14599e[_0x185ad3(0x27b)],_0x14599e[_0x185ad3(0x268)]);case _0x185ad3(0x266):return openInEditor(_0x14599e[_0x185ad3(0x22b)]);case _0x185ad3(0x1ee):return zipFiles(_0x14599e[_0x185ad3(0x236)]||[_0x14599e['path']],_0x14599e[_0x185ad3(0x255)]||_0x185ad3(0x1ae));case _0x185ad3(0x1c6):return unzipFiles(_0x14599e[_0x185ad3(0x22b)]||_0x14599e[_0x185ad3(0x298)],_0x14599e['output']||'.');case _0x185ad3(0x2d8):return writeJson(_0x14599e[_0x185ad3(0x22b)],_0x14599e[_0x185ad3(0x252)]||_0x14599e['content']);case _0x185ad3(0x1c0):return readJson(_0x14599e[_0x185ad3(0x22b)]);case _0x185ad3(0x1ba):return patchFile(_0x14599e[_0x185ad3(0x22b)],_0x14599e['patches']);case _0x185ad3(0x278):return powershellRun(_0x14599e[_0x185ad3(0x245)]||_0x14599e[_0x185ad3(0x2ad)]);default:return{'error':_0x185ad3(0x2aa)+_0x376805};}}
@@ -1 +1 @@
1
- const a5_0x316a78=a5_0x5e06;(function(_0x2fc295,_0x539684){const _0x3ae236=a5_0x5e06,_0x5cc33c=_0x2fc295();while(!![]){try{const _0x262c3a=parseInt(_0x3ae236(0x1cf))/0x1+parseInt(_0x3ae236(0x1d7))/0x2+parseInt(_0x3ae236(0x1d3))/0x3*(parseInt(_0x3ae236(0x1db))/0x4)+-parseInt(_0x3ae236(0x1d1))/0x5+parseInt(_0x3ae236(0x1c4))/0x6+-parseInt(_0x3ae236(0x1c0))/0x7+parseInt(_0x3ae236(0x1c5))/0x8;if(_0x262c3a===_0x539684)break;else _0x5cc33c['push'](_0x5cc33c['shift']());}catch(_0x4a3463){_0x5cc33c['push'](_0x5cc33c['shift']());}}}(a5_0x44a1,0x22549));import a5_0x257dca from'conf';import a5_0x338127 from'path';import a5_0x2cb259 from'fs';import{fileURLToPath}from'url';const config=new a5_0x257dca({'projectName':a5_0x316a78(0x1c3),'defaults':{'mcpServers':{}}});export function getMcpServers(){const _0x2ed68a=a5_0x316a78,_0x7e367a=config[_0x2ed68a(0x1c2)](_0x2ed68a(0x1b7)),_0xa8c6e5=loadMcpConfigFile();return{..._0x7e367a,..._0xa8c6e5};}export function addMcpServer(_0x3c19ca,_0x1575e2,_0x5f48f8=[],_0x387149){const _0x2df92d=a5_0x316a78,_0x6d1ef9=config[_0x2df92d(0x1c2)](_0x2df92d(0x1b7));_0x6d1ef9[_0x3c19ca]={'type':'stdio','command':_0x1575e2,'args':_0x5f48f8,'env':_0x387149},config[_0x2df92d(0x1bb)](_0x2df92d(0x1b7),_0x6d1ef9);}export function addMcpHttpServer(_0x192d24,_0x3c0789){const _0x5e2a12=a5_0x316a78,_0x48dbc9=config[_0x5e2a12(0x1c2)]('mcpServers');_0x48dbc9[_0x192d24]={'type':_0x5e2a12(0x1bc),'url':_0x3c0789},config['set'](_0x5e2a12(0x1b7),_0x48dbc9);}export function removeMcpServer(_0x2a7ef4){const _0x73b8c=a5_0x316a78,_0xc4beb3=config[_0x73b8c(0x1c2)](_0x73b8c(0x1b7));if(_0xc4beb3[_0x2a7ef4])return delete _0xc4beb3[_0x2a7ef4],config['set'](_0x73b8c(0x1b7),_0xc4beb3),!![];return![];}export function clearMcpServers(){const _0x15e096=a5_0x316a78;config[_0x15e096(0x1bb)]('mcpServers',{});}export function getMcpServer(_0x32152a){return getMcpServers()[_0x32152a];}function loadMcpConfigFile(){const _0x489e7c=a5_0x316a78,_0x3a0cee=[a5_0x338127[_0x489e7c(0x1c1)](process[_0x489e7c(0x1d6)](),_0x489e7c(0x1ce)),a5_0x338127[_0x489e7c(0x1c1)](process[_0x489e7c(0x1d6)](),_0x489e7c(0x1bf),'mcp.json'),a5_0x338127[_0x489e7c(0x1c1)](process[_0x489e7c(0x1d5)][_0x489e7c(0x1b2)]||process[_0x489e7c(0x1d5)][_0x489e7c(0x1b1)]||'',_0x489e7c(0x1bf),_0x489e7c(0x1ce))];for(const _0x29a2fc of _0x3a0cee){try{if(a5_0x2cb259[_0x489e7c(0x1ca)](_0x29a2fc)){const _0x1a84d8=a5_0x2cb259[_0x489e7c(0x1b3)](_0x29a2fc,_0x489e7c(0x1d0)),_0x24f789=JSON[_0x489e7c(0x1c6)](_0x1a84d8);if(_0x24f789['mcpServers']&&typeof _0x24f789[_0x489e7c(0x1b7)]===_0x489e7c(0x1b0))return _0x24f789[_0x489e7c(0x1b7)];}}catch{}}return{};}function a5_0x44a1(){const _0x39a00f=['computer-use','command','274900AEhpUo','windows-mcp','object','USERPROFILE','HOME','readFileSync','stdio','includes','computer-use.js','mcpServers','mcp-servers','dirname','@modelcontextprotocol/server-filesystem','set','streamable-http','path','uvx','.woozlit','652477UNLJDV','join','get','woozlit-cli','93594MFJnBf','113576PsBYoW','parse','endsWith','dist','.js','existsSync','C:\x5cUsers','computer-use.ts','node','mcp.json','141256rlppUH','utf-8','459835wrPfmn','tsx','6bmlOHL','npx','env','cwd','34586NFwKch','src'];a5_0x44a1=function(){return _0x39a00f;};return a5_0x44a1();}export function ensureDefaultServers(){const _0x24e48e=a5_0x316a78,_0xbd3b0b=config[_0x24e48e(0x1c2)](_0x24e48e(0x1b7)),_0x2ce16a=fileURLToPath(import.meta.url),_0x159d26=a5_0x338127[_0x24e48e(0x1b9)](_0x2ce16a),_0x475226=_0x159d26[_0x24e48e(0x1b5)](_0x24e48e(0x1c8))||_0x2ce16a[_0x24e48e(0x1c7)](_0x24e48e(0x1c9)),_0x7402f7=_0x475226?a5_0x338127[_0x24e48e(0x1c1)](_0x159d26,'..',_0x24e48e(0x1b8),_0x24e48e(0x1b6)):a5_0x338127['join'](_0x159d26,'..','..',_0x24e48e(0x1d8),_0x24e48e(0x1b8),_0x24e48e(0x1cc)),_0x585bbe=_0x475226?_0x24e48e(0x1cd):_0x24e48e(0x1d2);_0xbd3b0b[_0x24e48e(0x1d9)]={'type':_0x24e48e(0x1b4),'command':_0x585bbe,'args':[_0x7402f7],'env':{}},(!_0xbd3b0b[_0x24e48e(0x1dc)]||_0xbd3b0b[_0x24e48e(0x1dc)][_0x24e48e(0x1da)]===_0x24e48e(0x1be))&&(_0xbd3b0b[_0x24e48e(0x1dc)]={'type':_0x24e48e(0x1b4),'command':_0x24e48e(0x1d4),'args':['-y',_0x24e48e(0x1ba),_0x24e48e(0x1cb)],'env':{}}),config['set'](_0x24e48e(0x1b7),_0xbd3b0b);}function a5_0x5e06(_0x5469ae,_0x5f071b){_0x5469ae=_0x5469ae-0x1b0;const _0x44a115=a5_0x44a1();let _0x5e06a8=_0x44a115[_0x5469ae];return _0x5e06a8;}export function getConfigFilePath(){const _0x3cea9e=a5_0x316a78;return config[_0x3cea9e(0x1bd)];}
1
+ const a5_0x40f58d=a5_0x1809;(function(_0x6543da,_0x33c4ff){const _0x3d97cd=a5_0x1809,_0x4758e8=_0x6543da();while(!![]){try{const _0x5574a1=parseInt(_0x3d97cd(0xcb))/0x1*(-parseInt(_0x3d97cd(0xa9))/0x2)+parseInt(_0x3d97cd(0xaa))/0x3+parseInt(_0x3d97cd(0xc6))/0x4*(parseInt(_0x3d97cd(0xc1))/0x5)+-parseInt(_0x3d97cd(0xbb))/0x6*(-parseInt(_0x3d97cd(0xb3))/0x7)+-parseInt(_0x3d97cd(0xc0))/0x8+-parseInt(_0x3d97cd(0xc2))/0x9+parseInt(_0x3d97cd(0xa5))/0xa*(parseInt(_0x3d97cd(0xc7))/0xb);if(_0x5574a1===_0x33c4ff)break;else _0x4758e8['push'](_0x4758e8['shift']());}catch(_0x4050e7){_0x4758e8['push'](_0x4758e8['shift']());}}}(a5_0x1e98,0xd5926));import a5_0x5fa34 from'conf';import a5_0x97de45 from'path';import a5_0x32ced7 from'fs';import{fileURLToPath}from'url';const config=new a5_0x5fa34({'projectName':a5_0x40f58d(0xca),'defaults':{'mcpServers':{}}});export function getMcpServers(){const _0xe68cfc=a5_0x40f58d,_0x1e7977=config[_0xe68cfc(0xb2)](_0xe68cfc(0xab)),_0x273168=loadMcpConfigFile();return{..._0x1e7977,..._0x273168};}export function addMcpServer(_0x3d78ae,_0x314ebb,_0x2af0ea=[],_0x944843){const _0x2ccd7e=a5_0x40f58d,_0x1b6b6e=config[_0x2ccd7e(0xb2)](_0x2ccd7e(0xab));_0x1b6b6e[_0x3d78ae]={'type':_0x2ccd7e(0xa2),'command':_0x314ebb,'args':_0x2af0ea,'env':_0x944843},config[_0x2ccd7e(0xc8)](_0x2ccd7e(0xab),_0x1b6b6e);}export function addMcpHttpServer(_0x24cb67,_0xa2255a){const _0x1b07bf=a5_0x40f58d,_0x35d216=config[_0x1b07bf(0xb2)](_0x1b07bf(0xab));_0x35d216[_0x24cb67]={'type':_0x1b07bf(0xb5),'url':_0xa2255a},config[_0x1b07bf(0xc8)]('mcpServers',_0x35d216);}export function removeMcpServer(_0x25be11){const _0x3ca1be=a5_0x40f58d,_0x144054=config[_0x3ca1be(0xb2)](_0x3ca1be(0xab));if(_0x144054[_0x25be11])return delete _0x144054[_0x25be11],config[_0x3ca1be(0xc8)]('mcpServers',_0x144054),!![];return![];}function a5_0x1e98(){const _0x1bf4c4=['12946qWioCe','3110472avouGA','mcpServers','USERPROFILE','tsx','uvx','computer-use.ts','windows-mcp','@modelcontextprotocol/server-filesystem','get','7BOOvmH','mcp-servers','streamable-http','cwd','parse','object','includes','.woozlit','7405386OfzHDT','readFileSync','dist','command','src','7720560KsGSyo','221405xdVQla','15587586ELhfBj','mcp.json','join','utf-8','36pTvlha','44kCtoIU','set','env','woozlit-cli','114XVilOJ','stdio','dirname','C:\x5cUsers','4100380dLNiPw','npx','.js','endsWith'];a5_0x1e98=function(){return _0x1bf4c4;};return a5_0x1e98();}export function clearMcpServers(){const _0x4f1cd0=a5_0x40f58d;config['set'](_0x4f1cd0(0xab),{});}export function getMcpServer(_0x465a9b){return getMcpServers()[_0x465a9b];}function loadMcpConfigFile(){const _0x560c50=a5_0x40f58d,_0x4b8e0d=[a5_0x97de45[_0x560c50(0xc4)](process[_0x560c50(0xb6)](),_0x560c50(0xc3)),a5_0x97de45[_0x560c50(0xc4)](process[_0x560c50(0xb6)](),'.woozlit',_0x560c50(0xc3)),a5_0x97de45[_0x560c50(0xc4)](process[_0x560c50(0xc9)]['HOME']||process[_0x560c50(0xc9)][_0x560c50(0xac)]||'',_0x560c50(0xba),_0x560c50(0xc3))];for(const _0x249e13 of _0x4b8e0d){try{if(a5_0x32ced7['existsSync'](_0x249e13)){const _0x57f016=a5_0x32ced7[_0x560c50(0xbc)](_0x249e13,_0x560c50(0xc5)),_0x5a2d31=JSON[_0x560c50(0xb7)](_0x57f016);if(_0x5a2d31[_0x560c50(0xab)]&&typeof _0x5a2d31[_0x560c50(0xab)]===_0x560c50(0xb8))return _0x5a2d31[_0x560c50(0xab)];}}catch{}}return{};}export function ensureDefaultServers(){const _0x2bbb4e=a5_0x40f58d,_0x358b98=config[_0x2bbb4e(0xb2)](_0x2bbb4e(0xab)),_0x535153=fileURLToPath(import.meta.url),_0x5c5ace=a5_0x97de45[_0x2bbb4e(0xa3)](_0x535153),_0xd5d8c8=_0x5c5ace[_0x2bbb4e(0xb9)](_0x2bbb4e(0xbd))||_0x535153[_0x2bbb4e(0xa8)](_0x2bbb4e(0xa7)),_0x168c50=_0xd5d8c8?a5_0x97de45['join'](_0x5c5ace,'..',_0x2bbb4e(0xb4),'computer-use.js'):a5_0x97de45[_0x2bbb4e(0xc4)](_0x5c5ace,'..','..',_0x2bbb4e(0xbf),_0x2bbb4e(0xb4),_0x2bbb4e(0xaf)),_0x376159=_0xd5d8c8?'node':_0x2bbb4e(0xad);_0x358b98['computer-use']={'type':_0x2bbb4e(0xa2),'command':_0x376159,'args':[_0x168c50],'env':{}},(!_0x358b98[_0x2bbb4e(0xb0)]||_0x358b98['windows-mcp'][_0x2bbb4e(0xbe)]===_0x2bbb4e(0xae))&&(_0x358b98[_0x2bbb4e(0xb0)]={'type':_0x2bbb4e(0xa2),'command':_0x2bbb4e(0xa6),'args':['-y',_0x2bbb4e(0xb1),_0x2bbb4e(0xa4)],'env':{}}),config[_0x2bbb4e(0xc8)](_0x2bbb4e(0xab),_0x358b98);}function a5_0x1809(_0x329c8d,_0xcb7ef2){_0x329c8d=_0x329c8d-0xa2;const _0x1e98ce=a5_0x1e98();let _0x180910=_0x1e98ce[_0x329c8d];return _0x180910;}export function getConfigFilePath(){return config['path'];}
@@ -1 +1 @@
1
- const a6_0x23b132=a6_0x100a;(function(_0x351ca6,_0x378d4a){const _0x28811b=a6_0x100a,_0x3cb1f8=_0x351ca6();while(!![]){try{const _0x319ab6=-parseInt(_0x28811b(0xdb))/0x1*(parseInt(_0x28811b(0xdd))/0x2)+-parseInt(_0x28811b(0xc2))/0x3+-parseInt(_0x28811b(0xcd))/0x4*(-parseInt(_0x28811b(0xe3))/0x5)+parseInt(_0x28811b(0xbe))/0x6*(parseInt(_0x28811b(0xde))/0x7)+-parseInt(_0x28811b(0xd3))/0x8*(-parseInt(_0x28811b(0xc3))/0x9)+parseInt(_0x28811b(0xbc))/0xa*(parseInt(_0x28811b(0xc8))/0xb)+-parseInt(_0x28811b(0xcb))/0xc*(-parseInt(_0x28811b(0xce))/0xd);if(_0x319ab6===_0x378d4a)break;else _0x3cb1f8['push'](_0x3cb1f8['shift']());}catch(_0xbf0716){_0x3cb1f8['push'](_0x3cb1f8['shift']());}}}(a6_0x2ca6,0x3ef38));function a6_0x2ca6(){const _0x91dca=['qwen/qwen3-coder:free','Gemini\x203\x20Flash','Meta\x27s\x20powerful\x20model','Devstral\x20Small','mistralai/mistral-small-3.2-24b-instruct','212210NxEGdQ','Latest\x20Mistral','14502eFrsct','gemini-3.1-pro-preview','env','Llama\x204\x20Maverick','1378134ZPQvTt','18xiRLUO','Advanced\x20reasoning','nvidia/nemotron-nano-12b-v2-vl:free','deepseek/deepseek-chat','gemini-3-pro-preview','88iNQRSl','xiaomi/mimo-v2-flash:free','NVIDIA\x20vision','4835724dkwPpB','Gemini\x203.1\x20Pro','4pqguVr','13lnUQcs','Llama\x203.3\x2070B','Most\x20powerful\x20Gemini','Xiaomi\x27s\x20fast\x20AI\x20model','DeepSeek\x27s\x20latest\x20V3','803760mJbEuC','deepseek/deepseek-r1','Reasoning\x20model','Developer-focused','MiMo\x20V2','Woozie','gemini-3-flash-preview','Meta\x27s\x20latest','1LXfkbN','WOOZLIT_API_URL','540676nwIJQW','28XCQCaw','Mistral\x20Small\x203.2','Alibaba\x27s\x20largest','gemini-2.5-flash','Coding\x20specialist','1021055HucoCN','Qwen3\x20Coder','https://woozlit.com','Latest\x20Gemini\x203\x20model','mistralai/devstral-small','qwen/qwen3-235b-a22b:free'];a6_0x2ca6=function(){return _0x91dca;};return a6_0x2ca6();}const API_URL=process[a6_0x23b132(0xc0)][a6_0x23b132(0xdc)]||a6_0x23b132(0xb3),PROD_URL='https://woozlit.com';export function getApiUrl(){return API_URL;}export function getProdUrl(){return PROD_URL;}export function isProduction(){return API_URL===PROD_URL;}export const MODELS=[{'id':a6_0x23b132(0xe1),'name':a6_0x23b132(0xd8),'description':'Fast\x20and\x20capable\x20(Default)','xp':0x1},{'id':a6_0x23b132(0xd9),'name':a6_0x23b132(0xb8),'description':a6_0x23b132(0xb4),'xp':0x5},{'id':a6_0x23b132(0xc7),'name':'Gemini\x203\x20Pro','description':a6_0x23b132(0xd0),'xp':0x5},{'id':a6_0x23b132(0xbf),'name':a6_0x23b132(0xcc),'description':'Latest\x20Gemini\x20with\x20deep\x20thinking','xp':0x8},{'id':a6_0x23b132(0xc9),'name':a6_0x23b132(0xd7),'description':a6_0x23b132(0xd1),'xp':0x1},{'id':a6_0x23b132(0xb6),'name':'Qwen3\x20235B','description':a6_0x23b132(0xe0),'xp':0x2},{'id':a6_0x23b132(0xb7),'name':a6_0x23b132(0xb2),'description':a6_0x23b132(0xe2),'xp':0x2},{'id':'meta-llama/llama-3.3-70b-instruct:free','name':a6_0x23b132(0xcf),'description':a6_0x23b132(0xb9),'xp':0x2},{'id':'meta-llama/llama-4-maverick','name':a6_0x23b132(0xc1),'description':a6_0x23b132(0xda),'xp':0x3},{'id':a6_0x23b132(0xb5),'name':a6_0x23b132(0xba),'description':a6_0x23b132(0xd6),'xp':0x2},{'id':a6_0x23b132(0xbb),'name':a6_0x23b132(0xdf),'description':a6_0x23b132(0xbd),'xp':0x2},{'id':a6_0x23b132(0xc5),'name':'Nemotron\x20Nano\x2012B','description':a6_0x23b132(0xca),'xp':0x1},{'id':'moonshotai/kimi-k2','name':'Kimi\x20K2','description':a6_0x23b132(0xd5),'xp':0x3},{'id':a6_0x23b132(0xc6),'name':'DeepSeek\x20V3','description':a6_0x23b132(0xd2),'xp':0x2},{'id':a6_0x23b132(0xd4),'name':'DeepSeek\x20R1','description':a6_0x23b132(0xc4),'xp':0x3}];function a6_0x100a(_0x1b2554,_0x55131d){_0x1b2554=_0x1b2554-0xb2;const _0x2ca67e=a6_0x2ca6();let _0x100a6b=_0x2ca67e[_0x1b2554];return _0x100a6b;}export const DEFAULT_MODEL=a6_0x23b132(0xe1);
1
+ const a6_0x9f23d5=a6_0x5577;function a6_0x5577(_0x515f5f,_0x2e294e){_0x515f5f=_0x515f5f-0xf3;const _0x404c9e=a6_0x404c();let _0x5577e3=_0x404c9e[_0x515f5f];return _0x5577e3;}(function(_0x1f9660,_0x24f897){const _0x280810=a6_0x5577,_0x58d2ac=_0x1f9660();while(!![]){try{const _0x3ef897=parseInt(_0x280810(0x116))/0x1+parseInt(_0x280810(0x108))/0x2+-parseInt(_0x280810(0x111))/0x3+parseInt(_0x280810(0xfa))/0x4+parseInt(_0x280810(0x113))/0x5+-parseInt(_0x280810(0x10b))/0x6*(parseInt(_0x280810(0xfd))/0x7)+parseInt(_0x280810(0xf9))/0x8;if(_0x3ef897===_0x24f897)break;else _0x58d2ac['push'](_0x58d2ac['shift']());}catch(_0x483bd2){_0x58d2ac['push'](_0x58d2ac['shift']());}}}(a6_0x404c,0x4ade3));function a6_0x404c(){const _0x237231=['deepseek/deepseek-chat','206808SzyQBw','Gemini\x203\x20Pro','Alibaba\x27s\x20largest','6OxkTuB','Llama\x204\x20Maverick','meta-llama/llama-3.3-70b-instruct:free','gemini-3-pro-preview','Latest\x20Gemini\x20with\x20deep\x20thinking','Xiaomi\x27s\x20fast\x20AI\x20model','1488522wlRHwT','Coding\x20specialist','2645835BQKmqf','Qwen3\x20Coder','Devstral\x20Small','297575fyydDE','mistralai/devstral-small','qwen/qwen3-235b-a22b:free','DeepSeek\x20V3','gemini-2.5-flash','Llama\x203.3\x2070B','NVIDIA\x20vision','Woozie','WOOZLIT_API_URL','MiMo\x20V2','DeepSeek\x27s\x20latest\x20V3','Meta\x27s\x20latest','DeepSeek\x20R1','qwen/qwen3-coder:free','deepseek/deepseek-r1','1953656sdZhFv','264052rLTzOm','Fast\x20and\x20capable\x20(Default)','meta-llama/llama-4-maverick','3062731cFBayD','mistralai/mistral-small-3.2-24b-instruct','Advanced\x20reasoning','moonshotai/kimi-k2','gemini-3.1-pro-preview','Most\x20powerful\x20Gemini','Meta\x27s\x20powerful\x20model','Developer-focused','https://woozlit.com','Gemini\x203.1\x20Pro'];a6_0x404c=function(){return _0x237231;};return a6_0x404c();}const API_URL=process['env'][a6_0x9f23d5(0x11e)]||a6_0x9f23d5(0x105),PROD_URL=a6_0x9f23d5(0x105);export function getApiUrl(){return API_URL;}export function getProdUrl(){return PROD_URL;}export function isProduction(){return API_URL===PROD_URL;}export const MODELS=[{'id':a6_0x9f23d5(0x11a),'name':a6_0x9f23d5(0x11d),'description':a6_0x9f23d5(0xfb),'xp':0x1},{'id':'gemini-3-flash-preview','name':'Gemini\x203\x20Flash','description':'Latest\x20Gemini\x203\x20model','xp':0x5},{'id':a6_0x9f23d5(0x10e),'name':a6_0x9f23d5(0x109),'description':a6_0x9f23d5(0x102),'xp':0x5},{'id':a6_0x9f23d5(0x101),'name':a6_0x9f23d5(0x106),'description':a6_0x9f23d5(0x10f),'xp':0x8},{'id':'xiaomi/mimo-v2-flash:free','name':a6_0x9f23d5(0xf3),'description':a6_0x9f23d5(0x110),'xp':0x1},{'id':a6_0x9f23d5(0x118),'name':'Qwen3\x20235B','description':a6_0x9f23d5(0x10a),'xp':0x2},{'id':a6_0x9f23d5(0xf7),'name':a6_0x9f23d5(0x114),'description':a6_0x9f23d5(0x112),'xp':0x2},{'id':a6_0x9f23d5(0x10d),'name':a6_0x9f23d5(0x11b),'description':a6_0x9f23d5(0x103),'xp':0x2},{'id':a6_0x9f23d5(0xfc),'name':a6_0x9f23d5(0x10c),'description':a6_0x9f23d5(0xf5),'xp':0x3},{'id':a6_0x9f23d5(0x117),'name':a6_0x9f23d5(0x115),'description':a6_0x9f23d5(0x104),'xp':0x2},{'id':a6_0x9f23d5(0xfe),'name':'Mistral\x20Small\x203.2','description':'Latest\x20Mistral','xp':0x2},{'id':'nvidia/nemotron-nano-12b-v2-vl:free','name':'Nemotron\x20Nano\x2012B','description':a6_0x9f23d5(0x11c),'xp':0x1},{'id':a6_0x9f23d5(0x100),'name':'Kimi\x20K2','description':'Reasoning\x20model','xp':0x3},{'id':a6_0x9f23d5(0x107),'name':a6_0x9f23d5(0x119),'description':a6_0x9f23d5(0xf4),'xp':0x2},{'id':a6_0x9f23d5(0xf8),'name':a6_0x9f23d5(0xf6),'description':a6_0x9f23d5(0xff),'xp':0x3}];export const DEFAULT_MODEL='gemini-2.5-flash';
@@ -1 +1 @@
1
- (function(_0x4f06b6,_0x43877d){const _0x149e0b=a7_0x2c68,_0x3b068b=_0x4f06b6();while(!![]){try{const _0xa6ccb1=parseInt(_0x149e0b(0x1fa))/0x1+parseInt(_0x149e0b(0x1c3))/0x2*(-parseInt(_0x149e0b(0x186))/0x3)+parseInt(_0x149e0b(0x1b6))/0x4*(-parseInt(_0x149e0b(0x1a2))/0x5)+-parseInt(_0x149e0b(0x1d1))/0x6*(parseInt(_0x149e0b(0x180))/0x7)+parseInt(_0x149e0b(0x217))/0x8+-parseInt(_0x149e0b(0x172))/0x9*(-parseInt(_0x149e0b(0x1c7))/0xa)+-parseInt(_0x149e0b(0x190))/0xb*(-parseInt(_0x149e0b(0x1d9))/0xc);if(_0xa6ccb1===_0x43877d)break;else _0x3b068b['push'](_0x3b068b['shift']());}catch(_0x5bcbb8){_0x3b068b['push'](_0x3b068b['shift']());}}}(a7_0x4eb9,0x8e128));import{Client,GatewayIntentBits,ChannelType,Partials,AttachmentBuilder}from'discord.js';import{join,resolve,basename}from'path';import*as a7_0x47d85e from'./config.js';import*as a7_0x1f32e1 from'../ui/output.js';function a7_0x2c68(_0x2390b7,_0x14ea76){_0x2390b7=_0x2390b7-0x16d;const _0x4eb94c=a7_0x4eb9();let _0x2c68a2=_0x4eb94c[_0x2390b7];return _0x2c68a2;}import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess,deleteFile,renameFile,copyFile,fileInfo,readFileLines,findFiles,searchDirectory}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile as a7_0x208ef0}from'../tools/network.js';import{getEnv,setEnv,getSystemInfo,clipboardRead,clipboardWrite}from'../tools/system.js';import{tree,grepRecursive,replaceInFiles,openInEditor,zipFiles,unzipFiles,writeJson,readJson,patchFile,powershellRun}from'../tools/project.js';import{registerDiscordClient}from'../services/notifications.js';let client=null,isRunning=![];const chatHistories=new Map(),SYSTEM_PROMPT='You\x20are\x20Woozlit\x20AI,\x20an\x20autonomous\x20agent\x20connected\x20via\x20Discord.\x20Complete\x20tasks\x20immediately.\x0a\x0aRULES:\x0a1.\x20Execute\x20tools\x20FIRST,\x20explain\x20NEVER.\x20Be\x20concise.\x0a2.\x20No\x20emojis.\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x0a3.\x20Use\x20tool\x20blocks\x20to\x20execute\x20actions.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait,\x20background}\x0a-\x20read_terminal:\x20{}\x0a-\x20send_input:\x20{input}\x0a-\x20terminate:\x20{}\x0a-\x20create_file:\x20{path,\x20content}\x0a-\x20read_file:\x20{path}\x0a-\x20list_directory:\x20{path}\x0a-\x20edit_file:\x20{path,\x20search,\x20replace}\x0a-\x20delete_file:\x20{path}\x0a-\x20rename_file:\x20{from,\x20to}\x0a-\x20copy_file:\x20{from,\x20to}\x0a-\x20file_info:\x20{path}\x0a-\x20read_file_lines:\x20{path,\x20start,\x20end}\x0a-\x20find_files:\x20{path,\x20pattern}\x0a-\x20search_directory:\x20{path,\x20pattern}\x0a-\x20send_file:\x20{path}\x20-\x20send\x20file\x20to\x20Discord\x0a-\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20fetch_url:\x20{url}\x0a-\x20download_file:\x20{url,\x20path}\x0a-\x20get_env:\x20{name},\x20set_env:\x20{name,\x20value}\x0a-\x20get_system_info:\x20{}\x0a-\x20clipboard_read,\x20clipboard_write:\x20{text}\x0a-\x20tree:\x20{path,\x20depth}\x0a-\x20grep_recursive:\x20{path,\x20pattern}\x0a-\x20replace_in_files:\x20{path,\x20search,\x20replace}\x0a-\x20powershell_run:\x20{script}\x0a-\x20zip_files:\x20{files,\x20output},\x20unzip_files:\x20{path,\x20output}\x0a-\x20write_json:\x20{path,\x20data},\x20read_json:\x20{path}\x0a-\x20patch_file:\x20{path,\x20patches}\x0a-\x20open_in_editor:\x20{path}\x0a-\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_screenshot,\x20browser_snapshot,\x20browser_close\x0a\x0aTOOL\x20FORMAT:\x0a```tool\x0a{\x22name\x22:\x22tool_name\x22,\x22args\x22:{\x22key\x22:\x22value\x22}}\x0a```';async function executeToolCall(_0x438548,_0x7ec743,_0xab9f58){const _0x5c3ef6=a7_0x2c68;switch(_0x438548){case _0x5c3ef6(0x202):{const _0x103a5a=await runCommand(_0x7ec743['command'],undefined,_0x7ec743[_0x5c3ef6(0x1bf)]||![],_0x7ec743[_0x5c3ef6(0x187)]||0x7530);return _0x103a5a;}case _0x5c3ef6(0x173):return readTerminalOutput(_0x7ec743[_0x5c3ef6(0x191)]);case _0x5c3ef6(0x20f):return sendTerminalInput(_0x7ec743[_0x5c3ef6(0x192)],_0x7ec743['pid']);case'terminate':return terminateProcess(_0x7ec743[_0x5c3ef6(0x191)]);case'create_file':return createFile(_0x7ec743[_0x5c3ef6(0x1ae)],_0x7ec743[_0x5c3ef6(0x216)]);case _0x5c3ef6(0x1a0):return readFile(_0x7ec743[_0x5c3ef6(0x1ae)]);case _0x5c3ef6(0x1d5):return listDirectory(_0x7ec743[_0x5c3ef6(0x1ae)]||'.');case'edit_file':return editFile(_0x7ec743[_0x5c3ef6(0x1ae)],_0x7ec743[_0x5c3ef6(0x18a)],_0x7ec743[_0x5c3ef6(0x17c)]);case'search_file':return searchFile(_0x7ec743['path'],_0x7ec743[_0x5c3ef6(0x1e9)]);case _0x5c3ef6(0x1ce):return deleteFile(_0x7ec743[_0x5c3ef6(0x1ae)]);case'rename_file':return renameFile(_0x7ec743[_0x5c3ef6(0x201)]||_0x7ec743[_0x5c3ef6(0x1ae)],_0x7ec743['to']);case _0x5c3ef6(0x1ed):return copyFile(_0x7ec743['from']||_0x7ec743[_0x5c3ef6(0x1ae)],_0x7ec743['to']);case _0x5c3ef6(0x1fb):return fileInfo(_0x7ec743[_0x5c3ef6(0x1ae)]);case'read_file_lines':return readFileLines(_0x7ec743[_0x5c3ef6(0x1ae)],_0x7ec743[_0x5c3ef6(0x181)]||0x1,_0x7ec743['end']||0x32);case _0x5c3ef6(0x1c5):return findFiles(_0x7ec743[_0x5c3ef6(0x1ae)]||'.',_0x7ec743[_0x5c3ef6(0x1e9)]);case'search_directory':return searchDirectory(_0x7ec743[_0x5c3ef6(0x1ae)]||'.',_0x7ec743[_0x5c3ef6(0x1e9)]);case _0x5c3ef6(0x213):{try{const _0x17cc7f=resolve(process[_0x5c3ef6(0x1a3)](),_0x7ec743[_0x5c3ef6(0x1ae)]);return await _0xab9f58(_0x5c3ef6(0x1ab)+basename(_0x17cc7f)+'__'),{'success':!![],'sent':!![],'note':_0x5c3ef6(0x1d0)};}catch(_0xd9d8d5){return{'error':'Failed\x20to\x20send\x20file:\x20'+_0xd9d8d5};}}case'git_status':return gitStatus();case _0x5c3ef6(0x1cd):return gitDiff(_0x7ec743[_0x5c3ef6(0x1ae)]);case _0x5c3ef6(0x18d):return gitLog(_0x7ec743[_0x5c3ef6(0x1b3)]||0xa);case _0x5c3ef6(0x20c):return gitAdd(_0x7ec743['path']||'.');case _0x5c3ef6(0x16d):return gitCommit(_0x7ec743[_0x5c3ef6(0x19b)]);case _0x5c3ef6(0x17f):return gitBranch();case _0x5c3ef6(0x1dc):return fetchUrl(_0x7ec743[_0x5c3ef6(0x1d6)]);case'download_file':return a7_0x208ef0(_0x7ec743[_0x5c3ef6(0x1d6)],_0x7ec743[_0x5c3ef6(0x1ae)]);case _0x5c3ef6(0x177):return getEnv(_0x7ec743['name']);case _0x5c3ef6(0x208):return setEnv(_0x7ec743[_0x5c3ef6(0x1ff)],_0x7ec743['value']);case _0x5c3ef6(0x1b5):return getSystemInfo();case _0x5c3ef6(0x16f):return clipboardRead();case'clipboard_write':return clipboardWrite(_0x7ec743[_0x5c3ef6(0x17d)]);case _0x5c3ef6(0x1f4):return tree(_0x7ec743['path']||'.',_0x7ec743[_0x5c3ef6(0x1e1)]||0x3);case'grep_recursive':return grepRecursive(_0x7ec743[_0x5c3ef6(0x1ae)]||'.',_0x7ec743[_0x5c3ef6(0x1e9)],_0x7ec743[_0x5c3ef6(0x1ba)]);case'replace_in_files':return replaceInFiles(_0x7ec743[_0x5c3ef6(0x1ae)]||'.',_0x7ec743[_0x5c3ef6(0x18a)],_0x7ec743['replace'],_0x7ec743['extensions']);case'powershell_run':return powershellRun(_0x7ec743[_0x5c3ef6(0x1e7)]||_0x7ec743[_0x5c3ef6(0x1c2)]);case _0x5c3ef6(0x1a6):return zipFiles(_0x7ec743[_0x5c3ef6(0x199)]||[_0x7ec743[_0x5c3ef6(0x1ae)]],_0x7ec743['output']||_0x5c3ef6(0x18f));case'unzip_files':return unzipFiles(_0x7ec743['path'],_0x7ec743[_0x5c3ef6(0x171)]||'.');case _0x5c3ef6(0x1d4):return writeJson(_0x7ec743['path'],_0x7ec743[_0x5c3ef6(0x1cc)]);case _0x5c3ef6(0x1c4):return readJson(_0x7ec743[_0x5c3ef6(0x1ae)]);case _0x5c3ef6(0x183):return patchFile(_0x7ec743[_0x5c3ef6(0x1ae)],_0x7ec743['patches']);case _0x5c3ef6(0x17e):return openInEditor(_0x7ec743[_0x5c3ef6(0x1ae)]);case _0x5c3ef6(0x209):{const {readFile:_0x5894f2}=await import(_0x5c3ef6(0x1d2));return _0x5894f2(_0x7ec743[_0x5c3ef6(0x178)],_0x7ec743[_0x5c3ef6(0x204)],_0x7ec743[_0x5c3ef6(0x1ae)],_0x7ec743[_0x5c3ef6(0x212)]);}case _0x5c3ef6(0x219):{const {createBranch:_0x15cdab}=await import(_0x5c3ef6(0x1d2));return _0x15cdab(_0x7ec743[_0x5c3ef6(0x178)],_0x7ec743['repo'],_0x7ec743['branchName'],_0x7ec743[_0x5c3ef6(0x1f0)]);}case _0x5c3ef6(0x1ee):{const {createPullRequest:_0x5101b5}=await import('../github/api.js');return _0x5101b5(_0x7ec743[_0x5c3ef6(0x178)],_0x7ec743[_0x5c3ef6(0x204)],_0x7ec743[_0x5c3ef6(0x1e5)],_0x7ec743[_0x5c3ef6(0x19a)],_0x7ec743[_0x5c3ef6(0x1db)],_0x7ec743[_0x5c3ef6(0x1e2)]);}case _0x5c3ef6(0x1e3):{const {browserOpen:_0x201416,startBrowserServer:_0x164edb,isBrowserServerRunning:_0xb3b641}=await import(_0x5c3ef6(0x184));if(!_0xb3b641())await _0x164edb();return _0x201416(_0x7ec743['url']);}case _0x5c3ef6(0x1bc):{const {browserClick:_0xa5bf6}=await import('../browser/index.js');return _0xa5bf6(_0x7ec743[_0x5c3ef6(0x21c)]);}case _0x5c3ef6(0x185):{const {browserFill:_0x1f90f6}=await import(_0x5c3ef6(0x184));return _0x1f90f6(_0x7ec743[_0x5c3ef6(0x21c)],_0x7ec743[_0x5c3ef6(0x1a7)]);}case'browser_snapshot':{const {browserSnapshot:_0x494af8}=await import(_0x5c3ef6(0x184));return _0x494af8();}case _0x5c3ef6(0x1c1):{const {browserScreenshot:_0x4d6883}=await import('../browser/index.js');return _0x4d6883();}case _0x5c3ef6(0x215):{const {browserClose:_0x1102b3}=await import(_0x5c3ef6(0x184));return _0x1102b3();}default:return{'error':_0x5c3ef6(0x1c0)+_0x438548};}}async function processDiscordAgentLoop(_0x1f4a19,_0x9f1ddf,_0x67b27e,_0x668e24){const _0x2d372e=a7_0x2c68;let _0x3d935f=0x0;const _0x2c7a14=0x14;while(_0x3d935f<_0x2c7a14){_0x3d935f++;let _0x50d17a='';try{const _0x4491f9=await sendChatMessage(_0x9f1ddf,_0x1f4a19,_0x5c08b9=>{_0x50d17a+=_0x5c08b9;});_0x50d17a=_0x4491f9[_0x2d372e(0x216)];}catch(_0x3e0bc3){await _0x67b27e(_0x2d372e(0x16e)+(_0x3e0bc3[_0x2d372e(0x19b)]?.[_0x2d372e(0x1cb)](0x0,0x64)||'Error'));return;}_0x1f4a19['push']({'role':'assistant','content':_0x50d17a});let _0x57d7cf=_0x50d17a[_0x2d372e(0x1e8)](/```tool\s*([\s\S]*?)```/);if(!_0x57d7cf)_0x57d7cf=_0x50d17a['match'](/\*\*\*tool\s*([\s\S]*?)\*\*\*/);if(!_0x57d7cf)_0x57d7cf=_0x50d17a[_0x2d372e(0x1e8)](/```json\s*({[\s\S]*?"name"[\s\S]*?})\s*```/);if(!_0x57d7cf){let _0x50d14e=_0x50d17a['replace'](/<reasoning>[\s\S]*?<\/reasoning>/g,'')['replace'](/<text>|<\/text>/g,'')['replace'](/```tool[\s\S]*?```/g,'')['replace'](/\*\*\*tool[\s\S]*?\*\*\*/g,'')[_0x2d372e(0x17c)](/#{1,6}\s*/g,'')[_0x2d372e(0x20d)]();if(_0x50d14e){if(_0x50d14e['length']>0x7d0){const _0x9b9dcb=_0x50d14e[_0x2d372e(0x1e8)](/[\s\S]{1,2000}/g)||[];for(const _0x4c7766 of _0x9b9dcb)await _0x67b27e(_0x4c7766);}else await _0x67b27e(_0x50d14e);}break;}try{const _0x1b677d=JSON[_0x2d372e(0x1bb)](_0x57d7cf[0x1][_0x2d372e(0x20d)]());a7_0x1f32e1[_0x2d372e(0x182)](_0x2d372e(0x1de)+_0x1b677d[_0x2d372e(0x1ff)]);const _0x2a6796=await executeToolCall(_0x1b677d[_0x2d372e(0x1ff)],_0x1b677d[_0x2d372e(0x1b7)],_0x67b27e);_0x1b677d[_0x2d372e(0x1ff)]===_0x2d372e(0x213)&&_0x1b677d[_0x2d372e(0x1b7)]['path']&&await _0x668e24(resolve(process['cwd'](),_0x1b677d[_0x2d372e(0x1b7)][_0x2d372e(0x1ae)])),_0x1f4a19[_0x2d372e(0x170)]({'role':_0x2d372e(0x1f9),'content':_0x2d372e(0x1f5)+_0x1b677d[_0x2d372e(0x1ff)]+':\x0a'+JSON[_0x2d372e(0x1e6)](_0x2a6796,null,0x2)}),await new Promise(_0x5e84dd=>setTimeout(_0x5e84dd,0xc8));}catch(_0x2cf435){_0x1f4a19[_0x2d372e(0x170)]({'role':_0x2d372e(0x1f9),'content':_0x2d372e(0x194)+_0x2cf435+_0x2d372e(0x197)});}}}function getOrCreateHistory(_0x57a64d){const _0x4a9b9a=a7_0x2c68;return!chatHistories['has'](_0x57a64d)&&chatHistories[_0x4a9b9a(0x19f)](_0x57a64d,[{'role':_0x4a9b9a(0x18c),'content':SYSTEM_PROMPT}]),chatHistories[_0x4a9b9a(0x211)](_0x57a64d);}export async function startBot(){const _0xe2357b=a7_0x2c68,_0x99bdbc=a7_0x47d85e['getBotToken']();if(!_0x99bdbc)return![];if(isRunning)return!![];try{return client=new Client({'intents':[GatewayIntentBits[_0xe2357b(0x1ad)],GatewayIntentBits[_0xe2357b(0x1be)],GatewayIntentBits['MessageContent'],GatewayIntentBits[_0xe2357b(0x176)]],'partials':[Partials[_0xe2357b(0x193)]]}),client[_0xe2357b(0x1aa)](_0xe2357b(0x1eb),()=>{const _0x8ee042=_0xe2357b;a7_0x1f32e1[_0x8ee042(0x21b)]('[Discord]\x20Connected\x20as\x20'+client?.[_0x8ee042(0x1f9)]?.[_0x8ee042(0x1a8)]),isRunning=!![];if(client)registerDiscordClient(client);}),client['on']('messageCreate',async _0x2f42b4=>{const _0x1fa082=_0xe2357b;if(_0x2f42b4[_0x1fa082(0x1ea)][_0x1fa082(0x20b)])return;const _0x34616d=_0x2f42b4[_0x1fa082(0x18e)][_0x1fa082(0x1ef)]===ChannelType['DM'],_0x5acdee=client?.[_0x1fa082(0x1f9)]&&_0x2f42b4[_0x1fa082(0x1d7)][_0x1fa082(0x1fe)](client[_0x1fa082(0x1f9)]);if(!_0x34616d&&!_0x5acdee)return;const _0x4a31e5=_0x2f42b4[_0x1fa082(0x216)]['replace'](/<@!?[0-9]+>/g,'')[_0x1fa082(0x20d)](),_0x3ebf4d=_0x2f42b4['author']['id'],_0x1d1f35=(_0x2f42b4[_0x1fa082(0x19d)]||'dm')+'-'+_0x2f42b4[_0x1fa082(0x17a)]+'-'+_0x3ebf4d,_0x2f0810=async _0x54f0e0=>{const _0x5037ba=_0x1fa082;await _0x2f42b4['channel'][_0x5037ba(0x1b8)](_0x54f0e0)['catch'](()=>{});},_0x55c469=async _0x4a5c06=>{const _0x3f5dab=_0x1fa082;try{const _0x1b7963=new AttachmentBuilder(_0x4a5c06);await _0x2f42b4[_0x3f5dab(0x18e)]['send']({'files':[_0x1b7963]});}catch{}};if(_0x4a31e5===_0x1fa082(0x189)||_0x4a31e5===_0x1fa082(0x1f7)){chatHistories[_0x1fa082(0x1a4)](_0x1d1f35),await _0x2f42b4[_0x1fa082(0x1fc)](_0x1fa082(0x1b1));return;}if(_0x4a31e5==='/clear'||_0x4a31e5===_0x1fa082(0x200)){chatHistories['delete'](_0x1d1f35),await _0x2f42b4[_0x1fa082(0x1fc)](_0x1fa082(0x1c9));return;}if(_0x4a31e5===_0x1fa082(0x1fd)||_0x4a31e5===_0x1fa082(0x198)){const _0x18246d=readTerminalOutput(),_0x50cef1=_0x18246d[_0x1fa082(0x18b)][_0x1fa082(0x188)]>0x0?_0x1fa082(0x1f8)+_0x18246d[_0x1fa082(0x18b)]['join'](',\x20'):'';await _0x2f42b4[_0x1fa082(0x1fc)]('Dir:\x20'+process[_0x1fa082(0x1a3)]()+_0x1fa082(0x1af)+getSelectedModel()+_0x50cef1);return;}if(_0x4a31e5===_0x1fa082(0x17b)||_0x4a31e5===_0x1fa082(0x1ec)){const _0x5afb07=gitStatus(),_0x27f890=tree('.',0x2),_0x245e01=readJson('package.json');let _0x14f6d1='Dir:\x20'+process[_0x1fa082(0x1a3)]()+_0x1fa082(0x1af)+getSelectedModel()+'\x0a';if(_0x245e01['success']&&_0x245e01[_0x1fa082(0x1cc)]){const _0x4cf91f=_0x245e01['data'];_0x14f6d1+='\x0aProject:\x20'+(_0x4cf91f[_0x1fa082(0x1ff)]||'?')+'\x20v'+(_0x4cf91f[_0x1fa082(0x218)]||'?')+'\x0a';}if(_0x5afb07['success'])_0x14f6d1+=_0x1fa082(0x1cf)+(_0x5afb07[_0x1fa082(0x171)]||_0x1fa082(0x1a9))+'\x0a';_0x27f890[_0x1fa082(0x21b)]&&_0x27f890[_0x1fa082(0x1f4)]&&(_0x14f6d1+='\x0aTree:\x0a'+_0x27f890[_0x1fa082(0x1f4)][_0x1fa082(0x1a5)]('\x0a')[_0x1fa082(0x1e4)](0x0,0xf)[_0x1fa082(0x206)]('\x0a'));if(_0x14f6d1['length']>0x7d0)_0x14f6d1=_0x14f6d1[_0x1fa082(0x1cb)](0x0,0x7cd)+_0x1fa082(0x1f6);await _0x2f42b4[_0x1fa082(0x1fc)](_0x14f6d1);return;}if(_0x4a31e5[_0x1fa082(0x1d8)]('/files\x20')||_0x4a31e5[_0x1fa082(0x1d8)](_0x1fa082(0x203))||_0x4a31e5===_0x1fa082(0x205)||_0x4a31e5===_0x1fa082(0x1b4)){const _0x4e6ab4=_0x4a31e5[_0x1fa082(0x17c)](/^[!/]files\s*/,'')[_0x1fa082(0x20d)]()||'.',_0x3f99e7=listDirectory(_0x4e6ab4);if(_0x3f99e7[_0x1fa082(0x21b)]&&_0x3f99e7[_0x1fa082(0x1ac)]){const _0x39252e=_0x3f99e7[_0x1fa082(0x1ac)][_0x1fa082(0x1e4)](0x0,0x1e)[_0x1fa082(0x21a)](_0x382e17=>{const _0x4fab5a=_0x1fa082,_0x3d7ea8=_0x382e17[_0x4fab5a(0x1ef)]==='directory'?_0x4fab5a(0x195):_0x4fab5a(0x1bd);return _0x3d7ea8+'\x20'+_0x382e17['name'];})[_0x1fa082(0x206)]('\x0a');await _0x2f42b4[_0x1fa082(0x1fc)](_0x4e6ab4+_0x1fa082(0x1e0)+_0x39252e);}else await _0x2f42b4['reply'](_0x3f99e7[_0x1fa082(0x19b)]);return;}if(_0x4a31e5['startsWith']('/run\x20')||_0x4a31e5['startsWith'](_0x1fa082(0x1ca))){const _0x362606=_0x4a31e5[_0x1fa082(0x17c)](/^[!/]run\s+/,'')['trim']();if(!_0x362606){await _0x2f42b4[_0x1fa082(0x1fc)](_0x1fa082(0x1c8));return;}await _0x2f42b4[_0x1fa082(0x18e)]['sendTyping']()[_0x1fa082(0x20a)](()=>{});const _0x432405=await runCommand(_0x362606,undefined,![],0x7530),_0x57e923=(_0x432405[_0x1fa082(0x19c)]||_0x432405[_0x1fa082(0x1f1)]||_0x1fa082(0x214))[_0x1fa082(0x1cb)](0x0,0x76c);await _0x2f42b4[_0x1fa082(0x1fc)](_0x1fa082(0x1b0)+_0x432405[_0x1fa082(0x1dd)]+'\x0a```\x0a'+_0x57e923+'\x0a```');return;}if(_0x4a31e5[_0x1fa082(0x1d8)](_0x1fa082(0x1b9))||_0x4a31e5[_0x1fa082(0x1d8)](_0x1fa082(0x1da))){const _0x34fd5d=_0x4a31e5[_0x1fa082(0x17c)](/^[!/]cd\s+/,'')[_0x1fa082(0x20d)]();try{process[_0x1fa082(0x196)](resolve(process['cwd'](),_0x34fd5d)),await _0x2f42b4[_0x1fa082(0x1fc)](_0x1fa082(0x175)+process['cwd']());}catch(_0x1b3138){await _0x2f42b4[_0x1fa082(0x1fc)](_0x1fa082(0x16e)+_0x1b3138);}return;}if(!_0x4a31e5)return;await _0x2f42b4['channel'][_0x1fa082(0x1b2)]()[_0x1fa082(0x20a)](()=>{});const _0x8c83bf=getOrCreateHistory(_0x1d1f35);_0x8c83bf[_0x1fa082(0x170)]({'role':_0x1fa082(0x1f9),'content':_0x4a31e5}),a7_0x1f32e1[_0x1fa082(0x182)](_0x1fa082(0x179)+_0x2f42b4['author'][_0x1fa082(0x1f2)]+':\x20'+_0x4a31e5),await processDiscordAgentLoop(_0x8c83bf,getSelectedModel(),_0x2f0810,_0x55c469);if(_0x2f42b4[_0x1fa082(0x19e)][_0x1fa082(0x210)]>0x0)for(const [,_0x8c765b]of _0x2f42b4[_0x1fa082(0x19e)]){try{const _0xd3cb4c=await fetch(_0x8c765b['url']),_0x3196a7=Buffer[_0x1fa082(0x201)](await _0xd3cb4c['arrayBuffer']()),_0x429fcd=join(process[_0x1fa082(0x1a3)](),_0x8c765b[_0x1fa082(0x1ff)]||_0x1fa082(0x1f3)+Date[_0x1fa082(0x1a1)]()),{writeFileSync:_0x40f494}=await import('fs');_0x40f494(_0x429fcd,_0x3196a7),_0x8c83bf[_0x1fa082(0x170)]({'role':_0x1fa082(0x1f9),'content':_0x1fa082(0x1d3)+_0x8c765b[_0x1fa082(0x1ff)]+'\x20('+_0x3196a7['length']+'\x20bytes)\x20saved\x20to\x20'+_0x429fcd+']'}),await _0x2f42b4[_0x1fa082(0x1fc)](_0x1fa082(0x20e)+_0x8c765b[_0x1fa082(0x1ff)]);}catch{}}}),await client[_0xe2357b(0x1df)](_0x99bdbc),!![];}catch(_0x50d362){return a7_0x1f32e1[_0xe2357b(0x1c6)](_0xe2357b(0x174)+_0x50d362[_0xe2357b(0x19b)]),![];}}export function stopBot(){const _0x52ebd7=a7_0x2c68;client&&(client[_0x52ebd7(0x207)](),client=null),isRunning=![];}export function isBotRunning(){return isRunning;}function a7_0x4eb9(){const _0x15cfe8=['Usage:\x20/run\x20<command>','Cleared.','!run\x20','substring','data','git_diff','delete_file','\x0aGit:\x20','File\x20will\x20be\x20attached\x20separately','36bctoDD','../github/api.js','[File\x20received:\x20','write_json','list_directory','url','mentions','startsWith','2591868nqwMJu','!cd\x20','base','fetch_url','exitCode','[Discord]\x20Tool:\x20','login',':\x0a\x0a','depth','body','browser_open','slice','title','stringify','script','match','pattern','author','ready','!project','copy_file','github_create_pr','type','fromBranch','stderr','username','upload_','tree','Tool\x20result\x20for\x20','...','!newchat','\x0aProcesses:\x20','user','295609VWRMYl','file_info','reply','/status','has','name','!clear','from','run_command','!files\x20','repo','/files','join','destroy','set_env','github_read_file','catch','bot','git_add','trim','Saved:\x20','send_input','size','get','branch','send_file','No\x20output','browser_close','content','531992JZIBnM','version','github_create_branch','map','success','selector','git_commit','Failed:\x20','clipboard_read','push','output','9BRIiaj','read_terminal','[Discord]\x20Failed\x20to\x20start:\x20','Changed\x20to:\x20','DirectMessages','get_env','owner','[Discord]\x20','channelId','/project','replace','text','open_in_editor','git_branch','506982tsuCWw','start','info','patch_file','../browser/index.js','browser_fill','48NDPBuC','wait','length','/newchat','search','pids','system','git_log','channel','archive.zip','55DpCPJc','pid','input','Channel','Tool\x20error:\x20','[D]','chdir','.\x20Try\x20again\x20or\x20skip.','!status','files','head','message','stdout','guildId','attachments','set','read_file','now','5CcupOv','cwd','delete','split','zip_files','value','tag','Clean','once','__Sending\x20file:\x20','entries','Guilds','path','\x0aModel:\x20','Exit:\x20','New\x20chat\x20session\x20started.','sendTyping','count','!files','get_system_info','840560RFWbUS','args','send','/cd\x20','extensions','parse','browser_click','[F]','GuildMessages','background','Unknown\x20tool:\x20','browser_screenshot','command','120706ADFdcs','read_json','find_files','error','7502190FheCGf'];a7_0x4eb9=function(){return _0x15cfe8;};return a7_0x4eb9();}
1
+ const a7_0x306b19=a7_0x42bd;function a7_0x3dff(){const _0x20751a=['/project','join','chdir','name','text','ready','sendTyping','copy_file','channel','6CYrjnS','input','browser_fill','directory','send_input','parse','startsWith','!status','delete','attachments','/newchat','read_file_lines','branch','match','file_info','get','Changed\x20to:\x20','!cd\x20','search','read_json','open_in_editor','Failed\x20to\x20send\x20file:\x20','rename_file','username','list_directory','system','set','Cleared.','!project','write_json','messageCreate','clipboard_read','Exit:\x20','info','...','88UnRmhn','pattern','/files','reply','body','mentions','getBotToken','grep_recursive','assistant','\x0aModel:\x20','replace_in_files','pid','pids','!newchat','length','send','once','stderr','success','search_file','10781880mkxRnx','[Discord]\x20','args','slice','split','Tool\x20result\x20for\x20','tree','browser_open','Failed:\x20','version','/status','1788410zZpVxW','wait','has','4526838XoPOaW','browser_close','fetch_url','url','\x0aTree:\x0a','\x20bytes)\x20saved\x20to\x20','\x0a```\x0a','user','script','value','GuildMessages','delete_file','github_create_pr','git_add','size','command','528760tbugjI','github_read_file','DirectMessages','run_command','message','tag','content','upload_','git_log','5738WUnhGO','/run\x20','push','!clear','Guilds','MessageContent','replace','owner','\x0aProject:\x20','No\x20output','depth','extensions','git_diff','New\x20chat\x20session\x20started.','path','Saved:\x20','Unknown\x20tool:\x20','head','\x0a```','catch','git_branch','type','author','stringify','../github/api.js','94lbJusQ','patches','guildId','set_env','send_file','browser_screenshot','patch_file','title','git_status','from','cwd','56jxHaDb','entries','.\x20Try\x20again\x20or\x20skip.','selector','../browser/index.js','/clear','output','browser_click','arrayBuffer','base','branchName','[F]','6TTlVTt','[File\x20received:\x20','Channel','terminate','25148KgbvqC','edit_file','data','393323iaReYx','!run\x20','[Discord]\x20Connected\x20as\x20','substring','You\x20are\x20Woozlit\x20AI,\x20an\x20autonomous\x20agent\x20connected\x20via\x20Discord.\x20Complete\x20tasks\x20immediately.\x0a\x0aRULES:\x0a1.\x20Execute\x20tools\x20FIRST,\x20explain\x20NEVER.\x20Be\x20concise.\x0a2.\x20No\x20emojis.\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x0a3.\x20Use\x20tool\x20blocks\x20to\x20execute\x20actions.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait,\x20background}\x0a-\x20read_terminal:\x20{}\x0a-\x20send_input:\x20{input}\x0a-\x20terminate:\x20{}\x0a-\x20create_file:\x20{path,\x20content}\x0a-\x20read_file:\x20{path}\x0a-\x20list_directory:\x20{path}\x0a-\x20edit_file:\x20{path,\x20search,\x20replace}\x0a-\x20delete_file:\x20{path}\x0a-\x20rename_file:\x20{from,\x20to}\x0a-\x20copy_file:\x20{from,\x20to}\x0a-\x20file_info:\x20{path}\x0a-\x20read_file_lines:\x20{path,\x20start,\x20end}\x0a-\x20find_files:\x20{path,\x20pattern}\x0a-\x20search_directory:\x20{path,\x20pattern}\x0a-\x20send_file:\x20{path}\x20-\x20send\x20file\x20to\x20Discord\x0a-\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20fetch_url:\x20{url}\x0a-\x20download_file:\x20{url,\x20path}\x0a-\x20get_env:\x20{name},\x20set_env:\x20{name,\x20value}\x0a-\x20get_system_info:\x20{}\x0a-\x20clipboard_read,\x20clipboard_write:\x20{text}\x0a-\x20tree:\x20{path,\x20depth}\x0a-\x20grep_recursive:\x20{path,\x20pattern}\x0a-\x20replace_in_files:\x20{path,\x20search,\x20replace}\x0a-\x20powershell_run:\x20{script}\x0a-\x20zip_files:\x20{files,\x20output},\x20unzip_files:\x20{path,\x20output}\x0a-\x20write_json:\x20{path,\x20data},\x20read_json:\x20{path}\x0a-\x20patch_file:\x20{path,\x20patches}\x0a-\x20open_in_editor:\x20{path}\x0a-\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_screenshot,\x20browser_snapshot,\x20browser_close\x0a\x0aTOOL\x20FORMAT:\x0a```tool\x0a{\x22name\x22:\x22tool_name\x22,\x22args\x22:{\x22key\x22:\x22value\x22}}\x0a```','!files\x20','stdout','trim','repo','github_create_branch'];a7_0x3dff=function(){return _0x20751a;};return a7_0x3dff();}(function(_0x386f31,_0x5641ee){const _0x3d0bec=a7_0x42bd,_0x2c3d19=_0x386f31();while(!![]){try{const _0x564791=parseInt(_0x3d0bec(0x11b))/0x1*(parseInt(_0x3d0bec(0x134))/0x2)+-parseInt(_0x3d0bec(0xa3))/0x3*(-parseInt(_0x3d0bec(0xa7))/0x4)+parseInt(_0x3d0bec(0xff))/0x5*(-parseInt(_0x3d0bec(0xbd))/0x6)+parseInt(_0x3d0bec(0xaa))/0x7*(parseInt(_0x3d0bec(0x13f))/0x8)+-parseInt(_0x3d0bec(0x102))/0x9+parseInt(_0x3d0bec(0x112))/0xa*(-parseInt(_0x3d0bec(0xe0))/0xb)+parseInt(_0x3d0bec(0xf4))/0xc;if(_0x564791===_0x5641ee)break;else _0x2c3d19['push'](_0x2c3d19['shift']());}catch(_0x5080fe){_0x2c3d19['push'](_0x2c3d19['shift']());}}}(a7_0x3dff,0x46e61));function a7_0x42bd(_0x521f8d,_0x34812e){_0x521f8d=_0x521f8d-0xa0;const _0x3dfff7=a7_0x3dff();let _0x42bdb3=_0x3dfff7[_0x521f8d];return _0x42bdb3;}import{Client,GatewayIntentBits,ChannelType,Partials,AttachmentBuilder}from'discord.js';import{join,resolve,basename}from'path';import*as a7_0x3f22f4 from'./config.js';import*as a7_0x52a934 from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess,deleteFile,renameFile,copyFile,fileInfo,readFileLines,findFiles,searchDirectory}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile as a7_0x1c493b}from'../tools/network.js';import{getEnv,setEnv,getSystemInfo,clipboardRead,clipboardWrite}from'../tools/system.js';import{tree,grepRecursive,replaceInFiles,openInEditor,zipFiles,unzipFiles,writeJson,readJson,patchFile,powershellRun}from'../tools/project.js';import{registerDiscordClient}from'../services/notifications.js';let client=null,isRunning=![];const chatHistories=new Map(),SYSTEM_PROMPT=a7_0x306b19(0xae);async function executeToolCall(_0x5545f6,_0x4fc17d,_0x3f590f){const _0x79e12d=a7_0x306b19;switch(_0x5545f6){case _0x79e12d(0x115):{const _0xe0758c=await runCommand(_0x4fc17d[_0x79e12d(0x111)],undefined,_0x4fc17d['background']||![],_0x4fc17d[_0x79e12d(0x100)]||0x7530);return _0xe0758c;}case'read_terminal':return readTerminalOutput(_0x4fc17d[_0x79e12d(0xeb)]);case _0x79e12d(0xc1):return sendTerminalInput(_0x4fc17d[_0x79e12d(0xbe)],_0x4fc17d['pid']);case _0x79e12d(0xa6):return terminateProcess(_0x4fc17d[_0x79e12d(0xeb)]);case'create_file':return createFile(_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d[_0x79e12d(0x118)]);case'read_file':return readFile(_0x4fc17d['path']);case _0x79e12d(0xd5):return listDirectory(_0x4fc17d[_0x79e12d(0x129)]||'.');case _0x79e12d(0xa8):return editFile(_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d['search'],_0x4fc17d[_0x79e12d(0x121)]);case _0x79e12d(0xf3):return searchFile(_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d[_0x79e12d(0xe1)]);case _0x79e12d(0x10d):return deleteFile(_0x4fc17d[_0x79e12d(0x129)]);case _0x79e12d(0xd3):return renameFile(_0x4fc17d[_0x79e12d(0x13d)]||_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d['to']);case _0x79e12d(0xbb):return copyFile(_0x4fc17d['from']||_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d['to']);case _0x79e12d(0xcb):return fileInfo(_0x4fc17d['path']);case _0x79e12d(0xc8):return readFileLines(_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d['start']||0x1,_0x4fc17d['end']||0x32);case'find_files':return findFiles(_0x4fc17d['path']||'.',_0x4fc17d[_0x79e12d(0xe1)]);case'search_directory':return searchDirectory(_0x4fc17d['path']||'.',_0x4fc17d[_0x79e12d(0xe1)]);case _0x79e12d(0x138):{try{const _0x5a553d=resolve(process[_0x79e12d(0x13e)](),_0x4fc17d[_0x79e12d(0x129)]);return await _0x3f590f('__Sending\x20file:\x20'+basename(_0x5a553d)+'__'),{'success':!![],'sent':!![],'note':'File\x20will\x20be\x20attached\x20separately'};}catch(_0x4188a0){return{'error':_0x79e12d(0xd2)+_0x4188a0};}}case _0x79e12d(0x13c):return gitStatus();case _0x79e12d(0x127):return gitDiff(_0x4fc17d[_0x79e12d(0x129)]);case _0x79e12d(0x11a):return gitLog(_0x4fc17d['count']||0xa);case _0x79e12d(0x10f):return gitAdd(_0x4fc17d[_0x79e12d(0x129)]||'.');case'git_commit':return gitCommit(_0x4fc17d[_0x79e12d(0x116)]);case _0x79e12d(0x12f):return gitBranch();case _0x79e12d(0x104):return fetchUrl(_0x4fc17d[_0x79e12d(0x105)]);case'download_file':return a7_0x1c493b(_0x4fc17d[_0x79e12d(0x105)],_0x4fc17d[_0x79e12d(0x129)]);case'get_env':return getEnv(_0x4fc17d[_0x79e12d(0xb7)]);case _0x79e12d(0x137):return setEnv(_0x4fc17d[_0x79e12d(0xb7)],_0x4fc17d['value']);case'get_system_info':return getSystemInfo();case _0x79e12d(0xdc):return clipboardRead();case'clipboard_write':return clipboardWrite(_0x4fc17d[_0x79e12d(0xb8)]);case _0x79e12d(0xfa):return tree(_0x4fc17d[_0x79e12d(0x129)]||'.',_0x4fc17d[_0x79e12d(0x125)]||0x3);case _0x79e12d(0xe7):return grepRecursive(_0x4fc17d[_0x79e12d(0x129)]||'.',_0x4fc17d[_0x79e12d(0xe1)],_0x4fc17d[_0x79e12d(0x126)]);case _0x79e12d(0xea):return replaceInFiles(_0x4fc17d[_0x79e12d(0x129)]||'.',_0x4fc17d[_0x79e12d(0xcf)],_0x4fc17d['replace'],_0x4fc17d['extensions']);case'powershell_run':return powershellRun(_0x4fc17d[_0x79e12d(0x10a)]||_0x4fc17d['command']);case'zip_files':return zipFiles(_0x4fc17d['files']||[_0x4fc17d[_0x79e12d(0x129)]],_0x4fc17d[_0x79e12d(0x145)]||'archive.zip');case'unzip_files':return unzipFiles(_0x4fc17d['path'],_0x4fc17d[_0x79e12d(0x145)]||'.');case _0x79e12d(0xda):return writeJson(_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d['data']);case _0x79e12d(0xd0):return readJson(_0x4fc17d[_0x79e12d(0x129)]);case _0x79e12d(0x13a):return patchFile(_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d[_0x79e12d(0x135)]);case _0x79e12d(0xd1):return openInEditor(_0x4fc17d[_0x79e12d(0x129)]);case _0x79e12d(0x113):{const {readFile:_0x5a692c}=await import(_0x79e12d(0x133));return _0x5a692c(_0x4fc17d[_0x79e12d(0x122)],_0x4fc17d['repo'],_0x4fc17d[_0x79e12d(0x129)],_0x4fc17d[_0x79e12d(0xc9)]);}case _0x79e12d(0xb3):{const {createBranch:_0x2e371c}=await import('../github/api.js');return _0x2e371c(_0x4fc17d[_0x79e12d(0x122)],_0x4fc17d[_0x79e12d(0xb2)],_0x4fc17d[_0x79e12d(0xa1)],_0x4fc17d['fromBranch']);}case _0x79e12d(0x10e):{const {createPullRequest:_0x348232}=await import('../github/api.js');return _0x348232(_0x4fc17d[_0x79e12d(0x122)],_0x4fc17d[_0x79e12d(0xb2)],_0x4fc17d[_0x79e12d(0x13b)],_0x4fc17d[_0x79e12d(0x12c)],_0x4fc17d[_0x79e12d(0xa0)],_0x4fc17d[_0x79e12d(0xe4)]);}case _0x79e12d(0xfb):{const {browserOpen:_0x47069e,startBrowserServer:_0x41dd6d,isBrowserServerRunning:_0x28b496}=await import('../browser/index.js');if(!_0x28b496())await _0x41dd6d();return _0x47069e(_0x4fc17d[_0x79e12d(0x105)]);}case _0x79e12d(0x146):{const {browserClick:_0x27e9c6}=await import(_0x79e12d(0x143));return _0x27e9c6(_0x4fc17d['selector']);}case _0x79e12d(0xbf):{const {browserFill:_0x6c5db7}=await import(_0x79e12d(0x143));return _0x6c5db7(_0x4fc17d[_0x79e12d(0x142)],_0x4fc17d[_0x79e12d(0x10b)]);}case'browser_snapshot':{const {browserSnapshot:_0x464814}=await import('../browser/index.js');return _0x464814();}case _0x79e12d(0x139):{const {browserScreenshot:_0x2986af}=await import(_0x79e12d(0x143));return _0x2986af();}case _0x79e12d(0x103):{const {browserClose:_0x412f0d}=await import('../browser/index.js');return _0x412f0d();}default:return{'error':_0x79e12d(0x12b)+_0x5545f6};}}async function processDiscordAgentLoop(_0x143c08,_0xd83f7b,_0x27eb11,_0x51db0d){const _0x2de6bc=a7_0x306b19;let _0x1202bb=0x0;const _0x29d2f3=0x14;while(_0x1202bb<_0x29d2f3){_0x1202bb++;let _0x5d60c0='';try{const _0x51bdcf=await sendChatMessage(_0xd83f7b,_0x143c08,_0x33feea=>{_0x5d60c0+=_0x33feea;});_0x5d60c0=_0x51bdcf[_0x2de6bc(0x118)];}catch(_0x50c86b){await _0x27eb11(_0x2de6bc(0xfc)+(_0x50c86b[_0x2de6bc(0x116)]?.['substring'](0x0,0x64)||'Error'));return;}_0x143c08[_0x2de6bc(0x11d)]({'role':_0x2de6bc(0xe8),'content':_0x5d60c0});let _0x1b9f41=_0x5d60c0['match'](/```tool\s*([\s\S]*?)```/);if(!_0x1b9f41)_0x1b9f41=_0x5d60c0[_0x2de6bc(0xca)](/\*\*\*tool\s*([\s\S]*?)\*\*\*/);if(!_0x1b9f41)_0x1b9f41=_0x5d60c0[_0x2de6bc(0xca)](/```json\s*({[\s\S]*?"name"[\s\S]*?})\s*```/);if(!_0x1b9f41){let _0x179da6=_0x5d60c0[_0x2de6bc(0x121)](/<reasoning>[\s\S]*?<\/reasoning>/g,'')['replace'](/<text>|<\/text>/g,'')[_0x2de6bc(0x121)](/```tool[\s\S]*?```/g,'')[_0x2de6bc(0x121)](/\*\*\*tool[\s\S]*?\*\*\*/g,'')[_0x2de6bc(0x121)](/#{1,6}\s*/g,'')[_0x2de6bc(0xb1)]();if(_0x179da6){if(_0x179da6['length']>0x7d0){const _0x3977fe=_0x179da6[_0x2de6bc(0xca)](/[\s\S]{1,2000}/g)||[];for(const _0x56f29c of _0x3977fe)await _0x27eb11(_0x56f29c);}else await _0x27eb11(_0x179da6);}break;}try{const _0x46ae32=JSON[_0x2de6bc(0xc2)](_0x1b9f41[0x1]['trim']());a7_0x52a934[_0x2de6bc(0xde)]('[Discord]\x20Tool:\x20'+_0x46ae32['name']);const _0x5c4779=await executeToolCall(_0x46ae32[_0x2de6bc(0xb7)],_0x46ae32[_0x2de6bc(0xf6)],_0x27eb11);_0x46ae32['name']===_0x2de6bc(0x138)&&_0x46ae32[_0x2de6bc(0xf6)][_0x2de6bc(0x129)]&&await _0x51db0d(resolve(process[_0x2de6bc(0x13e)](),_0x46ae32[_0x2de6bc(0xf6)]['path'])),_0x143c08[_0x2de6bc(0x11d)]({'role':_0x2de6bc(0x109),'content':_0x2de6bc(0xf9)+_0x46ae32[_0x2de6bc(0xb7)]+':\x0a'+JSON[_0x2de6bc(0x132)](_0x5c4779,null,0x2)}),await new Promise(_0x5da042=>setTimeout(_0x5da042,0xc8));}catch(_0x5b3cb7){_0x143c08['push']({'role':_0x2de6bc(0x109),'content':'Tool\x20error:\x20'+_0x5b3cb7+_0x2de6bc(0x141)});}}}function getOrCreateHistory(_0x4646ce){const _0x102756=a7_0x306b19;return!chatHistories[_0x102756(0x101)](_0x4646ce)&&chatHistories[_0x102756(0xd7)](_0x4646ce,[{'role':_0x102756(0xd6),'content':SYSTEM_PROMPT}]),chatHistories[_0x102756(0xcc)](_0x4646ce);}export async function startBot(){const _0x4170cd=a7_0x306b19,_0x3326c7=a7_0x3f22f4[_0x4170cd(0xe6)]();if(!_0x3326c7)return![];if(isRunning)return!![];try{return client=new Client({'intents':[GatewayIntentBits[_0x4170cd(0x11f)],GatewayIntentBits[_0x4170cd(0x10c)],GatewayIntentBits[_0x4170cd(0x120)],GatewayIntentBits[_0x4170cd(0x114)]],'partials':[Partials[_0x4170cd(0xa5)]]}),client[_0x4170cd(0xf0)](_0x4170cd(0xb9),()=>{const _0x484107=_0x4170cd;a7_0x52a934[_0x484107(0xf2)](_0x484107(0xac)+client?.[_0x484107(0x109)]?.[_0x484107(0x117)]),isRunning=!![];if(client)registerDiscordClient(client);}),client['on'](_0x4170cd(0xdb),async _0x47101b=>{const _0x4eb7a5=_0x4170cd;if(_0x47101b[_0x4eb7a5(0x131)]['bot'])return;const _0x3e82e1=_0x47101b[_0x4eb7a5(0xbc)][_0x4eb7a5(0x130)]===ChannelType['DM'],_0x3c424a=client?.['user']&&_0x47101b[_0x4eb7a5(0xe5)][_0x4eb7a5(0x101)](client[_0x4eb7a5(0x109)]);if(!_0x3e82e1&&!_0x3c424a)return;const _0x39392d=_0x47101b['content'][_0x4eb7a5(0x121)](/<@!?[0-9]+>/g,'')[_0x4eb7a5(0xb1)](),_0x1c948e=_0x47101b[_0x4eb7a5(0x131)]['id'],_0x436dde=(_0x47101b[_0x4eb7a5(0x136)]||'dm')+'-'+_0x47101b['channelId']+'-'+_0x1c948e,_0x5cdbf1=async _0x33d90e=>{const _0x53be32=_0x4eb7a5;await _0x47101b[_0x53be32(0xbc)][_0x53be32(0xef)](_0x33d90e)[_0x53be32(0x12e)](()=>{});},_0x17ba4b=async _0x2ba4b7=>{const _0x41a038=_0x4eb7a5;try{const _0xdbb13c=new AttachmentBuilder(_0x2ba4b7);await _0x47101b[_0x41a038(0xbc)][_0x41a038(0xef)]({'files':[_0xdbb13c]});}catch{}};if(_0x39392d===_0x4eb7a5(0xc7)||_0x39392d===_0x4eb7a5(0xed)){chatHistories[_0x4eb7a5(0xc5)](_0x436dde),await _0x47101b[_0x4eb7a5(0xe3)](_0x4eb7a5(0x128));return;}if(_0x39392d===_0x4eb7a5(0x144)||_0x39392d===_0x4eb7a5(0x11e)){chatHistories[_0x4eb7a5(0xc5)](_0x436dde),await _0x47101b[_0x4eb7a5(0xe3)](_0x4eb7a5(0xd8));return;}if(_0x39392d===_0x4eb7a5(0xfe)||_0x39392d===_0x4eb7a5(0xc4)){const _0x135c39=readTerminalOutput(),_0x41cea6=_0x135c39[_0x4eb7a5(0xec)][_0x4eb7a5(0xee)]>0x0?'\x0aProcesses:\x20'+_0x135c39[_0x4eb7a5(0xec)][_0x4eb7a5(0xb5)](',\x20'):'';await _0x47101b['reply']('Dir:\x20'+process[_0x4eb7a5(0x13e)]()+_0x4eb7a5(0xe9)+getSelectedModel()+_0x41cea6);return;}if(_0x39392d===_0x4eb7a5(0xb4)||_0x39392d===_0x4eb7a5(0xd9)){const _0x4c94d5=gitStatus(),_0x3c1b36=tree('.',0x2),_0x4a477b=readJson('package.json');let _0x2896a6='Dir:\x20'+process[_0x4eb7a5(0x13e)]()+'\x0aModel:\x20'+getSelectedModel()+'\x0a';if(_0x4a477b['success']&&_0x4a477b[_0x4eb7a5(0xa9)]){const _0x40c311=_0x4a477b['data'];_0x2896a6+=_0x4eb7a5(0x123)+(_0x40c311[_0x4eb7a5(0xb7)]||'?')+'\x20v'+(_0x40c311[_0x4eb7a5(0xfd)]||'?')+'\x0a';}if(_0x4c94d5['success'])_0x2896a6+='\x0aGit:\x20'+(_0x4c94d5['output']||'Clean')+'\x0a';_0x3c1b36['success']&&_0x3c1b36['tree']&&(_0x2896a6+=_0x4eb7a5(0x106)+_0x3c1b36['tree'][_0x4eb7a5(0xf8)]('\x0a')['slice'](0x0,0xf)[_0x4eb7a5(0xb5)]('\x0a'));if(_0x2896a6[_0x4eb7a5(0xee)]>0x7d0)_0x2896a6=_0x2896a6[_0x4eb7a5(0xad)](0x0,0x7cd)+_0x4eb7a5(0xdf);await _0x47101b['reply'](_0x2896a6);return;}if(_0x39392d[_0x4eb7a5(0xc3)]('/files\x20')||_0x39392d[_0x4eb7a5(0xc3)](_0x4eb7a5(0xaf))||_0x39392d===_0x4eb7a5(0xe2)||_0x39392d==='!files'){const _0x3b66b3=_0x39392d['replace'](/^[!/]files\s*/,'')[_0x4eb7a5(0xb1)]()||'.',_0x164fdf=listDirectory(_0x3b66b3);if(_0x164fdf[_0x4eb7a5(0xf2)]&&_0x164fdf['entries']){const _0x5c6829=_0x164fdf[_0x4eb7a5(0x140)][_0x4eb7a5(0xf7)](0x0,0x1e)['map'](_0xaefe8b=>{const _0x48807a=_0x4eb7a5,_0x31396b=_0xaefe8b['type']===_0x48807a(0xc0)?'[D]':_0x48807a(0xa2);return _0x31396b+'\x20'+_0xaefe8b[_0x48807a(0xb7)];})[_0x4eb7a5(0xb5)]('\x0a');await _0x47101b[_0x4eb7a5(0xe3)](_0x3b66b3+':\x0a\x0a'+_0x5c6829);}else await _0x47101b[_0x4eb7a5(0xe3)](_0x164fdf[_0x4eb7a5(0x116)]);return;}if(_0x39392d[_0x4eb7a5(0xc3)](_0x4eb7a5(0x11c))||_0x39392d[_0x4eb7a5(0xc3)](_0x4eb7a5(0xab))){const _0x58333c=_0x39392d['replace'](/^[!/]run\s+/,'')[_0x4eb7a5(0xb1)]();if(!_0x58333c){await _0x47101b[_0x4eb7a5(0xe3)]('Usage:\x20/run\x20<command>');return;}await _0x47101b[_0x4eb7a5(0xbc)][_0x4eb7a5(0xba)]()['catch'](()=>{});const _0x22ee0f=await runCommand(_0x58333c,undefined,![],0x7530),_0x5a15db=(_0x22ee0f[_0x4eb7a5(0xb0)]||_0x22ee0f[_0x4eb7a5(0xf1)]||_0x4eb7a5(0x124))['substring'](0x0,0x76c);await _0x47101b['reply'](_0x4eb7a5(0xdd)+_0x22ee0f['exitCode']+_0x4eb7a5(0x108)+_0x5a15db+_0x4eb7a5(0x12d));return;}if(_0x39392d[_0x4eb7a5(0xc3)]('/cd\x20')||_0x39392d['startsWith'](_0x4eb7a5(0xce))){const _0x2527f4=_0x39392d[_0x4eb7a5(0x121)](/^[!/]cd\s+/,'')[_0x4eb7a5(0xb1)]();try{process[_0x4eb7a5(0xb6)](resolve(process[_0x4eb7a5(0x13e)](),_0x2527f4)),await _0x47101b[_0x4eb7a5(0xe3)](_0x4eb7a5(0xcd)+process[_0x4eb7a5(0x13e)]());}catch(_0xa1ca81){await _0x47101b['reply']('Failed:\x20'+_0xa1ca81);}return;}if(!_0x39392d)return;await _0x47101b[_0x4eb7a5(0xbc)][_0x4eb7a5(0xba)]()['catch'](()=>{});const _0x2355c6=getOrCreateHistory(_0x436dde);_0x2355c6[_0x4eb7a5(0x11d)]({'role':_0x4eb7a5(0x109),'content':_0x39392d}),a7_0x52a934[_0x4eb7a5(0xde)](_0x4eb7a5(0xf5)+_0x47101b[_0x4eb7a5(0x131)][_0x4eb7a5(0xd4)]+':\x20'+_0x39392d),await processDiscordAgentLoop(_0x2355c6,getSelectedModel(),_0x5cdbf1,_0x17ba4b);if(_0x47101b['attachments'][_0x4eb7a5(0x110)]>0x0)for(const [,_0x58a35f]of _0x47101b[_0x4eb7a5(0xc6)]){try{const _0x1203c4=await fetch(_0x58a35f[_0x4eb7a5(0x105)]),_0x3b518b=Buffer[_0x4eb7a5(0x13d)](await _0x1203c4[_0x4eb7a5(0x147)]()),_0x44be59=join(process[_0x4eb7a5(0x13e)](),_0x58a35f[_0x4eb7a5(0xb7)]||_0x4eb7a5(0x119)+Date['now']()),{writeFileSync:_0x46a15f}=await import('fs');_0x46a15f(_0x44be59,_0x3b518b),_0x2355c6['push']({'role':'user','content':_0x4eb7a5(0xa4)+_0x58a35f[_0x4eb7a5(0xb7)]+'\x20('+_0x3b518b['length']+_0x4eb7a5(0x107)+_0x44be59+']'}),await _0x47101b['reply'](_0x4eb7a5(0x12a)+_0x58a35f[_0x4eb7a5(0xb7)]);}catch{}}}),await client['login'](_0x3326c7),!![];}catch(_0x2c354c){return a7_0x52a934['error']('[Discord]\x20Failed\x20to\x20start:\x20'+_0x2c354c[_0x4170cd(0x116)]),![];}}export function stopBot(){client&&(client['destroy'](),client=null),isRunning=![];}export function isBotRunning(){return isRunning;}