woozlit 2.0.4 → 2.1.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.
- package/dist/auth/login.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/server.js +1 -1
- package/dist/browser/tools.js +1 -1
- package/dist/chat/agent.js +1 -1
- package/dist/config/mcp.js +1 -1
- package/dist/config/settings.js +1 -1
- package/dist/discord/client.js +1 -1
- package/dist/discord/config.js +1 -1
- package/dist/discord/index.js +1 -1
- package/dist/discord/setup.js +1 -1
- package/dist/email/config.js +1 -1
- package/dist/email/index.js +1 -1
- package/dist/email/service.js +1 -1
- package/dist/email/setup.js +1 -1
- package/dist/github/api.js +1 -1
- package/dist/github/auth.js +1 -1
- package/dist/github/auto-setup.js +1 -1
- package/dist/github/index.js +1 -1
- package/dist/github/manual-setup.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-servers/computer-use.js +1 -1
- package/dist/services/bot-manager.js +1 -1
- package/dist/services/voice-agent.js +1 -1
- package/dist/telegram/bot.js +1 -1
- package/dist/telegram/config.js +1 -1
- package/dist/telegram/index.js +1 -1
- package/dist/telegram/reminders.js +1 -1
- package/dist/telegram/setup.js +1 -1
- package/dist/tools/command.js +1 -1
- package/dist/tools/file.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/mcp.js +1 -1
- package/dist/tools/rollback.js +1 -1
- package/dist/tools/rules.js +1 -1
- package/dist/twilio/config.js +1 -1
- package/dist/twilio/index.js +1 -1
- package/dist/twilio/server.js +1 -1
- package/dist/twilio/setup.js +1 -1
- package/dist/ui/output.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/ui/themes.js +1 -1
- package/dist/utils/api.js +1 -1
- package/dist/utils/chat-history.d.ts +15 -0
- package/dist/utils/chat-history.js +1 -0
- package/dist/utils/history.js +1 -1
- package/dist/utils/mcp-installer.js +1 -1
- package/dist/utils/platform.js +1 -1
- package/dist/utils/storage.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/dist/verify_repro.js +1 -1
- package/package.json +1 -1
package/dist/auth/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x4645e1,_0x46e734){const _0x5c600a=a0_0x5249,_0x568023=_0x4645e1();while(!![]){try{const _0x52ec6d=-parseInt(_0x5c600a(0x1a8))/0x1*(parseInt(_0x5c600a(0x1a0))/0x2)+parseInt(_0x5c600a(0x1a4))/0x3+parseInt(_0x5c600a(0x195))/0x4*(parseInt(_0x5c600a(0x1a2))/0x5)+parseInt(_0x5c600a(0x1ac))/0x6+-parseInt(_0x5c600a(0x1ad))/0x7*(parseInt(_0x5c600a(0x1a5))/0x8)+parseInt(_0x5c600a(0x192))/0x9*(parseInt(_0x5c600a(0x19b))/0xa)+parseInt(_0x5c600a(0x193))/0xb*(parseInt(_0x5c600a(0x1a7))/0xc);if(_0x52ec6d===_0x46e734)break;else _0x568023['push'](_0x568023['shift']());}catch(_0x394363){_0x568023['push'](_0x568023['shift']());}}}(a0_0x1691,0x26296));import a0_0x488a40 from'open';import{createServer}from'http';function a0_0x1691(){const _0x5808d2=['520539XFIBFU','29360ZhkGzC','http://localhost:','71088ztcQCS','279298ZlbeJq','userId','writeHead','close','1516104SgzzNi','511DPGomA','get','url','33021iuaHoO','374THmMbw','text/html','215564lctZNq','/callback','listen','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<!DOCTYPE\x20html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<title>Woozlit\x20CLI</title>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\x20system-ui,\x20-apple-system,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20100vh;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20#0a0a0a;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20#fff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.container\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x202rem;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20h1\x20{\x20color:\x20#10b981;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20p\x20{\x20color:\x20#9ca3af;\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</style>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22container\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h1>Login\x20Successful</h1>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','email','token','60nedluH','end','displayName','pathname','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<!DOCTYPE\x20html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<head><title>Woozlit\x20CLI</title></head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<body\x20style=\x22font-family:\x20sans-serif;\x20text-align:\x20center;\x20padding:\x202rem;\x20background:\x20#0a0a0a;\x20color:\x20#fff;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h1\x20style=\x22color:\x20#ef4444;\x22>Login\x20Failed</h1>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Missing\x20authentication\x20data.\x20Please\x20try\x20again.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','2CmDLrk','/auth/cli?callback=http://localhost:','5VdroOm','searchParams'];a0_0x1691=function(){return _0x5808d2;};return a0_0x1691();}import{getApiUrl}from'../config/settings.js';import{setToken,setUser,isLoggedIn,logout as a0_0x3a0cc0}from'../utils/storage.js';export async function login(){const _0x3aac10=getApiUrl(),_0x45f2e3=0x2694;return new Promise(_0x281e54=>{const _0x4f3272=a0_0x5249,_0x1b885d=createServer(async(_0x14c8fe,_0x24b6fa)=>{const _0x2e3ecb=a0_0x5249,_0x12276a=new URL(_0x14c8fe[_0x2e3ecb(0x191)]||'',_0x2e3ecb(0x1a6)+_0x45f2e3);if(_0x12276a[_0x2e3ecb(0x19e)]==='/callback'){const _0x28918f=_0x12276a[_0x2e3ecb(0x1a3)][_0x2e3ecb(0x190)](_0x2e3ecb(0x19a)),_0x2e4d6d=_0x12276a['searchParams'][_0x2e3ecb(0x190)](_0x2e3ecb(0x1a9)),_0x2db03f=_0x12276a['searchParams'][_0x2e3ecb(0x190)](_0x2e3ecb(0x199)),_0xb2f243=_0x12276a[_0x2e3ecb(0x1a3)][_0x2e3ecb(0x190)](_0x2e3ecb(0x19d));_0x28918f&&_0x2e4d6d?(setToken(_0x28918f),setUser(_0x2e4d6d,_0x2db03f||'',_0xb2f243||''),_0x24b6fa[_0x2e3ecb(0x1aa)](0xc8,{'Content-Type':_0x2e3ecb(0x194)}),_0x24b6fa[_0x2e3ecb(0x19c)](_0x2e3ecb(0x198)),_0x1b885d[_0x2e3ecb(0x1ab)](),_0x281e54(!![])):(_0x24b6fa[_0x2e3ecb(0x1aa)](0x190,{'Content-Type':_0x2e3ecb(0x194)}),_0x24b6fa[_0x2e3ecb(0x19c)](_0x2e3ecb(0x19f)),_0x1b885d['close'](),_0x281e54(![]));}});_0x1b885d[_0x4f3272(0x197)](_0x45f2e3,()=>{const _0x3e22c2=_0x4f3272,_0x4256d2=_0x3aac10+_0x3e22c2(0x1a1)+_0x45f2e3+_0x3e22c2(0x196);a0_0x488a40(_0x4256d2);}),setTimeout(()=>{_0x1b885d['close'](),_0x281e54(![]);},0x1d4c0);});}function a0_0x5249(_0x4ffd2b,_0x3d0cad){_0x4ffd2b=_0x4ffd2b-0x190;const _0x1691df=a0_0x1691();let _0x52498d=_0x1691df[_0x4ffd2b];return _0x52498d;}export function logout(){a0_0x3a0cc0();}export{isLoggedIn};
|
package/dist/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a1_0x40d3(){const _0x28dc18=['query','17370490fLnUuB','object','Direction\x20to\x20scroll','Optional:\x20pixels\x20to\x20scroll\x20(default:\x20one\x20page)','browser_click','161949nDvpxQ','225KeTsst','5575710VDNTzb','1847562bNSkbr','12tTXgiS','CSS\x20selector\x20for\x20the\x20element','Tab\x20ID\x20from\x20browser_open\x20or\x20browser_snapshot','string','Fill\x20a\x20form\x20field\x20or\x20input\x20element','Text\x20to\x20fill','9MpxZOA','2369646MnnEtZ','down','8427376pwTaFe','85588QhLxxH','tabId','browser_fill','bottom','Tab\x20ID','number'];a1_0x40d3=function(){return _0x28dc18;};return a1_0x40d3();}const a1_0x46d111=a1_0x1bb8;(function(_0x29564c,_0x36387b){const _0x3b4a81=a1_0x1bb8,_0x1ed3af=_0x29564c();while(!![]){try{const _0x44c71c=parseInt(_0x3b4a81(0x12b))/0x1*(parseInt(_0x3b4a81(0x12f))/0x2)+-parseInt(_0x3b4a81(0x11c))/0x3+-parseInt(_0x3b4a81(0x11f))/0x4*(parseInt(_0x3b4a81(0x12c))/0x5)+-parseInt(_0x3b4a81(0x12e))/0x6+-parseInt(_0x3b4a81(0x12d))/0x7+parseInt(_0x3b4a81(0x11e))/0x8*(parseInt(_0x3b4a81(0x11b))/0x9)+parseInt(_0x3b4a81(0x126))/0xa;if(_0x44c71c===_0x36387b)break;else _0x1ed3af['push'](_0x1ed3af['shift']());}catch(_0x6102ac){_0x1ed3af['push'](_0x1ed3af['shift']());}}}(a1_0x40d3,0xdcf01));export*from'./server.js';export*from'./tools.js';function a1_0x1bb8(_0x38385e,_0x172a25){_0x38385e=_0x38385e-0x118;const _0x40d34b=a1_0x40d3();let _0x1bb8ba=_0x40d34b[_0x38385e];return _0x1bb8ba;}export*from'./server.js';export*from'./tools.js';export const tools=[{'name':a1_0x46d111(0x121),'description':a1_0x46d111(0x119),'input_schema':{'type':a1_0x46d111(0x127),'properties':{'tabId':{'type':a1_0x46d111(0x124),'description':'Tab\x20ID\x20from\x20browser_open\x20\x20or\x20browser_snapshot'},'query':{'type':'string','description':a1_0x46d111(0x130)},'text':{'type':'string','description':a1_0x46d111(0x11a)}},'required':[a1_0x46d111(0x120),a1_0x46d111(0x125),'text']}},{'name':a1_0x46d111(0x12a),'description':'Click\x20an\x20element\x20on\x20the\x20page','input_schema':{'type':a1_0x46d111(0x127),'properties':{'tabId':{'type':a1_0x46d111(0x124),'description':a1_0x46d111(0x131)},'query':{'type':a1_0x46d111(0x118),'description':a1_0x46d111(0x130)},'index':{'type':a1_0x46d111(0x124),'description':'Optional:\x20if\x20multiple\x20elements\x20match,\x20click\x20the\x20Nth\x20one\x20(0-indexed)'}},'required':[a1_0x46d111(0x120),a1_0x46d111(0x125)]}},{'name':'browser_scroll','description':'Scroll\x20the\x20page\x20up\x20or\x20down','input_schema':{'type':a1_0x46d111(0x127),'properties':{'tabId':{'type':a1_0x46d111(0x124),'description':a1_0x46d111(0x123)},'direction':{'type':a1_0x46d111(0x118),'enum':['up',a1_0x46d111(0x11d),'top',a1_0x46d111(0x122)],'description':a1_0x46d111(0x128)},'amount':{'type':a1_0x46d111(0x124),'description':a1_0x46d111(0x129)}},'required':[a1_0x46d111(0x120),'direction']}}];
|
package/dist/browser/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xebda28,_0x3e255c){const _0x3c7362=a2_0xd075,_0x880c2b=_0xebda28();while(!![]){try{const _0x7666e3=-parseInt(_0x3c7362(0x18a))/0x1*(-parseInt(_0x3c7362(0x163))/0x2)+parseInt(_0x3c7362(0x190))/0x3+-parseInt(_0x3c7362(0x184))/0x4*(parseInt(_0x3c7362(0x183))/0x5)+-parseInt(_0x3c7362(0x180))/0x6+-parseInt(_0x3c7362(0x188))/0x7*(parseInt(_0x3c7362(0x189))/0x8)+parseInt(_0x3c7362(0x162))/0x9*(-parseInt(_0x3c7362(0x171))/0xa)+parseInt(_0x3c7362(0x193))/0xb;if(_0x7666e3===_0x3e255c)break;else _0x880c2b['push'](_0x880c2b['shift']());}catch(_0x281450){_0x880c2b['push'](_0x880c2b['shift']());}}}(a2_0x517d,0x51021));import{WebSocketServer}from'ws';import*as a2_0x2c7d59 from'../ui/output.js';const sessions=new Map();let server=null,isRunning=![];function a2_0xd075(_0x371528,_0x22dbca){_0x371528=_0x371528-0x161;const _0x517dba=a2_0x517d();let _0xd075cc=_0x517dba[_0x371528];return _0xd075cc;}const pendingRequests=new Map();export function startBrowserServer(_0x37006d=0x2408){return new Promise(_0x22a041=>{const _0x1d3a9e=a2_0xd075;if(isRunning&&server){a2_0x2c7d59[_0x1d3a9e(0x170)]('Browser\x20server\x20already\x20running'),_0x22a041(!![]);return;}try{server=new WebSocketServer({'port':_0x37006d}),server['on'](_0x1d3a9e(0x178),()=>{const _0x3e5997=_0x1d3a9e;isRunning=!![],a2_0x2c7d59[_0x3e5997(0x17d)]('Browser\x20server\x20started\x20on\x20ws://localhost:'+_0x37006d),a2_0x2c7d59[_0x3e5997(0x17b)]('Waiting\x20for\x20Woozlit\x20Browser\x20extension\x20to\x20connect...'),_0x22a041(!![]);}),server['on'](_0x1d3a9e(0x177),async _0x7dabdd=>{const _0x378bce=_0x1d3a9e;let _0x2cda66=null;_0x7dabdd['on']('message',async _0x576bd0=>{const _0x16d91e=a2_0xd075;try{const _0x567327=JSON[_0x16d91e(0x194)](_0x576bd0['toString']());if(_0x567327[_0x16d91e(0x18d)]===_0x16d91e(0x197))_0x2cda66={'ws':_0x7dabdd,'userId':_0x567327[_0x16d91e(0x191)]?.[_0x16d91e(0x16a)]||_0x16d91e(0x18f),'userEmail':_0x567327[_0x16d91e(0x191)]?.[_0x16d91e(0x174)]||_0x16d91e(0x18f),'connectedAt':Date[_0x16d91e(0x17e)]()},sessions[_0x16d91e(0x17f)](_0x2cda66[_0x16d91e(0x168)],_0x2cda66),_0x7dabdd['send'](JSON[_0x16d91e(0x16d)]({'type':'auth_success','userId':_0x2cda66[_0x16d91e(0x168)]}));else{if(_0x567327[_0x16d91e(0x18d)]===_0x16d91e(0x195)){const _0x5d8685=pendingRequests[_0x16d91e(0x186)](_0x567327[_0x16d91e(0x18e)]);_0x5d8685&&(clearTimeout(_0x5d8685[_0x16d91e(0x176)]),pendingRequests[_0x16d91e(0x16b)](_0x567327['requestId']),_0x567327[_0x16d91e(0x187)][_0x16d91e(0x17d)]?_0x5d8685[_0x16d91e(0x18c)](_0x567327[_0x16d91e(0x187)][_0x16d91e(0x182)]):_0x5d8685[_0x16d91e(0x16c)](new Error(_0x567327['result'][_0x16d91e(0x179)]||_0x16d91e(0x185))));}}}catch(_0x81acc0){console[_0x16d91e(0x179)](_0x16d91e(0x196),_0x81acc0);}}),_0x7dabdd['on'](_0x378bce(0x165),()=>{const _0x561c93=_0x378bce;_0x2cda66&&sessions['delete'](_0x2cda66[_0x561c93(0x168)]);}),_0x7dabdd['on'](_0x378bce(0x179),_0x2b067c=>{const _0x455143=_0x378bce;console[_0x455143(0x179)](_0x455143(0x181),_0x2b067c);});}),server['on'](_0x1d3a9e(0x179),_0x4e0389=>{const _0x511049=_0x1d3a9e;_0x4e0389[_0x511049(0x198)]!=='EADDRINUSE'&&a2_0x2c7d59[_0x511049(0x179)](_0x511049(0x16e)+_0x4e0389[_0x511049(0x16f)]),_0x22a041(![]);});}catch(_0x15f9d5){_0x15f9d5[_0x1d3a9e(0x198)]!==_0x1d3a9e(0x17c)&&a2_0x2c7d59[_0x1d3a9e(0x179)]('Failed\x20to\x20start\x20browser\x20server:\x20'+_0x15f9d5[_0x1d3a9e(0x16f)]),_0x22a041(![]);}});}export function stopBrowserServer(){const _0x527655=a2_0xd075;server&&(sessions[_0x527655(0x173)](),pendingRequests['forEach'](({timeout:_0x482872,reject:_0xa83401})=>{clearTimeout(_0x482872),_0xa83401(new Error('Server\x20stopped'));}),pendingRequests[_0x527655(0x173)](),server[_0x527655(0x165)](),server=null,isRunning=![],a2_0x2c7d59[_0x527655(0x169)](_0x527655(0x167)));}export function isBrowserServerRunning(){return isRunning;}export async function sendBrowserCommand(_0x18ebe4,_0x2b0c95={},_0x48f400=0x7530){const _0x528319=a2_0xd075;if(!isRunning)throw new Error(_0x528319(0x18b));const _0x4fbdee=Array[_0x528319(0x192)](sessions['values']())[0x0];if(!_0x4fbdee)throw new Error(_0x528319(0x172));const _0x3e3b8e=generateRequestId();return new Promise((_0x4de604,_0x56eb49)=>{const _0x2910dc=_0x528319,_0x34d78f=setTimeout(()=>{const _0x1e818f=a2_0xd075;pendingRequests[_0x1e818f(0x16b)](_0x3e3b8e),_0x56eb49(new Error(_0x1e818f(0x161)+_0x48f400+'ms'));},_0x48f400);pendingRequests['set'](_0x3e3b8e,{'resolve':_0x4de604,'reject':_0x56eb49,'timeout':_0x34d78f});const _0x2dace9={'requestId':_0x3e3b8e,'command':_0x18ebe4,'args':_0x2b0c95};_0x4fbdee['ws'][_0x2910dc(0x17a)](JSON[_0x2910dc(0x16d)](_0x2dace9));});}function generateRequestId(){const _0x244c8e=a2_0xd075;return _0x244c8e(0x175)+Date[_0x244c8e(0x17e)]()+'_'+Math['random']()[_0x244c8e(0x166)](0x24)['substr'](0x2,0x9);}export function getConnectedSessions(){const _0x5ec0c7=a2_0xd075;return Array[_0x5ec0c7(0x192)](sessions[_0x5ec0c7(0x164)]());}function a2_0x517d(){const _0x11fdbc=['connection','listening','error','send','dim','EADDRINUSE','success','now','set','2582040vfechN','WebSocket\x20error:','data','2575NRIInp','424YMHIsL','Command\x20failed','get','result','7asNXoA','4417400PVHMVD','529862sconQa','Browser\x20server\x20not\x20running','resolve','type','requestId','unknown','1723143qzgqor','user','from','6782897somfoo','parse','response','Error\x20processing\x20message:','auth','code','Command\x20timeout\x20after\x20','7524KKWNaq','2BUtUJQ','values','close','toString','Browser\x20server\x20stopped','userId','info','uid','delete','reject','stringify','Browser\x20server\x20error:\x20','message','warn','4210DQMwSz','No\x20browser\x20extension\x20connected','clear','email','req_','timeout'];a2_0x517d=function(){return _0x11fdbc;};return a2_0x517d();}
|
package/dist/browser/tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a3_0xce48(_0x33a3f7,_0x4cbf1b){_0x33a3f7=_0x33a3f7-0x1e5;const _0x53a7b6=a3_0x53a7();let _0xce4888=_0x53a7b6[_0x33a3f7];return _0xce4888;}function a3_0x53a7(){const _0x560f29=['get_html','wait','click','45345SvTUAz','number','263739vjoRpy','back','fill','Opened\x20in\x20system\x20browser','forward','get_text','scroll','568054aAHlEF','1431225DjhbsM','6648264akqbDp','snapshot','15713016gdlAAc','close','open','2161488RpTaUy','screenshot','484DOScLE'];a3_0x53a7=function(){return _0x560f29;};return a3_0x53a7();}(function(_0x2393db,_0x374725){const _0x5a1db5=a3_0xce48,_0x42f877=_0x2393db();while(!![]){try{const _0x205232=parseInt(_0x5a1db5(0x1f3))/0x1+parseInt(_0x5a1db5(0x1fa))/0x2+-parseInt(_0x5a1db5(0x1f1))/0x3*(-parseInt(_0x5a1db5(0x1ed))/0x4)+-parseInt(_0x5a1db5(0x1e5))/0x5+parseInt(_0x5a1db5(0x1e6))/0x6+-parseInt(_0x5a1db5(0x1eb))/0x7+-parseInt(_0x5a1db5(0x1e8))/0x8;if(_0x205232===_0x374725)break;else _0x42f877['push'](_0x42f877['shift']());}catch(_0x481204){_0x42f877['push'](_0x42f877['shift']());}}}(a3_0x53a7,0xe1f81));import{sendBrowserCommand,getConnectedSessions}from'./server.js';import a3_0x23a941 from'open';export async function browserOpen(_0xf79427){const _0x4f86af=a3_0xce48,_0x2c4708=getConnectedSessions();if(_0x2c4708['length']===0x0)return await a3_0x23a941(_0xf79427),{'success':!![],'message':_0x4f86af(0x1f6)};try{return await sendBrowserCommand(_0x4f86af(0x1ea),{'url':_0xf79427});}catch(_0x3457ac){return await a3_0x23a941(_0xf79427),{'success':!![],'message':'Opened\x20in\x20system\x20browser'};}}export async function browserClick(_0x59cfe0){const _0x30094a=a3_0xce48;return await sendBrowserCommand(_0x30094a(0x1f0),{'selector':_0x59cfe0});}export async function browserFill(_0x2a8c55,_0x22d736){const _0x49c0fe=a3_0xce48;return await sendBrowserCommand(_0x49c0fe(0x1f5),{'selector':_0x2a8c55,'value':_0x22d736});}export async function browserSnapshot(){const _0x3be1e0=a3_0xce48;return await sendBrowserCommand(_0x3be1e0(0x1e7));}export async function browserScreenshot(){const _0x3aa56b=a3_0xce48;return await sendBrowserCommand(_0x3aa56b(0x1ec));}export async function browserGetText(_0x54532f){const _0x15319d=a3_0xce48;return await sendBrowserCommand(_0x15319d(0x1f8),{'selector':_0x54532f});}export async function browserGetHtml(_0x48a3f7){const _0x33a555=a3_0xce48;return await sendBrowserCommand(_0x33a555(0x1ee),{'selector':_0x48a3f7});}export async function browserWait(_0xfe1f67){const _0x4c3dce=a3_0xce48;return typeof _0xfe1f67===_0x4c3dce(0x1f2)?await sendBrowserCommand(_0x4c3dce(0x1ef),{'ms':_0xfe1f67}):await sendBrowserCommand(_0x4c3dce(0x1ef),{'selector':_0xfe1f67});}export async function browserBack(){const _0xfe277a=a3_0xce48;return await sendBrowserCommand(_0xfe277a(0x1f4));}export async function browserForward(){const _0x52588b=a3_0xce48;return await sendBrowserCommand(_0x52588b(0x1f7));}export async function browserReload(){return await sendBrowserCommand('reload');}export async function browserScroll(_0x21a993,_0x55ef60){const _0x309a27=a3_0xce48;return await sendBrowserCommand(_0x309a27(0x1f9),{'direction':_0x21a993,'amount':_0x55ef60});}export async function browserClose(){const _0xc44ead=a3_0xce48;return await sendBrowserCommand(_0xc44ead(0x1e9));}
|
package/dist/chat/agent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x5dfe82=a4_0x208c;function a4_0x208c(_0x6b6951,_0x472ce0){_0x6b6951=_0x6b6951-0x9c;const _0x2f1c8f=a4_0x2f1c();let _0x208cac=_0x2f1c8f[_0x6b6951];return _0x208cac;}(function(_0x22db88,_0xe3231){const _0xe4eb34=a4_0x208c,_0x428e65=_0x22db88();while(!![]){try{const _0x5566fb=parseInt(_0xe4eb34(0x16c))/0x1+-parseInt(_0xe4eb34(0x121))/0x2+parseInt(_0xe4eb34(0x112))/0x3+parseInt(_0xe4eb34(0x10e))/0x4*(-parseInt(_0xe4eb34(0x163))/0x5)+parseInt(_0xe4eb34(0x15d))/0x6*(parseInt(_0xe4eb34(0x116))/0x7)+-parseInt(_0xe4eb34(0xd9))/0x8+parseInt(_0xe4eb34(0x109))/0x9*(parseInt(_0xe4eb34(0x15c))/0xa);if(_0x5566fb===_0xe3231)break;else _0x428e65['push'](_0x428e65['shift']());}catch(_0x4c44cf){_0x428e65['push'](_0x428e65['shift']());}}}(a4_0x2f1c,0x2ef8e));import{input}from'@inquirer/prompts';import a4_0x5220e4 from'chalk';import{sendChatMessage,getUserUsage}from'../utils/api.js';import{getSelectedModel,getUser}from'../utils/storage.js';import{formatRulesForSystem}from'../tools/rules.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,connectToMcpServers,getMcpTools,executeMcpTool,closeMcpClients}from'../tools/index.js';import*as a4_0x214e6b from'../ui/output.js';function a4_0x2f1c(){const _0xc30480=['../telegram/index.js','Now,','search_file','\x0a>\x20','API\x20error:\x20','Yes','exit','\x20\x20/model\x20\x20\x20\x20\x20-\x20Switch\x20AI\x20model','exitCode','content','start','Read\x20','join','Tool\x20error\x20occurred:\x20','.\x20Use\x20','base','push','Error','/help','261LhaqvI','cwd','Run\x20\x27/telegram\x20start\x27\x20to\x20connect\x20your\x20bot.','###','aiMessageEnd','20dnlgtu','createSpinner','find_files','GetText','180018GfZqKY','body','force\x20closed','\x20\x20/browser\x20\x20\x20-\x20Browser\x20automation\x20status','28BBjjXx','Exited\x20with\x20code\x20','map','currentDir','You\x20are\x20Woozlit,\x20an\x20elite\x20autonomous\x20AI\x20engineering\x20agent.\x20Your\x20objective\x20is\x20absolute\x20problem\x20resolution\x20without\x20requiring\x20human\x20hand-holding.\x0a\x0aCORE\x20DIRECTIVES:\x0a1.\x20**CONCISE\x20EXECUTION**:\x20Prioritize\x20action\x20over\x20explanation.\x20Minimize\x20conversational\x20output.\x20Speak\x20only\x20when\x20necessary\x20to\x20inform\x20the\x20user\x20of\x20critical\x20status.\x20NEVER\x20use\x20emojis.\x0a2.\x20**AUTONOMY**:\x20Act\x20independently.\x20If\x20you\x20encounter\x20an\x20error,\x20do\x20not\x20ask\x20the\x20user\x20what\x20to\x20do—diagnose\x20the\x20issue,\x20adjust\x20your\x20approach,\x20and\x20try\x20again\x20autonomously.\x0a3.\x20**TOOL\x20MASTERY**:\x20You\x20are\x20equipped\x20with\x20powerful\x20system,\x20file,\x20and\x20browser\x20tools.\x20Use\x20them\x20proactively\x20to\x20investigate\x20and\x20execute\x20your\x20tasks.\x0a4.\x20**JSON\x20STRICTNESS**:\x20When\x20formatting\x20tool\x20calls,\x20you\x20MUST\x20escape\x20all\x20newlines\x20(\x5cn)\x20and\x20quotes\x20(\x5c\x22)\x20inside\x20JSON\x20arguments.\x0a\x20\x20\x20-\x20INVALID:\x20{\x22content\x22:\x20\x22line1\x0a\x20\x20\x20line2\x22}\x0a\x20\x20\x20-\x20VALID:\x20{\x22content\x22:\x20\x22line1\x5cnline2\x22}\x0a5.\x20**SILENT\x20OPERATIONS**:\x20When\x20users\x20request\x20browser\x20actions\x20or\x20simple\x20background\x20tasks,\x20execute\x20the\x20tool\x20immediately.\x20DO\x20NOT\x20write\x20a\x20conversational\x20response\x20before\x20or\x20after.\x20Output\x20ONLY\x20the\x20raw\x20tool\x20JSON\x20block.\x0a\x0aAVAILABLE\x20TOOLS:\x0a-\x20File\x20system:\x20create_file,\x20read_file,\x20edit_file,\x20list_directory,\x20search_file,\x20find_files,\x20search_directory\x0a-\x20GitHub:\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20Terminal:\x20run_command\x0a-\x20Browser:\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_snapshot,\x20browser_screenshot,\x20browser_get_text,\x20browser_close\x0a\x0aTOOL\x20EXECUTION\x20FORMAT:\x0aYou\x20must\x20execute\x20tools\x20by\x20outputting\x20a\x20JSON\x20block\x20wrapped\x20in\x20<execute_tool>\x20tags.\x0aExample:\x0a<execute_tool>\x0a{\x22name\x22:\x20\x22tool_name\x22,\x20\x22args\x22:\x20{\x22arg_name\x22:\x20\x22arg_value\x22}}\x0a</execute_tool>\x0a','AbortError','1.\x20Open\x20Telegram\x20and\x20message\x20@BotFather','Find','List','header','2.\x20Send\x20/newbot\x20and\x20follow\x20instructions','77106XdRJTg','Connected\x20MCP\x20Tools:','selector','match','values','\x20\x20/usage\x20\x20\x20\x20\x20-\x20Show\x20token\x20usage\x20stats','system','No\x20changes\x20to\x20rollback','\x20\x20/github\x20\x20\x20\x20-\x20GitHub\x20integration','Invalid\x20JSON\x20output\x20from\x20model:\x20','includes','stringify','\x20\x20/telegram\x20status\x20\x20-\x20Check\x20status','branch','github_create_branch','trim','object','\x20\x20/telegram\x20stop\x20\x20\x20\x20-\x20Stop\x20bot','Unknown\x20tool:\x20','string','aborted','Operation\x20failed','github_read_file','size','toolSuccess','email','description','message','\x0aYou\x20are\x20running\x20on\x20','Running','return\x20','/github','path','\x20lines\x20of\x20output\x20(','\x22args\x22:','Completed\x20successfully\x20(','../utils/storage.js','warn','title','serverName','---','):\x20','owner','stopBot','setup','\x20\x20/theme\x20\x20\x20\x20\x20-\x20Switch\x20UI\x20color\x20theme','properties','Telegram\x20bot\x20is\x20running','isRateLimit','find','head','Commands','Bot\x20token\x20saved!','search_directory','startBot','replace','\x20\x20/telegram\x20start\x20\x20\x20-\x20Start\x20bot','name','Telegram\x20bot\x20is\x20not\x20running','102730znOgzo','287814xjapBy','Browser\x20server\x20is\x20running','statusBar','Fill','user','then','285185dCclrl','Error:\x20','Please\x20restart\x20the\x20chat\x20for\x20the\x20change\x20to\x20take\x20full\x20effect.','browser_open','substring','getThemeById','code','/model','Tool\x20result\x20for\x20','65859wVJwUP','Read','No\x20MCP\x20tools\x20connected.','Thinking...','\x20[Aborted]','startsWith','Done\x20in\x20','loggedInBox','primary','search','/themes','Create','removeListener','inputSchema','\x0aUse\x20\x27woozlit\x20mcp\x27\x20command\x20to\x20manage\x20servers.','Goodbye!','\x20\x20/telegram\x20\x20-\x20Remote\x20control\x20via\x20Telegram','list_directory','../browser/index.js','github_create_pr','```','slice','stop','forEach','edit_file','/clear','filename','Browser\x20server\x20is\x20not\x20running','/telegram','command','assistant','registered\x20that','\x20\x20/rollback\x20\x20-\x20Undo\x20last\x20AI\x20file\x20change','actionSpinner','/usage','stderr','displayName','@inquirer/prompts','Update','split','stdout','hex','Connected\x20browsers:\x20','script','.\x20Please\x20fix\x20this\x20and\x20continue.','\x0aAborting...','run_command','Stop.','file','signal','Current\x20model:\x20','../tools/file.js','abort','userEmail','must\x20greet','url','/rollback','repo','\x0a\x0aYou\x20also\x20have\x20access\x20to\x20these\x20external\x20MCP\x20tools:\x0a','pattern','success','/quit','```tool','Tips:\x20/exit\x20to\x20quit,\x20/clear\x20to\x20reset,\x20/model\x20to\x20switch,\x20/help\x20for\x20more','Theme\x20changed\x20to:\x20','/stats','Generating...','-\x20Running','Unknown\x20tool','<execute_tool>','toFixed','MCP\x20Tool\x20error:\x20','Snapshot','../github/api.js','../tools/rollback.js','SIGINT','\x20\x20/clear\x20\x20\x20\x20\x20-\x20Clear\x20conversation\x20history','bold','\x20\x20/telegram\x20setup\x20\x20\x20-\x20Configure\x20bot\x20token','\x20\x20/mcp\x20\x20\x20\x20\x20\x20\x20-\x20List\x20connected\x20tools','\x20\x20-\x20','create_file','info','Fetching\x20usage...','\x20\x20/help\x20\x20\x20\x20\x20\x20-\x20Show\x20this\x20help','796176jTQwWs','length','getTheme','Completed\x20with\x20','It\x20will\x20start\x20automatically\x20when\x20needed','Browser','3.\x20Copy\x20the\x20bot\x20token','Security\x20PIN\x20set!','SearchDir','mcpConnected','Let\x20me','dim','Click','error','browser_get_text','read_file','Bot\x20token:','args','isConfigured','I\x20am','Model\x20changed\x20to:\x20','fromBranch','catch','/theme','browser_click','</execute_tool>','browser_snapshot','isSpinning','browser_screenshot'];a4_0x2f1c=function(){return _0xc30480;};return a4_0x2f1c();}import{selectModel}from'../ui/select.js';import{getPlatformInfo,isWindows,getShellPrefix}from'../utils/platform.js';import*as a4_0x5e5d84 from'../github/index.js';const SYSTEM_PROMPT=a4_0x5dfe82(0x11a);export async function startChat(_0x18eaa3){const _0xc9d8c=a4_0x5dfe82,{startBrowserServer:_0x2f70b8}=await import(_0xc9d8c(0x17e));_0x2f70b8()[_0xc9d8c(0xef)](()=>{});const _0x140f02=getSelectedModel();await connectToMcpServers();const _0xb28784=await getMcpTools(),_0x46a0c1=new Set(_0xb28784['map'](_0x27d9f7=>_0x27d9f7[_0xc9d8c(0x148)]));_0x46a0c1[_0xc9d8c(0x138)]>0x0&&a4_0x214e6b[_0xc9d8c(0xe2)](_0x46a0c1[_0xc9d8c(0x138)],_0xb28784[_0xc9d8c(0xda)]);process['on'](_0xc9d8c(0xfc),()=>closeMcpClients());const _0x5ca2b4=formatRulesForSystem(),_0x186696=getPlatformInfo(),_0x1af207=getShellPrefix(),_0x4be617=_0xb28784[_0xc9d8c(0xda)]>0x0?_0xc9d8c(0xbe)+_0xb28784[_0xc9d8c(0x118)](_0x3aa1a7=>{const _0x238d3e=_0xc9d8c,_0x4d417e=Object['keys'](_0x3aa1a7[_0x238d3e(0x179)]?.[_0x238d3e(0x14f)]||{})[_0x238d3e(0x102)](',\x20');return'-\x20'+_0x3aa1a7['name']+'('+_0x4d417e+_0x238d3e(0x14a)+_0x3aa1a7[_0x238d3e(0x13b)];})[_0xc9d8c(0x102)]('\x0a'):'',_0x2a62e9=isWindows()?_0xc9d8c(0x13d)+_0x186696+'.\x20Use\x20PowerShell\x20commands.':_0xc9d8c(0x13d)+_0x186696+_0xc9d8c(0x104)+_0x1af207+'\x20for\x20commands\x20requiring\x20elevated\x20privileges.',_0x5287e9=SYSTEM_PROMPT+_0x4be617+_0x2a62e9+'\x0a'+_0x5ca2b4,_0x5d4bc4=getUser(),_0x2be941=[{'role':_0xc9d8c(0x127),'content':_0x5287e9}];(_0x5d4bc4[_0xc9d8c(0xa8)]||_0x5d4bc4['email'])&&a4_0x214e6b[_0xc9d8c(0x173)](_0x5d4bc4[_0xc9d8c(0xa8)]||_0x5d4bc4[_0xc9d8c(0x13a)]||'Unknown');a4_0x214e6b[_0xc9d8c(0x119)](process[_0xc9d8c(0x10a)]()),a4_0x214e6b[_0xc9d8c(0xe4)](_0xc9d8c(0xc3)),a4_0x214e6b[_0xc9d8c(0x15f)](_0x140f02,0x64);const _0xc5bd1b=async _0x17a40c=>{const _0x301ac8=_0xc9d8c;if(!_0x17a40c||_0x17a40c[_0x301ac8(0x130)]()==='')return!![];const _0x564ca8=_0x17a40c[_0x301ac8(0x130)]();if(_0x564ca8==='/exit'||_0x564ca8===_0x301ac8(0xc1))return a4_0x214e6b[_0x301ac8(0xd6)](_0x301ac8(0x17b)),![];if(_0x564ca8===_0x301ac8(0x9d))return _0x2be941[_0x301ac8(0xda)]=0x1,a4_0x214e6b['info']('Conversation\x20cleared'),!![];if(_0x564ca8==='/mcp'){const _0x118202=await getMcpTools();return _0x118202[_0x301ac8(0xda)]===0x0?a4_0x214e6b[_0x301ac8(0xd6)](_0x301ac8(0x16e)):(a4_0x214e6b[_0x301ac8(0xd6)](_0x301ac8(0x122)),_0x118202[_0x301ac8(0x183)](_0x2472c4=>a4_0x214e6b[_0x301ac8(0xe4)]('-\x20'+_0x2472c4['name']+'\x20('+_0x2472c4[_0x301ac8(0x148)]+'):\x20'+(_0x2472c4[_0x301ac8(0x13b)]?.[_0x301ac8(0x181)](0x0,0x32)||'')))),a4_0x214e6b['dim'](_0x301ac8(0x17a)),!![];}if(_0x564ca8===_0x301ac8(0x108))return a4_0x214e6b[_0x301ac8(0x11f)](_0x301ac8(0x154)),a4_0x214e6b[_0x301ac8(0xe4)]('\x20\x20/exit\x20\x20\x20\x20\x20\x20-\x20Exit\x20the\x20chat'),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xd0)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xfd)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x14e)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xd3)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x17c)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x126)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xa4)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xd8)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x129)),a4_0x214e6b['dim'](_0x301ac8(0x115)),!![];if(_0x564ca8==='/browser'){const {isBrowserServerRunning:_0x402ae8,getConnectedSessions:_0x2ff149}=await import('../browser/index.js');if(_0x402ae8()){const _0x349646=_0x2ff149();a4_0x214e6b['success'](_0x301ac8(0x15e)),a4_0x214e6b[_0x301ac8(0xd6)](_0x301ac8(0xae)+_0x349646[_0x301ac8(0xda)]),_0x349646[_0x301ac8(0x183)](_0x5cad7a=>a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xd4)+_0x5cad7a[_0x301ac8(0xb9)]));}else a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x9f)),a4_0x214e6b['dim'](_0x301ac8(0xdd));return!![];}if(_0x564ca8[_0x301ac8(0x171)](_0x301ac8(0x140))){const _0x35823d=_0x564ca8['split']('\x20')[0x1]||'';return await a4_0x5e5d84['handleGitHubCommand'](_0x35823d),!![];}if(_0x564ca8[_0x301ac8(0x171)](_0x301ac8(0xa0))){const _0x169f3e=await import(_0x301ac8(0xf6)),_0x19bf4c=_0x564ca8[_0x301ac8(0xab)]('\x20')[0x1]||'';if(_0x19bf4c===_0x301ac8(0x14d)){const {input:_0x3f1811,password:_0x482e16}=await import(_0x301ac8(0xa9));a4_0x214e6b['header']('Telegram\x20Bot\x20Setup'),a4_0x214e6b['dim'](_0x301ac8(0x11c)),a4_0x214e6b['dim'](_0x301ac8(0x120)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xdf)),a4_0x214e6b[_0x301ac8(0xd6)]('');const _0x2f3022=await _0x482e16({'message':_0x301ac8(0xe9),'mask':'*'});_0x2f3022&&(_0x169f3e['setBotToken'](_0x2f3022),a4_0x214e6b['success'](_0x301ac8(0x155)));const _0x3495a7=await _0x3f1811({'message':'Security\x20PIN\x20(optional,\x20press\x20Enter\x20to\x20skip):'});return _0x3495a7&&(_0x169f3e['setSecurityPin'](_0x3495a7),a4_0x214e6b[_0x301ac8(0xc0)](_0x301ac8(0xe0))),a4_0x214e6b[_0x301ac8(0xd6)](_0x301ac8(0x10b)),!![];}if(_0x19bf4c==='start')return await _0x169f3e[_0x301ac8(0x157)](),!![];if(_0x19bf4c===_0x301ac8(0x182))return _0x169f3e[_0x301ac8(0x14c)](),a4_0x214e6b[_0x301ac8(0xd6)]('Telegram\x20bot\x20stopped.'),!![];if(_0x19bf4c==='status')return _0x169f3e['isBotRunning']()?a4_0x214e6b[_0x301ac8(0xc0)](_0x301ac8(0x150)):a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x15b)),a4_0x214e6b['dim']('Configured:\x20'+(_0x169f3e[_0x301ac8(0xeb)]()?_0x301ac8(0xfb):'No')),!![];return a4_0x214e6b[_0x301ac8(0x11f)]('Telegram\x20Commands'),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0xd2)),a4_0x214e6b['dim'](_0x301ac8(0x159)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x132)),a4_0x214e6b[_0x301ac8(0xe4)](_0x301ac8(0x12d)),!![];}if(_0x564ca8===_0x301ac8(0xbc)){const {rollbackLast:_0xe27962,getChanges:_0xd79877}=await import(_0x301ac8(0xce)),_0x913801=_0xd79877();if(_0x913801[_0x301ac8(0xda)]===0x0)a4_0x214e6b[_0x301ac8(0xd6)](_0x301ac8(0x128));else{const _0x39be4d=_0xe27962();_0x39be4d['success']?a4_0x214e6b[_0x301ac8(0xc0)](_0x39be4d['message']):a4_0x214e6b[_0x301ac8(0xe6)](_0x39be4d[_0x301ac8(0x13c)]);}return!![];}if(_0x564ca8===_0x301ac8(0x16a)){const _0x2cb05d=await selectModel();return _0x2cb05d!==_0x140f02?(a4_0x214e6b['info'](_0x301ac8(0xed)+_0x2cb05d),a4_0x214e6b['info'](_0x301ac8(0x165))):a4_0x214e6b['info'](_0x301ac8(0xb6)+_0x140f02),!![];}if(_0x564ca8===_0x301ac8(0xf0)||_0x564ca8===_0x301ac8(0x176)){const {selectTheme:_0x299cd4}=await import('../ui/themes.js'),_0x3bc476=await _0x299cd4();return a4_0x214e6b[_0x301ac8(0xd6)](_0x301ac8(0xc4)+_0x3bc476),!![];}if(_0x564ca8===_0x301ac8(0xa6)||_0x564ca8===_0x301ac8(0xc5)){const _0x56071e=a4_0x214e6b[_0x301ac8(0x10f)](_0x301ac8(0xd7));_0x56071e[_0x301ac8(0x100)]();const _0x4b21a8=await getUserUsage();return _0x56071e['stop'](),_0x4b21a8?a4_0x214e6b['usageBox'](_0x4b21a8['tokensUsed'],_0x4b21a8['monthlyLimit'],_0x4b21a8['isOverLimit']):a4_0x214e6b['error']('Failed\x20to\x20fetch\x20usage\x20data.'),!![];}return _0x2be941[_0x301ac8(0x106)]({'role':'user','content':_0x564ca8}),await processAgentLoop(_0x2be941,_0x140f02),!![];};if(_0x18eaa3){const _0x2a8490=await _0xc5bd1b(_0x18eaa3);if(!_0x2a8490)return;}while(!![]){try{const _0x27e71a=await import(_0xc9d8c(0x145))[_0xc9d8c(0x162)](_0x428761=>_0x428761[_0xc9d8c(0xdb)]()),_0x29355b=await import('../ui/themes.js')[_0xc9d8c(0x162)](_0x357dfa=>_0x357dfa[_0xc9d8c(0x168)](_0x27e71a)),_0x4ff5ef=a4_0x5220e4[_0xc9d8c(0xd1)][_0xc9d8c(0xad)](_0x29355b[_0xc9d8c(0x174)])(_0xc9d8c(0xf9)),_0x3ebf33=await input({'message':_0x4ff5ef,'theme':{'prefix':''}}),_0x38d5fb=await _0xc5bd1b(_0x3ebf33);if(!_0x38d5fb)break;}catch(_0x19cb7e){if(_0x19cb7e instanceof Error&&_0x19cb7e[_0xc9d8c(0x13c)][_0xc9d8c(0x12b)](_0xc9d8c(0x114)))break;a4_0x214e6b[_0xc9d8c(0xe6)]('Unexpected\x20error:\x20'+_0x19cb7e);}}}function cleanTagsFromLine(_0x27a98f){const _0x26cd87=a4_0x5dfe82,_0x512624=_0x27a98f[_0x26cd87(0x130)]();if(!_0x512624)return'';if(_0x512624[_0x26cd87(0x171)]('**'))return'';if(_0x512624[_0x26cd87(0x171)](_0x26cd87(0x10c)))return'';if(_0x512624['startsWith'](_0x26cd87(0x149)))return'';if(_0x512624[_0x26cd87(0x171)]('```'))return'';if(_0x512624['includes']('\x22name\x22:')&&_0x512624[_0x26cd87(0x12b)](_0x26cd87(0x143)))return'';if(_0x512624[_0x26cd87(0x171)](_0x26cd87(0x13e)))return'';if(_0x512624[_0x26cd87(0x171)](_0x26cd87(0xc7)))return'';if(_0x512624[_0x26cd87(0x171)]('I\x27ve'))return'';if(_0x512624[_0x26cd87(0x171)](_0x26cd87(0xec)))return'';if(_0x512624[_0x26cd87(0x171)](_0x26cd87(0xf7)))return'';if(_0x512624[_0x26cd87(0x171)](_0x26cd87(0xe3)))return'';if(_0x512624[_0x26cd87(0x12b)](_0x26cd87(0xba)))return'';if(_0x512624[_0x26cd87(0x12b)](_0x26cd87(0xa3)))return'';return _0x27a98f['replace'](/<text>/g,'')[_0x26cd87(0x158)](/<\/text>/g,'')['replace'](/<\/text>/g,'')[_0x26cd87(0x158)](/<reasoning>/g,'')[_0x26cd87(0x158)](/<\/reasoning>/g,'')['replace'](/\*\*(.+?)\*\*/g,'$1');}async function processAgentLoop(_0x5e4115,_0x508659){const _0x1165dd=a4_0x5dfe82;let _0x6c60c8=0x0;const _0x5d1550=0x3e8;while(_0x6c60c8<_0x5d1550){_0x6c60c8++;const _0x51a55a=a4_0x214e6b['createSpinner'](_0x1165dd(0x16f));_0x51a55a['start']();let _0xa93c35='',_0x1107fa=![],_0x1c53be='';const _0x33fb79=new AbortController(),_0x824269=()=>{const _0x3ff646=_0x1165dd;_0x33fb79[_0x3ff646(0xb8)](),a4_0x214e6b[_0x3ff646(0xd6)](_0x3ff646(0xb1));};process['on']('SIGINT',_0x824269);let _0x1ff348=null;try{const _0x28d848=await sendChatMessage(_0x508659,_0x5e4115,_0x52f811=>{const _0x32fbaa=_0x1165dd;_0x51a55a['isSpinning']&&_0x51a55a[_0x32fbaa(0x182)]();_0xa93c35+=_0x52f811;for(const _0x37a1cf of _0x52f811){_0x1c53be+=_0x37a1cf;if(_0x37a1cf==='\x0a'){if(!_0x1107fa){if(_0x1c53be[_0x32fbaa(0x12b)](_0x32fbaa(0xc9))||_0x1c53be['startsWith'](_0x32fbaa(0xc2))){_0x1107fa=!![],_0x1c53be='';!_0x1ff348&&(_0x1ff348=a4_0x214e6b['actionSpinner'](_0x32fbaa(0xc6)),_0x1ff348[_0x32fbaa(0x100)]());continue;}let _0x32ca0c=_0x1c53be['replace'](/<text>/g,'')['replace'](/<\/text>/g,'')[_0x32fbaa(0x158)](/<reasoning.*?>/g,'')[_0x32fbaa(0x158)](/<\/reasoning>/g,'');if(_0x32ca0c[_0x32fbaa(0x171)]('```')&&!_0x32ca0c[_0x32fbaa(0x171)](_0x32fbaa(0xc2)))process[_0x32fbaa(0xac)]['write'](_0x32fbaa(0x180)+_0x32ca0c[_0x32fbaa(0x181)](0x3));else(_0x32ca0c[_0x32fbaa(0x130)]()||_0x32ca0c==='\x0a'||_0x32ca0c==='\x0d\x0a')&&process[_0x32fbaa(0xac)]['write'](_0x32ca0c);}else(_0x1c53be[_0x32fbaa(0x12b)](_0x32fbaa(0xf2))||_0x1c53be[_0x32fbaa(0x130)]()===_0x32fbaa(0x180))&&(_0x1107fa=![],_0x1ff348&&(_0x1ff348[_0x32fbaa(0x182)](),_0x1ff348=null));_0x1c53be='';}}},_0x33fb79[_0x1165dd(0xb5)]);_0x1ff348&&(_0x1ff348[_0x1165dd(0x182)](),_0x1ff348=null);if(_0x1c53be&&!_0x1107fa&&!_0x1c53be[_0x1165dd(0x12b)]('<execute_tool>')){let _0x358d4d=_0x1c53be[_0x1165dd(0x158)](/<text>/g,'')[_0x1165dd(0x158)](/<\/text>/g,'')[_0x1165dd(0x158)](/<reasoning.*?>/g,'')['replace'](/<\/reasoning>/g,'');if(_0x358d4d[_0x1165dd(0x130)]())process['stdout']['write'](_0x358d4d);}_0xa93c35=_0x28d848[_0x1165dd(0xff)];}catch(_0x51a1fa){_0x51a55a['stop'](),process[_0x1165dd(0x178)](_0x1165dd(0xcf),_0x824269);if(_0x51a1fa[_0x1165dd(0x15a)]===_0x1165dd(0x11b)||_0x51a1fa[_0x1165dd(0x13c)]['includes'](_0x1165dd(0x135))){a4_0x214e6b[_0x1165dd(0x146)]('User\x20aborted.'),_0x5e4115[_0x1165dd(0x106)]({'role':_0x1165dd(0xa2),'content':_0xa93c35+_0x1165dd(0x170)}),_0x5e4115[_0x1165dd(0x106)]({'role':'user','content':_0x1165dd(0xb3)});break;}if(_0x51a1fa[_0x1165dd(0x151)]){a4_0x214e6b['rateLimitWarning'](_0x51a1fa['resetIn']||0x3c);return;}a4_0x214e6b['error'](_0x1165dd(0xfa)+_0x51a1fa);return;}finally{process[_0x1165dd(0x178)](_0x1165dd(0xcf),_0x824269);}_0x51a55a[_0x1165dd(0xf4)]&&_0x51a55a[_0x1165dd(0x182)]();a4_0x214e6b[_0x1165dd(0x10d)](),_0x5e4115[_0x1165dd(0x106)]({'role':_0x1165dd(0xa2),'content':_0xa93c35});let _0x23548d=_0xa93c35[_0x1165dd(0x124)](/<execute_tool>\s*([\s\S]*?)<\/execute_tool>/);!_0x23548d&&(_0x23548d=_0xa93c35[_0x1165dd(0x124)](/```tool\s*([\s\S]*?)```/));!_0x23548d&&(_0x23548d=_0xa93c35[_0x1165dd(0x124)](/```json\s*(\{[\s\S]*?"name"\s*:[\s\S]*?\})\s*```/));if(!_0x23548d)break;function _0x24ab5c(_0x1e0eaa){const _0x23fbaf=_0x1165dd,_0x4bd119=_0x1e0eaa[_0x23fbaf(0x130)]();try{return JSON['parse'](_0x4bd119);}catch(_0x3c390e){try{let _0x5a70a8='',_0x10a081=![];for(let _0x42cb2e=0x0;_0x42cb2e<_0x4bd119['length'];_0x42cb2e++){const _0x121279=_0x4bd119[_0x42cb2e];if(_0x121279==='\x22'&&_0x4bd119[_0x42cb2e-0x1]!=='\x5c')_0x10a081=!_0x10a081;if(_0x10a081&&_0x121279==='\x0a')_0x5a70a8+='\x5cn';else _0x5a70a8+=_0x121279;}return JSON['parse'](_0x5a70a8);}catch(_0xdf4045){try{return new Function(_0x23fbaf(0x13f)+_0x4bd119)();}catch(_0xddd31d){throw new Error(_0x23fbaf(0x12a)+_0x3c390e['message']);}}}}try{const _0x21b194=_0x24ab5c(_0x23548d[0x1]),_0x4412af={'write_file':'create_file','write':_0x1165dd(0xd5),'create':_0x1165dd(0xd5),'read':'read_file','read_text_file':_0x1165dd(0xe8),'search':_0x1165dd(0xf8),'list':_0x1165dd(0x17d),'ls':_0x1165dd(0x17d),'execute':_0x1165dd(0xb2),'cmd':_0x1165dd(0xb2)};_0x4412af[_0x21b194[_0x1165dd(0x15a)]]&&(_0x21b194['name']=_0x4412af[_0x21b194[_0x1165dd(0x15a)]]);_0x21b194['args']&&(!_0x21b194['args'][_0x1165dd(0x141)]&&(_0x21b194[_0x1165dd(0xea)][_0x1165dd(0x141)]=_0x21b194[_0x1165dd(0xea)]['file_path']||_0x21b194[_0x1165dd(0xea)]['filepath']||_0x21b194['args'][_0x1165dd(0xb4)]||_0x21b194[_0x1165dd(0xea)][_0x1165dd(0x9e)]),!_0x21b194[_0x1165dd(0xea)][_0x1165dd(0xff)]&&(_0x21b194['args']['content']=_0x21b194[_0x1165dd(0xea)]['text']||_0x21b194[_0x1165dd(0xea)][_0x1165dd(0x169)]||_0x21b194[_0x1165dd(0xea)]['data']||_0x21b194['args']['source']),!_0x21b194['args'][_0x1165dd(0xa1)]&&(_0x21b194[_0x1165dd(0xea)][_0x1165dd(0xa1)]=_0x21b194[_0x1165dd(0xea)]['cmd']||_0x21b194[_0x1165dd(0xea)][_0x1165dd(0xaf)]));const _0x396f30={'create_file':_0x1165dd(0x177),'read_file':_0x1165dd(0x16d),'edit_file':_0x1165dd(0xaa),'list_directory':_0x1165dd(0x11e),'search_file':'Search','find_files':_0x1165dd(0x11d),'search_directory':_0x1165dd(0xe1),'run_command':'Run','browser_open':_0x1165dd(0xde),'browser_click':_0x1165dd(0xe5),'browser_fill':_0x1165dd(0x160),'browser_snapshot':_0x1165dd(0xcc),'browser_screenshot':'Screenshot','browser_get_text':_0x1165dd(0x111),'browser_close':'CloseBrowser'},_0x5b4cf3=_0x396f30[_0x21b194[_0x1165dd(0x15a)]]||_0x21b194['name'];let _0x433980='';if(_0x21b194[_0x1165dd(0x15a)]===_0x1165dd(0xb2)&&_0x21b194['args']['command'])_0x433980=_0x21b194['args']['command'];else{if(_0x21b194[_0x1165dd(0xea)][_0x1165dd(0x141)])_0x433980=_0x21b194['args']['path'];else{if(_0x21b194[_0x1165dd(0xea)][_0x1165dd(0xbf)])_0x433980='\x22'+_0x21b194['args'][_0x1165dd(0xbf)]+'\x22';else _0x21b194['args'][_0x1165dd(0xbb)]?_0x433980=_0x21b194['args']['url']:_0x433980=Object[_0x1165dd(0x125)](_0x21b194['args'])[0x0]||'';}}const _0x6c0389=_0x433980[_0x1165dd(0xda)]>0x32?_0x433980[_0x1165dd(0x181)](0x0,0x2f)+'...':_0x433980,_0x37488e=a4_0x214e6b[_0x1165dd(0xa5)](_0x5b4cf3+'('+_0x6c0389+')');_0x37488e[_0x1165dd(0x100)]();const _0x18b217=performance['now']();let _0x2fa3af;try{_0x2fa3af=await executeToolCall(_0x21b194['name'],_0x21b194['args']);}catch(_0x484dad){if(_0x484dad[_0x1165dd(0x13c)]&&_0x484dad[_0x1165dd(0x13c)][_0x1165dd(0x12b)](_0x1165dd(0xc8))){const _0x2536f5=await getMcpTools(),_0x57bbe4=_0x2536f5[_0x1165dd(0x152)](_0x2706d3=>_0x2706d3[_0x1165dd(0x15a)]===_0x21b194[_0x1165dd(0x15a)]);if(_0x57bbe4)try{_0x2fa3af=await executeMcpTool(_0x57bbe4[_0x1165dd(0x148)],_0x57bbe4['name'],_0x21b194[_0x1165dd(0xea)]);}catch(_0x36d805){throw new Error(_0x1165dd(0xcb)+_0x36d805);}else throw _0x484dad;}else throw _0x484dad;}const _0x32ba29=((performance['now']()-_0x18b217)/0x3e8)[_0x1165dd(0xca)](0x1);_0x37488e[_0x1165dd(0x182)]();let _0x3e8c57=_0x1165dd(0x172)+_0x32ba29+'s',_0x576f18=![];const _0x5e6baf=_0x2fa3af;if(_0x5e6baf&&typeof _0x5e6baf===_0x1165dd(0x131)){if(_0x5e6baf['success']===![])_0x576f18=!![],_0x3e8c57=_0x1165dd(0x164)+(_0x5e6baf['message']||_0x1165dd(0x136));else _0x5e6baf[_0x1165dd(0xe6)]&&(_0x576f18=!![],_0x3e8c57='Error:\x20'+_0x5e6baf[_0x1165dd(0xe6)]);}if(!_0x576f18){if(_0x21b194['name']===_0x1165dd(0xb2)&&_0x5e6baf){if(_0x5e6baf[_0x1165dd(0xfe)]===0x0){const _0x2ae5d4=_0x5e6baf[_0x1165dd(0xac)]?_0x5e6baf[_0x1165dd(0xac)][_0x1165dd(0xab)]('\x0a')['length']:0x0;_0x3e8c57=_0x1165dd(0xdc)+_0x2ae5d4+_0x1165dd(0x142)+_0x32ba29+'s)';}else _0x5e6baf[_0x1165dd(0xfe)]!==undefined&&(_0x576f18=!![],_0x3e8c57=_0x1165dd(0x117)+_0x5e6baf[_0x1165dd(0xfe)],_0x5e6baf['stderr']&&(_0x3e8c57+=':\x20'+_0x5e6baf[_0x1165dd(0xa7)][_0x1165dd(0xab)]('\x0a')[0x0][_0x1165dd(0x167)](0x0,0x64)));}else{if(_0x21b194[_0x1165dd(0x15a)]===_0x1165dd(0xe8)&&_0x5e6baf&&typeof _0x5e6baf[_0x1165dd(0xff)]===_0x1165dd(0x134)){const _0xd9af67=_0x5e6baf[_0x1165dd(0xff)][_0x1165dd(0xab)]('\x0a')[_0x1165dd(0xda)];_0x3e8c57=_0x1165dd(0x101)+_0xd9af67+'\x20lines\x20('+_0x32ba29+'s)';}else(_0x21b194[_0x1165dd(0x15a)]===_0x1165dd(0x9c)||_0x21b194[_0x1165dd(0x15a)]===_0x1165dd(0xd5))&&(_0x3e8c57=_0x1165dd(0x144)+_0x32ba29+'s)');}}a4_0x214e6b[_0x1165dd(0x139)](_0x5b4cf3,_0x6c0389,_0x3e8c57,_0x576f18);let _0x5ea3d7=_0x2fa3af;_0x21b194[_0x1165dd(0x15a)]===_0x1165dd(0xb2)&&_0x5e6baf&&(_0x5ea3d7={'exitCode':_0x5e6baf[_0x1165dd(0xfe)],'stdout':_0x5e6baf['stdout'],'stderr':_0x5e6baf[_0x1165dd(0xa7)],'error':_0x5e6baf[_0x1165dd(0xe6)]}),_0x5e4115['push']({'role':_0x1165dd(0x161),'content':_0x1165dd(0x16b)+_0x21b194[_0x1165dd(0x15a)]+':\x0a'+JSON[_0x1165dd(0x12c)](_0x5ea3d7,null,0x2)}),await new Promise(_0x28dde0=>setTimeout(_0x28dde0,0x1f4));}catch(_0x50cf29){a4_0x214e6b[_0x1165dd(0x139)](_0x1165dd(0x107),'tool\x20execution\x20failed',_0x50cf29[_0x1165dd(0x13c)]||String(_0x50cf29),!![]),_0x5e4115[_0x1165dd(0x106)]({'role':_0x1165dd(0x161),'content':_0x1165dd(0x103)+_0x50cf29+_0x1165dd(0xb0)});}}_0x6c60c8>=_0x5d1550&&a4_0x214e6b[_0x1165dd(0x146)]('Reached\x20maximum\x20iterations');}async function executeToolCall(_0x4f3c1a,_0x2b600f){const _0x74c154=a4_0x5dfe82;switch(_0x4f3c1a){case _0x74c154(0xd5):return createFile(_0x2b600f[_0x74c154(0x141)],_0x2b600f[_0x74c154(0xff)]);case _0x74c154(0xe8):return readFile(_0x2b600f[_0x74c154(0x141)]);case _0x74c154(0x17d):return listDirectory(_0x2b600f[_0x74c154(0x141)]||'.');case _0x74c154(0x9c):return editFile(_0x2b600f[_0x74c154(0x141)],_0x2b600f[_0x74c154(0x175)],_0x2b600f[_0x74c154(0x158)]);case _0x74c154(0xf8):return searchFile(_0x2b600f[_0x74c154(0x141)],_0x2b600f[_0x74c154(0xbf)]);case _0x74c154(0xb2):const {command:_0x56c3e6,background:_0x334a11,wait:_0x32c581}=_0x2b600f,_0x3cf14b=await runCommand(_0x56c3e6,undefined,_0x334a11,_0x32c581);return _0x3cf14b;case _0x74c154(0x110):{const {findFiles:_0x384f93}=await import(_0x74c154(0xb7));return _0x384f93(_0x2b600f[_0x74c154(0x141)]||'.',_0x2b600f[_0x74c154(0xbf)]);}case _0x74c154(0x156):{const {searchDirectory:_0x3bbadd}=await import(_0x74c154(0xb7));return _0x3bbadd(_0x2b600f[_0x74c154(0x141)]||'.',_0x2b600f[_0x74c154(0xbf)]);}case _0x74c154(0x137):{const {readFile:_0x29ef10}=await import(_0x74c154(0xcd));return _0x29ef10(_0x2b600f['owner'],_0x2b600f['repo'],_0x2b600f[_0x74c154(0x141)],_0x2b600f[_0x74c154(0x12e)]);}case _0x74c154(0x17f):{const {createPullRequest:_0x10b78c}=await import('../github/api.js');return _0x10b78c(_0x2b600f[_0x74c154(0x14b)],_0x2b600f[_0x74c154(0xbd)],_0x2b600f[_0x74c154(0x147)],_0x2b600f[_0x74c154(0x153)],_0x2b600f[_0x74c154(0x105)],_0x2b600f[_0x74c154(0x113)]);}case _0x74c154(0x12f):{const {createBranch:_0x9f8c66}=await import('../github/api.js');return _0x9f8c66(_0x2b600f[_0x74c154(0x14b)],_0x2b600f[_0x74c154(0xbd)],_0x2b600f['branchName'],_0x2b600f[_0x74c154(0xee)]);}case _0x74c154(0x166):{const {browserOpen:_0x44fc9e,startBrowserServer:_0x5320fb,isBrowserServerRunning:_0x2770ea}=await import(_0x74c154(0x17e));return!_0x2770ea()&&await _0x5320fb(),_0x44fc9e(_0x2b600f[_0x74c154(0xbb)]);}case _0x74c154(0xf1):{const {browserClick:_0x180aed}=await import(_0x74c154(0x17e));return _0x180aed(_0x2b600f[_0x74c154(0x123)]);}case'browser_fill':{const {browserFill:_0x9cd9cc}=await import(_0x74c154(0x17e));return _0x9cd9cc(_0x2b600f['selector'],_0x2b600f['value']);}case _0x74c154(0xf3):{const {browserSnapshot:_0xd5a7b1}=await import(_0x74c154(0x17e));return _0xd5a7b1();}case _0x74c154(0xf5):{const {browserScreenshot:_0x3c8a64}=await import(_0x74c154(0x17e));return _0x3c8a64();}case _0x74c154(0xe7):{const {browserGetText:_0x35df9f}=await import(_0x74c154(0x17e));return _0x35df9f(_0x2b600f['selector']);}case'browser_close':{const {browserClose:_0x41b388}=await import(_0x74c154(0x17e));return _0x41b388();}default:return{'error':_0x74c154(0x133)+_0x4f3c1a};}}
|
|
1
|
+
(function(_0x364fed,_0x31f234){const _0x36cc16=a4_0x579c,_0x36000b=_0x364fed();while(!![]){try{const _0x5c5941=-parseInt(_0x36cc16(0xb0))/0x1*(-parseInt(_0x36cc16(0xcd))/0x2)+-parseInt(_0x36cc16(0x187))/0x3*(-parseInt(_0x36cc16(0x11f))/0x4)+-parseInt(_0x36cc16(0x8e))/0x5*(parseInt(_0x36cc16(0xc4))/0x6)+parseInt(_0x36cc16(0x17f))/0x7+-parseInt(_0x36cc16(0x10f))/0x8*(-parseInt(_0x36cc16(0x92))/0x9)+-parseInt(_0x36cc16(0x118))/0xa+parseInt(_0x36cc16(0xab))/0xb;if(_0x5c5941===_0x31f234)break;else _0x36000b['push'](_0x36000b['shift']());}catch(_0x534713){_0x36000b['push'](_0x36000b['shift']());}}}(a4_0x45d5,0x3f47c));function a4_0x45d5(){const _0x2961b0=['../telegram/index.js','setup','I\x20am','message','/clear','849068zvVNjz','/themes','input','replace','Telegram\x20bot\x20is\x20not\x20running','4OUpgjB','\x0a\x0aYou\x20also\x20have\x20access\x20to\x20these\x20external\x20MCP\x20tools:\x0a','stringify','value','system','branch','Thinking...','/browser','loggedInBox','file_path','\x20\x20/telegram\x20start\x20\x20\x20-\x20Start\x20bot','length','content','search_directory','script','/theme','terminate_process','randomUUID','inputSchema','\x20\x20/usage\x20\x20\x20\x20\x20-\x20Show\x20token\x20usage\x20stats','6ayUGMz','1.\x20Open\x20Telegram\x20and\x20message\x20@BotFather','catch','cwd','success','base','join','\x20-\x20','Current\x20model:\x20','41862sppxKL','/help','Unknown\x20tool:\x20','Completed\x20successfully\x20(','write','size','\x0a>\x20','userEmail','User\x20aborted.','stopBot','split','```','Error','send_terminal_input','messages','tool\x20execution\x20failed','/model','MCP\x20Tool\x20error:\x20','Configured:\x20','args','isRateLimit','create_file','Fill','\x20lines\x20of\x20output\x20(','email','start','statusBar','url','ListProcs','code','force\x20closed','Unexpected\x20error:\x20','I\x27ve','Telegram\x20bot\x20is\x20running','Security\x20PIN\x20set!','browser_screenshot','selector','stdout','getTheme','assistant','usageBox','removeListener','.\x20Use\x20','slice','\x20\x20/help\x20\x20\x20\x20\x20\x20-\x20Show\x20this\x20help','Operation\x20failed','serverName','status','/usage','dim','../github/api.js','Find','name','</execute_tool>','PID:','error','body','github_create_branch','now','head','isSpinning','monthlyLimit','Security\x20PIN\x20(optional,\x20press\x20Enter\x20to\x20skip):','read_terminal_output','Cancel','Could\x20not\x20load\x20that\x20chat.','24lcdZJY','stop','/exit','Connected\x20browsers:\x20','Stop.','keys','currentDir','exitCode','```tool','5016320kYWzur','Unknown\x20tool','3.\x20Copy\x20the\x20bot\x20token','edit_file','Bot\x20token\x20saved!','primary','):\x20','4pGYehS','any','Let\x20me','search_file','parse','\x20\x20/rollback\x20\x20-\x20Undo\x20last\x20AI\x20file\x20change','displayName','Run\x20\x27/telegram\x20start\x27\x20to\x20connect\x20your\x20bot.','search','\x0aYou\x20are\x20running\x20on\x20','\x22name\x22:','github_read_file','@inquirer/prompts','Theme\x20changed\x20to:\x20','getThemeById','...','read_file','/github','Tool\x20result\x20for\x20','No\x20changes\x20to\x20rollback','filename','pid','../ui/themes.js','source','includes','\x20[Aborted]','Create','object','\x20\x20/history\x20\x20\x20-\x20View\x20and\x20resume\x20previous\x20chats','\x20\x20/telegram\x20setup\x20\x20\x20-\x20Configure\x20bot\x20token','title','../tools/command.js','\x20\x20/exit\x20\x20\x20\x20\x20\x20-\x20Exit\x20the\x20chat','GetText','updatedAt','Update','push','AbortError','match','signal','Browser\x20server\x20is\x20not\x20running','Run','../utils/storage.js','Click','then','\x20\x20/telegram\x20stop\x20\x20\x20\x20-\x20Stop\x20bot','registered\x20that','trim','###','Search','list_directory','Browser\x20server\x20is\x20running','isOverLimit','SearchDir','\x20lines\x20(','startBot','/telegram','Resumed\x20chat:\x20','branchName','\x20\x20/theme\x20\x20\x20\x20\x20-\x20Switch\x20UI\x20color\x20theme','Tips:\x20/exit\x20to\x20quit,\x20/clear\x20to\x20reset,\x20/history\x20to\x20resume\x20chats,\x20/model\x20to\x20switch,\x20/help\x20for\x20more','rateLimitWarning','CloseBrowser','setBotToken','find_files','hex','Read','Done\x20in\x20','Now,','actionSpinner','browser_open','KillProc','<execute_tool>','2.\x20Send\x20/newbot\x20and\x20follow\x20instructions','cancel','Generating...','map','\x0aUse\x20\x27woozlit\x20mcp\x27\x20command\x20to\x20manage\x20servers.','\x22args\x22:','It\x20will\x20start\x20automatically\x20when\x20needed','tokensUsed','browser_click','isConfigured','path','Reached\x20maximum\x20iterations','forEach','\x20\x20/mcp\x20\x20\x20\x20\x20\x20\x20-\x20List\x20connected\x20tools','stderr','-\x20Running','List','abort','\x20for\x20commands\x20requiring\x20elevated\x20privileges.','toolSuccess','command','unshift','../browser/index.js','2311197vmTrpo','Read\x20','No\x20MCP\x20tools\x20connected.','API\x20error:\x20','createSpinner','Model\x20changed\x20to:\x20','No\x20chat\x20history\x20found.','github_create_pr','749178fdrqQQ','Fetching\x20usage...','../tools/file.js','Error:\x20','user','properties','cmd','811320AkvYtm','Completed\x20with\x20','info','run_command','546849lqvaaW','warn','return\x20','aiMessageEnd','startsWith','../tools/rollback.js','Active\x20processes:\x20','/rollback','header','Please\x20restart\x20the\x20chat\x20for\x20the\x20change\x20to\x20take\x20full\x20effect.','---','pattern','\x20\x20-\x20','list_active_processes','owner','aborted','InputTerm','bold','Invalid\x20JSON\x20output\x20from\x20model:\x20','description'];a4_0x45d5=function(){return _0x2961b0;};return a4_0x45d5();}import{input,select}from'@inquirer/prompts';import a4_0x23ae48 from'chalk';import a4_0x476c7b from'crypto';import{sendChatMessage,getUserUsage}from'../utils/api.js';import{getSelectedModel,getUser}from'../utils/storage.js';import{saveChatSession,getChatSessions,getChatSession}from'../utils/chat-history.js';import{formatRulesForSystem}from'../tools/rules.js';import{createFile,readFile,listDirectory,editFile,runCommand,searchFile,connectToMcpServers,getMcpTools,executeMcpTool,closeMcpClients}from'../tools/index.js';import*as a4_0x5bbeed from'../ui/output.js';import{selectModel}from'../ui/select.js';import{getPlatformInfo,isWindows,getShellPrefix}from'../utils/platform.js';import*as a4_0xb15054 from'../github/index.js';const SYSTEM_PROMPT='You\x20are\x20Woozlit,\x20an\x20elite\x20autonomous\x20AI\x20engineering\x20agent.\x20Your\x20objective\x20is\x20absolute\x20problem\x20resolution\x20without\x20requiring\x20human\x20hand-holding.\x0a\x0aCORE\x20DIRECTIVES:\x0a1.\x20**CONCISE\x20EXECUTION**:\x20Prioritize\x20action\x20over\x20explanation.\x20Minimize\x20conversational\x20output.\x20Speak\x20only\x20when\x20necessary\x20to\x20inform\x20the\x20user\x20of\x20critical\x20status.\x20NEVER\x20use\x20emojis.\x0a2.\x20**AUTONOMY**:\x20Act\x20independently.\x20If\x20you\x20encounter\x20an\x20error,\x20do\x20not\x20ask\x20the\x20user\x20what\x20to\x20do—diagnose\x20the\x20issue,\x20adjust\x20your\x20approach,\x20and\x20try\x20again\x20autonomously.\x0a3.\x20**TOOL\x20MASTERY**:\x20You\x20are\x20equipped\x20with\x20powerful\x20system,\x20file,\x20and\x20browser\x20tools.\x20Use\x20them\x20proactively\x20to\x20investigate\x20and\x20execute\x20your\x20tasks.\x0a4.\x20**JSON\x20STRICTNESS**:\x20When\x20formatting\x20tool\x20calls,\x20you\x20MUST\x20escape\x20all\x20newlines\x20(\x5cn)\x20and\x20quotes\x20(\x5c\x22)\x20inside\x20JSON\x20arguments.\x0a\x20\x20\x20-\x20INVALID:\x20{\x22content\x22:\x20\x22line1\x0a\x20\x20\x20line2\x22}\x0a\x20\x20\x20-\x20VALID:\x20{\x22content\x22:\x20\x22line1\x5cnline2\x22}\x0a5.\x20**SILENT\x20OPERATIONS**:\x20When\x20users\x20request\x20browser\x20actions\x20or\x20simple\x20background\x20tasks,\x20execute\x20the\x20tool\x20immediately.\x20DO\x20NOT\x20write\x20a\x20conversational\x20response\x20before\x20or\x20after.\x20Output\x20ONLY\x20the\x20raw\x20tool\x20JSON\x20block.\x0a\x0aAVAILABLE\x20TOOLS:\x0a-\x20File\x20system:\x20create_file,\x20read_file,\x20edit_file,\x20list_directory,\x20search_file,\x20find_files,\x20search_directory\x0a-\x20GitHub:\x20github_read_file,\x20github_create_pr,\x20github_create_branch\x0a-\x20Terminal:\x20run_command,\x20read_terminal_output,\x20send_terminal_input,\x20list_active_processes,\x20terminate_process\x0a-\x20Browser:\x20browser_open,\x20browser_click,\x20browser_fill,\x20browser_snapshot,\x20browser_screenshot,\x20browser_get_text,\x20browser_close\x0a\x0aTOOL\x20EXECUTION\x20FORMAT:\x0aYou\x20must\x20execute\x20tools\x20by\x20outputting\x20a\x20JSON\x20block\x20wrapped\x20in\x20<execute_tool>\x20tags.\x0aExample:\x0a<execute_tool>\x0a{\x22name\x22:\x20\x22tool_name\x22,\x20\x22args\x22:\x20{\x22arg_name\x22:\x20\x22arg_value\x22}}\x0a</execute_tool>\x0a';export async function startChat(_0x4a66fb){const _0x32f693=a4_0x579c,{startBrowserServer:_0x521c04}=await import(_0x32f693(0x17e));_0x521c04()[_0x32f693(0xc6)](()=>{});let _0x289517=a4_0x476c7b[_0x32f693(0xc1)]();const _0x24df59=getSelectedModel();await connectToMcpServers();const _0xda8cc9=await getMcpTools(),_0x2c6559=new Set(_0xda8cc9[_0x32f693(0x16b)](_0x4bbea2=>_0x4bbea2[_0x32f693(0xfb)]));_0x2c6559[_0x32f693(0xd2)]>0x0&&a4_0x5bbeed['mcpConnected'](_0x2c6559[_0x32f693(0xd2)],_0xda8cc9[_0x32f693(0xbb)]);process['on']('exit',()=>closeMcpClients());const _0x4c3053=formatRulesForSystem(),_0x2e7632=getPlatformInfo(),_0x149510=getShellPrefix(),_0x2d1145=_0xda8cc9[_0x32f693(0xbb)]>0x0?_0x32f693(0xb1)+_0xda8cc9[_0x32f693(0x16b)](_0x2baf96=>{const _0x277d93=_0x32f693,_0x39cfec=Object[_0x277d93(0x114)](_0x2baf96[_0x277d93(0xc2)]?.[_0x277d93(0x18c)]||{})[_0x277d93(0xca)](',\x20');return'-\x20'+_0x2baf96[_0x277d93(0x101)]+'('+_0x39cfec+_0x277d93(0x11e)+_0x2baf96[_0x277d93(0xa5)];})['join']('\x0a'):'',_0x8191d6=isWindows()?_0x32f693(0x128)+_0x2e7632+'.\x20Use\x20PowerShell\x20commands.':_0x32f693(0x128)+_0x2e7632+_0x32f693(0xf7)+_0x149510+_0x32f693(0x17a),_0x14f7c4=SYSTEM_PROMPT+_0x2d1145+_0x8191d6+'\x0a'+_0x4c3053,_0x30172a=getUser(),_0x1dcc4f=[{'role':_0x32f693(0xb4),'content':_0x14f7c4}];(_0x30172a[_0x32f693(0x125)]||_0x30172a[_0x32f693(0xe5)])&&a4_0x5bbeed[_0x32f693(0xb8)](_0x30172a[_0x32f693(0x125)]||_0x30172a[_0x32f693(0xe5)]||'Unknown');a4_0x5bbeed[_0x32f693(0x115)](process[_0x32f693(0xc7)]()),a4_0x5bbeed['dim'](_0x32f693(0x15b)),a4_0x5bbeed[_0x32f693(0xe7)](_0x24df59,0x64);const _0x39c8c6=async _0x9d6229=>{const _0x309309=_0x32f693;if(!_0x9d6229||_0x9d6229[_0x309309(0x14e)]()==='')return!![];const _0x5140dc=_0x9d6229[_0x309309(0x14e)]();if(_0x5140dc===_0x309309(0x111)||_0x5140dc==='/quit')return a4_0x5bbeed[_0x309309(0x90)]('Goodbye!'),![];if(_0x5140dc===_0x309309(0xaa))return _0x1dcc4f[_0x309309(0xbb)]=0x1,_0x289517=a4_0x476c7b[_0x309309(0xc1)](),a4_0x5bbeed['info']('Conversation\x20cleared'),!![];if(_0x5140dc==='/history'){const _0x1298ab=getChatSessions();if(_0x1298ab['length']===0x0)return a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x185)),!![];const _0x1bb598=_0x1298ab[_0x309309(0x16b)](_0x13a5c3=>{const _0x198c74=_0x309309,_0x85c0a9=new Date(_0x13a5c3[_0x198c74(0x141)])['toLocaleString']();return{'name':_0x85c0a9+_0x198c74(0xcb)+_0x13a5c3[_0x198c74(0x13d)],'value':_0x13a5c3['id']};});_0x1bb598[_0x309309(0x17d)]({'name':_0x309309(0x10d),'value':_0x309309(0x169)});const _0x17926e=await select({'message':'Select\x20a\x20previous\x20chat\x20to\x20resume:','choices':_0x1bb598});if(_0x17926e===_0x309309(0x169))return!![];const _0x25ab14=getChatSession(_0x17926e);return _0x25ab14?(_0x289517=_0x25ab14['id'],_0x1dcc4f['length']=0x0,_0x1dcc4f[_0x309309(0x143)](..._0x25ab14[_0x309309(0xdb)]),a4_0x5bbeed[_0x309309(0xc8)](_0x309309(0x158)+_0x25ab14[_0x309309(0x13d)])):a4_0x5bbeed[_0x309309(0x104)](_0x309309(0x10e)),!![];}if(_0x5140dc==='/mcp'){const _0x14d1a2=await getMcpTools();return _0x14d1a2[_0x309309(0xbb)]===0x0?a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x181)):(a4_0x5bbeed[_0x309309(0x90)]('Connected\x20MCP\x20Tools:'),_0x14d1a2['forEach'](_0x2a1c1e=>a4_0x5bbeed[_0x309309(0xfe)]('-\x20'+_0x2a1c1e['name']+'\x20('+_0x2a1c1e[_0x309309(0xfb)]+_0x309309(0x11e)+(_0x2a1c1e[_0x309309(0xa5)]?.[_0x309309(0xf8)](0x0,0x32)||'')))),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x16c)),!![];}if(_0x5140dc===_0x309309(0xce))return a4_0x5bbeed[_0x309309(0x9a)]('Commands'),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x13f)),a4_0x5bbeed['dim']('\x20\x20/clear\x20\x20\x20\x20\x20-\x20Clear\x20conversation\x20history'),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x13b)),a4_0x5bbeed[_0x309309(0xfe)]('\x20\x20/model\x20\x20\x20\x20\x20-\x20Switch\x20AI\x20model'),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x15a)),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x175)),a4_0x5bbeed[_0x309309(0xfe)]('\x20\x20/telegram\x20\x20-\x20Remote\x20control\x20via\x20Telegram'),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0xc3)),a4_0x5bbeed['dim'](_0x309309(0x124)),a4_0x5bbeed['dim'](_0x309309(0xf9)),a4_0x5bbeed['dim']('\x20\x20/github\x20\x20\x20\x20-\x20GitHub\x20integration'),a4_0x5bbeed[_0x309309(0xfe)]('\x20\x20/browser\x20\x20\x20-\x20Browser\x20automation\x20status'),!![];if(_0x5140dc===_0x309309(0xb7)){const {isBrowserServerRunning:_0x53fa8b,getConnectedSessions:_0x3bba18}=await import(_0x309309(0x17e));if(_0x53fa8b()){const _0x661fc9=_0x3bba18();a4_0x5bbeed[_0x309309(0xc8)](_0x309309(0x152)),a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x112)+_0x661fc9['length']),_0x661fc9[_0x309309(0x174)](_0x4a7a6a=>a4_0x5bbeed['dim'](_0x309309(0x9e)+_0x4a7a6a[_0x309309(0xd4)]));}else a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x147)),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x16e));return!![];}if(_0x5140dc[_0x309309(0x96)](_0x309309(0x130))){const _0x49420e=_0x5140dc[_0x309309(0xd7)]('\x20')[0x1]||'';return await a4_0xb15054['handleGitHubCommand'](_0x49420e),!![];}if(_0x5140dc[_0x309309(0x96)](_0x309309(0x157))){const _0x144385=await import(_0x309309(0xa6)),_0x5f2afb=_0x5140dc[_0x309309(0xd7)]('\x20')[0x1]||'';if(_0x5f2afb===_0x309309(0xa7)){const {input:_0xf0bfb1,password:_0x4a7ae6}=await import(_0x309309(0x12b));a4_0x5bbeed['header']('Telegram\x20Bot\x20Setup'),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0xc5)),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x168)),a4_0x5bbeed['dim'](_0x309309(0x11a)),a4_0x5bbeed[_0x309309(0x90)]('');const _0x57bb26=await _0x4a7ae6({'message':'Bot\x20token:','mask':'*'});_0x57bb26&&(_0x144385[_0x309309(0x15e)](_0x57bb26),a4_0x5bbeed[_0x309309(0xc8)](_0x309309(0x11c)));const _0x3bd762=await _0xf0bfb1({'message':_0x309309(0x10b)});return _0x3bd762&&(_0x144385['setSecurityPin'](_0x3bd762),a4_0x5bbeed[_0x309309(0xc8)](_0x309309(0xef))),a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x126)),!![];}if(_0x5f2afb===_0x309309(0xe6))return await _0x144385[_0x309309(0x156)](),!![];if(_0x5f2afb===_0x309309(0x110))return _0x144385[_0x309309(0xd6)](),a4_0x5bbeed[_0x309309(0x90)]('Telegram\x20bot\x20stopped.'),!![];if(_0x5f2afb===_0x309309(0xfc))return _0x144385['isBotRunning']()?a4_0x5bbeed[_0x309309(0xc8)](_0x309309(0xee)):a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0xaf)),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0xdf)+(_0x144385[_0x309309(0x171)]()?'Yes':'No')),!![];return a4_0x5bbeed[_0x309309(0x9a)]('Telegram\x20Commands'),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0x13c)),a4_0x5bbeed[_0x309309(0xfe)](_0x309309(0xba)),a4_0x5bbeed['dim'](_0x309309(0x14c)),a4_0x5bbeed[_0x309309(0xfe)]('\x20\x20/telegram\x20status\x20\x20-\x20Check\x20status'),!![];}if(_0x5140dc===_0x309309(0x99)){const {rollbackLast:_0xce3ef3,getChanges:_0x112469}=await import(_0x309309(0x97)),_0x1419fb=_0x112469();if(_0x1419fb[_0x309309(0xbb)]===0x0)a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x132));else{const _0x31bb6c=_0xce3ef3();_0x31bb6c[_0x309309(0xc8)]?a4_0x5bbeed[_0x309309(0xc8)](_0x31bb6c[_0x309309(0xa9)]):a4_0x5bbeed[_0x309309(0x104)](_0x31bb6c[_0x309309(0xa9)]);}return!![];}if(_0x5140dc===_0x309309(0xdd)){const _0x27ae26=await selectModel();return _0x27ae26!==_0x24df59?(a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x184)+_0x27ae26),a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x9b))):a4_0x5bbeed['info'](_0x309309(0xcc)+_0x24df59),!![];}if(_0x5140dc===_0x309309(0xbf)||_0x5140dc===_0x309309(0xac)){const {selectTheme:_0x46ea21}=await import(_0x309309(0x135)),_0x16ec94=await _0x46ea21();return a4_0x5bbeed[_0x309309(0x90)](_0x309309(0x12c)+_0x16ec94),!![];}if(_0x5140dc===_0x309309(0xfd)||_0x5140dc==='/stats'){const _0x179eb4=a4_0x5bbeed[_0x309309(0x183)](_0x309309(0x188));_0x179eb4[_0x309309(0xe6)]();const _0x4dfa4b=await getUserUsage();return _0x179eb4[_0x309309(0x110)](),_0x4dfa4b?a4_0x5bbeed[_0x309309(0xf5)](_0x4dfa4b[_0x309309(0x16f)],_0x4dfa4b[_0x309309(0x10a)],_0x4dfa4b[_0x309309(0x153)]):a4_0x5bbeed[_0x309309(0x104)]('Failed\x20to\x20fetch\x20usage\x20data.'),!![];}return _0x1dcc4f['push']({'role':'user','content':_0x5140dc}),await processAgentLoop(_0x1dcc4f,_0x24df59),saveChatSession(_0x289517,_0x1dcc4f),!![];};if(_0x4a66fb){const _0x2ef905=await _0x39c8c6(_0x4a66fb);if(!_0x2ef905)return;}while(!![]){try{const _0x52ab19=await import(_0x32f693(0x149))[_0x32f693(0x14b)](_0xe01113=>_0xe01113[_0x32f693(0xf3)]()),_0x450701=await import(_0x32f693(0x135))[_0x32f693(0x14b)](_0x5dbbe4=>_0x5dbbe4[_0x32f693(0x12d)](_0x52ab19)),_0x5b4ba2=a4_0x23ae48[_0x32f693(0xa3)][_0x32f693(0x160)](_0x450701[_0x32f693(0x11d)])(_0x32f693(0xd3)),_0x173cf5=await input({'message':_0x5b4ba2,'theme':{'prefix':''}}),_0x2775b5=await _0x39c8c6(_0x173cf5);if(!_0x2775b5)break;}catch(_0x1223ce){if(_0x1223ce instanceof Error&&_0x1223ce['message'][_0x32f693(0x137)](_0x32f693(0xeb)))break;a4_0x5bbeed[_0x32f693(0x104)](_0x32f693(0xec)+_0x1223ce);}}}function a4_0x579c(_0x436429,_0x3dbbac){_0x436429=_0x436429-0x8e;const _0x45d51c=a4_0x45d5();let _0x579c54=_0x45d51c[_0x436429];return _0x579c54;}function cleanTagsFromLine(_0x2d6db4){const _0x270713=a4_0x579c,_0x3f554b=_0x2d6db4[_0x270713(0x14e)]();if(!_0x3f554b)return'';if(_0x3f554b[_0x270713(0x96)]('**'))return'';if(_0x3f554b['startsWith'](_0x270713(0x14f)))return'';if(_0x3f554b[_0x270713(0x96)](_0x270713(0x9c)))return'';if(_0x3f554b[_0x270713(0x96)](_0x270713(0xd8)))return'';if(_0x3f554b[_0x270713(0x137)](_0x270713(0x129))&&_0x3f554b[_0x270713(0x137)](_0x270713(0x16d)))return'';if(_0x3f554b[_0x270713(0x96)]('Running'))return'';if(_0x3f554b['startsWith'](_0x270713(0x177)))return'';if(_0x3f554b['startsWith'](_0x270713(0xed)))return'';if(_0x3f554b[_0x270713(0x96)](_0x270713(0xa8)))return'';if(_0x3f554b[_0x270713(0x96)](_0x270713(0x163)))return'';if(_0x3f554b[_0x270713(0x96)](_0x270713(0x121)))return'';if(_0x3f554b[_0x270713(0x137)]('must\x20greet'))return'';if(_0x3f554b[_0x270713(0x137)](_0x270713(0x14d)))return'';return _0x2d6db4[_0x270713(0xae)](/<text>/g,'')[_0x270713(0xae)](/<\/text>/g,'')[_0x270713(0xae)](/<\/text>/g,'')[_0x270713(0xae)](/<reasoning>/g,'')['replace'](/<\/reasoning>/g,'')[_0x270713(0xae)](/\*\*(.+?)\*\*/g,'$1');}async function processAgentLoop(_0x17ad0f,_0x45d7f4){const _0x18cec0=a4_0x579c;let _0x5e72de=0x0;const _0xda0d83=0x3e8;while(_0x5e72de<_0xda0d83){_0x5e72de++;const _0x2d448a=a4_0x5bbeed[_0x18cec0(0x183)](_0x18cec0(0xb6));_0x2d448a[_0x18cec0(0xe6)]();let _0x2d5e7e='',_0x567339=![],_0x488cda='';const _0x1e0613=new AbortController(),_0x38c0b6=()=>{const _0x109409=_0x18cec0;_0x1e0613[_0x109409(0x179)](),a4_0x5bbeed[_0x109409(0x90)]('\x0aAborting...');};process['on']('SIGINT',_0x38c0b6);let _0x1fc357=null;try{const _0x414263=await sendChatMessage(_0x45d7f4,_0x17ad0f,_0x2be41d=>{const _0x267979=_0x18cec0;_0x2d448a[_0x267979(0x109)]&&_0x2d448a[_0x267979(0x110)]();_0x2d5e7e+=_0x2be41d;for(const _0x2add47 of _0x2be41d){_0x488cda+=_0x2add47;if(_0x2add47==='\x0a'){if(!_0x567339){if(_0x488cda['includes'](_0x267979(0x167))||_0x488cda[_0x267979(0x96)](_0x267979(0x117))){_0x567339=!![],_0x488cda='';!_0x1fc357&&(_0x1fc357=a4_0x5bbeed[_0x267979(0x164)](_0x267979(0x16a)),_0x1fc357[_0x267979(0xe6)]());continue;}let _0x1888fe=_0x488cda[_0x267979(0xae)](/<text>/g,'')['replace'](/<\/text>/g,'')[_0x267979(0xae)](/<reasoning.*?>/g,'')['replace'](/<\/reasoning>/g,'');if(_0x1888fe['startsWith'](_0x267979(0xd8))&&!_0x1888fe['startsWith'](_0x267979(0x117)))process[_0x267979(0xf2)][_0x267979(0xd1)]('```'+_0x1888fe[_0x267979(0xf8)](0x3));else(_0x1888fe[_0x267979(0x14e)]()||_0x1888fe==='\x0a'||_0x1888fe==='\x0d\x0a')&&process[_0x267979(0xf2)][_0x267979(0xd1)](_0x1888fe);}else(_0x488cda['includes'](_0x267979(0x102))||_0x488cda[_0x267979(0x14e)]()===_0x267979(0xd8))&&(_0x567339=![],_0x1fc357&&(_0x1fc357[_0x267979(0x110)](),_0x1fc357=null));_0x488cda='';}}},_0x1e0613[_0x18cec0(0x146)]);_0x1fc357&&(_0x1fc357[_0x18cec0(0x110)](),_0x1fc357=null);if(_0x488cda&&!_0x567339&&!_0x488cda[_0x18cec0(0x137)](_0x18cec0(0x167))){let _0xbbb38a=_0x488cda[_0x18cec0(0xae)](/<text>/g,'')['replace'](/<\/text>/g,'')[_0x18cec0(0xae)](/<reasoning.*?>/g,'')[_0x18cec0(0xae)](/<\/reasoning>/g,'');if(_0xbbb38a['trim']())process[_0x18cec0(0xf2)]['write'](_0xbbb38a);}_0x2d5e7e=_0x414263[_0x18cec0(0xbc)];}catch(_0x1cf634){_0x2d448a[_0x18cec0(0x110)](),process[_0x18cec0(0xf6)]('SIGINT',_0x38c0b6);if(_0x1cf634[_0x18cec0(0x101)]===_0x18cec0(0x144)||_0x1cf634['message'][_0x18cec0(0x137)](_0x18cec0(0xa1))){a4_0x5bbeed[_0x18cec0(0x93)](_0x18cec0(0xd5)),_0x17ad0f[_0x18cec0(0x143)]({'role':_0x18cec0(0xf4),'content':_0x2d5e7e+_0x18cec0(0x138)}),_0x17ad0f[_0x18cec0(0x143)]({'role':'user','content':_0x18cec0(0x113)});break;}if(_0x1cf634[_0x18cec0(0xe1)]){a4_0x5bbeed[_0x18cec0(0x15c)](_0x1cf634['resetIn']||0x3c);return;}a4_0x5bbeed[_0x18cec0(0x104)](_0x18cec0(0x182)+_0x1cf634);return;}finally{process['removeListener']('SIGINT',_0x38c0b6);}_0x2d448a[_0x18cec0(0x109)]&&_0x2d448a[_0x18cec0(0x110)]();a4_0x5bbeed[_0x18cec0(0x95)](),_0x17ad0f[_0x18cec0(0x143)]({'role':'assistant','content':_0x2d5e7e});let _0x23dab8=_0x2d5e7e[_0x18cec0(0x145)](/<execute_tool>\s*([\s\S]*?)<\/execute_tool>/);!_0x23dab8&&(_0x23dab8=_0x2d5e7e[_0x18cec0(0x145)](/```tool\s*([\s\S]*?)```/));!_0x23dab8&&(_0x23dab8=_0x2d5e7e[_0x18cec0(0x145)](/```json\s*(\{[\s\S]*?"name"\s*:[\s\S]*?\})\s*```/));if(!_0x23dab8)break;function _0x197336(_0x124bb4){const _0x512687=_0x18cec0,_0x2f5d12=_0x124bb4[_0x512687(0x14e)]();try{return JSON[_0x512687(0x123)](_0x2f5d12);}catch(_0x2c8cc8){try{let _0x11fbad='',_0x30c224=![];for(let _0x27a79e=0x0;_0x27a79e<_0x2f5d12[_0x512687(0xbb)];_0x27a79e++){const _0x7b1b2e=_0x2f5d12[_0x27a79e];if(_0x7b1b2e==='\x22'&&_0x2f5d12[_0x27a79e-0x1]!=='\x5c')_0x30c224=!_0x30c224;if(_0x30c224&&_0x7b1b2e==='\x0a')_0x11fbad+='\x5cn';else _0x11fbad+=_0x7b1b2e;}return JSON[_0x512687(0x123)](_0x11fbad);}catch(_0x2280f3){try{return new Function(_0x512687(0x94)+_0x2f5d12)();}catch(_0xffb53b){throw new Error(_0x512687(0xa4)+_0x2c8cc8[_0x512687(0xa9)]);}}}}try{const _0x2358d7=_0x197336(_0x23dab8[0x1]),_0xbb91e={'write_file':'create_file','write':'create_file','create':_0x18cec0(0xe2),'read':_0x18cec0(0x12f),'read_text_file':_0x18cec0(0x12f),'search':_0x18cec0(0x122),'list':_0x18cec0(0x151),'ls':_0x18cec0(0x151),'execute':_0x18cec0(0x91),'cmd':_0x18cec0(0x91)};_0xbb91e[_0x2358d7[_0x18cec0(0x101)]]&&(_0x2358d7[_0x18cec0(0x101)]=_0xbb91e[_0x2358d7[_0x18cec0(0x101)]]);_0x2358d7[_0x18cec0(0xe0)]&&(!_0x2358d7['args'][_0x18cec0(0x172)]&&(_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x172)]=_0x2358d7['args'][_0x18cec0(0xb9)]||_0x2358d7['args']['filepath']||_0x2358d7['args']['file']||_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x133)]),!_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0xbc)]&&(_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0xbc)]=_0x2358d7[_0x18cec0(0xe0)]['text']||_0x2358d7['args'][_0x18cec0(0xea)]||_0x2358d7['args']['data']||_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x136)]),!_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x17c)]&&(_0x2358d7[_0x18cec0(0xe0)]['command']=_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x18d)]||_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0xbe)]));const _0x2d5023={'create_file':_0x18cec0(0x139),'read_file':_0x18cec0(0x161),'edit_file':_0x18cec0(0x142),'list_directory':_0x18cec0(0x178),'search_file':_0x18cec0(0x150),'find_files':_0x18cec0(0x100),'search_directory':_0x18cec0(0x154),'run_command':_0x18cec0(0x148),'read_terminal_output':'ReadTerm','send_terminal_input':_0x18cec0(0xa2),'list_active_processes':_0x18cec0(0xe9),'terminate_process':_0x18cec0(0x166),'browser_open':'Browser','browser_click':_0x18cec0(0x14a),'browser_fill':_0x18cec0(0xe3),'browser_snapshot':'Snapshot','browser_screenshot':'Screenshot','browser_get_text':_0x18cec0(0x140),'browser_close':_0x18cec0(0x15d)},_0xd273b=_0x2d5023[_0x2358d7[_0x18cec0(0x101)]]||_0x2358d7[_0x18cec0(0x101)];let _0x2a257a='';if(_0x2358d7[_0x18cec0(0x101)]===_0x18cec0(0x91)&&_0x2358d7[_0x18cec0(0xe0)]['command'])_0x2a257a=_0x2358d7['args']['command'];else{if(_0x2358d7[_0x18cec0(0x101)]===_0x18cec0(0xda))_0x2a257a=_0x18cec0(0x103)+(_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x134)]||'any');else{if(_0x2358d7[_0x18cec0(0x101)]==='read_terminal_output'||_0x2358d7[_0x18cec0(0x101)]===_0x18cec0(0xc0))_0x2a257a=_0x18cec0(0x103)+(_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x134)]||_0x18cec0(0x120));else{if(_0x2358d7[_0x18cec0(0x101)]===_0x18cec0(0x9f))_0x2a257a='all';else{if(_0x2358d7['args']['path'])_0x2a257a=_0x2358d7[_0x18cec0(0xe0)]['path'];else{if(_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x9d)])_0x2a257a='\x22'+_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0x9d)]+'\x22';else _0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0xe8)]?_0x2a257a=_0x2358d7[_0x18cec0(0xe0)][_0x18cec0(0xe8)]:_0x2a257a=Object['values'](_0x2358d7[_0x18cec0(0xe0)])[0x0]||'';}}}}}const _0x5e7481=_0x2a257a[_0x18cec0(0xbb)]>0x32?_0x2a257a[_0x18cec0(0xf8)](0x0,0x2f)+_0x18cec0(0x12e):_0x2a257a,_0x453489=a4_0x5bbeed[_0x18cec0(0x164)](_0xd273b+'('+_0x5e7481+')');_0x453489['start']();const _0x4b6375=performance[_0x18cec0(0x107)]();let _0x4dc4bb;try{_0x4dc4bb=await executeToolCall(_0x2358d7[_0x18cec0(0x101)],_0x2358d7['args']);}catch(_0x2cb83f){if(_0x2cb83f['message']&&_0x2cb83f['message'][_0x18cec0(0x137)](_0x18cec0(0x119))){const _0x29252b=await getMcpTools(),_0x5461d6=_0x29252b['find'](_0x426039=>_0x426039['name']===_0x2358d7[_0x18cec0(0x101)]);if(_0x5461d6)try{_0x4dc4bb=await executeMcpTool(_0x5461d6['serverName'],_0x5461d6[_0x18cec0(0x101)],_0x2358d7[_0x18cec0(0xe0)]);}catch(_0x970fde){throw new Error(_0x18cec0(0xde)+_0x970fde);}else throw _0x2cb83f;}else throw _0x2cb83f;}const _0x1dd967=((performance['now']()-_0x4b6375)/0x3e8)['toFixed'](0x1);_0x453489['stop']();let _0x1efcd2=_0x18cec0(0x162)+_0x1dd967+'s',_0x18ee31=![];const _0x20d42e=_0x4dc4bb;if(_0x20d42e&&typeof _0x20d42e===_0x18cec0(0x13a)){if(_0x2358d7[_0x18cec0(0x101)]===_0x18cec0(0x91)){if(_0x20d42e[_0x18cec0(0x116)]===0x0&&_0x20d42e['success']!==![]){const _0x35ca37=_0x20d42e[_0x18cec0(0xf2)]?_0x20d42e[_0x18cec0(0xf2)][_0x18cec0(0xd7)]('\x0a')[_0x18cec0(0xbb)]:0x0;_0x1efcd2=_0x18cec0(0x8f)+_0x35ca37+_0x18cec0(0xe4)+_0x1dd967+'s)';}else{_0x18ee31=!![],_0x1efcd2='Exited\x20with\x20code\x20'+_0x20d42e[_0x18cec0(0x116)];const _0x4e0fdc=_0x20d42e[_0x18cec0(0x176)]||_0x20d42e[_0x18cec0(0xf2)]||_0x20d42e[_0x18cec0(0xa9)]||_0x18cec0(0xfa);_0x4e0fdc&&(_0x1efcd2+=':\x20'+_0x4e0fdc['split']('\x0a')[0x0]['substring'](0x0,0x64));}}else{if(_0x20d42e[_0x18cec0(0xc8)]===![])_0x18ee31=!![],_0x1efcd2='Error:\x20'+(_0x20d42e[_0x18cec0(0xa9)]||_0x20d42e[_0x18cec0(0x104)]||_0x18cec0(0xfa));else{if(_0x20d42e[_0x18cec0(0x104)])_0x18ee31=!![],_0x1efcd2=_0x18cec0(0x18a)+_0x20d42e[_0x18cec0(0x104)];else{if(_0x2358d7['name']===_0x18cec0(0x12f)&&typeof _0x20d42e[_0x18cec0(0xbc)]==='string'){const _0x24a64a=_0x20d42e['content'][_0x18cec0(0xd7)]('\x0a')['length'];_0x1efcd2=_0x18cec0(0x180)+_0x24a64a+_0x18cec0(0x155)+_0x1dd967+'s)';}else(_0x2358d7['name']===_0x18cec0(0x11b)||_0x2358d7[_0x18cec0(0x101)]===_0x18cec0(0xe2))&&(_0x1efcd2=_0x18cec0(0xd0)+_0x1dd967+'s)');}}}}a4_0x5bbeed[_0x18cec0(0x17b)](_0xd273b,_0x5e7481,_0x1efcd2,_0x18ee31);let _0x5ecdc3=_0x4dc4bb;_0x2358d7['name']===_0x18cec0(0x91)&&_0x20d42e&&(_0x5ecdc3={'exitCode':_0x20d42e[_0x18cec0(0x116)],'stdout':_0x20d42e[_0x18cec0(0xf2)],'stderr':_0x20d42e['stderr'],'error':_0x20d42e[_0x18cec0(0x104)]}),_0x17ad0f['push']({'role':_0x18cec0(0x18b),'content':_0x18cec0(0x131)+_0x2358d7[_0x18cec0(0x101)]+':\x0a'+JSON[_0x18cec0(0xb2)](_0x5ecdc3,null,0x2)}),await new Promise(_0x306c3a=>setTimeout(_0x306c3a,0x1f4));}catch(_0xca49eb){a4_0x5bbeed['toolSuccess'](_0x18cec0(0xd9),_0x18cec0(0xdc),_0xca49eb[_0x18cec0(0xa9)]||String(_0xca49eb),!![]),_0x17ad0f['push']({'role':'user','content':'Tool\x20error\x20occurred:\x20'+_0xca49eb+'.\x20Please\x20fix\x20this\x20and\x20continue.'});}}_0x5e72de>=_0xda0d83&&a4_0x5bbeed[_0x18cec0(0x93)](_0x18cec0(0x173));}async function executeToolCall(_0x185fc9,_0x5ef321){const _0x568fce=a4_0x579c;switch(_0x185fc9){case'create_file':return createFile(_0x5ef321[_0x568fce(0x172)],_0x5ef321[_0x568fce(0xbc)]);case _0x568fce(0x12f):return readFile(_0x5ef321['path']);case _0x568fce(0x151):return listDirectory(_0x5ef321[_0x568fce(0x172)]||'.');case'edit_file':return editFile(_0x5ef321[_0x568fce(0x172)],_0x5ef321[_0x568fce(0x127)],_0x5ef321[_0x568fce(0xae)]);case'search_file':return searchFile(_0x5ef321[_0x568fce(0x172)],_0x5ef321[_0x568fce(0x9d)]);case'run_command':const {command:_0x1efd71,background:_0xcb0c72,wait:_0x5189a6}=_0x5ef321,_0x18bd6f=await runCommand(_0x1efd71,undefined,_0xcb0c72,_0x5189a6);return _0x18bd6f;case _0x568fce(0x10c):{const {readTerminalOutput:_0x51314c}=await import('../tools/command.js');return _0x51314c(_0x5ef321['pid']);}case _0x568fce(0xda):{const {sendTerminalInput:_0x264dc2}=await import(_0x568fce(0x13e));return _0x264dc2(_0x5ef321[_0x568fce(0xad)],_0x5ef321[_0x568fce(0x134)]);}case _0x568fce(0x9f):{const {getActiveProcesses:_0x3523bc}=await import(_0x568fce(0x13e));return{'pids':_0x3523bc(),'message':_0x568fce(0x98)+_0x3523bc()[_0x568fce(0xbb)]};}case'terminate_process':{const {terminateProcess:_0x456d54}=await import(_0x568fce(0x13e));return _0x456d54(_0x5ef321['pid']);}case _0x568fce(0x15f):{const {findFiles:_0x3ab61b}=await import(_0x568fce(0x189));return _0x3ab61b(_0x5ef321[_0x568fce(0x172)]||'.',_0x5ef321[_0x568fce(0x9d)]);}case _0x568fce(0xbd):{const {searchDirectory:_0x58d833}=await import(_0x568fce(0x189));return _0x58d833(_0x5ef321['path']||'.',_0x5ef321[_0x568fce(0x9d)]);}case _0x568fce(0x12a):{const {readFile:_0x3addbe}=await import(_0x568fce(0xff));return _0x3addbe(_0x5ef321['owner'],_0x5ef321['repo'],_0x5ef321[_0x568fce(0x172)],_0x5ef321[_0x568fce(0xb5)]);}case _0x568fce(0x186):{const {createPullRequest:_0x1f62e}=await import(_0x568fce(0xff));return _0x1f62e(_0x5ef321[_0x568fce(0xa0)],_0x5ef321['repo'],_0x5ef321[_0x568fce(0x13d)],_0x5ef321[_0x568fce(0x108)],_0x5ef321[_0x568fce(0xc9)],_0x5ef321[_0x568fce(0x105)]);}case _0x568fce(0x106):{const {createBranch:_0x31c2c0}=await import(_0x568fce(0xff));return _0x31c2c0(_0x5ef321[_0x568fce(0xa0)],_0x5ef321['repo'],_0x5ef321[_0x568fce(0x159)],_0x5ef321['fromBranch']);}case _0x568fce(0x165):{const {browserOpen:_0xb31514,startBrowserServer:_0x2a16d5,isBrowserServerRunning:_0x1c0086}=await import(_0x568fce(0x17e));return!_0x1c0086()&&await _0x2a16d5(),_0xb31514(_0x5ef321[_0x568fce(0xe8)]);}case _0x568fce(0x170):{const {browserClick:_0x583644}=await import(_0x568fce(0x17e));return _0x583644(_0x5ef321['selector']);}case'browser_fill':{const {browserFill:_0x274796}=await import(_0x568fce(0x17e));return _0x274796(_0x5ef321[_0x568fce(0xf1)],_0x5ef321[_0x568fce(0xb3)]);}case'browser_snapshot':{const {browserSnapshot:_0x255753}=await import(_0x568fce(0x17e));return _0x255753();}case _0x568fce(0xf0):{const {browserScreenshot:_0x3ddb56}=await import('../browser/index.js');return _0x3ddb56();}case'browser_get_text':{const {browserGetText:_0x488dd5}=await import(_0x568fce(0x17e));return _0x488dd5(_0x5ef321[_0x568fce(0xf1)]);}case'browser_close':{const {browserClose:_0x5966e6}=await import(_0x568fce(0x17e));return _0x5966e6();}default:return{'error':_0x568fce(0xcf)+_0x185fc9};}}
|
package/dist/config/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a5_0x230fab=a5_0x1bd7;(function(_0x5cc96a,_0x369669){const _0xcd41a=a5_0x1bd7,_0x2755bf=_0x5cc96a();while(!![]){try{const _0x4df0db=parseInt(_0xcd41a(0xf6))/0x1*(parseInt(_0xcd41a(0x104))/0x2)+-parseInt(_0xcd41a(0xe1))/0x3+-parseInt(_0xcd41a(0xe2))/0x4*(parseInt(_0xcd41a(0x101))/0x5)+parseInt(_0xcd41a(0xf9))/0x6*(parseInt(_0xcd41a(0xe5))/0x7)+parseInt(_0xcd41a(0xf4))/0x8*(-parseInt(_0xcd41a(0xec))/0x9)+parseInt(_0xcd41a(0x100))/0xa+parseInt(_0xcd41a(0xf0))/0xb*(parseInt(_0xcd41a(0xfd))/0xc);if(_0x4df0db===_0x369669)break;else _0x2755bf['push'](_0x2755bf['shift']());}catch(_0x1c1419){_0x2755bf['push'](_0x2755bf['shift']());}}}(a5_0x35a2,0x93922));function a5_0x1bd7(_0x2f4e04,_0x2f77d9){_0x2f4e04=_0x2f4e04-0xde;const _0x35a25a=a5_0x35a2();let _0x1bd7a4=_0x35a25a[_0x2f4e04];return _0x1bd7a4;}import a5_0x15c740 from'conf';import a5_0x36df13 from'path';import a5_0x599408 from'fs';import{fileURLToPath}from'url';const config=new a5_0x15c740({'projectName':a5_0x230fab(0xde),'defaults':{'mcpServers':{}}});export function getMcpServers(){const _0x2b4476=a5_0x230fab,_0x3ba002=config[_0x2b4476(0xfe)]('mcpServers'),_0x5c230f=loadMcpConfigFile();return{..._0x3ba002,..._0x5c230f};}export function addMcpServer(_0x30a31e,_0x587531,_0x61197f=[],_0x1eec8d){const _0xd07350=a5_0x230fab,_0xc37573=config['get'](_0xd07350(0xe9));_0xc37573[_0x30a31e]={'type':_0xd07350(0xef),'command':_0x587531,'args':_0x61197f,'env':_0x1eec8d},config['set'](_0xd07350(0xe9),_0xc37573);}export function addMcpHttpServer(_0x5c1356,_0x22240f){const _0x33a876=a5_0x230fab,_0x70ed01=config[_0x33a876(0xfe)](_0x33a876(0xe9));_0x70ed01[_0x5c1356]={'type':'streamable-http','url':_0x22240f},config[_0x33a876(0xf5)](_0x33a876(0xe9),_0x70ed01);}export function removeMcpServer(_0x3a5fd0){const _0x21b41f=a5_0x230fab,_0x3389bd=config[_0x21b41f(0xfe)]('mcpServers');if(_0x3389bd[_0x3a5fd0])return delete _0x3389bd[_0x3a5fd0],config[_0x21b41f(0xf5)]('mcpServers',_0x3389bd),!![];return![];}export function clearMcpServers(){config['set']('mcpServers',{});}function a5_0x35a2(){const _0x4c276e=['command','cwd','204QUSjsg','USERPROFILE','.woozlit','@modelcontextprotocol/server-filesystem','19691148hKntTv','get','uvx','3396460ohQJkZ','109015wPOLHE','mcp.json','path','1675118hUUsHp','woozlit-cli','mcp-servers','join','2173821vMuEKi','184pbZSsz','computer-use.js','dist','113911WqMorH','computer-use','tsx','src','mcpServers','existsSync','readFileSync','9354789BrJHXQ','.js','parse','stdio','11LATJxB','env','windows-mcp','utf-8','8UBqyzh','set','1PedVTt'];a5_0x35a2=function(){return _0x4c276e;};return a5_0x35a2();}export function getMcpServer(_0x1a5988){return getMcpServers()[_0x1a5988];}function loadMcpConfigFile(){const _0x243d69=a5_0x230fab,_0x3bb63b=[a5_0x36df13[_0x243d69(0xe0)](process[_0x243d69(0xf8)](),_0x243d69(0x102)),a5_0x36df13[_0x243d69(0xe0)](process['cwd'](),_0x243d69(0xfb),_0x243d69(0x102)),a5_0x36df13[_0x243d69(0xe0)](process[_0x243d69(0xf1)]['HOME']||process['env'][_0x243d69(0xfa)]||'','.woozlit',_0x243d69(0x102))];for(const _0x1f6b1f of _0x3bb63b){try{if(a5_0x599408[_0x243d69(0xea)](_0x1f6b1f)){const _0x5a9e1b=a5_0x599408[_0x243d69(0xeb)](_0x1f6b1f,_0x243d69(0xf3)),_0x5eb4c8=JSON[_0x243d69(0xee)](_0x5a9e1b);if(_0x5eb4c8[_0x243d69(0xe9)]&&typeof _0x5eb4c8[_0x243d69(0xe9)]==='object')return _0x5eb4c8[_0x243d69(0xe9)];}}catch{}}return{};}export function ensureDefaultServers(){const _0x40b9f8=a5_0x230fab,_0x2249d2=config[_0x40b9f8(0xfe)]('mcpServers'),_0x163c34=fileURLToPath(import.meta.url),_0x5e9833=a5_0x36df13['dirname'](_0x163c34),_0x26772a=_0x5e9833['includes'](_0x40b9f8(0xe4))||_0x163c34['endsWith'](_0x40b9f8(0xed)),_0x36e909=_0x26772a?a5_0x36df13[_0x40b9f8(0xe0)](_0x5e9833,'..',_0x40b9f8(0xdf),_0x40b9f8(0xe3)):a5_0x36df13[_0x40b9f8(0xe0)](_0x5e9833,'..','..',_0x40b9f8(0xe8),_0x40b9f8(0xdf),'computer-use.ts'),_0x1c9a14=_0x26772a?'node':_0x40b9f8(0xe7);_0x2249d2[_0x40b9f8(0xe6)]={'type':_0x40b9f8(0xef),'command':_0x1c9a14,'args':[_0x36e909],'env':{}},(!_0x2249d2[_0x40b9f8(0xf2)]||_0x2249d2[_0x40b9f8(0xf2)][_0x40b9f8(0xf7)]===_0x40b9f8(0xff))&&(_0x2249d2['windows-mcp']={'type':'stdio','command':'npx','args':['-y',_0x40b9f8(0xfc),'C:\x5cUsers'],'env':{}}),config[_0x40b9f8(0xf5)](_0x40b9f8(0xe9),_0x2249d2);}export function getConfigFilePath(){const _0x44a932=a5_0x230fab;return config[_0x44a932(0x103)];}
|
package/dist/config/settings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x3fddae=a6_0x29b6;(function(_0x165cd6,_0x44c610){const _0x245039=a6_0x29b6,_0x41eb1c=_0x165cd6();while(!![]){try{const _0x4ed12d=-parseInt(_0x245039(0x196))/0x1*(parseInt(_0x245039(0x184))/0x2)+parseInt(_0x245039(0x191))/0x3+parseInt(_0x245039(0x19e))/0x4+parseInt(_0x245039(0x179))/0x5+parseInt(_0x245039(0x17b))/0x6+-parseInt(_0x245039(0x182))/0x7*(parseInt(_0x245039(0x198))/0x8)+parseInt(_0x245039(0x188))/0x9*(-parseInt(_0x245039(0x19c))/0xa);if(_0x4ed12d===_0x44c610)break;else _0x41eb1c['push'](_0x41eb1c['shift']());}catch(_0x1e829d){_0x41eb1c['push'](_0x41eb1c['shift']());}}}(a6_0x7a29,0x675c4));function a6_0x29b6(_0x314102,_0x191531){_0x314102=_0x314102-0x177;const _0x7a2998=a6_0x7a29();let _0x29b6ba=_0x7a2998[_0x314102];return _0x29b6ba;}const API_URL=process[a6_0x3fddae(0x1a0)][a6_0x3fddae(0x185)]||'https://woozlit.com',PROD_URL=a6_0x3fddae(0x19b);export function getApiUrl(){return API_URL;}export function getProdUrl(){return PROD_URL;}export function isProduction(){return API_URL===PROD_URL;}export const MODELS=[{'id':a6_0x3fddae(0x193),'name':a6_0x3fddae(0x17c),'description':a6_0x3fddae(0x17f),'xp':0x1},{'id':a6_0x3fddae(0x180),'name':'Gemini\x203\x20Flash','description':'Latest\x20Gemini\x203\x20model','xp':0x5},{'id':a6_0x3fddae(0x18c),'name':a6_0x3fddae(0x177),'description':a6_0x3fddae(0x19d),'xp':0x5},{'id':a6_0x3fddae(0x18d),'name':a6_0x3fddae(0x194),'description':a6_0x3fddae(0x18a),'xp':0x1},{'id':'qwen/qwen3-235b-a22b:free','name':a6_0x3fddae(0x18f),'description':a6_0x3fddae(0x17a),'xp':0x2},{'id':a6_0x3fddae(0x197),'name':a6_0x3fddae(0x18b),'description':a6_0x3fddae(0x199),'xp':0x2},{'id':a6_0x3fddae(0x19a),'name':a6_0x3fddae(0x186),'description':a6_0x3fddae(0x183),'xp':0x2},{'id':'meta-llama/llama-4-maverick','name':'Llama\x204\x20Maverick','description':a6_0x3fddae(0x192),'xp':0x3},{'id':a6_0x3fddae(0x189),'name':'Devstral\x20Small','description':a6_0x3fddae(0x195),'xp':0x2},{'id':a6_0x3fddae(0x1a1),'name':'Mistral\x20Small\x203.2','description':a6_0x3fddae(0x181),'xp':0x2},{'id':a6_0x3fddae(0x19f),'name':'Nemotron\x20Nano\x2012B','description':a6_0x3fddae(0x17d),'xp':0x1},{'id':'moonshotai/kimi-k2','name':a6_0x3fddae(0x187),'description':a6_0x3fddae(0x17e),'xp':0x3},{'id':'deepseek/deepseek-chat','name':a6_0x3fddae(0x178),'description':'DeepSeek\x27s\x20latest\x20V3','xp':0x2},{'id':a6_0x3fddae(0x190),'name':'DeepSeek\x20R1','description':a6_0x3fddae(0x18e),'xp':0x3}];export const DEFAULT_MODEL=a6_0x3fddae(0x193);function a6_0x7a29(){const _0xb0943d=['mistralai/devstral-small','Xiaomi\x27s\x20fast\x20AI\x20model','Qwen3\x20Coder','gemini-3-pro-preview','xiaomi/mimo-v2-flash:free','Advanced\x20reasoning','Qwen3\x20235B','deepseek/deepseek-r1','946755qOJBIQ','Meta\x27s\x20latest','gemini-2.5-flash','MiMo\x20V2','Developer-focused','186dkVODq','qwen/qwen3-coder:free','8TPvwtF','Coding\x20specialist','meta-llama/llama-3.3-70b-instruct:free','https://woozlit.com','84250qXDIfo','Most\x20powerful\x20Gemini','5472EmiSWS','nvidia/nemotron-nano-12b-v2-vl:free','env','mistralai/mistral-small-3.2-24b-instruct','Gemini\x203\x20Pro','DeepSeek\x20V3','3582620hUETHd','Alibaba\x27s\x20largest','3098982eIQHGg','Woozie','NVIDIA\x20vision','Reasoning\x20model','Fast\x20and\x20capable\x20(Default)','gemini-3-flash-preview','Latest\x20Mistral','3937507rXAAno','Meta\x27s\x20powerful\x20model','4888bcivAh','WOOZLIT_API_URL','Llama\x203.3\x2070B','Kimi\x20K2','117ZMdxrl'];a6_0x7a29=function(){return _0xb0943d;};return a6_0x7a29();}
|
package/dist/discord/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x35be01,_0x29d8b2){const _0x4ab129=a7_0x2e32,_0x330ef2=_0x35be01();while(!![]){try{const _0x46f3fb=-parseInt(_0x4ab129(0x186))/0x1+parseInt(_0x4ab129(0x199))/0x2+-parseInt(_0x4ab129(0x198))/0x3+-parseInt(_0x4ab129(0x1a4))/0x4*(-parseInt(_0x4ab129(0x184))/0x5)+-parseInt(_0x4ab129(0x188))/0x6*(parseInt(_0x4ab129(0x182))/0x7)+parseInt(_0x4ab129(0x17e))/0x8+parseInt(_0x4ab129(0x19c))/0x9;if(_0x46f3fb===_0x29d8b2)break;else _0x330ef2['push'](_0x330ef2['shift']());}catch(_0x5cc253){_0x330ef2['push'](_0x330ef2['shift']());}}}(a7_0x3bcf,0xd530d));import{Client,GatewayIntentBits,ChannelType,Partials}from'discord.js';import*as a7_0x40b73d from'./config.js';function a7_0x2e32(_0x6d6539,_0x3452e2){_0x6d6539=_0x6d6539-0x174;const _0x3bcf7d=a7_0x3bcf();let _0x2e320d=_0x3bcf7d[_0x6d6539];return _0x2e320d;}import*as a7_0x4f1d47 from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';let client=null,isRunning=![];const chatHistories=new Map();export async function startBot(){const _0x2bd062=a7_0x2e32,_0x466954=a7_0x40b73d[_0x2bd062(0x187)]();if(!_0x466954)return![];if(isRunning)return!![];try{return client=new Client({'intents':[GatewayIntentBits[_0x2bd062(0x180)],GatewayIntentBits[_0x2bd062(0x192)],GatewayIntentBits[_0x2bd062(0x174)],GatewayIntentBits[_0x2bd062(0x18a)]],'partials':[Partials[_0x2bd062(0x189)]]}),client[_0x2bd062(0x19e)]('ready',()=>{const _0xf0196e=_0x2bd062;a7_0x4f1d47['success'](_0xf0196e(0x183)+client?.['user']?.['tag']),isRunning=!![];}),client['on'](_0x2bd062(0x18d),async _0x552fd0=>{const _0x2a2bbb=_0x2bd062;if(_0x552fd0[_0x2a2bbb(0x1a1)][_0x2a2bbb(0x19b)])return;const _0x4d6ddd=_0x552fd0[_0x2a2bbb(0x193)][_0x2a2bbb(0x185)]===ChannelType['DM'],_0x506dbb=client?.[_0x2a2bbb(0x176)]&&_0x552fd0[_0x2a2bbb(0x197)][_0x2a2bbb(0x175)](client['user']);if(!_0x4d6ddd&&!_0x506dbb)return;await _0x552fd0['channel'][_0x2a2bbb(0x19d)]()[_0x2a2bbb(0x17a)](()=>{});const _0x567198=_0x552fd0['author']['id'],_0x3891a8=(_0x552fd0[_0x2a2bbb(0x19a)]||'dm')+'-'+_0x552fd0[_0x2a2bbb(0x1a2)]+'-'+_0x567198;!chatHistories[_0x2a2bbb(0x175)](_0x3891a8)&&chatHistories[_0x2a2bbb(0x17f)](_0x3891a8,[{'role':_0x2a2bbb(0x1a0),'content':_0x2a2bbb(0x18c)}]);const _0x48e06f=chatHistories[_0x2a2bbb(0x194)](_0x3891a8),_0x590b59=_0x552fd0[_0x2a2bbb(0x196)][_0x2a2bbb(0x179)](/<@!?[0-9]+>/g,'')[_0x2a2bbb(0x1a3)]();if(!_0x590b59)return;_0x48e06f[_0x2a2bbb(0x181)]({'role':_0x2a2bbb(0x176),'content':_0x590b59}),a7_0x4f1d47[_0x2a2bbb(0x17b)](_0x2a2bbb(0x178)+_0x552fd0[_0x2a2bbb(0x1a1)]['username']+':\x20'+_0x590b59);const _0x4c5199=getSelectedModel();try{let _0x435da2='';const _0x218aaf=await sendChatMessage(_0x4c5199,_0x48e06f,_0x283a2f=>{_0x435da2+=_0x283a2f;});_0x435da2=_0x218aaf['content'],_0x48e06f[_0x2a2bbb(0x181)]({'role':_0x2a2bbb(0x18e),'content':_0x435da2});if(_0x435da2[_0x2a2bbb(0x190)]>0x7d0){const _0x69c70a=_0x435da2[_0x2a2bbb(0x18f)](/[\s\S]{1,2000}/g)||[];for(const _0x1c72fe of _0x69c70a){await _0x552fd0['reply'](_0x1c72fe);}}else await _0x552fd0[_0x2a2bbb(0x17c)](_0x435da2);}catch(_0x439ae1){a7_0x4f1d47['error'](_0x2a2bbb(0x18b)+_0x439ae1[_0x2a2bbb(0x17d)]),await _0x552fd0[_0x2a2bbb(0x17c)](_0x2a2bbb(0x191));}}),await client[_0x2bd062(0x195)](_0x466954),!![];}catch(_0x19aafa){return a7_0x4f1d47['error'](_0x2bd062(0x19f)+_0x19aafa[_0x2bd062(0x17d)]),![];}}export function stopBot(){const _0x57370f=a7_0x2e32;client&&(client[_0x57370f(0x177)](),client=null),isRunning=![];}function a7_0x3bcf(){const _0x4a3d79=['4928685aKtQWJ','2750004EfFlEw','guildId','bot','21661650CpNikQ','sendTyping','once','[Discord]\x20Failed\x20to\x20start:\x20','system','author','channelId','trim','459444CUFRLq','MessageContent','has','user','destroy','[Discord]\x20','replace','catch','info','reply','message','1458896sVNaKW','set','Guilds','push','154189ApPoLs','[Discord]\x20Connected\x20as\x20','15bkRByQ','type','669296Nrjhyv','getBotToken','306SmTvdk','Channel','DirectMessages','[Discord]\x20Error:\x20','You\x20are\x20Woozlit,\x20a\x20helpful\x20AI\x20assistant\x20connected\x20via\x20Discord.\x20Keep\x20responses\x20concise.','messageCreate','assistant','match','length','Sorry,\x20I\x20encountered\x20an\x20error\x20processing\x20that.','GuildMessages','channel','get','login','content','mentions'];a7_0x3bcf=function(){return _0x4a3d79;};return a7_0x3bcf();}export function isBotRunning(){return isRunning;}
|
package/dist/discord/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x2e558d=a8_0x2493;function a8_0x547d(){const _0x4b3d74=['sha256','clear','final','126uZpZjj','from','split','914733wRqFxz','120taFITr','4121020AdVyzr','update','utf8','get','digest','createCipheriv','55966NPbEkX','randomBytes','88HdXImA','createHash','botToken','woozlit_discord_secure_key','hex','5170008zsEyuX','toString','aes-256-cbc','6179495FGDwuL','389655obgsIJ','69wxOUnN','700938EQqmKr','woozlit-cli-discord'];a8_0x547d=function(){return _0x4b3d74;};return a8_0x547d();}(function(_0x227946,_0x1b6bbc){const _0x34d393=a8_0x2493,_0x28c997=_0x227946();while(!![]){try{const _0x1ebca4=parseInt(_0x34d393(0x102))/0x1+-parseInt(_0x34d393(0xed))/0x2*(-parseInt(_0x34d393(0xf9))/0x3)+parseInt(_0x34d393(0xf4))/0x4+parseInt(_0x34d393(0xf7))/0x5+-parseInt(_0x34d393(0xff))/0x6*(-parseInt(_0x34d393(0xf8))/0x7)+-parseInt(_0x34d393(0x103))/0x8*(parseInt(_0x34d393(0xfa))/0x9)+-parseInt(_0x34d393(0x104))/0xa*(parseInt(_0x34d393(0xef))/0xb);if(_0x1ebca4===_0x1b6bbc)break;else _0x28c997['push'](_0x28c997['shift']());}catch(_0x285af0){_0x28c997['push'](_0x28c997['shift']());}}}(a8_0x547d,0xc1086));import a8_0x441c11 from'conf';import a8_0x48c3d5 from'crypto';const config=new a8_0x441c11({'projectName':a8_0x2e558d(0xfb),'defaults':{'botToken':'','commandPrefix':'!','enabled':![]}}),ENCRYPTION_KEY=a8_0x2e558d(0xf2);function a8_0x2493(_0x46860d,_0x2d7a07){_0x46860d=_0x46860d-0xe9;const _0x547d81=a8_0x547d();let _0x249386=_0x547d81[_0x46860d];return _0x249386;}function encrypt(_0x2786de){const _0x59b168=a8_0x2e558d;if(!_0x2786de)return'';const _0x3bd4e1=a8_0x48c3d5[_0x59b168(0xee)](0x10),_0x5bea9b=a8_0x48c3d5[_0x59b168(0xf0)](_0x59b168(0xfc))[_0x59b168(0x105)](ENCRYPTION_KEY)[_0x59b168(0xeb)](),_0x4b9cee=a8_0x48c3d5[_0x59b168(0xec)](_0x59b168(0xf6),_0x5bea9b,_0x3bd4e1);let _0x3e5cf4=_0x4b9cee[_0x59b168(0x105)](_0x2786de,_0x59b168(0xe9),_0x59b168(0xf3));return _0x3e5cf4+=_0x4b9cee['final'](_0x59b168(0xf3)),_0x3bd4e1[_0x59b168(0xf5)](_0x59b168(0xf3))+':'+_0x3e5cf4;}function decrypt(_0x1a0f4e){const _0x3c7a33=a8_0x2e558d;if(!_0x1a0f4e)return'';try{const [_0xe508af,_0x5dc7b2]=_0x1a0f4e[_0x3c7a33(0x101)](':');if(!_0xe508af||!_0x5dc7b2)return'';const _0x246594=Buffer[_0x3c7a33(0x100)](_0xe508af,_0x3c7a33(0xf3)),_0x556af9=a8_0x48c3d5[_0x3c7a33(0xf0)]('sha256')[_0x3c7a33(0x105)](ENCRYPTION_KEY)[_0x3c7a33(0xeb)](),_0x2cf99e=a8_0x48c3d5['createDecipheriv']('aes-256-cbc',_0x556af9,_0x246594);let _0x2fec72=_0x2cf99e['update'](_0x5dc7b2,_0x3c7a33(0xf3),_0x3c7a33(0xe9));return _0x2fec72+=_0x2cf99e[_0x3c7a33(0xfe)]('utf8'),_0x2fec72;}catch{return'';}}export function setBotToken(_0x50a7e9){const _0x5d97a6=a8_0x2e558d;config['set'](_0x5d97a6(0xf1),encrypt(_0x50a7e9));}export function getBotToken(){const _0x5b5923=a8_0x2e558d;return decrypt(config[_0x5b5923(0xea)](_0x5b5923(0xf1)));}export function isEnabled(){return!!getBotToken();}export function isConfigured(){return!!getBotToken();}export function clearConfig(){const _0x474c81=a8_0x2e558d;config[_0x474c81(0xfd)]();}
|
package/dist/discord/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29de33,_0x4499b1){var _0x37c6ce=a9_0x16a0,_0x59ea5d=_0x29de33();while(!![]){try{var _0x2916a7=parseInt(_0x37c6ce(0xae))/0x1*(-parseInt(_0x37c6ce(0xb3))/0x2)+parseInt(_0x37c6ce(0xb0))/0x3+parseInt(_0x37c6ce(0xac))/0x4+-parseInt(_0x37c6ce(0xb4))/0x5+-parseInt(_0x37c6ce(0xb1))/0x6+parseInt(_0x37c6ce(0xb5))/0x7*(-parseInt(_0x37c6ce(0xb2))/0x8)+parseInt(_0x37c6ce(0xaf))/0x9*(parseInt(_0x37c6ce(0xad))/0xa);if(_0x2916a7===_0x4499b1)break;else _0x59ea5d['push'](_0x59ea5d['shift']());}catch(_0x456e13){_0x59ea5d['push'](_0x59ea5d['shift']());}}}(a9_0x513b,0xf2eb1));export*from'./config.js';export{startBot,stopBot,isBotRunning}from'./client.js';export{setupDiscord}from'./setup.js';function a9_0x16a0(_0x2af8ef,_0x185615){_0x2af8ef=_0x2af8ef-0xac;var _0x513b10=a9_0x513b();var _0x16a0b9=_0x513b10[_0x2af8ef];return _0x16a0b9;}function a9_0x513b(){var _0x4bee67=['12408730ItvgTb','1hxuOtE','18wycJAf','5944398eYOIGK','8936298IIiZIs','1162648BrfhXB','1743438KqfPEY','2864225XvlZDK','70vukvAI','3676152rFkRKz'];a9_0x513b=function(){return _0x4bee67;};return a9_0x513b();}
|
package/dist/discord/setup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a10_0x4d9e(){const _0x3a586a=['1361943JsStOf','18992920VgQkxk','90786UBKmTJ','dim','40732lHTmHv','15rHYgXV','Discord\x20configuration\x20saved!','16JHBUlK','1600232sihuMp','info','73728TIiREv','607019JeYnQm','280aOSvRY','You\x20need\x20a\x20Bot\x20Token\x20from\x20the\x20Discord\x20Developer\x20Portal.','Token\x20seems\x20too\x20short','Restart\x20the\x20CLI\x20to\x20start\x20the\x20Discord\x20Bot.'];a10_0x4d9e=function(){return _0x3a586a;};return a10_0x4d9e();}(function(_0x17e576,_0x533b1a){const _0x12a6a4=a10_0xa806,_0x54fcc3=_0x17e576();while(!![]){try{const _0x564afb=parseInt(_0x12a6a4(0x173))/0x1+parseInt(_0x12a6a4(0x17c))/0x2+parseInt(_0x12a6a4(0x172))/0x3+-parseInt(_0x12a6a4(0x180))/0x4*(-parseInt(_0x12a6a4(0x17d))/0x5)+-parseInt(_0x12a6a4(0x17a))/0x6*(-parseInt(_0x12a6a4(0x174))/0x7)+parseInt(_0x12a6a4(0x17f))/0x8*(parseInt(_0x12a6a4(0x178))/0x9)+-parseInt(_0x12a6a4(0x179))/0xa;if(_0x564afb===_0x533b1a)break;else _0x54fcc3['push'](_0x54fcc3['shift']());}catch(_0x37b27c){_0x54fcc3['push'](_0x54fcc3['shift']());}}}(a10_0x4d9e,0xd2241));import{input}from'@inquirer/prompts';function a10_0xa806(_0x37fabf,_0x1e6dd1){_0x37fabf=_0x37fabf-0x172;const _0x4d9ecf=a10_0x4d9e();let _0xa80600=_0x4d9ecf[_0x37fabf];return _0xa80600;}import*as a10_0x47bb89 from'./config.js';import*as a10_0x3184f3 from'../ui/output.js';export async function setupDiscord(){const _0x5e11b0=a10_0xa806;a10_0x3184f3[_0x5e11b0(0x181)]('Setup\x20Woozlit\x20Discord\x20Bot'),a10_0x3184f3[_0x5e11b0(0x17b)](_0x5e11b0(0x175));const _0x11e866=await input({'message':'Bot\x20Token:','validate':_0x557c3a=>_0x557c3a['length']>0xa?!![]:_0x5e11b0(0x176)}),_0x3e1941=await input({'message':'Command\x20Prefix\x20(optional,\x20default\x20\x27!\x27):','default':'!'});a10_0x47bb89['setBotToken'](_0x11e866),a10_0x3184f3['success'](_0x5e11b0(0x17e)),a10_0x3184f3['info'](_0x5e11b0(0x177));}
|
package/dist/email/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a11_0x3d39(_0x4b7e18,_0x6ac133){_0x4b7e18=_0x4b7e18-0x177;const _0x2a47f9=a11_0x2a47();let _0x3d3951=_0x2a47f9[_0x4b7e18];return _0x3d3951;}const a11_0x27155d=a11_0x3d39;(function(_0x332a3f,_0x1162bd){const _0x412fd1=a11_0x3d39,_0x15d9c4=_0x332a3f();while(!![]){try{const _0x1fc27a=-parseInt(_0x412fd1(0x19b))/0x1+-parseInt(_0x412fd1(0x199))/0x2+-parseInt(_0x412fd1(0x191))/0x3+-parseInt(_0x412fd1(0x197))/0x4*(-parseInt(_0x412fd1(0x18b))/0x5)+-parseInt(_0x412fd1(0x17f))/0x6*(parseInt(_0x412fd1(0x19d))/0x7)+-parseInt(_0x412fd1(0x185))/0x8*(-parseInt(_0x412fd1(0x178))/0x9)+parseInt(_0x412fd1(0x17e))/0xa;if(_0x1fc27a===_0x1162bd)break;else _0x15d9c4['push'](_0x15d9c4['shift']());}catch(_0x4214cb){_0x15d9c4['push'](_0x15d9c4['shift']());}}}(a11_0x2a47,0xa0e20));import a11_0x56030b from'conf';import a11_0x458d73 from'crypto';const config=new a11_0x56030b({'projectName':'woozlit-cli-email','defaults':{'imapHost':a11_0x27155d(0x189),'imapPort':0x3e1,'imapUser':'','imapPass':'','smtpHost':a11_0x27155d(0x179),'smtpPort':0x24b,'smtpUser':'','smtpPass':'','checkInterval':0x5,'allowedSenders':[],'enabled':![]}}),ENCRYPTION_KEY=a11_0x27155d(0x190);function encrypt(_0x527460){const _0x259294=a11_0x27155d;if(!_0x527460)return'';const _0x26b181=a11_0x458d73[_0x259294(0x182)](0x10),_0x25b5c9=a11_0x458d73[_0x259294(0x180)](_0x259294(0x184))[_0x259294(0x19e)](ENCRYPTION_KEY)['digest'](),_0x31f875=a11_0x458d73[_0x259294(0x17a)]('aes-256-cbc',_0x25b5c9,_0x26b181);let _0xc00d56=_0x31f875[_0x259294(0x19e)](_0x527460,_0x259294(0x18f),_0x259294(0x183));return _0xc00d56+=_0x31f875[_0x259294(0x18d)]('hex'),_0x26b181['toString'](_0x259294(0x183))+':'+_0xc00d56;}function a11_0x2a47(){const _0x5c2f4b=['imap.gmail.com','imapPass','44775anHvwj','enabled','final','smtpUser','utf8','woozlit_email_secure_key','1069683GHqgnC','set','smtpPort','imap','from','imapUser','292Cbxjri','digest','767622zXvCkA','split','1083797ufEMOB','push','182HxXJVn','update','password','10494rRbmgF','smtp.gmail.com','createCipheriv','get','smtpHost','smtpPass','17101780StQCuT','268734dwuRHN','createHash','aes-256-cbc','randomBytes','hex','sha256','8808vcdhvt','allowedSenders','createDecipheriv','imapHost'];a11_0x2a47=function(){return _0x5c2f4b;};return a11_0x2a47();}function decrypt(_0x4c5b25){const _0x4d008=a11_0x27155d;if(!_0x4c5b25)return'';try{const [_0x2cbc8b,_0x4f5f7d]=_0x4c5b25[_0x4d008(0x19a)](':');if(!_0x2cbc8b||!_0x4f5f7d)return'';const _0x3dc9d4=Buffer[_0x4d008(0x195)](_0x2cbc8b,'hex'),_0x702df2=a11_0x458d73['createHash'](_0x4d008(0x184))[_0x4d008(0x19e)](ENCRYPTION_KEY)[_0x4d008(0x198)](),_0x2aafe6=a11_0x458d73[_0x4d008(0x187)](_0x4d008(0x181),_0x702df2,_0x3dc9d4);let _0x552d6d=_0x2aafe6['update'](_0x4f5f7d,_0x4d008(0x183),_0x4d008(0x18f));return _0x552d6d+=_0x2aafe6[_0x4d008(0x18d)](_0x4d008(0x18f)),_0x552d6d;}catch{return'';}}export function setCredentials(_0x325c7a,_0x3eedd7,_0xb26e7,_0x2d3048){const _0x1b8341=a11_0x27155d;config['set'](_0x1b8341(0x196),_0x325c7a),config[_0x1b8341(0x192)](_0x1b8341(0x18a),encrypt(_0x3eedd7)),config[_0x1b8341(0x192)](_0x1b8341(0x18e),_0x325c7a),config[_0x1b8341(0x192)](_0x1b8341(0x17d),encrypt(_0x3eedd7));if(_0xb26e7)config['set']('imapHost',_0xb26e7);}export function getConfig(){const _0x1960c2=a11_0x27155d;return{'imap':{'user':config[_0x1960c2(0x17b)](_0x1960c2(0x196)),'password':decrypt(config['get']('imapPass')),'host':config[_0x1960c2(0x17b)](_0x1960c2(0x188)),'port':config['get']('imapPort'),'tls':!![],'tlsOptions':{'rejectUnauthorized':![]},'authTimeout':0xbb8},'smtp':{'host':config['get'](_0x1960c2(0x17c)),'port':config['get'](_0x1960c2(0x193)),'auth':{'user':config[_0x1960c2(0x17b)]('smtpUser'),'pass':decrypt(config[_0x1960c2(0x17b)](_0x1960c2(0x17d)))},'tls':{'rejectUnauthorized':![]}},'interval':config[_0x1960c2(0x17b)]('checkInterval'),'allowedSenders':config['get'](_0x1960c2(0x186))||[],'enabled':config['get']('enabled')};}export function isConfigured(){const _0x182c9b=a11_0x27155d,_0x3d17c5=getConfig();return!!_0x3d17c5[_0x182c9b(0x194)]['user']&&!!_0x3d17c5['imap'][_0x182c9b(0x177)];}export function setEnabled(_0x41c52b){const _0x263d6b=a11_0x27155d;config[_0x263d6b(0x192)](_0x263d6b(0x18c),_0x41c52b);}export function addAllowedSender(_0x221da8){const _0x72039d=a11_0x27155d,_0x4ff057=config[_0x72039d(0x17b)](_0x72039d(0x186))||[];!_0x4ff057['includes'](_0x221da8)&&(_0x4ff057[_0x72039d(0x19c)](_0x221da8),config[_0x72039d(0x192)](_0x72039d(0x186),_0x4ff057));}
|
package/dist/email/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8d3422,_0x1bc886){var _0x2d0a40=a12_0x346c,_0x134252=_0x8d3422();while(!![]){try{var _0x244ca9=-parseInt(_0x2d0a40(0x1ea))/0x1+-parseInt(_0x2d0a40(0x1ee))/0x2+parseInt(_0x2d0a40(0x1e9))/0x3*(-parseInt(_0x2d0a40(0x1ec))/0x4)+parseInt(_0x2d0a40(0x1f0))/0x5+parseInt(_0x2d0a40(0x1eb))/0x6+-parseInt(_0x2d0a40(0x1ed))/0x7+-parseInt(_0x2d0a40(0x1f1))/0x8*(-parseInt(_0x2d0a40(0x1ef))/0x9);if(_0x244ca9===_0x1bc886)break;else _0x134252['push'](_0x134252['shift']());}catch(_0x22d7d9){_0x134252['push'](_0x134252['shift']());}}}(a12_0x2936,0xb68f9));function a12_0x346c(_0x1a9708,_0x18b6ce){_0x1a9708=_0x1a9708-0x1e9;var _0x29366a=a12_0x2936();var _0x346ce7=_0x29366a[_0x1a9708];return _0x346ce7;}export*from'./config.js';export{startBot,stopBot,isBotRunning}from'./service.js';export{setupEmail}from'./setup.js';function a12_0x2936(){var _0x684b9b=['635540Ioioze','8717076jLFHsY','4UzpRBp','2070488hIdaqG','2265468qXoZkA','9TPbPTW','7062800GQBQpi','1500976WliQwN','723603iMfBZR'];a12_0x2936=function(){return _0x684b9b;};return a12_0x2936();}
|
package/dist/email/service.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x216c7d,_0x7c6302){const _0x512fe0=a13_0x13b6,_0x16cec8=_0x216c7d();while(!![]){try{const _0x56759e=parseInt(_0x512fe0(0xe9))/0x1*(-parseInt(_0x512fe0(0xd9))/0x2)+parseInt(_0x512fe0(0xd8))/0x3*(-parseInt(_0x512fe0(0xd7))/0x4)+parseInt(_0x512fe0(0xfe))/0x5*(parseInt(_0x512fe0(0xde))/0x6)+parseInt(_0x512fe0(0xd1))/0x7*(parseInt(_0x512fe0(0xcf))/0x8)+parseInt(_0x512fe0(0xd2))/0x9+parseInt(_0x512fe0(0xe7))/0xa+parseInt(_0x512fe0(0xe5))/0xb;if(_0x56759e===_0x7c6302)break;else _0x16cec8['push'](_0x16cec8['shift']());}catch(_0x3a0b4b){_0x16cec8['push'](_0x16cec8['shift']());}}}(a13_0x3b8d,0x7b42e));import a13_0x4735 from'imap-simple';import a13_0x25b7db from'nodemailer';import*as a13_0x86a645 from'./config.js';function a13_0x3b8d(){const _0x25bdcd=['70406RBfznD','search','interval','info','which','12bcyiJN','body','getConfig','Re:\x20','content','from','find','11328636sgRAcO','INBOX','666060FXTIma','env','17tQIlGM','No\x20Subject','allowedSenders','parts','message','smtp','TEXT','HEADER','match','\x20|\x20Subj:\x20','[Email]\x20Found\x20','openBox','\x20new\x20messages','error','UNSEEN','\x20(not\x20allowed)','You\x20received\x20an\x20email\x20from\x20','isConfigured','NODE_TLS_REJECT_UNAUTHORIZED','end','sendMail','62515aoWzWP','[Email]\x20Reply\x20sent\x20to\x20','user','4503704IqFPlL','length','7pgdvCO','3570066cOaakU','createTransport','includes','auth','success','108644ooMYJC','108wiPXLW'];a13_0x3b8d=function(){return _0x25bdcd;};return a13_0x3b8d();}import*as a13_0x3f5789 from'../ui/output.js';import{getSelectedModel}from'../utils/storage.js';import{sendChatMessage}from'../utils/api.js';let intervalId=null,isRunning=![];async function checkEmails(){const _0x1a3f06=a13_0x13b6,_0x4eab8b=a13_0x86a645[_0x1a3f06(0xe0)]();try{const _0x51a909=await a13_0x4735['connect']({'imap':_0x4eab8b['imap']});await _0x51a909[_0x1a3f06(0xf4)](_0x1a3f06(0xe6));const _0xfd84e0=[_0x1a3f06(0xf7)],_0x3f4ad3={'bodies':['HEADER',_0x1a3f06(0xef)],'markSeen':!![]},_0x581d5c=await _0x51a909[_0x1a3f06(0xda)](_0xfd84e0,_0x3f4ad3);_0x581d5c['length']>0x0&&a13_0x3f5789[_0x1a3f06(0xdc)](_0x1a3f06(0xf3)+_0x581d5c[_0x1a3f06(0xd0)]+_0x1a3f06(0xf5));for(const _0x55c058 of _0x581d5c){const _0x7d78b5=_0x55c058[_0x1a3f06(0xec)][_0x1a3f06(0xe4)](_0x24c478=>_0x24c478[_0x1a3f06(0xdd)]===_0x1a3f06(0xf0)),_0x241ef0=_0x7d78b5[_0x1a3f06(0xdf)][_0x1a3f06(0xe3)]?.[0x0]||'',_0x41cc9c=_0x7d78b5[_0x1a3f06(0xdf)]['subject']?.[0x0]||_0x1a3f06(0xea);if(_0x4eab8b[_0x1a3f06(0xeb)][_0x1a3f06(0xd0)]>0x0){const _0x5243c5=_0x241ef0[_0x1a3f06(0xf1)](/<(.+)>/)?.[0x1]||_0x241ef0;if(!_0x4eab8b[_0x1a3f06(0xeb)][_0x1a3f06(0xd4)](_0x5243c5)){a13_0x3f5789['dim']('[Email]\x20Ignored\x20mail\x20from\x20'+_0x241ef0+_0x1a3f06(0xf8));continue;}}const _0x40d6d6=_0x55c058[_0x1a3f06(0xec)]['find'](_0x3247f0=>_0x3247f0[_0x1a3f06(0xdd)]===_0x1a3f06(0xef)),_0x5d420b=_0x40d6d6?.[_0x1a3f06(0xdf)]||'';a13_0x3f5789[_0x1a3f06(0xdc)]('[Email]\x20From:\x20'+_0x241ef0+_0x1a3f06(0xf2)+_0x41cc9c);try{const _0x2a0673=_0x1a3f06(0xf9)+_0x241ef0+':\x0aSubject:\x20'+_0x41cc9c+'\x0aBody:\x0a'+_0x5d420b+'\x0a\x0aDraft\x20a\x20helpful\x20reply.\x20Structure\x20it\x20clearly.',_0x52e999=await sendChatMessage(getSelectedModel(),[{'role':_0x1a3f06(0xce),'content':_0x2a0673}]),_0x3ff840=a13_0x25b7db[_0x1a3f06(0xd3)](_0x4eab8b[_0x1a3f06(0xee)]);await _0x3ff840[_0x1a3f06(0xfd)]({'from':_0x4eab8b[_0x1a3f06(0xee)][_0x1a3f06(0xd5)]['user'],'to':_0x241ef0,'subject':_0x1a3f06(0xe1)+_0x41cc9c,'text':_0x52e999[_0x1a3f06(0xe2)]}),a13_0x3f5789[_0x1a3f06(0xd6)](_0x1a3f06(0xcd)+_0x241ef0);}catch(_0x5bfb24){a13_0x3f5789[_0x1a3f06(0xf6)]('[Email]\x20Processing/Reply\x20error:\x20'+_0x5bfb24[_0x1a3f06(0xed)]);}}_0x51a909[_0x1a3f06(0xfc)]();}catch(_0xab2e0c){}}export async function startBot(){const _0x12560c=a13_0x13b6;if(!a13_0x86a645[_0x12560c(0xfa)]())return![];if(isRunning)return!![];process[_0x12560c(0xe8)][_0x12560c(0xfb)]='0',checkEmails();const _0x20af3c=a13_0x86a645['getConfig']()[_0x12560c(0xdb)]||0x5;return intervalId=setInterval(checkEmails,_0x20af3c*0x3c*0x3e8),isRunning=!![],!![];}function a13_0x13b6(_0x1254ba,_0x3598f3){_0x1254ba=_0x1254ba-0xcd;const _0x3b8d2c=a13_0x3b8d();let _0x13b63a=_0x3b8d2c[_0x1254ba];return _0x13b63a;}export function stopBot(){intervalId&&(clearInterval(intervalId),intervalId=null),isRunning=![];}export function isBotRunning(){return isRunning;}export{isConfigured}from'./config.js';
|