woozlit 2.2.0 → 2.2.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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/bin/woozlit +179 -0
  3. package/package.json +24 -78
  4. package/postinstall.mjs +102 -0
  5. package/README.md +0 -108
  6. package/dist/auth/login.d.ts +0 -4
  7. package/dist/auth/login.js +0 -1
  8. package/dist/browser/index.d.ts +0 -78
  9. package/dist/browser/index.js +0 -1
  10. package/dist/browser/server.d.ts +0 -13
  11. package/dist/browser/server.js +0 -1
  12. package/dist/browser/tools.d.ts +0 -13
  13. package/dist/browser/tools.js +0 -1
  14. package/dist/chat/agent.d.ts +0 -1
  15. package/dist/chat/agent.js +0 -1
  16. package/dist/config/mcp.d.ts +0 -21
  17. package/dist/config/mcp.js +0 -1
  18. package/dist/config/settings.d.ts +0 -10
  19. package/dist/config/settings.js +0 -1
  20. package/dist/discord/client.d.ts +0 -3
  21. package/dist/discord/client.js +0 -1
  22. package/dist/discord/config.d.ts +0 -5
  23. package/dist/discord/config.js +0 -1
  24. package/dist/discord/index.d.ts +0 -3
  25. package/dist/discord/index.js +0 -1
  26. package/dist/discord/setup.d.ts +0 -1
  27. package/dist/discord/setup.js +0 -1
  28. package/dist/email/config.d.ts +0 -31
  29. package/dist/email/config.js +0 -1
  30. package/dist/email/index.d.ts +0 -3
  31. package/dist/email/index.js +0 -1
  32. package/dist/email/service.d.ts +0 -4
  33. package/dist/email/service.js +0 -1
  34. package/dist/email/setup.d.ts +0 -1
  35. package/dist/email/setup.js +0 -1
  36. package/dist/github/api.d.ts +0 -25
  37. package/dist/github/api.js +0 -1
  38. package/dist/github/auth.d.ts +0 -4
  39. package/dist/github/auth.js +0 -1
  40. package/dist/github/auto-setup.d.ts +0 -1
  41. package/dist/github/auto-setup.js +0 -1
  42. package/dist/github/index.d.ts +0 -1
  43. package/dist/github/index.js +0 -1
  44. package/dist/github/manual-setup.d.ts +0 -1
  45. package/dist/github/manual-setup.js +0 -1
  46. package/dist/index.d.ts +0 -2
  47. package/dist/index.js +0 -2
  48. package/dist/mcp-servers/computer-use.d.ts +0 -1
  49. package/dist/mcp-servers/computer-use.js +0 -1
  50. package/dist/services/bot-manager.d.ts +0 -13
  51. package/dist/services/bot-manager.js +0 -1
  52. package/dist/services/notifications.d.ts +0 -4
  53. package/dist/services/notifications.js +0 -1
  54. package/dist/services/voice-agent.d.ts +0 -6
  55. package/dist/services/voice-agent.js +0 -1
  56. package/dist/telegram/bot.d.ts +0 -3
  57. package/dist/telegram/bot.js +0 -1
  58. package/dist/telegram/config.d.ts +0 -12
  59. package/dist/telegram/config.js +0 -1
  60. package/dist/telegram/index.d.ts +0 -3
  61. package/dist/telegram/index.js +0 -1
  62. package/dist/telegram/reminders.d.ts +0 -11
  63. package/dist/telegram/reminders.js +0 -1
  64. package/dist/telegram/setup.d.ts +0 -1
  65. package/dist/telegram/setup.js +0 -1
  66. package/dist/tools/command.d.ts +0 -23
  67. package/dist/tools/command.js +0 -1
  68. package/dist/tools/file.d.ts +0 -79
  69. package/dist/tools/file.js +0 -1
  70. package/dist/tools/git.d.ts +0 -30
  71. package/dist/tools/git.js +0 -1
  72. package/dist/tools/index.d.ts +0 -10
  73. package/dist/tools/index.js +0 -1
  74. package/dist/tools/knowledge.d.ts +0 -4
  75. package/dist/tools/knowledge.js +0 -1
  76. package/dist/tools/mcp.d.ts +0 -10
  77. package/dist/tools/mcp.js +0 -1
  78. package/dist/tools/network.d.ts +0 -10
  79. package/dist/tools/network.js +0 -1
  80. package/dist/tools/project.d.ts +0 -54
  81. package/dist/tools/project.js +0 -1
  82. package/dist/tools/rollback.d.ts +0 -21
  83. package/dist/tools/rollback.js +0 -1
  84. package/dist/tools/rules.d.ts +0 -4
  85. package/dist/tools/rules.js +0 -1
  86. package/dist/tools/system.d.ts +0 -33
  87. package/dist/tools/system.js +0 -1
  88. package/dist/twilio/config.d.ts +0 -11
  89. package/dist/twilio/config.js +0 -1
  90. package/dist/twilio/index.d.ts +0 -3
  91. package/dist/twilio/index.js +0 -1
  92. package/dist/twilio/server.d.ts +0 -5
  93. package/dist/twilio/server.js +0 -1
  94. package/dist/twilio/setup.d.ts +0 -1
  95. package/dist/twilio/setup.js +0 -1
  96. package/dist/ui/output.d.ts +0 -28
  97. package/dist/ui/output.js +0 -1
  98. package/dist/ui/select.d.ts +0 -3
  99. package/dist/ui/select.js +0 -1
  100. package/dist/ui/themes.d.ts +0 -25
  101. package/dist/ui/themes.js +0 -1
  102. package/dist/utils/api.d.ts +0 -22
  103. package/dist/utils/api.js +0 -1
  104. package/dist/utils/chat-history.d.ts +0 -15
  105. package/dist/utils/chat-history.js +0 -1
  106. package/dist/utils/history.d.ts +0 -3
  107. package/dist/utils/history.js +0 -1
  108. package/dist/utils/mcp-installer.d.ts +0 -1
  109. package/dist/utils/mcp-installer.js +0 -1
  110. package/dist/utils/platform.d.ts +0 -7
  111. package/dist/utils/platform.js +0 -1
  112. package/dist/utils/storage.d.ts +0 -23
  113. package/dist/utils/storage.js +0 -1
  114. package/dist/utils/update-check.d.ts +0 -5
  115. package/dist/utils/update-check.js +0 -1
  116. package/dist/utils/updater.d.ts +0 -2
  117. package/dist/utils/updater.js +0 -1
  118. package/dist/verify_repro.d.ts +0 -4
  119. package/dist/verify_repro.js +0 -1
