woozlit 2.0.0 → 2.0.2

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 (81) hide show
  1. package/README.md +30 -111
  2. package/dist/auth/login.js +1 -1
  3. package/dist/browser/index.d.ts +78 -0
  4. package/dist/browser/index.js +1 -0
  5. package/dist/browser/server.d.ts +13 -0
  6. package/dist/browser/server.js +1 -0
  7. package/dist/browser/tools.d.ts +13 -0
  8. package/dist/browser/tools.js +1 -0
  9. package/dist/chat/agent.js +1 -1
  10. package/dist/config/mcp.js +1 -1
  11. package/dist/config/settings.js +1 -1
  12. package/dist/discord/client.d.ts +3 -0
  13. package/dist/discord/client.js +1 -0
  14. package/dist/discord/config.d.ts +5 -0
  15. package/dist/discord/config.js +1 -0
  16. package/dist/discord/index.d.ts +3 -0
  17. package/dist/discord/index.js +1 -0
  18. package/dist/discord/setup.d.ts +1 -0
  19. package/dist/discord/setup.js +1 -0
  20. package/dist/email/config.d.ts +31 -0
  21. package/dist/email/config.js +1 -0
  22. package/dist/email/index.d.ts +3 -0
  23. package/dist/email/index.js +1 -0
  24. package/dist/email/service.d.ts +4 -0
  25. package/dist/email/service.js +1 -0
  26. package/dist/email/setup.d.ts +1 -0
  27. package/dist/email/setup.js +1 -0
  28. package/dist/github/api.d.ts +25 -0
  29. package/dist/github/api.js +1 -0
  30. package/dist/github/auth.d.ts +4 -0
  31. package/dist/github/auth.js +1 -0
  32. package/dist/github/auto-setup.d.ts +1 -0
  33. package/dist/github/auto-setup.js +1 -0
  34. package/dist/github/index.d.ts +1 -0
  35. package/dist/github/index.js +1 -0
  36. package/dist/github/manual-setup.d.ts +1 -0
  37. package/dist/github/manual-setup.js +1 -0
  38. package/dist/index.js +1 -1
  39. package/dist/mcp-servers/computer-use.js +1 -1
  40. package/dist/services/bot-manager.d.ts +13 -0
  41. package/dist/services/bot-manager.js +1 -0
  42. package/dist/services/voice-agent.d.ts +6 -0
  43. package/dist/services/voice-agent.js +1 -0
  44. package/dist/telegram/bot.js +1 -1
  45. package/dist/telegram/config.js +1 -1
  46. package/dist/telegram/index.d.ts +1 -0
  47. package/dist/telegram/index.js +1 -1
  48. package/dist/telegram/reminders.d.ts +11 -0
  49. package/dist/telegram/reminders.js +1 -0
  50. package/dist/telegram/setup.d.ts +1 -0
  51. package/dist/telegram/setup.js +1 -0
  52. package/dist/tools/command.js +1 -1
  53. package/dist/tools/file.js +1 -1
  54. package/dist/tools/index.d.ts +1 -0
  55. package/dist/tools/index.js +1 -1
  56. package/dist/tools/mcp.js +1 -1
  57. package/dist/tools/rollback.js +1 -1
  58. package/dist/tools/rules.js +1 -1
  59. package/dist/twilio/config.d.ts +11 -0
  60. package/dist/twilio/config.js +1 -0
  61. package/dist/twilio/index.d.ts +3 -0
  62. package/dist/twilio/index.js +1 -0
  63. package/dist/twilio/server.d.ts +5 -0
  64. package/dist/twilio/server.js +1 -0
  65. package/dist/twilio/setup.d.ts +1 -0
  66. package/dist/twilio/setup.js +1 -0
  67. package/dist/ui/output.d.ts +2 -2
  68. package/dist/ui/output.js +1 -1
  69. package/dist/ui/select.js +1 -1
  70. package/dist/ui/themes.d.ts +12 -0
  71. package/dist/ui/themes.js +1 -0
  72. package/dist/utils/api.js +1 -1
  73. package/dist/utils/history.js +1 -1
  74. package/dist/utils/mcp-installer.js +1 -1
  75. package/dist/utils/platform.js +1 -1
  76. package/dist/utils/storage.d.ts +3 -0
  77. package/dist/utils/storage.js +1 -1
  78. package/dist/utils/update-check.js +1 -1
  79. package/dist/verify_repro.d.ts +4 -0
  80. package/dist/verify_repro.js +1 -0
  81. package/package.json +21 -10
@@ -0,0 +1 @@
1
+ (function(_0x1e7d7a,_0x41f91d){var _0x4112d8=a9_0x5ac0,_0x32b594=_0x1e7d7a();while(!![]){try{var _0x319f81=parseInt(_0x4112d8(0xd4))/0x1+parseInt(_0x4112d8(0xdb))/0x2+parseInt(_0x4112d8(0xda))/0x3+-parseInt(_0x4112d8(0xd7))/0x4*(parseInt(_0x4112d8(0xd8))/0x5)+-parseInt(_0x4112d8(0xd5))/0x6+-parseInt(_0x4112d8(0xd6))/0x7+-parseInt(_0x4112d8(0xd9))/0x8*(-parseInt(_0x4112d8(0xd3))/0x9);if(_0x319f81===_0x41f91d)break;else _0x32b594['push'](_0x32b594['shift']());}catch(_0xcea687){_0x32b594['push'](_0x32b594['shift']());}}}(a9_0x4d38,0x7d56f));function a9_0x5ac0(_0x51fc3a,_0x561aa3){_0x51fc3a=_0x51fc3a-0xd3;var _0x4d3854=a9_0x4d38();var _0x5ac0d8=_0x4d3854[_0x51fc3a];return _0x5ac0d8;}export*from'./config.js';export{startBot,stopBot,isBotRunning}from'./client.js';export{setupDiscord}from'./setup.js';function a9_0x4d38(){var _0xbbb3e0=['9EkYZaO','305099eyCFwE','3682056FRhpTK','3020675Fvzrwn','14156jCZVcL','1315HSBjqv','12205784ZcVDQs','588216bScAHd','924910yPhRjD'];a9_0x4d38=function(){return _0xbbb3e0;};return a9_0x4d38();}
@@ -0,0 +1 @@
1
+ export declare function setupDiscord(): Promise<void>;
@@ -0,0 +1 @@
1
+ (function(_0x3e8536,_0x1a4281){const _0x4a707e=a10_0x5bf3,_0x477733=_0x3e8536();while(!![]){try{const _0xefaf1a=parseInt(_0x4a707e(0x1a8))/0x1*(parseInt(_0x4a707e(0x19e))/0x2)+parseInt(_0x4a707e(0x1a3))/0x3*(parseInt(_0x4a707e(0x1a0))/0x4)+parseInt(_0x4a707e(0x19b))/0x5+-parseInt(_0x4a707e(0x1a9))/0x6*(-parseInt(_0x4a707e(0x1a6))/0x7)+parseInt(_0x4a707e(0x1a4))/0x8+-parseInt(_0x4a707e(0x199))/0x9+-parseInt(_0x4a707e(0x1a5))/0xa*(parseInt(_0x4a707e(0x19d))/0xb);if(_0xefaf1a===_0x1a4281)break;else _0x477733['push'](_0x477733['shift']());}catch(_0x4a18da){_0x477733['push'](_0x477733['shift']());}}}(a10_0xd646,0x68b4a));import{input}from'@inquirer/prompts';import*as a10_0x2be7e8 from'./config.js';import*as a10_0x34e2c3 from'../ui/output.js';function a10_0x5bf3(_0x5027ae,_0x1a39f6){_0x5027ae=_0x5027ae-0x199;const _0xd64608=a10_0xd646();let _0x5bf311=_0xd64608[_0x5027ae];return _0x5bf311;}export async function setupDiscord(){const _0x4d8a61=a10_0x5bf3;a10_0x34e2c3[_0x4d8a61(0x19f)](_0x4d8a61(0x1a2)),a10_0x34e2c3['dim'](_0x4d8a61(0x19a));const _0x4cabba=await input({'message':_0x4d8a61(0x19c),'validate':_0x4c0b8b=>_0x4c0b8b['length']>0xa?!![]:'Token\x20seems\x20too\x20short'}),_0x4c9be8=await input({'message':_0x4d8a61(0x1a7),'default':'!'});a10_0x2be7e8['setBotToken'](_0x4cabba),a10_0x34e2c3[_0x4d8a61(0x1aa)](_0x4d8a61(0x1a1)),a10_0x34e2c3[_0x4d8a61(0x19f)]('Restart\x20the\x20CLI\x20to\x20start\x20the\x20Discord\x20Bot.');}function a10_0xd646(){const _0x3e81c3=['Setup\x20Woozlit\x20Discord\x20Bot','22164AcVrcY','1819120eLQPxi','100IYknEy','133AythSH','Command\x20Prefix\x20(optional,\x20default\x20\x27!\x27):','31163nZasgM','85644vEWLgF','success','2518524JCasyt','You\x20need\x20a\x20Bot\x20Token\x20from\x20the\x20Discord\x20Developer\x20Portal.','379975aUDHmo','Bot\x20Token:','733403ymInOU','22KeOeHh','info','248bugUjK','Discord\x20configuration\x20saved!'];a10_0xd646=function(){return _0x3e81c3;};return a10_0xd646();}
@@ -0,0 +1,31 @@
1
+ export declare function setCredentials(user: string, pass: string, host?: string, port?: number): void;
2
+ export declare function getConfig(): {
3
+ imap: {
4
+ user: string;
5
+ password: string;
6
+ host: string;
7
+ port: number;
8
+ tls: boolean;
9
+ tlsOptions: {
10
+ rejectUnauthorized: boolean;
11
+ };
12
+ authTimeout: number;
13
+ };
14
+ smtp: {
15
+ host: string;
16
+ port: number;
17
+ auth: {
18
+ user: string;
19
+ pass: string;
20
+ };
21
+ tls: {
22
+ rejectUnauthorized: boolean;
23
+ };
24
+ };
25
+ interval: number;
26
+ allowedSenders: string[];
27
+ enabled: boolean;
28
+ };
29
+ export declare function isConfigured(): boolean;
30
+ export declare function setEnabled(val: boolean): void;
31
+ export declare function addAllowedSender(email: string): void;
@@ -0,0 +1 @@
1
+ const a11_0x44fafd=a11_0x2c05;function a11_0x2c05(_0x4c6346,_0x19e01a){_0x4c6346=_0x4c6346-0x1b4;const _0x5e6410=a11_0x5e64();let _0x2c0504=_0x5e6410[_0x4c6346];return _0x2c0504;}(function(_0x2481cf,_0x3f1fbb){const _0x6d1485=a11_0x2c05,_0x3c8b64=_0x2481cf();while(!![]){try{const _0x116db9=parseInt(_0x6d1485(0x1db))/0x1+parseInt(_0x6d1485(0x1bc))/0x2*(-parseInt(_0x6d1485(0x1c1))/0x3)+-parseInt(_0x6d1485(0x1c5))/0x4*(parseInt(_0x6d1485(0x1dc))/0x5)+parseInt(_0x6d1485(0x1d4))/0x6+parseInt(_0x6d1485(0x1da))/0x7+-parseInt(_0x6d1485(0x1c9))/0x8*(parseInt(_0x6d1485(0x1d8))/0x9)+-parseInt(_0x6d1485(0x1c4))/0xa*(-parseInt(_0x6d1485(0x1ce))/0xb);if(_0x116db9===_0x3f1fbb)break;else _0x3c8b64['push'](_0x3c8b64['shift']());}catch(_0x212618){_0x3c8b64['push'](_0x3c8b64['shift']());}}}(a11_0x5e64,0xc03db));function a11_0x5e64(){const _0x5ecd14=['imapPass','randomBytes','allowedSenders','6450504zsvmzy','update','get','woozlit-cli-email','createHash','22WkXMSk','sha256','woozlit_email_secure_key','smtp.gmail.com','toString','createCipheriv','999228qPkfcJ','smtpPort','checkInterval','smtpPass','9UrSXpz','digest','20013qdVFfh','1533924fqmMLZ','5QAKWrI','hex','aes-256-cbc','imap.gmail.com','from','createDecipheriv','imap','imapUser','utf8','set','839698lvFaTe','includes','smtpUser','password','enabled','3SVCNzH','final','imapHost','4253190RPajin','2161512ngcBLl'];a11_0x5e64=function(){return _0x5ecd14;};return a11_0x5e64();}import a11_0x3baf40 from'conf';import a11_0x14e9c8 from'crypto';const config=new a11_0x3baf40({'projectName':a11_0x44fafd(0x1cc),'defaults':{'imapHost':a11_0x44fafd(0x1b5),'imapPort':0x3e1,'imapUser':'','imapPass':'','smtpHost':a11_0x44fafd(0x1d1),'smtpPort':0x24b,'smtpUser':'','smtpPass':'','checkInterval':0x5,'allowedSenders':[],'enabled':![]}}),ENCRYPTION_KEY=a11_0x44fafd(0x1d0);function encrypt(_0x3152c5){const _0x1dd9a3=a11_0x44fafd;if(!_0x3152c5)return'';const _0x287c25=a11_0x14e9c8[_0x1dd9a3(0x1c7)](0x10),_0x177535=a11_0x14e9c8[_0x1dd9a3(0x1cd)](_0x1dd9a3(0x1cf))[_0x1dd9a3(0x1ca)](ENCRYPTION_KEY)[_0x1dd9a3(0x1d9)](),_0x2597a1=a11_0x14e9c8[_0x1dd9a3(0x1d3)]('aes-256-cbc',_0x177535,_0x287c25);let _0x3de012=_0x2597a1[_0x1dd9a3(0x1ca)](_0x3152c5,_0x1dd9a3(0x1ba),_0x1dd9a3(0x1dd));return _0x3de012+=_0x2597a1[_0x1dd9a3(0x1c2)]('hex'),_0x287c25[_0x1dd9a3(0x1d2)](_0x1dd9a3(0x1dd))+':'+_0x3de012;}function decrypt(_0x25446b){const _0x3dae67=a11_0x44fafd;if(!_0x25446b)return'';try{const [_0x18639e,_0x513097]=_0x25446b['split'](':');if(!_0x18639e||!_0x513097)return'';const _0x39b2a4=Buffer[_0x3dae67(0x1b6)](_0x18639e,'hex'),_0x38c1bf=a11_0x14e9c8[_0x3dae67(0x1cd)](_0x3dae67(0x1cf))[_0x3dae67(0x1ca)](ENCRYPTION_KEY)['digest'](),_0xa23a39=a11_0x14e9c8[_0x3dae67(0x1b7)](_0x3dae67(0x1b4),_0x38c1bf,_0x39b2a4);let _0x16f1b0=_0xa23a39[_0x3dae67(0x1ca)](_0x513097,_0x3dae67(0x1dd),_0x3dae67(0x1ba));return _0x16f1b0+=_0xa23a39[_0x3dae67(0x1c2)](_0x3dae67(0x1ba)),_0x16f1b0;}catch{return'';}}export function setCredentials(_0x48a269,_0x58881f,_0x30e518,_0xb90cb7){const _0x43dfa0=a11_0x44fafd;config[_0x43dfa0(0x1bb)](_0x43dfa0(0x1b9),_0x48a269),config['set'](_0x43dfa0(0x1c6),encrypt(_0x58881f)),config[_0x43dfa0(0x1bb)](_0x43dfa0(0x1be),_0x48a269),config[_0x43dfa0(0x1bb)](_0x43dfa0(0x1d7),encrypt(_0x58881f));if(_0x30e518)config[_0x43dfa0(0x1bb)](_0x43dfa0(0x1c3),_0x30e518);}export function getConfig(){const _0x38f23c=a11_0x44fafd;return{'imap':{'user':config[_0x38f23c(0x1cb)](_0x38f23c(0x1b9)),'password':decrypt(config[_0x38f23c(0x1cb)]('imapPass')),'host':config['get'](_0x38f23c(0x1c3)),'port':config[_0x38f23c(0x1cb)]('imapPort'),'tls':!![],'tlsOptions':{'rejectUnauthorized':![]},'authTimeout':0xbb8},'smtp':{'host':config['get']('smtpHost'),'port':config['get'](_0x38f23c(0x1d5)),'auth':{'user':config[_0x38f23c(0x1cb)](_0x38f23c(0x1be)),'pass':decrypt(config[_0x38f23c(0x1cb)](_0x38f23c(0x1d7)))},'tls':{'rejectUnauthorized':![]}},'interval':config[_0x38f23c(0x1cb)](_0x38f23c(0x1d6)),'allowedSenders':config[_0x38f23c(0x1cb)](_0x38f23c(0x1c8))||[],'enabled':config['get'](_0x38f23c(0x1c0))};}export function isConfigured(){const _0x1a7ef7=a11_0x44fafd,_0xfe615d=getConfig();return!!_0xfe615d['imap']['user']&&!!_0xfe615d[_0x1a7ef7(0x1b8)][_0x1a7ef7(0x1bf)];}export function setEnabled(_0x4dfce5){const _0x51a524=a11_0x44fafd;config['set'](_0x51a524(0x1c0),_0x4dfce5);}export function addAllowedSender(_0x1ff923){const _0x16019e=a11_0x44fafd,_0xbc138d=config[_0x16019e(0x1cb)](_0x16019e(0x1c8))||[];!_0xbc138d[_0x16019e(0x1bd)](_0x1ff923)&&(_0xbc138d['push'](_0x1ff923),config[_0x16019e(0x1bb)](_0x16019e(0x1c8),_0xbc138d));}
@@ -0,0 +1,3 @@
1
+ export * from "./config.js";
2
+ export { startBot, stopBot, isBotRunning } from "./service.js";
3
+ export { setupEmail } from "./setup.js";
@@ -0,0 +1 @@
1
+ function a12_0x847b(){var _0x31c780=['7569xOIpCF','812796xlHGus','1095MhQplS','99WHKhkQ','64kMPwKg','35wNmajn','40637NbMHNp','50ugTBIx','10870OnPEcU','715044NXYBFN','49228166HyVnRP','5272fqGiBY','363797QJoMAX'];a12_0x847b=function(){return _0x31c780;};return a12_0x847b();}(function(_0x3eaa5e,_0x2433f3){var _0x3761a5=a12_0x27f4,_0x4a9295=_0x3eaa5e();while(!![]){try{var _0x18275d=-parseInt(_0x3761a5(0xf1))/0x1*(-parseInt(_0x3761a5(0xf2))/0x2)+-parseInt(_0x3761a5(0xed))/0x3*(-parseInt(_0x3761a5(0xe9))/0x4)+-parseInt(_0x3761a5(0xf0))/0x5*(-parseInt(_0x3761a5(0xec))/0x6)+-parseInt(_0x3761a5(0xea))/0x7*(-parseInt(_0x3761a5(0xef))/0x8)+parseInt(_0x3761a5(0xeb))/0x9*(parseInt(_0x3761a5(0xf3))/0xa)+parseInt(_0x3761a5(0xee))/0xb*(parseInt(_0x3761a5(0xf4))/0xc)+-parseInt(_0x3761a5(0xf5))/0xd;if(_0x18275d===_0x2433f3)break;else _0x4a9295['push'](_0x4a9295['shift']());}catch(_0x3a8822){_0x4a9295['push'](_0x4a9295['shift']());}}}(a12_0x847b,0x80195));export*from'./config.js';function a12_0x27f4(_0x56e2a7,_0x1fd990){_0x56e2a7=_0x56e2a7-0xe9;var _0x847bde=a12_0x847b();var _0x27f4a6=_0x847bde[_0x56e2a7];return _0x27f4a6;}export{startBot,stopBot,isBotRunning}from'./service.js';export{setupEmail}from'./setup.js';
@@ -0,0 +1,4 @@
1
+ export declare function startBot(): Promise<boolean>;
2
+ export declare function stopBot(): void;
3
+ export declare function isBotRunning(): boolean;
4
+ export { isConfigured } from "./config.js";
@@ -0,0 +1 @@
1
+ (function(_0x1affcf,_0x2016b0){const _0x46f4d7=a13_0x5d30,_0x28bc95=_0x1affcf();while(!![]){try{const _0x177120=parseInt(_0x46f4d7(0xaa))/0x1+-parseInt(_0x46f4d7(0xbf))/0x2*(parseInt(_0x46f4d7(0xbe))/0x3)+-parseInt(_0x46f4d7(0xd4))/0x4*(-parseInt(_0x46f4d7(0xa4))/0x5)+-parseInt(_0x46f4d7(0xb9))/0x6*(-parseInt(_0x46f4d7(0xaf))/0x7)+-parseInt(_0x46f4d7(0xc0))/0x8+-parseInt(_0x46f4d7(0xb7))/0x9*(-parseInt(_0x46f4d7(0xc1))/0xa)+parseInt(_0x46f4d7(0xab))/0xb*(parseInt(_0x46f4d7(0xb2))/0xc);if(_0x177120===_0x2016b0)break;else _0x28bc95['push'](_0x28bc95['shift']());}catch(_0x444b17){_0x28bc95['push'](_0x28bc95['shift']());}}}(a13_0x45aa,0xdd815));import a13_0x44459c from'imap-simple';import a13_0x11b6c0 from'nodemailer';import*as a13_0x2990a1 from'./config.js';import*as a13_0x3cb852 from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';let intervalId=null,isRunning=![];async function checkEmails(){const _0x137583=a13_0x5d30,_0xe78ec1=a13_0x2990a1[_0x137583(0xd3)]();try{const _0x33972c=await a13_0x44459c[_0x137583(0xba)]({'imap':_0xe78ec1[_0x137583(0xbb)]});await _0x33972c[_0x137583(0xbc)](_0x137583(0xb3));const _0x3a20d8=[_0x137583(0xd0)],_0x5cc10c={'bodies':['HEADER','TEXT'],'markSeen':!![]},_0x24acf4=await _0x33972c['search'](_0x3a20d8,_0x5cc10c);_0x24acf4[_0x137583(0xb0)]>0x0&&a13_0x3cb852['info'](_0x137583(0xbd)+_0x24acf4[_0x137583(0xb0)]+_0x137583(0xad));for(const _0x1e6a87 of _0x24acf4){const _0x2eb822=_0x1e6a87[_0x137583(0xcb)]['find'](_0xa7084c=>_0xa7084c['which']==='HEADER'),_0x3a086f=_0x2eb822[_0x137583(0xcf)]['from']?.[0x0]||'',_0x451eb4=_0x2eb822['body'][_0x137583(0xa6)]?.[0x0]||_0x137583(0xca);if(_0xe78ec1[_0x137583(0xc5)][_0x137583(0xb0)]>0x0){const _0x2b4fa5=_0x3a086f[_0x137583(0xc3)](/<(.+)>/)?.[0x1]||_0x3a086f;if(!_0xe78ec1[_0x137583(0xc5)][_0x137583(0xc4)](_0x2b4fa5)){a13_0x3cb852[_0x137583(0xb1)](_0x137583(0xd1)+_0x3a086f+_0x137583(0xcd));continue;}}const _0x328eb4=_0x1e6a87[_0x137583(0xcb)]['find'](_0x35a9ab=>_0x35a9ab['which']===_0x137583(0xa8)),_0x37f5e4=_0x328eb4?.[_0x137583(0xcf)]||'';a13_0x3cb852[_0x137583(0xc8)]('[Email]\x20From:\x20'+_0x3a086f+_0x137583(0xb4)+_0x451eb4);try{const _0x83296c=_0x137583(0xae)+_0x3a086f+_0x137583(0xb5)+_0x451eb4+_0x137583(0xac)+_0x37f5e4+'\x0a\x0aDraft\x20a\x20helpful\x20reply.\x20Structure\x20it\x20clearly.',_0x68c34e=await sendChatMessage(getSelectedModel(),[{'role':_0x137583(0xa5),'content':_0x83296c}]),_0x217fec=a13_0x11b6c0['createTransport'](_0xe78ec1[_0x137583(0xb8)]);await _0x217fec[_0x137583(0xd2)]({'from':_0xe78ec1[_0x137583(0xb8)]['auth'][_0x137583(0xa5)],'to':_0x3a086f,'subject':_0x137583(0xc6)+_0x451eb4,'text':_0x68c34e[_0x137583(0xc7)]}),a13_0x3cb852['success'](_0x137583(0xc2)+_0x3a086f);}catch(_0x160104){a13_0x3cb852[_0x137583(0xd5)](_0x137583(0xb6)+_0x160104['message']);}}_0x33972c[_0x137583(0xc9)]();}catch(_0x167b58){}}export async function startBot(){const _0x1679ba=a13_0x5d30;if(!a13_0x2990a1[_0x1679ba(0xcc)]())return![];if(isRunning)return!![];process[_0x1679ba(0xa7)][_0x1679ba(0xa9)]='0',checkEmails();const _0x133d05=a13_0x2990a1[_0x1679ba(0xd3)]()[_0x1679ba(0xce)]||0x5;return intervalId=setInterval(checkEmails,_0x133d05*0x3c*0x3e8),isRunning=!![],!![];}export function stopBot(){intervalId&&(clearInterval(intervalId),intervalId=null),isRunning=![];}export function isBotRunning(){return isRunning;}function a13_0x45aa(){const _0x2f18e6=['1884xnHOzn','error','3735pBMDWQ','user','subject','env','TEXT','NODE_TLS_REJECT_UNAUTHORIZED','237211gWSkAz','302599oFapaq','\x0aBody:\x0a','\x20new\x20messages','You\x20received\x20an\x20email\x20from\x20','7SPiLix','length','dim','1272YZhrwH','INBOX','\x20|\x20Subj:\x20',':\x0aSubject:\x20','[Email]\x20Processing/Reply\x20error:\x20','198mUUAjP','smtp','418890CMiVLk','connect','imap','openBox','[Email]\x20Found\x20','385158wOIOFX','28trovTB','13121552PwqiDa','350030SXrwZp','[Email]\x20Reply\x20sent\x20to\x20','match','includes','allowedSenders','Re:\x20','content','info','end','No\x20Subject','parts','isConfigured','\x20(not\x20allowed)','interval','body','UNSEEN','[Email]\x20Ignored\x20mail\x20from\x20','sendMail','getConfig'];a13_0x45aa=function(){return _0x2f18e6;};return a13_0x45aa();}function a13_0x5d30(_0x338510,_0x22329c){_0x338510=_0x338510-0xa4;const _0x45aaaf=a13_0x45aa();let _0x5d301e=_0x45aaaf[_0x338510];return _0x5d301e;}export{isConfigured}from'./config.js';
@@ -0,0 +1 @@
1
+ export declare function setupEmail(): Promise<void>;
@@ -0,0 +1 @@
1
+ (function(_0x26e903,_0x524b17){const _0x4c672b=a14_0x4360,_0x2d59e5=_0x26e903();while(!![]){try{const _0x1b4b47=-parseInt(_0x4c672b(0x152))/0x1+parseInt(_0x4c672b(0x144))/0x2+parseInt(_0x4c672b(0x148))/0x3+-parseInt(_0x4c672b(0x142))/0x4*(parseInt(_0x4c672b(0x155))/0x5)+-parseInt(_0x4c672b(0x143))/0x6+-parseInt(_0x4c672b(0x149))/0x7+parseInt(_0x4c672b(0x145))/0x8*(parseInt(_0x4c672b(0x14b))/0x9);if(_0x1b4b47===_0x524b17)break;else _0x2d59e5['push'](_0x2d59e5['shift']());}catch(_0x1bf8c5){_0x2d59e5['push'](_0x2d59e5['shift']());}}}(a14_0x5010,0x27361));import{password,input,confirm}from'@inquirer/prompts';function a14_0x4360(_0x3ebd6f,_0x34e044){_0x3ebd6f=_0x3ebd6f-0x13c;const _0x5010c3=a14_0x5010();let _0x436052=_0x5010c3[_0x3ebd6f];return _0x436052;}import*as a14_0x334e12 from'./config.js';import*as a14_0x179815 from'../ui/output.js';export async function setupEmail(){const _0x1ab2f8=a14_0x4360;a14_0x179815['info']('This\x20setup\x20will\x20configure\x20Woozlit\x20to\x20check\x20your\x20email\x20and\x20reply.'),a14_0x179815[_0x1ab2f8(0x13c)](_0x1ab2f8(0x151));const _0x52d2b2=await input({'message':'Email\x20Provider\x20(gmail/outlook/other):','default':'gmail'}),_0x5e0b54=await input({'message':_0x1ab2f8(0x146)}),_0x2cdaf0=await password({'message':_0x1ab2f8(0x13d)});let _0x464f31=_0x1ab2f8(0x13f),_0x3afc13=0x3e1,_0x4d63e7='smtp.gmail.com',_0x2cdaa0=0x24b;if(_0x52d2b2['toLowerCase']()!==_0x1ab2f8(0x14c)){const _0x384417=await confirm({'message':_0x1ab2f8(0x147),'default':![]});if(_0x384417){_0x464f31=await input({'message':_0x1ab2f8(0x153),'default':_0x464f31});const _0x1a69b0=await input({'message':'IMAP\x20Port:','default':_0x1ab2f8(0x140)});_0x3afc13=parseInt(_0x1a69b0),_0x4d63e7=await input({'message':_0x1ab2f8(0x141),'default':_0x4d63e7});const _0x214672=await input({'message':_0x1ab2f8(0x154),'default':'587'});_0x2cdaa0=parseInt(_0x214672);}}a14_0x334e12[_0x1ab2f8(0x14a)](_0x5e0b54,_0x2cdaf0,_0x464f31,_0x3afc13),a14_0x334e12[_0x1ab2f8(0x14d)](!![]);const _0x13dc72=await confirm({'message':_0x1ab2f8(0x14e),'default':!![]});if(_0x13dc72){a14_0x334e12['addAllowedSender'](_0x5e0b54);const _0x4d431c=await input({'message':_0x1ab2f8(0x150)});if(_0x4d431c)a14_0x334e12[_0x1ab2f8(0x156)](_0x4d431c);}a14_0x179815['success'](_0x1ab2f8(0x14f)),a14_0x179815['info'](_0x1ab2f8(0x13e));}function a14_0x5010(){const _0x3b4657=['248208qgzYqn','Email\x20Address:','Configure\x20advanced\x20server\x20settings?','788388RMuVii','1067395CwEmvD','setCredentials','90afoFXr','gmail','setEnabled','Only\x20allow\x20emails\x20from\x20yourself\x20(recommended)?','Email\x20configuration\x20saved!','Your\x20personal\x20email\x20(that\x20you\x20will\x20send\x20FROM):','Use\x20an\x20App\x20Password\x20if\x20you\x20are\x20using\x20Gmail\x20(2FA\x20enabled).','64428ZlLpxM','IMAP\x20Host:','SMTP\x20Port:','5ZYtDsG','addAllowedSender','warn','Password\x20(or\x20App\x20Password):','Restart\x20the\x20CLI\x20to\x20start\x20the\x20Email\x20Agent.','imap.gmail.com','993','SMTP\x20Host:','1133012rUmvcH','807420CZfikw','444578pcqnBL'];a14_0x5010=function(){return _0x3b4657;};return a14_0x5010();}
@@ -0,0 +1,25 @@
1
+ export interface GitHubRepo {
2
+ name: string;
3
+ full_name: string;
4
+ private: boolean;
5
+ description: string | null;
6
+ }
7
+ export interface GitHubPR {
8
+ number: number;
9
+ title: string;
10
+ state: string;
11
+ html_url: string;
12
+ }
13
+ export declare function listRepos(): Promise<GitHubRepo[]>;
14
+ export declare function getRepo(owner: string, repo: string): Promise<GitHubRepo>;
15
+ export declare function readFile(owner: string, repo: string, path: string, branch?: string): Promise<string>;
16
+ export declare function createOrUpdateFile(owner: string, repo: string, path: string, content: string, message: string, branch?: string, sha?: string): Promise<any>;
17
+ export declare function createPullRequest(owner: string, repo: string, title: string, head: string, base?: string, body?: string): Promise<GitHubPR>;
18
+ export declare function listPullRequests(owner: string, repo: string, state?: "open" | "closed" | "all"): Promise<GitHubPR[]>;
19
+ export declare function commentOnPR(owner: string, repo: string, prNumber: number, body: string): Promise<any>;
20
+ export declare function createBranch(owner: string, repo: string, branchName: string, fromBranch?: string): Promise<any>;
21
+ export declare function getAppStatus(): Promise<{
22
+ valid: boolean;
23
+ repoCount: number;
24
+ accountName?: string;
25
+ }>;
@@ -0,0 +1 @@
1
+ const a15_0x3193f7=a15_0x552b;(function(_0x185b73,_0xe3bde8){const _0x2109de=a15_0x552b,_0x14e2af=_0x185b73();while(!![]){try{const _0xfb0404=-parseInt(_0x2109de(0x16b))/0x1*(-parseInt(_0x2109de(0x14e))/0x2)+-parseInt(_0x2109de(0x154))/0x3+parseInt(_0x2109de(0x175))/0x4+parseInt(_0x2109de(0x14f))/0x5+parseInt(_0x2109de(0x16c))/0x6+parseInt(_0x2109de(0x163))/0x7*(parseInt(_0x2109de(0x15f))/0x8)+-parseInt(_0x2109de(0x176))/0x9;if(_0xfb0404===_0xe3bde8)break;else _0x14e2af['push'](_0x14e2af['shift']());}catch(_0x3c4ca4){_0x14e2af['push'](_0x14e2af['shift']());}}}(a15_0x5252,0x3ef54));import{getGitHubToken}from'./auth.js';async function githubRequest(_0x1b2823,_0x5e7033={}){const _0x4e13ec=a15_0x552b,_0x3d65e1=await getGitHubToken();if(!_0x3d65e1)throw new Error(_0x4e13ec(0x16d));const _0xc14fee=await fetch(_0x4e13ec(0x152)+_0x1b2823,{..._0x5e7033,'headers':{'Authorization':'Bearer\x20'+_0x3d65e1,'Accept':_0x4e13ec(0x171),'X-GitHub-Api-Version':'2022-11-28',..._0x5e7033[_0x4e13ec(0x156)]}});if(!_0xc14fee['ok']){const _0x2055cc=await _0xc14fee[_0x4e13ec(0x151)]();throw new Error('GitHub\x20API\x20error:\x20'+_0xc14fee[_0x4e13ec(0x16a)]+'\x20-\x20'+_0x2055cc);}return _0xc14fee[_0x4e13ec(0x155)]();}export async function listRepos(){const _0x131d02=a15_0x552b;return githubRequest(_0x131d02(0x15e));}export async function getRepo(_0x28f04a,_0x5e70d8){const _0x3ea50d=a15_0x552b;return githubRequest(_0x3ea50d(0x167)+_0x28f04a+'/'+_0x5e70d8);}function a15_0x552b(_0x440e2f,_0x4c724c){_0x440e2f=_0x440e2f-0x14e;const _0x5252c4=a15_0x5252();let _0x552b14=_0x5252c4[_0x440e2f];return _0x552b14;}function a15_0x5252(){const _0x37825b=['/git/ref/heads/','from','base64','main','/user/repos?per_page=100&sort=updated','269368IhpIgm','POST','open','owner','56wNmBhQ','/contents/','login','?ref=','/repos/','content','toString','status','2cPDJmG','2863482AZvqaU','Not\x20authenticated\x20with\x20GitHub.\x20Run\x20\x27/github\x20login\x27\x20first.','/comments','/git/refs','/issues/','application/vnd.github+json','GitHub\x20App','object','PUT','19740RyCpld','3803031RWdHop','total_count','47738PwSTTz','1224915KLRiqj','repositories','text','https://api.github.com','stringify','1091508tQfyFl','json','headers','/pulls?state=','&per_page=50','/pulls'];a15_0x5252=function(){return _0x37825b;};return a15_0x5252();}export async function readFile(_0xf2451,_0x3b15d9,_0x25a688,_0x11bdf3=a15_0x3193f7(0x15d)){const _0x583b41=a15_0x3193f7,_0x46650d=await githubRequest('/repos/'+_0xf2451+'/'+_0x3b15d9+'/contents/'+_0x25a688+_0x583b41(0x166)+_0x11bdf3),_0x2a8831=Buffer[_0x583b41(0x15b)](_0x46650d[_0x583b41(0x168)],_0x583b41(0x15c))[_0x583b41(0x169)]('utf-8');return _0x2a8831;}export async function createOrUpdateFile(_0x2f225e,_0x32ceff,_0x33ae81,_0x482c47,_0x1d3da8,_0x6db9d3=a15_0x3193f7(0x15d),_0x36ed7b){const _0x27f906=a15_0x3193f7,_0x5c8fc5=Buffer[_0x27f906(0x15b)](_0x482c47)[_0x27f906(0x169)](_0x27f906(0x15c));return githubRequest(_0x27f906(0x167)+_0x2f225e+'/'+_0x32ceff+_0x27f906(0x164)+_0x33ae81,{'method':_0x27f906(0x174),'body':JSON[_0x27f906(0x153)]({'message':_0x1d3da8,'content':_0x5c8fc5,'branch':_0x6db9d3,..._0x36ed7b&&{'sha':_0x36ed7b}})});}export async function createPullRequest(_0x4c7d86,_0x2361ab,_0x2c27f8,_0xce9ca3,_0x4c3ee9='main',_0x2d1494){const _0xbe4392=a15_0x3193f7;return githubRequest('/repos/'+_0x4c7d86+'/'+_0x2361ab+_0xbe4392(0x159),{'method':_0xbe4392(0x160),'body':JSON[_0xbe4392(0x153)]({'title':_0x2c27f8,'head':_0xce9ca3,'base':_0x4c3ee9,'body':_0x2d1494||''})});}export async function listPullRequests(_0x1c4925,_0x496cd2,_0x47ef8f=a15_0x3193f7(0x161)){const _0x2cc8c2=a15_0x3193f7;return githubRequest(_0x2cc8c2(0x167)+_0x1c4925+'/'+_0x496cd2+_0x2cc8c2(0x157)+_0x47ef8f+_0x2cc8c2(0x158));}export async function commentOnPR(_0x513ec8,_0x4eb4dd,_0x4a9e08,_0x3de50d){const _0x460b41=a15_0x3193f7;return githubRequest('/repos/'+_0x513ec8+'/'+_0x4eb4dd+_0x460b41(0x170)+_0x4a9e08+_0x460b41(0x16e),{'method':'POST','body':JSON[_0x460b41(0x153)]({'body':_0x3de50d})});}export async function createBranch(_0x273c07,_0x495962,_0x1a2dd0,_0xe7b007=a15_0x3193f7(0x15d)){const _0x981bb1=a15_0x3193f7,_0x445aa5=await githubRequest(_0x981bb1(0x167)+_0x273c07+'/'+_0x495962+_0x981bb1(0x15a)+_0xe7b007);return githubRequest(_0x981bb1(0x167)+_0x273c07+'/'+_0x495962+_0x981bb1(0x16f),{'method':_0x981bb1(0x160),'body':JSON[_0x981bb1(0x153)]({'ref':'refs/heads/'+_0x1a2dd0,'sha':_0x445aa5[_0x981bb1(0x173)]['sha']})});}export async function getAppStatus(){const _0x40e522=a15_0x3193f7;try{const _0x14f9b4=await githubRequest('/installation/repositories?per_page=1'),_0x8988a6=_0x14f9b4[_0x40e522(0x177)];let _0xc2d051=_0x40e522(0x172);return _0x14f9b4[_0x40e522(0x150)]&&_0x14f9b4['repositories']['length']>0x0&&(_0xc2d051=_0x14f9b4['repositories'][0x0][_0x40e522(0x162)][_0x40e522(0x165)]),{'valid':!![],'repoCount':_0x8988a6,'accountName':_0xc2d051};}catch(_0x5ac38a){throw _0x5ac38a;}}
@@ -0,0 +1,4 @@
1
+ export declare function getGitHubToken(): Promise<string | null>;
2
+ export declare function isGitHubAuthenticated(): Promise<boolean>;
3
+ export declare function loginGitHub(): Promise<void>;
4
+ export declare function logoutGitHub(): Promise<void>;
@@ -0,0 +1 @@
1
+ const a16_0x2b22d2=a16_0x3c7d;function a16_0x3c7d(_0xb5944a,_0x22c1f8){_0xb5944a=_0xb5944a-0x11b;const _0x38d65b=a16_0x38d6();let _0x3c7d32=_0x38d65b[_0xb5944a];return _0x3c7d32;}(function(_0x11f008,_0x455c4f){const _0x365a64=a16_0x3c7d,_0x20e582=_0x11f008();while(!![]){try{const _0xa647fe=parseInt(_0x365a64(0x12b))/0x1+-parseInt(_0x365a64(0x12d))/0x2*(-parseInt(_0x365a64(0x125))/0x3)+-parseInt(_0x365a64(0x12f))/0x4*(parseInt(_0x365a64(0x131))/0x5)+parseInt(_0x365a64(0x130))/0x6+-parseInt(_0x365a64(0x11d))/0x7+-parseInt(_0x365a64(0x135))/0x8+parseInt(_0x365a64(0x11f))/0x9;if(_0xa647fe===_0x455c4f)break;else _0x20e582['push'](_0x20e582['shift']());}catch(_0x377682){_0x20e582['push'](_0x20e582['shift']());}}}(a16_0x38d6,0xa0be6));import{promises as a16_0x47d1cf}from'fs';import{join}from'path';import{createAppAuth}from'@octokit/auth-app';import{homedir}from'os';const GLOBAL_CONFIG_DIR=join(homedir(),a16_0x2b22d2(0x122)),CONFIG_FILE=join(GLOBAL_CONFIG_DIR,a16_0x2b22d2(0x124)),KEY_FILE=join(GLOBAL_CONFIG_DIR,a16_0x2b22d2(0x137));let appAuth=null,installationToken=null;async function getGitHubAppConfig(){const _0x53e211=a16_0x2b22d2;try{const _0x46c10e=await a16_0x47d1cf['access'](CONFIG_FILE)[_0x53e211(0x12c)](()=>!![])[_0x53e211(0x12e)](()=>![]),_0x19f0c1=await a16_0x47d1cf['access'](KEY_FILE)[_0x53e211(0x12c)](()=>!![])[_0x53e211(0x12e)](()=>![]);if(!_0x46c10e||!_0x19f0c1)return null;const _0x1a3c09=await a16_0x47d1cf[_0x53e211(0x127)](CONFIG_FILE,_0x53e211(0x128)),{appId:_0x28f11a,installationId:_0x5068ef}=JSON[_0x53e211(0x123)](_0x1a3c09),_0x2f9fe1=await a16_0x47d1cf[_0x53e211(0x127)](KEY_FILE,_0x53e211(0x128));if(!_0x28f11a||!_0x5068ef||!_0x2f9fe1)return null;return{'appId':_0x28f11a,'privateKey':_0x2f9fe1,'installationId':_0x5068ef};}catch(_0x348555){return null;}}async function initAppAuth(){const _0x21c41a=a16_0x2b22d2;if(appAuth)return;const _0x328565=await getGitHubAppConfig();if(!_0x328565)throw new Error(_0x21c41a(0x132));appAuth=createAppAuth({'appId':_0x328565[_0x21c41a(0x138)],'privateKey':_0x328565[_0x21c41a(0x11c)],'installationId':_0x328565[_0x21c41a(0x134)]});}async function getInstallationToken(){const _0x2dd86f=a16_0x2b22d2;await initAppAuth();if(installationToken&&installationToken[_0x2dd86f(0x121)]>new Date())return installationToken['token'];const {token:_0x28fb55,expiresAt:_0x42f560}=await appAuth({'type':_0x2dd86f(0x13b)});return installationToken={'token':_0x28fb55,'expiresAt':new Date(_0x42f560)},_0x28fb55;}export async function getGitHubToken(){const _0x7e0447=a16_0x2b22d2;try{return await getInstallationToken();}catch(_0x52c0f0){return console[_0x7e0447(0x13a)](_0x7e0447(0x139),_0x52c0f0),null;}}function a16_0x38d6(){const _0x48cbf4=['❌\x20Authentication\x20failed:','1286851MTsfUV','then','2kxoBYO','catch','2396MdgLHg','2778744YltFun','7245dKXwtO','GitHub\x20App\x20not\x20configured.\x20Run\x20/github\x20setup','✓\x20GitHub\x20App\x20authenticated!','installationId','9114704vnLswx','Error\x20clearing\x20session:','github-app.pem','appId','GitHub\x20App\x20auth\x20failed:','error','installation','✓\x20GitHub\x20session\x20cleared','privateKey','2232734LuhDmy','unlink','9160668ReTkpx','Run\x20/github\x20setup\x20to\x20configure\x20automatically','expiresAt','.woozlit','parse','github-app-config.json','650490IbAwMb','log','readFile','utf8','You\x20can\x20now\x20access\x20private\x20repositories'];a16_0x38d6=function(){return _0x48cbf4;};return a16_0x38d6();}export async function isGitHubAuthenticated(){const _0x3caafe=await getGitHubAppConfig();return _0x3caafe!==null;}export async function loginGitHub(){const _0x50b220=a16_0x2b22d2,_0x46a419=await getGitHubAppConfig();if(!_0x46a419){console[_0x50b220(0x126)]('\x0a❌\x20GitHub\x20App\x20not\x20configured'),console[_0x50b220(0x126)](_0x50b220(0x120));return;}try{const _0x3b8764=await getInstallationToken();console[_0x50b220(0x126)](_0x50b220(0x133)),console[_0x50b220(0x126)](_0x50b220(0x129));}catch(_0x380ec8){console[_0x50b220(0x13a)](_0x50b220(0x12a),_0x380ec8),console[_0x50b220(0x126)]('Try\x20running\x20/github\x20setup\x20again');}}export async function logoutGitHub(){const _0x48dd57=a16_0x2b22d2;try{await a16_0x47d1cf[_0x48dd57(0x11e)](CONFIG_FILE)[_0x48dd57(0x12e)](()=>{}),await a16_0x47d1cf[_0x48dd57(0x11e)](KEY_FILE)['catch'](()=>{}),installationToken=null,appAuth=null,console[_0x48dd57(0x126)](_0x48dd57(0x11b));}catch(_0x309a41){console[_0x48dd57(0x13a)](_0x48dd57(0x136),_0x309a41);}}
@@ -0,0 +1 @@
1
+ export declare function autoSetupGitHub(): Promise<void>;
@@ -0,0 +1 @@
1
+ function a17_0x3b61(_0x5640c3,_0x141878){_0x5640c3=_0x5640c3-0xf2;const _0xb90124=a17_0xb901();let _0x3b61f5=_0xb90124[_0x5640c3];return _0x3b61f5;}(function(_0x411c23,_0x146227){const _0x1616cc=a17_0x3b61,_0x56b0a7=_0x411c23();while(!![]){try{const _0x23460f=-parseInt(_0x1616cc(0x118))/0x1+parseInt(_0x1616cc(0x108))/0x2*(parseInt(_0x1616cc(0xfa))/0x3)+parseInt(_0x1616cc(0x112))/0x4+-parseInt(_0x1616cc(0x134))/0x5*(parseInt(_0x1616cc(0x120))/0x6)+-parseInt(_0x1616cc(0xf9))/0x7*(parseInt(_0x1616cc(0xfb))/0x8)+parseInt(_0x1616cc(0xf8))/0x9+parseInt(_0x1616cc(0x11c))/0xa*(parseInt(_0x1616cc(0xfe))/0xb);if(_0x23460f===_0x146227)break;else _0x56b0a7['push'](_0x56b0a7['shift']());}catch(_0x3c7fa3){_0x56b0a7['push'](_0x56b0a7['shift']());}}}(a17_0xb901,0x4b5e8));import{promises as a17_0x56cca9}from'fs';import{join}from'path';import*as a17_0x2f5360 from'../ui/output.js';import{createServer}from'http';import a17_0x1fe986 from'open';import{homedir}from'os';import{createAppAuth}from'@octokit/auth-app';import{input}from'@inquirer/prompts';async function createGitHubAppManifestFlow(){return new Promise(async(_0xccb0d4,_0x13dded)=>{const _0x372571=a17_0x3b61;let _0x45e807=![];const _0x56effb=createServer(async(_0xbf782b,_0xe12067)=>{const _0x52763a=a17_0x3b61;if(_0xbf782b[_0x52763a(0x11e)]===_0x52763a(0x10d)){_0xe12067[_0x52763a(0xff)](0x194),_0xe12067[_0x52763a(0x12a)]();return;}a17_0x2f5360[_0x52763a(0x100)](_0x52763a(0x10b)+_0xbf782b[_0x52763a(0x11b)]+'\x20'+_0xbf782b[_0x52763a(0x11e)]);const _0x1ade11=new URL(_0xbf782b[_0x52763a(0x11e)]||'/',_0x52763a(0x12e)),_0x350559=_0x1ade11[_0x52763a(0x124)][_0x52763a(0x111)](_0x52763a(0x12d));_0x350559?(_0xe12067[_0x52763a(0xff)](0xc8,{'Content-Type':_0x52763a(0x13a)}),_0xe12067[_0x52763a(0x12a)](_0x52763a(0x10a)),_0xe12067[_0x52763a(0x142)](),!_0x45e807&&(_0x45e807=!![],_0x56effb['close'](),_0x4c2a78(_0x350559))):(_0xe12067['writeHead'](0x190),_0xe12067['end'](_0x52763a(0xfc)));}),_0x4c2a78=async _0x5b7692=>{const _0x171286=a17_0x3b61;try{a17_0x2f5360[_0x171286(0x101)](_0x171286(0x104));const _0x58e75d=await fetch(_0x171286(0x11f)+_0x5b7692+_0x171286(0x140),{'method':_0x171286(0xf4),'headers':{'Accept':_0x171286(0x115)}});if(!_0x58e75d['ok'])throw new Error('Failed\x20to\x20exchange\x20code:\x20'+await _0x58e75d[_0x171286(0x135)]());const _0x2e7299=await _0x58e75d[_0x171286(0x132)]();_0xccb0d4(_0x2e7299);}catch(_0x32e36e){_0x13dded(_0x32e36e);}};_0x56effb[_0x372571(0x125)](0xbb8,_0x372571(0x123),async()=>{const _0x80e0d6=_0x372571,_0x29419e={'name':_0x80e0d6(0x136)+Date['now'](),'url':'http://127.0.0.1:3000','hook_attributes':{'url':_0x80e0d6(0x13b)},'redirect_url':_0x80e0d6(0x103),'public':![],'default_permissions':{'contents':_0x80e0d6(0xf5),'pull_requests':_0x80e0d6(0xf5),'metadata':_0x80e0d6(0x11a)},'default_events':[]},_0x525662=new URLSearchParams({'manifest':JSON[_0x80e0d6(0x130)](_0x29419e)}),_0xc9428c=_0x80e0d6(0x119)+_0x525662['toString']();a17_0x2f5360['info'](_0x80e0d6(0x12b)),a17_0x2f5360[_0x80e0d6(0x100)](_0x80e0d6(0x143)+_0xc9428c);try{await a17_0x1fe986(_0xc9428c),a17_0x2f5360['success'](_0x80e0d6(0xf3)),a17_0x2f5360[_0x80e0d6(0x101)](_0x80e0d6(0x107)),a17_0x2f5360['dim'](_0x80e0d6(0x138));try{const _0x47c8c4=await input({'message':'Paste\x20code\x20(or\x20wait\x20for\x20automatic\x20redirect):','transformer':_0x1d75ed=>_0x1d75ed[_0x80e0d6(0x13c)]()});_0x47c8c4&&!_0x45e807&&(_0x45e807=!![],_0x56effb['close'](),_0x4c2a78(_0x47c8c4));}catch(_0x355d3e){}}catch(_0x4c5d68){a17_0x2f5360['error'](_0x80e0d6(0x122)),a17_0x2f5360[_0x80e0d6(0x101)](_0x80e0d6(0x126)+_0xc9428c);}}),_0x56effb['on'](_0x372571(0x10c),_0x5aec0f=>{const _0x2ae969=_0x372571;a17_0x2f5360[_0x2ae969(0x10c)]('Server\x20error:\x20'+_0x5aec0f),_0x13dded(_0x5aec0f);});});}function a17_0xb901(){const _0x1e5cad=['127.0.0.1','searchParams','listen','Please\x20visit\x20this\x20URL\x20manually:\x0a','\x0aStep\x203:\x20Checking\x20installation...','.woozlit','Could\x20not\x20find\x20installation.\x20Please\x20try\x20again.','end','Step\x201:\x20Opening\x20GitHub\x20to\x20create\x20App...','utf8','code','http://127.0.0.1:3000','length','stringify','exit','json','GitHub\x20App\x20Auto-Setup','10NNMvdK','text','Woozlit\x20CLI\x20','pem','(If\x20nothing\x20happens,\x20copy\x20the\x20\x22code\x22\x20parameter\x20from\x20the\x20browser\x20URL\x20address\x20bar\x20and\x20paste\x20it\x20below,\x20or\x20simply\x20press\x20Enter\x20to\x20start\x20manual\x20entry)','/app/installations','text/html','http://127.0.0.1:3000/webhook','trim','\x0aStep\x204:\x20Saving\x20configuration...','App\x20created\x20but\x20not\x20installed\x20yet.','App\x20ID:\x20','/conversions','header','destroy','Url:\x20','hook','Browser\x20opened!\x20Please\x20click\x20\x22Create\x20GitHub\x20App\x22\x20on\x20the\x20page.','POST','write','once','GET','1402470CElZiP','1104229QmrgxI','397752jUIFVs','8HotxUa','No\x20code\x20found','✓\x20App\x20installed!','22JovWXt','writeHead','dim','info','App\x20Name:\x20','http://127.0.0.1:3000/callback','\x0aStep\x202:\x20Registering\x20GitHub\x20App...','writeFile','/installations/new','\x0awaiting\x20for\x20browser\x20callback...','2wKlvTQ','Opened:\x20','<h1>Setup\x20Complete!</h1><p>You\x20can\x20close\x20this\x20tab\x20and\x20return\x20to\x20the\x20terminal.</p>','Received\x20request:\x20','error','/favicon.ico','Please\x20install\x20the\x20app\x20on\x20your\x20account/repositories.','html_url','success','get','2368064QwigfN','mkdir','access','application/vnd.github+json','data','\x0aSetup\x20failed:\x20','149169Gqqfyw','https://github.com/settings/apps/new?','read','method','571380XNXOWw','stdin','url','https://api.github.com/app-manifests/','1137234qaWvWD','github-app-config.json','Failed\x20to\x20open\x20browser\x20automatically.'];a17_0xb901=function(){return _0x1e5cad;};return a17_0xb901();}async function saveConfig(_0x1b1976,_0x140669,_0xd9616d){const _0x2d2b6c=a17_0x3b61,_0x5daa65=join(homedir(),_0x2d2b6c(0x128));try{await a17_0x56cca9[_0x2d2b6c(0x114)](_0x5daa65);}catch{await a17_0x56cca9[_0x2d2b6c(0x113)](_0x5daa65,{'recursive':!![]});}const _0x473d12=join(_0x5daa65,_0x2d2b6c(0x121)),_0x1d5876=join(_0x5daa65,'github-app.pem');await a17_0x56cca9[_0x2d2b6c(0x105)](_0x1d5876,_0x140669,_0x2d2b6c(0x12c)),await a17_0x56cca9[_0x2d2b6c(0x105)](_0x473d12,JSON[_0x2d2b6c(0x130)]({'appId':_0x1b1976,'installationId':_0xd9616d},null,0x2),_0x2d2b6c(0x12c));}async function installAppIfNeeded(_0x1cd9f5){const _0x14c5e9=a17_0x3b61;a17_0x2f5360[_0x14c5e9(0x101)](_0x14c5e9(0x127));const _0x244839=createAppAuth({'appId':_0x1cd9f5['id'],'privateKey':_0x1cd9f5[_0x14c5e9(0x137)]});try{const {data:_0x5c7a86}=await _0x244839[_0x14c5e9(0xf2)]((_0x48a809,_0xb0b114)=>_0x48a809(_0xb0b114),{'method':_0x14c5e9(0xf7),'url':'/app/installations'});if(_0x5c7a86&&_0x5c7a86[_0x14c5e9(0x12f)]>0x0)return _0x5c7a86[0x0]['id'];}catch(_0x155d0a){}a17_0x2f5360[_0x14c5e9(0x101)](_0x14c5e9(0x13e)),a17_0x2f5360['info'](_0x14c5e9(0x10e));const _0x4d3555=_0x1cd9f5[_0x14c5e9(0x10f)]+_0x14c5e9(0x106);await a17_0x1fe986(_0x4d3555),a17_0x2f5360[_0x14c5e9(0x101)](_0x14c5e9(0x109)+_0x4d3555),a17_0x2f5360[_0x14c5e9(0x101)]('Press\x20Enter\x20after\x20you\x20have\x20installed\x20the\x20app...'),await new Promise(_0x368d96=>process[_0x14c5e9(0x11d)][_0x14c5e9(0xf6)](_0x14c5e9(0x116),_0x368d96));const _0x361534=createAppAuth({'appId':_0x1cd9f5['id'],'privateKey':_0x1cd9f5['pem']}),{data:_0x2211d8}=await _0x361534[_0x14c5e9(0xf2)]((_0x21d93,_0x259150)=>_0x21d93(_0x259150),{'method':_0x14c5e9(0xf7),'url':_0x14c5e9(0x139)});if(_0x2211d8&&_0x2211d8[_0x14c5e9(0x12f)]>0x0)return _0x2211d8[0x0]['id'];throw new Error(_0x14c5e9(0x129));}export async function autoSetupGitHub(){const _0x5d462e=a17_0x3b61;a17_0x2f5360[_0x5d462e(0x141)](_0x5d462e(0x133)),a17_0x2f5360['dim']('This\x20will\x20create\x20a\x20GitHub\x20App\x20automatically\x20via\x20Manifest\x20Flow\x0a');try{const _0x2553eb=await createGitHubAppManifestFlow();a17_0x2f5360[_0x5d462e(0x110)]('\x0a✓\x20GitHub\x20App\x20created!');const _0x5f0da9=await installAppIfNeeded(_0x2553eb);a17_0x2f5360[_0x5d462e(0x110)](_0x5d462e(0xfd)),a17_0x2f5360['info'](_0x5d462e(0x13d)),await saveConfig(_0x2553eb['id'],_0x2553eb[_0x5d462e(0x137)],_0x5f0da9),a17_0x2f5360[_0x5d462e(0x110)]('\x0a✓\x20GitHub\x20App\x20setup\x20complete!'),a17_0x2f5360[_0x5d462e(0x100)](_0x5d462e(0x13f)+_0x2553eb['id']),a17_0x2f5360[_0x5d462e(0x100)](_0x5d462e(0x102)+_0x2553eb['name']),a17_0x2f5360[_0x5d462e(0x100)]('Configuration\x20saved\x20globally\x20to\x20~/.woozlit/'),a17_0x2f5360[_0x5d462e(0x110)]('You\x20can\x20now\x20access\x20private\x20repositories!');}catch(_0x346f69){a17_0x2f5360['error'](_0x5d462e(0x117)+_0x346f69),a17_0x2f5360['dim']('\x0aYou\x20can\x20try\x20manual\x20setup\x20with:\x20/github\x20manual'),process[_0x5d462e(0x131)](0x1);}}
@@ -0,0 +1 @@
1
+ export declare function handleGitHubCommand(subCmd: string): Promise<void>;
@@ -0,0 +1 @@
1
+ (function(_0x2fce8d,_0x55121d){const _0x1d52e3=a18_0x4707,_0x47d010=_0x2fce8d();while(!![]){try{const _0x3f2d3f=-parseInt(_0x1d52e3(0x1aa))/0x1+parseInt(_0x1d52e3(0x190))/0x2+parseInt(_0x1d52e3(0x18c))/0x3+parseInt(_0x1d52e3(0x18b))/0x4*(-parseInt(_0x1d52e3(0x184))/0x5)+-parseInt(_0x1d52e3(0x180))/0x6+parseInt(_0x1d52e3(0x193))/0x7*(-parseInt(_0x1d52e3(0x195))/0x8)+-parseInt(_0x1d52e3(0x18a))/0x9*(-parseInt(_0x1d52e3(0x19e))/0xa);if(_0x3f2d3f===_0x55121d)break;else _0x47d010['push'](_0x47d010['shift']());}catch(_0x286744){_0x47d010['push'](_0x47d010['shift']());}}}(a18_0x23a9,0x5db88));import*as a18_0x2e82d9 from'../ui/output.js';import{loginGitHub,logoutGitHub,isGitHubAuthenticated}from'./auth.js';import{listRepos}from'./api.js';import{autoSetupGitHub}from'./auto-setup.js';function a18_0x23a9(){const _0x9d44d0=['Failed\x20to\x20fetch\x20repos:\x20','logout','(public)','private','slice','config','Not\x20logged\x20in\x20to\x20GitHub\x20App','header','Access\x20to\x20','setup','\x20more','67907iFZyOK','success','Not\x20logged\x20in.\x20Run\x20\x27/github\x20setup\x27\x20first','2191674GcOnFg','length','createSpinner','\x20repositories','5sjqCgl','./api.js','\x20\x20/github\x20status\x20\x20-\x20Check\x20authentication\x20status','Installed\x20on\x20account:\x20','Fetching\x20repos...','\x20\x20...\x20and\x20','54qEsuvR','2878700zmIGgs','618708IbIMVV','repos','accountName','start','1190662oNamzR','\x20\x20/github\x20logout\x20\x20-\x20Clear\x20GitHub\x20App\x20credentials','Your\x20GitHub\x20Repositories','385vetzHN','dim','6240ayyPum','manual','warn','error','stop','✓\x20Authenticated\x20as\x20GitHub\x20App','\x20\x20/github\x20setup\x20\x20\x20-\x20Auto-create\x20GitHub\x20App\x20(recommended)','forEach','login','1296790bwBCwu'];a18_0x23a9=function(){return _0x9d44d0;};return a18_0x23a9();}function a18_0x4707(_0x138199,_0x3c0dd8){_0x138199=_0x138199-0x180;const _0x23a9eb=a18_0x23a9();let _0x47077c=_0x23a9eb[_0x138199];return _0x47077c;}import{manualSetupGitHub}from'./manual-setup.js';export async function handleGitHubCommand(_0x7374dc){const _0x582ebf=a18_0x4707;if(_0x7374dc===_0x582ebf(0x1a8)){await autoSetupGitHub();return;}if(_0x7374dc===_0x582ebf(0x196)||_0x7374dc===_0x582ebf(0x1a4)){await manualSetupGitHub();return;}if(_0x7374dc===_0x582ebf(0x19d)){await loginGitHub();return;}if(_0x7374dc===_0x582ebf(0x1a0)){await logoutGitHub();return;}if(_0x7374dc==='status'){const _0x16a926=await isGitHubAuthenticated();if(_0x16a926)try{const {getAppStatus:_0x5d69e0}=await import(_0x582ebf(0x185)),_0x4892a1=await _0x5d69e0();a18_0x2e82d9[_0x582ebf(0x1ab)](_0x582ebf(0x19a)),_0x4892a1[_0x582ebf(0x18e)]&&a18_0x2e82d9['info'](_0x582ebf(0x187)+_0x4892a1['accountName']),a18_0x2e82d9[_0x582ebf(0x194)](_0x582ebf(0x1a7)+_0x4892a1['repoCount']+_0x582ebf(0x183));}catch(_0x437cc3){a18_0x2e82d9[_0x582ebf(0x197)]('Token\x20may\x20be\x20invalid\x20or\x20app\x20has\x20no\x20repo\x20access:\x20'+_0x437cc3);}else a18_0x2e82d9[_0x582ebf(0x194)](_0x582ebf(0x1a5));return;}if(_0x7374dc===_0x582ebf(0x18d)){const _0x3375ea=await isGitHubAuthenticated();if(!_0x3375ea){a18_0x2e82d9[_0x582ebf(0x198)](_0x582ebf(0x1ac));return;}a18_0x2e82d9[_0x582ebf(0x1a6)](_0x582ebf(0x192));const _0x4ffc0d=a18_0x2e82d9[_0x582ebf(0x182)](_0x582ebf(0x188));_0x4ffc0d[_0x582ebf(0x18f)]();try{const _0x2b0143=await listRepos();_0x4ffc0d['stop'](),_0x2b0143[_0x582ebf(0x1a3)](0x0,0xa)[_0x582ebf(0x19c)](_0x35c7cb=>{const _0x46232d=_0x582ebf,_0x1ace25=_0x35c7cb[_0x46232d(0x1a2)]?'(private)':_0x46232d(0x1a1);a18_0x2e82d9[_0x46232d(0x194)]('\x20\x20'+_0x35c7cb['full_name']+'\x20'+_0x1ace25);}),_0x2b0143[_0x582ebf(0x181)]>0xa&&a18_0x2e82d9[_0x582ebf(0x194)](_0x582ebf(0x189)+(_0x2b0143[_0x582ebf(0x181)]-0xa)+_0x582ebf(0x1a9));}catch(_0x4bdae5){_0x4ffc0d[_0x582ebf(0x199)](),a18_0x2e82d9[_0x582ebf(0x198)](_0x582ebf(0x19f)+_0x4bdae5);}return;}a18_0x2e82d9['header']('GitHub\x20Commands'),a18_0x2e82d9['dim'](_0x582ebf(0x19b)),a18_0x2e82d9[_0x582ebf(0x194)]('\x20\x20/github\x20login\x20\x20\x20-\x20Test\x20GitHub\x20App\x20authentication'),a18_0x2e82d9[_0x582ebf(0x194)](_0x582ebf(0x191)),a18_0x2e82d9[_0x582ebf(0x194)](_0x582ebf(0x186)),a18_0x2e82d9[_0x582ebf(0x194)]('\x20\x20/github\x20repos\x20\x20\x20-\x20List\x20your\x20repositories\x20(including\x20private)');}
@@ -0,0 +1 @@
1
+ export declare function manualSetupGitHub(): Promise<void>;
@@ -0,0 +1 @@
1
+ (function(_0x443036,_0x57394b){const _0x3433a0=a19_0x5265,_0x3386b4=_0x443036();while(!![]){try{const _0xa4854b=parseInt(_0x3433a0(0x1e4))/0x1*(-parseInt(_0x3433a0(0x1ff))/0x2)+parseInt(_0x3433a0(0x207))/0x3+-parseInt(_0x3433a0(0x1e9))/0x4+-parseInt(_0x3433a0(0x20a))/0x5*(parseInt(_0x3433a0(0x1e7))/0x6)+-parseInt(_0x3433a0(0x1f4))/0x7*(parseInt(_0x3433a0(0x209))/0x8)+-parseInt(_0x3433a0(0x1ee))/0x9+-parseInt(_0x3433a0(0x1ef))/0xa*(-parseInt(_0x3433a0(0x1e6))/0xb);if(_0xa4854b===_0x57394b)break;else _0x3386b4['push'](_0x3386b4['shift']());}catch(_0x2aecba){_0x3386b4['push'](_0x3386b4['shift']());}}}(a19_0xde91,0x896a6));import{promises as a19_0x336a8c}from'fs';import{join}from'path';import*as a19_0x317f6f from'../ui/output.js';import{homedir}from'os';import{input,editor}from'@inquirer/prompts';function a19_0x5265(_0xaa8022,_0x1a39c2){_0xaa8022=_0xaa8022-0x1e2;const _0xde9104=a19_0xde91();let _0x5265eb=_0xde9104[_0xaa8022];return _0x5265eb;}async function saveConfig(_0xedf887,_0x48d19b,_0x22235a){const _0x534976=a19_0x5265,_0xb3b83c=join(homedir(),_0x534976(0x203));try{await a19_0x336a8c[_0x534976(0x1f2)](_0xb3b83c);}catch{await a19_0x336a8c[_0x534976(0x1f8)](_0xb3b83c,{'recursive':!![]});}const _0x439a7d=join(_0xb3b83c,_0x534976(0x202)),_0x56d1bb=join(_0xb3b83c,_0x534976(0x1ed));await a19_0x336a8c[_0x534976(0x1f5)](_0x56d1bb,_0x48d19b,'utf8'),await a19_0x336a8c[_0x534976(0x1f5)](_0x439a7d,JSON['stringify']({'appId':_0xedf887,'installationId':_0x22235a},null,0x2),_0x534976(0x1f9));}function a19_0xde91(){const _0x283296=['github-app.pem','3359943tnteoV','21797500JWQGpf','error','Private\x20Key\x20(PEM\x20format):','access','BEGIN\x20PRIVATE\x20KEY','672AmSTWQ','writeFile','length','dim','mkdir','utf8','success','warn','\x0aSetup\x20failed:\x20','\x0aFor\x20the\x20Private\x20Key,\x20your\x20default\x20editor\x20will\x20open.','To\x20verify,\x20run:\x20/github\x20status','38FvLoJC','\x0a✓\x20Configuration\x20saved!','Installation\x20ID\x20is\x20required','github-app-config.json','.woozlit','BEGIN\x20RSA\x20PRIVATE\x20KEY','App\x20ID\x20is\x20required','force\x20closed','2023779uySGjT','includes','7832cQQUvz','205UtuTMR','info','Installation\x20ID:','22547QHGYhs','\x0aSaving\x20configuration...','11ycDwyY','122316GznTBZ','Paste\x20the\x20entire\x20content\x20of\x20your\x20.pem\x20file,\x20save,\x20and\x20close.','2239836nZGkjk','GitHub\x20App\x20Manual\x20Configuration','Invalid\x20PEM\x20format','Enter\x20your\x20existing\x20GitHub\x20App\x20credentials\x20manually.\x0a'];a19_0xde91=function(){return _0x283296;};return a19_0xde91();}export async function manualSetupGitHub(){const _0xaa8393=a19_0x5265;a19_0x317f6f['header'](_0xaa8393(0x1ea)),a19_0x317f6f[_0xaa8393(0x1f7)](_0xaa8393(0x1ec));try{const _0x51e880=await input({'message':'App\x20ID:','validate':_0x56789f=>_0x56789f[_0xaa8393(0x1f6)]>0x0?!![]:_0xaa8393(0x205)});a19_0x317f6f[_0xaa8393(0x1e2)](_0xaa8393(0x1fd)),a19_0x317f6f[_0xaa8393(0x1e2)](_0xaa8393(0x1e8)),await new Promise(_0x5d5bf6=>setTimeout(_0x5d5bf6,0x7d0));const _0x4034da=await editor({'message':_0xaa8393(0x1f1),'validate':_0x16e8c6=>_0x16e8c6[_0xaa8393(0x208)](_0xaa8393(0x204))||_0x16e8c6[_0xaa8393(0x208)](_0xaa8393(0x1f3))?!![]:_0xaa8393(0x1eb)}),_0x18aec0=await input({'message':_0xaa8393(0x1e3),'validate':_0x441547=>_0x441547[_0xaa8393(0x1f6)]>0x0?!![]:_0xaa8393(0x201)});a19_0x317f6f[_0xaa8393(0x1e2)](_0xaa8393(0x1e5)),await saveConfig(_0x51e880,_0x4034da,_0x18aec0),a19_0x317f6f[_0xaa8393(0x1fa)](_0xaa8393(0x200)),a19_0x317f6f[_0xaa8393(0x1f7)](_0xaa8393(0x1fe));}catch(_0x1301d2){if(_0x1301d2 instanceof Error&&_0x1301d2['message']['includes'](_0xaa8393(0x206))){a19_0x317f6f[_0xaa8393(0x1fb)]('\x0aSetup\x20cancelled.');return;}a19_0x317f6f[_0xaa8393(0x1f0)](_0xaa8393(0x1fc)+_0x1301d2);}}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a4_0x5bcee7=a4_0xb2c4;(function(_0x2c342a,_0x488140){const _0x521ff1=a4_0xb2c4,_0x2c1303=_0x2c342a();while(!![]){try{const _0x33c65e=parseInt(_0x521ff1(0x208))/0x1*(-parseInt(_0x521ff1(0x219))/0x2)+parseInt(_0x521ff1(0x23f))/0x3+-parseInt(_0x521ff1(0x21d))/0x4*(-parseInt(_0x521ff1(0x233))/0x5)+-parseInt(_0x521ff1(0x1fd))/0x6+-parseInt(_0x521ff1(0x246))/0x7+-parseInt(_0x521ff1(0x204))/0x8*(-parseInt(_0x521ff1(0x201))/0x9)+-parseInt(_0x521ff1(0x21a))/0xa*(-parseInt(_0x521ff1(0x23d))/0xb);if(_0x33c65e===_0x488140)break;else _0x2c1303['push'](_0x2c1303['shift']());}catch(_0x32d9eb){_0x2c1303['push'](_0x2c1303['shift']());}}}(a4_0x2a45,0xd70ef));function a4_0xb2c4(_0x4c6e9c,_0x513e47){_0x4c6e9c=_0x4c6e9c-0x1f1;const _0x2a458e=a4_0x2a45();let _0xb2c42e=_0x2a458e[_0x4c6e9c];return _0xb2c42e;}import{Command}from'commander';import{login,logout,isLoggedIn}from'./auth/login.js';import{startChat}from'./chat/agent.js';import{selectModel,getSelectedModel}from'./ui/select.js';import{listRules,addRule,clearRules}from'./tools/rules.js';import{getUser}from'./utils/storage.js';import{addMcpServer,addMcpHttpServer,removeMcpServer,clearMcpServers,getMcpServers,ensureDefaultServers,getConfigFilePath}from'./config/mcp.js';import{createFile,listDirectory}from'./tools/file.js';import*as a4_0x4bfa15 from'./ui/output.js';const VERSION=a4_0x5bcee7(0x252),program=new Command();function a4_0x2a45(){const _0x4f43b5=['command','error','List\x20all\x20MCP\x20servers','7989840JPJDgq','keys','length','list','6150357vZCPnx','Add\x20an\x20HTTP\x20MCP\x20server\x20(streamable-http)','delete-all','8Asminu','Add\x20a\x20new\x20rule','\x0aConfig\x20file:\x20','config','18251iOLtje','Logged\x20in\x20as\x20','No\x20MCP\x20servers\x20configured','Logout\x20from\x20your\x20Woozlit\x20account','Ask\x20a\x20single\x20question','add-http\x20<name>\x20<url>','action','name','createSpinner','info','version','MCP\x20server\x20\x27','showLogo','Config\x20file:\x20',':\x20[HTTP]\x20','Add\x20a\x20stdio\x20MCP\x20server','No\x20rules\x20defined','122qVepKA','190ZUuJfu','url','success','156556FsdDME','streamable-http','.woozlit/rules.md','Initialized\x20Woozlit\x20in\x20current\x20directory','login','start','Added\x20HTTP\x20MCP\x20server:\x20',':\x20[stdio]\x20','Not\x20logged\x20in.\x20Use\x20\x27woozlit\x20login\x27\x20to\x20authenticate.','init','Already\x20logged\x20in\x20as\x20','Select\x20AI\x20model','whoami','Remove\x20all\x20MCP\x20servers','.woozlit/context.md','Rules','remove\x20<name>','aliases','stdout','Email:\x20','Current\x20User','header','100TRTBdP','URL:\x20','You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.','Added\x20rule:\x20','entries','Created\x20.woozlit/rules.md\x20and\x20.woozlit/context.md','model','warn','email','Opening\x20browser\x20for\x20login...','338965WxKrko','Woozlit\x20already\x20initialized\x20in\x20this\x20directory','4586619RaqVVx','stop','chat\x20[message]','type','Woozlit\x20AI\x20-\x20Agentic\x20Coding\x20Assistant','delete','Show\x20current\x20user\x20info','1782767GTWfrQ','add\x20<name>\x20<command>\x20[args...]','description','Default\x20servers\x20will\x20be\x20restored\x20on\x20next\x20restart\x20unless\x20you\x20remove\x20them\x20again.','Remove\x20an\x20MCP\x20server','You\x20can\x20also\x20add\x20servers\x20via\x20mcp.json\x20in\x20your\x20project\x20directory','displayName','woozlit','Waiting\x20for\x20authentication...','Model\x20set\x20to:\x20','#\x20Project\x20Context\x0a\x0aDescribe\x20your\x20project\x20here.\x0a','args','2.0.0','Login\x20with\x20your\x20Woozlit\x20account','Added\x20stdio\x20MCP\x20server:\x20','dim','some','logout','All\x20MCP\x20servers\x20removed','Login\x20failed\x20or\x20timed\x20out','Logged\x20out\x20successfully','forEach'];a4_0x2a45=function(){return _0x4f43b5;};return a4_0x2a45();}program[a4_0x5bcee7(0x20f)](a4_0x5bcee7(0x24d))['description'](a4_0x5bcee7(0x243))[a4_0x5bcee7(0x212)](VERSION)[a4_0x5bcee7(0x20e)](async()=>{const _0x492aa5=a4_0x5bcee7;ensureDefaultServers(),a4_0x4bfa15[_0x492aa5(0x214)](VERSION);if(!isLoggedIn()){a4_0x4bfa15[_0x492aa5(0x23a)]('You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.'),a4_0x4bfa15['dim'](''),a4_0x4bfa15['info']('Opening\x20browser\x20for\x20login...');const _0x52b3ee=a4_0x4bfa15[_0x492aa5(0x210)]('Waiting\x20for\x20authentication...');_0x52b3ee[_0x492aa5(0x222)]();const _0x164893=await login();_0x52b3ee['stop']();if(!_0x164893){a4_0x4bfa15[_0x492aa5(0x1fb)]('Login\x20failed\x20or\x20timed\x20out');return;}const _0x2d3875=getUser();a4_0x4bfa15['success'](_0x492aa5(0x209)+(_0x2d3875[_0x492aa5(0x24c)]||_0x2d3875[_0x492aa5(0x23b)]));}await startChat();}),program['command'](a4_0x5bcee7(0x221))['description'](a4_0x5bcee7(0x1f1))[a4_0x5bcee7(0x20e)](async()=>{const _0x6c3234=a4_0x5bcee7;if(isLoggedIn()){const _0x4b365e=getUser();a4_0x4bfa15[_0x6c3234(0x211)](_0x6c3234(0x227)+_0x4b365e['email']);return;}a4_0x4bfa15[_0x6c3234(0x211)](_0x6c3234(0x23c));const _0x3a2f59=a4_0x4bfa15[_0x6c3234(0x210)](_0x6c3234(0x24e));_0x3a2f59['start']();const _0x2ea6c5=await login();_0x3a2f59[_0x6c3234(0x240)]();if(_0x2ea6c5){const _0xa9a1fe=getUser();a4_0x4bfa15['success'](_0x6c3234(0x209)+(_0xa9a1fe[_0x6c3234(0x24c)]||_0xa9a1fe['email']));}else a4_0x4bfa15['error'](_0x6c3234(0x1f7));}),program[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x1f5))[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x20b))[a4_0x5bcee7(0x20e)](()=>{const _0x300c5a=a4_0x5bcee7;logout(),a4_0x4bfa15[_0x300c5a(0x21c)](_0x300c5a(0x1f8));}),program[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x229))[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x245))[a4_0x5bcee7(0x20e)](()=>{const _0x536221=a4_0x5bcee7;if(!isLoggedIn()){a4_0x4bfa15[_0x536221(0x23a)](_0x536221(0x225));return;}const _0xb5b8fb=getUser();a4_0x4bfa15[_0x536221(0x232)](_0x536221(0x231)),a4_0x4bfa15[_0x536221(0x211)]('Name:\x20'+(_0xb5b8fb['displayName']||'N/A')),a4_0x4bfa15['info'](_0x536221(0x230)+(_0xb5b8fb[_0x536221(0x23b)]||'N/A')),a4_0x4bfa15[_0x536221(0x211)]('Model:\x20'+getSelectedModel());}),program[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x241))[a4_0x5bcee7(0x248)]('Start\x20an\x20AI\x20chat\x20session')[a4_0x5bcee7(0x20e)](async _0x5dd6b8=>{const _0xc7bdaa=a4_0x5bcee7;a4_0x4bfa15[_0xc7bdaa(0x214)](VERSION);if(!isLoggedIn()){a4_0x4bfa15[_0xc7bdaa(0x23a)]('You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.'),a4_0x4bfa15[_0xc7bdaa(0x1f3)](''),a4_0x4bfa15[_0xc7bdaa(0x211)](_0xc7bdaa(0x23c));const _0x5b7aae=a4_0x4bfa15[_0xc7bdaa(0x210)](_0xc7bdaa(0x24e));_0x5b7aae[_0xc7bdaa(0x222)]();const _0x26cddf=await login();_0x5b7aae['stop']();if(!_0x26cddf){a4_0x4bfa15[_0xc7bdaa(0x1fb)]('Login\x20failed\x20or\x20timed\x20out');return;}const _0x559e87=getUser();a4_0x4bfa15[_0xc7bdaa(0x21c)](_0xc7bdaa(0x209)+(_0x559e87['displayName']||_0x559e87[_0xc7bdaa(0x23b)]));}await startChat(_0x5dd6b8);}),program[a4_0x5bcee7(0x1fa)]('ask\x20<message>')[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x20c))['action'](async _0x5cb628=>{const _0x57936b=a4_0x5bcee7;a4_0x4bfa15['showLogo'](VERSION);if(!isLoggedIn()){a4_0x4bfa15[_0x57936b(0x23a)](_0x57936b(0x235)),a4_0x4bfa15[_0x57936b(0x1f3)](''),a4_0x4bfa15[_0x57936b(0x211)](_0x57936b(0x23c));const _0x26be47=a4_0x4bfa15['createSpinner'](_0x57936b(0x24e));_0x26be47[_0x57936b(0x222)]();const _0x1489fc=await login();_0x26be47[_0x57936b(0x240)]();if(!_0x1489fc){a4_0x4bfa15[_0x57936b(0x1fb)](_0x57936b(0x1f7));return;}const _0xf4addc=getUser();a4_0x4bfa15['success'](_0x57936b(0x209)+(_0xf4addc[_0x57936b(0x24c)]||_0xf4addc[_0x57936b(0x23b)]));}await startChat(_0x5cb628);});const configCmd=program[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x207))[a4_0x5bcee7(0x248)]('Configure\x20CLI\x20settings');configCmd[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x239))[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x228))['action'](async()=>{const _0x14271c=a4_0x5bcee7,_0x5ce7f2=await selectModel();a4_0x4bfa15[_0x14271c(0x21c)](_0x14271c(0x24f)+_0x5ce7f2);});const rulesCmd=program['command']('rules')[a4_0x5bcee7(0x248)]('Manage\x20AI\x20behavior\x20rules');rulesCmd[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x200))[a4_0x5bcee7(0x248)]('List\x20all\x20rules')[a4_0x5bcee7(0x20e)](()=>{const _0x24143c=a4_0x5bcee7,_0x40d26d=listRules();if(_0x40d26d[_0x24143c(0x1ff)]===0x0){a4_0x4bfa15[_0x24143c(0x211)](_0x24143c(0x218));return;}a4_0x4bfa15[_0x24143c(0x232)](_0x24143c(0x22c)),_0x40d26d[_0x24143c(0x1f9)]((_0x15630a,_0x1046f5)=>{const _0x47429d=_0x24143c;process[_0x47429d(0x22f)]['write'](_0x1046f5+0x1+'.\x20'+_0x15630a+'\x0a');});}),rulesCmd[a4_0x5bcee7(0x1fa)]('add\x20<rule>')[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x205))['action'](_0x5d5dd1=>{const _0x4f629d=a4_0x5bcee7;addRule(_0x5d5dd1),a4_0x4bfa15[_0x4f629d(0x21c)](_0x4f629d(0x236)+_0x5d5dd1);})[a4_0x5bcee7(0x20e)](()=>{const _0x3ae398=a4_0x5bcee7;clearRules(),a4_0x4bfa15[_0x3ae398(0x21c)]('All\x20rules\x20cleared');});const mcpCmd=program[a4_0x5bcee7(0x1fa)]('mcp')['description']('Manage\x20MCP\x20servers');mcpCmd[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x200))[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x1fc))[a4_0x5bcee7(0x20e)](()=>{const _0x2cb9f5=a4_0x5bcee7,_0x17f000=getMcpServers(),_0x30702c=Object[_0x2cb9f5(0x1fe)](_0x17f000);if(_0x30702c[_0x2cb9f5(0x1ff)]===0x0){a4_0x4bfa15[_0x2cb9f5(0x211)](_0x2cb9f5(0x20a)),a4_0x4bfa15['dim'](_0x2cb9f5(0x215)+getConfigFilePath());return;}a4_0x4bfa15[_0x2cb9f5(0x232)]('MCP\x20Servers'),_0x30702c[_0x2cb9f5(0x1f9)](_0x5a65ca=>{const _0x2c7706=_0x2cb9f5,_0x1117a5=_0x17f000[_0x5a65ca];_0x1117a5[_0x2c7706(0x242)]===_0x2c7706(0x21e)?a4_0x4bfa15[_0x2c7706(0x211)]('-\x20'+_0x5a65ca+_0x2c7706(0x216)+_0x1117a5[_0x2c7706(0x21b)]):a4_0x4bfa15['info']('-\x20'+_0x5a65ca+_0x2c7706(0x224)+_0x1117a5[_0x2c7706(0x1fa)]+'\x20'+(_0x1117a5[_0x2c7706(0x251)]?.['join']('\x20')||''));}),a4_0x4bfa15['dim'](_0x2cb9f5(0x206)+getConfigFilePath()),a4_0x4bfa15[_0x2cb9f5(0x1f3)](_0x2cb9f5(0x24b));}),mcpCmd[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x247))[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x217))[a4_0x5bcee7(0x20e)]((_0x457c41,_0x512b98,_0x39f069)=>{const _0x1d6b51=a4_0x5bcee7;addMcpServer(_0x457c41,_0x512b98,_0x39f069),a4_0x4bfa15[_0x1d6b51(0x21c)](_0x1d6b51(0x1f2)+_0x457c41);}),mcpCmd[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x20d))[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x202))['action']((_0x2c7643,_0x7d58a2)=>{const _0x3859d0=a4_0x5bcee7;addMcpHttpServer(_0x2c7643,_0x7d58a2),a4_0x4bfa15[_0x3859d0(0x21c)](_0x3859d0(0x223)+_0x2c7643),a4_0x4bfa15['dim'](_0x3859d0(0x234)+_0x7d58a2);}),mcpCmd[a4_0x5bcee7(0x1fa)](a4_0x5bcee7(0x22d))[a4_0x5bcee7(0x22e)]([a4_0x5bcee7(0x244),'rm'])[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x24a))['action'](_0x3b49d1=>{const _0xae4c02=a4_0x5bcee7;removeMcpServer(_0x3b49d1)?a4_0x4bfa15['success']('Removed\x20MCP\x20server:\x20'+_0x3b49d1):a4_0x4bfa15['error'](_0xae4c02(0x213)+_0x3b49d1+'\x27\x20not\x20found');}),mcpCmd[a4_0x5bcee7(0x1fa)]('remove-all')[a4_0x5bcee7(0x22e)]([a4_0x5bcee7(0x203),'clear'])[a4_0x5bcee7(0x248)](a4_0x5bcee7(0x22a))['action'](async()=>{const _0x464491=a4_0x5bcee7,{confirm:_0x422233}=await import('@inquirer/prompts'),_0x32614c=await _0x422233({'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20ALL\x20MCP\x20servers?','default':![]});_0x32614c?(clearMcpServers(),a4_0x4bfa15[_0x464491(0x21c)](_0x464491(0x1f6)),a4_0x4bfa15[_0x464491(0x1f3)](_0x464491(0x249))):a4_0x4bfa15[_0x464491(0x211)]('Operation\x20cancelled');}),program['command'](a4_0x5bcee7(0x226))[a4_0x5bcee7(0x248)]('Initialize\x20Woozlit\x20in\x20current\x20directory')[a4_0x5bcee7(0x20e)](()=>{const _0x4edf29=a4_0x5bcee7,_0x50757d=listDirectory('.'),_0x3c33da=_0x50757d[_0x4edf29(0x237)]?.[_0x4edf29(0x1f4)](_0x26fc32=>_0x26fc32[_0x4edf29(0x20f)]==='.woozlit');if(_0x3c33da){a4_0x4bfa15[_0x4edf29(0x23a)](_0x4edf29(0x23e));return;}createFile(_0x4edf29(0x21f),'#\x20Project\x20Rules\x0a\x0aAdd\x20your\x20project-specific\x20rules\x20here.\x0a'),createFile(_0x4edf29(0x22b),_0x4edf29(0x250)),a4_0x4bfa15['success'](_0x4edf29(0x220)),a4_0x4bfa15[_0x4edf29(0x1f3)](_0x4edf29(0x238));}),program['parse']();
2
+ function a20_0x5785(_0x88f422,_0x2c0f76){_0x88f422=_0x88f422-0xbb;const _0x56684f=a20_0x5668();let _0x578566=_0x56684f[_0x88f422];return _0x578566;}const a20_0x298f7e=a20_0x5785;(function(_0x5db289,_0x588659){const _0xb4b752=a20_0x5785,_0x3aa754=_0x5db289();while(!![]){try{const _0x16a44d=parseInt(_0xb4b752(0x126))/0x1+-parseInt(_0xb4b752(0xed))/0x2+-parseInt(_0xb4b752(0x111))/0x3*(parseInt(_0xb4b752(0xcc))/0x4)+-parseInt(_0xb4b752(0xe0))/0x5*(parseInt(_0xb4b752(0xfd))/0x6)+-parseInt(_0xb4b752(0xe1))/0x7+parseInt(_0xb4b752(0x12e))/0x8*(parseInt(_0xb4b752(0xce))/0x9)+parseInt(_0xb4b752(0xec))/0xa;if(_0x16a44d===_0x588659)break;else _0x3aa754['push'](_0x3aa754['shift']());}catch(_0x2cebac){_0x3aa754['push'](_0x3aa754['shift']());}}}(a20_0x5668,0x562a9));import{Command}from'commander';import a20_0x56d84c from'chalk';import{login,logout,isLoggedIn}from'./auth/login.js';import{startChat}from'./chat/agent.js';import{selectModel,getSelectedModel}from'./ui/select.js';import{listRules,addRule,clearRules}from'./tools/rules.js';import{getUser}from'./utils/storage.js';import{addMcpServer,addMcpHttpServer,removeMcpServer,clearMcpServers,getMcpServers,ensureDefaultServers,getConfigFilePath}from'./config/mcp.js';import{createFile,listDirectory}from'./tools/file.js';import*as a20_0x430f9e from'./ui/output.js';function a20_0x5668(){const _0xc2b6d5=['configured','Configure\x20Discord\x20Bot\x20Token','start','Theme\x20set\x20to:\x20','48XTnUOf','bold','Default\x20servers\x20will\x20be\x20restored\x20on\x20next\x20restart\x20unless\x20you\x20remove\x20them\x20again.','type','./ui/themes.js','stop','setup','Name:\x20','header','dim','Manage\x20Discord\x20integration','Login\x20with\x20your\x20Woozlit\x20account','Configure\x20CLI\x20settings','Manage\x20AI\x20behavior\x20rules','Manage\x20Telegram\x20integration','Not\x20logged\x20in.\x20Use\x20\x27woozlit\x20login\x27\x20to\x20authenticate.','Select\x20AI\x20model','No\x20rules\x20defined','entries','Add\x20an\x20HTTP\x20MCP\x20server\x20(streamable-http)','Login\x20failed\x20or\x20timed\x20out','\x27\x20not\x20found','List\x20all\x20MCP\x20servers','info','#\x20Project\x20Context\x0a\x0aDescribe\x20your\x20project\x20here.\x0a','success','Configure\x20email\x20credentials','Ask\x20a\x20single\x20question','length','./utils/storage.js','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20ALL\x20MCP\x20servers?','delete','Model\x20set\x20to:\x20','MCP\x20Servers','hex','clean','chat\x20[message]','./email/index.js','streamable-http','join','Removed\x20MCP\x20server:\x20','remove-all','#3b82f6','You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.','No\x20MCP\x20servers\x20configured','MCP\x20server\x20\x27','List\x20all\x20rules','2.0.2','\x0aUse\x20\x27woozlit\x20<service>\x20setup\x27\x20to\x20configure\x20services.','refresh','245492JlEoBy','some','327834xJHIsA','command',':\x20[HTTP]\x20','forEach','theme','getStatus','Background\x20Services','Initialize\x20Woozlit\x20in\x20current\x20directory','\x0aConfig\x20file:\x20','./telegram/index.js','yellow','Show\x20current\x20user\x20info','Are\x20you\x20sure\x20you\x20want\x20to\x20completely\x20WIPE\x20all\x20CLI\x20data,\x20rules,\x20and\x20configs?','#\x20Project\x20Rules\x0a\x0aAdd\x20your\x20project-specific\x20rules\x20here.\x0a','Woozlit\x20AI\x20-\x20Agentic\x20Coding\x20Assistant','createSpinner','Rules','Added\x20HTTP\x20MCP\x20server:\x20','3380roAulx','460957vhRvJc','add-http\x20<name>\x20<url>','url','clear','Select\x20UI\x20theme\x20(alias\x20for\x20config\x20theme)','Stopped','telegram','Added\x20stdio\x20MCP\x20server:\x20','reset','Woozlit\x20already\x20initialized\x20in\x20this\x20directory','init','13141280JGvyID','1005884nvjxIL','Remove\x20an\x20MCP\x20server',':\x20[stdio]\x20','config','NODE_TLS_REJECT_UNAUTHORIZED','Logged\x20in\x20as\x20','Start\x20an\x20AI\x20chat\x20session','version','@inquirer/prompts','Running','wipe','Please\x20restart\x20the\x20CLI.','Remove\x20all\x20MCP\x20servers','list','keys','add\x20<name>\x20<command>\x20[args...]','6240RvvVqW','./discord/index.js','whoami','error','All\x20MCP\x20servers\x20removed','Refresh\x20cancelled.','Waiting\x20for\x20authentication...','showLogo','mcp','running','Opening\x20browser\x20for\x20login...','Config\x20file:\x20','stdout','woozlit','./github/index.js','Current\x20User','login','./services/bot-manager.js','name','green','12wfEibM','Already\x20logged\x20in\x20as\x20','./config/mcp.js','N/A','Show\x20status\x20of\x20background\x20services/bots','description','action','rules','Add\x20a\x20stdio\x20MCP\x20server','displayName','Select\x20UI\x20theme','delete-all','remove\x20<name>','parse','warn','Wipe\x20all\x20data,\x20rules,\x20settings,\x20and\x20MCP\x20configs','Initialized\x20Woozlit\x20in\x20current\x20directory','Created\x20.woozlit/rules.md\x20and\x20.woozlit/context.md','All\x20rules\x20cleared','services','Manage\x20MCP\x20servers','337578hfDQxH','aliases','email','write'];a20_0x5668=function(){return _0xc2b6d5;};return a20_0x5668();}const VERSION=a20_0x298f7e(0xc9),program=new Command();process['env'][a20_0x298f7e(0xf1)]='0',program['name'](a20_0x298f7e(0x10a))[a20_0x298f7e(0x116)](a20_0x298f7e(0xdc))[a20_0x298f7e(0xf4)](VERSION)['action'](async()=>{const _0x2a23e4=a20_0x298f7e;ensureDefaultServers();const {botManager:_0x1566c2}=await import(_0x2a23e4(0x10e));await _0x1566c2['startAllConfigured'](),a20_0x430f9e[_0x2a23e4(0x104)](VERSION);if(!isLoggedIn()){a20_0x430f9e[_0x2a23e4(0x11f)](_0x2a23e4(0xc5)),a20_0x430f9e[_0x2a23e4(0x137)](''),a20_0x430f9e[_0x2a23e4(0x145)]('Opening\x20browser\x20for\x20login...');const _0x256608=a20_0x430f9e[_0x2a23e4(0xdd)](_0x2a23e4(0x103));_0x256608['start']();const _0x32cd84=await login();_0x256608[_0x2a23e4(0x133)]();if(!_0x32cd84){a20_0x430f9e['error'](_0x2a23e4(0x142));return;}const _0x4d0a4d=getUser();a20_0x430f9e[_0x2a23e4(0x147)]('Logged\x20in\x20as\x20'+(_0x4d0a4d[_0x2a23e4(0x11a)]||_0x4d0a4d[_0x2a23e4(0x128)]));}await startChat();}),program['command'](a20_0x298f7e(0x10d))[a20_0x298f7e(0x116)](a20_0x298f7e(0x139))[a20_0x298f7e(0x117)](async()=>{const _0x18a4e8=a20_0x298f7e;if(isLoggedIn()){const _0x37f61c=getUser();a20_0x430f9e[_0x18a4e8(0x145)](_0x18a4e8(0x112)+_0x37f61c[_0x18a4e8(0x128)]);return;}a20_0x430f9e[_0x18a4e8(0x145)](_0x18a4e8(0x107));const _0x41a220=a20_0x430f9e[_0x18a4e8(0xdd)](_0x18a4e8(0x103));_0x41a220[_0x18a4e8(0x12c)]();const _0x25c328=await login();_0x41a220[_0x18a4e8(0x133)]();if(_0x25c328){const _0x37b58c=getUser();a20_0x430f9e[_0x18a4e8(0x147)](_0x18a4e8(0xf2)+(_0x37b58c['displayName']||_0x37b58c[_0x18a4e8(0x128)]));}else a20_0x430f9e['error'](_0x18a4e8(0x142));}),program[a20_0x298f7e(0xcf)]('logout')[a20_0x298f7e(0x116)]('Logout\x20from\x20your\x20Woozlit\x20account')['action'](()=>{const _0x283d82=a20_0x298f7e;logout(),a20_0x430f9e[_0x283d82(0x147)]('Logged\x20out\x20successfully');}),program[a20_0x298f7e(0xcf)](a20_0x298f7e(0xff))[a20_0x298f7e(0x116)](a20_0x298f7e(0xd9))['action'](()=>{const _0x38f825=a20_0x298f7e;if(!isLoggedIn()){a20_0x430f9e[_0x38f825(0x11f)](_0x38f825(0x13d));return;}const _0x16f963=getUser();a20_0x430f9e['header'](_0x38f825(0x10c)),a20_0x430f9e[_0x38f825(0x145)](_0x38f825(0x135)+(_0x16f963[_0x38f825(0x11a)]||_0x38f825(0x114))),a20_0x430f9e['info']('Email:\x20'+(_0x16f963['email']||_0x38f825(0x114))),a20_0x430f9e[_0x38f825(0x145)]('Model:\x20'+getSelectedModel());}),program[a20_0x298f7e(0xcf)](a20_0x298f7e(0xbe))['description'](a20_0x298f7e(0xf3))[a20_0x298f7e(0x117)](async _0x26cee3=>{const _0x4c98aa=a20_0x298f7e;a20_0x430f9e[_0x4c98aa(0x104)](VERSION);if(!isLoggedIn()){a20_0x430f9e[_0x4c98aa(0x11f)](_0x4c98aa(0xc5)),a20_0x430f9e[_0x4c98aa(0x137)](''),a20_0x430f9e[_0x4c98aa(0x145)]('Opening\x20browser\x20for\x20login...');const _0x188d79=a20_0x430f9e[_0x4c98aa(0xdd)]('Waiting\x20for\x20authentication...');_0x188d79[_0x4c98aa(0x12c)]();const _0x5f19ba=await login();_0x188d79['stop']();if(!_0x5f19ba){a20_0x430f9e[_0x4c98aa(0x100)](_0x4c98aa(0x142));return;}const _0x5a4a34=getUser();a20_0x430f9e['success'](_0x4c98aa(0xf2)+(_0x5a4a34['displayName']||_0x5a4a34['email']));}await startChat(_0x26cee3);}),program[a20_0x298f7e(0xcf)]('ask\x20<message>')[a20_0x298f7e(0x116)](a20_0x298f7e(0x149))[a20_0x298f7e(0x117)](async _0x4ec03=>{const _0x564c94=a20_0x298f7e;a20_0x430f9e[_0x564c94(0x104)](VERSION);if(!isLoggedIn()){a20_0x430f9e[_0x564c94(0x11f)](_0x564c94(0xc5)),a20_0x430f9e[_0x564c94(0x137)](''),a20_0x430f9e[_0x564c94(0x145)](_0x564c94(0x107));const _0x191c55=a20_0x430f9e[_0x564c94(0xdd)](_0x564c94(0x103));_0x191c55[_0x564c94(0x12c)]();const _0x25aa8e=await login();_0x191c55[_0x564c94(0x133)]();if(!_0x25aa8e){a20_0x430f9e['error']('Login\x20failed\x20or\x20timed\x20out');return;}const _0x21a785=getUser();a20_0x430f9e[_0x564c94(0x147)](_0x564c94(0xf2)+(_0x21a785['displayName']||_0x21a785['email']));}await startChat(_0x4ec03);});const configCmd=program['command'](a20_0x298f7e(0xf0))[a20_0x298f7e(0x116)](a20_0x298f7e(0x13a));configCmd['command']('model')[a20_0x298f7e(0x116)](a20_0x298f7e(0x13e))[a20_0x298f7e(0x117)](async()=>{const _0xe9ccd2=a20_0x298f7e,_0x31943e=await selectModel();a20_0x430f9e['success'](_0xe9ccd2(0x14e)+_0x31943e);}),configCmd[a20_0x298f7e(0xcf)](a20_0x298f7e(0xd2))['description'](a20_0x298f7e(0x11b))[a20_0x298f7e(0x117)](async()=>{const _0x1aa2d8=a20_0x298f7e,{selectTheme:_0x20a334}=await import(_0x1aa2d8(0x132)),_0x5f3bd0=await _0x20a334();a20_0x430f9e[_0x1aa2d8(0x147)](_0x1aa2d8(0x12d)+_0x5f3bd0);}),program['command'](a20_0x298f7e(0xd2))[a20_0x298f7e(0x116)](a20_0x298f7e(0xe5))['action'](async()=>{const _0x5017a8=a20_0x298f7e,{selectTheme:_0x1e87dd}=await import(_0x5017a8(0x132)),_0x261221=await _0x1e87dd();a20_0x430f9e[_0x5017a8(0x147)](_0x5017a8(0x12d)+_0x261221);});const rulesCmd=program[a20_0x298f7e(0xcf)](a20_0x298f7e(0x118))[a20_0x298f7e(0x116)](a20_0x298f7e(0x13b));rulesCmd[a20_0x298f7e(0xcf)](a20_0x298f7e(0xfa))[a20_0x298f7e(0x116)](a20_0x298f7e(0xc8))[a20_0x298f7e(0x117)](()=>{const _0x213746=a20_0x298f7e,_0x179fd=listRules();if(_0x179fd[_0x213746(0x14a)]===0x0){a20_0x430f9e[_0x213746(0x145)](_0x213746(0x13f));return;}a20_0x430f9e[_0x213746(0x136)](_0x213746(0xde)),_0x179fd['forEach']((_0x1366c4,_0x1f5ed9)=>{const _0x54ea9b=_0x213746;process[_0x54ea9b(0x109)][_0x54ea9b(0x129)](_0x1f5ed9+0x1+'.\x20'+_0x1366c4+'\x0a');});}),rulesCmd[a20_0x298f7e(0xcf)]('add\x20<rule>')[a20_0x298f7e(0x116)]('Add\x20a\x20new\x20rule')[a20_0x298f7e(0x117)](_0x17ba8b=>{const _0xb9000e=a20_0x298f7e;addRule(_0x17ba8b),a20_0x430f9e[_0xb9000e(0x147)]('Added\x20rule:\x20'+_0x17ba8b);})[a20_0x298f7e(0x117)](()=>{const _0x266533=a20_0x298f7e;clearRules(),a20_0x430f9e[_0x266533(0x147)](_0x266533(0x123));});const mcpCmd=program[a20_0x298f7e(0xcf)](a20_0x298f7e(0x105))[a20_0x298f7e(0x116)](a20_0x298f7e(0x125));mcpCmd[a20_0x298f7e(0xcf)]('list')[a20_0x298f7e(0x116)](a20_0x298f7e(0x144))['action'](()=>{const _0x4777b8=a20_0x298f7e,_0x1ab990=getMcpServers(),_0x4aeeb9=Object[_0x4777b8(0xfb)](_0x1ab990);if(_0x4aeeb9[_0x4777b8(0x14a)]===0x0){a20_0x430f9e[_0x4777b8(0x145)](_0x4777b8(0xc6)),a20_0x430f9e[_0x4777b8(0x137)](_0x4777b8(0x108)+getConfigFilePath());return;}a20_0x430f9e['header'](_0x4777b8(0xbb)),_0x4aeeb9[_0x4777b8(0xd1)](_0x1d9f27=>{const _0x35bcba=_0x4777b8,_0x231ec2=_0x1ab990[_0x1d9f27];_0x231ec2[_0x35bcba(0x131)]===_0x35bcba(0xc0)?a20_0x430f9e[_0x35bcba(0x145)]('-\x20'+_0x1d9f27+_0x35bcba(0xd0)+_0x231ec2[_0x35bcba(0xe3)]):a20_0x430f9e[_0x35bcba(0x145)]('-\x20'+_0x1d9f27+_0x35bcba(0xef)+_0x231ec2[_0x35bcba(0xcf)]+'\x20'+(_0x231ec2['args']?.[_0x35bcba(0xc1)]('\x20')||''));}),a20_0x430f9e['dim'](_0x4777b8(0xd6)+getConfigFilePath()),a20_0x430f9e[_0x4777b8(0x137)]('You\x20can\x20also\x20add\x20servers\x20via\x20mcp.json\x20in\x20your\x20project\x20directory');}),mcpCmd[a20_0x298f7e(0xcf)](a20_0x298f7e(0xfc))['description'](a20_0x298f7e(0x119))[a20_0x298f7e(0x117)]((_0x41b115,_0xf2ea6c,_0xf0c6c4)=>{const _0x4eabf5=a20_0x298f7e;addMcpServer(_0x41b115,_0xf2ea6c,_0xf0c6c4),a20_0x430f9e['success'](_0x4eabf5(0xe8)+_0x41b115);}),mcpCmd['command'](a20_0x298f7e(0xe2))['description'](a20_0x298f7e(0x141))[a20_0x298f7e(0x117)]((_0xb20170,_0x33e02d)=>{const _0x1157f9=a20_0x298f7e;addMcpHttpServer(_0xb20170,_0x33e02d),a20_0x430f9e['success'](_0x1157f9(0xdf)+_0xb20170),a20_0x430f9e[_0x1157f9(0x137)]('URL:\x20'+_0x33e02d);}),mcpCmd['command'](a20_0x298f7e(0x11d))['aliases']([a20_0x298f7e(0x14d),'rm'])[a20_0x298f7e(0x116)](a20_0x298f7e(0xee))[a20_0x298f7e(0x117)](_0x2b7487=>{const _0x63f606=a20_0x298f7e;removeMcpServer(_0x2b7487)?a20_0x430f9e[_0x63f606(0x147)](_0x63f606(0xc2)+_0x2b7487):a20_0x430f9e[_0x63f606(0x100)](_0x63f606(0xc7)+_0x2b7487+_0x63f606(0x143));}),mcpCmd[a20_0x298f7e(0xcf)](a20_0x298f7e(0xc3))[a20_0x298f7e(0x127)]([a20_0x298f7e(0x11c),a20_0x298f7e(0xe4)])['description'](a20_0x298f7e(0xf9))[a20_0x298f7e(0x117)](async()=>{const _0x174dde=a20_0x298f7e,{confirm:_0x4c6494}=await import(_0x174dde(0xf5)),_0xcde801=await _0x4c6494({'message':_0x174dde(0x14c),'default':![]});_0xcde801?(clearMcpServers(),a20_0x430f9e[_0x174dde(0x147)](_0x174dde(0x101)),a20_0x430f9e['dim'](_0x174dde(0x130))):a20_0x430f9e['info']('Operation\x20cancelled');}),program[a20_0x298f7e(0xcf)](a20_0x298f7e(0xcb))['aliases']([a20_0x298f7e(0xe9),a20_0x298f7e(0xf7),a20_0x298f7e(0xbd)])[a20_0x298f7e(0x116)](a20_0x298f7e(0x120))[a20_0x298f7e(0x117)](async()=>{const _0x308d7b=a20_0x298f7e,{confirm:_0x5ad36e}=await import(_0x308d7b(0xf5)),_0x22f570=await _0x5ad36e({'message':a20_0x56d84c[_0x308d7b(0x12f)]['hex'](_0x308d7b(0xc4))(_0x308d7b(0xda)),'default':![],'theme':{'prefix':{'idle':a20_0x56d84c[_0x308d7b(0x12f)]['hex'](_0x308d7b(0xc4))('>'),'done':a20_0x56d84c[_0x308d7b(0xbc)](_0x308d7b(0xc4))('●')}}});if(_0x22f570){const {wipeAll:_0x48d63e}=await import(_0x308d7b(0x14b));_0x48d63e();try{const {clearMcpServers:_0x13587a}=await import(_0x308d7b(0x113));_0x13587a();}catch(_0x226436){}a20_0x430f9e[_0x308d7b(0x147)]('All\x20data,\x20configs,\x20and\x20MCP\x20servers\x20have\x20been\x20wiped.'),a20_0x430f9e[_0x308d7b(0x137)](_0x308d7b(0xf8));}else a20_0x430f9e['info'](_0x308d7b(0x102));}),program[a20_0x298f7e(0xcf)](a20_0x298f7e(0xeb))['description'](a20_0x298f7e(0xd5))[a20_0x298f7e(0x117)](()=>{const _0x2d8fd8=a20_0x298f7e,_0x5412db=listDirectory('.'),_0x276d41=_0x5412db[_0x2d8fd8(0x140)]?.[_0x2d8fd8(0xcd)](_0x110fd4=>_0x110fd4[_0x2d8fd8(0x10f)]==='.woozlit');if(_0x276d41){a20_0x430f9e[_0x2d8fd8(0x11f)](_0x2d8fd8(0xea));return;}createFile('.woozlit/rules.md',_0x2d8fd8(0xdb)),createFile('.woozlit/context.md',_0x2d8fd8(0x146)),a20_0x430f9e[_0x2d8fd8(0x147)](_0x2d8fd8(0x121)),a20_0x430f9e['dim'](_0x2d8fd8(0x122));}),program[a20_0x298f7e(0xcf)](a20_0x298f7e(0x124))[a20_0x298f7e(0x116)](a20_0x298f7e(0x115))[a20_0x298f7e(0x117)](async()=>{const _0x1531fd=a20_0x298f7e,{botManager:_0x368a8f}=await import(_0x1531fd(0x10e)),_0x2f0c68=_0x368a8f[_0x1531fd(0xd3)]();a20_0x430f9e[_0x1531fd(0x136)](_0x1531fd(0xd4));if(_0x2f0c68[_0x1531fd(0x14a)]===0x0){a20_0x430f9e[_0x1531fd(0x145)]('No\x20services\x20registered.');return;}_0x2f0c68[_0x1531fd(0xd1)](_0x5515aa=>{const _0x3a50fe=_0x1531fd,_0x588ef3=_0x5515aa[_0x3a50fe(0x106)]?a20_0x56d84c[_0x3a50fe(0x110)](_0x3a50fe(0xf6)):_0x5515aa[_0x3a50fe(0x12a)]?a20_0x56d84c[_0x3a50fe(0xd8)](_0x3a50fe(0xe6)):a20_0x56d84c['gray']('Not\x20Configured');a20_0x430f9e[_0x3a50fe(0x145)]('-\x20'+_0x5515aa[_0x3a50fe(0x10f)]+':\x20'+_0x588ef3);}),a20_0x430f9e[_0x1531fd(0x137)](_0x1531fd(0xca));});const discordCmd=program[a20_0x298f7e(0xcf)]('discord')[a20_0x298f7e(0x116)](a20_0x298f7e(0x138));discordCmd[a20_0x298f7e(0xcf)](a20_0x298f7e(0x134))['description'](a20_0x298f7e(0x12b))[a20_0x298f7e(0x117)](async()=>{const _0x4b21cb=a20_0x298f7e,{setupDiscord:_0x3edc6d}=await import(_0x4b21cb(0xfe));await _0x3edc6d();});const githubCmd=program[a20_0x298f7e(0xcf)]('github\x20[subcmd]')[a20_0x298f7e(0x116)]('Manage\x20GitHub\x20tool\x20integration')['action'](async _0xc52d1d=>{const _0x8eb955=a20_0x298f7e,{handleGitHubCommand:_0x121fec}=await import(_0x8eb955(0x10b));await _0x121fec(_0xc52d1d||'');}),telegramCmd=program['command'](a20_0x298f7e(0xe7))[a20_0x298f7e(0x116)](a20_0x298f7e(0x13c));telegramCmd['command'](a20_0x298f7e(0x134))['description']('Configure\x20Telegram\x20Bot\x20Token')[a20_0x298f7e(0x117)](async()=>{const _0x3c5f98=a20_0x298f7e,{setupTelegram:_0x24cb5}=await import(_0x3c5f98(0xd7));await _0x24cb5();});const emailCmd=program['command'](a20_0x298f7e(0x128))[a20_0x298f7e(0x116)]('Manage\x20Email\x20integration');emailCmd['command'](a20_0x298f7e(0x134))['description'](a20_0x298f7e(0x148))[a20_0x298f7e(0x117)](async()=>{const _0x4f9a1a=a20_0x298f7e,{setupEmail:_0x4cbe70}=await import(_0x4f9a1a(0xbf));await _0x4cbe70();}),program[a20_0x298f7e(0x11e)]();
@@ -1 +1 @@
1
- const a5_0x300a07=a5_0xc79e;(function(_0x496901,_0x5590f8){const _0x27fa30=a5_0xc79e,_0x161ade=_0x496901();while(!![]){try{const _0x20807b=-parseInt(_0x27fa30(0x1cf))/0x1+parseInt(_0x27fa30(0x1c3))/0x2*(-parseInt(_0x27fa30(0x1db))/0x3)+parseInt(_0x27fa30(0x1ca))/0x4*(-parseInt(_0x27fa30(0x1d7))/0x5)+-parseInt(_0x27fa30(0x1c0))/0x6*(parseInt(_0x27fa30(0x1e1))/0x7)+parseInt(_0x27fa30(0x1d9))/0x8+-parseInt(_0x27fa30(0x1e7))/0x9*(parseInt(_0x27fa30(0x1cd))/0xa)+parseInt(_0x27fa30(0x1b0))/0xb;if(_0x20807b===_0x5590f8)break;else _0x161ade['push'](_0x161ade['shift']());}catch(_0x1767ae){_0x161ade['push'](_0x161ade['shift']());}}}(a5_0x4058,0xa26f2));import{Server}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema}from'@modelcontextprotocol/sdk/types.js';import{Jimp}from'jimp';import{createRequire}from'module';const require=createRequire(import.meta.url);let robot,screenshot;function a5_0xc79e(_0x54938b,_0x347f1f){_0x54938b=_0x54938b-0x1ac;const _0x4058ad=a5_0x4058();let _0xc79ed9=_0x4058ad[_0x54938b];return _0xc79ed9;}try{robot=require('robotjs');}catch(a5_0x274597){}try{screenshot=require(a5_0x300a07(0x1dd));}catch(a5_0x10cf30){}const AUTO=-0x1,MIME_JPEG=a5_0x300a07(0x1b5),server=new Server({'name':a5_0x300a07(0x1ae),'version':a5_0x300a07(0x1c2)},{'capabilities':{'tools':{}}});function a5_0x4058(){const _0x287e0f=['computer_mouse_move','Text\x20to\x20type','computer_mouse_click','198624gYBsiS','Typed:\x20\x22','1.0.0','4NFXFdX','resize','Screenshot\x20taken.','boolean','typeString','Take\x20a\x20screenshot\x20of\x20the\x20primary\x20display.\x20Returns\x20base64\x20encoded\x20image.','computer_type','16mcYGHu','height','\x20(double)','412660QuRyXP','object','686995nsziWV','Moved\x20mouse\x20to\x20','Modifier\x20keys','Error:\x20','Clicked\x20','X\x20coordinate','alt','Click\x20the\x20mouse\x20button.','1034760BMAUse','key','8107760oKQVsK','\x20button','1214487KVEPxh','Y\x20coordinate','screenshot-desktop','Unknown\x20tool:\x20','toString','Type\x20a\x20string\x20of\x20text.','91KEoYoT','read','computer_screenshot','keyTap','string','Screen\x20size:\x20','9gjpsYc','shift','bitmap','array','getBuffer','computer-use','Tap\x20a\x20single\x20key\x20with\x20optional\x20modifiers.','26927329Ileghv','control','computer_key_tap','width','computer_screen_size','image/jpeg','image','join','left','text','Move\x20the\x20mouse\x20cursor\x20to\x20specific\x20coordinates.','number','with\x20'];a5_0x4058=function(){return _0x287e0f;};return a5_0x4058();}server['setRequestHandler'](ListToolsRequestSchema,async()=>{const _0x573072=a5_0x300a07;return{'tools':[{'name':_0x573072(0x1e3),'description':_0x573072(0x1c8),'inputSchema':{'type':_0x573072(0x1ce),'properties':{}}},{'name':'computer_mouse_move','description':_0x573072(0x1ba),'inputSchema':{'type':_0x573072(0x1ce),'properties':{'x':{'type':_0x573072(0x1bb),'description':_0x573072(0x1d4)},'y':{'type':_0x573072(0x1bb),'description':_0x573072(0x1dc)}},'required':['x','y']}},{'name':'computer_mouse_click','description':_0x573072(0x1d6),'inputSchema':{'type':'object','properties':{'button':{'type':_0x573072(0x1e5),'enum':[_0x573072(0x1b8),'right','middle'],'default':_0x573072(0x1b8)},'double':{'type':_0x573072(0x1c6),'default':![]}}}},{'name':_0x573072(0x1c9),'description':_0x573072(0x1e0),'inputSchema':{'type':_0x573072(0x1ce),'properties':{'text':{'type':_0x573072(0x1e5),'description':_0x573072(0x1be)}},'required':[_0x573072(0x1b9)]}},{'name':_0x573072(0x1b2),'description':_0x573072(0x1af),'inputSchema':{'type':'object','properties':{'key':{'type':_0x573072(0x1e5),'description':'Key\x20to\x20tap\x20(e.g.\x20\x27enter\x27,\x20\x27a\x27,\x20\x27backspace\x27)'},'modifiers':{'type':_0x573072(0x1ac),'items':{'type':_0x573072(0x1e5),'enum':[_0x573072(0x1d5),'command',_0x573072(0x1b1),_0x573072(0x1e8)]},'description':_0x573072(0x1d1)}},'required':[_0x573072(0x1d8)]}},{'name':_0x573072(0x1b4),'description':'Get\x20the\x20screen\x20resolution.','inputSchema':{'type':_0x573072(0x1ce),'properties':{}}}]};}),server['setRequestHandler'](CallToolRequestSchema,async _0x41a06a=>{const _0x36a586=a5_0x300a07,{name:_0x27baf8,arguments:_0x3b4791}=_0x41a06a['params'];try{if(_0x27baf8===_0x36a586(0x1e3)){const _0x1a9b7c=await screenshot(),_0xd7f513=await Jimp[_0x36a586(0x1e2)](_0x1a9b7c);_0xd7f513[_0x36a586(0x1e9)]['width']>0x400&&_0xd7f513[_0x36a586(0x1c4)]({'w':0x400});const _0x190eca=await _0xd7f513[_0x36a586(0x1ad)](MIME_JPEG),_0x50a111=_0x190eca[_0x36a586(0x1df)]('base64');return{'content':[{'type':_0x36a586(0x1b9),'text':_0x36a586(0x1c5)},{'type':_0x36a586(0x1b6),'data':_0x50a111,'mimeType':_0x36a586(0x1b5)}]};}if(_0x27baf8===_0x36a586(0x1bd)){const {x:_0x14872c,y:_0x9d9063}=_0x3b4791;return robot['moveMouse'](_0x14872c,_0x9d9063),{'content':[{'type':'text','text':_0x36a586(0x1d0)+_0x14872c+',\x20'+_0x9d9063}]};}if(_0x27baf8===_0x36a586(0x1bf)){const {button:button=_0x36a586(0x1b8),double:double=![]}=_0x3b4791;return robot['mouseClick'](button,double),{'content':[{'type':'text','text':_0x36a586(0x1d3)+button+_0x36a586(0x1da)+(double?_0x36a586(0x1cc):'')}]};}if(_0x27baf8==='computer_type'){const {text:_0xa4979e}=_0x3b4791;return robot[_0x36a586(0x1c7)](_0xa4979e),{'content':[{'type':_0x36a586(0x1b9),'text':_0x36a586(0x1c1)+_0xa4979e+'\x22'}]};}if(_0x27baf8==='computer_key_tap'){const {key:_0x7d211,modifiers:_0x2a9d0c}=_0x3b4791;return robot[_0x36a586(0x1e4)](_0x7d211,_0x2a9d0c),{'content':[{'type':'text','text':'Tapped\x20key:\x20'+_0x7d211+'\x20'+(_0x2a9d0c?_0x36a586(0x1bc)+_0x2a9d0c[_0x36a586(0x1b7)]('+'):'')}]};}if(_0x27baf8===_0x36a586(0x1b4)){const _0x432003=robot['getScreenSize']();return{'content':[{'type':'text','text':_0x36a586(0x1e6)+_0x432003[_0x36a586(0x1b3)]+'x'+_0x432003[_0x36a586(0x1cb)]}]};}throw new Error(_0x36a586(0x1de)+_0x27baf8);}catch(_0x138d3e){return{'content':[{'type':_0x36a586(0x1b9),'text':_0x36a586(0x1d2)+_0x138d3e}],'isError':!![]};}});const transport=new StdioServerTransport();await server['connect'](transport);
1
+ const a21_0x3f44d5=a21_0x6129;(function(_0x384a0d,_0x4d5cbe){const _0x2ec476=a21_0x6129,_0xd1b3bd=_0x384a0d();while(!![]){try{const _0xd37041=-parseInt(_0x2ec476(0x194))/0x1*(parseInt(_0x2ec476(0x17a))/0x2)+-parseInt(_0x2ec476(0x186))/0x3*(parseInt(_0x2ec476(0x159))/0x4)+-parseInt(_0x2ec476(0x173))/0x5*(-parseInt(_0x2ec476(0x161))/0x6)+parseInt(_0x2ec476(0x151))/0x7+-parseInt(_0x2ec476(0x156))/0x8*(-parseInt(_0x2ec476(0x187))/0x9)+-parseInt(_0x2ec476(0x16e))/0xa+-parseInt(_0x2ec476(0x164))/0xb*(-parseInt(_0x2ec476(0x15f))/0xc);if(_0xd37041===_0x4d5cbe)break;else _0xd1b3bd['push'](_0xd1b3bd['shift']());}catch(_0x482805){_0xd1b3bd['push'](_0xd1b3bd['shift']());}}}(a21_0x22e8,0xe4200));function a21_0x22e8(){const _0x41d165=['join','string','capture','params','Moved\x20mouse\x20to\x20','Type\x20a\x20string\x20of\x20text.','Typed:\x20\x22','3HwoWUF','7846785MtzSsO','computer_mouse_click','boolean','object','moveMouse','computer_type','computer_screenshot','@hurdlegroup/robotjs','height','resize','Tap\x20a\x20single\x20key\x20with\x20optional\x20modifiers.','\x20(double)','connect','63johgKQ','7370118rNHRDl','Key\x20to\x20tap\x20(e.g.\x20\x27enter\x27,\x20\x27a\x27,\x20\x27backspace\x27)','typeString','getScreenSize','toString','8UEgRSe','image/jpeg','text','3906360qpjlxc','Move\x20the\x20mouse\x20cursor\x20to\x20specific\x20coordinates.','computer_screen_size','array','mouseClick','shift','12780UNLpWM','image','366NGFiay','keyTap','Tapped\x20key:\x20','9933aBBxfB','Unknown\x20tool:\x20','setRequestHandler','control','left','1.0.0','Get\x20the\x20screen\x20resolution.','bitmap','screen','Screenshot\x20taken.','13668340mEPEph','data','getBuffer','Error:\x20','key','76145biiFiO','right','Y\x20coordinate','width','Take\x20a\x20screenshot\x20of\x20the\x20primary\x20display.\x20Returns\x20base64\x20encoded\x20image.','alt','Text\x20to\x20type','17066SXzpmu','Modifier\x20keys','command','base64','Clicked\x20'];a21_0x22e8=function(){return _0x41d165;};return a21_0x22e8();}import{Server}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema}from'@modelcontextprotocol/sdk/types.js';import{Jimp}from'jimp';import{createRequire}from'module';function a21_0x6129(_0x5ae5d0,_0x4399da){_0x5ae5d0=_0x5ae5d0-0x151;const _0x22e8aa=a21_0x22e8();let _0x612900=_0x22e8aa[_0x5ae5d0];return _0x612900;}const require=createRequire(import.meta.url);let robot;try{robot=require(a21_0x3f44d5(0x18e));}catch(a21_0x4df26b){}const AUTO=-0x1,MIME_JPEG=a21_0x3f44d5(0x157),server=new Server({'name':'computer-use','version':a21_0x3f44d5(0x169)},{'capabilities':{'tools':{}}});server[a21_0x3f44d5(0x166)](ListToolsRequestSchema,async()=>{const _0xefec7b=a21_0x3f44d5;return{'tools':[{'name':_0xefec7b(0x18d),'description':_0xefec7b(0x177),'inputSchema':{'type':_0xefec7b(0x18a),'properties':{}}},{'name':'computer_mouse_move','description':_0xefec7b(0x15a),'inputSchema':{'type':_0xefec7b(0x18a),'properties':{'x':{'type':'number','description':'X\x20coordinate'},'y':{'type':'number','description':_0xefec7b(0x175)}},'required':['x','y']}},{'name':_0xefec7b(0x188),'description':'Click\x20the\x20mouse\x20button.','inputSchema':{'type':'object','properties':{'button':{'type':_0xefec7b(0x180),'enum':['left',_0xefec7b(0x174),'middle'],'default':_0xefec7b(0x168)},'double':{'type':_0xefec7b(0x189),'default':![]}}}},{'name':_0xefec7b(0x18c),'description':_0xefec7b(0x184),'inputSchema':{'type':_0xefec7b(0x18a),'properties':{'text':{'type':'string','description':_0xefec7b(0x179)}},'required':[_0xefec7b(0x158)]}},{'name':'computer_key_tap','description':_0xefec7b(0x191),'inputSchema':{'type':_0xefec7b(0x18a),'properties':{'key':{'type':_0xefec7b(0x180),'description':_0xefec7b(0x152)},'modifiers':{'type':_0xefec7b(0x15c),'items':{'type':_0xefec7b(0x180),'enum':[_0xefec7b(0x178),_0xefec7b(0x17c),_0xefec7b(0x167),_0xefec7b(0x15e)]},'description':_0xefec7b(0x17b)}},'required':[_0xefec7b(0x172)]}},{'name':'computer_screen_size','description':_0xefec7b(0x16a),'inputSchema':{'type':_0xefec7b(0x18a),'properties':{}}}]};}),server[a21_0x3f44d5(0x166)](CallToolRequestSchema,async _0x450ac5=>{const _0x4eb2f8=a21_0x3f44d5,{name:_0x42dcf6,arguments:_0x20dcb3}=_0x450ac5[_0x4eb2f8(0x182)];try{if(_0x42dcf6===_0x4eb2f8(0x18d)){const _0x59f380=robot[_0x4eb2f8(0x154)](),_0x1951b8=robot[_0x4eb2f8(0x16c)][_0x4eb2f8(0x181)](0x0,0x0,_0x59f380['width'],_0x59f380[_0x4eb2f8(0x18f)]),_0x544fb4=new Jimp({'width':_0x1951b8[_0x4eb2f8(0x176)],'height':_0x1951b8['height']});for(let _0xfe37fa=0x0;_0xfe37fa<_0x1951b8['image']['length'];_0xfe37fa+=0x4){_0x544fb4[_0x4eb2f8(0x16b)][_0x4eb2f8(0x16f)][_0xfe37fa]=_0x1951b8[_0x4eb2f8(0x160)][_0xfe37fa+0x2],_0x544fb4[_0x4eb2f8(0x16b)][_0x4eb2f8(0x16f)][_0xfe37fa+0x1]=_0x1951b8[_0x4eb2f8(0x160)][_0xfe37fa+0x1],_0x544fb4[_0x4eb2f8(0x16b)][_0x4eb2f8(0x16f)][_0xfe37fa+0x2]=_0x1951b8[_0x4eb2f8(0x160)][_0xfe37fa],_0x544fb4['bitmap'][_0x4eb2f8(0x16f)][_0xfe37fa+0x3]=_0x1951b8[_0x4eb2f8(0x160)][_0xfe37fa+0x3];}_0x544fb4[_0x4eb2f8(0x16b)][_0x4eb2f8(0x176)]>0x400&&_0x544fb4[_0x4eb2f8(0x190)]({'w':0x400});const _0xd241ff=await _0x544fb4[_0x4eb2f8(0x170)](MIME_JPEG),_0x4cc570=_0xd241ff[_0x4eb2f8(0x155)](_0x4eb2f8(0x17d));return{'content':[{'type':_0x4eb2f8(0x158),'text':_0x4eb2f8(0x16d)},{'type':_0x4eb2f8(0x160),'data':_0x4cc570,'mimeType':_0x4eb2f8(0x157)}]};}if(_0x42dcf6==='computer_mouse_move'){const {x:_0x1eef16,y:_0x3bcab}=_0x20dcb3;return robot[_0x4eb2f8(0x18b)](_0x1eef16,_0x3bcab),{'content':[{'type':'text','text':_0x4eb2f8(0x183)+_0x1eef16+',\x20'+_0x3bcab}]};}if(_0x42dcf6===_0x4eb2f8(0x188)){const {button:button=_0x4eb2f8(0x168),double:double=![]}=_0x20dcb3;return robot[_0x4eb2f8(0x15d)](button,double),{'content':[{'type':_0x4eb2f8(0x158),'text':_0x4eb2f8(0x17e)+button+'\x20button'+(double?_0x4eb2f8(0x192):'')}]};}if(_0x42dcf6===_0x4eb2f8(0x18c)){const {text:_0x4172f2}=_0x20dcb3;return robot[_0x4eb2f8(0x153)](_0x4172f2),{'content':[{'type':'text','text':_0x4eb2f8(0x185)+_0x4172f2+'\x22'}]};}if(_0x42dcf6==='computer_key_tap'){const {key:_0x5e151d,modifiers:_0x5ca4ff}=_0x20dcb3;return robot[_0x4eb2f8(0x162)](_0x5e151d,_0x5ca4ff),{'content':[{'type':_0x4eb2f8(0x158),'text':_0x4eb2f8(0x163)+_0x5e151d+'\x20'+(_0x5ca4ff?'with\x20'+_0x5ca4ff[_0x4eb2f8(0x17f)]('+'):'')}]};}if(_0x42dcf6===_0x4eb2f8(0x15b)){const _0x3b6a77=robot[_0x4eb2f8(0x154)]();return{'content':[{'type':'text','text':'Screen\x20size:\x20'+_0x3b6a77[_0x4eb2f8(0x176)]+'x'+_0x3b6a77[_0x4eb2f8(0x18f)]}]};}throw new Error(_0x4eb2f8(0x165)+_0x42dcf6);}catch(_0x57ae80){return{'content':[{'type':_0x4eb2f8(0x158),'text':_0x4eb2f8(0x171)+_0x57ae80}],'isError':!![]};}});const transport=new StdioServerTransport();await server[a21_0x3f44d5(0x193)](transport);
@@ -0,0 +1,13 @@
1
+ declare class BotManager {
2
+ private services;
3
+ constructor();
4
+ startAllConfigured(): Promise<void>;
5
+ stopAll(): void;
6
+ getStatus(): {
7
+ name: string;
8
+ running: boolean;
9
+ configured: boolean;
10
+ }[];
11
+ }
12
+ export declare const botManager: BotManager;
13
+ export {};
@@ -0,0 +1 @@
1
+ const a22_0x582e7b=a22_0x2b44;(function(_0x401709,_0x1bfa27){const _0x2e411b=a22_0x2b44,_0x59d0dc=_0x401709();while(!![]){try{const _0x116b70=-parseInt(_0x2e411b(0xba))/0x1+-parseInt(_0x2e411b(0xc1))/0x2+parseInt(_0x2e411b(0xcc))/0x3+parseInt(_0x2e411b(0xbb))/0x4*(-parseInt(_0x2e411b(0xbc))/0x5)+parseInt(_0x2e411b(0xbe))/0x6+parseInt(_0x2e411b(0xb4))/0x7+-parseInt(_0x2e411b(0xca))/0x8*(parseInt(_0x2e411b(0xb2))/0x9);if(_0x116b70===_0x1bfa27)break;else _0x59d0dc['push'](_0x59d0dc['shift']());}catch(_0x5abe40){_0x59d0dc['push'](_0x59d0dc['shift']());}}}(a22_0x4634,0x66ae8));function a22_0x4634(){const _0x9fd5cd=['57070cRgwbf','Telegram','3211104DVUMjy','Discord','map','1226728QyQYJl','stopBot','success','Email','filter','\x20services\x20active\x20in\x20background','startBot','forEach','start','24qMpbdq','dim','1055499fWtPvu','isBotRunning','push','isConfigured','services','getStatus','[Bot\x20Manager]\x20','length','isRunning','309627OIekfW','startAllConfigured','5521684AyGfSe','Failed\x20to\x20start\x20','error','stopAll','\x0a[Bot\x20Manager]\x20Starting\x20background\x20services...','name','162010ugGnve','132osUYST'];a22_0x4634=function(){return _0x9fd5cd;};return a22_0x4634();}import*as a22_0x5e3ced from'../telegram/index.js';import*as a22_0x2f7120 from'../discord/index.js';function a22_0x2b44(_0xaf92f4,_0x193e40){_0xaf92f4=_0xaf92f4-0xb1;const _0x463440=a22_0x4634();let _0x2b44e0=_0x463440[_0xaf92f4];return _0x2b44e0;}import*as a22_0x59d770 from'../email/index.js';import*as a22_0x5262c1 from'../ui/output.js';class BotManager{[a22_0x582e7b(0xd0)]=[];constructor(){const _0x3fd1d3=a22_0x582e7b;this[_0x3fd1d3(0xd0)][_0x3fd1d3(0xce)]({'name':_0x3fd1d3(0xbd),'start':a22_0x5e3ced[_0x3fd1d3(0xc7)],'stop':a22_0x5e3ced[_0x3fd1d3(0xc2)],'isRunning':a22_0x5e3ced[_0x3fd1d3(0xcd)],'isConfigured':a22_0x5e3ced[_0x3fd1d3(0xcf)]}),this[_0x3fd1d3(0xd0)]['push']({'name':_0x3fd1d3(0xbf),'start':a22_0x2f7120['startBot'],'stop':a22_0x2f7120[_0x3fd1d3(0xc2)],'isRunning':a22_0x2f7120[_0x3fd1d3(0xcd)],'isConfigured':a22_0x2f7120[_0x3fd1d3(0xcf)]}),this[_0x3fd1d3(0xd0)][_0x3fd1d3(0xce)]({'name':_0x3fd1d3(0xc4),'start':a22_0x59d770[_0x3fd1d3(0xc7)],'stop':a22_0x59d770[_0x3fd1d3(0xc2)],'isRunning':a22_0x59d770[_0x3fd1d3(0xcd)],'isConfigured':a22_0x59d770[_0x3fd1d3(0xcf)]});}async[a22_0x582e7b(0xb3)](){const _0x2d23d8=a22_0x582e7b,_0xf87a3e=this[_0x2d23d8(0xd0)][_0x2d23d8(0xc5)](_0x238dab=>_0x238dab[_0x2d23d8(0xcf)]());if(_0xf87a3e[_0x2d23d8(0xd3)]===0x0)return;a22_0x5262c1[_0x2d23d8(0xcb)](_0x2d23d8(0xb8));const _0x5d1641=await Promise['all'](_0xf87a3e[_0x2d23d8(0xc0)](async _0x3155bd=>{const _0xb6e0fc=_0x2d23d8;try{if(_0x3155bd[_0xb6e0fc(0xb1)]())return!![];const _0x21f882=await _0x3155bd[_0xb6e0fc(0xc9)]();return _0x21f882;}catch(_0x5136b1){return a22_0x5262c1[_0xb6e0fc(0xb6)](_0xb6e0fc(0xb5)+_0x3155bd['name']+':\x20'+_0x5136b1),![];}})),_0xe9b7af=_0x5d1641[_0x2d23d8(0xc5)](_0x428db2=>_0x428db2)[_0x2d23d8(0xd3)];_0xe9b7af>0x0&&a22_0x5262c1[_0x2d23d8(0xc3)](_0x2d23d8(0xd2)+_0xe9b7af+'/'+_0xf87a3e[_0x2d23d8(0xd3)]+_0x2d23d8(0xc6));}[a22_0x582e7b(0xb7)](){const _0x5af22a=a22_0x582e7b;this['services'][_0x5af22a(0xc8)](_0x27bd7b=>{_0x27bd7b['isRunning']()&&_0x27bd7b['stop']();});}[a22_0x582e7b(0xd1)](){const _0x3a65f2=a22_0x582e7b;return this[_0x3a65f2(0xd0)][_0x3a65f2(0xc0)](_0x448343=>({'name':_0x448343[_0x3a65f2(0xb9)],'running':_0x448343[_0x3a65f2(0xb1)](),'configured':_0x448343[_0x3a65f2(0xcf)]()}));}}export const botManager=new BotManager();
@@ -0,0 +1,6 @@
1
+ export declare function setGeminiKey(key: string): void;
2
+ export declare function getGeminiKey(): string;
3
+ export declare function processVoiceMessage(audioPath: string): Promise<{
4
+ text?: string;
5
+ audioPath?: string;
6
+ }>;
@@ -0,0 +1 @@
1
+ const a23_0x10be43=a23_0x39eb;(function(_0x60954c,_0x16eb89){const _0x114560=a23_0x39eb,_0x1accc4=_0x60954c();while(!![]){try{const _0x3d62b6=-parseInt(_0x114560(0x1be))/0x1+parseInt(_0x114560(0x1ba))/0x2*(parseInt(_0x114560(0x1bd))/0x3)+-parseInt(_0x114560(0x1c5))/0x4+parseInt(_0x114560(0x1c6))/0x5+parseInt(_0x114560(0x1c3))/0x6*(parseInt(_0x114560(0x1c9))/0x7)+-parseInt(_0x114560(0x1b5))/0x8+-parseInt(_0x114560(0x1bc))/0x9;if(_0x3d62b6===_0x16eb89)break;else _0x1accc4['push'](_0x1accc4['shift']());}catch(_0x2971cb){_0x1accc4['push'](_0x1accc4['shift']());}}}(a23_0x4bdc,0x8cbc0));import{GoogleGenerativeAI}from'@google/generative-ai';import{promises as a23_0x2fa1f6}from'fs';import*as a23_0x5ea8de from'../ui/output.js';import a23_0x24c769 from'conf';const config=new a23_0x24c769({'projectName':a23_0x10be43(0x1b8)});export function setGeminiKey(_0x1e994a){const _0x92b20d=a23_0x10be43;config[_0x92b20d(0x1c0)](_0x92b20d(0x1c8),_0x1e994a);}function a23_0x39eb(_0x55b9dc,_0x1e22dc){_0x55b9dc=_0x55b9dc-0x1b3;const _0x4bdcda=a23_0x4bdc();let _0x39eb2d=_0x4bdcda[_0x55b9dc];return _0x39eb2d;}export function getGeminiKey(){const _0x3230fd=a23_0x10be43;return config[_0x3230fd(0x1bb)](_0x3230fd(0x1c8))||'';}export async function processVoiceMessage(_0x5cafbe){const _0x2d7835=a23_0x10be43,_0x413158=getGeminiKey();if(!_0x413158)throw new Error('Gemini\x20API\x20Key\x20not\x20configured.\x20Run\x20\x27/voice\x20setup\x27\x20first.');const _0x2ce6ed=new GoogleGenerativeAI(_0x413158),_0x37f6e1=_0x2ce6ed[_0x2d7835(0x1b7)]({'model':_0x2d7835(0x1b6)});try{const _0x501073=await a23_0x2fa1f6[_0x2d7835(0x1c7)](_0x5cafbe),_0x370ff4=_0x501073[_0x2d7835(0x1c2)](_0x2d7835(0x1c4)),_0x4e64e3=_0x2d7835(0x1ca),_0xce4d74=await _0x37f6e1[_0x2d7835(0x1c1)]([_0x2d7835(0x1cb),{'inlineData':{'mimeType':_0x4e64e3,'data':_0x370ff4}}]),_0x3f33c9=_0xce4d74[_0x2d7835(0x1bf)][_0x2d7835(0x1b9)]();return{'text':_0x3f33c9};}catch(_0x36ba50){a23_0x5ea8de[_0x2d7835(0x1b4)](_0x2d7835(0x1b3)+_0x36ba50['message']);throw _0x36ba50;}}function a23_0x4bdc(){const _0x148ff9=['3wquKeG','182936RIOiQN','response','set','generateContent','toString','6OiWfeh','base64','2760696pPsJpd','4041430CjqSxu','readFile','geminiKey','1425109dnhsTy','audio/ogg','Listen\x20to\x20this\x20audio\x20and\x20respond\x20helpfully.\x20If\x20it\x27s\x20a\x20command,\x20execute\x20it\x20or\x20say\x20you\x20can\x27t.','Voice\x20processing\x20failed:\x20','error','1114560KKTXIL','gemini-2.0-flash-exp','getGenerativeModel','woozlit-cli-voice','text','1334386ReeXGB','get','811692gRYgrk'];a23_0x4bdc=function(){return _0x148ff9;};return a23_0x4bdc();}
@@ -1 +1 @@
1
- const a6_0x597b73=a6_0x16b5;(function(_0x48f806,_0x4e5dbc){const _0x47b818=a6_0x16b5,_0x454e40=_0x48f806();while(!![]){try{const _0x1b1426=-parseInt(_0x47b818(0x226))/0x1*(parseInt(_0x47b818(0x214))/0x2)+parseInt(_0x47b818(0x201))/0x3+-parseInt(_0x47b818(0x260))/0x4*(-parseInt(_0x47b818(0x22e))/0x5)+-parseInt(_0x47b818(0x225))/0x6*(-parseInt(_0x47b818(0x26b))/0x7)+-parseInt(_0x47b818(0x208))/0x8+parseInt(_0x47b818(0x25f))/0x9+parseInt(_0x47b818(0x217))/0xa*(-parseInt(_0x47b818(0x204))/0xb);if(_0x1b1426===_0x4e5dbc)break;else _0x454e40['push'](_0x454e40['shift']());}catch(_0x3e52f2){_0x454e40['push'](_0x454e40['shift']());}}}(a6_0x36c9,0x1ad60));import a6_0x3f1794 from'node-telegram-bot-api';import a6_0xad099c from'screenshot-desktop';import{promises as a6_0x5b778d}from'fs';import{tmpdir}from'os';import{join}from'path';import*as a6_0x176ae4 from'./config.js';import{sendChatMessage}from'../utils/api.js';import{getSelectedModel}from'../utils/storage.js';function a6_0x16b5(_0x31a361,_0x11c5f0){_0x31a361=_0x31a361-0x1ed;const _0x36c9a4=a6_0x36c9();let _0x16b570=_0x36c9a4[_0x31a361];return _0x16b570;}import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess}from'../tools/index.js';import*as a6_0x403592 from'../ui/output.js';let bot=null,isRunning=![];const verifiedSessions=new Set(),statusMessages=new Map(),chatHistories=new Map(),WOOZLIT_DIR=join(process[a6_0x597b73(0x268)][a6_0x597b73(0x20d)]||process[a6_0x597b73(0x268)][a6_0x597b73(0x239)]||'.','.woozlit'),HISTORY_FILE=join(WOOZLIT_DIR,a6_0x597b73(0x22d));async function ensureWoozlitDir(){const _0x32948a=a6_0x597b73;try{await a6_0x5b778d[_0x32948a(0x211)](WOOZLIT_DIR,{'recursive':!![]});}catch{}}async function getTaskHistory(){try{const _0x326129=await a6_0x5b778d['readFile'](HISTORY_FILE,'utf-8');return JSON['parse'](_0x326129);}catch{return[];}}async function saveTaskHistory(_0x2fd4a0,_0x5d0782){const _0x3b9fa4=a6_0x597b73;await ensureWoozlitDir();const _0x5ac93a=await getTaskHistory();_0x5ac93a[_0x3b9fa4(0x25a)]({'timestamp':Date[_0x3b9fa4(0x202)](),'request':_0x2fd4a0,'actionSummary':_0x5d0782});if(_0x5ac93a[_0x3b9fa4(0x1fe)]>0x14)_0x5ac93a[_0x3b9fa4(0x25d)]();await a6_0x5b778d[_0x3b9fa4(0x235)](HISTORY_FILE,JSON[_0x3b9fa4(0x207)](_0x5ac93a,null,0x2));}function formatHistoryForPrompt(_0x4f385c){const _0x21645e=a6_0x597b73;if(_0x4f385c[_0x21645e(0x1fe)]===0x0)return'';return _0x21645e(0x256)+_0x4f385c[_0x21645e(0x242)](-0x5)[_0x21645e(0x206)](_0x364d2a=>_0x21645e(0x20c)+_0x364d2a[_0x21645e(0x264)]+_0x21645e(0x223)+_0x364d2a[_0x21645e(0x22c)]['join'](',\x20'))[_0x21645e(0x267)]('\x0a');}function getSystemPrompt(_0xbf51d4){const _0x79a9ee=a6_0x597b73;return _0x79a9ee(0x222)+_0xbf51d4;}async function getOrCreateHistory(_0x390304){const _0x3c4d48=a6_0x597b73;if(!chatHistories[_0x3c4d48(0x255)](_0x390304)){const _0x244615=await getTaskHistory(),_0x1663d8=formatHistoryForPrompt(_0x244615);chatHistories[_0x3c4d48(0x20e)](_0x390304,[{'role':'system','content':getSystemPrompt(_0x1663d8)}]);}return chatHistories['get'](_0x390304);}async function updateStatus(_0x4e8c2d,_0x5a20e3){const _0x5b69a5=a6_0x597b73;if(!bot)return;const _0x41a6f0=statusMessages[_0x5b69a5(0x1f1)](_0x4e8c2d);if(_0x41a6f0)try{await bot[_0x5b69a5(0x22f)](_0x5a20e3,{'chat_id':_0x4e8c2d,'message_id':_0x41a6f0});return;}catch(_0x19efda){if(_0x19efda[_0x5b69a5(0x25e)]&&_0x19efda['message']['includes'](_0x5b69a5(0x263)))return;statusMessages[_0x5b69a5(0x24f)](_0x4e8c2d);}try{const _0x4b584b=await bot[_0x5b69a5(0x1fc)](_0x4e8c2d,_0x5a20e3);statusMessages[_0x5b69a5(0x20e)](_0x4e8c2d,_0x4b584b[_0x5b69a5(0x23b)]);}catch(_0x12ca85){}}async function takeScreenshot(){const _0x5ee71a=a6_0x597b73,_0x22150f=_0x5ee71a(0x212)+Date[_0x5ee71a(0x202)]()+_0x5ee71a(0x26a),_0x51fc4c=join(tmpdir(),_0x22150f),_0x65f3dd=await a6_0xad099c({'format':'png'});return await a6_0x5b778d[_0x5ee71a(0x235)](_0x51fc4c,_0x65f3dd),_0x51fc4c;}async function executeToolCall(_0x1e291f,_0x19e99f,_0x5e0925){const _0x173fce=a6_0x597b73;switch(_0x1e291f){case _0x173fce(0x241):try{statusMessages[_0x173fce(0x24f)](_0x5e0925);const _0x476c53=await takeScreenshot();return await bot?.[_0x173fce(0x230)](_0x5e0925,_0x476c53,{'caption':'Desktop'}),await a6_0x5b778d[_0x173fce(0x245)](_0x476c53)['catch'](()=>{}),{'success':!![],'sent':!![]};}catch(_0x81ae1b){return{'error':_0x173fce(0x1f0)+_0x81ae1b};}case _0x173fce(0x20b):return readTerminalOutput(_0x19e99f['pid']);case _0x173fce(0x24a):return sendTerminalInput(_0x19e99f['input'],_0x19e99f[_0x173fce(0x22b)]);case _0x173fce(0x262):return terminateProcess(_0x19e99f[_0x173fce(0x22b)]);case _0x173fce(0x251):return createFile(_0x19e99f['path'],_0x19e99f[_0x173fce(0x26e)]);case _0x173fce(0x253):return readFile(_0x19e99f[_0x173fce(0x24e)]);case _0x173fce(0x26f):return listDirectory(_0x19e99f[_0x173fce(0x24e)]||'.');case _0x173fce(0x266):return editFile(_0x19e99f[_0x173fce(0x24e)],_0x19e99f[_0x173fce(0x21e)],_0x19e99f[_0x173fce(0x26c)]);case _0x173fce(0x24d):return searchFile(_0x19e99f['path'],_0x19e99f[_0x173fce(0x1ed)]);case _0x173fce(0x215):const {command:_0x735cc9,background:_0x4c7227,wait:_0x282248}=_0x19e99f,_0x2f29da=await runCommand(_0x735cc9,_0x560274=>{const _0x106b38=_0x173fce;a6_0x403592[_0x106b38(0x25c)](_0x560274);},_0x4c7227||![],_0x282248||0x7530);return _0x2f29da;default:return{'error':'Unknown\x20tool:\x20'+_0x1e291f};}}function estimateTime(_0x2ee591,_0x16e9cf){const _0x49537a=a6_0x597b73;if(_0x2ee591===_0x49537a(0x241))return'~2s';if(_0x2ee591===_0x49537a(0x20b)||_0x2ee591===_0x49537a(0x24a)||_0x2ee591===_0x49537a(0x262))return _0x49537a(0x1ef);if(_0x2ee591===_0x49537a(0x215)){const _0x383d48=(_0x16e9cf[_0x49537a(0x20a)]||'')[_0x49537a(0x23e)]();if(_0x383d48[_0x49537a(0x21d)](_0x49537a(0x22a))||_0x383d48[_0x49537a(0x21d)](_0x49537a(0x26d)))return'~2-3\x20min';if(_0x383d48['includes']('npm\x20install')||_0x383d48[_0x49537a(0x21d)](_0x49537a(0x250)))return _0x49537a(0x237);if(_0x383d48[_0x49537a(0x21d)](_0x49537a(0x227))||_0x383d48[_0x49537a(0x21d)](_0x49537a(0x234)))return _0x49537a(0x1f2);if(_0x383d48[_0x49537a(0x21d)](_0x49537a(0x25b)))return _0x49537a(0x1f7);if(_0x383d48[_0x49537a(0x21d)](_0x49537a(0x1f8)))return _0x49537a(0x237);}return _0x49537a(0x1f5);}function getActionDescription(_0x5b2daf,_0x25d338){const _0x4a647c=a6_0x597b73;if(_0x5b2daf===_0x4a647c(0x215)){let _0x16045=_0x25d338[_0x4a647c(0x20a)]||'command';if(_0x16045[_0x4a647c(0x1fe)]>0x1e)_0x16045=_0x16045[_0x4a647c(0x23f)](0x0,0x1b)+_0x4a647c(0x233);return'Running:\x20'+_0x16045;}if(_0x5b2daf==='create_file')return _0x4a647c(0x1f6)+_0x25d338[_0x4a647c(0x24e)];if(_0x5b2daf===_0x4a647c(0x266))return _0x4a647c(0x23c)+_0x25d338[_0x4a647c(0x24e)];if(_0x5b2daf===_0x4a647c(0x241))return'Taking\x20screenshot...';return _0x4a647c(0x218)+_0x5b2daf+_0x4a647c(0x233);}async function processTelegramAgentLoop(_0x5109e0,_0x24346e,_0x196703,_0x58f470){const _0x5c9f89=a6_0x597b73;let _0x1dcd79=0x0;const _0x415e25=0x14;let _0x1ac9ca=![];const _0x5dffc2=[];while(_0x1dcd79<_0x415e25){_0x1dcd79++,a6_0x403592['dim']('[Telegram]\x20Iteration\x20'+_0x1dcd79+'...');let _0x2eb14b='';try{const _0x4eb228=await sendChatMessage(_0x196703,_0x24346e,_0x2f4649=>{_0x2eb14b+=_0x2f4649;});_0x2eb14b=_0x4eb228[_0x5c9f89(0x26e)];}catch(_0x16fec2){await bot?.[_0x5c9f89(0x1fc)](_0x5109e0,'Failed:\x20'+(_0x16fec2[_0x5c9f89(0x25e)]?.[_0x5c9f89(0x23f)](0x0,0x1e)||_0x5c9f89(0x229)));return;}_0x24346e[_0x5c9f89(0x25a)]({'role':_0x5c9f89(0x248),'content':_0x2eb14b});const _0x35b18a=_0x2eb14b[_0x5c9f89(0x219)](/```tool\s*([\s\S]*?)```/);if(!_0x35b18a){let _0x5a6c4a=_0x2eb14b[_0x5c9f89(0x26c)](/<[^>]+>[\s\S]*?<\/[^>]+>/g,'')[_0x5c9f89(0x26c)](/<[^>]+>/g,'')['replace'](/```[\s\S]*?```/g,'')[_0x5c9f89(0x26c)](/\*\*(.+?)\*\*/g,'$1')[_0x5c9f89(0x26c)](/\*(.+?)\*/g,'$1')[_0x5c9f89(0x26c)](/__(.+?)__/g,'$1')[_0x5c9f89(0x26c)](/_(.+?)_/g,'$1')['replace'](/#{1,6}\s*/g,'')['replace'](/^[-*+]\s+/gm,'')['replace'](/^\d+\.\s+/gm,'')[_0x5c9f89(0x26c)](/`([^`]+)`/g,'$1')[_0x5c9f89(0x26c)](/\[([^\]]+)\]\([^)]+\)/g,'$1')[_0x5c9f89(0x21b)]();const _0x214b13=_0x5a6c4a[_0x5c9f89(0x259)]('\x0a')[_0x5c9f89(0x1f9)](_0xd030f2=>_0xd030f2['trim']()&&_0xd030f2[_0x5c9f89(0x21b)]()[_0x5c9f89(0x1fe)]>0x1);if(_0x5a6c4a[_0x5c9f89(0x21b)]()){if(_0x5dffc2[_0x5c9f89(0x1fe)]>0x0){await saveTaskHistory(_0x58f470,_0x5dffc2);const _0x56ea6a=_0x5c9f89(0x1fa)+_0x5dffc2[_0x5c9f89(0x206)](_0xe0f380=>'-\x20'+_0xe0f380)[_0x5c9f89(0x267)]('\x0a');await bot?.[_0x5c9f89(0x1fc)](_0x5109e0,_0x5a6c4a+_0x56ea6a)['catch'](()=>{});}else await bot?.['sendMessage'](_0x5109e0,_0x5a6c4a)['catch'](()=>{});}break;}try{const _0x17b97d=_0x35b18a[0x1][_0x5c9f89(0x21b)](),_0x1320aa=JSON[_0x5c9f89(0x1f4)](_0x17b97d),_0x22b3b2=estimateTime(_0x1320aa['name'],_0x1320aa[_0x5c9f89(0x220)]),_0x222b98=getActionDescription(_0x1320aa['name'],_0x1320aa[_0x5c9f89(0x220)]);_0x5dffc2[_0x5c9f89(0x25a)](_0x222b98[_0x5c9f89(0x26c)](/\(\~.*\)/,'')['trim']()),await updateStatus(_0x5109e0,_0x222b98+'\x20('+_0x22b3b2+')'),_0x1ac9ca=!![],a6_0x403592['toolActivity'](_0x1320aa['name'],_0x1320aa['args']);const _0x218b79=performance[_0x5c9f89(0x202)](),_0x146d68=await executeToolCall(_0x1320aa[_0x5c9f89(0x210)],_0x1320aa[_0x5c9f89(0x220)],_0x5109e0),_0x266426=((performance[_0x5c9f89(0x202)]()-_0x218b79)/0x3e8)[_0x5c9f89(0x203)](0x1);a6_0x403592[_0x5c9f89(0x236)](_0x5c9f89(0x21a)+_0x1320aa['name']+_0x5c9f89(0x1fd)+_0x266426+'s'),_0x24346e['push']({'role':_0x5c9f89(0x1ee),'content':_0x5c9f89(0x240)+_0x1320aa[_0x5c9f89(0x210)]+':\x0a'+JSON[_0x5c9f89(0x207)](_0x146d68,null,0x2)}),await new Promise(_0x2d8b0e=>setTimeout(_0x2d8b0e,0xc8));}catch(_0x5532bb){a6_0x403592[_0x5c9f89(0x228)](_0x5c9f89(0x21c)+_0x5532bb),_0x24346e[_0x5c9f89(0x25a)]({'role':_0x5c9f89(0x1ee),'content':'Tool\x20error:\x20'+_0x5532bb+_0x5c9f89(0x243)});}}_0x1dcd79>=_0x415e25&&await bot?.[_0x5c9f89(0x1fc)](_0x5109e0,_0x5c9f89(0x244));}async function handleMessage(_0xaabe99){const _0x2bd0b4=a6_0x597b73;if(!_0xaabe99[_0x2bd0b4(0x269)]||!_0xaabe99[_0x2bd0b4(0x23a)])return;const _0x273386=_0xaabe99[_0x2bd0b4(0x23d)]['id'],_0x4ed7f9=_0xaabe99[_0x2bd0b4(0x269)][_0x2bd0b4(0x21b)](),_0x103538=_0xaabe99[_0x2bd0b4(0x23a)]['id'];if(!a6_0x176ae4[_0x2bd0b4(0x1fb)](_0x103538)){const _0xde9fbc=a6_0x176ae4[_0x2bd0b4(0x261)]();if(_0xde9fbc&&!verifiedSessions['has'](_0x103538)){if(_0x4ed7f9===_0xde9fbc){verifiedSessions[_0x2bd0b4(0x1ff)](_0x103538),a6_0x176ae4[_0x2bd0b4(0x254)](_0x103538),await bot?.[_0x2bd0b4(0x1fc)](_0x273386,'Verified');return;}await bot?.['sendMessage'](_0x273386,'PIN\x20required');return;}!_0xde9fbc&&a6_0x176ae4[_0x2bd0b4(0x254)](_0x103538);}if(_0x4ed7f9===_0x2bd0b4(0x224)){await bot?.['sendMessage'](_0x273386,'Woozlit\x20Remote\x0a\x0aConnected:\x20'+process[_0x2bd0b4(0x24c)]()+_0x2bd0b4(0x232));return;}if(_0x4ed7f9===_0x2bd0b4(0x247)){chatHistories['delete'](_0x273386),statusMessages['delete'](_0x273386),await bot?.['sendMessage'](_0x273386,_0x2bd0b4(0x221));return;}if(_0x4ed7f9===_0x2bd0b4(0x209)||_0x4ed7f9==='/screenshot'){try{await bot?.['sendChatAction'](_0x273386,'upload_photo');const _0x227cf7=await takeScreenshot();await bot?.[_0x2bd0b4(0x230)](_0x273386,_0x227cf7,{'caption':_0x2bd0b4(0x20f)}),await a6_0x5b778d['unlink'](_0x227cf7)[_0x2bd0b4(0x257)](()=>{});}catch(_0x3bc07e){await bot?.[_0x2bd0b4(0x1fc)](_0x273386,_0x2bd0b4(0x1f0)+_0x3bc07e);}return;}if(_0x4ed7f9===_0x2bd0b4(0x200)){const _0xfc8fe8=readTerminalOutput(),_0x2e89ce=_0xfc8fe8[_0x2bd0b4(0x258)][_0x2bd0b4(0x1fe)]>0x0?_0x2bd0b4(0x205)+_0xfc8fe8['pids'][_0x2bd0b4(0x267)](',\x20'):'';await bot?.[_0x2bd0b4(0x1fc)](_0x273386,_0x2bd0b4(0x231)+process['cwd']()+_0x2bd0b4(0x21f)+getSelectedModel()+_0x2e89ce);return;}if(_0x4ed7f9===_0x2bd0b4(0x213)){const _0x5fab8b=terminateProcess();await bot?.['sendMessage'](_0x273386,_0x5fab8b[_0x2bd0b4(0x25e)]);return;}const _0x3d22e3=await getOrCreateHistory(_0x273386);_0x3d22e3[_0x2bd0b4(0x25a)]({'role':_0x2bd0b4(0x1ee),'content':_0x4ed7f9}),a6_0x403592['info'](_0x2bd0b4(0x21a)+_0xaabe99[_0x2bd0b4(0x23a)]['first_name']+':\x20'+_0x4ed7f9),await processTelegramAgentLoop(_0x273386,_0x3d22e3,getSelectedModel(),_0x4ed7f9);}export async function startBot(){const _0x5fb61=a6_0x597b73,_0x4f7043=a6_0x176ae4['getBotToken']();if(!_0x4f7043)return a6_0x403592[_0x5fb61(0x228)](_0x5fb61(0x24b)),![];if(isRunning&&bot)return a6_0x403592[_0x5fb61(0x216)]('Telegram\x20bot\x20already\x20running.'),!![];try{return bot=new a6_0x3f1794(_0x4f7043,{'polling':!![]}),bot['on'](_0x5fb61(0x25e),handleMessage),bot['on']('polling_error',_0x2beeb9=>{const _0x5755ac=_0x5fb61;_0x2beeb9[_0x5755ac(0x25e)]?.[_0x5755ac(0x21d)](_0x5755ac(0x238))&&(a6_0x403592[_0x5755ac(0x228)](_0x5755ac(0x252)),stopBot());}),isRunning=!![],a6_0x403592[_0x5fb61(0x236)](_0x5fb61(0x249)),!![];}catch(_0x5c23a6){return a6_0x403592['error'](_0x5fb61(0x246)+_0x5c23a6[_0x5fb61(0x25e)]),![];}}function a6_0x36c9(){const _0x33ba3c=['content','list_directory','pattern','user','~1s','Screenshot\x20failed:\x20','get','~30s','stopPolling','parse','~2s','Creating\x20file:\x20','~1\x20min','build','filter','\x0a\x0aTask\x20Summary:\x0a','isAllowedChatId','sendMessage','\x20done\x20in\x20','length','add','/status','443208ELpDUO','now','toFixed','825noJDAE','\x0aProcesses:\x20','map','stringify','1343776auqCCM','/screen','command','read_terminal','-\x20Request:\x20\x22','USERPROFILE','set','Desktop','name','mkdir','screenshot_','/kill','34RtOjJb','run_command','warn','21540fQSWbM','Executing\x20','match','[Telegram]\x20','trim','[Telegram]\x20Tool\x20error:\x20','includes','search','\x0aModel:\x20','args','Cleared','You\x20are\x20Woozlit,\x20a\x20helpful\x20AI\x20assistant\x20capable\x20of\x20controlling\x20this\x20PC\x20via\x20Telegram.\x0a\x0aCAPABILITIES:\x0a-\x20Chat\x20naturally\x20about\x20any\x20topic.\x0a-\x20Execute\x20PC\x20tasks\x20using\x20tools\x20(file\x20management,\x20terminal,\x20screenshots).\x0a-\x20Remember\x20context\x20from\x20previous\x20tasks.\x0a\x0aRULES:\x0a-\x20Be\x20helpful\x20and\x20friendly.\x20You\x20don\x27t\x20need\x20to\x20be\x20silent.\x0a-\x20When\x20doing\x20tasks,\x20you\x20can\x20briefly\x20confirm\x20you\x27re\x20on\x20it.\x0a-\x20NEVER\x20use\x20XML\x20tags\x20like\x20<searchaction>\x20in\x20responses.\x0a-\x20After\x20ALL\x20tasks\x20complete:\x20Provide\x20a\x20TASK\x20SUMMARY.\x0a\x0aTIME\x20ESTIMATES\x20(tell\x20user\x20before\x20starting\x20long\x20tasks):\x0a-\x20Vite/Next.js/React\x20projects:\x202-5\x20minutes\x0a-\x20npm/pnpm\x20install:\x201-2\x20minutes\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait\x20(ms,\x20default\x2030000),\x20background\x20(bool)}\x0a-\x20read_terminal:\x20{}\x20-\x20check\x20running\x20process\x20output\x0a-\x20send_input:\x20{input}\x20-\x20answer\x20prompts\x20(like\x20\x22y\x22\x20or\x20\x22n\x22)\x0a-\x20terminate:\x20{}\x20-\x20kill\x20stuck\x20process\x0a-\x20create_file,\x20read_file,\x20edit_file,\x20list_directory\x0a-\x20screenshot:\x20{}\x20-\x20capture\x20desktop\x0a\x0aWORKFLOW:\x0a1.\x20Start\x20long\x20commands\x20with\x20background:true,\x20wait:5000\x0a2.\x20Monitor\x20with\x20read_terminal\x0a3.\x20Answer\x20prompts\x20with\x20send_input\x0a4.\x20Verify\x20with\x20screenshot','\x22\x0a\x20\x20Actions:\x20','/start','522sdAawb','1389iqVHfV','npm\x20init','error','Error','create-next-app','pid','actionSummary','history.json','15roHqkU','editMessageText','sendPhoto','Dir:\x20','\x0a\x0a/clear\x20-\x20Reset\x0a/status\x20-\x20Info\x0a/screen\x20-\x20Screenshot','...','pnpm\x20init','writeFile','success','~1-2\x20min','ETELEGRAM:\x20401','HOME','from','message_id','Editing\x20file:\x20','chat','toLowerCase','substring','Tool\x20result\x20for\x20','screenshot','slice','.\x20Try\x20again\x20or\x20skip.','Stopped\x20(max\x20steps)','unlink','Bot\x20start\x20failed:\x20','/clear','assistant','Telegram\x20bot\x20started!','send_input','No\x20Telegram\x20bot\x20token.\x20Run\x20/telegram\x20setup\x20first.','cwd','search_file','path','delete','pnpm\x20install','create_file','Invalid\x20bot\x20token.','read_file','addAllowedChatId','has','\x0a\x0aRECENT\x20TASK\x20HISTORY\x20(Use\x20this\x20context):\x0a','catch','pids','split','push','git\x20clone','commandOutput','shift','message','703575HYmZRz','150428pkMIYb','getSecurityPin','terminate','message\x20is\x20not\x20modified','request','clear','edit_file','join','env','text','.png','10003MHlkmI','replace','create-vite'];a6_0x36c9=function(){return _0x33ba3c;};return a6_0x36c9();}export function stopBot(){const _0x1ec41a=a6_0x597b73;bot&&(bot[_0x1ec41a(0x1f3)](),bot=null),isRunning=![],verifiedSessions[_0x1ec41a(0x265)]();}export function isBotRunning(){return isRunning;}
1
+ const a24_0x348a57=a24_0x5a7b;(function(_0x2b2f84,_0x277875){const _0x4530b1=a24_0x5a7b,_0x1f4bf0=_0x2b2f84();while(!![]){try{const _0x7e5d56=-parseInt(_0x4530b1(0x1c8))/0x1*(-parseInt(_0x4530b1(0x1d8))/0x2)+-parseInt(_0x4530b1(0x1f0))/0x3*(parseInt(_0x4530b1(0x19f))/0x4)+-parseInt(_0x4530b1(0x199))/0x5*(-parseInt(_0x4530b1(0x1d7))/0x6)+parseInt(_0x4530b1(0x1c6))/0x7+parseInt(_0x4530b1(0x184))/0x8*(-parseInt(_0x4530b1(0x1d5))/0x9)+parseInt(_0x4530b1(0x1cb))/0xa+-parseInt(_0x4530b1(0x175))/0xb;if(_0x7e5d56===_0x277875)break;else _0x1f4bf0['push'](_0x1f4bf0['shift']());}catch(_0x250800){_0x1f4bf0['push'](_0x1f4bf0['shift']());}}}(a24_0x2be1,0x9e186));function a24_0x2be1(){const _0x52e2a2=['\x0a\x0a/clear\x20-\x20Reset\x0a/status\x20-\x20Info\x0a/screen\x20-\x20Screenshot','reply','Verified','.ogg','includes','Bot\x20start\x20failed:\x20','set','message_id','[Telegram]\x20Iteration\x20','~2-3\x20min','trim','Creating\x20file:\x20','/start','robotjs\x20not\x20available\x20to\x20capture\x20photo','screenshot_','screenshot','npm\x20init','browser_close','[Telegram]\x20','url','delete','title','getBuffer','sendMessage','getBotToken','replace','../github/api.js','[Telegram]\x20Starting\x20tool\x20','parse','warn','\x0a\x0aTask\x20Summary:\x0a','schedule_reminder','pid','writeFile','isAllowedChatId','voice_','Running:\x20','...','arrayBuffer','head','clear','Voice\x20processing\x20error:\x20','file_id','~2s','dim','from','substring','search_file','map','image/jpeg','No\x20Telegram\x20bot\x20token.\x20Run\x20/telegram\x20setup\x20first.','Executing\x20','actionSummary','has','match','utf-8','name','send_input','browser_screenshot','Screenshot\x20failed:\x20','command','21896930wnSeXP','error','path','browser_snapshot','@hurdlegroup/robotjs','now','env','git\x20clone','typing','stringify','editMessageText','401','~1-2\x20min','body','build','88XTeqFG','npm\x20install','Woozlit\x20Remote\x0a\x0aConnected:\x20','create-vite','create-next-app','TOOL\x20JSON:\x20','split','Invalid\x20bot\x20token.','fromBranch','getSecurityPin','message','args','toFixed','shift','read_terminal','pids','Telegram\x20bot\x20started!','success','~1s','info','replyWithPhoto','6266765BEwAuP','../browser/index.js','USERPROFILE','first_name','assistant','/kill','1031252LWYawu','repo','create_file','Failed:\x20','toLowerCase','getScreenSize','browser_fill','base','terminate','add','content','data','run_command','pnpm\x20install','\x22\x0a\x20\x20Actions:\x20','~30s','toolSuccess','Browser\x20Screenshot','branch','Cleared','get','slice','\x20(Voice):\x20','branchName','Tool\x20result\x20for\x20','-\x20Request:\x20\x22','api','.\x20Try\x20again\x20or\x20skip.','sendChatAction','push','Taking\x20screenshot...','Voice\x20error:\x20','request','browser_click','value','search','owner','file_path','/clear','4203507IxalND','text','1REgTck','image','message\x20is\x20not\x20modified','11237530ZgcbCg','length','Sorry,\x20I\x20couldn\x27t\x20understand\x20that\x20audio.','edit_file','.woozlit','addAllowedChatId','browser_open','width','base64','/screen','597987gXJFWT','selector','6rklRwt','1298534XfitmE','PARSED\x20TOOL:\x20','Desktop','bitmap','\x0aModel:\x20','Stopped\x20(max\x20steps)','values','/screenshot','HOME','Done\x20in\x20','unlink','replyWithChatAction','chat','join','catch','.jpeg','cwd','input','user','stop','screen','~1\x20min','readFile','system','3oGdUDn'];a24_0x2be1=function(){return _0x52e2a2;};return a24_0x2be1();}import{Bot,InputFile}from'grammy';import{promises as a24_0xcf40a4}from'fs';import{tmpdir}from'os';import{join}from'path';import*as a24_0x16e637 from'./config.js';import{checkReminders,scheduleReminder}from'./reminders.js';import{sendChatMessage}from'../utils/api.js';import{getSelectedModel}from'../utils/storage.js';function a24_0x5a7b(_0x49aa68,_0x21a7c5){_0x49aa68=_0x49aa68-0x150;const _0x2be1d5=a24_0x2be1();let _0x5a7b43=_0x2be1d5[_0x49aa68];return _0x5a7b43;}import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess}from'../tools/index.js';import{processVoiceMessage}from'../services/voice-agent.js';import*as a24_0x25297d from'../ui/output.js';import{createRequire}from'module';import{Jimp}from'jimp';const require=createRequire(import.meta.url);let bot=null,isRunning=![];const verifiedSessions=new Set(),statusMessages=new Map(),chatHistories=new Map(),WOOZLIT_DIR=join(process[a24_0x348a57(0x17b)][a24_0x348a57(0x19b)]||process[a24_0x348a57(0x17b)][a24_0x348a57(0x1e0)]||'.',a24_0x348a57(0x1cf)),HISTORY_FILE=join(WOOZLIT_DIR,'history.json');async function ensureWoozlitDir(){try{await a24_0xcf40a4['mkdir'](WOOZLIT_DIR,{'recursive':!![]});}catch{}}async function getTaskHistory(){const _0x185804=a24_0x348a57;try{const _0x33c0be=await a24_0xcf40a4[_0x185804(0x1ee)](HISTORY_FILE,_0x185804(0x16f));return JSON[_0x185804(0x154)](_0x33c0be);}catch{return[];}}async function saveTaskHistory(_0x2197db,_0x222bd9){const _0x167ad9=a24_0x348a57;await ensureWoozlitDir();const _0x1dfdbf=await getTaskHistory();_0x1dfdbf['push']({'timestamp':Date[_0x167ad9(0x17a)](),'request':_0x2197db,'actionSummary':_0x222bd9});if(_0x1dfdbf[_0x167ad9(0x1cc)]>0x14)_0x1dfdbf[_0x167ad9(0x191)]();await a24_0xcf40a4[_0x167ad9(0x159)](HISTORY_FILE,JSON[_0x167ad9(0x17e)](_0x1dfdbf,null,0x2));}function formatHistoryForPrompt(_0x48df21){const _0x51b751=a24_0x348a57;if(_0x48df21['length']===0x0)return'';return'\x0a\x0aRECENT\x20TASK\x20HISTORY\x20(Use\x20this\x20context):\x0a'+_0x48df21[_0x51b751(0x1b4)](-0x5)[_0x51b751(0x168)](_0x1b552f=>_0x51b751(0x1b8)+_0x1b552f[_0x51b751(0x1bf)]+_0x51b751(0x1ad)+_0x1b552f[_0x51b751(0x16c)][_0x51b751(0x1e5)](',\x20'))[_0x51b751(0x1e5)]('\x0a');}function getSystemPrompt(_0x2df34b){return'You\x20are\x20Woozlit\x20AI.\x20Complete\x20tasks\x20autonomously.\x0a\x0aCRITICAL\x20RULES:\x0a1.\x20**EXECUTE\x20IMMEDIATELY**:\x20When\x20user\x20requests\x20an\x20action,\x20execute\x20the\x20tool\x20FIRST,\x20explain\x20NEVER.\x0a2.\x20**NO\x20EMOJIS**:\x20Never\x20use\x20emojis\x20in\x20any\x20response.\x0a3.\x20**NO\x20CONVERSATIONAL\x20ERRORS**:\x20If\x20a\x20browser\x20command\x20cannot\x20be\x20executed,\x20just\x20execute\x20it\x20anyway.\x20Never\x20explain\x20limitations.\x0a4.\x20**CONCISE**:\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x20No\x20filler.\x0a5.\x20**TOOL\x20FORMAT**:\x20Use\x20THREE\x20backticks\x20(```)\x20NOT\x20asterisks\x20(***)\x20for\x20tool\x20blocks.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait\x20(ms,\x20default\x2030000),\x20background\x20(bool)}\x0a-\x20read_terminal:\x20{}\x20-\x20check\x20running\x20process\x20output\x0a-\x20send_input:\x20{input}\x20-\x20answer\x20prompts\x0a-\x20terminate:\x20{}\x20-\x20kill\x20stuck\x20process\x0a-\x20create_file:\x20{path,\x20content}\x0a-\x20read_file:\x20{path}\x0a-\x20list_directory:\x20{path}\x0a-\x20edit_file:\x20{path,\x20search,\x20replace}\x0a-\x20screenshot:\x20{}\x20-\x20capture\x20desktop\x0a-\x20schedule_reminder:\x20{delayMinutes:\x20number,\x20message:\x20string}\x0a-\x20github_read_file:\x20{owner,\x20repo,\x20path,\x20branch}\x0a-\x20github_create_branch:\x20{owner,\x20repo,\x20branchName,\x20fromBranch}\x0a-\x20github_create_pr:\x20{owner,\x20repo,\x20title,\x20head,\x20base,\x20body}\x0a-\x20browser_open:\x20{url}\x0a-\x20browser_click:\x20{selector}\x0a-\x20browser_fill:\x20{selector,\x20value}\x0a-\x20browser_screenshot:\x20{}\x0a-\x20browser_snapshot:\x20{}\x0a\x0aBROWSER\x20COMMANDS\x20-\x20EXECUTE\x20IMMEDIATELY:\x0aWhen\x20user\x20says\x20\x22open\x20[site]\x22,\x20\x22go\x20to\x20[url]\x22,\x20\x22navigate\x20to\x20[url]\x22:\x0a```tool\x0a{\x22name\x22:\x22browser_open\x22,\x22args\x22:{\x22url\x22:\x22https://example.com\x22}}\x0a```\x0a\x0aDO\x20NOT\x20respond\x20with:\x0a-\x20\x22I\x20understand\x20you\x27d\x20like\x20me\x20to...\x22\x0a-\x20\x22I\x20need\x20the\x20extension\x20to\x20be\x20connected...\x22\x0a-\x20\x22Apologies\x20for\x20the\x20inconvenience\x22\x0a-\x20Any\x20explanation\x20about\x20what\x20you\x27re\x20about\x20to\x20do\x0a\x0aJUST\x20EXECUTE\x20THE\x20TOOL.\x0a\x0aEXAMPLE:\x0aUser:\x20\x22open\x20discord\x22\x0aYou:\x0a```tool\x0a{\x22name\x22:\x22browser_open\x22,\x22args\x22:{\x22url\x22:\x22https://discord.com\x22}}\x0a```'+_0x2df34b;}async function getOrCreateHistory(_0x293189){const _0x7e027a=a24_0x348a57;if(!chatHistories[_0x7e027a(0x16d)](_0x293189)){const _0xeaeff='';chatHistories[_0x7e027a(0x1f7)](_0x293189,[{'role':_0x7e027a(0x1ef),'content':getSystemPrompt(_0xeaeff)}]);}return chatHistories[_0x7e027a(0x1b3)](_0x293189);}async function updateStatus(_0x57bf1a,_0x587a37){const _0x41cbac=a24_0x348a57;if(!bot)return;const _0x50bc8f=statusMessages[_0x41cbac(0x1b3)](_0x57bf1a);if(_0x50bc8f)try{await bot[_0x41cbac(0x1b9)][_0x41cbac(0x17f)](_0x57bf1a,_0x50bc8f,_0x587a37);return;}catch(_0x20fa64){if(_0x20fa64[_0x41cbac(0x18e)]&&_0x20fa64[_0x41cbac(0x18e)]['includes'](_0x41cbac(0x1ca)))return;statusMessages[_0x41cbac(0x205)](_0x57bf1a);}try{const _0x16f147=await bot[_0x41cbac(0x1b9)][_0x41cbac(0x208)](_0x57bf1a,_0x587a37);statusMessages[_0x41cbac(0x1f7)](_0x57bf1a,_0x16f147[_0x41cbac(0x1f8)]);}catch(_0x49280e){}}async function takeScreenshot(){const _0x34342c=a24_0x348a57,_0x16aa3e=_0x34342c(0x1ff)+Date[_0x34342c(0x17a)]()+_0x34342c(0x1e7),_0xa59cce=join(tmpdir(),_0x16aa3e);let _0x3111aa;try{_0x3111aa=require(_0x34342c(0x179));const _0x4b8d60=_0x3111aa[_0x34342c(0x1a4)](),_0xe1d488=_0x3111aa[_0x34342c(0x1ec)]['capture'](0x0,0x0,_0x4b8d60[_0x34342c(0x1d2)],_0x4b8d60['height']),_0x1a9fc9=new Jimp({'width':_0xe1d488[_0x34342c(0x1d2)],'height':_0xe1d488['height']});for(let _0x5c276b=0x0;_0x5c276b<_0xe1d488[_0x34342c(0x1c9)][_0x34342c(0x1cc)];_0x5c276b+=0x4){_0x1a9fc9[_0x34342c(0x1db)][_0x34342c(0x1aa)][_0x5c276b]=_0xe1d488[_0x34342c(0x1c9)][_0x5c276b+0x2],_0x1a9fc9[_0x34342c(0x1db)][_0x34342c(0x1aa)][_0x5c276b+0x1]=_0xe1d488[_0x34342c(0x1c9)][_0x5c276b+0x1],_0x1a9fc9[_0x34342c(0x1db)][_0x34342c(0x1aa)][_0x5c276b+0x2]=_0xe1d488['image'][_0x5c276b],_0x1a9fc9[_0x34342c(0x1db)][_0x34342c(0x1aa)][_0x5c276b+0x3]=_0xe1d488[_0x34342c(0x1c9)][_0x5c276b+0x3];}_0x1a9fc9[_0x34342c(0x1db)][_0x34342c(0x1d2)]>0x500&&_0x1a9fc9['resize']({'w':0x500});const _0x4fedc3=await _0x1a9fc9[_0x34342c(0x207)](_0x34342c(0x169));await a24_0xcf40a4[_0x34342c(0x159)](_0xa59cce,_0x4fedc3);}catch(_0x4e29fe){throw new Error(_0x34342c(0x1fe));}return _0xa59cce;}async function executeToolCall(_0x4d1f4d,_0x50e383,_0x491b6b){const _0x2e9ae5=a24_0x348a57;switch(_0x4d1f4d){case _0x2e9ae5(0x200):try{statusMessages[_0x2e9ae5(0x205)](_0x491b6b);const _0x3544cd=await takeScreenshot();return await bot?.[_0x2e9ae5(0x1b9)]['sendPhoto'](_0x491b6b,new InputFile(_0x3544cd),{'caption':_0x2e9ae5(0x1da)}),await a24_0xcf40a4[_0x2e9ae5(0x1e2)](_0x3544cd)[_0x2e9ae5(0x1e6)](()=>{}),{'success':!![],'sent':!![]};}catch(_0x45e85e){return{'error':_0x2e9ae5(0x173)+_0x45e85e};}case'read_terminal':return readTerminalOutput(_0x50e383[_0x2e9ae5(0x158)]);case _0x2e9ae5(0x171):return sendTerminalInput(_0x50e383[_0x2e9ae5(0x1e9)],_0x50e383[_0x2e9ae5(0x158)]);case _0x2e9ae5(0x1a7):return terminateProcess(_0x50e383[_0x2e9ae5(0x158)]);case _0x2e9ae5(0x1a1):return createFile(_0x50e383[_0x2e9ae5(0x177)],_0x50e383[_0x2e9ae5(0x1a9)]);case'read_file':return readFile(_0x50e383[_0x2e9ae5(0x177)]);case'list_directory':return listDirectory(_0x50e383[_0x2e9ae5(0x177)]||'.');case _0x2e9ae5(0x1ce):return editFile(_0x50e383['path'],_0x50e383[_0x2e9ae5(0x1c2)],_0x50e383[_0x2e9ae5(0x151)]);case _0x2e9ae5(0x167):return searchFile(_0x50e383['path'],_0x50e383['pattern']);case _0x2e9ae5(0x1ab):const {command:_0x3998f6,background:_0x3bf5a5,wait:_0x5babdb}=_0x50e383,_0x3f15a6=await runCommand(_0x3998f6,undefined,_0x3bf5a5||![],_0x5babdb||0x7530);return _0x3f15a6;case _0x2e9ae5(0x157):return scheduleReminder(_0x491b6b,_0x50e383['delayMinutes'],_0x50e383[_0x2e9ae5(0x18e)]);case'github_read_file':{const {readFile:_0x1c15f6}=await import(_0x2e9ae5(0x152));return _0x1c15f6(_0x50e383['owner'],_0x50e383[_0x2e9ae5(0x1a0)],_0x50e383[_0x2e9ae5(0x177)],_0x50e383[_0x2e9ae5(0x1b1)]);}case'github_create_branch':{const {createBranch:_0x25ca74}=await import('../github/api.js');return _0x25ca74(_0x50e383[_0x2e9ae5(0x1c3)],_0x50e383[_0x2e9ae5(0x1a0)],_0x50e383[_0x2e9ae5(0x1b6)],_0x50e383[_0x2e9ae5(0x18c)]);}case'github_create_pr':{const {createPullRequest:_0x1185e6}=await import(_0x2e9ae5(0x152));return _0x1185e6(_0x50e383[_0x2e9ae5(0x1c3)],_0x50e383['repo'],_0x50e383[_0x2e9ae5(0x206)],_0x50e383[_0x2e9ae5(0x15f)],_0x50e383[_0x2e9ae5(0x1a6)],_0x50e383[_0x2e9ae5(0x182)]);}case _0x2e9ae5(0x1d1):{const {browserOpen:_0x526aef,startBrowserServer:_0x938cf5,isBrowserServerRunning:_0x28f080}=await import(_0x2e9ae5(0x19a));return!_0x28f080()&&await _0x938cf5(),_0x526aef(_0x50e383[_0x2e9ae5(0x204)]);}case _0x2e9ae5(0x1c0):{const {browserClick:_0x3ed0ee}=await import(_0x2e9ae5(0x19a));return _0x3ed0ee(_0x50e383[_0x2e9ae5(0x1d6)]);}case _0x2e9ae5(0x1a5):{const {browserFill:_0x254b75}=await import(_0x2e9ae5(0x19a));return _0x254b75(_0x50e383[_0x2e9ae5(0x1d6)],_0x50e383[_0x2e9ae5(0x1c1)]);}case _0x2e9ae5(0x178):{const {browserSnapshot:_0x4d04f8}=await import(_0x2e9ae5(0x19a));return _0x4d04f8();}case _0x2e9ae5(0x172):{const {browserScreenshot:_0x2aaf8d}=await import(_0x2e9ae5(0x19a)),_0x401cb3=await _0x2aaf8d();if(_0x401cb3['success']&&_0x401cb3[_0x2e9ae5(0x1aa)]){const _0x3584fa=_0x401cb3[_0x2e9ae5(0x1aa)][_0x2e9ae5(0x151)](/^data:image\/\w+;base64,/,''),_0x420fdf=Buffer[_0x2e9ae5(0x165)](_0x3584fa,_0x2e9ae5(0x1d3));return statusMessages[_0x2e9ae5(0x205)](_0x491b6b),await bot?.[_0x2e9ae5(0x1b9)]['sendPhoto'](_0x491b6b,new InputFile(_0x420fdf),{'caption':_0x2e9ae5(0x1b0)}),{'success':!![],'sent':!![]};}return _0x401cb3;}case _0x2e9ae5(0x202):{const {browserClose:_0x3676f0}=await import(_0x2e9ae5(0x19a));return _0x3676f0();}default:return{'error':'Unknown\x20tool:\x20'+_0x4d1f4d};}}function estimateTime(_0x51cef7,_0x22be04){const _0x5ca666=a24_0x348a57;if(_0x51cef7===_0x5ca666(0x200))return'~2s';if(_0x51cef7===_0x5ca666(0x192)||_0x51cef7===_0x5ca666(0x171)||_0x51cef7==='terminate')return _0x5ca666(0x196);if(_0x51cef7==='run_command'){const _0x7a0fc1=(_0x22be04[_0x5ca666(0x174)]||'')[_0x5ca666(0x1a3)]();if(_0x7a0fc1[_0x5ca666(0x1f5)](_0x5ca666(0x188))||_0x7a0fc1[_0x5ca666(0x1f5)](_0x5ca666(0x187)))return _0x5ca666(0x1fa);if(_0x7a0fc1[_0x5ca666(0x1f5)](_0x5ca666(0x185))||_0x7a0fc1[_0x5ca666(0x1f5)](_0x5ca666(0x1ac)))return'~1-2\x20min';if(_0x7a0fc1[_0x5ca666(0x1f5)](_0x5ca666(0x201))||_0x7a0fc1[_0x5ca666(0x1f5)]('pnpm\x20init'))return _0x5ca666(0x1ae);if(_0x7a0fc1['includes'](_0x5ca666(0x17c)))return _0x5ca666(0x1ed);if(_0x7a0fc1[_0x5ca666(0x1f5)](_0x5ca666(0x183)))return _0x5ca666(0x181);}return _0x5ca666(0x163);}function getActionDescription(_0x4bdbd8,_0x9f7a1e){const _0x1dfdb5=a24_0x348a57;if(_0x4bdbd8===_0x1dfdb5(0x1ab)){let _0x26aac6=_0x9f7a1e['command']||_0x1dfdb5(0x174);if(_0x26aac6[_0x1dfdb5(0x1cc)]>0x1e)_0x26aac6=_0x26aac6['substring'](0x0,0x1b)+_0x1dfdb5(0x15d);return _0x1dfdb5(0x15c)+_0x26aac6;}if(_0x4bdbd8===_0x1dfdb5(0x1a1))return _0x1dfdb5(0x1fc)+_0x9f7a1e[_0x1dfdb5(0x177)];if(_0x4bdbd8==='edit_file')return'Editing\x20file:\x20'+_0x9f7a1e['path'];if(_0x4bdbd8==='screenshot')return _0x1dfdb5(0x1bd);return _0x1dfdb5(0x16b)+_0x4bdbd8+'...';}async function processTelegramAgentLoop(_0x3c84fa,_0x34b158,_0x55dac4,_0x1682cb){const _0x4d89ff=a24_0x348a57;let _0x469987=0x0;const _0x55de7c=0x14;let _0x3f2b83=![];const _0x4aec1a=[];while(_0x469987<_0x55de7c){_0x469987++;bot&&bot['api'][_0x4d89ff(0x1bb)](_0x3c84fa,_0x4d89ff(0x17d))[_0x4d89ff(0x1e6)](()=>{});a24_0x25297d[_0x4d89ff(0x164)](_0x4d89ff(0x1f9)+_0x469987+'...');let _0x5efdb4='';try{const _0x3e36e9=await sendChatMessage(_0x55dac4,_0x34b158,_0x2c6f6d=>{_0x5efdb4+=_0x2c6f6d;});_0x5efdb4=_0x3e36e9[_0x4d89ff(0x1a9)];}catch(_0x1c467e){await bot?.[_0x4d89ff(0x1b9)][_0x4d89ff(0x208)](_0x3c84fa,_0x4d89ff(0x1a2)+(_0x1c467e[_0x4d89ff(0x18e)]?.[_0x4d89ff(0x166)](0x0,0x1e)||'Error'));return;}_0x34b158[_0x4d89ff(0x1bc)]({'role':_0x4d89ff(0x19d),'content':_0x5efdb4});let _0x2fd14f=_0x5efdb4[_0x4d89ff(0x16e)](/```tool\s*([\s\S]*?)```/);!_0x2fd14f&&(_0x2fd14f=_0x5efdb4[_0x4d89ff(0x16e)](/\*\*\*tool\s*([\s\S]*?)\*\*\*/));!_0x2fd14f&&(_0x2fd14f=_0x5efdb4[_0x4d89ff(0x16e)](/\`\`\`json\s*({[\s\S]*?"name"[\s\S]*?})\s*\`\`\`/));if(!_0x2fd14f){let _0x47b5b0=_0x5efdb4[_0x4d89ff(0x151)](/\<reasoning\>[\s\S]*?\<\/reasoning\>/g,'')[_0x4d89ff(0x151)](/\<text\>|\<\/text\>/g,'')['replace'](/```tool[\s\S]*?```/g,'')[_0x4d89ff(0x151)](/\*\*\*tool[\s\S]*?\*\*\*/g,'')['replace'](/```json\s*{\s*"tool"[\s\S]*?```/g,'')[_0x4d89ff(0x151)](/```json\s*{\s*"command"[\s\S]*?```/g,'')['replace'](/\*\*(.+?)\*\*/g,'$1')[_0x4d89ff(0x151)](/\*(.+?)\*/g,'$1')['replace'](/__(.+?)__/g,'$1')[_0x4d89ff(0x151)](/_(.+?)_/g,'$1')[_0x4d89ff(0x151)](/#{1,6}\s*/g,'')[_0x4d89ff(0x151)](/^[-*+]\s+/gm,'')[_0x4d89ff(0x151)](/^\d+\.\s+/gm,'')[_0x4d89ff(0x151)](/`([^`]+)`/g,'$1')[_0x4d89ff(0x151)](/\[([^\]]+)\]\([^)]+\)/g,'$1')[_0x4d89ff(0x1fb)]();const _0x4888f5=_0x47b5b0[_0x4d89ff(0x18a)]('\x0a')['filter'](_0x3d37e4=>_0x3d37e4[_0x4d89ff(0x1fb)]()&&_0x3d37e4[_0x4d89ff(0x1fb)]()[_0x4d89ff(0x1cc)]>0x1);if(_0x47b5b0[_0x4d89ff(0x1fb)]()){if(_0x4aec1a[_0x4d89ff(0x1cc)]>0x0){await saveTaskHistory(_0x1682cb,_0x4aec1a);const _0x528ded=_0x4d89ff(0x156)+_0x4aec1a[_0x4d89ff(0x168)](_0x48387f=>'-\x20'+_0x48387f)[_0x4d89ff(0x1e5)]('\x0a');await bot?.['api'][_0x4d89ff(0x208)](_0x3c84fa,_0x47b5b0+_0x528ded)[_0x4d89ff(0x1e6)](()=>{});}else await bot?.['api'][_0x4d89ff(0x208)](_0x3c84fa,_0x47b5b0)['catch'](()=>{});}break;}try{const _0x495655=_0x2fd14f[0x1][_0x4d89ff(0x1fb)]();a24_0x25297d[_0x4d89ff(0x164)](_0x4d89ff(0x189)+_0x495655);const _0x46d2bb=JSON['parse'](_0x495655);a24_0x25297d[_0x4d89ff(0x164)](_0x4d89ff(0x1d9)+JSON['stringify'](_0x46d2bb));const _0x2fa934=estimateTime(_0x46d2bb['name'],_0x46d2bb[_0x4d89ff(0x18f)]),_0xb2b8b9=getActionDescription(_0x46d2bb[_0x4d89ff(0x170)],_0x46d2bb[_0x4d89ff(0x18f)]);_0x4aec1a[_0x4d89ff(0x1bc)](_0xb2b8b9[_0x4d89ff(0x151)](/\(\~.*\)/,'')['trim']()),await updateStatus(_0x3c84fa,_0xb2b8b9+'\x20('+_0x2fa934+')'),_0x3f2b83=!![],a24_0x25297d[_0x4d89ff(0x197)](_0x4d89ff(0x153)+_0x46d2bb[_0x4d89ff(0x170)]);const _0x5eb649=performance['now'](),_0x5dc81f=await executeToolCall(_0x46d2bb[_0x4d89ff(0x170)],_0x46d2bb[_0x4d89ff(0x18f)],_0x3c84fa),_0x49107c=((performance[_0x4d89ff(0x17a)]()-_0x5eb649)/0x3e8)[_0x4d89ff(0x190)](0x1);a24_0x25297d[_0x4d89ff(0x1af)](_0x46d2bb['name'],Object[_0x4d89ff(0x1de)](_0x46d2bb['args'])[0x0]||'',_0x4d89ff(0x1e1)+_0x49107c+'s'),_0x34b158[_0x4d89ff(0x1bc)]({'role':'user','content':_0x4d89ff(0x1b7)+_0x46d2bb[_0x4d89ff(0x170)]+':\x0a'+JSON[_0x4d89ff(0x17e)](_0x5dc81f,null,0x2)}),await new Promise(_0x240c8f=>setTimeout(_0x240c8f,0xc8));}catch(_0x51ad98){a24_0x25297d[_0x4d89ff(0x176)]('[Telegram]\x20Tool\x20error:\x20'+_0x51ad98),_0x34b158[_0x4d89ff(0x1bc)]({'role':_0x4d89ff(0x1ea),'content':'Tool\x20error:\x20'+_0x51ad98+_0x4d89ff(0x1ba)});}}_0x469987>=_0x55de7c&&await bot?.[_0x4d89ff(0x1b9)]['sendMessage'](_0x3c84fa,_0x4d89ff(0x1dd));}async function handleMessage(_0x515c8f){const _0x419715=a24_0x348a57,_0x30b128=_0x515c8f[_0x419715(0x18e)]?.[_0x419715(0x1c7)]?.['trim'](),_0x4a8d66=_0x515c8f[_0x419715(0x165)]?.['id'];if(!_0x30b128||!_0x4a8d66||!_0x515c8f[_0x419715(0x1e4)]?.['id'])return;const _0x4022fd=_0x515c8f[_0x419715(0x1e4)]['id'],_0x5575a1=_0x4a8d66;if(!a24_0x16e637['isAllowedChatId'](_0x5575a1)){const _0x5945a9=a24_0x16e637[_0x419715(0x18d)]();if(_0x5945a9&&!verifiedSessions[_0x419715(0x16d)](_0x5575a1)){if(_0x30b128===_0x5945a9){verifiedSessions[_0x419715(0x1a8)](_0x5575a1),a24_0x16e637[_0x419715(0x1d0)](_0x5575a1),await _0x515c8f['reply'](_0x419715(0x1f3));return;}await _0x515c8f[_0x419715(0x1f2)]('PIN\x20required');return;}!_0x5945a9&&a24_0x16e637['addAllowedChatId'](_0x5575a1);}if(_0x30b128===_0x419715(0x1fd)){await _0x515c8f[_0x419715(0x1f2)](_0x419715(0x186)+process['cwd']()+_0x419715(0x1f1));return;}if(_0x30b128===_0x419715(0x1c5)){chatHistories[_0x419715(0x205)](_0x4022fd),statusMessages[_0x419715(0x205)](_0x4022fd),await _0x515c8f[_0x419715(0x1f2)](_0x419715(0x1b2));return;}if(_0x30b128===_0x419715(0x1d4)||_0x30b128===_0x419715(0x1df)){try{await _0x515c8f[_0x419715(0x1e3)]('upload_photo');const _0x43e2f8=await takeScreenshot();await _0x515c8f[_0x419715(0x198)](new InputFile(_0x43e2f8),{'caption':_0x419715(0x1da)}),await a24_0xcf40a4[_0x419715(0x1e2)](_0x43e2f8)[_0x419715(0x1e6)](()=>{});}catch(_0x276b53){await _0x515c8f['reply']('Screenshot\x20failed:\x20'+_0x276b53);}return;}if(_0x30b128==='/status'){const _0x12b3db=readTerminalOutput(),_0x5bffdd=_0x12b3db[_0x419715(0x193)][_0x419715(0x1cc)]>0x0?'\x0aProcesses:\x20'+_0x12b3db[_0x419715(0x193)][_0x419715(0x1e5)](',\x20'):'';await _0x515c8f[_0x419715(0x1f2)]('Dir:\x20'+process[_0x419715(0x1e8)]()+_0x419715(0x1dc)+getSelectedModel()+_0x5bffdd);return;}if(_0x30b128===_0x419715(0x19e)){const _0x5b7059=terminateProcess();await _0x515c8f['reply'](_0x5b7059[_0x419715(0x18e)]);return;}const _0x35a843=await getOrCreateHistory(_0x4022fd);_0x35a843['push']({'role':_0x419715(0x1ea),'content':_0x30b128}),a24_0x25297d['info'](_0x419715(0x203)+_0x515c8f[_0x419715(0x165)][_0x419715(0x19c)]+':\x20'+_0x30b128),await processTelegramAgentLoop(_0x4022fd,_0x35a843,getSelectedModel(),_0x30b128);}export async function startBot(){const _0x13fd29=a24_0x348a57,_0x4b3587=a24_0x16e637[_0x13fd29(0x150)]();if(!_0x4b3587)return a24_0x25297d[_0x13fd29(0x176)](_0x13fd29(0x16a)),![];if(isRunning&&bot)return a24_0x25297d[_0x13fd29(0x155)]('Telegram\x20bot\x20already\x20running.'),!![];try{return bot=new Bot(_0x4b3587),bot['on']('message:text',handleMessage),bot['on']('message:voice',async _0xb8a54c=>{const _0x595683=_0x13fd29,_0x40f7fa=_0xb8a54c[_0x595683(0x1e4)]['id'],_0x4d040d=_0xb8a54c[_0x595683(0x165)]?.['id'];if(!_0x4d040d||!a24_0x16e637[_0x595683(0x15a)](_0x4d040d))return;try{const _0x37e662=_0xb8a54c['message']['voice']?.[_0x595683(0x162)];if(!_0x37e662)return;await _0xb8a54c[_0x595683(0x1e3)](_0x595683(0x17d));const _0x3fb67e=await _0xb8a54c[_0x595683(0x1b9)]['getFile'](_0x37e662),_0x3be03d='https://api.telegram.org/file/bot'+_0x4b3587+'/'+_0x3fb67e[_0x595683(0x1c4)];if(!_0x3be03d)return;const _0x5c2d3c=await fetch(_0x3be03d),_0x3b7abd=await _0x5c2d3c[_0x595683(0x15e)](),_0x6bd77b=Buffer['from'](_0x3b7abd),_0x2b9953=join(tmpdir(),_0x595683(0x15b)+Date[_0x595683(0x17a)]()+_0x595683(0x1f4));await a24_0xcf40a4['writeFile'](_0x2b9953,_0x6bd77b),await _0xb8a54c[_0x595683(0x1e3)](_0x595683(0x17d));const _0xd68400=await processVoiceMessage(_0x2b9953);await a24_0xcf40a4[_0x595683(0x1e2)](_0x2b9953)[_0x595683(0x1e6)](()=>{});if(_0xd68400[_0x595683(0x1c7)]){const _0x131e40=await getOrCreateHistory(_0x40f7fa);_0x131e40[_0x595683(0x1bc)]({'role':_0x595683(0x1ea),'content':'[Voice\x20Message]:\x20'+_0xd68400[_0x595683(0x1c7)]}),a24_0x25297d[_0x595683(0x197)]('[Telegram]\x20'+_0xb8a54c[_0x595683(0x165)]?.['first_name']+_0x595683(0x1b5)+_0xd68400['text']),await processTelegramAgentLoop(_0x40f7fa,_0x131e40,getSelectedModel(),_0xd68400[_0x595683(0x1c7)]);}else await _0xb8a54c[_0x595683(0x1f2)](_0x595683(0x1cd));}catch(_0x4a6133){a24_0x25297d['error'](_0x595683(0x1be)+_0x4a6133[_0x595683(0x18e)]),await _0xb8a54c['reply'](_0x595683(0x161)+_0x4a6133[_0x595683(0x18e)]);}}),setInterval(()=>{if(bot)checkReminders(bot);},0xea60),bot[_0x13fd29(0x1e6)](_0xab46c6=>{const _0x4e8476=_0x13fd29;_0xab46c6[_0x4e8476(0x18e)]?.[_0x4e8476(0x1f5)](_0x4e8476(0x180))&&(a24_0x25297d[_0x4e8476(0x176)](_0x4e8476(0x18b)),stopBot());}),bot['start'](),isRunning=!![],a24_0x25297d[_0x13fd29(0x195)](_0x13fd29(0x194)),!![];}catch(_0x130660){return a24_0x25297d[_0x13fd29(0x176)](_0x13fd29(0x1f6)+_0x130660[_0x13fd29(0x18e)]),![];}}export function stopBot(){const _0x58f715=a24_0x348a57;bot&&(bot[_0x58f715(0x1eb)](),bot=null),isRunning=![],verifiedSessions[_0x58f715(0x160)]();}export function isBotRunning(){return isRunning;}
@@ -1 +1 @@
1
- const a7_0x53a9ba=a7_0x48b2;(function(_0x20b0ee,_0x44dde0){const _0x728562=a7_0x48b2,_0x188e7a=_0x20b0ee();while(!![]){try{const _0x91b5b1=parseInt(_0x728562(0x160))/0x1*(-parseInt(_0x728562(0x15f))/0x2)+-parseInt(_0x728562(0x15a))/0x3*(-parseInt(_0x728562(0x14b))/0x4)+parseInt(_0x728562(0x153))/0x5*(parseInt(_0x728562(0x158))/0x6)+parseInt(_0x728562(0x15b))/0x7*(-parseInt(_0x728562(0x169))/0x8)+parseInt(_0x728562(0x164))/0x9*(-parseInt(_0x728562(0x156))/0xa)+parseInt(_0x728562(0x157))/0xb*(-parseInt(_0x728562(0x14e))/0xc)+-parseInt(_0x728562(0x161))/0xd*(-parseInt(_0x728562(0x154))/0xe);if(_0x91b5b1===_0x44dde0)break;else _0x188e7a['push'](_0x188e7a['shift']());}catch(_0xdfb20c){_0x188e7a['push'](_0x188e7a['shift']());}}}(a7_0x3f73,0xd6388));import a7_0x2725a8 from'conf';import a7_0x4e7e95 from'crypto';const config=new a7_0x2725a8({'projectName':a7_0x53a9ba(0x14d),'defaults':{'botToken':'','allowedChatIds':[],'securityPin':'','enabled':![]}}),ENCRYPTION_KEY=a7_0x53a9ba(0x149);function encrypt(_0x377821){const _0x2675fa=a7_0x53a9ba,_0xdff791=a7_0x4e7e95[_0x2675fa(0x165)](0x10),_0x4940d3=a7_0x4e7e95[_0x2675fa(0x146)](_0x2675fa(0x14f))[_0x2675fa(0x147)](ENCRYPTION_KEY)[_0x2675fa(0x144)](),_0x5f1260=a7_0x4e7e95[_0x2675fa(0x14c)](_0x2675fa(0x15d),_0x4940d3,_0xdff791);let _0xf1e8d0=_0x5f1260[_0x2675fa(0x147)](_0x377821,_0x2675fa(0x14a),_0x2675fa(0x151));return _0xf1e8d0+=_0x5f1260[_0x2675fa(0x15e)](_0x2675fa(0x151)),_0xdff791['toString'](_0x2675fa(0x151))+':'+_0xf1e8d0;}function decrypt(_0x512707){const _0x2e490a=a7_0x53a9ba;try{const [_0x4d675f,_0x589968]=_0x512707[_0x2e490a(0x148)](':');if(!_0x4d675f||!_0x589968)return'';const _0x558bd5=Buffer[_0x2e490a(0x150)](_0x4d675f,_0x2e490a(0x151)),_0x307a9b=a7_0x4e7e95[_0x2e490a(0x146)](_0x2e490a(0x14f))['update'](ENCRYPTION_KEY)[_0x2e490a(0x144)](),_0x2de05d=a7_0x4e7e95[_0x2e490a(0x166)](_0x2e490a(0x15d),_0x307a9b,_0x558bd5);let _0x56eeba=_0x2de05d[_0x2e490a(0x147)](_0x589968,_0x2e490a(0x151),'utf8');return _0x56eeba+=_0x2de05d['final'](_0x2e490a(0x14a)),_0x56eeba;}catch{return'';}}export function setBotToken(_0x25896c){const _0x565427=a7_0x53a9ba;config[_0x565427(0x16a)]('botToken',encrypt(_0x25896c));}export function getBotToken(){const _0x278487=a7_0x53a9ba,_0x1d038f=config['get'](_0x278487(0x162));if(!_0x1d038f)return'';return decrypt(_0x1d038f);}function a7_0x48b2(_0x137d67,_0x37b03e){_0x137d67=_0x137d67-0x143;const _0x3f7348=a7_0x3f73();let _0x48b2d4=_0x3f7348[_0x137d67];return _0x48b2d4;}export function setSecurityPin(_0x23b631){const _0x127bcd=a7_0x53a9ba;config['set'](_0x127bcd(0x159),encrypt(_0x23b631));}export function getSecurityPin(){const _0x9de4e3=a7_0x53a9ba,_0x12b7d4=config[_0x9de4e3(0x163)]('securityPin');if(!_0x12b7d4)return'';return decrypt(_0x12b7d4);}function a7_0x3f73(){const _0xa74799=['woozlit-cli-telegram','1020yAufGj','sha256','from','hex','push','62410edQbNj','140pZdzKp','enabled','1150NyUPLu','56111ARPMAQ','138wTMTZS','securityPin','927OYbywN','135163atjvlD','allowedChatIds','aes-256-cbc','final','172536YMfLeF','7ivFmIF','3430232BEsvwG','botToken','get','103509NuDHrs','randomBytes','createDecipheriv','filter','clear','392DjiKIR','set','length','digest','includes','createHash','update','split','woozlit_telegram_secure_key_2026','utf8','16284wleMuM','createCipheriv'];a7_0x3f73=function(){return _0xa74799;};return a7_0x3f73();}export function addAllowedChatId(_0xc7dfad){const _0x48ec79=a7_0x53a9ba,_0x263284=config[_0x48ec79(0x163)](_0x48ec79(0x15c));!_0x263284[_0x48ec79(0x145)](_0xc7dfad)&&(_0x263284[_0x48ec79(0x152)](_0xc7dfad),config['set'](_0x48ec79(0x15c),_0x263284));}export function removeAllowedChatId(_0x4e0a2e){const _0x109422=a7_0x53a9ba,_0x4e61bb=config[_0x109422(0x163)]('allowedChatIds');config[_0x109422(0x16a)](_0x109422(0x15c),_0x4e61bb[_0x109422(0x167)](_0x4de561=>_0x4de561!==_0x4e0a2e));}export function getAllowedChatIds(){const _0x4d172d=a7_0x53a9ba;return config[_0x4d172d(0x163)](_0x4d172d(0x15c));}export function isAllowedChatId(_0xf54f2c){const _0x4eba02=a7_0x53a9ba,_0x571e87=config[_0x4eba02(0x163)]('allowedChatIds');return _0x571e87[_0x4eba02(0x143)]===0x0||_0x571e87[_0x4eba02(0x145)](_0xf54f2c);}export function setEnabled(_0x3f1bf9){config['set']('enabled',_0x3f1bf9);}export function isEnabled(){const _0x6f782b=a7_0x53a9ba;return config['get'](_0x6f782b(0x155));}export function isConfigured(){return!!getBotToken();}export function clearConfig(){const _0x40cb45=a7_0x53a9ba;config[_0x40cb45(0x168)]();}
1
+ const a25_0x36afd6=a25_0x399d;(function(_0x59dfb4,_0x417e12){const _0x19a3f1=a25_0x399d,_0x45425f=_0x59dfb4();while(!![]){try{const _0xbcee73=-parseInt(_0x19a3f1(0x199))/0x1*(-parseInt(_0x19a3f1(0x1a9))/0x2)+parseInt(_0x19a3f1(0x1aa))/0x3+parseInt(_0x19a3f1(0x19e))/0x4+parseInt(_0x19a3f1(0x1a0))/0x5+-parseInt(_0x19a3f1(0x1a1))/0x6*(-parseInt(_0x19a3f1(0x1a7))/0x7)+-parseInt(_0x19a3f1(0x1a8))/0x8+-parseInt(_0x19a3f1(0x198))/0x9*(parseInt(_0x19a3f1(0x19a))/0xa);if(_0xbcee73===_0x417e12)break;else _0x45425f['push'](_0x45425f['shift']());}catch(_0x142009){_0x45425f['push'](_0x45425f['shift']());}}}(a25_0x5f3a,0x517f3));import a25_0x1f4740 from'conf';import a25_0x8367b from'crypto';const config=new a25_0x1f4740({'projectName':a25_0x36afd6(0x194),'defaults':{'botToken':'','allowedChatIds':[],'securityPin':'','enabled':![]}}),ENCRYPTION_KEY=a25_0x36afd6(0x1a4);function encrypt(_0x48154c){const _0x5e6c52=a25_0x36afd6,_0x496ea6=a25_0x8367b['randomBytes'](0x10),_0x46caba=a25_0x8367b[_0x5e6c52(0x190)](_0x5e6c52(0x18d))[_0x5e6c52(0x197)](ENCRYPTION_KEY)[_0x5e6c52(0x19b)](),_0x4445fd=a25_0x8367b[_0x5e6c52(0x18b)](_0x5e6c52(0x191),_0x46caba,_0x496ea6);let _0x28b306=_0x4445fd[_0x5e6c52(0x197)](_0x48154c,_0x5e6c52(0x193),_0x5e6c52(0x192));return _0x28b306+=_0x4445fd[_0x5e6c52(0x1ab)]('hex'),_0x496ea6[_0x5e6c52(0x19d)](_0x5e6c52(0x192))+':'+_0x28b306;}function decrypt(_0x283364){const _0x4b9746=a25_0x36afd6;try{const [_0x9b5698,_0xd436dd]=_0x283364['split'](':');if(!_0x9b5698||!_0xd436dd)return'';const _0x300a40=Buffer[_0x4b9746(0x18c)](_0x9b5698,_0x4b9746(0x192)),_0xf313be=a25_0x8367b[_0x4b9746(0x190)](_0x4b9746(0x18d))['update'](ENCRYPTION_KEY)[_0x4b9746(0x19b)](),_0x7ea80=a25_0x8367b[_0x4b9746(0x19c)](_0x4b9746(0x191),_0xf313be,_0x300a40);let _0x2815c3=_0x7ea80['update'](_0xd436dd,_0x4b9746(0x192),_0x4b9746(0x193));return _0x2815c3+=_0x7ea80[_0x4b9746(0x1ab)](_0x4b9746(0x193)),_0x2815c3;}catch{return'';}}export function setBotToken(_0x598d31){const _0x12bd87=a25_0x36afd6;config[_0x12bd87(0x195)](_0x12bd87(0x1a6),encrypt(_0x598d31));}export function getBotToken(){const _0x18472f=a25_0x36afd6,_0x52a3e9=config[_0x18472f(0x1a3)](_0x18472f(0x1a6));if(!_0x52a3e9)return'';return decrypt(_0x52a3e9);}export function setSecurityPin(_0x1e227d){const _0x1b017b=a25_0x36afd6;config[_0x1b017b(0x195)]('securityPin',encrypt(_0x1e227d));}export function getSecurityPin(){const _0x3669b4=a25_0x36afd6,_0x5270c3=config[_0x3669b4(0x1a3)](_0x3669b4(0x1a5));if(!_0x5270c3)return'';return decrypt(_0x5270c3);}export function addAllowedChatId(_0x13dcaa){const _0x5cc187=a25_0x36afd6,_0x357bb1=config[_0x5cc187(0x1a3)](_0x5cc187(0x196));!_0x357bb1[_0x5cc187(0x18f)](_0x13dcaa)&&(_0x357bb1[_0x5cc187(0x19f)](_0x13dcaa),config[_0x5cc187(0x195)](_0x5cc187(0x196),_0x357bb1));}export function removeAllowedChatId(_0x12a864){const _0x230a89=a25_0x36afd6,_0x2cbebf=config[_0x230a89(0x1a3)](_0x230a89(0x196));config[_0x230a89(0x195)]('allowedChatIds',_0x2cbebf['filter'](_0xb0252d=>_0xb0252d!==_0x12a864));}export function getAllowedChatIds(){const _0xc2961=a25_0x36afd6;return config[_0xc2961(0x1a3)]('allowedChatIds');}export function isAllowedChatId(_0x220e5e){const _0x1f082f=a25_0x36afd6,_0x196a4b=config['get'](_0x1f082f(0x196));return _0x196a4b[_0x1f082f(0x1ac)]===0x0||_0x196a4b[_0x1f082f(0x18f)](_0x220e5e);}function a25_0x5f3a(){const _0x23f841=['2051329yOlNaH','97328tGGXex','585436fOhooI','303513oGOfRO','final','length','createCipheriv','from','sha256','enabled','includes','createHash','aes-256-cbc','hex','utf8','woozlit-cli-telegram','set','allowedChatIds','update','549ULlYuT','1RAHXTs','125900EAmdQc','digest','createDecipheriv','toString','1437280NgPUpp','push','338555xKnCsr','6dSzchE','clear','get','woozlit_telegram_secure_key_2026','securityPin','botToken'];a25_0x5f3a=function(){return _0x23f841;};return a25_0x5f3a();}function a25_0x399d(_0x18fca8,_0x168cc2){_0x18fca8=_0x18fca8-0x18b;const _0x5f3a7e=a25_0x5f3a();let _0x399d64=_0x5f3a7e[_0x18fca8];return _0x399d64;}export function setEnabled(_0x598b4b){const _0xaafad1=a25_0x36afd6;config['set'](_0xaafad1(0x18e),_0x598b4b);}export function isEnabled(){const _0x1006a2=a25_0x36afd6;return config[_0x1006a2(0x1a3)]('enabled');}export function isConfigured(){return!!getBotToken();}export function clearConfig(){const _0x5d8ccd=a25_0x36afd6;config[_0x5d8ccd(0x1a2)]();}
@@ -1,2 +1,3 @@
1
1
  export * from "./config.js";
2
2
  export { startBot, stopBot, isBotRunning } from "./bot.js";
3
+ export { setupTelegram } from "./setup.js";