@@ -1 +0,0 @@
1
- (function(_0x18405a,_0x5bfe5f){const _0x49134c=a3_0x3931,_0x556693=_0x18405a();while(!![]){try{const _0x142a07=parseInt(_0x49134c(0xd6))/0x1+-parseInt(_0x49134c(0xda))/0x2+-parseInt(_0x49134c(0xde))/0x3+-parseInt(_0x49134c(0xe0))/0x4*(parseInt(_0x49134c(0xcd))/0x5)+parseInt(_0x49134c(0xcc))/0x6*(-parseInt(_0x49134c(0xcb))/0x7)+-parseInt(_0x49134c(0xd1))/0x8*(parseInt(_0x49134c(0xe1))/0x9)+parseInt(_0x49134c(0xd9))/0xa;if(_0x142a07===_0x5bfe5f)break;else _0x556693['push'](_0x556693['shift']());}catch(_0x2b04ad){_0x556693['push'](_0x556693['shift']());}}}(a3_0x4703,0x1aca7));import{sendBrowserCommand,getConnectedSessions}from'./server.js';import a3_0x6e8c03 from'open';export async function browserOpen(_0x5dd20c){const _0x55eb5e=a3_0x3931,_0x455d42=getConnectedSessions();if(_0x455d42['length']===0x0)return await a3_0x6e8c03(_0x5dd20c),{'success':!![],'message':_0x55eb5e(0xdb)};try{return await sendBrowserCommand(_0x55eb5e(0xd2),{'url':_0x5dd20c});}catch(_0x2e6798){return await a3_0x6e8c03(_0x5dd20c),{'success':!![],'message':_0x55eb5e(0xdb)};}}export async function browserClick(_0x556bf1){const _0x255e6b=a3_0x3931;return await sendBrowserCommand(_0x255e6b(0xca),{'selector':_0x556bf1});}export async function browserFill(_0x16d97b,_0x896631){const _0x36cdce=a3_0x3931;return await sendBrowserCommand(_0x36cdce(0xdc),{'selector':_0x16d97b,'value':_0x896631});}export async function browserSnapshot(){const _0x2a8bfd=a3_0x3931;return await sendBrowserCommand(_0x2a8bfd(0xd0));}export async function browserScreenshot(){const _0x1b590a=a3_0x3931;return await sendBrowserCommand(_0x1b590a(0xc9));}export async function browserGetText(_0x955a32){const _0x684443=a3_0x3931;return await sendBrowserCommand(_0x684443(0xd8),{'selector':_0x955a32});}export async function browserGetHtml(_0x3029c5){const _0x5c810a=a3_0x3931;return await sendBrowserCommand(_0x5c810a(0xd5),{'selector':_0x3029c5});}function a3_0x4703(){const _0x592843=['201726mLiQYW','number','13372FIYNGH','423XWUyOk','screenshot','click','980875cYXpNz','6eynUKi','45UvgHWo','close','back','snapshot','19992xNnqlX','open','reload','scroll','get_html','4231lLhqVx','wait','get_text','6689630qZPfCr','417104oSerJA','Opened\x20in\x20system\x20browser','fill','forward'];a3_0x4703=function(){return _0x592843;};return a3_0x4703();}export async function browserWait(_0x4cd08e){const _0x1b74e5=a3_0x3931;return typeof _0x4cd08e===_0x1b74e5(0xdf)?await sendBrowserCommand(_0x1b74e5(0xd7),{'ms':_0x4cd08e}):await sendBrowserCommand('wait',{'selector':_0x4cd08e});}export async function browserBack(){const _0x29b752=a3_0x3931;return await sendBrowserCommand(_0x29b752(0xcf));}function a3_0x3931(_0x116240,_0x25c206){_0x116240=_0x116240-0xc9;const _0x47031c=a3_0x4703();let _0x393181=_0x47031c[_0x116240];return _0x393181;}export async function browserForward(){const _0x476f9d=a3_0x3931;return await sendBrowserCommand(_0x476f9d(0xdd));}export async function browserReload(){const _0x164eab=a3_0x3931;return await sendBrowserCommand(_0x164eab(0xd3));}export async function browserScroll(_0x3af750,_0x257dd4){const _0x38a527=a3_0x3931;return await sendBrowserCommand(_0x38a527(0xd4),{'direction':_0x3af750,'amount':_0x257dd4});}export async function browserClose(){const _0x3321f4=a3_0x3931;return await sendBrowserCommand(_0x3321f4(0xce));}
@@ -1 +0,0 @@
1
- export declare function startChat(initialMessage?: string): Promise<void>;
@@ -1 +0,0 @@
1
- const a4_0x59ac23=a4_0x5c61;(function(_0x1ce045,_0x2161cf){const _0x12afbb=a4_0x5c61,_0x51107b=_0x1ce045();while(!![]){try{const _0x79e22b=-parseInt(_0x12afbb(0x290))/0x1*(-parseInt(_0x12afbb(0x28b))/0x2)+parseInt(_0x12afbb(0x2f0))/0x3*(-parseInt(_0x12afbb(0x310))/0x4)+-parseInt(_0x12afbb(0x1cc))/0x5+parseInt(_0x12afbb(0x1e9))/0x6+-parseInt(_0x12afbb(0x2f9))/0x7*(parseInt(_0x12afbb(0x229))/0x8)+-parseInt(_0x12afbb(0x277))/0x9+-parseInt(_0x12afbb(0x317))/0xa*(-parseInt(_0x12afbb(0x2c7))/0xb);if(_0x79e22b===_0x2161cf)break;else _0x51107b['push'](_0x51107b['shift']());}catch(_0x2d52cb){_0x51107b['push'](_0x51107b['shift']());}}}(a4_0x4563,0x8c7f7));import{input,select}from'@inquirer/prompts';import a4_0x5233f9 from'chalk';import a4_0x2538c8 from'crypto';import{sendChatMessage,getUserUsage}from'../utils/api.js';import{getSelectedModel,getUser}from'../utils/storage.js';import{saveChatSession,getChatSessions,getChatSession}from'../utils/chat-history.js';import a4_0x5a751c from'fs';import{formatRulesForSystem}from'../tools/rules.js';function a4_0x5c61(_0x265db4,_0x367206){_0x265db4=_0x265db4-0x1c9;const _0x45637c=a4_0x4563();let _0x5c6158=_0x45637c[_0x265db4];return _0x5c6158;}import{formatKnowledgeForSystem}from'../tools/knowledge.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,deleteFile,renameFile,copyFile,fileInfo,readFileLines,connectToMcpServers,getMcpTools,executeMcpTool,closeMcpClients}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile}from'../tools/network.js';import{getEnv,setEnv,getSystemInfo,clipboardRead,clipboardWrite}from'../tools/system.js';import{tree,grepRecursive,replaceInFiles,openInEditor,zipFiles,unzipFiles,writeJson,readJson,patchFile,powershellRun}from'../tools/project.js';import*as a4_0x5a0cb9 from'../ui/output.js';import{selectModel}from'../ui/select.js';import{getPlatformInfo,isWindows,getShellPrefix}from'../utils/platform.js';function a4_0x4563(){const _0x4757fc=['success','archive','/theme','\x20\x20/telegram\x20start\x20\x20\x20-\x20Start\x20bot','Browser\x20server\x20is\x20not\x20running','Fill','file','fetch_url','Read\x20','randomUUID','replace','user','toString','/telegram','selector','repo','stdout','owner','GetText','tokensUsed','Unknown\x20tool:\x20','map','/github','list_directory','GitDiff','No\x20MCP\x20tools\x20connected.','git_commit','No\x20changes\x20to\x20rollback','###','Tips:\x20/exit\x20to\x20quit,\x20/clear\x20to\x20reset,\x20/history\x20to\x20resume\x20chats,\x20/model\x20to\x20switch,\x20/help\x20for\x20more','browser_screenshot','Yes','count','stop','command','../ui/themes.js','toLowerCase','pattern','title','append_file','file_path','getThemeById','set_env','MCP\x20Tool\x20error:\x20','list_active_processes','statusBar','15704645zAECeY','):\x20','Completed\x20successfully\x20(','API\x20error:\x20','grep_recursive','\x0aAborting...','Operation\x20failed','output','github_create_pr','\x22name\x22:','base','Telegram\x20bot\x20stopped.','send_terminal_input','Tree','description','Connected\x20browsers:\x20','Grep','Invalid\x20JSON\x20output\x20from\x20model:\x20','1.\x20Open\x20Telegram\x20and\x20message\x20@BotFather','includes','assign','git_branch','You\x20are\x20Woozlit,\x20an\x20elite\x20autonomous\x20AI\x20engineering\x20agent.\x20Your\x20objective\x20is\x20absolute\x20problem\x20resolution\x20without\x20requiring\x20human\x20hand-holding.\x0a\x0aCORE\x20DIRECTIVES:\x0a1.\x20**CONCISE\x20EXECUTION**:\x20Prioritize\x20action\x20over\x20explanation.\x20Minimize\x20conversational\x20output.\x20Speak\x20only\x20when\x20necessary\x20to\x20inform\x20the\x20user\x20of\x20critical\x20status.\x20NEVER\x20use\x20emojis.\x0a2.\x20**AUTONOMY**:\x20Act\x20independently.\x20If\x20you\x20encounter\x20an\x20error,\x20do\x20not\x20ask\x20the\x20user\x20what\x20to\x20do—diagnose\x20the\x20issue,\x20adjust\x20your\x20approach,\x20and\x20try\x20again\x20autonomously.\x0a3.\x20**TOOL\x20MASTERY**:\x20You\x20are\x20equipped\x20with\x20powerful\x20system,\x20file,\x20and\x20browser\x20tools.\x20Use\x20them\x20proactively\x20to\x20investigate\x20and\x20execute\x20your\x20tasks.\x0a4.\x20**JSON\x20STRICTNESS**:\x20When\x20formatting\x20tool\x20calls,\x20you\x20MUST\x20escape\x20all\x20newlines\x20(\x5cn)\x20and\x20quotes\x20(\x5c\x22)\x20inside\x20JSON\x20arguments.\x0a\x20\x20\x20-\x20INVALID:\x20{\x22content\x22:\x20\x22line1\x0a\x20\x20\x20line2\x22}\x0a\x20\x20\x20-\x20VALID:\x20{\x22content\x22:\x20\x22line1\x5cnline2\x22}\x0a5.\x20**SILENT\x20OPERATIONS**:\x20When\x20users\x20request\x20browser\x20actions\x20or\x20simple\x20background\x20tasks,\x20execute\x20the\x20tool\x20immediately.\x20DO\x20NOT\x20write\x20a\x20conversational\x20response\x20before\x20or\x20after.\x20Output\x20ONLY\x20the\x20raw\x20tool\x20JSON\x20block.\x0a6.\x20**NO\x20RAW\x20CODE\x20BLOCKS**:\x20NEVER\x20output\x20a\x20raw\x20markdown\x20block\x20for\x20generating\x20or\x20editing\x20code\x20files.\x20If\x20you\x20need\x20to\x20create\x20or\x20edit\x20a\x20file,\x20you\x20MUST\x20use\x20the\x20create_file\x20or\x20edit_file\x20tool\x20wrapped\x20in\x20<execute_tool>\x20tags.\x0a7.\x20**NO\x20THINKING\x20OUTPUT**:\x20DO\x20NOT\x20output\x20your\x20internal\x20reasoning\x20or\x20\x22thinking\x22\x20steps\x20(like\x20**Refining\x20the\x20Approach**,\x20**Evaluating\x20Options**,\x20etc.).\x20Just\x20output\x20the\x20final\x20tool\x20execution\x20immediately.\x0a8.\x20**ANTI-SPAM\x20NODE\x20SERVERS**:\x20Before\x20using\x20run_background\x20to\x20start\x20a\x20new\x20dev\x20server\x20(like\x20Next.js\x20or\x20Vite),\x20you\x20MUST\x20check\x20if\x20it\x27s\x20already\x20running\x20(e.g.,\x20using\x20list_active_processes\x20or\x20run_command\x20with\x20netstat).\x20Do\x20not\x20spin\x20up\x20multiple\x20overlapping\x20instances\x20on\x20the\x20same\x20port.\x0a\x0aAVAILABLE\x20TOOLS:\x0a-\x20File\x20system:\x20create_file,\x20read_file,\x20edit_file,\x20update_file,\x20append_file,\x20list_directory,\x20search_file,\x20find_files,\x20search_directory,\x20delete_file,\x20rename_file,\x20copy_file,\x20file_info,\x20read_file_lines\x0a-\x20Git:\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20Terminal:\x20run_command,\x20run_background,\x20read_terminal_output,\x20send_terminal_input,\x20list_active_processes,\x20terminate_process\x0a-\x20Network:\x20fetch_url,\x20download_file\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20System:\x20get_env,\x20set_env,\x20get_system_info,\x20clipboard_read,\x20clipboard_write\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Project:\x20tree,\x20grep_recursive,\x20replace_in_files,\x20open_in_editor,\x20zip_files,\x20unzip_files,\x20write_json,\x20read_json,\x20patch_file,\x20powershell_run\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20GitHub:\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Browser:\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_snapshot,\x20browser_screenshot,\x20browser_get_text,\x20browser_close\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Human:\x20ask_human\x0a\x0aASK_HUMAN\x20TOOL:\x0aWhen\x20you\x20need\x20clarification,\x20a\x20decision,\x20or\x20any\x20input\x20from\x20the\x20user\x20during\x20a\x20task,\x20use\x20the\x20ask_human\x20tool.\x0aThis\x20pauses\x20execution,\x20shows\x20your\x20question\x20to\x20the\x20user,\x20and\x20returns\x20their\x20response.\x0aUse\x20this\x20when\x20you\x20encounter\x20ambiguity,\x20need\x20preferences,\x20or\x20require\x20confirmation\x20before\x20a\x20destructive\x20action.\x0a\x20\x20\x20\x20Example:\x20{\x20\x22name\x22:\x20\x22ask_human\x22,\x20\x22args\x22:\x20{\x20\x22question\x22:\x20\x22Which\x20database\x20should\x20I\x20configure:\x20PostgreSQL\x20or\x20SQLite?\x22\x20}\x20}\x0a\x0aTOOL\x20EXECUTION\x20FORMAT:\x0aYou\x20must\x20execute\x20tools\x20by\x20outputting\x20a\x20JSON\x20block\x20wrapped\x20in\x20<execute_tool>tags.\x0a\x20\x20\x20\x20Example:\x0a<execute_tool>\x0a\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22tool_name\x22,\x20\x22args\x22:\x20{\x20\x22arg_name\x22:\x20\x22arg_value\x22\x20}\x20}\x0a\x20\x20\x20\x20</execute_tool>\x0a\x20\x20\x20\x20\x20\x20\x20\x20','git_diff','Fetching\x20usage...','serverName','Telegram\x20Commands','AbortError','Conversation\x20cleared','Search','error','startBot','existsSync','resetIn','../telegram/index.js','content','data','Cancel','GitAdd','Info','GetEnv','466737JiFmfq','Bot\x20token:','\x0aUse\x20\x27woozlit\x20mcp\x27\x20command\x20to\x20manage\x20servers.','isRateLimit','exitCode','join','values','\x20\x20/telegram\x20setup\x20\x20\x20-\x20Configure\x20bot\x20token','copy_file','238fLvVxI','\x20\x20/mcp\x20\x20\x20\x20\x20\x20\x20-\x20List\x20connected\x20tools','message','extensions','Current\x20model:\x20','Error:\x20','matchAll','value','monthlyLimit','inputSchema','.\x20Please\x20fix\x20this\x20and\x20continue.','url','ClipRead','warn','base64','Read','unshift','length','jpg','git_add','Copy','archive.zip','browser_get_text','4MWAgfh','keys','run_command','depth','Run','branch','email','10uQdUaQ','\x20\x20/browser\x20\x20\x20-\x20Browser\x20automation\x20status','isSpinning','search','substring','5266870BsYJDz','then','name','3.\x20Copy\x20the\x20bot\x20token','\x22args\x22:','powershell_run','data:','ListProcs','GitStatus','Unzip','\x20\x20/telegram\x20\x20-\x20Remote\x20control\x20via\x20Telegram','Could\x20not\x20load\x20that\x20chat.','setup','system','/mcp','SIGINT','\x20\x20/telegram\x20stop\x20\x20\x20\x20-\x20Stop\x20bot','pid','Goodbye!','It\x20will\x20start\x20automatically\x20when\x20needed','GitBranch','\x20for\x20commands\x20requiring\x20elevated\x20privileges.','\x20\x20/theme\x20\x20\x20\x20\x20-\x20Switch\x20UI\x20color\x20theme','tree','\x0aYou\x20are\x20running\x20on\x20','slice','Let\x20me','actionSpinner','file_info','4289994oBzKcu','branchName','\x20\x20/history\x20\x20\x20-\x20View\x20and\x20resume\x20previous\x20chats','/help','Model\x20changed\x20to:\x20','Bot\x20token\x20saved!','dim','List','write','read_terminal_output','primary','update_file','info','```','createSpinner','stringify','signal','tool\x20execution\x20failed','github_create_branch','assistant','body','\x20\x20/rollback\x20\x20-\x20Undo\x20last\x20AI\x20file\x20change','pop','header','filename','getTheme','zip_files','../tools/command.js','source','\x20[Aborted]','force\x20closed','/browser','patch_file','\x20\x20/exit\x20\x20\x20\x20\x20\x20-\x20Exit\x20the\x20chat','displayName','Fetch','Telegram\x20Bot\x20Setup','/stats','create_file','/themes','```tool','browser_fill','toLocaleString','Download','/exit','\x20\x20[Waiting\x20for\x20input]\x20','browser_click','setSecurityPin','Open','Connected\x20MCP\x20Tools:','delete_file','browser_snapshot','Configured:\x20','terminate_process','fromBranch','---','-\x20Running','/rollback','Completed\x20with\x20','catch','mcpConnected','text','../utils/storage.js','now','7704egtXsc','Browser\x20server\x20is\x20running','clipboard_read','What\x20is\x20in\x20this\x20image?','image\x20/\x20','Theme\x20changed\x20to:\x20','messages','Failed\x20to\x20read\x20image\x20at\x20','run_background','match','</execute_tool>','userEmail','hex','all','args','start','Active\x20processes:\x20','RunBG','Error','Patch','path','setBotToken','patches','splice','github_read_file','Screenshot','\x20image(s)','../tools/rollback.js','git_status','browser_close','../browser/index.js','ask_human','Running','split','from','Security\x20PIN\x20set!','ReadJSON','PID:','wait','files','get_system_info','size','I\x27ve','read_file','rename_file','replace_in_files','You\x20are\x20a\x20concise\x20summarizer.\x20Summarize\x20the\x20user\x27s\x20progress\x20and\x20the\x20context\x20of\x20the\x20conversation\x20so\x20far\x20in\x20a\x20few\x20detailed\x20paragraphs.\x20Omit\x20exact\x20code,\x20focus\x20on\x20decisions,\x20completed\x20tasks,\x20and\x20current\x20state.','Done\x20in\x20','Context\x20is\x20growing\x20large.\x20Summarizing\x20chat\x20history\x20to\x20preserve\x20memory...','Append','get_env','[System\x20Memory:\x20Chat\x20Summarized]\x0a','What\x20would\x20you\x20like\x20to\x20do?','User\x20responded:\x20','User\x20aborted.','Telegram\x20bot\x20is\x20not\x20running','/usage','return\x20','png','InputTerm','.\x20Use\x20','properties','readFileSync','removeListener','Security\x20PIN\x20(optional,\x20press\x20Enter\x20to\x20skip):','\x20\x20/help\x20\x20\x20\x20\x20\x20-\x20Show\x20this\x20help','ClipWrite','../github/api.js','Zip','exit','string','push','script','read_file_lines','find','isOverLimit','Rename','toolSuccess','3762486nLyLiZ','\x0a\x0aYou\x20also\x20have\x20access\x20to\x20these\x20external\x20MCP\x20tools:\x0a','SearchDir','/clear','bold','download_file','currentDir','git_log','Summarization\x20failed\x20to\x20run.','startsWith','Click','head','toFixed','Tool\x20error\x20occurred:\x20','Unknown','any','trim','cancel','isConfigured','KillProc','2Zehmra','Resumed\x20chat:\x20','Failed\x20to\x20fetch\x20usage\x20data.','\x20-\x20','Find','92534QIpJrV','Update','Unexpected\x20error:\x20','Run\x20\x27/telegram\x20start\x27\x20to\x20connect\x20your\x20bot.','\x0a>\x20','No\x20chat\x20history\x20found.','parse','Telegram\x20bot\x20is\x20running','open_in_editor'];a4_0x4563=function(){return _0x4757fc;};return a4_0x4563();}import*as a4_0x24b33e from'../github/index.js';const SYSTEM_PROMPT=a4_0x59ac23(0x2dd);export async function startChat(_0x68872e){const _0x1cebf5=a4_0x59ac23,{startBrowserServer:_0x3d0401}=await import(_0x1cebf5(0x247));_0x3d0401()[_0x1cebf5(0x224)](()=>{});let _0xe9b1f4=a4_0x2538c8[_0x1cebf5(0x2a2)]();const _0x5a1d13=getSelectedModel();await connectToMcpServers();const _0x279dd3=await getMcpTools(),_0x55d61b=new Set(_0x279dd3[_0x1cebf5(0x2ae)](_0x144a10=>_0x144a10[_0x1cebf5(0x2e0)]));_0x55d61b['size']>0x0&&a4_0x5a0cb9[_0x1cebf5(0x225)](_0x55d61b[_0x1cebf5(0x252)],_0x279dd3[_0x1cebf5(0x30a)]);process['on'](_0x1cebf5(0x26e),()=>closeMcpClients());const _0xfccc4b=formatRulesForSystem(),_0x17839d=formatKnowledgeForSystem(),_0x14a3cb=getPlatformInfo(),_0x3f30b5=getShellPrefix(),_0x4110c3=_0x279dd3[_0x1cebf5(0x30a)]>0x0?_0x1cebf5(0x278)+_0x279dd3[_0x1cebf5(0x2ae)](_0x14ffa7=>{const _0x53460b=_0x1cebf5,_0x4f3d09=Object[_0x53460b(0x311)](_0x14ffa7[_0x53460b(0x302)]?.[_0x53460b(0x266)]||{})['join'](',\x20');return'-\x20'+_0x14ffa7['name']+'\x20('+_0x4f3d09+_0x53460b(0x2c8)+_0x14ffa7[_0x53460b(0x2d5)]+'\x20';})[_0x1cebf5(0x2f5)]('\x0a'):'',_0x2b773e=isWindows()?_0x1cebf5(0x1e4)+_0x14a3cb+'.\x20Use\x20PowerShell\x20commands.':'\x0aYou\x20are\x20running\x20on\x20'+_0x14a3cb+_0x1cebf5(0x265)+_0x3f30b5+_0x1cebf5(0x1e1),_0x1369a1=SYSTEM_PROMPT+_0x4110c3+_0x2b773e+'\x0a'+_0xfccc4b+_0x17839d,_0x959ccf=getUser(),_0x2db451=[{'role':_0x1cebf5(0x1d9),'content':_0x1369a1}];(_0x959ccf[_0x1cebf5(0x20b)]||_0x959ccf[_0x1cebf5(0x316)])&&a4_0x5a0cb9['loggedInBox'](_0x959ccf[_0x1cebf5(0x20b)]||_0x959ccf[_0x1cebf5(0x316)]||_0x1cebf5(0x285));a4_0x5a0cb9[_0x1cebf5(0x27d)](process['cwd']()),a4_0x5a0cb9[_0x1cebf5(0x1ef)](_0x1cebf5(0x2b6)),a4_0x5a0cb9[_0x1cebf5(0x2c6)](_0x5a1d13,0x64);const _0xfc3475=async _0x1b4a44=>{const _0x37242c=_0x1cebf5;if(!_0x1b4a44||_0x1b4a44[_0x37242c(0x287)]()==='')return!![];const _0x29866f=_0x1b4a44['trim']();if(_0x29866f===_0x37242c(0x215)||_0x29866f==='/quit')return a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x1de)),![];if(_0x29866f===_0x37242c(0x27a))return _0x2db451['length']=0x1,_0xe9b1f4=a4_0x2538c8[_0x37242c(0x2a2)](),a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x2e3)),!![];if(_0x29866f==='/history'){const _0x29e3fa=getChatSessions();if(_0x29e3fa['length']===0x0)return a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x295)),!![];const _0x179a98=_0x29e3fa['map'](_0x3ef2ba=>{const _0x4b5fc7=_0x37242c,_0x8c6e67=new Date(_0x3ef2ba['updatedAt'])[_0x4b5fc7(0x213)]();return{'name':_0x8c6e67+_0x4b5fc7(0x28e)+_0x3ef2ba['title']+'\x20','value':_0x3ef2ba['id']};});_0x179a98['unshift']({'name':_0x37242c(0x2ec),'value':_0x37242c(0x288)});const _0x1c2fb2=await select({'message':'Select\x20a\x20previous\x20chat\x20to\x20resume:','choices':_0x179a98});if(_0x1c2fb2==='cancel')return!![];const _0x16be70=getChatSession(_0x1c2fb2);return _0x16be70?(_0xe9b1f4=_0x16be70['id'],_0x2db451[_0x37242c(0x30a)]=0x0,_0x2db451[_0x37242c(0x270)](..._0x16be70[_0x37242c(0x22f)]),a4_0x5a0cb9['success'](_0x37242c(0x28c)+_0x16be70['title']+'\x20')):a4_0x5a0cb9[_0x37242c(0x2e5)](_0x37242c(0x1d7)),!![];}if(_0x29866f===_0x37242c(0x1da)){const _0x5c549e=await getMcpTools();return _0x5c549e['length']===0x0?a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x2b2)):(a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x21a)),_0x5c549e['forEach'](_0x511d86=>a4_0x5a0cb9[_0x37242c(0x1ef)]('-\x20'+_0x511d86[_0x37242c(0x1ce)]+'\x20('+_0x511d86[_0x37242c(0x2e0)]+_0x37242c(0x2c8)+(_0x511d86[_0x37242c(0x2d5)]?.[_0x37242c(0x1e5)](0x0,0x32)||'')+'\x20'))),a4_0x5a0cb9['dim'](_0x37242c(0x2f2)),!![];}if(_0x29866f===_0x37242c(0x1ec))return a4_0x5a0cb9[_0x37242c(0x200)]('Commands'),a4_0x5a0cb9['dim'](_0x37242c(0x20a)),a4_0x5a0cb9['dim']('\x20\x20/clear\x20\x20\x20\x20\x20-\x20Clear\x20conversation\x20history'),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x1eb)),a4_0x5a0cb9[_0x37242c(0x1ef)]('\x20\x20/model\x20\x20\x20\x20\x20-\x20Switch\x20AI\x20model'),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x1e2)),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x2fa)),a4_0x5a0cb9['dim'](_0x37242c(0x1d6)),a4_0x5a0cb9[_0x37242c(0x1ef)]('\x20\x20/usage\x20\x20\x20\x20\x20-\x20Show\x20token\x20usage\x20stats'),a4_0x5a0cb9['dim'](_0x37242c(0x1fe)),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x26a)),a4_0x5a0cb9[_0x37242c(0x1ef)]('\x20\x20/github\x20\x20\x20\x20-\x20GitHub\x20integration'),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x318)),!![];if(_0x29866f===_0x37242c(0x208)){const {isBrowserServerRunning:_0x234a28,getConnectedSessions:_0x4c1288}=await import('../browser/index.js');if(_0x234a28()){const _0x24efac=_0x4c1288();a4_0x5a0cb9[_0x37242c(0x299)](_0x37242c(0x22a)),a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x2d6)+_0x24efac[_0x37242c(0x30a)]+'\x20'),_0x24efac['forEach'](_0x5c8b12=>a4_0x5a0cb9[_0x37242c(0x1ef)]('\x20\x20-\x20'+_0x5c8b12[_0x37242c(0x234)]+'\x20'));}else a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x29d)),a4_0x5a0cb9['dim'](_0x37242c(0x1df));return!![];}if(_0x29866f['startsWith'](_0x37242c(0x2af))){const _0x4a0605=_0x29866f['split']('\x20')[0x1]||'';return await a4_0x24b33e['handleGitHubCommand'](_0x4a0605),!![];}if(_0x29866f[_0x37242c(0x280)](_0x37242c(0x2a6))){const _0x24f438=await import(_0x37242c(0x2e9)),_0x23817f=_0x29866f[_0x37242c(0x24a)]('\x20')[0x1]||'';if(_0x23817f===_0x37242c(0x1d8)){const {input:_0x95d22,password:_0x3d607e}=await import('@inquirer/prompts');a4_0x5a0cb9[_0x37242c(0x200)](_0x37242c(0x20d)),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x2d9)),a4_0x5a0cb9[_0x37242c(0x1ef)]('2.\x20Send\x20/newbot\x20and\x20follow\x20instructions'),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x1cf)),a4_0x5a0cb9[_0x37242c(0x1f5)]('');const _0x43593f=await _0x3d607e({'message':_0x37242c(0x2f1),'mask':'*'});_0x43593f&&(_0x24f438[_0x37242c(0x23e)](_0x43593f),a4_0x5a0cb9[_0x37242c(0x299)](_0x37242c(0x1ee)));const _0x1ec6b2=await _0x95d22({'message':_0x37242c(0x269)});return _0x1ec6b2&&(_0x24f438[_0x37242c(0x218)](_0x1ec6b2),a4_0x5a0cb9['success'](_0x37242c(0x24c))),a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x293)),!![];}if(_0x23817f===_0x37242c(0x238))return await _0x24f438[_0x37242c(0x2e6)](),!![];if(_0x23817f===_0x37242c(0x2ba))return _0x24f438['stopBot'](),a4_0x5a0cb9['info'](_0x37242c(0x2d2)),!![];if(_0x23817f==='status')return _0x24f438['isBotRunning']()?a4_0x5a0cb9[_0x37242c(0x299)](_0x37242c(0x297)):a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x260)),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x21d)+(_0x24f438[_0x37242c(0x289)]()?_0x37242c(0x2b8):'No')+'\x20'),!![];return a4_0x5a0cb9[_0x37242c(0x200)](_0x37242c(0x2e1)),a4_0x5a0cb9['dim'](_0x37242c(0x2f7)),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x29c)),a4_0x5a0cb9[_0x37242c(0x1ef)](_0x37242c(0x1dc)),a4_0x5a0cb9['dim']('\x20\x20/telegram\x20status\x20\x20-\x20Check\x20status'),!![];}if(_0x29866f===_0x37242c(0x222)){const {rollbackLast:_0x5e4fd6,getChanges:_0x78f479}=await import(_0x37242c(0x244)),_0x445464=_0x78f479();if(_0x445464[_0x37242c(0x30a)]===0x0)a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x2b4));else{const _0x356fb5=_0x5e4fd6();_0x356fb5[_0x37242c(0x299)]?a4_0x5a0cb9[_0x37242c(0x299)](_0x356fb5[_0x37242c(0x2fb)]):a4_0x5a0cb9[_0x37242c(0x2e5)](_0x356fb5['message']);}return!![];}if(_0x29866f==='/model'){const _0x32a70c=await selectModel();return _0x32a70c!==_0x5a1d13?(a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x1ed)+_0x32a70c+'\x20'),a4_0x5a0cb9[_0x37242c(0x1f5)]('Please\x20restart\x20the\x20chat\x20for\x20the\x20change\x20to\x20take\x20full\x20effect.')):a4_0x5a0cb9['info'](_0x37242c(0x2fd)+_0x5a1d13+'\x20'),!![];}if(_0x29866f===_0x37242c(0x29b)||_0x29866f===_0x37242c(0x210)){const {selectTheme:_0x3270ba}=await import(_0x37242c(0x2bc)),_0x2ceb78=await _0x3270ba();return a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x22e)+_0x2ceb78+'\x20'),!![];}if(_0x29866f===_0x37242c(0x261)||_0x29866f===_0x37242c(0x20e)){const _0x3c82bf=a4_0x5a0cb9['createSpinner'](_0x37242c(0x2df));_0x3c82bf[_0x37242c(0x238)]();const _0x4bba32=await getUserUsage();return _0x3c82bf['stop'](),_0x4bba32?a4_0x5a0cb9['usageBox'](_0x4bba32[_0x37242c(0x2ac)],_0x4bba32[_0x37242c(0x301)],_0x4bba32[_0x37242c(0x274)]):a4_0x5a0cb9[_0x37242c(0x2e5)](_0x37242c(0x28d)),!![];}const _0x30f2c7=/(?:[a-zA-Z]:\\[^:<>"|?*]+?\.(?:png|jpg|jpeg|gif|webp))|(?:\/[^:<>"|?*]+?\.(?:png|jpg|jpeg|gif|webp))/gi,_0x102e91=[..._0x29866f[_0x37242c(0x2ff)](_0x30f2c7)]['map'](_0x31d6f4=>_0x31d6f4[0x0]);if(_0x102e91['length']>0x0){const _0x4c7411=[];let _0x1fdac4=_0x29866f;for(const _0x1dfd46 of _0x102e91){_0x1fdac4=_0x1fdac4[_0x37242c(0x2a3)](_0x1dfd46,'')[_0x37242c(0x287)]();try{if(a4_0x5a751c[_0x37242c(0x2e7)](_0x1dfd46)){const _0x368f44=_0x1dfd46[_0x37242c(0x24a)]('.')[_0x37242c(0x1ff)]()?.[_0x37242c(0x2bd)]()||_0x37242c(0x263);let _0x5c36c8=_0x37242c(0x22d)+_0x368f44+'\x20';if(_0x368f44===_0x37242c(0x30b))_0x5c36c8='image/jpeg';const _0x282c18=a4_0x5a751c[_0x37242c(0x267)](_0x1dfd46)[_0x37242c(0x2a5)](_0x37242c(0x307));_0x4c7411[_0x37242c(0x270)]({'type':'image_url','image_url':{'url':_0x37242c(0x1d2)+_0x5c36c8+';\x20base64,\x20'+_0x282c18+'\x20'}});}}catch(_0x46e610){a4_0x5a0cb9[_0x37242c(0x306)](_0x37242c(0x230)+_0x1dfd46+':\x20'+_0x46e610+'\x20');}}if(_0x1fdac4)_0x4c7411[_0x37242c(0x309)]({'type':_0x37242c(0x226),'text':_0x1fdac4});else _0x4c7411[_0x37242c(0x30a)]>0x0&&_0x4c7411[_0x37242c(0x309)]({'type':_0x37242c(0x226),'text':_0x37242c(0x22c)});_0x4c7411[_0x37242c(0x30a)]>0x0?(_0x2db451[_0x37242c(0x270)]({'role':_0x37242c(0x2a4),'content':_0x4c7411}),a4_0x5a0cb9['info']('Attached\x20'+(_0x4c7411[_0x37242c(0x30a)]-(_0x1fdac4?0x1:0x1))+_0x37242c(0x243))):_0x2db451[_0x37242c(0x270)]({'role':_0x37242c(0x2a4),'content':_0x29866f});}else _0x2db451[_0x37242c(0x270)]({'role':'user','content':_0x29866f});await processAgentLoop(_0x2db451,_0x5a1d13);const _0x2d8924=JSON['stringify'](_0x2db451)[_0x37242c(0x30a)]/0x4;if(_0x2d8924>0xc350&&_0x2db451[_0x37242c(0x30a)]>0xa){a4_0x5a0cb9[_0x37242c(0x1f5)](_0x37242c(0x259));const _0x473613=Object[_0x37242c(0x2db)]([],_0x2db451[_0x37242c(0x1e5)](0x1,_0x2db451[_0x37242c(0x30a)]-0x4));try{const _0x1786c3=[{'role':_0x37242c(0x1d9),'content':_0x37242c(0x257)},{'role':_0x37242c(0x2a4),'content':JSON[_0x37242c(0x1f8)](_0x473613)}],_0x1ad86c=await sendChatMessage(_0x5a1d13,_0x1786c3),_0x5a0fc3=_0x1ad86c[_0x37242c(0x2ea)];_0x2db451[_0x37242c(0x240)](0x1,_0x2db451[_0x37242c(0x30a)]-0x5,{'role':'assistant','content':_0x37242c(0x25c)+_0x5a0fc3+'\x20'}),_0xe9b1f4=a4_0x2538c8['randomUUID']();}catch(_0x469c1d){a4_0x5a0cb9['warn'](_0x37242c(0x27f));}}return saveChatSession(_0xe9b1f4,_0x2db451),!![];};if(_0x68872e){const _0x4c2981=await _0xfc3475(_0x68872e);if(!_0x4c2981)return;}while(!![]){try{const _0x10443c=await import(_0x1cebf5(0x227))[_0x1cebf5(0x1cd)](_0x428452=>_0x428452[_0x1cebf5(0x202)]()),_0x46bea0=await import(_0x1cebf5(0x2bc))[_0x1cebf5(0x1cd)](_0x207900=>_0x207900[_0x1cebf5(0x2c2)](_0x10443c)),_0x80c0dd=a4_0x5233f9[_0x1cebf5(0x27b)][_0x1cebf5(0x235)](_0x46bea0[_0x1cebf5(0x1f3)])(_0x1cebf5(0x294)),_0x1c80bf=await input({'message':_0x80c0dd,'theme':{'prefix':''}}),_0x11d86d=await _0xfc3475(_0x1c80bf);if(!_0x11d86d)break;}catch(_0x422395){if(_0x422395 instanceof Error&&_0x422395[_0x1cebf5(0x2fb)][_0x1cebf5(0x2da)](_0x1cebf5(0x207)))break;a4_0x5a0cb9[_0x1cebf5(0x2e5)](_0x1cebf5(0x292)+_0x422395+'\x20');}}}function cleanTagsFromLine(_0x4853d1){const _0x246e0a=a4_0x59ac23,_0x313d06=_0x4853d1[_0x246e0a(0x287)]();if(!_0x313d06)return'';if(_0x313d06[_0x246e0a(0x280)]('**'))return'';if(_0x313d06['startsWith'](_0x246e0a(0x2b5)))return'';if(_0x313d06[_0x246e0a(0x280)](_0x246e0a(0x220)))return'';if(_0x313d06[_0x246e0a(0x280)](_0x246e0a(0x1f6)))return'';if(_0x313d06[_0x246e0a(0x2da)](_0x246e0a(0x2d0))&&_0x313d06[_0x246e0a(0x2da)](_0x246e0a(0x1d0)))return'';if(_0x313d06[_0x246e0a(0x280)](_0x246e0a(0x249)))return'';if(_0x313d06['startsWith'](_0x246e0a(0x221)))return'';if(_0x313d06['startsWith'](_0x246e0a(0x253)))return'';if(_0x313d06[_0x246e0a(0x280)]('I\x20am'))return'';if(_0x313d06[_0x246e0a(0x280)]('Now,'))return'';if(_0x313d06[_0x246e0a(0x280)](_0x246e0a(0x1e6)))return'';if(_0x313d06[_0x246e0a(0x2da)]('must\x20greet'))return'';if(_0x313d06['includes']('registered\x20that'))return'';return _0x4853d1[_0x246e0a(0x2a3)](/<text>/g,'')[_0x246e0a(0x2a3)](/<\/text>/g,'')[_0x246e0a(0x2a3)](/<\/text>/g,'')['replace'](/<reasoning>/g,'')['replace'](/<\/reasoning>/g,'')['replace'](/\*\*(.+?)\*\*/g,'$1');}async function processAgentLoop(_0x5aa585,_0x20f31b){const _0x304661=a4_0x59ac23;let _0x17a44e=0x0;const _0xf405ca=0x3e8;while(_0x17a44e<_0xf405ca){_0x17a44e++;const _0x33f5b1=a4_0x5a0cb9[_0x304661(0x1f7)]('Thinking...');_0x33f5b1[_0x304661(0x238)]();let _0x5593a='',_0x2e407=![],_0x762e6c='';const _0x41269f=new AbortController(),_0x55370a=()=>{const _0x4a50eb=_0x304661;_0x41269f['abort'](),a4_0x5a0cb9[_0x4a50eb(0x1f5)](_0x4a50eb(0x2cc));};process['on']('SIGINT',_0x55370a);let _0x3b4563=null;try{const _0xea5daf=await sendChatMessage(_0x20f31b,_0x5aa585,_0x5f154c=>{const _0x4c1c30=_0x304661;_0x33f5b1[_0x4c1c30(0x1c9)]&&_0x33f5b1[_0x4c1c30(0x2ba)]();_0x5593a+=_0x5f154c;for(const _0x307355 of _0x5f154c){_0x762e6c+=_0x307355;if(_0x307355==='\x0a'){if(!_0x2e407){if(_0x762e6c[_0x4c1c30(0x2da)]('<execute_tool>')||_0x762e6c['startsWith'](_0x4c1c30(0x211))){_0x2e407=!![],_0x762e6c='';!_0x3b4563&&(_0x3b4563=a4_0x5a0cb9[_0x4c1c30(0x1e7)]('Generating...'),_0x3b4563[_0x4c1c30(0x238)]());continue;}let _0x403161=_0x762e6c[_0x4c1c30(0x2a3)](/<text>/g,'')[_0x4c1c30(0x2a3)](/<\/text>/g,'')[_0x4c1c30(0x2a3)](/<reasoning.*?>/g,'')['replace'](/<\/reasoning>/g,'');if(_0x403161[_0x4c1c30(0x280)](_0x4c1c30(0x1f6))&&!_0x403161[_0x4c1c30(0x280)](_0x4c1c30(0x211)))process[_0x4c1c30(0x2a9)][_0x4c1c30(0x1f1)](_0x4c1c30(0x1f6)+_0x403161[_0x4c1c30(0x1e5)](0x3));else(_0x403161[_0x4c1c30(0x287)]()||_0x403161==='\x0a'||_0x403161==='\x0d\x0a')&&process[_0x4c1c30(0x2a9)]['write'](_0x403161);}else(_0x762e6c[_0x4c1c30(0x2da)](_0x4c1c30(0x233))||_0x762e6c[_0x4c1c30(0x287)]()===_0x4c1c30(0x1f6))&&(_0x2e407=![],_0x3b4563&&(_0x3b4563['stop'](),_0x3b4563=null));_0x762e6c='';}}},_0x41269f[_0x304661(0x1f9)]);_0x3b4563&&(_0x3b4563[_0x304661(0x2ba)](),_0x3b4563=null);if(_0x762e6c&&!_0x2e407&&!_0x762e6c['includes']('<execute_tool>')){let _0x37b5bc=_0x762e6c[_0x304661(0x2a3)](/<text>/g,'')[_0x304661(0x2a3)](/<\/text>/g,'')['replace'](/<reasoning.*?>/g,'')[_0x304661(0x2a3)](/<\/reasoning>/g,'');if(_0x37b5bc[_0x304661(0x287)]())process[_0x304661(0x2a9)][_0x304661(0x1f1)](_0x37b5bc);}_0x5593a=_0xea5daf[_0x304661(0x2ea)];}catch(_0x46273b){_0x33f5b1[_0x304661(0x2ba)](),process[_0x304661(0x268)](_0x304661(0x1db),_0x55370a);if(_0x46273b[_0x304661(0x1ce)]===_0x304661(0x2e2)||_0x46273b[_0x304661(0x2fb)]['includes']('aborted')){a4_0x5a0cb9['warn'](_0x304661(0x25f)),_0x5aa585[_0x304661(0x270)]({'role':_0x304661(0x1fc),'content':_0x5593a+_0x304661(0x206)}),_0x5aa585[_0x304661(0x270)]({'role':_0x304661(0x2a4),'content':'Stop.'});break;}if(_0x46273b[_0x304661(0x2f3)]){a4_0x5a0cb9['rateLimitWarning'](_0x46273b[_0x304661(0x2e8)]||0x3c);return;}a4_0x5a0cb9['error'](_0x304661(0x2ca)+_0x46273b);return;}finally{process['removeListener']('SIGINT',_0x55370a);}_0x33f5b1[_0x304661(0x1c9)]&&_0x33f5b1[_0x304661(0x2ba)]();a4_0x5a0cb9['aiMessageEnd'](),_0x5aa585['push']({'role':'assistant','content':_0x5593a});let _0xbdac45=_0x5593a['match'](/<execute_tool>\s*([\s\S]*?)<\/execute_tool>/);!_0xbdac45&&(_0xbdac45=_0x5593a['match'](/```tool\s*([\s\S]*?)```/));!_0xbdac45&&(_0xbdac45=_0x5593a[_0x304661(0x232)](/```json\s*(\{[\s\S]*?"name"\s*:[\s\S]*?\})\s*```/));if(!_0xbdac45)break;function _0x1a2ae6(_0x50b118){const _0x552854=_0x304661,_0x57248c=_0x50b118[_0x552854(0x287)]();try{return JSON[_0x552854(0x296)](_0x57248c);}catch(_0x4fc488){try{let _0x488d50='',_0x345ed7=![];for(let _0x37f2ed=0x0;_0x37f2ed<_0x57248c[_0x552854(0x30a)];_0x37f2ed++){const _0x1e2f10=_0x57248c[_0x37f2ed];if(_0x1e2f10==='\x22'&&_0x57248c[_0x37f2ed-0x1]!=='\x5c')_0x345ed7=!_0x345ed7;if(_0x345ed7&&_0x1e2f10==='\x0a')_0x488d50+='\x5cn';else _0x488d50+=_0x1e2f10;}return JSON[_0x552854(0x296)](_0x488d50);}catch(_0x2a7879){try{return new Function(_0x552854(0x262)+_0x57248c)();}catch(_0x2d9b48){throw new Error(_0x552854(0x2d8)+_0x4fc488[_0x552854(0x2fb)]);}}}}try{const _0x8fb83f=_0x1a2ae6(_0xbdac45[0x1]),_0x33a08b={'write_file':_0x304661(0x20f),'write':_0x304661(0x20f),'create':'create_file','read':'read_file','read_text_file':_0x304661(0x254),'search':'search_file','list':'list_directory','ls':'list_directory','update':_0x304661(0x1f4),'append':_0x304661(0x2c0),'execute':'run_command','cmd':_0x304661(0x312),'remove_file':_0x304661(0x21b),'rm':_0x304661(0x21b),'unlink':_0x304661(0x21b),'move_file':'rename_file','mv':'rename_file','cp':_0x304661(0x2f8),'stat':_0x304661(0x1e8),'head':'read_file_lines','wget':_0x304661(0x27c),'curl':'fetch_url','http_get':_0x304661(0x2a0),'env':_0x304661(0x25b),'sysinfo':'get_system_info','paste':_0x304661(0x22b),'ask':_0x304661(0x248),'prompt_user':_0x304661(0x248),'request_input':_0x304661(0x248),'dir_tree':_0x304661(0x1e3),'show_tree':_0x304661(0x1e3),'grep':_0x304661(0x2cb),'find_in_files':_0x304661(0x2cb),'search_all':'grep_recursive','find_replace':_0x304661(0x256),'sed':'replace_in_files','open':_0x304661(0x298),'vscode':'open_in_editor','compress':_0x304661(0x203),'archive':_0x304661(0x203),'extract':'unzip_files','decompress':'unzip_files','ps':_0x304661(0x1d1),'pwsh':_0x304661(0x1d1)};_0x33a08b[_0x8fb83f['name']]&&(_0x8fb83f['name']=_0x33a08b[_0x8fb83f['name']]);_0x8fb83f[_0x304661(0x237)]&&(!_0x8fb83f[_0x304661(0x237)][_0x304661(0x23d)]&&(_0x8fb83f[_0x304661(0x237)]['path']=_0x8fb83f[_0x304661(0x237)][_0x304661(0x2c1)]||_0x8fb83f['args']['filepath']||_0x8fb83f[_0x304661(0x237)][_0x304661(0x29f)]||_0x8fb83f['args'][_0x304661(0x201)]),!_0x8fb83f[_0x304661(0x237)][_0x304661(0x2ea)]&&(_0x8fb83f[_0x304661(0x237)][_0x304661(0x2ea)]=_0x8fb83f['args'][_0x304661(0x226)]||_0x8fb83f[_0x304661(0x237)]['code']||_0x8fb83f['args']['data']||_0x8fb83f[_0x304661(0x237)][_0x304661(0x205)]),!_0x8fb83f[_0x304661(0x237)]['command']&&(_0x8fb83f[_0x304661(0x237)][_0x304661(0x2bb)]=_0x8fb83f[_0x304661(0x237)]['cmd']||_0x8fb83f[_0x304661(0x237)][_0x304661(0x271)]));const _0x3b0e1f={'create_file':'Create','read_file':_0x304661(0x308),'edit_file':'Edit','update_file':_0x304661(0x291),'append_file':_0x304661(0x25a),'list_directory':_0x304661(0x1f0),'search_file':_0x304661(0x2e4),'find_files':_0x304661(0x28f),'search_directory':_0x304661(0x279),'delete_file':'Delete','rename_file':_0x304661(0x275),'copy_file':_0x304661(0x30d),'file_info':_0x304661(0x2ee),'read_file_lines':'ReadLines','run_command':_0x304661(0x314),'run_background':_0x304661(0x23a),'read_terminal_output':'ReadTerm','send_terminal_input':_0x304661(0x264),'list_active_processes':_0x304661(0x1d3),'terminate_process':_0x304661(0x28a),'git_status':_0x304661(0x1d4),'git_diff':_0x304661(0x2b1),'git_log':'GitLog','git_add':_0x304661(0x2ed),'git_commit':'GitCommit','git_branch':_0x304661(0x1e0),'fetch_url':_0x304661(0x20c),'download_file':_0x304661(0x214),'get_env':_0x304661(0x2ef),'set_env':'SetEnv','get_system_info':'SysInfo','clipboard_read':_0x304661(0x305),'clipboard_write':_0x304661(0x26b),'ask_human':'Ask','tree':_0x304661(0x2d4),'grep_recursive':_0x304661(0x2d7),'replace_in_files':'Replace','open_in_editor':_0x304661(0x219),'zip_files':_0x304661(0x26d),'unzip_files':_0x304661(0x1d5),'write_json':'WriteJSON','read_json':_0x304661(0x24d),'patch_file':_0x304661(0x23c),'powershell_run':'PS','browser_open':'Browser','browser_click':_0x304661(0x281),'browser_fill':_0x304661(0x29e),'browser_snapshot':'Snapshot','browser_screenshot':_0x304661(0x242),'browser_get_text':_0x304661(0x2ab),'browser_close':'CloseBrowser'},_0x13eca9=_0x3b0e1f[_0x8fb83f[_0x304661(0x1ce)]]||_0x8fb83f[_0x304661(0x1ce)];let _0x4fe66e='';if(_0x8fb83f[_0x304661(0x1ce)]===_0x304661(0x312)&&_0x8fb83f[_0x304661(0x237)]['command'])_0x4fe66e=_0x8fb83f[_0x304661(0x237)]['command'];else{if(_0x8fb83f[_0x304661(0x1ce)]===_0x304661(0x2d3))_0x4fe66e=_0x304661(0x24e)+(_0x8fb83f[_0x304661(0x237)][_0x304661(0x1dd)]||_0x304661(0x286));else{if(_0x8fb83f[_0x304661(0x1ce)]==='read_terminal_output'||_0x8fb83f[_0x304661(0x1ce)]==='terminate_process')_0x4fe66e='PID:'+(_0x8fb83f['args'][_0x304661(0x1dd)]||'any');else{if(_0x8fb83f[_0x304661(0x1ce)]===_0x304661(0x2c5))_0x4fe66e=_0x304661(0x236);else{if(_0x8fb83f[_0x304661(0x237)][_0x304661(0x23d)])_0x4fe66e=_0x8fb83f[_0x304661(0x237)][_0x304661(0x23d)];else{if(_0x8fb83f[_0x304661(0x237)][_0x304661(0x2be)])_0x4fe66e='\x22'+_0x8fb83f[_0x304661(0x237)]['pattern']+'\x22';else _0x8fb83f['args']['url']?_0x4fe66e=_0x8fb83f[_0x304661(0x237)][_0x304661(0x304)]:_0x4fe66e=Object[_0x304661(0x2f6)](_0x8fb83f[_0x304661(0x237)])[0x0]||'';}}}}}const _0x1cdc1c=_0x4fe66e['length']>0x32?_0x4fe66e['slice'](0x0,0x2f)+'...':_0x4fe66e,_0x2567a7=a4_0x5a0cb9[_0x304661(0x1e7)](_0x13eca9+'('+_0x1cdc1c+')');_0x2567a7[_0x304661(0x238)]();const _0x27ea7b=performance[_0x304661(0x228)]();let _0x181356;try{_0x181356=await executeToolCall(_0x8fb83f[_0x304661(0x1ce)],_0x8fb83f[_0x304661(0x237)]);}catch(_0x57847c){if(_0x57847c[_0x304661(0x2fb)]&&_0x57847c[_0x304661(0x2fb)][_0x304661(0x2da)]('Unknown\x20tool')){const _0x7d0e2d=await getMcpTools(),_0x27e5a3=_0x7d0e2d[_0x304661(0x273)](_0x176b36=>_0x176b36[_0x304661(0x1ce)]===_0x8fb83f[_0x304661(0x1ce)]);if(_0x27e5a3)try{_0x181356=await executeMcpTool(_0x27e5a3['serverName'],_0x27e5a3[_0x304661(0x1ce)],_0x8fb83f[_0x304661(0x237)]);}catch(_0x150223){throw new Error(_0x304661(0x2c4)+_0x150223);}else throw _0x57847c;}else throw _0x57847c;}const _0x444402=((performance[_0x304661(0x228)]()-_0x27ea7b)/0x3e8)[_0x304661(0x283)](0x1);_0x2567a7[_0x304661(0x2ba)]();let _0x1d9a21=_0x304661(0x258)+_0x444402+'s',_0x2789f8=![];const _0x5d7b15=_0x181356;if(_0x5d7b15&&typeof _0x5d7b15==='object'){if(_0x8fb83f['name']===_0x304661(0x312)){if(_0x5d7b15[_0x304661(0x2f4)]===0x0&&_0x5d7b15[_0x304661(0x299)]!==![]){const _0x17c7f7=_0x5d7b15[_0x304661(0x2a9)]?_0x5d7b15[_0x304661(0x2a9)][_0x304661(0x24a)]('\x0a')[_0x304661(0x30a)]:0x0;_0x1d9a21=_0x304661(0x223)+_0x17c7f7+'\x20lines\x20of\x20output\x20('+_0x444402+'s)';}else{_0x2789f8=!![],_0x1d9a21='Exited\x20with\x20code\x20'+_0x5d7b15[_0x304661(0x2f4)];const _0x3fa9a4=_0x5d7b15['stderr']||_0x5d7b15['stdout']||_0x5d7b15[_0x304661(0x2fb)]||_0x304661(0x2cd);_0x3fa9a4&&(_0x1d9a21+=':\x20'+_0x3fa9a4[_0x304661(0x24a)]('\x0a')[0x0][_0x304661(0x1cb)](0x0,0x64));}}else{if(_0x5d7b15[_0x304661(0x299)]===![])_0x2789f8=!![],_0x1d9a21=_0x304661(0x2fe)+(_0x5d7b15[_0x304661(0x2fb)]||_0x5d7b15[_0x304661(0x2e5)]||_0x304661(0x2cd));else{if(_0x5d7b15[_0x304661(0x2e5)])_0x2789f8=!![],_0x1d9a21=_0x304661(0x2fe)+_0x5d7b15[_0x304661(0x2e5)];else{if(_0x8fb83f[_0x304661(0x1ce)]===_0x304661(0x254)&&typeof _0x5d7b15[_0x304661(0x2ea)]===_0x304661(0x26f)){const _0x17fe86=_0x5d7b15[_0x304661(0x2ea)]['split']('\x0a')[_0x304661(0x30a)];_0x1d9a21=_0x304661(0x2a1)+_0x17fe86+'\x20lines\x20('+_0x444402+'s)';}else(_0x8fb83f[_0x304661(0x1ce)]==='edit_file'||_0x8fb83f['name']===_0x304661(0x20f))&&(_0x1d9a21=_0x304661(0x2c9)+_0x444402+'s)');}}}}a4_0x5a0cb9['toolSuccess'](_0x13eca9,_0x1cdc1c,_0x1d9a21,_0x2789f8);let _0x33fe74=_0x181356;_0x8fb83f[_0x304661(0x1ce)]==='run_command'&&_0x5d7b15&&(_0x33fe74={'exitCode':_0x5d7b15[_0x304661(0x2f4)],'stdout':_0x5d7b15[_0x304661(0x2a9)],'stderr':_0x5d7b15['stderr'],'error':_0x5d7b15['error']}),_0x5aa585[_0x304661(0x270)]({'role':'user','content':'Tool\x20result\x20for\x20'+_0x8fb83f[_0x304661(0x1ce)]+':\x0a'+JSON[_0x304661(0x1f8)](_0x33fe74,null,0x2)}),await new Promise(_0x1a16f4=>setTimeout(_0x1a16f4,0x1f4));}catch(_0x4be06c){a4_0x5a0cb9[_0x304661(0x276)](_0x304661(0x23b),_0x304661(0x1fa),_0x4be06c[_0x304661(0x2fb)]||String(_0x4be06c),!![]),_0x5aa585[_0x304661(0x270)]({'role':'user','content':_0x304661(0x284)+_0x4be06c+_0x304661(0x303)});}}_0x17a44e>=_0xf405ca&&a4_0x5a0cb9[_0x304661(0x306)]('Reached\x20maximum\x20iterations');}async function executeToolCall(_0x46e838,_0x487ee0){const _0x3b69e7=a4_0x59ac23;switch(_0x46e838){case'create_file':return createFile(_0x487ee0['path'],_0x487ee0['content']);case _0x3b69e7(0x254):return readFile(_0x487ee0[_0x3b69e7(0x23d)]);case _0x3b69e7(0x2b0):return listDirectory(_0x487ee0[_0x3b69e7(0x23d)]||'.');case'edit_file':return editFile(_0x487ee0[_0x3b69e7(0x23d)],_0x487ee0[_0x3b69e7(0x1ca)],_0x487ee0['replace']);case'search_file':return searchFile(_0x487ee0['path'],_0x487ee0[_0x3b69e7(0x2be)]);case _0x3b69e7(0x312):const {command:_0x123082,background:_0x1e2204,wait:_0x4e5fe0}=_0x487ee0,_0xc3e1f6=await runCommand(_0x123082,undefined,_0x1e2204,_0x4e5fe0);return _0xc3e1f6;case _0x3b69e7(0x1f2):{const {readTerminalOutput:_0x5b43a9}=await import('../tools/command.js');return _0x5b43a9(_0x487ee0[_0x3b69e7(0x1dd)]);}case'send_terminal_input':{const {sendTerminalInput:_0x19863d}=await import(_0x3b69e7(0x204));return _0x19863d(_0x487ee0['input'],_0x487ee0[_0x3b69e7(0x1dd)]);}case'list_active_processes':{const {getActiveProcesses:_0x22ee78}=await import('../tools/command.js');return{'pids':_0x22ee78(),'message':_0x3b69e7(0x239)+_0x22ee78()[_0x3b69e7(0x30a)]};}case _0x3b69e7(0x21e):{const {terminateProcess:_0x4f482a}=await import(_0x3b69e7(0x204));return _0x4f482a(_0x487ee0[_0x3b69e7(0x1dd)]);}case'find_files':{const {findFiles:_0x3748e3}=await import('../tools/file.js');return _0x3748e3(_0x487ee0[_0x3b69e7(0x23d)]||'.',_0x487ee0['pattern']);}case'search_directory':{const {searchDirectory:_0x16fcb7}=await import('../tools/file.js');return _0x16fcb7(_0x487ee0[_0x3b69e7(0x23d)]||'.',_0x487ee0['pattern']);}case _0x3b69e7(0x241):{const {readFile:_0x3b4859}=await import(_0x3b69e7(0x26c));return _0x3b4859(_0x487ee0['owner'],_0x487ee0[_0x3b69e7(0x2a8)],_0x487ee0[_0x3b69e7(0x23d)],_0x487ee0[_0x3b69e7(0x315)]);}case _0x3b69e7(0x2cf):{const {createPullRequest:_0x1f32fe}=await import(_0x3b69e7(0x26c));return _0x1f32fe(_0x487ee0[_0x3b69e7(0x2aa)],_0x487ee0[_0x3b69e7(0x2a8)],_0x487ee0[_0x3b69e7(0x2bf)],_0x487ee0[_0x3b69e7(0x282)],_0x487ee0[_0x3b69e7(0x2d1)],_0x487ee0[_0x3b69e7(0x1fd)]);}case _0x3b69e7(0x1fb):{const {createBranch:_0x4f8879}=await import('../github/api.js');return _0x4f8879(_0x487ee0[_0x3b69e7(0x2aa)],_0x487ee0['repo'],_0x487ee0[_0x3b69e7(0x1ea)],_0x487ee0[_0x3b69e7(0x21f)]);}case'browser_open':{const {browserOpen:_0x550c22,startBrowserServer:_0x58d361,isBrowserServerRunning:_0x1ff5e0}=await import(_0x3b69e7(0x247));return!_0x1ff5e0()&&await _0x58d361(),_0x550c22(_0x487ee0[_0x3b69e7(0x304)]);}case _0x3b69e7(0x217):{const {browserClick:_0x524501}=await import(_0x3b69e7(0x247));return _0x524501(_0x487ee0[_0x3b69e7(0x2a7)]);}case _0x3b69e7(0x212):{const {browserFill:_0x30f791}=await import(_0x3b69e7(0x247));return _0x30f791(_0x487ee0[_0x3b69e7(0x2a7)],_0x487ee0['value']);}case _0x3b69e7(0x21c):{const {browserSnapshot:_0x316c05}=await import(_0x3b69e7(0x247));return _0x316c05();}case _0x3b69e7(0x2b7):{const {browserScreenshot:_0x5077f3}=await import(_0x3b69e7(0x247));return _0x5077f3();}case _0x3b69e7(0x30f):{const {browserGetText:_0x8eaee3}=await import(_0x3b69e7(0x247));return _0x8eaee3(_0x487ee0['selector']);}case _0x3b69e7(0x246):{const {browserClose:_0x375c78}=await import(_0x3b69e7(0x247));return _0x375c78();}case _0x3b69e7(0x21b):return deleteFile(_0x487ee0[_0x3b69e7(0x23d)]);case _0x3b69e7(0x255):return renameFile(_0x487ee0[_0x3b69e7(0x24b)]||_0x487ee0['path'],_0x487ee0['to']||_0x487ee0['destination']);case _0x3b69e7(0x2f8):return copyFile(_0x487ee0['from']||_0x487ee0['path'],_0x487ee0['to']||_0x487ee0['destination']);case _0x3b69e7(0x1e8):return fileInfo(_0x487ee0[_0x3b69e7(0x23d)]);case _0x3b69e7(0x272):return readFileLines(_0x487ee0[_0x3b69e7(0x23d)],_0x487ee0[_0x3b69e7(0x238)]||0x1,_0x487ee0['end']||0x32);case _0x3b69e7(0x231):{const _0x48ad66=await runCommand(_0x487ee0[_0x3b69e7(0x2bb)],undefined,!![],_0x487ee0[_0x3b69e7(0x24f)]||0x1388);return _0x48ad66;}case _0x3b69e7(0x245):return gitStatus();case _0x3b69e7(0x2de):return gitDiff(_0x487ee0['path']);case _0x3b69e7(0x27e):return gitLog(_0x487ee0[_0x3b69e7(0x2b9)]||0xa);case _0x3b69e7(0x30c):return gitAdd(_0x487ee0[_0x3b69e7(0x23d)]||'.');case _0x3b69e7(0x2b3):return gitCommit(_0x487ee0[_0x3b69e7(0x2fb)]);case _0x3b69e7(0x2dc):return gitBranch();case'fetch_url':return fetchUrl(_0x487ee0[_0x3b69e7(0x304)]);case _0x3b69e7(0x27c):return downloadFile(_0x487ee0['url'],_0x487ee0['path']);case _0x3b69e7(0x25b):return getEnv(_0x487ee0[_0x3b69e7(0x1ce)]);case _0x3b69e7(0x2c3):return setEnv(_0x487ee0[_0x3b69e7(0x1ce)],_0x487ee0[_0x3b69e7(0x300)]);case _0x3b69e7(0x251):return getSystemInfo();case'clipboard_read':return clipboardRead();case'clipboard_write':return clipboardWrite(_0x487ee0[_0x3b69e7(0x226)]||_0x487ee0[_0x3b69e7(0x2ea)]);case _0x3b69e7(0x248):{const _0x29f9f5=_0x487ee0['question']||_0x487ee0[_0x3b69e7(0x2fb)]||_0x3b69e7(0x25d);a4_0x5a0cb9['aiMessageEnd']();const _0x5b5250=await input({'message':a4_0x5233f9[_0x3b69e7(0x235)]('#3b82f6')(_0x3b69e7(0x216))+_0x29f9f5+'\x0a','theme':{'prefix':''}});return{'success':!![],'response':_0x5b5250,'message':_0x3b69e7(0x25e)+_0x5b5250};}case'tree':return tree(_0x487ee0[_0x3b69e7(0x23d)]||'.',_0x487ee0[_0x3b69e7(0x313)]||0x3);case _0x3b69e7(0x2cb):return grepRecursive(_0x487ee0[_0x3b69e7(0x23d)]||'.',_0x487ee0[_0x3b69e7(0x2be)],_0x487ee0[_0x3b69e7(0x2fc)]);case _0x3b69e7(0x256):return replaceInFiles(_0x487ee0[_0x3b69e7(0x23d)]||'.',_0x487ee0[_0x3b69e7(0x1ca)],_0x487ee0[_0x3b69e7(0x2a3)],_0x487ee0['extensions']);case'open_in_editor':return openInEditor(_0x487ee0['path']);case'zip_files':return zipFiles(_0x487ee0[_0x3b69e7(0x250)]||[_0x487ee0[_0x3b69e7(0x23d)]],_0x487ee0['output']||_0x3b69e7(0x30e));case'unzip_files':return unzipFiles(_0x487ee0['path']||_0x487ee0[_0x3b69e7(0x29a)],_0x487ee0[_0x3b69e7(0x2ce)]||'.');case'write_json':return writeJson(_0x487ee0['path'],_0x487ee0[_0x3b69e7(0x2eb)]||_0x487ee0[_0x3b69e7(0x2ea)]);case'read_json':return readJson(_0x487ee0['path']);case _0x3b69e7(0x209):return patchFile(_0x487ee0[_0x3b69e7(0x23d)],_0x487ee0[_0x3b69e7(0x23f)]);case _0x3b69e7(0x1d1):return powershellRun(_0x487ee0['script']||_0x487ee0[_0x3b69e7(0x2bb)]);default:return{'error':_0x3b69e7(0x2ad)+_0x46e838};}}
@@ -1,21 +0,0 @@
1
- export type McpServerType = "stdio" | "streamable-http";
2
- interface McpServerConfigStdio {
3
- type?: "stdio";
4
- command: string;
5
- args: string[];
6
- env?: Record<string, string>;
7
- }
8
- interface McpServerConfigHttp {
9
- type: "streamable-http";
10
- url: string;
11
- }
12
- export type McpServerConfig = McpServerConfigStdio | McpServerConfigHttp;
13
- export declare function getMcpServers(): Record<string, McpServerConfig>;
14
- export declare function addMcpServer(name: string, command: string, args?: string[], env?: Record<string, string>): void;
15
- export declare function addMcpHttpServer(name: string, url: string): void;
16
- export declare function removeMcpServer(name: string): boolean;
17
- export declare function clearMcpServers(): void;
18
- export declare function getMcpServer(name: string): McpServerConfig | undefined;
19
- export declare function ensureDefaultServers(): void;
20
- export declare function getConfigFilePath(): string;
21
- export {};
@@ -1 +0,0 @@
1
- function a5_0x570c(_0xb82668,_0x3e7a30){_0xb82668=_0xb82668-0x8e;const _0x45f7c6=a5_0x45f7();let _0x570cb2=_0x45f7c6[_0xb82668];return _0x570cb2;}(function(_0x14c531,_0x512987){const _0xbf3a20=a5_0x570c,_0x3511eb=_0x14c531();while(!![]){try{const _0xc3f845=parseInt(_0xbf3a20(0x90))/0x1+-parseInt(_0xbf3a20(0x8f))/0x2*(-parseInt(_0xbf3a20(0x9e))/0x3)+-parseInt(_0xbf3a20(0x97))/0x4*(parseInt(_0xbf3a20(0xa6))/0x5)+parseInt(_0xbf3a20(0xaf))/0x6*(parseInt(_0xbf3a20(0xb5))/0x7)+-parseInt(_0xbf3a20(0x99))/0x8+parseInt(_0xbf3a20(0xac))/0x9*(parseInt(_0xbf3a20(0x96))/0xa)+-parseInt(_0xbf3a20(0xb2))/0xb*(parseInt(_0xbf3a20(0xa8))/0xc);if(_0xc3f845===_0x512987)break;else _0x3511eb['push'](_0x3511eb['shift']());}catch(_0x4ffe1a){_0x3511eb['push'](_0x3511eb['shift']());}}}(a5_0x45f7,0x5710d));import a5_0x1d90f2 from'conf';import a5_0x436f4c from'path';import a5_0x51318c from'fs';import{fileURLToPath}from'url';function a5_0x45f7(){const _0x564478=['utf-8','dirname','2599630IzfQgY','129308wDfdcN','USERPROFILE','2532024NEovXP','set','computer-use.js','.js','get','68316JmAeFr','env','tsx','stdio','includes','windows-mcp','C:\x5cUsers','object','65QLJiYc','dist','24deJGAB','join','node','mcpServers','9fsapid','mcp.json','mcp-servers','1916802XHEZcN','.woozlit','endsWith','2668402MsJwcm','HOME','command','14wskrhR','cwd','26gEfStz','383606mCuZaz','path','@modelcontextprotocol/server-filesystem','computer-use'];a5_0x45f7=function(){return _0x564478;};return a5_0x45f7();}const config=new a5_0x1d90f2({'projectName':'woozlit-cli','defaults':{'mcpServers':{}}});export function getMcpServers(){const _0x560f41=a5_0x570c,_0x2c2fe0=config[_0x560f41(0x9d)](_0x560f41(0xab)),_0x266b32=loadMcpConfigFile();return{..._0x2c2fe0,..._0x266b32};}export function addMcpServer(_0x562bdc,_0x4d13df,_0xde87a=[],_0x408e65){const _0x9a6768=a5_0x570c,_0x11d8cb=config['get'](_0x9a6768(0xab));_0x11d8cb[_0x562bdc]={'type':_0x9a6768(0xa1),'command':_0x4d13df,'args':_0xde87a,'env':_0x408e65},config['set'](_0x9a6768(0xab),_0x11d8cb);}export function addMcpHttpServer(_0x264930,_0x5a4154){const _0x30be30=a5_0x570c,_0x3b6efe=config[_0x30be30(0x9d)]('mcpServers');_0x3b6efe[_0x264930]={'type':'streamable-http','url':_0x5a4154},config[_0x30be30(0x9a)](_0x30be30(0xab),_0x3b6efe);}export function removeMcpServer(_0x103887){const _0x192a4c=a5_0x570c,_0x25466b=config[_0x192a4c(0x9d)](_0x192a4c(0xab));if(_0x25466b[_0x103887])return delete _0x25466b[_0x103887],config['set'](_0x192a4c(0xab),_0x25466b),!![];return![];}export function clearMcpServers(){const _0x2b6cbb=a5_0x570c;config[_0x2b6cbb(0x9a)](_0x2b6cbb(0xab),{});}export function getMcpServer(_0x5959d7){return getMcpServers()[_0x5959d7];}function loadMcpConfigFile(){const _0x314a3d=a5_0x570c,_0x222140=[a5_0x436f4c['join'](process[_0x314a3d(0x8e)](),_0x314a3d(0xad)),a5_0x436f4c[_0x314a3d(0xa9)](process[_0x314a3d(0x8e)](),_0x314a3d(0xb0),_0x314a3d(0xad)),a5_0x436f4c[_0x314a3d(0xa9)](process[_0x314a3d(0x9f)][_0x314a3d(0xb3)]||process[_0x314a3d(0x9f)][_0x314a3d(0x98)]||'',_0x314a3d(0xb0),'mcp.json')];for(const _0x2b117f of _0x222140){try{if(a5_0x51318c['existsSync'](_0x2b117f)){const _0x5b1439=a5_0x51318c['readFileSync'](_0x2b117f,_0x314a3d(0x94)),_0x5eff47=JSON['parse'](_0x5b1439);if(_0x5eff47[_0x314a3d(0xab)]&&typeof _0x5eff47[_0x314a3d(0xab)]===_0x314a3d(0xa5))return _0x5eff47['mcpServers'];}}catch{}}return{};}export function ensureDefaultServers(){const _0x332334=a5_0x570c,_0x2fb183=config[_0x332334(0x9d)]('mcpServers'),_0x4d63cf=fileURLToPath(import.meta.url),_0x1251fb=a5_0x436f4c[_0x332334(0x95)](_0x4d63cf),_0x210bf5=_0x1251fb[_0x332334(0xa2)](_0x332334(0xa7))||_0x4d63cf[_0x332334(0xb1)](_0x332334(0x9c)),_0x55fe43=_0x210bf5?a5_0x436f4c['join'](_0x1251fb,'..',_0x332334(0xae),_0x332334(0x9b)):a5_0x436f4c[_0x332334(0xa9)](_0x1251fb,'..','..','src','mcp-servers','computer-use.ts'),_0x2cb99d=_0x210bf5?_0x332334(0xaa):_0x332334(0xa0);_0x2fb183[_0x332334(0x93)]={'type':_0x332334(0xa1),'command':_0x2cb99d,'args':[_0x55fe43],'env':{}},(!_0x2fb183['windows-mcp']||_0x2fb183[_0x332334(0xa3)][_0x332334(0xb4)]==='uvx')&&(_0x2fb183[_0x332334(0xa3)]={'type':'stdio','command':'npx','args':['-y',_0x332334(0x92),_0x332334(0xa4)],'env':{}}),config[_0x332334(0x9a)]('mcpServers',_0x2fb183);}export function getConfigFilePath(){const _0x4b7be2=a5_0x570c;return config[_0x4b7be2(0x91)];}
@@ -1,10 +0,0 @@
1
- export declare function getApiUrl(): string;
2
- export declare function getProdUrl(): string;
3
- export declare function isProduction(): boolean;
4
- export declare const MODELS: {
5
- id: string;
6
- name: string;
7
- description: string;
8
- xp: number;
9
- }[];
10
- export declare const DEFAULT_MODEL = "gemini-2.5-flash";
@@ -1 +0,0 @@
1
- const a6_0x470b01=a6_0x4a3d;function a6_0x4a3d(_0x24b758,_0xc4cf09){_0x24b758=_0x24b758-0x187;const _0x5c324b=a6_0x5c32();let _0x4a3dc1=_0x5c324b[_0x24b758];return _0x4a3dc1;}(function(_0x1651b5,_0x4ae72b){const _0x55116d=a6_0x4a3d,_0x53b2ee=_0x1651b5();while(!![]){try{const _0x2c4479=-parseInt(_0x55116d(0x1a2))/0x1*(-parseInt(_0x55116d(0x18c))/0x2)+parseInt(_0x55116d(0x189))/0x3+-parseInt(_0x55116d(0x18a))/0x4*(-parseInt(_0x55116d(0x1a0))/0x5)+-parseInt(_0x55116d(0x1af))/0x6*(-parseInt(_0x55116d(0x1b4))/0x7)+parseInt(_0x55116d(0x1a9))/0x8*(-parseInt(_0x55116d(0x199))/0x9)+parseInt(_0x55116d(0x18e))/0xa+-parseInt(_0x55116d(0x192))/0xb*(parseInt(_0x55116d(0x1b0))/0xc);if(_0x2c4479===_0x4ae72b)break;else _0x53b2ee['push'](_0x53b2ee['shift']());}catch(_0x26e6cc){_0x53b2ee['push'](_0x53b2ee['shift']());}}}(a6_0x5c32,0xda282));const API_URL=process[a6_0x470b01(0x1a4)][a6_0x470b01(0x1a6)]||a6_0x470b01(0x1aa),PROD_URL='https://woozlit.com';function a6_0x5c32(){const _0xb886ec=['gemini-2.5-flash','Latest\x20Gemini\x20with\x20deep\x20thinking','Kimi\x20K2','150eVURsF','NVIDIA\x20vision','68RQYPLE','Qwen3\x20Coder','env','gemini-3-flash-preview','WOOZLIT_API_URL','Developer-focused','Qwen3\x20235B','48KcBOJj','https://woozlit.com','Fast\x20and\x20capable\x20(Default)','DeepSeek\x20V3','Meta\x27s\x20latest','mistralai/mistral-small-3.2-24b-instruct','2748666QOMkQP','1368vvptvn','Meta\x27s\x20powerful\x20model','qwen/qwen3-coder:free','Woozie','7GyTcdK','deepseek/deepseek-r1','deepseek/deepseek-chat','nvidia/nemotron-nano-12b-v2-vl:free','Advanced\x20reasoning','MiMo\x20V2','mistralai/devstral-small','Latest\x20Gemini\x203\x20model','68049YavGoB','95892zDaUbx','Most\x20powerful\x20Gemini','49612deSlSX','qwen/qwen3-235b-a22b:free','13146560DnWdNC','Llama\x204\x20Maverick','Devstral\x20Small','DeepSeek\x20R1','286924hJfCmT','xiaomi/mimo-v2-flash:free','Alibaba\x27s\x20largest','Xiaomi\x27s\x20fast\x20AI\x20model','moonshotai/kimi-k2','DeepSeek\x27s\x20latest\x20V3','Coding\x20specialist','501453OfCCDU','Llama\x203.3\x2070B','Gemini\x203\x20Flash','gemini-3.1-pro-preview'];a6_0x5c32=function(){return _0xb886ec;};return a6_0x5c32();}export function getApiUrl(){return API_URL;}export function getProdUrl(){return PROD_URL;}export function isProduction(){return API_URL===PROD_URL;}export const MODELS=[{'id':'gemini-2.5-flash','name':a6_0x470b01(0x1b3),'description':a6_0x470b01(0x1ab),'xp':0x1},{'id':a6_0x470b01(0x1a5),'name':a6_0x470b01(0x19b),'description':a6_0x470b01(0x188),'xp':0x5},{'id':'gemini-3-pro-preview','name':'Gemini\x203\x20Pro','description':a6_0x470b01(0x18b),'xp':0x5},{'id':a6_0x470b01(0x19c),'name':'Gemini\x203.1\x20Pro','description':a6_0x470b01(0x19e),'xp':0x8},{'id':a6_0x470b01(0x193),'name':a6_0x470b01(0x1b9),'description':a6_0x470b01(0x195),'xp':0x1},{'id':a6_0x470b01(0x18d),'name':a6_0x470b01(0x1a8),'description':a6_0x470b01(0x194),'xp':0x2},{'id':a6_0x470b01(0x1b2),'name':a6_0x470b01(0x1a3),'description':a6_0x470b01(0x198),'xp':0x2},{'id':'meta-llama/llama-3.3-70b-instruct:free','name':a6_0x470b01(0x19a),'description':a6_0x470b01(0x1b1),'xp':0x2},{'id':'meta-llama/llama-4-maverick','name':a6_0x470b01(0x18f),'description':a6_0x470b01(0x1ad),'xp':0x3},{'id':a6_0x470b01(0x187),'name':a6_0x470b01(0x190),'description':a6_0x470b01(0x1a7),'xp':0x2},{'id':a6_0x470b01(0x1ae),'name':'Mistral\x20Small\x203.2','description':'Latest\x20Mistral','xp':0x2},{'id':a6_0x470b01(0x1b7),'name':'Nemotron\x20Nano\x2012B','description':a6_0x470b01(0x1a1),'xp':0x1},{'id':a6_0x470b01(0x196),'name':a6_0x470b01(0x19f),'description':'Reasoning\x20model','xp':0x3},{'id':a6_0x470b01(0x1b6),'name':a6_0x470b01(0x1ac),'description':a6_0x470b01(0x197),'xp':0x2},{'id':a6_0x470b01(0x1b5),'name':a6_0x470b01(0x191),'description':a6_0x470b01(0x1b8),'xp':0x3}];export const DEFAULT_MODEL=a6_0x470b01(0x19d);
@@ -1,3 +0,0 @@
1
- export declare function startBot(): Promise<boolean>;
2
- export declare function stopBot(): void;
3
- export declare function isBotRunning(): boolean;
@@ -1 +0,0 @@
1
- const a7_0x11290b=a7_0x3ed2;(function(_0x1173fa,_0x3d078e){const _0x2442ea=a7_0x3ed2,_0x162e5d=_0x1173fa();while(!![]){try{const _0x3958a4=-parseInt(_0x2442ea(0x10c))/0x1+-parseInt(_0x2442ea(0xad))/0x2+-parseInt(_0x2442ea(0xd8))/0x3*(parseInt(_0x2442ea(0x102))/0x4)+parseInt(_0x2442ea(0xd3))/0x5+-parseInt(_0x2442ea(0x10e))/0x6+parseInt(_0x2442ea(0xde))/0x7*(parseInt(_0x2442ea(0xd1))/0x8)+parseInt(_0x2442ea(0x67))/0x9;if(_0x3958a4===_0x3d078e)break;else _0x162e5d['push'](_0x162e5d['shift']());}catch(_0x1e66ae){_0x162e5d['push'](_0x162e5d['shift']());}}}(a7_0x560a,0xc2ad5));import{Client,GatewayIntentBits,ChannelType,Partials,AttachmentBuilder}from'discord.js';import{join,resolve,basename}from'path';import*as a7_0x3ae594 from'./config.js';function a7_0x560a(){const _0x586168=['rename_file','open_in_editor','/clear','browser_snapshot','browser_screenshot','/run\x20','GuildMessages','Channel','once','path','read_json','channelId','\x0a```','bot','background','send','join','author','copy_file','[D]','search_directory','pid','get','terminate','fromBranch','branchName','info','attachments','\x0aTree:\x0a','fetch_url','get_env','search','guildId','success','tree','8uUqebm','browser_fill','You\x20are\x20Woozlit\x20AI,\x20an\x20autonomous\x20agent\x20connected\x20via\x20Discord.\x20Complete\x20tasks\x20immediately.\x0a\x0aRULES:\x0a1.\x20Execute\x20tools\x20FIRST,\x20explain\x20NEVER.\x20Be\x20concise.\x0a2.\x20No\x20emojis.\x20Maximum\x201-2\x20sentences\x20for\x20final\x20responses.\x0a3.\x20Use\x20tool\x20blocks\x20to\x20execute\x20actions.\x0a\x0aTOOLS:\x0a-\x20run_command:\x20{command,\x20wait,\x20background}\x0a-\x20read_terminal:\x20{}\x0a-\x20send_input:\x20{input}\x0a-\x20terminate:\x20{}\x0a-\x20create_file:\x20{path,\x20content}\x0a-\x20read_file:\x20{path}\x0a-\x20list_directory:\x20{path}\x0a-\x20edit_file:\x20{path,\x20search,\x20replace}\x0a-\x20delete_file:\x20{path}\x0a-\x20rename_file:\x20{from,\x20to}\x0a-\x20copy_file:\x20{from,\x20to}\x0a-\x20file_info:\x20{path}\x0a-\x20read_file_lines:\x20{path,\x20start,\x20end}\x0a-\x20find_files:\x20{path,\x20pattern}\x0a-\x20search_directory:\x20{path,\x20pattern}\x0a-\x20send_file:\x20{path}\x20-\x20send\x20file\x20to\x20Discord\x0a-\x20git_status,\x20git_diff,\x20git_log,\x20git_add,\x20git_commit,\x20git_branch\x0a-\x20fetch_url:\x20{url}\x0a-\x20download_file:\x20{url,\x20path}\x0a-\x20get_env:\x20{name},\x20set_env:\x20{name,\x20value}\x0a-\x20get_system_info:\x20{}\x0a-\x20clipboard_read,\x20clipboard_write:\x20{text}\x0a-\x20tree:\x20{path,\x20depth}\x0a-\x20grep_recursive:\x20{path,\x20pattern}\x0a-\x20replace_in_files:\x20{path,\x20search,\x20replace}\x0a-\x20powershell_run:\x20{script}\x0a-\x20zip_files:\x20{files,\x20output},\x20unzip_files:\x20{path,\x20output}\x0a-\x20write_json:\x20{path,\x20data},\x20read_json:\x20{path}\x0a-\x20patch_file:\x20{path,\x20patches}\x0a-\x20open_in_editor:\x20{path}\x0a-\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_screenshot,\x20browser_snapshot,\x20browser_close\x0a\x0aTOOL\x20FORMAT:\x0a```tool\x0a{\x22name\x22:\x22tool_name\x22,\x22args\x22:{\x22key\x22:\x22value\x22}}\x0a```','reply','search_file','message','username','...','../github/api.js','powershell_run','1021539JAZFef','!status','1288524LSjcbp',':\x0a\x0a','chdir','branch','files','parse','MessageContent','read_file','has','arrayBuffer','16685442udVxzl','git_status','trim','stderr','assistant','Saved:\x20','!newchat','grep_recursive','!files','.\x20Try\x20again\x20or\x20skip.','end','url','/newchat','Cleared.','git_commit','tag','Exit:\x20','browser_close','length','set_env','Failed:\x20','args','file_info','login','entries','browser_open','../browser/index.js','write_json','value','substring','\x0a```\x0a','title','delete','Clean','patches','slice','git_log','list_directory','zip_files','extensions','replace','unzip_files','git_branch','match','patch_file','name','owner','type','Tool\x20error:\x20','DirectMessages','!files\x20','wait','\x0aProject:\x20','content','Unknown\x20tool:\x20','send_input','now','[Discord]\x20Tool:\x20','send_file','cwd','depth','\x20bytes)\x20saved\x20to\x20','push','startsWith','github_create_branch','New\x20chat\x20session\x20started.','repo','data','script','selector','3028734YVltVt','pids','File\x20will\x20be\x20attached\x20separately','start','[F]','input','sendTyping','system','catch','from','channel','read_file_lines','pattern','error','user','!run\x20','stringify','head','/files','[Discord]\x20','find_files','directory','!cd\x20','split','base','output','\x0aModel:\x20','[Discord]\x20Connected\x20as\x20','run_command','/status','Failed\x20to\x20send\x20file:\x20','command','size','/cd\x20','map','package.json','72stSnSg','version','5442945MecSwA','mentions','exitCode','create_file','!project','103206jmKVLb','/project','stdout','git_add','Tool\x20result\x20for\x20','No\x20output','524482xVpdDI'];a7_0x560a=function(){return _0x586168;};return a7_0x560a();}import*as a7_0x59554f from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,readTerminalOutput,sendTerminalInput,terminateProcess,deleteFile,renameFile,copyFile,fileInfo,readFileLines,findFiles,searchDirectory}from'../tools/index.js';import{gitStatus,gitDiff,gitLog,gitAdd,gitCommit,gitBranch}from'../tools/git.js';import{fetchUrl,downloadFile as a7_0x510ba5}from'../tools/network.js';import{getEnv,setEnv,getSystemInfo,clipboardRead,clipboardWrite}from'../tools/system.js';import{tree,grepRecursive,replaceInFiles,openInEditor,zipFiles,unzipFiles,writeJson,readJson,patchFile,powershellRun}from'../tools/project.js';import{registerDiscordClient}from'../services/notifications.js';let client=null,isRunning=![];const chatHistories=new Map(),SYSTEM_PROMPT=a7_0x11290b(0x104);function a7_0x3ed2(_0x449c2f,_0x3f0391){_0x449c2f=_0x449c2f-0x66;const _0x560aaf=a7_0x560a();let _0x3ed25d=_0x560aaf[_0x449c2f];return _0x3ed25d;}async function executeToolCall(_0x136817,_0x1a01c8,_0x394669){const _0x444412=a7_0x11290b;switch(_0x136817){case _0x444412(0xc9):{const _0x19c918=await runCommand(_0x1a01c8[_0x444412(0xcc)],undefined,_0x1a01c8[_0x444412(0xed)]||![],_0x1a01c8[_0x444412(0x9a)]||0x7530);return _0x19c918;}case'read_terminal':return readTerminalOutput(_0x1a01c8[_0x444412(0xf4)]);case _0x444412(0x9e):return sendTerminalInput(_0x1a01c8[_0x444412(0xb2)],_0x1a01c8[_0x444412(0xf4)]);case _0x444412(0xf6):return terminateProcess(_0x1a01c8[_0x444412(0xf4)]);case _0x444412(0xd6):return createFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0x9c)]);case _0x444412(0x115):return readFile(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0x8c):return listDirectory(_0x1a01c8[_0x444412(0xe8)]||'.');case'edit_file':return editFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8['search'],_0x1a01c8[_0x444412(0x8f)]);case _0x444412(0x106):return searchFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8['pattern']);case'delete_file':return deleteFile(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0xdf):return renameFile(_0x1a01c8[_0x444412(0xb6)]||_0x1a01c8[_0x444412(0xe8)],_0x1a01c8['to']);case _0x444412(0xf1):return copyFile(_0x1a01c8[_0x444412(0xb6)]||_0x1a01c8['path'],_0x1a01c8['to']);case _0x444412(0x7d):return fileInfo(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0xb8):return readFileLines(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0xb0)]||0x1,_0x1a01c8[_0x444412(0x71)]||0x32);case _0x444412(0xc1):return findFiles(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xb9)]);case _0x444412(0xf3):return searchDirectory(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xb9)]);case _0x444412(0xa1):{try{const _0x1b1f29=resolve(process[_0x444412(0xa2)](),_0x1a01c8[_0x444412(0xe8)]);return await _0x394669('__Sending\x20file:\x20'+basename(_0x1b1f29)+'__'),{'success':!![],'sent':!![],'note':_0x444412(0xaf)};}catch(_0x1b63f9){return{'error':_0x444412(0xcb)+_0x1b63f9};}}case _0x444412(0x68):return gitStatus();case'git_diff':return gitDiff(_0x1a01c8['path']);case _0x444412(0x8b):return gitLog(_0x1a01c8['count']||0xa);case _0x444412(0xdb):return gitAdd(_0x1a01c8[_0x444412(0xe8)]||'.');case _0x444412(0x75):return gitCommit(_0x1a01c8[_0x444412(0x107)]);case _0x444412(0x91):return gitBranch();case _0x444412(0xfc):return fetchUrl(_0x1a01c8[_0x444412(0x72)]);case'download_file':return a7_0x510ba5(_0x1a01c8['url'],_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0xfd):return getEnv(_0x1a01c8[_0x444412(0x94)]);case _0x444412(0x7a):return setEnv(_0x1a01c8[_0x444412(0x94)],_0x1a01c8['value']);case'get_system_info':return getSystemInfo();case'clipboard_read':return clipboardRead();case'clipboard_write':return clipboardWrite(_0x1a01c8['text']);case'tree':return tree(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xa3)]||0x3);case _0x444412(0x6e):return grepRecursive(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xb9)],_0x1a01c8[_0x444412(0x8e)]);case'replace_in_files':return replaceInFiles(_0x1a01c8[_0x444412(0xe8)]||'.',_0x1a01c8[_0x444412(0xfe)],_0x1a01c8[_0x444412(0x8f)],_0x1a01c8[_0x444412(0x8e)]);case _0x444412(0x10b):return powershellRun(_0x1a01c8[_0x444412(0xab)]||_0x1a01c8['command']);case _0x444412(0x8d):return zipFiles(_0x1a01c8[_0x444412(0x112)]||[_0x1a01c8[_0x444412(0xe8)]],_0x1a01c8[_0x444412(0xc6)]||'archive.zip');case _0x444412(0x90):return unzipFiles(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0xc6)]||'.');case _0x444412(0x82):return writeJson(_0x1a01c8['path'],_0x1a01c8['data']);case _0x444412(0xe9):return readJson(_0x1a01c8[_0x444412(0xe8)]);case _0x444412(0x93):return patchFile(_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0x89)]);case _0x444412(0xe0):return openInEditor(_0x1a01c8[_0x444412(0xe8)]);case'github_read_file':{const {readFile:_0x28f013}=await import(_0x444412(0x10a));return _0x28f013(_0x1a01c8[_0x444412(0x95)],_0x1a01c8['repo'],_0x1a01c8[_0x444412(0xe8)],_0x1a01c8[_0x444412(0x111)]);}case _0x444412(0xa7):{const {createBranch:_0x2f0cb7}=await import('../github/api.js');return _0x2f0cb7(_0x1a01c8[_0x444412(0x95)],_0x1a01c8[_0x444412(0xa9)],_0x1a01c8[_0x444412(0xf8)],_0x1a01c8[_0x444412(0xf7)]);}case'github_create_pr':{const {createPullRequest:_0x4869f1}=await import(_0x444412(0x10a));return _0x4869f1(_0x1a01c8[_0x444412(0x95)],_0x1a01c8['repo'],_0x1a01c8[_0x444412(0x86)],_0x1a01c8[_0x444412(0xbe)],_0x1a01c8[_0x444412(0xc5)],_0x1a01c8['body']);}case _0x444412(0x80):{const {browserOpen:_0x40527f,startBrowserServer:_0x32f366,isBrowserServerRunning:_0x395476}=await import(_0x444412(0x81));if(!_0x395476())await _0x32f366();return _0x40527f(_0x1a01c8['url']);}case'browser_click':{const {browserClick:_0x2abae4}=await import('../browser/index.js');return _0x2abae4(_0x1a01c8[_0x444412(0xac)]);}case _0x444412(0x103):{const {browserFill:_0x471644}=await import(_0x444412(0x81));return _0x471644(_0x1a01c8[_0x444412(0xac)],_0x1a01c8[_0x444412(0x83)]);}case _0x444412(0xe2):{const {browserSnapshot:_0x3cd5aa}=await import(_0x444412(0x81));return _0x3cd5aa();}case _0x444412(0xe3):{const {browserScreenshot:_0x601cd4}=await import(_0x444412(0x81));return _0x601cd4();}case _0x444412(0x78):{const {browserClose:_0x45abc1}=await import('../browser/index.js');return _0x45abc1();}default:return{'error':_0x444412(0x9d)+_0x136817};}}async function processDiscordAgentLoop(_0x4e8a92,_0x262736,_0x464a6e,_0x56ba90){const _0x39e4ee=a7_0x11290b;let _0x401b11=0x0;const _0x5f50f9=0x14;while(_0x401b11<_0x5f50f9){_0x401b11++;let _0x1a76ba='';try{const _0x9df16e=await sendChatMessage(_0x262736,_0x4e8a92,_0x31afb6=>{_0x1a76ba+=_0x31afb6;});_0x1a76ba=_0x9df16e[_0x39e4ee(0x9c)];}catch(_0x54d422){await _0x464a6e(_0x39e4ee(0x7b)+(_0x54d422[_0x39e4ee(0x107)]?.[_0x39e4ee(0x84)](0x0,0x64)||'Error'));return;}_0x4e8a92[_0x39e4ee(0xa5)]({'role':_0x39e4ee(0x6b),'content':_0x1a76ba});let _0x293d5f=_0x1a76ba[_0x39e4ee(0x92)](/```tool\s*([\s\S]*?)```/);if(!_0x293d5f)_0x293d5f=_0x1a76ba['match'](/\*\*\*tool\s*([\s\S]*?)\*\*\*/);if(!_0x293d5f)_0x293d5f=_0x1a76ba[_0x39e4ee(0x92)](/```json\s*({[\s\S]*?"name"[\s\S]*?})\s*```/);if(!_0x293d5f){let _0x2f1703=_0x1a76ba['replace'](/<reasoning>[\s\S]*?<\/reasoning>/g,'')[_0x39e4ee(0x8f)](/<text>|<\/text>/g,'')['replace'](/```tool[\s\S]*?```/g,'')[_0x39e4ee(0x8f)](/\*\*\*tool[\s\S]*?\*\*\*/g,'')[_0x39e4ee(0x8f)](/#{1,6}\s*/g,'')[_0x39e4ee(0x69)]();if(_0x2f1703){if(_0x2f1703[_0x39e4ee(0x79)]>0x7d0){const _0x355a3c=_0x2f1703['match'](/[\s\S]{1,2000}/g)||[];for(const _0x14edf0 of _0x355a3c)await _0x464a6e(_0x14edf0);}else await _0x464a6e(_0x2f1703);}break;}try{const _0x7b2c9f=JSON[_0x39e4ee(0x113)](_0x293d5f[0x1]['trim']());a7_0x59554f[_0x39e4ee(0xf9)](_0x39e4ee(0xa0)+_0x7b2c9f['name']);const _0x571cff=await executeToolCall(_0x7b2c9f[_0x39e4ee(0x94)],_0x7b2c9f[_0x39e4ee(0x7c)],_0x464a6e);_0x7b2c9f[_0x39e4ee(0x94)]==='send_file'&&_0x7b2c9f[_0x39e4ee(0x7c)][_0x39e4ee(0xe8)]&&await _0x56ba90(resolve(process[_0x39e4ee(0xa2)](),_0x7b2c9f[_0x39e4ee(0x7c)][_0x39e4ee(0xe8)])),_0x4e8a92[_0x39e4ee(0xa5)]({'role':_0x39e4ee(0xbb),'content':_0x39e4ee(0xdc)+_0x7b2c9f[_0x39e4ee(0x94)]+':\x0a'+JSON[_0x39e4ee(0xbd)](_0x571cff,null,0x2)}),await new Promise(_0x1ec02d=>setTimeout(_0x1ec02d,0xc8));}catch(_0x22b659){_0x4e8a92[_0x39e4ee(0xa5)]({'role':_0x39e4ee(0xbb),'content':_0x39e4ee(0x97)+_0x22b659+_0x39e4ee(0x70)});}}}function getOrCreateHistory(_0x15bdc5){const _0x32a79c=a7_0x11290b;return!chatHistories['has'](_0x15bdc5)&&chatHistories['set'](_0x15bdc5,[{'role':_0x32a79c(0xb4),'content':SYSTEM_PROMPT}]),chatHistories[_0x32a79c(0xf5)](_0x15bdc5);}export async function startBot(){const _0x42266a=a7_0x11290b,_0x380c72=a7_0x3ae594['getBotToken']();if(!_0x380c72)return![];if(isRunning)return!![];try{return client=new Client({'intents':[GatewayIntentBits['Guilds'],GatewayIntentBits[_0x42266a(0xe5)],GatewayIntentBits[_0x42266a(0x114)],GatewayIntentBits[_0x42266a(0x98)]],'partials':[Partials[_0x42266a(0xe6)]]}),client[_0x42266a(0xe7)]('ready',()=>{const _0x3bdee1=_0x42266a;a7_0x59554f[_0x3bdee1(0x100)](_0x3bdee1(0xc8)+client?.[_0x3bdee1(0xbb)]?.[_0x3bdee1(0x76)]),isRunning=!![];if(client)registerDiscordClient(client);}),client['on']('messageCreate',async _0x31e421=>{const _0x201516=_0x42266a;if(_0x31e421['author'][_0x201516(0xec)])return;const _0x5b689c=_0x31e421[_0x201516(0xb7)]['type']===ChannelType['DM'],_0xd89f54=client?.[_0x201516(0xbb)]&&_0x31e421[_0x201516(0xd4)][_0x201516(0x116)](client[_0x201516(0xbb)]);if(!_0x5b689c&&!_0xd89f54)return;const _0x37907a=_0x31e421[_0x201516(0x9c)][_0x201516(0x8f)](/<@!?[0-9]+>/g,'')['trim'](),_0x53ae96=_0x31e421[_0x201516(0xf0)]['id'],_0x5800e2=(_0x31e421[_0x201516(0xff)]||'dm')+'-'+_0x31e421[_0x201516(0xea)]+'-'+_0x53ae96,_0x2dd836=async _0x3f9d5c=>{const _0xc9e4aa=_0x201516;await _0x31e421[_0xc9e4aa(0xb7)]['send'](_0x3f9d5c)[_0xc9e4aa(0xb5)](()=>{});},_0x3799ba=async _0x264374=>{const _0x30ba77=_0x201516;try{const _0x1e927c=new AttachmentBuilder(_0x264374);await _0x31e421['channel'][_0x30ba77(0xee)]({'files':[_0x1e927c]});}catch{}};if(_0x37907a===_0x201516(0x73)||_0x37907a===_0x201516(0x6d)){chatHistories[_0x201516(0x87)](_0x5800e2),await _0x31e421[_0x201516(0x105)](_0x201516(0xa8));return;}if(_0x37907a===_0x201516(0xe1)||_0x37907a==='!clear'){chatHistories[_0x201516(0x87)](_0x5800e2),await _0x31e421[_0x201516(0x105)](_0x201516(0x74));return;}if(_0x37907a===_0x201516(0xca)||_0x37907a===_0x201516(0x10d)){const _0x402774=readTerminalOutput(),_0x3380b9=_0x402774[_0x201516(0xae)][_0x201516(0x79)]>0x0?'\x0aProcesses:\x20'+_0x402774[_0x201516(0xae)]['join'](',\x20'):'';await _0x31e421[_0x201516(0x105)]('Dir:\x20'+process['cwd']()+_0x201516(0xc7)+getSelectedModel()+_0x3380b9);return;}if(_0x37907a===_0x201516(0xd9)||_0x37907a===_0x201516(0xd7)){const _0x307628=gitStatus(),_0xad9206=tree('.',0x2),_0x4f7411=readJson(_0x201516(0xd0));let _0x3a4fee='Dir:\x20'+process[_0x201516(0xa2)]()+_0x201516(0xc7)+getSelectedModel()+'\x0a';if(_0x4f7411[_0x201516(0x100)]&&_0x4f7411['data']){const _0x19d405=_0x4f7411[_0x201516(0xaa)];_0x3a4fee+=_0x201516(0x9b)+(_0x19d405['name']||'?')+'\x20v'+(_0x19d405[_0x201516(0xd2)]||'?')+'\x0a';}if(_0x307628['success'])_0x3a4fee+='\x0aGit:\x20'+(_0x307628[_0x201516(0xc6)]||_0x201516(0x88))+'\x0a';_0xad9206[_0x201516(0x100)]&&_0xad9206[_0x201516(0x101)]&&(_0x3a4fee+=_0x201516(0xfb)+_0xad9206['tree'][_0x201516(0xc4)]('\x0a')[_0x201516(0x8a)](0x0,0xf)[_0x201516(0xef)]('\x0a'));if(_0x3a4fee[_0x201516(0x79)]>0x7d0)_0x3a4fee=_0x3a4fee[_0x201516(0x84)](0x0,0x7cd)+_0x201516(0x109);await _0x31e421[_0x201516(0x105)](_0x3a4fee);return;}if(_0x37907a[_0x201516(0xa6)]('/files\x20')||_0x37907a['startsWith'](_0x201516(0x99))||_0x37907a===_0x201516(0xbf)||_0x37907a===_0x201516(0x6f)){const _0x3057bd=_0x37907a['replace'](/^[!/]files\s*/,'')[_0x201516(0x69)]()||'.',_0x44f40f=listDirectory(_0x3057bd);if(_0x44f40f[_0x201516(0x100)]&&_0x44f40f[_0x201516(0x7f)]){const _0x4a2922=_0x44f40f[_0x201516(0x7f)][_0x201516(0x8a)](0x0,0x1e)[_0x201516(0xcf)](_0x7857a0=>{const _0x3720ef=_0x201516,_0x3f2f08=_0x7857a0[_0x3720ef(0x96)]===_0x3720ef(0xc2)?_0x3720ef(0xf2):_0x3720ef(0xb1);return _0x3f2f08+'\x20'+_0x7857a0['name'];})[_0x201516(0xef)]('\x0a');await _0x31e421[_0x201516(0x105)](_0x3057bd+_0x201516(0x10f)+_0x4a2922);}else await _0x31e421[_0x201516(0x105)](_0x44f40f['message']);return;}if(_0x37907a['startsWith'](_0x201516(0xe4))||_0x37907a[_0x201516(0xa6)](_0x201516(0xbc))){const _0x52ff8f=_0x37907a[_0x201516(0x8f)](/^[!/]run\s+/,'')['trim']();if(!_0x52ff8f){await _0x31e421['reply']('Usage:\x20/run\x20<command>');return;}await _0x31e421[_0x201516(0xb7)][_0x201516(0xb3)]()['catch'](()=>{});const _0x177984=await runCommand(_0x52ff8f,undefined,![],0x7530),_0x260ce2=(_0x177984[_0x201516(0xda)]||_0x177984[_0x201516(0x6a)]||_0x201516(0xdd))[_0x201516(0x84)](0x0,0x76c);await _0x31e421[_0x201516(0x105)](_0x201516(0x77)+_0x177984[_0x201516(0xd5)]+_0x201516(0x85)+_0x260ce2+_0x201516(0xeb));return;}if(_0x37907a[_0x201516(0xa6)](_0x201516(0xce))||_0x37907a[_0x201516(0xa6)](_0x201516(0xc3))){const _0x594ea1=_0x37907a[_0x201516(0x8f)](/^[!/]cd\s+/,'')[_0x201516(0x69)]();try{process[_0x201516(0x110)](resolve(process[_0x201516(0xa2)](),_0x594ea1)),await _0x31e421[_0x201516(0x105)]('Changed\x20to:\x20'+process['cwd']());}catch(_0x39a16b){await _0x31e421[_0x201516(0x105)](_0x201516(0x7b)+_0x39a16b);}return;}if(!_0x37907a)return;await _0x31e421[_0x201516(0xb7)][_0x201516(0xb3)]()[_0x201516(0xb5)](()=>{});const _0x19c88f=getOrCreateHistory(_0x5800e2);_0x19c88f[_0x201516(0xa5)]({'role':'user','content':_0x37907a}),a7_0x59554f[_0x201516(0xf9)](_0x201516(0xc0)+_0x31e421[_0x201516(0xf0)][_0x201516(0x108)]+':\x20'+_0x37907a),await processDiscordAgentLoop(_0x19c88f,getSelectedModel(),_0x2dd836,_0x3799ba);if(_0x31e421['attachments'][_0x201516(0xcd)]>0x0)for(const [,_0x4f04e4]of _0x31e421[_0x201516(0xfa)]){try{const _0x5393d2=await fetch(_0x4f04e4[_0x201516(0x72)]),_0x372f27=Buffer[_0x201516(0xb6)](await _0x5393d2[_0x201516(0x66)]()),_0x25b950=join(process['cwd'](),_0x4f04e4[_0x201516(0x94)]||'upload_'+Date[_0x201516(0x9f)]()),{writeFileSync:_0x401ef7}=await import('fs');_0x401ef7(_0x25b950,_0x372f27),_0x19c88f['push']({'role':_0x201516(0xbb),'content':'[File\x20received:\x20'+_0x4f04e4[_0x201516(0x94)]+'\x20('+_0x372f27[_0x201516(0x79)]+_0x201516(0xa4)+_0x25b950+']'}),await _0x31e421[_0x201516(0x105)](_0x201516(0x6c)+_0x4f04e4[_0x201516(0x94)]);}catch{}}}),await client[_0x42266a(0x7e)](_0x380c72),!![];}catch(_0xbc16ab){return a7_0x59554f[_0x42266a(0xba)]('[Discord]\x20Failed\x20to\x20start:\x20'+_0xbc16ab['message']),![];}}export function stopBot(){client&&(client['destroy'](),client=null),isRunning=![];}export function isBotRunning(){return isRunning;}
@@ -1,5 +0,0 @@
1
- export declare function setBotToken(token: string): void;
2
- export declare function getBotToken(): string;
3
- export declare function isEnabled(): boolean;
4
- export declare function isConfigured(): boolean;
5
- export declare function clearConfig(): void;
@@ -1 +0,0 @@
1
- const a8_0x59332c=a8_0x303e;(function(_0x418672,_0x21c36e){const _0x3c21a5=a8_0x303e,_0xfd98fd=_0x418672();while(!![]){try{const _0x3fd0ef=-parseInt(_0x3c21a5(0xb5))/0x1+-parseInt(_0x3c21a5(0xbe))/0x2+-parseInt(_0x3c21a5(0xcd))/0x3*(parseInt(_0x3c21a5(0xc5))/0x4)+-parseInt(_0x3c21a5(0xba))/0x5*(-parseInt(_0x3c21a5(0xcc))/0x6)+parseInt(_0x3c21a5(0xbb))/0x7*(parseInt(_0x3c21a5(0xd1))/0x8)+-parseInt(_0x3c21a5(0xd2))/0x9*(-parseInt(_0x3c21a5(0xc4))/0xa)+-parseInt(_0x3c21a5(0xce))/0xb*(-parseInt(_0x3c21a5(0xcb))/0xc);if(_0x3fd0ef===_0x21c36e)break;else _0xfd98fd['push'](_0xfd98fd['shift']());}catch(_0x3c2ee6){_0xfd98fd['push'](_0xfd98fd['shift']());}}}(a8_0x4f7a,0x4ab02));import a8_0x53a47d from'conf';import a8_0x2dd0f7 from'crypto';const config=new a8_0x53a47d({'projectName':a8_0x59332c(0xc9),'defaults':{'botToken':'','commandPrefix':'!','enabled':![]}}),ENCRYPTION_KEY=a8_0x59332c(0xcf);function encrypt(_0x31188c){const _0x3bd7ca=a8_0x59332c;if(!_0x31188c)return'';const _0x8e8c2d=a8_0x2dd0f7[_0x3bd7ca(0xc1)](0x10),_0x242cc6=a8_0x2dd0f7['createHash']('sha256')[_0x3bd7ca(0xb9)](ENCRYPTION_KEY)[_0x3bd7ca(0xc2)](),_0x2cb3fc=a8_0x2dd0f7[_0x3bd7ca(0xb7)]('aes-256-cbc',_0x242cc6,_0x8e8c2d);let _0xb3780=_0x2cb3fc[_0x3bd7ca(0xb9)](_0x31188c,'utf8',_0x3bd7ca(0xb8));return _0xb3780+=_0x2cb3fc[_0x3bd7ca(0xbd)](_0x3bd7ca(0xb8)),_0x8e8c2d['toString']('hex')+':'+_0xb3780;}function decrypt(_0x13ff21){const _0x6491df=a8_0x59332c;if(!_0x13ff21)return'';try{const [_0x4fef03,_0x392200]=_0x13ff21[_0x6491df(0xca)](':');if(!_0x4fef03||!_0x392200)return'';const _0x5680df=Buffer['from'](_0x4fef03,_0x6491df(0xb8)),_0xc42161=a8_0x2dd0f7[_0x6491df(0xc7)](_0x6491df(0xc8))['update'](ENCRYPTION_KEY)[_0x6491df(0xc2)](),_0x254c5c=a8_0x2dd0f7[_0x6491df(0xc0)](_0x6491df(0xb6),_0xc42161,_0x5680df);let _0x2d623c=_0x254c5c[_0x6491df(0xb9)](_0x392200,_0x6491df(0xb8),_0x6491df(0xc6));return _0x2d623c+=_0x254c5c[_0x6491df(0xbd)](_0x6491df(0xc6)),_0x2d623c;}catch{return'';}}export function setBotToken(_0x245f40){const _0xff497e=a8_0x59332c;config[_0xff497e(0xbc)](_0xff497e(0xc3),encrypt(_0x245f40));}function a8_0x4f7a(){const _0x3076ce=['clear','8QqWPLL','13743jCTtzY','588357lrfVFH','aes-256-cbc','createCipheriv','hex','update','328510vrwTOd','2175628Zdocxo','set','final','183764MlcRxg','get','createDecipheriv','randomBytes','digest','botToken','1130UmIXtd','17648oZtPiV','utf8','createHash','sha256','woozlit-cli-discord','split','3484068yzbVxd','36tRcHVN','321KihCqa','22KBBpmD','woozlit_discord_secure_key'];a8_0x4f7a=function(){return _0x3076ce;};return a8_0x4f7a();}export function getBotToken(){const _0x462b3a=a8_0x59332c;return decrypt(config[_0x462b3a(0xbf)](_0x462b3a(0xc3)));}export function isEnabled(){return!!getBotToken();}function a8_0x303e(_0x5b62cc,_0x4ea4dd){_0x5b62cc=_0x5b62cc-0xb5;const _0x4f7a49=a8_0x4f7a();let _0x303e57=_0x4f7a49[_0x5b62cc];return _0x303e57;}export function isConfigured(){return!!getBotToken();}export function clearConfig(){const _0x2df665=a8_0x59332c;config[_0x2df665(0xd0)]();}
@@ -1,3 +0,0 @@
1
- export * from "./config.js";
2
- export { startBot, stopBot, isBotRunning } from "./client.js";
3
- export { setupDiscord } from "./setup.js";
@@ -1 +0,0 @@
1
- function a9_0x463d(){var _0x24f237=['3469929XVslaU','474132cMiLML','10NctMpF','10cPotVg','63230ZbHcqQ','32834796kIEwsN','7fCyVse','6325443YMnjYO','9WYFVYV','1574392CMmTlu','1423796dplHrl','4zViEtQ'];a9_0x463d=function(){return _0x24f237;};return a9_0x463d();}(function(_0x275e60,_0xcd6a4e){var _0x1fe6b4=a9_0x2f78,_0x2ee064=_0x275e60();while(!![]){try{var _0xe20220=parseInt(_0x1fe6b4(0x1a2))/0x1*(parseInt(_0x1fe6b4(0x19e))/0x2)+parseInt(_0x1fe6b4(0x1a6))/0x3*(-parseInt(_0x1fe6b4(0x1a5))/0x4)+parseInt(_0x1fe6b4(0x1a8))/0x5*(-parseInt(_0x1fe6b4(0x1a7))/0x6)+parseInt(_0x1fe6b4(0x1a0))/0x7*(-parseInt(_0x1fe6b4(0x1a3))/0x8)+-parseInt(_0x1fe6b4(0x1a1))/0x9*(parseInt(_0x1fe6b4(0x19d))/0xa)+-parseInt(_0x1fe6b4(0x1a4))/0xb+parseInt(_0x1fe6b4(0x19f))/0xc;if(_0xe20220===_0xcd6a4e)break;else _0x2ee064['push'](_0x2ee064['shift']());}catch(_0x5d6876){_0x2ee064['push'](_0x2ee064['shift']());}}}(a9_0x463d,0xa549b));export*from'./config.js';function a9_0x2f78(_0x1bdd23,_0x590584){_0x1bdd23=_0x1bdd23-0x19d;var _0x463ddf=a9_0x463d();var _0x2f7815=_0x463ddf[_0x1bdd23];return _0x2f7815;}export{startBot,stopBot,isBotRunning}from'./client.js';export{setupDiscord}from'./setup.js';
@@ -1 +0,0 @@
1
- export declare function setupDiscord(): Promise<void>;
@@ -1 +0,0 @@
1
- (function(_0x2a2a28,_0x19d368){const _0x1cb1eb=a10_0x542f,_0x65ed6c=_0x2a2a28();while(!![]){try{const _0xce55a8=parseInt(_0x1cb1eb(0x15e))/0x1*(parseInt(_0x1cb1eb(0x15c))/0x2)+-parseInt(_0x1cb1eb(0x15a))/0x3+-parseInt(_0x1cb1eb(0x156))/0x4*(parseInt(_0x1cb1eb(0x150))/0x5)+-parseInt(_0x1cb1eb(0x161))/0x6*(-parseInt(_0x1cb1eb(0x14f))/0x7)+-parseInt(_0x1cb1eb(0x154))/0x8*(-parseInt(_0x1cb1eb(0x151))/0x9)+parseInt(_0x1cb1eb(0x15d))/0xa+-parseInt(_0x1cb1eb(0x15b))/0xb;if(_0xce55a8===_0x19d368)break;else _0x65ed6c['push'](_0x65ed6c['shift']());}catch(_0x540122){_0x65ed6c['push'](_0x65ed6c['shift']());}}}(a10_0x4861,0x2f17f));function a10_0x4861(){const _0x5811fb=['6648uoxVvX','Token\x20seems\x20too\x20short','3268YRKmhn','Restart\x20the\x20CLI\x20to\x20start\x20the\x20Discord\x20Bot.','You\x20need\x20a\x20Bot\x20Token\x20from\x20the\x20Discord\x20Developer\x20Portal.','success','628743aYVWmm','4007443RbwdUX','636428kPletA','3719390BhshbV','1iyEOIT','Discord\x20configuration\x20saved!','dim','144JQyVSR','17332pSQzpm','805hXOyzr','1611gmCPNE','info','Setup\x20Woozlit\x20Discord\x20Bot'];a10_0x4861=function(){return _0x5811fb;};return a10_0x4861();}import{input}from'@inquirer/prompts';import*as a10_0x23807f from'./config.js';import*as a10_0x511f7f from'../ui/output.js';function a10_0x542f(_0x599898,_0x1d44e7){_0x599898=_0x599898-0x14f;const _0x486172=a10_0x4861();let _0x542fd3=_0x486172[_0x599898];return _0x542fd3;}export async function setupDiscord(){const _0x44f7e8=a10_0x542f;a10_0x511f7f['info'](_0x44f7e8(0x153)),a10_0x511f7f[_0x44f7e8(0x160)](_0x44f7e8(0x158));const _0x126866=await input({'message':'Bot\x20Token:','validate':_0xccf8c8=>_0xccf8c8['length']>0xa?!![]:_0x44f7e8(0x155)}),_0x1e5fd8=await input({'message':'Command\x20Prefix\x20(optional,\x20default\x20\x27!\x27):','default':'!'});a10_0x23807f['setBotToken'](_0x126866),a10_0x511f7f[_0x44f7e8(0x159)](_0x44f7e8(0x15f)),a10_0x511f7f[_0x44f7e8(0x152)](_0x44f7e8(0x157));}
@@ -1,31 +0,0 @@
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;
@@ -1 +0,0 @@
1
- const a11_0x5a163f=a11_0x3f67;function a11_0xe7e4(){const _0x331ca8=['woozlit_email_secure_key','allowedSenders','imapPass','set','hex','smtpPort','from','6160tjmPAV','split','20cggOzf','enabled','digest','smtpUser','createDecipheriv','232RdBKEx','password','get','createHash','update','sha256','final','includes','784644MoBHpz','user','imapUser','76DRKhcd','imapPort','aes-256-cbc','427516jRoMjh','woozlit-cli-email','1681575ACRhBa','2671526VghzSi','38010nCLfsg','4131369VRxzcR','smtpPass','60GVmTNU','imap.gmail.com','imapHost','createCipheriv','smtpHost','utf8'];a11_0xe7e4=function(){return _0x331ca8;};return a11_0xe7e4();}(function(_0x7a552a,_0x8da68c){const _0x499b1f=a11_0x3f67,_0x3707c3=_0x7a552a();while(!![]){try{const _0x4e9762=parseInt(_0x499b1f(0x1ac))/0x1*(-parseInt(_0x499b1f(0x19a))/0x2)+-parseInt(_0x499b1f(0x1b1))/0x3+-parseInt(_0x499b1f(0x1af))/0x4+-parseInt(_0x499b1f(0x19c))/0x5*(parseInt(_0x499b1f(0x1a9))/0x6)+parseInt(_0x499b1f(0x1b3))/0x7*(-parseInt(_0x499b1f(0x1a1))/0x8)+parseInt(_0x499b1f(0x1b4))/0x9+-parseInt(_0x499b1f(0x1b6))/0xa*(-parseInt(_0x499b1f(0x1b2))/0xb);if(_0x4e9762===_0x8da68c)break;else _0x3707c3['push'](_0x3707c3['shift']());}catch(_0x256f03){_0x3707c3['push'](_0x3707c3['shift']());}}}(a11_0xe7e4,0x5196b));import a11_0x3c1887 from'conf';import a11_0x5eaf1d from'crypto';const config=new a11_0x3c1887({'projectName':a11_0x5a163f(0x1b0),'defaults':{'imapHost':a11_0x5a163f(0x1b7),'imapPort':0x3e1,'imapUser':'','imapPass':'','smtpHost':'smtp.gmail.com','smtpPort':0x24b,'smtpUser':'','smtpPass':'','checkInterval':0x5,'allowedSenders':[],'enabled':![]}}),ENCRYPTION_KEY=a11_0x5a163f(0x1bc);function encrypt(_0x2c14c1){const _0x2a91d0=a11_0x5a163f;if(!_0x2c14c1)return'';const _0x5daef5=a11_0x5eaf1d['randomBytes'](0x10),_0x17cd8a=a11_0x5eaf1d[_0x2a91d0(0x1a4)](_0x2a91d0(0x1a6))['update'](ENCRYPTION_KEY)[_0x2a91d0(0x19e)](),_0x411e3d=a11_0x5eaf1d[_0x2a91d0(0x1b9)](_0x2a91d0(0x1ae),_0x17cd8a,_0x5daef5);let _0xce8657=_0x411e3d[_0x2a91d0(0x1a5)](_0x2c14c1,_0x2a91d0(0x1bb),_0x2a91d0(0x1c0));return _0xce8657+=_0x411e3d['final'](_0x2a91d0(0x1c0)),_0x5daef5['toString'](_0x2a91d0(0x1c0))+':'+_0xce8657;}function decrypt(_0x51d6a2){const _0x4ef55d=a11_0x5a163f;if(!_0x51d6a2)return'';try{const [_0x58f16d,_0x3394be]=_0x51d6a2[_0x4ef55d(0x19b)](':');if(!_0x58f16d||!_0x3394be)return'';const _0x2f389b=Buffer[_0x4ef55d(0x199)](_0x58f16d,_0x4ef55d(0x1c0)),_0xe8f6b0=a11_0x5eaf1d[_0x4ef55d(0x1a4)]('sha256')['update'](ENCRYPTION_KEY)[_0x4ef55d(0x19e)](),_0x40e409=a11_0x5eaf1d[_0x4ef55d(0x1a0)](_0x4ef55d(0x1ae),_0xe8f6b0,_0x2f389b);let _0x5990de=_0x40e409[_0x4ef55d(0x1a5)](_0x3394be,_0x4ef55d(0x1c0),'utf8');return _0x5990de+=_0x40e409[_0x4ef55d(0x1a7)](_0x4ef55d(0x1bb)),_0x5990de;}catch{return'';}}function a11_0x3f67(_0x44d01e,_0x1832a9){_0x44d01e=_0x44d01e-0x198;const _0xe7e4c=a11_0xe7e4();let _0x3f6751=_0xe7e4c[_0x44d01e];return _0x3f6751;}export function setCredentials(_0x4c0eb7,_0x2d0c96,_0x36b4c4,_0x2d844a){const _0xa124fb=a11_0x5a163f;config['set'](_0xa124fb(0x1ab),_0x4c0eb7),config[_0xa124fb(0x1bf)](_0xa124fb(0x1be),encrypt(_0x2d0c96)),config[_0xa124fb(0x1bf)](_0xa124fb(0x19f),_0x4c0eb7),config[_0xa124fb(0x1bf)](_0xa124fb(0x1b5),encrypt(_0x2d0c96));if(_0x36b4c4)config[_0xa124fb(0x1bf)](_0xa124fb(0x1b8),_0x36b4c4);}export function getConfig(){const _0x2db6b1=a11_0x5a163f;return{'imap':{'user':config[_0x2db6b1(0x1a3)]('imapUser'),'password':decrypt(config[_0x2db6b1(0x1a3)]('imapPass')),'host':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1b8)),'port':config['get'](_0x2db6b1(0x1ad)),'tls':!![],'tlsOptions':{'rejectUnauthorized':![]},'authTimeout':0xbb8},'smtp':{'host':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1ba)),'port':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x198)),'auth':{'user':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x19f)),'pass':decrypt(config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1b5)))},'tls':{'rejectUnauthorized':![]}},'interval':config['get']('checkInterval'),'allowedSenders':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x1bd))||[],'enabled':config[_0x2db6b1(0x1a3)](_0x2db6b1(0x19d))};}export function isConfigured(){const _0x37bec8=a11_0x5a163f,_0x1a95ba=getConfig();return!!_0x1a95ba['imap'][_0x37bec8(0x1aa)]&&!!_0x1a95ba['imap'][_0x37bec8(0x1a2)];}export function setEnabled(_0x2565df){config['set']('enabled',_0x2565df);}export function addAllowedSender(_0x50292a){const _0x20851d=a11_0x5a163f,_0x255309=config[_0x20851d(0x1a3)]('allowedSenders')||[];!_0x255309[_0x20851d(0x1a8)](_0x50292a)&&(_0x255309['push'](_0x50292a),config['set']('allowedSenders',_0x255309));}
@@ -1,3 +0,0 @@
1
- export * from "./config.js";
2
- export { startBot, stopBot, isBotRunning } from "./service.js";
3
- export { setupEmail } from "./setup.js";
@@ -1 +0,0 @@
1
- (function(_0x1bc5e7,_0x2281ce){var _0xe21656=a12_0x1105,_0x2eb13e=_0x1bc5e7();while(!![]){try{var _0x518238=-parseInt(_0xe21656(0xd9))/0x1+parseInt(_0xe21656(0xe1))/0x2+parseInt(_0xe21656(0xe2))/0x3+parseInt(_0xe21656(0xdd))/0x4+parseInt(_0xe21656(0xda))/0x5*(-parseInt(_0xe21656(0xde))/0x6)+parseInt(_0xe21656(0xdc))/0x7*(parseInt(_0xe21656(0xe0))/0x8)+-parseInt(_0xe21656(0xdf))/0x9*(parseInt(_0xe21656(0xdb))/0xa);if(_0x518238===_0x2281ce)break;else _0x2eb13e['push'](_0x2eb13e['shift']());}catch(_0x54fd9c){_0x2eb13e['push'](_0x2eb13e['shift']());}}}(a12_0xb0e9,0x1cd23));export*from'./config.js';export{startBot,stopBot,isBotRunning}from'./service.js';function a12_0x1105(_0x267c29,_0x5e6eb1){_0x267c29=_0x267c29-0xd9;var _0xb0e98f=a12_0xb0e9();var _0x110507=_0xb0e98f[_0x267c29];return _0x110507;}export{setupEmail}from'./setup.js';function a12_0xb0e9(){var _0x28b27e=['10yvaNqs','217MpBySz','662060NllnYm','211902moeWVx','814833lAmIlx','43672gyDscB','167896nqFkcJ','463941oNdqCC','188166nTEgiS','25rXvsfi'];a12_0xb0e9=function(){return _0x28b27e;};return a12_0xb0e9();}
@@ -1,4 +0,0 @@
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";
@@ -1 +0,0 @@
1
- (function(_0x4c1d00,_0x39f5da){const _0x3882f8=a13_0x13f2,_0x398dc8=_0x4c1d00();while(!![]){try{const _0x4ed48d=-parseInt(_0x3882f8(0x108))/0x1*(parseInt(_0x3882f8(0xfa))/0x2)+parseInt(_0x3882f8(0xef))/0x3*(parseInt(_0x3882f8(0xfc))/0x4)+parseInt(_0x3882f8(0xfe))/0x5*(parseInt(_0x3882f8(0xf9))/0x6)+parseInt(_0x3882f8(0xfd))/0x7*(parseInt(_0x3882f8(0xdf))/0x8)+parseInt(_0x3882f8(0xe7))/0x9+-parseInt(_0x3882f8(0xf3))/0xa+-parseInt(_0x3882f8(0x102))/0xb;if(_0x4ed48d===_0x39f5da)break;else _0x398dc8['push'](_0x398dc8['shift']());}catch(_0x5a2636){_0x398dc8['push'](_0x398dc8['shift']());}}}(a13_0x50c0,0xe1a33));import a13_0x33c0b1 from'imap-simple';import a13_0x2b7379 from'nodemailer';import*as a13_0x3d8536 from'./config.js';import*as a13_0x793ae4 from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';let intervalId=null,isRunning=![];async function checkEmails(){const _0x59245d=a13_0x13f2,_0x468978=a13_0x3d8536[_0x59245d(0xea)]();try{const _0x11a183=await a13_0x33c0b1['connect']({'imap':_0x468978['imap']});await _0x11a183[_0x59245d(0xee)](_0x59245d(0xd9));const _0x508afa=['UNSEEN'],_0x15471d={'bodies':['HEADER',_0x59245d(0xf8)],'markSeen':!![]},_0x2df097=await _0x11a183['search'](_0x508afa,_0x15471d);_0x2df097['length']>0x0&&a13_0x793ae4[_0x59245d(0xe6)]('[Email]\x20Found\x20'+_0x2df097[_0x59245d(0xde)]+_0x59245d(0xdc));for(const _0x46589e of _0x2df097){const _0x3e5996=_0x46589e[_0x59245d(0x107)]['find'](_0x46b21b=>_0x46b21b[_0x59245d(0xfb)]===_0x59245d(0x10d)),_0x3b2a4f=_0x3e5996['body'][_0x59245d(0xe2)]?.[0x0]||'',_0x2b000d=_0x3e5996[_0x59245d(0xdb)][_0x59245d(0xe4)]?.[0x0]||_0x59245d(0xec);if(_0x468978[_0x59245d(0xf7)][_0x59245d(0xde)]>0x0){const _0x2770e9=_0x3b2a4f[_0x59245d(0x109)](/<(.+)>/)?.[0x1]||_0x3b2a4f;if(!_0x468978[_0x59245d(0xf7)][_0x59245d(0xe1)](_0x2770e9)){a13_0x793ae4[_0x59245d(0x106)](_0x59245d(0xe5)+_0x3b2a4f+_0x59245d(0x100));continue;}}const _0x1afbe2=_0x46589e[_0x59245d(0x107)][_0x59245d(0x10b)](_0x40f626=>_0x40f626[_0x59245d(0xfb)]===_0x59245d(0xf8)),_0x4a2a73=_0x1afbe2?.[_0x59245d(0xdb)]||'';a13_0x793ae4[_0x59245d(0xe6)](_0x59245d(0xf4)+_0x3b2a4f+_0x59245d(0xf2)+_0x2b000d);try{const _0x12bbfb=_0x59245d(0xe9)+_0x3b2a4f+_0x59245d(0x105)+_0x2b000d+_0x59245d(0xdd)+_0x4a2a73+_0x59245d(0xed),_0x10a35b=await sendChatMessage(getSelectedModel(),[{'role':'user','content':_0x12bbfb}]),_0x49ebd9=a13_0x2b7379[_0x59245d(0x103)](_0x468978[_0x59245d(0xf0)]);await _0x49ebd9[_0x59245d(0xe0)]({'from':_0x468978['smtp'][_0x59245d(0xeb)][_0x59245d(0x10c)],'to':_0x3b2a4f,'subject':_0x59245d(0xe8)+_0x2b000d,'text':_0x10a35b[_0x59245d(0x10a)]}),a13_0x793ae4[_0x59245d(0xe3)]('[Email]\x20Reply\x20sent\x20to\x20'+_0x3b2a4f);}catch(_0x70039d){a13_0x793ae4['error'](_0x59245d(0xf5)+_0x70039d[_0x59245d(0x101)]);}}_0x11a183[_0x59245d(0xda)]();}catch(_0x57f4b9){}}export async function startBot(){const _0x5cec9a=a13_0x13f2;if(!a13_0x3d8536[_0x5cec9a(0xf6)]())return![];if(isRunning)return!![];process[_0x5cec9a(0xf1)][_0x5cec9a(0xff)]='0',checkEmails();const _0x2260b9=a13_0x3d8536[_0x5cec9a(0xea)]()[_0x5cec9a(0x104)]||0x5;return intervalId=setInterval(checkEmails,_0x2260b9*0x3c*0x3e8),isRunning=!![],!![];}function a13_0x50c0(){const _0x1010d2=['find','user','HEADER','INBOX','end','body','\x20new\x20messages','\x0aBody:\x0a','length','369592UGjEUw','sendMail','includes','from','success','subject','[Email]\x20Ignored\x20mail\x20from\x20','info','9503613Wimxgu','Re:\x20','You\x20received\x20an\x20email\x20from\x20','getConfig','auth','No\x20Subject','\x0a\x0aDraft\x20a\x20helpful\x20reply.\x20Structure\x20it\x20clearly.','openBox','75AaXSry','smtp','env','\x20|\x20Subj:\x20','15165900jtdGZb','[Email]\x20From:\x20','[Email]\x20Processing/Reply\x20error:\x20','isConfigured','allowedSenders','TEXT','5232594yegTFv','2302oOWiWz','which','269736wmZSQJ','245khvkeJ','5IDeyOj','NODE_TLS_REJECT_UNAUTHORIZED','\x20(not\x20allowed)','message','29627246ygULnc','createTransport','interval',':\x0aSubject:\x20','dim','parts','84hvrFvF','match','content'];a13_0x50c0=function(){return _0x1010d2;};return a13_0x50c0();}export function stopBot(){intervalId&&(clearInterval(intervalId),intervalId=null),isRunning=![];}export function isBotRunning(){return isRunning;}function a13_0x13f2(_0x5eb7fe,_0x4ec4c8){_0x5eb7fe=_0x5eb7fe-0xd9;const _0x50c0de=a13_0x50c0();let _0x13f2bf=_0x50c0de[_0x5eb7fe];return _0x13f2bf;}export{isConfigured}from'./config.js';
@@ -1 +0,0 @@
1
- export declare function setupEmail(): Promise<void>;
@@ -1 +0,0 @@
1
- (function(_0x37db06,_0x57114b){const _0x187b7e=a14_0xefdc,_0x3c7b63=_0x37db06();while(!![]){try{const _0x3c9b3c=-parseInt(_0x187b7e(0x1d0))/0x1*(parseInt(_0x187b7e(0x1dd))/0x2)+-parseInt(_0x187b7e(0x1c5))/0x3*(parseInt(_0x187b7e(0x1cc))/0x4)+parseInt(_0x187b7e(0x1dc))/0x5*(-parseInt(_0x187b7e(0x1ce))/0x6)+parseInt(_0x187b7e(0x1e0))/0x7+parseInt(_0x187b7e(0x1c3))/0x8*(parseInt(_0x187b7e(0x1d5))/0x9)+-parseInt(_0x187b7e(0x1d4))/0xa+parseInt(_0x187b7e(0x1c2))/0xb;if(_0x3c9b3c===_0x57114b)break;else _0x3c7b63['push'](_0x3c7b63['shift']());}catch(_0x6277c8){_0x3c7b63['push'](_0x3c7b63['shift']());}}}(a14_0x5dee,0xc713f));function a14_0x5dee(){const _0xc455fe=['1532742zXaFjd','addAllowedSender','4StEVuW','Your\x20personal\x20email\x20(that\x20you\x20will\x20send\x20FROM):','success','gmail','14588920bOAlWi','7906617SSgkPA','Restart\x20the\x20CLI\x20to\x20start\x20the\x20Email\x20Agent.','imap.gmail.com','Configure\x20advanced\x20server\x20settings?','SMTP\x20Port:','IMAP\x20Host:','Email\x20Provider\x20(gmail/outlook/other):','5wZepso','751486ZwiyFK','smtp.gmail.com','Email\x20configuration\x20saved!','5738348yiNVpD','info','setEnabled','Password\x20(or\x20App\x20Password):','43075615MTtBEb','8IilXKo','This\x20setup\x20will\x20configure\x20Woozlit\x20to\x20check\x20your\x20email\x20and\x20reply.','81wvTZEE','587','Email\x20Address:','SMTP\x20Host:','993','Only\x20allow\x20emails\x20from\x20yourself\x20(recommended)?','IMAP\x20Port:','234296DGMiwB','toLowerCase'];a14_0x5dee=function(){return _0xc455fe;};return a14_0x5dee();}import{password,input,confirm}from'@inquirer/prompts';import*as a14_0x49c584 from'./config.js';import*as a14_0x156ff2 from'../ui/output.js';function a14_0xefdc(_0x3598fa,_0x23d415){_0x3598fa=_0x3598fa-0x1c1;const _0x5dee05=a14_0x5dee();let _0xefdccc=_0x5dee05[_0x3598fa];return _0xefdccc;}export async function setupEmail(){const _0x2164d0=a14_0xefdc;a14_0x156ff2[_0x2164d0(0x1e1)](_0x2164d0(0x1c4)),a14_0x156ff2['warn']('Use\x20an\x20App\x20Password\x20if\x20you\x20are\x20using\x20Gmail\x20(2FA\x20enabled).');const _0x36df0e=await input({'message':_0x2164d0(0x1db),'default':_0x2164d0(0x1d3)}),_0x3a83f3=await input({'message':_0x2164d0(0x1c7)}),_0x572b86=await password({'message':_0x2164d0(0x1c1)});let _0xcf7ea0=_0x2164d0(0x1d7),_0x12a716=0x3e1,_0x510740=_0x2164d0(0x1de),_0x4c3b62=0x24b;if(_0x36df0e[_0x2164d0(0x1cd)]()!==_0x2164d0(0x1d3)){const _0x415b97=await confirm({'message':_0x2164d0(0x1d8),'default':![]});if(_0x415b97){_0xcf7ea0=await input({'message':_0x2164d0(0x1da),'default':_0xcf7ea0});const _0x3aa800=await input({'message':_0x2164d0(0x1cb),'default':_0x2164d0(0x1c9)});_0x12a716=parseInt(_0x3aa800),_0x510740=await input({'message':_0x2164d0(0x1c8),'default':_0x510740});const _0x3c99d2=await input({'message':_0x2164d0(0x1d9),'default':_0x2164d0(0x1c6)});_0x4c3b62=parseInt(_0x3c99d2);}}a14_0x49c584['setCredentials'](_0x3a83f3,_0x572b86,_0xcf7ea0,_0x12a716),a14_0x49c584[_0x2164d0(0x1e2)](!![]);const _0x47731f=await confirm({'message':_0x2164d0(0x1ca),'default':!![]});if(_0x47731f){a14_0x49c584['addAllowedSender'](_0x3a83f3);const _0x56570a=await input({'message':_0x2164d0(0x1d1)});if(_0x56570a)a14_0x49c584[_0x2164d0(0x1cf)](_0x56570a);}a14_0x156ff2[_0x2164d0(0x1d2)](_0x2164d0(0x1df)),a14_0x156ff2[_0x2164d0(0x1e1)](_0x2164d0(0x1d6));}
@@ -1,25 +0,0 @@
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
- }>;
@@ -1 +0,0 @@
1
- const a15_0x28091d=a15_0x2226;(function(_0x310352,_0x569529){const _0x3339c5=a15_0x2226,_0x70cc44=_0x310352();while(!![]){try{const _0x13b024=-parseInt(_0x3339c5(0xe3))/0x1+parseInt(_0x3339c5(0xe2))/0x2+parseInt(_0x3339c5(0xc6))/0x3+-parseInt(_0x3339c5(0xba))/0x4*(parseInt(_0x3339c5(0xc3))/0x5)+-parseInt(_0x3339c5(0xbe))/0x6+parseInt(_0x3339c5(0xe0))/0x7*(-parseInt(_0x3339c5(0xe1))/0x8)+-parseInt(_0x3339c5(0xcc))/0x9*(-parseInt(_0x3339c5(0xc9))/0xa);if(_0x13b024===_0x569529)break;else _0x70cc44['push'](_0x70cc44['shift']());}catch(_0x5212c9){_0x70cc44['push'](_0x70cc44['shift']());}}}(a15_0x4e93,0x9ddc6));function a15_0x4e93(){const _0x192147=['text','headers','toString','stringify','total_count','/comments','open','json','654241TVzAna','24hklGiQ','435400NvskGi','751537pPNJUG','2022-11-28','content','20UBXhYx','https://api.github.com','/pulls?state=','/contents/','4299168oyKpAX','POST','main','/installation/repositories?per_page=1','base64','47225LidktG','/pulls','GitHub\x20App','371916kEFVTq','Not\x20authenticated\x20with\x20GitHub.\x20Run\x20\x27/github\x20login\x27\x20first.','from','1235650ifhUXu','/issues/','Bearer\x20','153VMfmay','refs/heads/','/repos/','login','sha','length','?ref=','repositories','GitHub\x20API\x20error:\x20','owner','/user/repos?per_page=100&sort=updated','&per_page=50'];a15_0x4e93=function(){return _0x192147;};return a15_0x4e93();}import{getGitHubToken}from'./auth.js';function a15_0x2226(_0x42cf12,_0xda7111){_0x42cf12=_0x42cf12-0xb9;const _0x4e9330=a15_0x4e93();let _0x2226d4=_0x4e9330[_0x42cf12];return _0x2226d4;}async function githubRequest(_0x3988f6,_0xaae04c={}){const _0x2b055f=a15_0x2226,_0xe1eb0a=await getGitHubToken();if(!_0xe1eb0a)throw new Error(_0x2b055f(0xc7));const _0x51bfc6=await fetch(_0x2b055f(0xbb)+_0x3988f6,{..._0xaae04c,'headers':{'Authorization':_0x2b055f(0xcb)+_0xe1eb0a,'Accept':'application/vnd.github+json','X-GitHub-Api-Version':_0x2b055f(0xe4),..._0xaae04c[_0x2b055f(0xd9)]}});if(!_0x51bfc6['ok']){const _0x519a06=await _0x51bfc6[_0x2b055f(0xd8)]();throw new Error(_0x2b055f(0xd4)+_0x51bfc6['status']+'\x20-\x20'+_0x519a06);}return _0x51bfc6[_0x2b055f(0xdf)]();}export async function listRepos(){const _0x3f63d3=a15_0x2226;return githubRequest(_0x3f63d3(0xd6));}export async function getRepo(_0x13a9d8,_0x280e1b){return githubRequest('/repos/'+_0x13a9d8+'/'+_0x280e1b);}export async function readFile(_0x4a5722,_0xd01f1d,_0xc99581,_0x719aba=a15_0x28091d(0xc0)){const _0x2f4792=a15_0x28091d,_0x3d78fc=await githubRequest(_0x2f4792(0xce)+_0x4a5722+'/'+_0xd01f1d+_0x2f4792(0xbd)+_0xc99581+_0x2f4792(0xd2)+_0x719aba),_0x1931ac=Buffer[_0x2f4792(0xc8)](_0x3d78fc[_0x2f4792(0xb9)],_0x2f4792(0xc2))[_0x2f4792(0xda)]('utf-8');return _0x1931ac;}export async function createOrUpdateFile(_0x28120f,_0x455a2a,_0x18b074,_0x3ae261,_0x1b336c,_0x20739f=a15_0x28091d(0xc0),_0x47feec){const _0x305d7a=a15_0x28091d,_0x21343f=Buffer['from'](_0x3ae261)[_0x305d7a(0xda)](_0x305d7a(0xc2));return githubRequest(_0x305d7a(0xce)+_0x28120f+'/'+_0x455a2a+_0x305d7a(0xbd)+_0x18b074,{'method':'PUT','body':JSON[_0x305d7a(0xdb)]({'message':_0x1b336c,'content':_0x21343f,'branch':_0x20739f,..._0x47feec&&{'sha':_0x47feec}})});}export async function createPullRequest(_0x485fc7,_0x2b4f96,_0x17e312,_0x59ca0f,_0x4665c9=a15_0x28091d(0xc0),_0x343735){const _0x238494=a15_0x28091d;return githubRequest(_0x238494(0xce)+_0x485fc7+'/'+_0x2b4f96+_0x238494(0xc4),{'method':_0x238494(0xbf),'body':JSON[_0x238494(0xdb)]({'title':_0x17e312,'head':_0x59ca0f,'base':_0x4665c9,'body':_0x343735||''})});}export async function listPullRequests(_0x585a79,_0x2aef12,_0x2b46c0=a15_0x28091d(0xde)){const _0x340ec0=a15_0x28091d;return githubRequest(_0x340ec0(0xce)+_0x585a79+'/'+_0x2aef12+_0x340ec0(0xbc)+_0x2b46c0+_0x340ec0(0xd7));}export async function commentOnPR(_0x1a40e2,_0x583f11,_0x24e010,_0x6d4750){const _0x4ef9f6=a15_0x28091d;return githubRequest(_0x4ef9f6(0xce)+_0x1a40e2+'/'+_0x583f11+_0x4ef9f6(0xca)+_0x24e010+_0x4ef9f6(0xdd),{'method':_0x4ef9f6(0xbf),'body':JSON[_0x4ef9f6(0xdb)]({'body':_0x6d4750})});}export async function createBranch(_0x2206ca,_0x43ad08,_0x1c6e44,_0x45d770=a15_0x28091d(0xc0)){const _0x17dbfd=a15_0x28091d,_0xc9ef42=await githubRequest(_0x17dbfd(0xce)+_0x2206ca+'/'+_0x43ad08+'/git/ref/heads/'+_0x45d770);return githubRequest(_0x17dbfd(0xce)+_0x2206ca+'/'+_0x43ad08+'/git/refs',{'method':_0x17dbfd(0xbf),'body':JSON[_0x17dbfd(0xdb)]({'ref':_0x17dbfd(0xcd)+_0x1c6e44,'sha':_0xc9ef42['object'][_0x17dbfd(0xd0)]})});}export async function getAppStatus(){const _0x1fde24=a15_0x28091d;try{const _0x322f67=await githubRequest(_0x1fde24(0xc1)),_0x2c76aa=_0x322f67[_0x1fde24(0xdc)];let _0x39b0da=_0x1fde24(0xc5);return _0x322f67[_0x1fde24(0xd3)]&&_0x322f67['repositories'][_0x1fde24(0xd1)]>0x0&&(_0x39b0da=_0x322f67[_0x1fde24(0xd3)][0x0][_0x1fde24(0xd5)][_0x1fde24(0xcf)]),{'valid':!![],'repoCount':_0x2c76aa,'accountName':_0x39b0da};}catch(_0x2d0ac0){throw _0x2d0ac0;}}
@@ -1,4 +0,0 @@
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>;
@@ -1 +0,0 @@
1
- const a16_0xa4fc44=a16_0x14b3;(function(_0x1517f4,_0x2341fa){const _0x53ab9e=a16_0x14b3,_0x416662=_0x1517f4();while(!![]){try{const _0x2a964e=parseInt(_0x53ab9e(0x124))/0x1+-parseInt(_0x53ab9e(0x131))/0x2+-parseInt(_0x53ab9e(0x128))/0x3*(-parseInt(_0x53ab9e(0x11b))/0x4)+parseInt(_0x53ab9e(0x11f))/0x5*(-parseInt(_0x53ab9e(0x12d))/0x6)+parseInt(_0x53ab9e(0x117))/0x7+-parseInt(_0x53ab9e(0x122))/0x8*(parseInt(_0x53ab9e(0x12e))/0x9)+parseInt(_0x53ab9e(0x123))/0xa;if(_0x2a964e===_0x2341fa)break;else _0x416662['push'](_0x416662['shift']());}catch(_0x36abd6){_0x416662['push'](_0x416662['shift']());}}}(a16_0x52d5,0x38db8));import{promises as a16_0x48dbc3}from'fs';function a16_0x14b3(_0x4a07e6,_0x5dcbc2){_0x4a07e6=_0x4a07e6-0x116;const _0x52d5bc=a16_0x52d5();let _0x14b3cc=_0x52d5bc[_0x4a07e6];return _0x14b3cc;}import{join}from'path';import{createAppAuth}from'@octokit/auth-app';import{homedir}from'os';const GLOBAL_CONFIG_DIR=join(homedir(),a16_0xa4fc44(0x12f)),CONFIG_FILE=join(GLOBAL_CONFIG_DIR,'github-app-config.json'),KEY_FILE=join(GLOBAL_CONFIG_DIR,a16_0xa4fc44(0x12c));let appAuth=null,installationToken=null;function a16_0x52d5(){const _0x9d8d0f=['then','550478ntmNTO','expiresAt','error','unlink','installationId','GitHub\x20App\x20not\x20configured.\x20Run\x20/github\x20setup','795424mghKMs','token','You\x20can\x20now\x20access\x20private\x20repositories','✓\x20GitHub\x20App\x20authenticated!','244tdvDxU','log','Error\x20clearing\x20session:','access','611215hppLRa','privateKey','utf8','24XhzYqf','4434780DBCBHb','156651ExBKto','installation','Run\x20/github\x20setup\x20to\x20configure\x20automatically','appId','846cPoWzW','readFile','Try\x20running\x20/github\x20setup\x20again','catch','github-app.pem','6WeDfdS','301779AoROUu','.woozlit'];a16_0x52d5=function(){return _0x9d8d0f;};return a16_0x52d5();}async function getGitHubAppConfig(){const _0x182443=a16_0xa4fc44;try{const _0x2f4c1d=await a16_0x48dbc3[_0x182443(0x11e)](CONFIG_FILE)[_0x182443(0x130)](()=>!![])[_0x182443(0x12b)](()=>![]),_0x2543c2=await a16_0x48dbc3[_0x182443(0x11e)](KEY_FILE)[_0x182443(0x130)](()=>!![])[_0x182443(0x12b)](()=>![]);if(!_0x2f4c1d||!_0x2543c2)return null;const _0x48cf5a=await a16_0x48dbc3[_0x182443(0x129)](CONFIG_FILE,'utf8'),{appId:_0x4e0210,installationId:_0x4955a5}=JSON['parse'](_0x48cf5a),_0x4e499f=await a16_0x48dbc3[_0x182443(0x129)](KEY_FILE,_0x182443(0x121));if(!_0x4e0210||!_0x4955a5||!_0x4e499f)return null;return{'appId':_0x4e0210,'privateKey':_0x4e499f,'installationId':_0x4955a5};}catch(_0x191c7b){return null;}}async function initAppAuth(){const _0x2c9a5b=a16_0xa4fc44;if(appAuth)return;const _0x260ddb=await getGitHubAppConfig();if(!_0x260ddb)throw new Error(_0x2c9a5b(0x116));appAuth=createAppAuth({'appId':_0x260ddb[_0x2c9a5b(0x127)],'privateKey':_0x260ddb[_0x2c9a5b(0x120)],'installationId':_0x260ddb[_0x2c9a5b(0x135)]});}async function getInstallationToken(){const _0x8c90f6=a16_0xa4fc44;await initAppAuth();if(installationToken&&installationToken[_0x8c90f6(0x132)]>new Date())return installationToken[_0x8c90f6(0x118)];const {token:_0x1c6511,expiresAt:_0x438f0c}=await appAuth({'type':_0x8c90f6(0x125)});return installationToken={'token':_0x1c6511,'expiresAt':new Date(_0x438f0c)},_0x1c6511;}export async function getGitHubToken(){const _0x457e2a=a16_0xa4fc44;try{return await getInstallationToken();}catch(_0x593c7b){return console[_0x457e2a(0x133)]('GitHub\x20App\x20auth\x20failed:',_0x593c7b),null;}}export async function isGitHubAuthenticated(){const _0x277265=await getGitHubAppConfig();return _0x277265!==null;}export async function loginGitHub(){const _0x1b50d6=a16_0xa4fc44,_0x3df2f6=await getGitHubAppConfig();if(!_0x3df2f6){console['log']('\x0a❌\x20GitHub\x20App\x20not\x20configured'),console['log'](_0x1b50d6(0x126));return;}try{const _0x1c6282=await getInstallationToken();console[_0x1b50d6(0x11c)](_0x1b50d6(0x11a)),console[_0x1b50d6(0x11c)](_0x1b50d6(0x119));}catch(_0x5a1e8c){console[_0x1b50d6(0x133)]('❌\x20Authentication\x20failed:',_0x5a1e8c),console[_0x1b50d6(0x11c)](_0x1b50d6(0x12a));}}export async function logoutGitHub(){const _0x1b856f=a16_0xa4fc44;try{await a16_0x48dbc3[_0x1b856f(0x134)](CONFIG_FILE)['catch'](()=>{}),await a16_0x48dbc3[_0x1b856f(0x134)](KEY_FILE)[_0x1b856f(0x12b)](()=>{}),installationToken=null,appAuth=null,console[_0x1b856f(0x11c)]('✓\x20GitHub\x20session\x20cleared');}catch(_0x54cbd1){console[_0x1b856f(0x133)](_0x1b856f(0x11d),_0x54cbd1);}}
@@ -1 +0,0 @@
1
- export declare function autoSetupGitHub(): Promise<void>;
@@ -1 +0,0 @@
1
- (function(_0x3f0466,_0x68d940){const _0x4df46d=a17_0x32b9,_0x4f271f=_0x3f0466();while(!![]){try{const _0x5bf383=-parseInt(_0x4df46d(0x172))/0x1*(parseInt(_0x4df46d(0x163))/0x2)+parseInt(_0x4df46d(0x190))/0x3+-parseInt(_0x4df46d(0x16d))/0x4+-parseInt(_0x4df46d(0x16f))/0x5*(-parseInt(_0x4df46d(0x177))/0x6)+-parseInt(_0x4df46d(0x17b))/0x7+-parseInt(_0x4df46d(0x17a))/0x8*(parseInt(_0x4df46d(0x174))/0x9)+-parseInt(_0x4df46d(0x180))/0xa*(-parseInt(_0x4df46d(0x153))/0xb);if(_0x5bf383===_0x68d940)break;else _0x4f271f['push'](_0x4f271f['shift']());}catch(_0x5b5f47){_0x4f271f['push'](_0x4f271f['shift']());}}}(a17_0x2078,0x5a499));import{promises as a17_0x418a72}from'fs';import{join}from'path';import*as a17_0x19a96f from'../ui/output.js';import{createServer}from'http';import a17_0x28a93e from'open';import{homedir}from'os';import{createAppAuth}from'@octokit/auth-app';import{input}from'@inquirer/prompts';async function createGitHubAppManifestFlow(){return new Promise(async(_0x3c059e,_0x50bb8e)=>{const _0xf38d=a17_0x32b9;let _0x4b2698=![];const _0x35933b=createServer(async(_0x54b6c6,_0x53c5bf)=>{const _0x42909d=a17_0x32b9;if(_0x54b6c6[_0x42909d(0x159)]===_0x42909d(0x173)){_0x53c5bf[_0x42909d(0x165)](0x194),_0x53c5bf[_0x42909d(0x17f)]();return;}a17_0x19a96f[_0x42909d(0x175)](_0x42909d(0x188)+_0x54b6c6[_0x42909d(0x18f)]+'\x20'+_0x54b6c6[_0x42909d(0x159)]);const _0x137414=new URL(_0x54b6c6[_0x42909d(0x159)]||'/',_0x42909d(0x182)),_0x49ae3e=_0x137414[_0x42909d(0x193)][_0x42909d(0x15f)]('code');_0x49ae3e?(_0x53c5bf[_0x42909d(0x165)](0xc8,{'Content-Type':_0x42909d(0x152)}),_0x53c5bf['end'](_0x42909d(0x145)),_0x53c5bf['destroy'](),!_0x4b2698&&(_0x4b2698=!![],_0x35933b[_0x42909d(0x192)](),_0x29017e(_0x49ae3e))):(_0x53c5bf[_0x42909d(0x165)](0x190),_0x53c5bf[_0x42909d(0x17f)](_0x42909d(0x15a)));}),_0x29017e=async _0xe1fbe0=>{const _0x5ecda2=a17_0x32b9;try{a17_0x19a96f[_0x5ecda2(0x18b)]('\x0aStep\x202:\x20Registering\x20GitHub\x20App...');const _0xc09043=await fetch(_0x5ecda2(0x14c)+_0xe1fbe0+_0x5ecda2(0x17d),{'method':_0x5ecda2(0x154),'headers':{'Accept':_0x5ecda2(0x18a)}});if(!_0xc09043['ok'])throw new Error(_0x5ecda2(0x156)+await _0xc09043[_0x5ecda2(0x15e)]());const _0x514445=await _0xc09043['json']();_0x3c059e(_0x514445);}catch(_0x5cfce4){_0x50bb8e(_0x5cfce4);}};_0x35933b[_0xf38d(0x155)](0xbb8,_0xf38d(0x148),async()=>{const _0x2464e1=_0xf38d,_0x434d03={'name':_0x2464e1(0x15d)+Date[_0x2464e1(0x158)](),'url':_0x2464e1(0x182),'hook_attributes':{'url':_0x2464e1(0x170)},'redirect_url':_0x2464e1(0x149),'public':![],'default_permissions':{'contents':'write','pull_requests':_0x2464e1(0x179),'metadata':_0x2464e1(0x14a)},'default_events':[]},_0x2579bb=new URLSearchParams({'manifest':JSON['stringify'](_0x434d03)}),_0x10a9f1=_0x2464e1(0x18e)+_0x2579bb['toString']();a17_0x19a96f['info'](_0x2464e1(0x18c)),a17_0x19a96f[_0x2464e1(0x175)](_0x2464e1(0x16e)+_0x10a9f1);try{await a17_0x28a93e(_0x10a9f1),a17_0x19a96f[_0x2464e1(0x14b)](_0x2464e1(0x162)),a17_0x19a96f[_0x2464e1(0x18b)]('\x0awaiting\x20for\x20browser\x20callback...'),a17_0x19a96f[_0x2464e1(0x175)](_0x2464e1(0x150));try{const _0x331dbf=await input({'message':_0x2464e1(0x151),'transformer':_0x3b1bc2=>_0x3b1bc2[_0x2464e1(0x16b)]()});_0x331dbf&&!_0x4b2698&&(_0x4b2698=!![],_0x35933b[_0x2464e1(0x192)](),_0x29017e(_0x331dbf));}catch(_0x4c8316){}}catch(_0x34f22b){a17_0x19a96f[_0x2464e1(0x14d)]('Failed\x20to\x20open\x20browser\x20automatically.'),a17_0x19a96f[_0x2464e1(0x18b)](_0x2464e1(0x15c)+_0x10a9f1);}}),_0x35933b['on'](_0xf38d(0x14d),_0x3f606a=>{const _0x552822=_0xf38d;a17_0x19a96f[_0x552822(0x14d)](_0x552822(0x176)+_0x3f606a),_0x50bb8e(_0x3f606a);});});}async function saveConfig(_0x7a8938,_0x51af01,_0x30eecd){const _0x5c5f28=a17_0x32b9,_0x27bdde=join(homedir(),_0x5c5f28(0x16a));try{await a17_0x418a72['access'](_0x27bdde);}catch{await a17_0x418a72[_0x5c5f28(0x181)](_0x27bdde,{'recursive':!![]});}const _0x48a8fe=join(_0x27bdde,_0x5c5f28(0x178)),_0x369f06=join(_0x27bdde,'github-app.pem');await a17_0x418a72[_0x5c5f28(0x166)](_0x369f06,_0x51af01,_0x5c5f28(0x15b)),await a17_0x418a72[_0x5c5f28(0x166)](_0x48a8fe,JSON[_0x5c5f28(0x189)]({'appId':_0x7a8938,'installationId':_0x30eecd},null,0x2),'utf8');}function a17_0x32b9(_0x5ef34f,_0x48387c){_0x5ef34f=_0x5ef34f-0x145;const _0x20789f=a17_0x2078();let _0x32b917=_0x20789f[_0x5ef34f];return _0x32b917;}async function installAppIfNeeded(_0x2bb48f){const _0xa6ea99=a17_0x32b9;a17_0x19a96f[_0xa6ea99(0x18b)](_0xa6ea99(0x185));const _0x1ce95d=createAppAuth({'appId':_0x2bb48f['id'],'privateKey':_0x2bb48f[_0xa6ea99(0x183)]});try{const {data:_0x2377f1}=await _0x1ce95d[_0xa6ea99(0x184)]((_0x3caef1,_0x3f4bec)=>_0x3caef1(_0x3f4bec),{'method':_0xa6ea99(0x191),'url':_0xa6ea99(0x161)});if(_0x2377f1&&_0x2377f1['length']>0x0)return _0x2377f1[0x0]['id'];}catch(_0x269814){}a17_0x19a96f[_0xa6ea99(0x18b)](_0xa6ea99(0x14f)),a17_0x19a96f[_0xa6ea99(0x18b)]('Please\x20install\x20the\x20app\x20on\x20your\x20account/repositories.');const _0x915759=_0x2bb48f[_0xa6ea99(0x186)]+_0xa6ea99(0x187);await a17_0x28a93e(_0x915759),a17_0x19a96f[_0xa6ea99(0x18b)](_0xa6ea99(0x147)+_0x915759),a17_0x19a96f[_0xa6ea99(0x18b)]('Press\x20Enter\x20after\x20you\x20have\x20installed\x20the\x20app...'),await new Promise(_0x25c4dd=>process['stdin'][_0xa6ea99(0x146)]('data',_0x25c4dd));const _0x8ca725=createAppAuth({'appId':_0x2bb48f['id'],'privateKey':_0x2bb48f['pem']}),{data:_0x3f5442}=await _0x8ca725[_0xa6ea99(0x184)]((_0x1e878f,_0x3c183f)=>_0x1e878f(_0x3c183f),{'method':'GET','url':'/app/installations'});if(_0x3f5442&&_0x3f5442[_0xa6ea99(0x14e)]>0x0)return _0x3f5442[0x0]['id'];throw new Error('Could\x20not\x20find\x20installation.\x20Please\x20try\x20again.');}function a17_0x2078(){const _0x532fdc=['App\x20Name:\x20','https://github.com/settings/apps/new?','method','1224213CEycRp','GET','close','searchParams','<h1>Setup\x20Complete!</h1><p>You\x20can\x20close\x20this\x20tab\x20and\x20return\x20to\x20the\x20terminal.</p>','once','Opened:\x20','127.0.0.1','http://127.0.0.1:3000/callback','read','success','https://api.github.com/app-manifests/','error','length','App\x20created\x20but\x20not\x20installed\x20yet.','(If\x20nothing\x20happens,\x20copy\x20the\x20\x22code\x22\x20parameter\x20from\x20the\x20browser\x20URL\x20address\x20bar\x20and\x20paste\x20it\x20below,\x20or\x20simply\x20press\x20Enter\x20to\x20start\x20manual\x20entry)','Paste\x20code\x20(or\x20wait\x20for\x20automatic\x20redirect):','text/html','3055580ziTBjQ','POST','listen','Failed\x20to\x20exchange\x20code:\x20','name','now','url','No\x20code\x20found','utf8','Please\x20visit\x20this\x20URL\x20manually:\x0a','Woozlit\x20CLI\x20','text','get','\x0a✓\x20GitHub\x20App\x20created!','/app/installations','Browser\x20opened!\x20Please\x20click\x20\x22Create\x20GitHub\x20App\x22\x20on\x20the\x20page.','79444EFVyPB','\x0a✓\x20GitHub\x20App\x20setup\x20complete!','writeHead','writeFile','header','✓\x20App\x20installed!','\x0aYou\x20can\x20try\x20manual\x20setup\x20with:\x20/github\x20manual','.woozlit','trim','exit','53256ZWgkDC','Url:\x20','534850gzMVjI','http://127.0.0.1:3000/webhook','\x0aStep\x204:\x20Saving\x20configuration...','6BDkbZj','/favicon.ico','738dAOfka','dim','Server\x20error:\x20','6cKYXsz','github-app-config.json','write','51488JGKyvy','1394162CRDCME','App\x20ID:\x20','/conversions','GitHub\x20App\x20Auto-Setup','end','30FuoRAO','mkdir','http://127.0.0.1:3000','pem','hook','\x0aStep\x203:\x20Checking\x20installation...','html_url','/installations/new','Received\x20request:\x20','stringify','application/vnd.github+json','info','Step\x201:\x20Opening\x20GitHub\x20to\x20create\x20App...'];a17_0x2078=function(){return _0x532fdc;};return a17_0x2078();}export async function autoSetupGitHub(){const _0x354ca7=a17_0x32b9;a17_0x19a96f[_0x354ca7(0x167)](_0x354ca7(0x17e)),a17_0x19a96f[_0x354ca7(0x175)]('This\x20will\x20create\x20a\x20GitHub\x20App\x20automatically\x20via\x20Manifest\x20Flow\x0a');try{const _0x46d7fc=await createGitHubAppManifestFlow();a17_0x19a96f[_0x354ca7(0x14b)](_0x354ca7(0x160));const _0x96cfd0=await installAppIfNeeded(_0x46d7fc);a17_0x19a96f[_0x354ca7(0x14b)](_0x354ca7(0x168)),a17_0x19a96f['info'](_0x354ca7(0x171)),await saveConfig(_0x46d7fc['id'],_0x46d7fc[_0x354ca7(0x183)],_0x96cfd0),a17_0x19a96f['success'](_0x354ca7(0x164)),a17_0x19a96f[_0x354ca7(0x175)](_0x354ca7(0x17c)+_0x46d7fc['id']),a17_0x19a96f[_0x354ca7(0x175)](_0x354ca7(0x18d)+_0x46d7fc[_0x354ca7(0x157)]),a17_0x19a96f['dim']('Configuration\x20saved\x20globally\x20to\x20~/.woozlit/'),a17_0x19a96f[_0x354ca7(0x14b)]('You\x20can\x20now\x20access\x20private\x20repositories!');}catch(_0x30e8d9){a17_0x19a96f[_0x354ca7(0x14d)]('\x0aSetup\x20failed:\x20'+_0x30e8d9),a17_0x19a96f[_0x354ca7(0x175)](_0x354ca7(0x169)),process[_0x354ca7(0x16c)](0x1);}}
@@ -1 +0,0 @@
1
- export declare function handleGitHubCommand(subCmd: string): Promise<void>;
@@ -1 +0,0 @@
1
- (function(_0x26efd1,_0x5d05e2){const _0x70d3bf=a18_0x4389,_0x3736a8=_0x26efd1();while(!![]){try{const _0x1813d3=-parseInt(_0x70d3bf(0x143))/0x1+parseInt(_0x70d3bf(0x114))/0x2+parseInt(_0x70d3bf(0x135))/0x3*(parseInt(_0x70d3bf(0x13e))/0x4)+parseInt(_0x70d3bf(0x122))/0x5*(-parseInt(_0x70d3bf(0x117))/0x6)+-parseInt(_0x70d3bf(0x11c))/0x7+-parseInt(_0x70d3bf(0x144))/0x8*(-parseInt(_0x70d3bf(0x13f))/0x9)+-parseInt(_0x70d3bf(0x134))/0xa;if(_0x1813d3===_0x5d05e2)break;else _0x3736a8['push'](_0x3736a8['shift']());}catch(_0x54b964){_0x3736a8['push'](_0x3736a8['shift']());}}}(a18_0x48da,0x7b42b));function a18_0x48da(){const _0x3c2bbd=['length','Installed\x20on\x20account:\x20','slice','1172hQCxYa','608445RQfzue','login','GitHub\x20Commands','\x20more','250009ZvcySy','104tgmyFw','1791476DoJNBa','(public)','repoCount','720342XhppeQ','accountName','status','(private)','info','4543980aGSVDw','Your\x20GitHub\x20Repositories','✓\x20Authenticated\x20as\x20GitHub\x20App','Fetching\x20repos...','\x20\x20/github\x20login\x20\x20\x20-\x20Test\x20GitHub\x20App\x20authentication','\x20\x20/github\x20logout\x20\x20-\x20Clear\x20GitHub\x20App\x20credentials','20dibeSm','private','\x20\x20/github\x20repos\x20\x20\x20-\x20List\x20your\x20repositories\x20(including\x20private)','header','full_name','createSpinner','error','\x20\x20/github\x20setup\x20\x20\x20-\x20Auto-create\x20GitHub\x20App\x20(recommended)','Not\x20logged\x20in.\x20Run\x20\x27/github\x20setup\x27\x20first','stop','\x20\x20...\x20and\x20','forEach','Access\x20to\x20','repos','dim','Token\x20may\x20be\x20invalid\x20or\x20app\x20has\x20no\x20repo\x20access:\x20','logout','config','7426880HgGAOm','8727BdFVaS','setup','warn','\x20repositories','start','manual'];a18_0x48da=function(){return _0x3c2bbd;};return a18_0x48da();}import*as a18_0x31391f from'../ui/output.js';import{loginGitHub,logoutGitHub,isGitHubAuthenticated}from'./auth.js';import{listRepos}from'./api.js';function a18_0x4389(_0x50d24a,_0x147c55){_0x50d24a=_0x50d24a-0x114;const _0x48dac1=a18_0x48da();let _0x4389a9=_0x48dac1[_0x50d24a];return _0x4389a9;}import{autoSetupGitHub}from'./auto-setup.js';import{manualSetupGitHub}from'./manual-setup.js';export async function handleGitHubCommand(_0x534532){const _0x1b6f29=a18_0x4389;if(_0x534532===_0x1b6f29(0x136)){await autoSetupGitHub();return;}if(_0x534532===_0x1b6f29(0x13a)||_0x534532===_0x1b6f29(0x133)){await manualSetupGitHub();return;}if(_0x534532===_0x1b6f29(0x140)){await loginGitHub();return;}if(_0x534532===_0x1b6f29(0x132)){await logoutGitHub();return;}if(_0x534532===_0x1b6f29(0x119)){const _0x5c3a2c=await isGitHubAuthenticated();if(_0x5c3a2c)try{const {getAppStatus:_0x332809}=await import('./api.js'),_0x544cdc=await _0x332809();a18_0x31391f['success'](_0x1b6f29(0x11e)),_0x544cdc[_0x1b6f29(0x118)]&&a18_0x31391f[_0x1b6f29(0x11b)](_0x1b6f29(0x13c)+_0x544cdc[_0x1b6f29(0x118)]),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x12e)+_0x544cdc[_0x1b6f29(0x116)]+_0x1b6f29(0x138));}catch(_0x28a331){a18_0x31391f[_0x1b6f29(0x137)](_0x1b6f29(0x131)+_0x28a331);}else a18_0x31391f['dim']('Not\x20logged\x20in\x20to\x20GitHub\x20App');return;}if(_0x534532===_0x1b6f29(0x12f)){const _0x30cede=await isGitHubAuthenticated();if(!_0x30cede){a18_0x31391f[_0x1b6f29(0x128)](_0x1b6f29(0x12a));return;}a18_0x31391f['header'](_0x1b6f29(0x11d));const _0x5a0d99=a18_0x31391f[_0x1b6f29(0x127)](_0x1b6f29(0x11f));_0x5a0d99[_0x1b6f29(0x139)]();try{const _0x29c9bf=await listRepos();_0x5a0d99['stop'](),_0x29c9bf[_0x1b6f29(0x13d)](0x0,0xa)[_0x1b6f29(0x12d)](_0x20f474=>{const _0x3bc22e=_0x1b6f29,_0x2a984c=_0x20f474[_0x3bc22e(0x123)]?_0x3bc22e(0x11a):_0x3bc22e(0x115);a18_0x31391f[_0x3bc22e(0x130)]('\x20\x20'+_0x20f474[_0x3bc22e(0x126)]+'\x20'+_0x2a984c);}),_0x29c9bf['length']>0xa&&a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x12c)+(_0x29c9bf[_0x1b6f29(0x13b)]-0xa)+_0x1b6f29(0x142));}catch(_0x319916){_0x5a0d99[_0x1b6f29(0x12b)](),a18_0x31391f['error']('Failed\x20to\x20fetch\x20repos:\x20'+_0x319916);}return;}a18_0x31391f[_0x1b6f29(0x125)](_0x1b6f29(0x141)),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x129)),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x120)),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x121)),a18_0x31391f[_0x1b6f29(0x130)]('\x20\x20/github\x20status\x20\x20-\x20Check\x20authentication\x20status'),a18_0x31391f[_0x1b6f29(0x130)](_0x1b6f29(0x124));}
@@ -1 +0,0 @@
1
- export declare function manualSetupGitHub(): Promise<void>;
@@ -1 +0,0 @@
1
- (function(_0x5903b6,_0x467947){const _0xaf3a71=a19_0x3715,_0x1b6b8f=_0x5903b6();while(!![]){try{const _0x5bb0a3=parseInt(_0xaf3a71(0x169))/0x1*(parseInt(_0xaf3a71(0x163))/0x2)+parseInt(_0xaf3a71(0x17a))/0x3+-parseInt(_0xaf3a71(0x16b))/0x4+-parseInt(_0xaf3a71(0x15e))/0x5*(parseInt(_0xaf3a71(0x16e))/0x6)+parseInt(_0xaf3a71(0x15b))/0x7+-parseInt(_0xaf3a71(0x15d))/0x8*(parseInt(_0xaf3a71(0x173))/0x9)+parseInt(_0xaf3a71(0x16d))/0xa;if(_0x5bb0a3===_0x467947)break;else _0x1b6b8f['push'](_0x1b6b8f['shift']());}catch(_0x373fa9){_0x1b6b8f['push'](_0x1b6b8f['shift']());}}}(a19_0x5ab1,0xc8270));function a19_0x5ab1(){const _0x676a3b=['mkdir','github-app-config.json','github-app.pem','length','writeFile','Private\x20Key\x20(PEM\x20format):','2056167UWNeFt','info','dim','success','.woozlit','210266istWfK','error','28144NmSOJs','4998055VYaGUP','\x0aFor\x20the\x20Private\x20Key,\x20your\x20default\x20editor\x20will\x20open.','stringify','BEGIN\x20PRIVATE\x20KEY','\x0aSetup\x20cancelled.','88318eKJZRa','includes','App\x20ID:','warn','utf8','To\x20verify,\x20run:\x20/github\x20status','23lsaRSF','Enter\x20your\x20existing\x20GitHub\x20App\x20credentials\x20manually.\x0a','6032008vVwTLO','access','29754090XXRFFa','6VLnGDf','App\x20ID\x20is\x20required','\x0aSaving\x20configuration...','Paste\x20the\x20entire\x20content\x20of\x20your\x20.pem\x20file,\x20save,\x20and\x20close.','force\x20closed','3528oYQZWB'];a19_0x5ab1=function(){return _0x676a3b;};return a19_0x5ab1();}function a19_0x3715(_0xc89b90,_0x41ae5b){_0xc89b90=_0xc89b90-0x158;const _0x5ab122=a19_0x5ab1();let _0x371514=_0x5ab122[_0xc89b90];return _0x371514;}import{promises as a19_0x402b96}from'fs';import{join}from'path';import*as a19_0x2d1e75 from'../ui/output.js';import{homedir}from'os';import{input,editor}from'@inquirer/prompts';async function saveConfig(_0x5b3779,_0x3cf235,_0x3d09d2){const _0x38b82f=a19_0x3715,_0x3fddd8=join(homedir(),_0x38b82f(0x15a));try{await a19_0x402b96[_0x38b82f(0x16c)](_0x3fddd8);}catch{await a19_0x402b96[_0x38b82f(0x174)](_0x3fddd8,{'recursive':!![]});}const _0x31b9da=join(_0x3fddd8,_0x38b82f(0x175)),_0x27f44e=join(_0x3fddd8,_0x38b82f(0x176));await a19_0x402b96[_0x38b82f(0x178)](_0x27f44e,_0x3cf235,_0x38b82f(0x167)),await a19_0x402b96[_0x38b82f(0x178)](_0x31b9da,JSON[_0x38b82f(0x160)]({'appId':_0x5b3779,'installationId':_0x3d09d2},null,0x2),_0x38b82f(0x167));}export async function manualSetupGitHub(){const _0x283de7=a19_0x3715;a19_0x2d1e75['header']('GitHub\x20App\x20Manual\x20Configuration'),a19_0x2d1e75['dim'](_0x283de7(0x16a));try{const _0x466c45=await input({'message':_0x283de7(0x165),'validate':_0x4a7e1a=>_0x4a7e1a[_0x283de7(0x177)]>0x0?!![]:_0x283de7(0x16f)});a19_0x2d1e75['info'](_0x283de7(0x15f)),a19_0x2d1e75[_0x283de7(0x17b)](_0x283de7(0x171)),await new Promise(_0x1eba67=>setTimeout(_0x1eba67,0x7d0));const _0x1eaa97=await editor({'message':_0x283de7(0x179),'validate':_0x2b1560=>_0x2b1560[_0x283de7(0x164)]('BEGIN\x20RSA\x20PRIVATE\x20KEY')||_0x2b1560[_0x283de7(0x164)](_0x283de7(0x161))?!![]:'Invalid\x20PEM\x20format'}),_0x3aba15=await input({'message':'Installation\x20ID:','validate':_0x1d2e5e=>_0x1d2e5e[_0x283de7(0x177)]>0x0?!![]:'Installation\x20ID\x20is\x20required'});a19_0x2d1e75[_0x283de7(0x17b)](_0x283de7(0x170)),await saveConfig(_0x466c45,_0x1eaa97,_0x3aba15),a19_0x2d1e75[_0x283de7(0x159)]('\x0a✓\x20Configuration\x20saved!'),a19_0x2d1e75[_0x283de7(0x158)](_0x283de7(0x168));}catch(_0x31cde8){if(_0x31cde8 instanceof Error&&_0x31cde8['message']['includes'](_0x283de7(0x172))){a19_0x2d1e75[_0x283de7(0x166)](_0x283de7(0x162));return;}a19_0x2d1e75[_0x283de7(0x15c)]('\x0aSetup\x20failed:\x20'+_0x31cde8);}}
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- const a20_0x206a81=a20_0x4654;(function(_0x712bb0,_0x455d56){const _0x3a15a2=a20_0x4654,_0x1c75a2=_0x712bb0();while(!![]){try{const _0x5ad497=parseInt(_0x3a15a2(0x95))/0x1+-parseInt(_0x3a15a2(0xc0))/0x2*(parseInt(_0x3a15a2(0xe9))/0x3)+parseInt(_0x3a15a2(0xae))/0x4+-parseInt(_0x3a15a2(0x8e))/0x5*(-parseInt(_0x3a15a2(0x9b))/0x6)+-parseInt(_0x3a15a2(0xf5))/0x7*(parseInt(_0x3a15a2(0xb2))/0x8)+parseInt(_0x3a15a2(0xfa))/0x9*(parseInt(_0x3a15a2(0x8a))/0xa)+parseInt(_0x3a15a2(0xc7))/0xb*(parseInt(_0x3a15a2(0x98))/0xc);if(_0x5ad497===_0x455d56)break;else _0x1c75a2['push'](_0x1c75a2['shift']());}catch(_0x270d7d){_0x1c75a2['push'](_0x1c75a2['shift']());}}}(a20_0x24a7,0xa4976));import{Command}from'commander';import a20_0x285d48 from'chalk';function a20_0x4654(_0x36c6a3,_0x59f890){_0x36c6a3=_0x36c6a3-0x7a;const _0x24a7a2=a20_0x24a7();let _0x465442=_0x24a7a2[_0x36c6a3];return _0x465442;}import{login,logout,isLoggedIn}from'./auth/login.js';import{startChat}from'./chat/agent.js';import{selectModel,getSelectedModel}from'./ui/select.js';import{listRules,addRule,clearRules}from'./tools/rules.js';import{listKnowledge,addKnowledge,clearKnowledge}from'./tools/knowledge.js';import{getUser}from'./utils/storage.js';function a20_0x24a7(){const _0x42f516=['\x27\x20not\x20found','running','remove\x20<name>','Current\x20User','delete-all','aliases','Added\x20stdio\x20MCP\x20server:\x20','Woozlit\x20already\x20initialized\x20in\x20this\x20directory','startAllConfigured','Show\x20current\x20user\x20info','createSpinner','bold','Are\x20you\x20sure\x20you\x20want\x20to\x20completely\x20WIPE\x20all\x20CLI\x20data,\x20rules,\x20and\x20configs?','stdout','version','action','discord','Model:\x20','Select\x20UI\x20theme\x20(alias\x20for\x20config\x20theme)','Show\x20status\x20of\x20background\x20services/bots','No\x20services\x20registered.','refresh','All\x20MCP\x20servers\x20removed','theme','name','Login\x20with\x20your\x20Woozlit\x20account','./utils/updater.js','Added\x20HTTP\x20MCP\x20server:\x20','email','22330OxeiFp','command','List\x20all\x20rules','info','75fjfjXw','description','Initialize\x20Woozlit\x20in\x20current\x20directory','Login\x20failed\x20or\x20timed\x20out','Not\x20logged\x20in.\x20Use\x20\x27woozlit\x20login\x27\x20to\x20authenticate.','logout','N/A','224191lRaSBE','All\x20data,\x20configs,\x20and\x20MCP\x20servers\x20have\x20been\x20wiped.','join','12qjMoba','Manage\x20Telegram\x20integration','type','171438dzcjBG','keys','./services/bot-manager.js','./discord/index.js','forEach','Running','Manage\x20MCP\x20servers','Manage\x20AI\x20knowledge\x20presets','Already\x20logged\x20in\x20as\x20','List\x20all\x20MCP\x20servers','update','Remove\x20an\x20MCP\x20server','remove-all','length',':\x20[stdio]\x20','green','clean','configured','You\x20can\x20also\x20add\x20servers\x20via\x20mcp.json\x20in\x20your\x20project\x20directory','2831916xXXdvF','./github/index.js','All\x20rules\x20cleared','Rules','8jiLwRl','init','\x0aConfig\x20file:\x20','Knowledge\x20Presets','env','.woozlit/rules.md','Select\x20AI\x20model','showLogo','wipe','URL:\x20','list','some','displayName','Created\x20.woozlit/rules.md\x20and\x20.woozlit/context.md','2bVWPkr','Default\x20servers\x20will\x20be\x20restored\x20on\x20next\x20restart\x20unless\x20you\x20remove\x20them\x20again.','Initialized\x20Woozlit\x20in\x20current\x20directory','header','Update\x20Woozlit\x20CLI\x20to\x20the\x20latest\x20version','dim','Stopped','132121VvAzKZ','getStatus','No\x20knowledge\x20presets\x20defined','Please\x20restart\x20the\x20CLI.','parse','Add\x20a\x20stdio\x20MCP\x20server','Added\x20knowledge\x20preset:\x20','Name:\x20','Waiting\x20for\x20authentication...','knowledge','Add\x20a\x20new\x20knowledge\x20preset','Opening\x20browser\x20for\x20login...','Add\x20a\x20new\x20rule','Logout\x20from\x20your\x20Woozlit\x20account','clear','You\x20can\x20also\x20update\x20manually\x20from\x20https://cli.woozlit.com','List\x20all\x20knowledge\x20presets','catch','No\x20MCP\x20servers\x20configured','Woozlit\x20AI\x20-\x20Agentic\x20Coding\x20Assistant','MCP\x20server\x20\x27','Configure\x20email\x20credentials','./utils/storage.js','start','telegram','delete','stop','args','write','chat\x20[message]','Not\x20Configured','Remove\x20all\x20MCP\x20servers','services','ask\x20<message>','2225766RJaJfS','add\x20<rule>','.woozlit','Added\x20rule:\x20','success','github\x20[subcmd]','No\x20rules\x20defined','add\x20<name>\x20<command>\x20[args...]','Theme\x20set\x20to:\x20','rules','error','Email:\x20','8965999oasNag','./ui/themes.js','woozlit','Refresh\x20cancelled.','Manage\x20Email\x20integration','5337hNNlUM','Manage\x20AI\x20behavior\x20rules','Operation\x20cancelled','Config\x20file:\x20','setup','./email/index.js','add-http\x20<name>\x20<url>','Logged\x20in\x20as\x20','You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.','Logged\x20out\x20successfully','warn'];a20_0x24a7=function(){return _0x42f516;};return a20_0x24a7();}import{addMcpServer,addMcpHttpServer,removeMcpServer,clearMcpServers,getMcpServers,ensureDefaultServers,getConfigFilePath}from'./config/mcp.js';import{createFile,listDirectory}from'./tools/file.js';import*as a20_0x5e5bb0 from'./ui/output.js';const VERSION='2.2.0',program=new Command();process[a20_0x206a81(0xb6)]['NODE_TLS_REJECT_UNAUTHORIZED']='0',program[a20_0x206a81(0x85)](a20_0x206a81(0xf7))[a20_0x206a81(0x8f)](a20_0x206a81(0xda))[a20_0x206a81(0x7b)](VERSION)[a20_0x206a81(0x7c)](async()=>{const _0x37176e=a20_0x206a81;ensureDefaultServers();const {botManager:_0x3c84a7}=await import('./services/bot-manager.js');await _0x3c84a7[_0x37176e(0x10d)]();const {checkForUpdates:_0xedebd5}=await import(_0x37176e(0x87));_0xedebd5(VERSION)[_0x37176e(0xd8)](()=>{}),a20_0x5e5bb0[_0x37176e(0xb9)](VERSION);if(!isLoggedIn()){a20_0x5e5bb0[_0x37176e(0x104)](_0x37176e(0x102)),a20_0x5e5bb0[_0x37176e(0xc5)](''),a20_0x5e5bb0['info'](_0x37176e(0xd2));const _0x5d6564=a20_0x5e5bb0[_0x37176e(0x10f)](_0x37176e(0xcf));_0x5d6564['start']();const _0x5609d3=await login();_0x5d6564[_0x37176e(0xe1)]();if(!_0x5609d3){a20_0x5e5bb0['error'](_0x37176e(0x91));return;}const _0x5f5db4=getUser();a20_0x5e5bb0[_0x37176e(0xed)]('Logged\x20in\x20as\x20'+(_0x5f5db4[_0x37176e(0xbe)]||_0x5f5db4[_0x37176e(0x89)]));}await startChat();}),program[a20_0x206a81(0x8b)]('login')[a20_0x206a81(0x8f)](a20_0x206a81(0x86))[a20_0x206a81(0x7c)](async()=>{const _0x1aff73=a20_0x206a81;if(isLoggedIn()){const _0xd2902c=getUser();a20_0x5e5bb0[_0x1aff73(0x8d)](_0x1aff73(0xa3)+_0xd2902c[_0x1aff73(0x89)]);return;}a20_0x5e5bb0[_0x1aff73(0x8d)](_0x1aff73(0xd2));const _0x1e75e5=a20_0x5e5bb0[_0x1aff73(0x10f)](_0x1aff73(0xcf));_0x1e75e5[_0x1aff73(0xde)]();const _0x131202=await login();_0x1e75e5[_0x1aff73(0xe1)]();if(_0x131202){const _0x12042e=getUser();a20_0x5e5bb0['success']('Logged\x20in\x20as\x20'+(_0x12042e[_0x1aff73(0xbe)]||_0x12042e[_0x1aff73(0x89)]));}else a20_0x5e5bb0['error'](_0x1aff73(0x91));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0x93))[a20_0x206a81(0x8f)](a20_0x206a81(0xd4))['action'](()=>{const _0x25570c=a20_0x206a81;logout(),a20_0x5e5bb0[_0x25570c(0xed)](_0x25570c(0x103));}),program[a20_0x206a81(0x8b)]('whoami')['description'](a20_0x206a81(0x10e))['action'](()=>{const _0x1997b2=a20_0x206a81;if(!isLoggedIn()){a20_0x5e5bb0[_0x1997b2(0x104)](_0x1997b2(0x92));return;}const _0x42d635=getUser();a20_0x5e5bb0[_0x1997b2(0xc3)](_0x1997b2(0x108)),a20_0x5e5bb0[_0x1997b2(0x8d)](_0x1997b2(0xce)+(_0x42d635[_0x1997b2(0xbe)]||'N/A')),a20_0x5e5bb0[_0x1997b2(0x8d)](_0x1997b2(0xf4)+(_0x42d635[_0x1997b2(0x89)]||_0x1997b2(0x94))),a20_0x5e5bb0[_0x1997b2(0x8d)](_0x1997b2(0x7e)+getSelectedModel());}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xe4))[a20_0x206a81(0x8f)]('Start\x20an\x20AI\x20chat\x20session')[a20_0x206a81(0x7c)](async _0x55bdcc=>{const _0x401ee4=a20_0x206a81;a20_0x5e5bb0[_0x401ee4(0xb9)](VERSION);if(!isLoggedIn()){a20_0x5e5bb0[_0x401ee4(0x104)](_0x401ee4(0x102)),a20_0x5e5bb0[_0x401ee4(0xc5)](''),a20_0x5e5bb0[_0x401ee4(0x8d)](_0x401ee4(0xd2));const _0x282f96=a20_0x5e5bb0[_0x401ee4(0x10f)]('Waiting\x20for\x20authentication...');_0x282f96[_0x401ee4(0xde)]();const _0x4f0eed=await login();_0x282f96[_0x401ee4(0xe1)]();if(!_0x4f0eed){a20_0x5e5bb0[_0x401ee4(0xf3)](_0x401ee4(0x91));return;}const _0x5d90dc=getUser();a20_0x5e5bb0[_0x401ee4(0xed)]('Logged\x20in\x20as\x20'+(_0x5d90dc[_0x401ee4(0xbe)]||_0x5d90dc[_0x401ee4(0x89)]));}await startChat(_0x55bdcc);}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xe8))[a20_0x206a81(0x8f)]('Ask\x20a\x20single\x20question')[a20_0x206a81(0x7c)](async _0x2a3496=>{const _0x5204ee=a20_0x206a81;a20_0x5e5bb0['showLogo'](VERSION);if(!isLoggedIn()){a20_0x5e5bb0['warn'](_0x5204ee(0x102)),a20_0x5e5bb0[_0x5204ee(0xc5)](''),a20_0x5e5bb0['info'](_0x5204ee(0xd2));const _0x33abf7=a20_0x5e5bb0[_0x5204ee(0x10f)](_0x5204ee(0xcf));_0x33abf7[_0x5204ee(0xde)]();const _0xb0b640=await login();_0x33abf7[_0x5204ee(0xe1)]();if(!_0xb0b640){a20_0x5e5bb0['error'](_0x5204ee(0x91));return;}const _0x30ebe4=getUser();a20_0x5e5bb0[_0x5204ee(0xed)](_0x5204ee(0x101)+(_0x30ebe4[_0x5204ee(0xbe)]||_0x30ebe4[_0x5204ee(0x89)]));}await startChat(_0x2a3496);});const configCmd=program[a20_0x206a81(0x8b)]('config')[a20_0x206a81(0x8f)]('Configure\x20CLI\x20settings');configCmd[a20_0x206a81(0x8b)]('model')[a20_0x206a81(0x8f)](a20_0x206a81(0xb8))['action'](async()=>{const _0x32eaab=a20_0x206a81,_0x2559d0=await selectModel();a20_0x5e5bb0[_0x32eaab(0xed)]('Model\x20set\x20to:\x20'+_0x2559d0);}),configCmd['command'](a20_0x206a81(0x84))[a20_0x206a81(0x8f)]('Select\x20UI\x20theme')[a20_0x206a81(0x7c)](async()=>{const _0x5cb413=a20_0x206a81,{selectTheme:_0x3c85fe}=await import(_0x5cb413(0xf6)),_0x539d28=await _0x3c85fe();a20_0x5e5bb0['success'](_0x5cb413(0xf1)+_0x539d28);}),program[a20_0x206a81(0x8b)](a20_0x206a81(0x84))[a20_0x206a81(0x8f)](a20_0x206a81(0x7f))[a20_0x206a81(0x7c)](async()=>{const _0x56ab68=a20_0x206a81,{selectTheme:_0x5ea87e}=await import(_0x56ab68(0xf6)),_0x553596=await _0x5ea87e();a20_0x5e5bb0[_0x56ab68(0xed)](_0x56ab68(0xf1)+_0x553596);});const rulesCmd=program[a20_0x206a81(0x8b)](a20_0x206a81(0xf2))['description'](a20_0x206a81(0xfb));rulesCmd['command'](a20_0x206a81(0xbc))['description'](a20_0x206a81(0x8c))[a20_0x206a81(0x7c)](()=>{const _0x2b9049=a20_0x206a81,_0x324a3e=listRules();if(_0x324a3e[_0x2b9049(0xa8)]===0x0){a20_0x5e5bb0['info'](_0x2b9049(0xef));return;}a20_0x5e5bb0[_0x2b9049(0xc3)](_0x2b9049(0xb1)),_0x324a3e[_0x2b9049(0x9f)]((_0x3eb18c,_0x5900dd)=>{const _0x1257cf=_0x2b9049;process[_0x1257cf(0x7a)][_0x1257cf(0xe3)](_0x5900dd+0x1+'.\x20'+_0x3eb18c+'\x0a');});}),rulesCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xea))[a20_0x206a81(0x8f)](a20_0x206a81(0xd3))['action'](_0x29a159=>{const _0x3cfea0=a20_0x206a81;addRule(_0x29a159),a20_0x5e5bb0[_0x3cfea0(0xed)](_0x3cfea0(0xec)+_0x29a159);})[a20_0x206a81(0x7c)](()=>{const _0x25a880=a20_0x206a81;clearRules(),a20_0x5e5bb0[_0x25a880(0xed)](_0x25a880(0xb0));});const knowledgeCmd=program[a20_0x206a81(0x8b)](a20_0x206a81(0xd0))[a20_0x206a81(0x8f)](a20_0x206a81(0xa2));knowledgeCmd['command'](a20_0x206a81(0xbc))['description'](a20_0x206a81(0xd7))[a20_0x206a81(0x7c)](()=>{const _0xe8b8f=a20_0x206a81,_0xebf3fd=listKnowledge();if(_0xebf3fd[_0xe8b8f(0xa8)]===0x0){a20_0x5e5bb0[_0xe8b8f(0x8d)](_0xe8b8f(0xc9));return;}a20_0x5e5bb0[_0xe8b8f(0xc3)](_0xe8b8f(0xb5)),_0xebf3fd['forEach']((_0x3377ae,_0x5069b7)=>{const _0x967e5e=_0xe8b8f;process[_0x967e5e(0x7a)]['write'](_0x5069b7+0x1+'.\x20'+_0x3377ae+'\x0a');});}),knowledgeCmd[a20_0x206a81(0x8b)]('add\x20<preset>')[a20_0x206a81(0x8f)](a20_0x206a81(0xd1))[a20_0x206a81(0x7c)](_0x1a91e4=>{const _0x2baf81=a20_0x206a81;addKnowledge(_0x1a91e4),a20_0x5e5bb0[_0x2baf81(0xed)](_0x2baf81(0xcd)+_0x1a91e4);}),knowledgeCmd['command'](a20_0x206a81(0xd5))[a20_0x206a81(0x8f)]('Clear\x20all\x20knowledge\x20presets')['action'](()=>{const _0x5e7d89=a20_0x206a81;clearKnowledge(),a20_0x5e5bb0[_0x5e7d89(0xed)]('All\x20knowledge\x20presets\x20cleared');});const mcpCmd=program['command']('mcp')[a20_0x206a81(0x8f)](a20_0x206a81(0xa1));mcpCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xbc))[a20_0x206a81(0x8f)](a20_0x206a81(0xa4))[a20_0x206a81(0x7c)](()=>{const _0x48d45b=a20_0x206a81,_0x22abcf=getMcpServers(),_0x26a3ba=Object[_0x48d45b(0x9c)](_0x22abcf);if(_0x26a3ba['length']===0x0){a20_0x5e5bb0['info'](_0x48d45b(0xd9)),a20_0x5e5bb0[_0x48d45b(0xc5)](_0x48d45b(0xfd)+getConfigFilePath());return;}a20_0x5e5bb0[_0x48d45b(0xc3)]('MCP\x20Servers'),_0x26a3ba[_0x48d45b(0x9f)](_0x3592b3=>{const _0x224087=_0x48d45b,_0x36bd8a=_0x22abcf[_0x3592b3];_0x36bd8a[_0x224087(0x9a)]==='streamable-http'?a20_0x5e5bb0[_0x224087(0x8d)]('-\x20'+_0x3592b3+':\x20[HTTP]\x20'+_0x36bd8a['url']):a20_0x5e5bb0[_0x224087(0x8d)]('-\x20'+_0x3592b3+_0x224087(0xa9)+_0x36bd8a[_0x224087(0x8b)]+'\x20'+(_0x36bd8a[_0x224087(0xe2)]?.[_0x224087(0x97)]('\x20')||''));}),a20_0x5e5bb0[_0x48d45b(0xc5)](_0x48d45b(0xb4)+getConfigFilePath()),a20_0x5e5bb0[_0x48d45b(0xc5)](_0x48d45b(0xad));}),mcpCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xf0))['description'](a20_0x206a81(0xcc))[a20_0x206a81(0x7c)]((_0x3e9ba7,_0x44cd0f,_0x7ae946)=>{const _0x5202ad=a20_0x206a81;addMcpServer(_0x3e9ba7,_0x44cd0f,_0x7ae946),a20_0x5e5bb0[_0x5202ad(0xed)](_0x5202ad(0x10b)+_0x3e9ba7);}),mcpCmd[a20_0x206a81(0x8b)](a20_0x206a81(0x100))[a20_0x206a81(0x8f)]('Add\x20an\x20HTTP\x20MCP\x20server\x20(streamable-http)')[a20_0x206a81(0x7c)]((_0x10739f,_0x42bb68)=>{const _0x58abd0=a20_0x206a81;addMcpHttpServer(_0x10739f,_0x42bb68),a20_0x5e5bb0['success'](_0x58abd0(0x88)+_0x10739f),a20_0x5e5bb0[_0x58abd0(0xc5)](_0x58abd0(0xbb)+_0x42bb68);}),mcpCmd['command'](a20_0x206a81(0x107))[a20_0x206a81(0x10a)]([a20_0x206a81(0xe0),'rm'])['description'](a20_0x206a81(0xa6))[a20_0x206a81(0x7c)](_0x28a142=>{const _0x50e41c=a20_0x206a81;removeMcpServer(_0x28a142)?a20_0x5e5bb0[_0x50e41c(0xed)]('Removed\x20MCP\x20server:\x20'+_0x28a142):a20_0x5e5bb0['error'](_0x50e41c(0xdb)+_0x28a142+_0x50e41c(0x105));}),mcpCmd['command'](a20_0x206a81(0xa7))['aliases']([a20_0x206a81(0x109),a20_0x206a81(0xd5)])[a20_0x206a81(0x8f)](a20_0x206a81(0xe6))['action'](async()=>{const _0x3be57d=a20_0x206a81,{confirm:_0x5e3829}=await import('@inquirer/prompts'),{getTheme:_0x1ceee3}=await import(_0x3be57d(0xdd)),{getInquirerTheme:_0x410b6a}=await import(_0x3be57d(0xf6)),_0x240a8d=await _0x5e3829({'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20ALL\x20MCP\x20servers?','default':![],'theme':_0x410b6a(_0x1ceee3())});_0x240a8d?(clearMcpServers(),a20_0x5e5bb0[_0x3be57d(0xed)](_0x3be57d(0x83)),a20_0x5e5bb0[_0x3be57d(0xc5)](_0x3be57d(0xc1))):a20_0x5e5bb0[_0x3be57d(0x8d)](_0x3be57d(0xfc));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0x82))[a20_0x206a81(0x10a)](['reset',a20_0x206a81(0xba),a20_0x206a81(0xab)])[a20_0x206a81(0x8f)]('Wipe\x20all\x20data,\x20rules,\x20settings,\x20and\x20MCP\x20configs')[a20_0x206a81(0x7c)](async()=>{const _0x1c7766=a20_0x206a81,{confirm:_0x2fa8fb}=await import('@inquirer/prompts'),{getTheme:_0x53e42b}=await import('./utils/storage.js'),{getInquirerTheme:_0x47355c}=await import(_0x1c7766(0xf6)),_0x82ef4a=_0x53e42b(),_0x173765=_0x47355c(_0x82ef4a),_0x1d1906=await _0x2fa8fb({'message':a20_0x285d48[_0x1c7766(0x110)](_0x1c7766(0x111)),'default':![],'theme':_0x173765});if(_0x1d1906){const {wipeAll:_0x52de7e}=await import(_0x1c7766(0xdd));_0x52de7e();try{const {clearMcpServers:_0x312422}=await import('./config/mcp.js');_0x312422();}catch(_0x19a618){}a20_0x5e5bb0[_0x1c7766(0xed)](_0x1c7766(0x96)),a20_0x5e5bb0[_0x1c7766(0xc5)](_0x1c7766(0xca));}else a20_0x5e5bb0[_0x1c7766(0x8d)](_0x1c7766(0xf8));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xb3))['description'](a20_0x206a81(0x90))['action'](()=>{const _0x2a9de8=a20_0x206a81,_0x394fd5=listDirectory('.'),_0x2d4880=_0x394fd5['entries']?.[_0x2a9de8(0xbd)](_0xe9194e=>_0xe9194e[_0x2a9de8(0x85)]===_0x2a9de8(0xeb));if(_0x2d4880){a20_0x5e5bb0[_0x2a9de8(0x104)](_0x2a9de8(0x10c));return;}createFile(_0x2a9de8(0xb7),'#\x20Project\x20Rules\x0a\x0aAdd\x20your\x20project-specific\x20rules\x20here.\x0a'),createFile('.woozlit/context.md','#\x20Project\x20Context\x0a\x0aDescribe\x20your\x20project\x20here.\x0a'),a20_0x5e5bb0[_0x2a9de8(0xed)](_0x2a9de8(0xc2)),a20_0x5e5bb0[_0x2a9de8(0xc5)](_0x2a9de8(0xbf));}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xe7))['description'](a20_0x206a81(0x80))[a20_0x206a81(0x7c)](async()=>{const _0x4df6f6=a20_0x206a81,{botManager:_0x482654}=await import(_0x4df6f6(0x9d)),_0x313493=_0x482654[_0x4df6f6(0xc8)]();a20_0x5e5bb0[_0x4df6f6(0xc3)]('Background\x20Services');if(_0x313493[_0x4df6f6(0xa8)]===0x0){a20_0x5e5bb0[_0x4df6f6(0x8d)](_0x4df6f6(0x81));return;}_0x313493[_0x4df6f6(0x9f)](_0x2985e5=>{const _0x440ea1=_0x4df6f6,_0x10b7a5=_0x2985e5[_0x440ea1(0x106)]?a20_0x285d48[_0x440ea1(0xaa)](_0x440ea1(0xa0)):_0x2985e5[_0x440ea1(0xac)]?a20_0x285d48['yellow'](_0x440ea1(0xc6)):a20_0x285d48['gray'](_0x440ea1(0xe5));a20_0x5e5bb0['info']('-\x20'+_0x2985e5[_0x440ea1(0x85)]+':\x20'+_0x10b7a5);}),a20_0x5e5bb0['dim']('\x0aUse\x20\x27woozlit\x20<service>\x20setup\x27\x20to\x20configure\x20services.');});const discordCmd=program['command'](a20_0x206a81(0x7d))['description']('Manage\x20Discord\x20integration');discordCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xfe))[a20_0x206a81(0x8f)]('Configure\x20Discord\x20Bot\x20Token')[a20_0x206a81(0x7c)](async()=>{const _0x1f87e7=a20_0x206a81,{setupDiscord:_0x23cdd7}=await import(_0x1f87e7(0x9e));await _0x23cdd7();});const githubCmd=program[a20_0x206a81(0x8b)](a20_0x206a81(0xee))['description']('Manage\x20GitHub\x20tool\x20integration')[a20_0x206a81(0x7c)](async _0x24f187=>{const _0x2d3e38=a20_0x206a81,{handleGitHubCommand:_0x657ff9}=await import(_0x2d3e38(0xaf));await _0x657ff9(_0x24f187||'');}),telegramCmd=program['command'](a20_0x206a81(0xdf))['description'](a20_0x206a81(0x99));telegramCmd['command'](a20_0x206a81(0xfe))['description']('Configure\x20Telegram\x20Bot\x20Token')[a20_0x206a81(0x7c)](async()=>{const {setupTelegram:_0x243352}=await import('./telegram/index.js');await _0x243352();});const emailCmd=program['command'](a20_0x206a81(0x89))[a20_0x206a81(0x8f)](a20_0x206a81(0xf9));emailCmd[a20_0x206a81(0x8b)](a20_0x206a81(0xfe))[a20_0x206a81(0x8f)](a20_0x206a81(0xdc))[a20_0x206a81(0x7c)](async()=>{const _0x320500=a20_0x206a81,{setupEmail:_0x4093c8}=await import(_0x320500(0xff));await _0x4093c8();}),program[a20_0x206a81(0x8b)](a20_0x206a81(0xa5))['description'](a20_0x206a81(0xc4))[a20_0x206a81(0x7c)](async()=>{const _0x43b333=a20_0x206a81,{performUpdate:_0x4eb21d}=await import(_0x43b333(0x87)),_0xa8e51e=await _0x4eb21d();!_0xa8e51e&&a20_0x5e5bb0[_0x43b333(0xc5)](_0x43b333(0xd6));}),program[a20_0x206a81(0xcb)]();
@@ -1 +0,0 @@
1
- export {};