woozlit 1.1.1 → 1.1.3
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/chat/agent.js +1 -1
- package/dist/config/mcp.d.ts +1 -0
- package/dist/config/mcp.js +1 -1
- package/dist/config/settings.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-servers/computer-use.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/ui/output.js +1 -1
- package/dist/ui/select.js +1 -1
- package/dist/utils/api.d.ts +1 -1
- package/dist/utils/api.js +1 -1
- package/dist/utils/history.js +1 -1
- package/dist/utils/mcp-installer.js +1 -1
- package/dist/utils/platform.js +1 -1
- package/dist/utils/storage.js +1 -1
- package/dist/utils/update-check.js +1 -1
- package/package.json +1 -1
package/dist/auth/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a0_0x1dbe(){const _0x301964=['text/html','writeHead','url','786802meymqS','end','http://localhost:','/callback','11070HEkEkq','5702985TTcZQq','1BzZXdP','get','userId','/auth/cli?callback=http://localhost:','6255370TctFGO','pathname','token','125328SmNVZd','\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','searchParams','close','108598ZPnUYh','10jESEBc','725yIRfGv','\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','72LnigZd','listen','667684dESbpZ'];a0_0x1dbe=function(){return _0x301964;};return a0_0x1dbe();}(function(_0x394b5d,_0x560aa7){const _0x3bc4ee=a0_0x1587,_0x5a5e53=_0x394b5d();while(!![]){try{const _0x4614dc=parseInt(_0x3bc4ee(0xc9))/0x1*(parseInt(_0x3bc4ee(0xc3))/0x2)+-parseInt(_0x3bc4ee(0xd0))/0x3+parseInt(_0x3bc4ee(0xbf))/0x4+-parseInt(_0x3bc4ee(0xd6))/0x5*(parseInt(_0x3bc4ee(0xc7))/0x6)+parseInt(_0x3bc4ee(0xd4))/0x7*(parseInt(_0x3bc4ee(0xd8))/0x8)+parseInt(_0x3bc4ee(0xc8))/0x9*(-parseInt(_0x3bc4ee(0xd5))/0xa)+parseInt(_0x3bc4ee(0xcd))/0xb;if(_0x4614dc===_0x560aa7)break;else _0x5a5e53['push'](_0x5a5e53['shift']());}catch(_0x51eb52){_0x5a5e53['push'](_0x5a5e53['shift']());}}}(a0_0x1dbe,0x4f814));import a0_0x1a380e from'open';function a0_0x1587(_0x536556,_0x416826){_0x536556=_0x536556-0xbe;const _0x1dbee9=a0_0x1dbe();let _0x15877c=_0x1dbee9[_0x536556];return _0x15877c;}import{createServer}from'http';import{getApiUrl}from'../config/settings.js';import{setToken,setUser,isLoggedIn,logout as a0_0x2054b7}from'../utils/storage.js';export async function login(){const _0x5f11e4=getApiUrl(),_0x5f4fa7=0x2694;return new Promise(_0x9f9881=>{const _0x23ec2c=a0_0x1587,_0x4dfc50=createServer(async(_0x3308c9,_0x11a30c)=>{const _0x4dab27=a0_0x1587,_0x516098=new URL(_0x3308c9[_0x4dab27(0xc2)]||'',_0x4dab27(0xc5)+_0x5f4fa7);if(_0x516098[_0x4dab27(0xce)]===_0x4dab27(0xc6)){const _0x387aa9=_0x516098['searchParams'][_0x4dab27(0xca)](_0x4dab27(0xcf)),_0x542f9f=_0x516098[_0x4dab27(0xd2)][_0x4dab27(0xca)](_0x4dab27(0xcb)),_0x33b6e5=_0x516098['searchParams'][_0x4dab27(0xca)]('email'),_0x3483bf=_0x516098[_0x4dab27(0xd2)]['get']('displayName');_0x387aa9&&_0x542f9f?(setToken(_0x387aa9),setUser(_0x542f9f,_0x33b6e5||'',_0x3483bf||''),_0x11a30c[_0x4dab27(0xc1)](0xc8,{'Content-Type':_0x4dab27(0xc0)}),_0x11a30c['end'](_0x4dab27(0xd1)),_0x4dfc50[_0x4dab27(0xd3)](),_0x9f9881(!![])):(_0x11a30c[_0x4dab27(0xc1)](0x190,{'Content-Type':_0x4dab27(0xc0)}),_0x11a30c[_0x4dab27(0xc4)](_0x4dab27(0xd7)),_0x4dfc50[_0x4dab27(0xd3)](),_0x9f9881(![]));}});_0x4dfc50[_0x23ec2c(0xbe)](_0x5f4fa7,()=>{const _0x284935=_0x23ec2c,_0x2a1f36=_0x5f11e4+_0x284935(0xcc)+_0x5f4fa7+_0x284935(0xc6);a0_0x1a380e(_0x2a1f36);}),setTimeout(()=>{const _0x18aefb=_0x23ec2c;_0x4dfc50[_0x18aefb(0xd3)](),_0x9f9881(![]);},0x1d4c0);});}export function logout(){a0_0x2054b7();}export{isLoggedIn};
|
package/dist/chat/agent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a1_0x292ec6=a1_0x4630;(function(_0x44b341,_0x5749c){const _0x1ed1de=a1_0x4630,_0x322bd8=_0x44b341();while(!![]){try{const _0x6d20e4=parseInt(_0x1ed1de(0x179))/0x1+-parseInt(_0x1ed1de(0x161))/0x2+parseInt(_0x1ed1de(0x15e))/0x3*(-parseInt(_0x1ed1de(0x15f))/0x4)+-parseInt(_0x1ed1de(0x11e))/0x5*(parseInt(_0x1ed1de(0x137))/0x6)+-parseInt(_0x1ed1de(0x182))/0x7+parseInt(_0x1ed1de(0x16c))/0x8*(-parseInt(_0x1ed1de(0x116))/0x9)+parseInt(_0x1ed1de(0x15d))/0xa;if(_0x6d20e4===_0x5749c)break;else _0x322bd8['push'](_0x322bd8['shift']());}catch(_0x3a8a45){_0x322bd8['push'](_0x322bd8['shift']());}}}(a1_0x5715,0x94326));import{input}from'@inquirer/prompts';function a1_0x4630(_0x44a88c,_0x286482){_0x44a88c=_0x44a88c-0x10f;const _0x571560=a1_0x5715();let _0x463073=_0x571560[_0x44a88c];return _0x463073;}function a1_0x5715(){const _0x522324=['stdout','run_command','#2563eb','/mcp','trim','Listing...','Commands','Conversation\x20cleared','#60a5fa','Reached\x20maximum\x20iterations','read_file','length','Running...','string','Reading...','search_directory','stop','search_file','info','actionSpinner','serverName','/help','.\x20Use\x20','282QiEyIj','commandOutput','list_directory','cwd','Executing...','):\x20','\x20\x20/rollback\x20-\x20Undo\x20last\x20AI\x20file\x20change','content','\x20\x20/help\x20\x20\x20\x20\x20-\x20Show\x20this\x20help','pattern','create_file','path','\x0a\x0aYou\x20also\x20have\x20access\x20to\x20these\x20external\x20MCP\x20tools:\x0a','Unknown\x20tool:\x20','...\x20(truncated)','../tools/file.js','isOverLimit','gradientText','Result:','/stats','read','/rollback','startsWith','\x20\x20/exit\x20\x20\x20\x20\x20-\x20Exit\x20the\x20chat','/usage','push','.\x20Use\x20PowerShell\x20commands.','write','includes','Unexpected\x20error:\x20','user','args','../tools/rollback.js','No\x20MCP\x20tools\x20connected.','\x20>\x20','match','success','isSpinning','28262550EeNQbi','159veQpSx','82568JekeNk','```','438514tsbwOO','Connected\x20MCP\x20Tools:','currentDir','inputSchema','Searching...','email','aiMessageEnd','description','You\x20are\x20Woozlit\x20AI,\x20a\x20powerful\x20agentic\x20coding\x20assistant.\x20You\x20help\x20users\x20with\x20coding\x20tasks\x20by\x20executing\x20actions\x20until\x20the\x20task\x20is\x20complete.\x0a\x0aYou\x20have\x20access\x20to\x20the\x20following\x20tools:\x0a-\x20create_file(path,\x20content):\x20Create\x20a\x20new\x20file\x20with\x20the\x20given\x20content\x0a-\x20read_file(path):\x20Read\x20the\x20contents\x20of\x20a\x20file\x0a-\x20list_directory(path):\x20List\x20files\x20and\x20directories\x0a-\x20edit_file(path,\x20search,\x20replace):\x20Edit\x20a\x20file\x20by\x20replacing\x20text\x0a-\x20search_file(path,\x20pattern):\x20Search\x20for\x20a\x20regex\x20pattern\x20in\x20a\x20file\x0a-\x20find_files(path,\x20pattern):\x20Find\x20files\x20by\x20name\x20pattern\x20in\x20a\x20directory\x20(recursive)\x0a-\x20search_directory(path,\x20pattern):\x20Search\x20for\x20text/code\x20in\x20all\x20files\x20in\x20a\x20directory\x20(like\x20grep)\x0a-\x20run_command(command,\x20background?,\x20wait?):\x20Execute\x20a\x20shell\x20command.\x20Set\x20background=true\x20to\x20run\x20detached.\x20wait=time_in_ms\x20(default\x203000)\x20for\x20background\x20check.\x0a\x0aYou\x20have\x20full\x20access\x20to\x20the\x20system.\x20You\x20can\x20install\x20packages,\x20run\x20servers,\x20and\x20modify\x20files.\x0aIf\x20you\x20encounter\x20an\x20error\x20(e.g.,\x20missing\x20package,\x20syntax\x20error),\x20you\x20MUST\x20attempt\x20to\x20fix\x20it\x20yourself\x20immediately.\x0aDo\x20not\x20ask\x20for\x20permission\x20to\x20fix\x20errors.\x20Just\x20fix\x20them\x20and\x20continue.\x0aYou\x20can\x20run\x20any\x20command\x20necessary\x20to\x20complete\x20the\x20task.\x0a\x0aWhen\x20the\x20user\x20gives\x20you\x20a\x20task:\x0a1.\x20Analyze\x20what\x20needs\x20to\x20be\x20done.\x0a2.\x20If\x20the\x20task\x20is\x20complex\x20or\x20long-running,\x20create\x20a\x20file\x20named\x20\x22info.woozlit\x22\x20to\x20store\x20your\x20plan\x20and\x20track\x20your\x20progress.\x0a3.\x20Execute\x20the\x20necessary\x20actions\x20step\x20by\x20step.\x0a4.\x20Continue\x20until\x20the\x20task\x20is\x20complete.\x0a5.\x20Report\x20what\x20you\x20accomplished.\x0a\x0aTo\x20use\x20a\x20tool,\x20respond\x20with\x20a\x20JSON\x20block\x20like\x20this:\x0a```tool\x0a{\x22name\x22:\x20\x22create_file\x22,\x20\x22args\x22:\x20{\x22path\x22:\x20\x22hello.txt\x22,\x20\x22content\x22:\x20\x22Hello\x20World\x22}}\x0a```\x0a\x0aFor\x20all\x20other\x20responses,\x20just\x20write\x20plain\x20text.\x20Do\x20NOT\x20wrap\x20your\x20response\x20in\x20JSON.\x20Do\x20NOT\x20output\x20{\x22message\x22:\x20\x22...\x22}.\x20Just\x20write\x20the\x20message\x20directly.\x0a','list','Goodbye!','3584808QKVZrQ','Fetching\x20usage...','Failed\x20JSON\x20content:','stringify','\x0aYou\x20are\x20running\x20on\x20','edit_file','Current\x20model:\x20','name','parse','displayName','Thinking...','/quit','map','387099Auiwvj','Editing...','edit','mcpConnected','replace','\x20\x20/mcp\x20\x20\x20\x20\x20\x20-\x20List\x20connected\x20tools','toolActivity','usageBox','\x20\x20/clear\x20\x20\x20\x20-\x20Clear\x20conversation\x20history','5030669qhkqGT','start','message','find_files','monthlyLimit','now','join','force\x20closed','dim','9qSOHMg','search','size','error','```tool','createSpinner','create','MCP\x20Tool\x20error:\x20','13435sHXWRc','Model\x20changed\x20to:\x20'];a1_0x5715=function(){return _0x522324;};return a1_0x5715();}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 a1_0x868dc from'../ui/output.js';import{selectModel}from'../ui/select.js';import{getPlatformInfo,isWindows,getShellPrefix}from'../utils/platform.js';const SYSTEM_PROMPT=a1_0x292ec6(0x169);export async function startChat(_0x20a3ad){const _0x1a7c3d=a1_0x292ec6,_0x4dd3e0=getSelectedModel();await connectToMcpServers();const _0x299b4a=await getMcpTools(),_0xa7907f=new Set(_0x299b4a[_0x1a7c3d(0x178)](_0xebc090=>_0xebc090[_0x1a7c3d(0x134)]));_0xa7907f[_0x1a7c3d(0x118)]>0x0&&a1_0x868dc[_0x1a7c3d(0x17c)](_0xa7907f[_0x1a7c3d(0x118)],_0x299b4a[_0x1a7c3d(0x12b)]);process['on']('exit',()=>closeMcpClients());const _0x1cf834=formatRulesForSystem(),_0x313a69=getPlatformInfo(),_0x2ad92f=getShellPrefix(),_0x560a65=_0x299b4a[_0x1a7c3d(0x12b)]>0x0?_0x1a7c3d(0x143)+_0x299b4a['map'](_0x28e1ba=>{const _0x5cbad4=_0x1a7c3d,_0xd7d3f1=Object['keys'](_0x28e1ba[_0x5cbad4(0x164)]?.['properties']||{})[_0x5cbad4(0x113)](',\x20');return'-\x20'+_0x28e1ba[_0x5cbad4(0x173)]+'('+_0xd7d3f1+_0x5cbad4(0x13c)+_0x28e1ba['description'];})['join']('\x0a'):'',_0x3f01bf=isWindows()?'\x0aYou\x20are\x20running\x20on\x20'+_0x313a69+_0x1a7c3d(0x151):_0x1a7c3d(0x170)+_0x313a69+_0x1a7c3d(0x136)+_0x2ad92f+'\x20for\x20commands\x20requiring\x20elevated\x20privileges.',_0x5aa8e8=SYSTEM_PROMPT+_0x560a65+_0x3f01bf+'\x0a'+_0x1cf834,_0x42f21b=getUser(),_0x33b25b=[{'role':'system','content':_0x5aa8e8}];(_0x42f21b['displayName']||_0x42f21b[_0x1a7c3d(0x166)])&&a1_0x868dc['loggedInBox'](_0x42f21b[_0x1a7c3d(0x175)]||_0x42f21b[_0x1a7c3d(0x166)]||'Unknown');a1_0x868dc[_0x1a7c3d(0x163)](process[_0x1a7c3d(0x13a)]()),a1_0x868dc[_0x1a7c3d(0x115)]('Tips:\x20/exit\x20to\x20quit,\x20/clear\x20to\x20reset,\x20/model\x20to\x20switch,\x20/help\x20for\x20more'),a1_0x868dc['statusBar'](_0x4dd3e0,0x64);const _0x5516fd=async _0x4a2c27=>{const _0x2b7bbc=_0x1a7c3d;if(!_0x4a2c27||_0x4a2c27[_0x2b7bbc(0x124)]()==='')return!![];const _0x4296e3=_0x4a2c27[_0x2b7bbc(0x124)]();if(_0x4296e3==='/exit'||_0x4296e3===_0x2b7bbc(0x177))return a1_0x868dc[_0x2b7bbc(0x132)](_0x2b7bbc(0x16b)),![];if(_0x4296e3==='/clear')return _0x33b25b['length']=0x1,a1_0x868dc[_0x2b7bbc(0x132)](_0x2b7bbc(0x127)),!![];if(_0x4296e3===_0x2b7bbc(0x123)){const _0x3432f1=await getMcpTools();return _0x3432f1[_0x2b7bbc(0x12b)]===0x0?a1_0x868dc[_0x2b7bbc(0x132)](_0x2b7bbc(0x158)):(a1_0x868dc[_0x2b7bbc(0x132)](_0x2b7bbc(0x162)),_0x3432f1['forEach'](_0x409996=>a1_0x868dc['dim']('-\x20'+_0x409996[_0x2b7bbc(0x173)]+'\x20('+_0x409996[_0x2b7bbc(0x134)]+_0x2b7bbc(0x13c)+(_0x409996[_0x2b7bbc(0x168)]?.['slice'](0x0,0x32)||'')))),a1_0x868dc[_0x2b7bbc(0x115)]('\x0aUse\x20\x27woozlit\x20mcp\x27\x20command\x20to\x20manage\x20servers.'),!![];}if(_0x4296e3===_0x2b7bbc(0x135))return a1_0x868dc['header'](_0x2b7bbc(0x126)),a1_0x868dc['dim'](_0x2b7bbc(0x14e)),a1_0x868dc[_0x2b7bbc(0x115)](_0x2b7bbc(0x181)),a1_0x868dc[_0x2b7bbc(0x115)]('\x20\x20/model\x20\x20\x20\x20-\x20Switch\x20AI\x20model'),a1_0x868dc[_0x2b7bbc(0x115)](_0x2b7bbc(0x17e)),a1_0x868dc[_0x2b7bbc(0x115)]('\x20\x20/usage\x20\x20\x20\x20-\x20Show\x20token\x20usage\x20stats'),a1_0x868dc['dim'](_0x2b7bbc(0x13d)),a1_0x868dc[_0x2b7bbc(0x115)](_0x2b7bbc(0x13f)),!![];if(_0x4296e3===_0x2b7bbc(0x14c)){const {rollbackLast:_0x3d834d,getChanges:_0x3410b1}=await import(_0x2b7bbc(0x157)),_0x496b27=_0x3410b1();if(_0x496b27['length']===0x0)a1_0x868dc[_0x2b7bbc(0x132)]('No\x20changes\x20to\x20rollback');else{const _0x55bad2=_0x3d834d();_0x55bad2[_0x2b7bbc(0x15b)]?a1_0x868dc[_0x2b7bbc(0x15b)](_0x55bad2[_0x2b7bbc(0x10f)]):a1_0x868dc['error'](_0x55bad2[_0x2b7bbc(0x10f)]);}return!![];}if(_0x4296e3==='/model'){const _0x5e7f14=await selectModel();return _0x5e7f14!==_0x4dd3e0?(a1_0x868dc['info'](_0x2b7bbc(0x11f)+_0x5e7f14),a1_0x868dc[_0x2b7bbc(0x132)]('Please\x20restart\x20the\x20chat\x20for\x20the\x20change\x20to\x20take\x20full\x20effect.')):a1_0x868dc['info'](_0x2b7bbc(0x172)+_0x4dd3e0),!![];}if(_0x4296e3===_0x2b7bbc(0x14f)||_0x4296e3===_0x2b7bbc(0x14a)){const _0x4ee519=a1_0x868dc[_0x2b7bbc(0x11b)](_0x2b7bbc(0x16d));_0x4ee519[_0x2b7bbc(0x183)]();const _0x10aa4a=await getUserUsage();return _0x4ee519['stop'](),_0x10aa4a?a1_0x868dc[_0x2b7bbc(0x180)](_0x10aa4a['tokensUsed'],_0x10aa4a[_0x2b7bbc(0x111)],_0x10aa4a[_0x2b7bbc(0x147)]):a1_0x868dc['error']('Failed\x20to\x20fetch\x20usage\x20data.'),!![];}return _0x33b25b[_0x2b7bbc(0x150)]({'role':_0x2b7bbc(0x155),'content':_0x4296e3}),await processAgentLoop(_0x33b25b,_0x4dd3e0),!![];};if(_0x20a3ad){const _0x29740f=await _0x5516fd(_0x20a3ad);if(!_0x29740f)return;}while(!![]){try{const _0x4f5d49=a1_0x868dc[_0x1a7c3d(0x148)](_0x1a7c3d(0x159),_0x1a7c3d(0x128),_0x1a7c3d(0x122)),_0x406d84=await input({'message':_0x4f5d49,'theme':{'prefix':''}}),_0x348397=await _0x5516fd(_0x406d84);if(!_0x348397)break;}catch(_0x53aa4f){if(_0x53aa4f instanceof Error&&_0x53aa4f[_0x1a7c3d(0x10f)]['includes'](_0x1a7c3d(0x114)))break;a1_0x868dc[_0x1a7c3d(0x119)](_0x1a7c3d(0x154)+_0x53aa4f);}}}async function processAgentLoop(_0x369443,_0x4f2b5f){const _0x5dcb92=a1_0x292ec6;let _0x9fb093=0x0;const _0x1778ec=0x3e8;while(_0x9fb093<_0x1778ec){_0x9fb093++;const _0x63b6d3=a1_0x868dc[_0x5dcb92(0x11b)](_0x5dcb92(0x176));_0x63b6d3[_0x5dcb92(0x183)]();let _0x35337c='',_0x4eee45=![],_0x5c5786='';try{const _0x4ab4d4=await sendChatMessage(_0x4f2b5f,_0x369443,_0x236a87=>{const _0x482fc5=_0x5dcb92;_0x63b6d3[_0x482fc5(0x15c)]&&(_0x63b6d3[_0x482fc5(0x130)](),a1_0x868dc['aiMessage'](''));_0x35337c+=_0x236a87;for(const _0x198081 of _0x236a87){_0x5c5786+=_0x198081;if(_0x198081==='\x0a'){const _0x55672a=_0x5c5786[_0x482fc5(0x124)]();if(!_0x4eee45){if(_0x55672a['startsWith'](_0x482fc5(0x11a)))_0x4eee45=!![];else _0x55672a[_0x482fc5(0x14d)](_0x482fc5(0x160))?process['stdout'][_0x482fc5(0x152)](_0x5c5786):process[_0x482fc5(0x120)][_0x482fc5(0x152)](_0x5c5786);}else _0x55672a[_0x482fc5(0x14d)](_0x482fc5(0x160))&&!_0x55672a['includes']('tool')&&(_0x4eee45=![]);_0x5c5786='';}}});_0x5c5786&&!_0x4eee45&&!_0x5c5786[_0x5dcb92(0x14d)](_0x5dcb92(0x11a))&&process['stdout'][_0x5dcb92(0x152)](_0x5c5786),_0x35337c=_0x4ab4d4[_0x5dcb92(0x13e)];}catch(_0x2006c9){_0x63b6d3[_0x5dcb92(0x130)](),a1_0x868dc[_0x5dcb92(0x119)]('API\x20error:\x20'+_0x2006c9);return;}_0x63b6d3['isSpinning']&&_0x63b6d3['stop']();a1_0x868dc[_0x5dcb92(0x167)](),_0x369443[_0x5dcb92(0x150)]({'role':'assistant','content':_0x35337c});const _0x6d2315=_0x35337c[_0x5dcb92(0x15a)](/```tool\s*([\s\S]*?)\s*```/);if(!_0x6d2315)break;try{const _0x234dd0=_0x6d2315[0x1][_0x5dcb92(0x124)](),_0x4f0903=JSON[_0x5dcb92(0x174)](_0x234dd0);a1_0x868dc[_0x5dcb92(0x17f)](_0x4f0903['name'],_0x4f0903[_0x5dcb92(0x156)]);let _0x6741fb=_0x5dcb92(0x13b);if(_0x4f0903[_0x5dcb92(0x173)][_0x5dcb92(0x14d)](_0x5dcb92(0x14b)))_0x6741fb=_0x5dcb92(0x12e);if(_0x4f0903[_0x5dcb92(0x173)]['startsWith'](_0x5dcb92(0x11c)))_0x6741fb='Creating...';if(_0x4f0903[_0x5dcb92(0x173)][_0x5dcb92(0x14d)](_0x5dcb92(0x17b)))_0x6741fb=_0x5dcb92(0x17a);if(_0x4f0903[_0x5dcb92(0x173)]['startsWith'](_0x5dcb92(0x16a)))_0x6741fb=_0x5dcb92(0x125);if(_0x4f0903[_0x5dcb92(0x173)][_0x5dcb92(0x14d)](_0x5dcb92(0x117)))_0x6741fb=_0x5dcb92(0x165);if(_0x4f0903[_0x5dcb92(0x173)]===_0x5dcb92(0x121))_0x6741fb=_0x5dcb92(0x12c);const _0x34017b=a1_0x868dc[_0x5dcb92(0x133)](_0x6741fb);_0x34017b[_0x5dcb92(0x183)]();const _0x4ea5cd=performance[_0x5dcb92(0x112)]();let _0x17e8f1;try{_0x17e8f1=await executeToolCall(_0x4f0903[_0x5dcb92(0x173)],_0x4f0903['args']);}catch(_0x155ab8){if(_0x155ab8[_0x5dcb92(0x10f)]&&_0x155ab8[_0x5dcb92(0x10f)][_0x5dcb92(0x153)]('Unknown\x20tool')){const _0x528208=await getMcpTools(),_0x7c2823=_0x528208['find'](_0x428f7f=>_0x428f7f['name']===_0x4f0903[_0x5dcb92(0x173)]);if(_0x7c2823)try{_0x17e8f1=await executeMcpTool(_0x7c2823[_0x5dcb92(0x134)],_0x7c2823[_0x5dcb92(0x173)],_0x4f0903[_0x5dcb92(0x156)]);}catch(_0x247d65){throw new Error(_0x5dcb92(0x11d)+_0x247d65);}else throw _0x155ab8;}else throw _0x155ab8;}_0x34017b['stop']();if(_0x17e8f1){const _0x581e96=typeof _0x17e8f1===_0x5dcb92(0x12d)?_0x17e8f1:JSON[_0x5dcb92(0x16f)](_0x17e8f1,null,0x2),_0x4fad6e=_0x581e96[_0x5dcb92(0x12b)]>0x3e8?_0x581e96['substring'](0x0,0x3e8)+_0x5dcb92(0x145):_0x581e96;a1_0x868dc[_0x5dcb92(0x115)](_0x5dcb92(0x149)),a1_0x868dc['dim'](_0x4fad6e);}_0x369443[_0x5dcb92(0x150)]({'role':_0x5dcb92(0x155),'content':'Tool\x20result\x20for\x20'+_0x4f0903[_0x5dcb92(0x173)]+':\x0a'+JSON['stringify'](_0x17e8f1,null,0x2)}),await new Promise(_0x16e461=>setTimeout(_0x16e461,0x3e8));}catch(_0x24aa6c){a1_0x868dc[_0x5dcb92(0x119)]('Tool\x20error:\x20'+_0x24aa6c);_0x6d2315&&_0x6d2315[0x1]&&(a1_0x868dc[_0x5dcb92(0x115)](_0x5dcb92(0x16e)),a1_0x868dc[_0x5dcb92(0x115)](_0x6d2315[0x1]));break;}}_0x9fb093>=_0x1778ec&&a1_0x868dc['warn'](_0x5dcb92(0x129));}async function executeToolCall(_0x10763b,_0x2210ad){const _0x313544=a1_0x292ec6;switch(_0x10763b){case _0x313544(0x141):return createFile(_0x2210ad[_0x313544(0x142)],_0x2210ad['content']);case _0x313544(0x12a):return readFile(_0x2210ad['path']);case _0x313544(0x139):return listDirectory(_0x2210ad['path']||'.');case _0x313544(0x171):return editFile(_0x2210ad['path'],_0x2210ad['search'],_0x2210ad[_0x313544(0x17d)]);case _0x313544(0x131):return searchFile(_0x2210ad['path'],_0x2210ad[_0x313544(0x140)]);case _0x313544(0x121):const {command:_0x5d1a60,background:_0x1f4152,wait:_0x7ca801}=_0x2210ad,_0x57b6e3=await runCommand(_0x5d1a60,_0x317654=>{const _0x43d0fc=_0x313544;a1_0x868dc[_0x43d0fc(0x138)](_0x317654);},_0x1f4152,_0x7ca801);return _0x57b6e3;case _0x313544(0x110):{const {findFiles:_0x262efd}=await import(_0x313544(0x146));return _0x262efd(_0x2210ad['path']||'.',_0x2210ad[_0x313544(0x140)]);}case _0x313544(0x12f):{const {searchDirectory:_0x28a269}=await import(_0x313544(0x146));return _0x28a269(_0x2210ad['path']||'.',_0x2210ad[_0x313544(0x140)]);}default:return{'error':_0x313544(0x144)+_0x10763b};}}
|
|
1
|
+
(function(_0x44cc69,_0x592caa){const _0x13591b=a1_0x5218,_0x3f7e0a=_0x44cc69();while(!![]){try{const _0x4af6d7=parseInt(_0x13591b(0x1e1))/0x1*(-parseInt(_0x13591b(0x236))/0x2)+parseInt(_0x13591b(0x221))/0x3+parseInt(_0x13591b(0x1d1))/0x4*(parseInt(_0x13591b(0x203))/0x5)+-parseInt(_0x13591b(0x234))/0x6+parseInt(_0x13591b(0x1e9))/0x7+parseInt(_0x13591b(0x1dc))/0x8*(-parseInt(_0x13591b(0x1d2))/0x9)+parseInt(_0x13591b(0x244))/0xa;if(_0x4af6d7===_0x592caa)break;else _0x3f7e0a['push'](_0x3f7e0a['shift']());}catch(_0x14ad2f){_0x3f7e0a['push'](_0x3f7e0a['shift']());}}}(a1_0x1aea,0x2cb76));import{input}from'@inquirer/prompts';import a1_0x1d3e1c from'chalk';function a1_0x5218(_0x275a31,_0x45974e){_0x275a31=_0x275a31-0x1c4;const _0x1aeab4=a1_0x1aea();let _0x521854=_0x1aeab4[_0x275a31];return _0x521854;}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 a1_0x2da411 from'../ui/output.js';import{selectModel}from'../ui/select.js';import{getPlatformInfo,isWindows,getShellPrefix}from'../utils/platform.js';const SYSTEM_PROMPT='You\x20are\x20Woozlit\x20AI,\x20a\x20powerful\x20autonomous\x20coding\x20agent.\x20You\x20complete\x20tasks\x20by\x20running\x20commands\x20and\x20executing\x20actions\x20in\x20a\x20loop\x20until\x20the\x20task\x20is\x20FULLY\x20complete.\x0a\x0aIMPORTANT:\x20You\x20are\x20an\x20AUTONOMOUS\x20AGENT.\x20Do\x20NOT\x20stop\x20after\x20one\x20action.\x20Keep\x20going\x20until\x20the\x20ENTIRE\x20task\x20is\x20done.\x0a\x0aPRIMARY\x20TOOL\x20-\x20USE\x20THIS\x20FOR\x20MOST\x20TASKS:\x0a-\x20run_command(command):\x20Execute\x20any\x20shell\x20command.\x20Use\x20this\x20for\x20EVERYTHING:\x20installing\x20packages,\x20running\x20scripts,\x20git\x20operations,\x20file\x20operations,\x20building\x20projects,\x20starting\x20servers,\x20etc.\x0a\x0aSECONDARY\x20TOOLS\x20(use\x20only\x20when\x20run_command\x20won\x27t\x20work):\x0a-\x20create_file(path,\x20content):\x20Create\x20a\x20new\x20file\x0a-\x20read_file(path):\x20Read\x20file\x20contents\x0a-\x20edit_file(path,\x20search,\x20replace):\x20Edit\x20a\x20file\x0a-\x20list_directory(path):\x20List\x20files\x0a-\x20search_file(path,\x20pattern):\x20Search\x20in\x20a\x20file\x0a-\x20find_files(path,\x20pattern):\x20Find\x20files\x20by\x20name\x0a-\x20search_directory(path,\x20pattern):\x20Search\x20text\x20in\x20all\x20files\x0a\x0aAGENT\x20BEHAVIOR:\x0a1.\x20Analyze\x20the\x20task\x20and\x20break\x20it\x20into\x20steps\x0a2.\x20Execute\x20each\x20step\x20using\x20run_command\x20(preferred)\x20or\x20other\x20tools\x0a3.\x20Check\x20the\x20result\x20of\x20each\x20command\x0a4.\x20If\x20there\x27s\x20an\x20error,\x20FIX\x20IT\x20IMMEDIATELY\x20-\x20don\x27t\x20ask,\x20just\x20fix\x0a5.\x20Continue\x20to\x20the\x20next\x20step\x0a6.\x20KEEP\x20LOOPING\x20until\x20the\x20ENTIRE\x20task\x20is\x20complete\x0a7.\x20Only\x20stop\x20when\x20you\x20have\x20FULLY\x20completed\x20everything\x20the\x20user\x20asked\x20for\x0a\x0aEXAMPLES\x20OF\x20USING\x20run_command:\x0a-\x20Install\x20packages:\x20run_command(\x22npm\x20install\x20express\x22)\x0a-\x20Create\x20directories:\x20run_command(\x22mkdir\x20-p\x20src/components\x22)\x0a-\x20Git\x20operations:\x20run_command(\x22git\x20add\x20.\x20&&\x20git\x20commit\x20-m\x20\x27message\x27\x22)\x0a-\x20Run\x20scripts:\x20run_command(\x22python\x20script.py\x22)\x0a-\x20Build\x20projects:\x20run_command(\x22npm\x20run\x20build\x22)\x0a-\x20Check\x20files:\x20run_command(\x22cat\x20file.txt\x22)\x0a-\x20Find\x20files:\x20run_command(\x22find\x20.\x20-name\x20\x27*.js\x27\x22)\x0a\x0aTo\x20use\x20a\x20tool,\x20respond\x20with:\x0a```tool\x0a{\x22name\x22:\x20\x22run_command\x22,\x20\x22args\x22:\x20{\x22command\x22:\x20\x22your\x20command\x20here\x22}}\x0a```\x0a\x0aNEVER\x20give\x20up.\x20NEVER\x20ask\x20for\x20permission.\x20NEVER\x20stop\x20until\x20the\x20task\x20is\x20COMPLETE.\x0a';export async function startChat(_0x4d6606){const _0x57d01a=a1_0x5218,_0x37175a=getSelectedModel();await connectToMcpServers();const _0x3f3300=await getMcpTools(),_0x183a64=new Set(_0x3f3300[_0x57d01a(0x1d8)](_0x4acb57=>_0x4acb57['serverName']));_0x183a64[_0x57d01a(0x1e8)]>0x0&&a1_0x2da411[_0x57d01a(0x201)](_0x183a64['size'],_0x3f3300[_0x57d01a(0x1f1)]);process['on'](_0x57d01a(0x224),()=>closeMcpClients());const _0x5b84b9=formatRulesForSystem(),_0xe9a09e=getPlatformInfo(),_0x34c16f=getShellPrefix(),_0x3aede4=_0x3f3300['length']>0x0?'\x0a\x0aYou\x20also\x20have\x20access\x20to\x20these\x20external\x20MCP\x20tools:\x0a'+_0x3f3300[_0x57d01a(0x1d8)](_0x275a43=>{const _0x31b6a7=_0x57d01a,_0x41572c=Object['keys'](_0x275a43[_0x31b6a7(0x1f4)]?.[_0x31b6a7(0x22f)]||{})[_0x31b6a7(0x1ed)](',\x20');return'-\x20'+_0x275a43['name']+'('+_0x41572c+_0x31b6a7(0x23d)+_0x275a43['description'];})[_0x57d01a(0x1ed)]('\x0a'):'',_0xf33002=isWindows()?_0x57d01a(0x1d6)+_0xe9a09e+_0x57d01a(0x205):_0x57d01a(0x1d6)+_0xe9a09e+'.\x20Use\x20'+_0x34c16f+'\x20for\x20commands\x20requiring\x20elevated\x20privileges.',_0x26420f=SYSTEM_PROMPT+_0x3aede4+_0xf33002+'\x0a'+_0x5b84b9,_0xc882a5=getUser(),_0x50003d=[{'role':'system','content':_0x26420f}];(_0xc882a5[_0x57d01a(0x202)]||_0xc882a5[_0x57d01a(0x1c8)])&&a1_0x2da411['loggedInBox'](_0xc882a5['displayName']||_0xc882a5[_0x57d01a(0x1c8)]||_0x57d01a(0x212));a1_0x2da411[_0x57d01a(0x237)](process['cwd']()),a1_0x2da411[_0x57d01a(0x1e3)](_0x57d01a(0x22c)),a1_0x2da411['statusBar'](_0x37175a,0x64);const _0x399687=async _0x11ed3d=>{const _0x5c44ef=_0x57d01a;if(!_0x11ed3d||_0x11ed3d[_0x5c44ef(0x1fb)]()==='')return!![];const _0x467475=_0x11ed3d[_0x5c44ef(0x1fb)]();if(_0x467475===_0x5c44ef(0x20d)||_0x467475===_0x5c44ef(0x1d5))return a1_0x2da411['info'](_0x5c44ef(0x23a)),![];if(_0x467475===_0x5c44ef(0x1f2))return _0x50003d[_0x5c44ef(0x1f1)]=0x1,a1_0x2da411[_0x5c44ef(0x21d)](_0x5c44ef(0x1f7)),!![];if(_0x467475===_0x5c44ef(0x1d3)){const _0x3ed9eb=await getMcpTools();return _0x3ed9eb['length']===0x0?a1_0x2da411['info'](_0x5c44ef(0x23b)):(a1_0x2da411['info'](_0x5c44ef(0x227)),_0x3ed9eb[_0x5c44ef(0x210)](_0x3bd963=>a1_0x2da411[_0x5c44ef(0x1e3)]('-\x20'+_0x3bd963[_0x5c44ef(0x1cb)]+'\x20('+_0x3bd963[_0x5c44ef(0x1f5)]+_0x5c44ef(0x23d)+(_0x3bd963['description']?.[_0x5c44ef(0x21a)](0x0,0x32)||'')))),a1_0x2da411[_0x5c44ef(0x1e3)](_0x5c44ef(0x1fe)),!![];}if(_0x467475===_0x5c44ef(0x246))return a1_0x2da411[_0x5c44ef(0x1ea)](_0x5c44ef(0x216)),a1_0x2da411['dim'](_0x5c44ef(0x22d)),a1_0x2da411['dim'](_0x5c44ef(0x213)),a1_0x2da411[_0x5c44ef(0x1e3)]('\x20\x20/model\x20\x20\x20\x20-\x20Switch\x20AI\x20model'),a1_0x2da411[_0x5c44ef(0x1e3)](_0x5c44ef(0x241)),a1_0x2da411[_0x5c44ef(0x1e3)]('\x20\x20/usage\x20\x20\x20\x20-\x20Show\x20token\x20usage\x20stats'),a1_0x2da411[_0x5c44ef(0x1e3)](_0x5c44ef(0x209)),a1_0x2da411[_0x5c44ef(0x1e3)](_0x5c44ef(0x1cc)),!![];if(_0x467475===_0x5c44ef(0x22e)){const {rollbackLast:_0x4e5dad,getChanges:_0x1543b7}=await import(_0x5c44ef(0x1ef)),_0x42477e=_0x1543b7();if(_0x42477e[_0x5c44ef(0x1f1)]===0x0)a1_0x2da411[_0x5c44ef(0x21d)](_0x5c44ef(0x1c4));else{const _0x3bf51c=_0x4e5dad();_0x3bf51c['success']?a1_0x2da411['success'](_0x3bf51c['message']):a1_0x2da411[_0x5c44ef(0x218)](_0x3bf51c['message']);}return!![];}if(_0x467475===_0x5c44ef(0x1cd)){const _0x530bc2=await selectModel();return _0x530bc2!==_0x37175a?(a1_0x2da411['info'](_0x5c44ef(0x20e)+_0x530bc2),a1_0x2da411[_0x5c44ef(0x21d)](_0x5c44ef(0x21b))):a1_0x2da411['info'](_0x5c44ef(0x22b)+_0x37175a),!![];}if(_0x467475===_0x5c44ef(0x1f6)||_0x467475===_0x5c44ef(0x1e4)){const _0x3bb3e6=a1_0x2da411[_0x5c44ef(0x229)]('Fetching\x20usage...');_0x3bb3e6[_0x5c44ef(0x215)]();const _0x3e6664=await getUserUsage();return _0x3bb3e6[_0x5c44ef(0x23c)](),_0x3e6664?a1_0x2da411[_0x5c44ef(0x20b)](_0x3e6664[_0x5c44ef(0x217)],_0x3e6664[_0x5c44ef(0x223)],_0x3e6664[_0x5c44ef(0x1e7)]):a1_0x2da411[_0x5c44ef(0x218)](_0x5c44ef(0x22a)),!![];}return _0x50003d['push']({'role':'user','content':_0x467475}),await processAgentLoop(_0x50003d,_0x37175a),!![];};if(_0x4d6606){const _0x5a4555=await _0x399687(_0x4d6606);if(!_0x5a4555)return;}while(!![]){try{const _0x4b1a7b=a1_0x2da411[_0x57d01a(0x1f9)](_0x57d01a(0x1f8),_0x57d01a(0x1e6),_0x57d01a(0x20a)),_0x16284e=await input({'message':_0x4b1a7b,'theme':{'prefix':''}}),_0x3ef8b1=await _0x399687(_0x16284e);if(!_0x3ef8b1)break;}catch(_0xfa6f5f){if(_0xfa6f5f instanceof Error&&_0xfa6f5f[_0x57d01a(0x1e0)]['includes']('force\x20closed'))break;a1_0x2da411[_0x57d01a(0x218)](_0x57d01a(0x1db)+_0xfa6f5f);}}}function a1_0x1aea(){const _0x41ed7e=['Stop.','dim','/stats','list','#60a5fa','isOverLimit','size','479920FVUjRW','header','Reached\x20maximum\x20iterations','includes','join','list_directory','../tools/rollback.js','MCP\x20Tool\x20error:\x20','length','/clear','push','inputSchema','serverName','/usage','Conversation\x20cleared','\x20>\x20','gradientText','pattern','trim','replace','stdout','\x0aUse\x20\x27woozlit\x20mcp\x27\x20command\x20to\x20manage\x20servers.','Executing...','toFixed','mcpConnected','displayName','5YTqbDJ','removeListener','.\x20Use\x20PowerShell\x20commands.','isSpinning','actionSpinner','args','\x20\x20/rollback\x20-\x20Undo\x20last\x20AI\x20file\x20change','#2563eb','usageBox','path','/exit','Model\x20changed\x20to:\x20','find','forEach','read','Unknown','\x20\x20/clear\x20\x20\x20\x20-\x20Clear\x20conversation\x20history','edit','start','Commands','tokensUsed','error','.\x20Please\x20fix\x20this\x20and\x20continue.','slice','Please\x20restart\x20the\x20chat\x20for\x20the\x20change\x20to\x20take\x20full\x20effect.','user','info','```tool','find_files','succeed','130356CGQAmI','Tool\x20error\x20occurred:\x20','monthlyLimit','exit','edit_file','search','Connected\x20MCP\x20Tools:','match','createSpinner','Failed\x20to\x20fetch\x20usage\x20data.','Current\x20model:\x20','Tips:\x20/exit\x20to\x20quit,\x20/clear\x20to\x20reset,\x20/model\x20to\x20switch,\x20/help\x20for\x20more','\x20\x20/exit\x20\x20\x20\x20\x20-\x20Exit\x20the\x20chat','/rollback','properties','Done\x20in\x20','aiMessage','../tools/file.js','signal','690150MdnTcR','\x20[Aborted]','2zlhRvI','currentDir','content','Editing...','Goodbye!','No\x20MCP\x20tools\x20connected.','stop','):\x20','AbortError','write','commandOutput','\x20\x20/mcp\x20\x20\x20\x20\x20\x20-\x20List\x20connected\x20tools','Thinking...','parse','4006790JbozBW','assistant','/help','No\x20changes\x20to\x20rollback','SIGINT','startsWith','stringify','email','warn','API\x20error:\x20','name','\x20\x20/help\x20\x20\x20\x20\x20-\x20Show\x20this\x20help','/model','run_command','Reading...','Unknown\x20tool','674852crZbtx','23022uNtlgT','/mcp','Tool\x20result\x20for\x20','/quit','\x0aYou\x20are\x20running\x20on\x20','Creating...','map','Running...','```','Unexpected\x20error:\x20','560FDvjSO','toolActivity','now','aborted','message','204161XIsqYV'];a1_0x1aea=function(){return _0x41ed7e;};return a1_0x1aea();}async function processAgentLoop(_0x23ec9e,_0x58cb82){const _0x313f58=a1_0x5218;let _0x565b5a=0x0;const _0x522d9c=0x3e8;while(_0x565b5a<_0x522d9c){_0x565b5a++;const _0x4ce168=a1_0x2da411[_0x313f58(0x229)](_0x313f58(0x242));_0x4ce168[_0x313f58(0x215)]();let _0x530d61='',_0x1960a6=![],_0x3c821a='';const _0x157c48=new AbortController(),_0x10b615=()=>{const _0x4ad281=_0x313f58;_0x157c48['abort'](),a1_0x2da411[_0x4ad281(0x21d)]('\x0aAborting...');};process['on'](_0x313f58(0x1c5),_0x10b615);try{const _0x2a00da=await sendChatMessage(_0x58cb82,_0x23ec9e,_0x44d0fb=>{const _0x2b81b0=_0x313f58;_0x4ce168[_0x2b81b0(0x206)]&&(_0x4ce168[_0x2b81b0(0x23c)](),a1_0x2da411[_0x2b81b0(0x231)](''));_0x530d61+=_0x44d0fb;for(const _0x318dac of _0x44d0fb){_0x3c821a+=_0x318dac;if(_0x318dac==='\x0a'){if(!_0x1960a6){if(_0x3c821a[_0x2b81b0(0x1c6)](_0x2b81b0(0x21e)))_0x1960a6=!![];else _0x3c821a[_0x2b81b0(0x1c6)](_0x2b81b0(0x1da))?process[_0x2b81b0(0x1fd)]['write'](_0x3c821a):process[_0x2b81b0(0x1fd)][_0x2b81b0(0x23f)](_0x3c821a);}else _0x3c821a['startsWith'](_0x2b81b0(0x1da))&&!_0x3c821a[_0x2b81b0(0x1c6)](_0x2b81b0(0x21e))&&(_0x1960a6=![]);_0x3c821a='';}}},_0x157c48[_0x313f58(0x233)]);_0x3c821a&&!_0x1960a6&&!_0x3c821a[_0x313f58(0x1c6)](_0x313f58(0x21e))&&process['stdout']['write'](_0x3c821a),_0x530d61=_0x2a00da[_0x313f58(0x238)];}catch(_0x3ec780){_0x4ce168[_0x313f58(0x23c)](),process[_0x313f58(0x204)](_0x313f58(0x1c5),_0x10b615);if(_0x3ec780['name']===_0x313f58(0x23e)||_0x3ec780[_0x313f58(0x1e0)][_0x313f58(0x1ec)](_0x313f58(0x1df))){a1_0x2da411[_0x313f58(0x1c9)]('User\x20aborted.'),_0x23ec9e[_0x313f58(0x1f3)]({'role':_0x313f58(0x245),'content':_0x530d61+_0x313f58(0x235)}),_0x23ec9e[_0x313f58(0x1f3)]({'role':'user','content':_0x313f58(0x1e2)});break;}a1_0x2da411[_0x313f58(0x218)](_0x313f58(0x1ca)+_0x3ec780);return;}finally{process[_0x313f58(0x204)](_0x313f58(0x1c5),_0x10b615);}_0x4ce168[_0x313f58(0x206)]&&_0x4ce168[_0x313f58(0x23c)]();a1_0x2da411['aiMessageEnd'](),_0x23ec9e[_0x313f58(0x1f3)]({'role':_0x313f58(0x245),'content':_0x530d61});const _0x5cb243=_0x530d61[_0x313f58(0x228)](/```tool\s*([\s\S]*?)```/);if(!_0x5cb243)break;try{const _0x320053=_0x5cb243[0x1][_0x313f58(0x1fb)](),_0x577902=JSON[_0x313f58(0x243)](_0x320053);a1_0x2da411[_0x313f58(0x1dd)](_0x577902[_0x313f58(0x1cb)],_0x577902[_0x313f58(0x208)]);let _0x166873=_0x313f58(0x1ff);if(_0x577902[_0x313f58(0x1cb)]['startsWith'](_0x313f58(0x211)))_0x166873=_0x313f58(0x1cf);if(_0x577902[_0x313f58(0x1cb)][_0x313f58(0x1c6)]('create'))_0x166873=_0x313f58(0x1d7);if(_0x577902['name'][_0x313f58(0x1c6)](_0x313f58(0x214)))_0x166873=_0x313f58(0x239);if(_0x577902[_0x313f58(0x1cb)][_0x313f58(0x1c6)](_0x313f58(0x1e5)))_0x166873='Listing...';if(_0x577902[_0x313f58(0x1cb)]['startsWith'](_0x313f58(0x226)))_0x166873='Searching...';if(_0x577902[_0x313f58(0x1cb)]===_0x313f58(0x1ce))_0x166873=_0x313f58(0x1d9);const _0x42945a=a1_0x2da411[_0x313f58(0x207)](_0x166873);_0x42945a[_0x313f58(0x215)]();const _0x346477=performance[_0x313f58(0x1de)]();let _0x15bb6b;try{_0x15bb6b=await executeToolCall(_0x577902['name'],_0x577902[_0x313f58(0x208)]);}catch(_0x4b2bf2){if(_0x4b2bf2[_0x313f58(0x1e0)]&&_0x4b2bf2[_0x313f58(0x1e0)][_0x313f58(0x1ec)](_0x313f58(0x1d0))){const _0x3f4d4e=await getMcpTools(),_0xa8ace=_0x3f4d4e[_0x313f58(0x20f)](_0x341a0b=>_0x341a0b['name']===_0x577902['name']);if(_0xa8ace)try{_0x15bb6b=await executeMcpTool(_0xa8ace[_0x313f58(0x1f5)],_0xa8ace[_0x313f58(0x1cb)],_0x577902[_0x313f58(0x208)]);}catch(_0x1f47e5){throw new Error(_0x313f58(0x1f0)+_0x1f47e5);}else throw _0x4b2bf2;}else throw _0x4b2bf2;}const _0x4584e6=((performance[_0x313f58(0x1de)]()-_0x346477)/0x3e8)[_0x313f58(0x200)](0x1);_0x42945a[_0x313f58(0x220)](a1_0x1d3e1c[_0x313f58(0x1e3)](_0x313f58(0x230)+_0x4584e6+'s')),_0x23ec9e[_0x313f58(0x1f3)]({'role':_0x313f58(0x21c),'content':_0x313f58(0x1d4)+_0x577902[_0x313f58(0x1cb)]+':\x0a'+JSON[_0x313f58(0x1c7)](_0x15bb6b,null,0x2)}),await new Promise(_0x33e866=>setTimeout(_0x33e866,0x1f4));}catch(_0x5e4355){a1_0x2da411['error']('Tool\x20error:\x20'+_0x5e4355),_0x23ec9e['push']({'role':_0x313f58(0x21c),'content':_0x313f58(0x222)+_0x5e4355+_0x313f58(0x219)});}}_0x565b5a>=_0x522d9c&&a1_0x2da411[_0x313f58(0x1c9)](_0x313f58(0x1eb));}async function executeToolCall(_0x528400,_0x2d3ad0){const _0x119814=a1_0x5218;switch(_0x528400){case'create_file':return createFile(_0x2d3ad0[_0x119814(0x20c)],_0x2d3ad0[_0x119814(0x238)]);case'read_file':return readFile(_0x2d3ad0[_0x119814(0x20c)]);case _0x119814(0x1ee):return listDirectory(_0x2d3ad0['path']||'.');case _0x119814(0x225):return editFile(_0x2d3ad0[_0x119814(0x20c)],_0x2d3ad0[_0x119814(0x226)],_0x2d3ad0[_0x119814(0x1fc)]);case'search_file':return searchFile(_0x2d3ad0['path'],_0x2d3ad0['pattern']);case _0x119814(0x1ce):const {command:_0x50c708,background:_0x24a175,wait:_0x1bd4b0}=_0x2d3ad0,_0x20537a=await runCommand(_0x50c708,_0x50d2e7=>{const _0x576fd7=_0x119814;a1_0x2da411[_0x576fd7(0x240)](_0x50d2e7);},_0x24a175,_0x1bd4b0);return _0x20537a;case _0x119814(0x21f):{const {findFiles:_0x27697f}=await import(_0x119814(0x232));return _0x27697f(_0x2d3ad0['path']||'.',_0x2d3ad0[_0x119814(0x1fa)]);}case'search_directory':{const {searchDirectory:_0x4db1b2}=await import(_0x119814(0x232));return _0x4db1b2(_0x2d3ad0[_0x119814(0x20c)]||'.',_0x2d3ad0['pattern']);}default:return{'error':'Unknown\x20tool:\x20'+_0x528400};}}
|
package/dist/config/mcp.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare function getMcpServers(): Record<string, McpServerConfig>;
|
|
|
14
14
|
export declare function addMcpServer(name: string, command: string, args?: string[], env?: Record<string, string>): void;
|
|
15
15
|
export declare function addMcpHttpServer(name: string, url: string): void;
|
|
16
16
|
export declare function removeMcpServer(name: string): boolean;
|
|
17
|
+
export declare function clearMcpServers(): void;
|
|
17
18
|
export declare function getMcpServer(name: string): McpServerConfig | undefined;
|
|
18
19
|
export declare function ensureDefaultServers(): void;
|
|
19
20
|
export declare function getConfigFilePath(): string;
|
package/dist/config/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a2_0x66425b=a2_0x4929;function a2_0x4929(_0x2b25e2,_0x291d99){_0x2b25e2=_0x2b25e2-0x13c;const _0x89add9=a2_0x89ad();let _0x492965=_0x89add9[_0x2b25e2];return _0x492965;}(function(_0x320c7e,_0xcae4c9){const _0x407767=a2_0x4929,_0x54b671=_0x320c7e();while(!![]){try{const _0x3e1e3f=-parseInt(_0x407767(0x164))/0x1*(-parseInt(_0x407767(0x14d))/0x2)+parseInt(_0x407767(0x147))/0x3+parseInt(_0x407767(0x14a))/0x4+parseInt(_0x407767(0x155))/0x5*(parseInt(_0x407767(0x15b))/0x6)+parseInt(_0x407767(0x15c))/0x7+parseInt(_0x407767(0x150))/0x8*(parseInt(_0x407767(0x154))/0x9)+-parseInt(_0x407767(0x140))/0xa*(parseInt(_0x407767(0x145))/0xb);if(_0x3e1e3f===_0xcae4c9)break;else _0x54b671['push'](_0x54b671['shift']());}catch(_0x178838){_0x54b671['push'](_0x54b671['shift']());}}}(a2_0x89ad,0x51a55));import a2_0x4ca05f from'conf';import a2_0x42ec1e from'path';import a2_0x2d7b5e from'fs';import{fileURLToPath}from'url';const config=new a2_0x4ca05f({'projectName':a2_0x66425b(0x14e),'defaults':{'mcpServers':{}}});export function getMcpServers(){const _0x5c8926=a2_0x66425b,_0x101290=config[_0x5c8926(0x162)](_0x5c8926(0x141)),_0x5632ff=loadMcpConfigFile();return{..._0x101290,..._0x5632ff};}export function addMcpServer(_0x363450,_0x1d9a2b,_0x4d1c79=[],_0x1aa378){const _0x134a06=a2_0x66425b,_0x6ae22a=config[_0x134a06(0x162)](_0x134a06(0x141));_0x6ae22a[_0x363450]={'type':_0x134a06(0x143),'command':_0x1d9a2b,'args':_0x4d1c79,'env':_0x1aa378},config[_0x134a06(0x146)](_0x134a06(0x141),_0x6ae22a);}export function addMcpHttpServer(_0x5663b6,_0x538a6f){const _0x4c215d=a2_0x66425b,_0x3dfd5c=config[_0x4c215d(0x162)](_0x4c215d(0x141));_0x3dfd5c[_0x5663b6]={'type':_0x4c215d(0x13c),'url':_0x538a6f},config[_0x4c215d(0x146)]('mcpServers',_0x3dfd5c);}export function removeMcpServer(_0x13170f){const _0x42c483=a2_0x66425b,_0x1e653a=config[_0x42c483(0x162)](_0x42c483(0x141));if(_0x1e653a[_0x13170f])return delete _0x1e653a[_0x13170f],config['set'](_0x42c483(0x141),_0x1e653a),!![];return![];}export function clearMcpServers(){const _0xc9f9c8=a2_0x66425b;config['set'](_0xc9f9c8(0x141),{});}export function getMcpServer(_0x47b95c){return getMcpServers()[_0x47b95c];}function loadMcpConfigFile(){const _0x27c287=a2_0x66425b,_0x3596cf=[a2_0x42ec1e[_0x27c287(0x13e)](process[_0x27c287(0x15d)](),_0x27c287(0x163)),a2_0x42ec1e[_0x27c287(0x13e)](process[_0x27c287(0x15d)](),'.woozlit','mcp.json'),a2_0x42ec1e[_0x27c287(0x13e)](process[_0x27c287(0x15f)][_0x27c287(0x13d)]||process[_0x27c287(0x15f)][_0x27c287(0x153)]||'',_0x27c287(0x144),_0x27c287(0x163))];for(const _0x54a8c4 of _0x3596cf){try{if(a2_0x2d7b5e[_0x27c287(0x160)](_0x54a8c4)){const _0x1b0f0b=a2_0x2d7b5e[_0x27c287(0x14f)](_0x54a8c4,_0x27c287(0x149)),_0x57a705=JSON['parse'](_0x1b0f0b);if(_0x57a705[_0x27c287(0x141)]&&typeof _0x57a705[_0x27c287(0x141)]===_0x27c287(0x156))return _0x57a705[_0x27c287(0x141)];}}catch{}}return{};}export function ensureDefaultServers(){const _0x4d4ef9=a2_0x66425b,_0x517f0d=config['get']('mcpServers'),_0x35b214=fileURLToPath(import.meta.url),_0x409da3=a2_0x42ec1e[_0x4d4ef9(0x161)](_0x35b214),_0x34fd4a=_0x409da3[_0x4d4ef9(0x165)]('dist')||_0x35b214[_0x4d4ef9(0x13f)]('.js'),_0x483477=_0x34fd4a?a2_0x42ec1e[_0x4d4ef9(0x13e)](_0x409da3,'..',_0x4d4ef9(0x157),_0x4d4ef9(0x14b)):a2_0x42ec1e[_0x4d4ef9(0x13e)](_0x409da3,'..','..',_0x4d4ef9(0x148),_0x4d4ef9(0x157),'computer-use.ts'),_0x2289f3=_0x34fd4a?_0x4d4ef9(0x142):_0x4d4ef9(0x14c);_0x517f0d[_0x4d4ef9(0x15a)]={'type':_0x4d4ef9(0x143),'command':_0x2289f3,'args':[_0x483477],'env':{}},(!_0x517f0d[_0x4d4ef9(0x15e)]||_0x517f0d[_0x4d4ef9(0x15e)][_0x4d4ef9(0x158)]===_0x4d4ef9(0x151))&&(_0x517f0d[_0x4d4ef9(0x15e)]={'type':'stdio','command':_0x4d4ef9(0x159),'args':['-y',_0x4d4ef9(0x152),_0x4d4ef9(0x166)],'env':{}}),config[_0x4d4ef9(0x146)]('mcpServers',_0x517f0d);}export function getConfigFilePath(){return config['path'];}function a2_0x89ad(){const _0x314d6f=['.woozlit','68618tNyazs','set','1692675yDfvWV','src','utf-8','473128dlxlKy','computer-use.js','tsx','12710rjUzli','woozlit-cli','readFileSync','128OKuIJQ','uvx','@modelcontextprotocol/server-filesystem','USERPROFILE','80604HYjUbT','84065UCNtrq','object','mcp-servers','command','npx','computer-use','192xFTbng','243082uPiBla','cwd','windows-mcp','env','existsSync','dirname','get','mcp.json','22FiWDaA','includes','C:\x5cUsers','streamable-http','HOME','join','endsWith','1930cmQMZx','mcpServers','node','stdio'];a2_0x89ad=function(){return _0x314d6f;};return a2_0x89ad();}
|
package/dist/config/settings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a3_0x1924(){const _0x183df0=['Latest\x20Mistral','3820932foutxW','MiMo\x20V2','Llama\x203.2\x2011B','mistralai/devstral-small','Kat\x20Coder\x20Pro','Kimi\x20K2','NVIDIA\x20vision','meta-llama/llama-3.2-11b-vision-instruct:free','deepseek/deepseek-r1','Efficient\x20vision\x20model','Nemotron\x20Nano\x2012B','Mistral\x20Small\x203.2','4lgpjiS','Advanced\x20reasoning\x20model','14lmfjXD','215742NBbOhT','GLM\x204.5\x20Air','Meta\x27s\x20vision\x20model','meta-llama/llama-4-maverick','989685ZscxeQ','Alibaba\x27s\x20largest','20377020ugFQTv','DeepSeek\x20R1T\x20Chimera','Reasoning\x20model','Meta\x27s\x20latest','WOOZLIT_API_URL','183618xxoMNw','10uUWXPT','Qwen3\x20Coder','Qwen3\x20235B','Llama\x203.3\x2070B','tngtech/deepseek-r1t-chimera:free','moonshotai/kimi-k2','xiaomi/mimo-v2-flash:free','meta-llama/llama-3.2-90b-vision-instruct:free','Advanced\x20coding','729387cVjnkf','Developer-focused','env','Llama\x204\x20Maverick','meta-llama/llama-3.3-70b-instruct:free','z-ai/glm-4.5-air:free','mistralai/mistral-small-3.2-24b-instruct','3012440IiFUgA','DeepSeek\x27s\x20latest\x20V3','https://woozlit.com','Llama\x203.2\x2090B','Xiaomi\x27s\x20fast\x20AI\x20model','qwen/qwen3-235b-a22b:free'];a3_0x1924=function(){return _0x183df0;};return a3_0x1924();}const a3_0x473cec=a3_0x49f6;(function(_0x3f4845,_0x3f2782){const _0x3ea1ae=a3_0x49f6,_0x3bd7ec=_0x3f4845();while(!![]){try{const _0x1c5e13=parseInt(_0x3ea1ae(0x1bb))/0x1*(parseInt(_0x3ea1ae(0x1af))/0x2)+-parseInt(_0x3ea1ae(0x1c4))/0x3*(-parseInt(_0x3ea1ae(0x1ac))/0x4)+parseInt(_0x3ea1ae(0x1b3))/0x5+-parseInt(_0x3ea1ae(0x1ba))/0x6+-parseInt(_0x3ea1ae(0x1ae))/0x7*(-parseInt(_0x3ea1ae(0x1cb))/0x8)+parseInt(_0x3ea1ae(0x1d2))/0x9+-parseInt(_0x3ea1ae(0x1b5))/0xa;if(_0x1c5e13===_0x3f2782)break;else _0x3bd7ec['push'](_0x3bd7ec['shift']());}catch(_0x3e15c3){_0x3bd7ec['push'](_0x3bd7ec['shift']());}}}(a3_0x1924,0x99989));function a3_0x49f6(_0x4d4ccd,_0x3c9e56){_0x4d4ccd=_0x4d4ccd-0x1a9;const _0x19248d=a3_0x1924();let _0x49f6c8=_0x19248d[_0x4d4ccd];return _0x49f6c8;}const API_URL=process[a3_0x473cec(0x1c6)][a3_0x473cec(0x1b9)]||a3_0x473cec(0x1cd),PROD_URL=a3_0x473cec(0x1cd);export function getApiUrl(){return API_URL;}export function getProdUrl(){return PROD_URL;}export function isProduction(){return API_URL===PROD_URL;}export const MODELS=[{'id':a3_0x473cec(0x1c1),'name':a3_0x473cec(0x1d3),'description':a3_0x473cec(0x1cf)},{'id':a3_0x473cec(0x1d0),'name':a3_0x473cec(0x1bd),'description':a3_0x473cec(0x1b4)},{'id':'qwen/qwen3-coder:free','name':a3_0x473cec(0x1bc),'description':'Coding\x20specialist'},{'id':a3_0x473cec(0x1c8),'name':a3_0x473cec(0x1be),'description':'Meta\x27s\x20powerful\x20model'},{'id':a3_0x473cec(0x1b2),'name':a3_0x473cec(0x1c7),'description':a3_0x473cec(0x1b8)},{'id':a3_0x473cec(0x1d5),'name':'Devstral\x20Small','description':a3_0x473cec(0x1c5)},{'id':a3_0x473cec(0x1ca),'name':a3_0x473cec(0x1ab),'description':a3_0x473cec(0x1d1)},{'id':'nvidia/nemotron-nano-12b-v2-vl:free','name':a3_0x473cec(0x1aa),'description':a3_0x473cec(0x1d8)},{'id':a3_0x473cec(0x1c0),'name':a3_0x473cec(0x1d7),'description':a3_0x473cec(0x1b7)},{'id':a3_0x473cec(0x1c9),'name':a3_0x473cec(0x1b0),'description':'Zhipu\x20AI\x20model'},{'id':'kwaipilot/kat-coder-pro:free','name':a3_0x473cec(0x1d6),'description':a3_0x473cec(0x1c3)},{'id':a3_0x473cec(0x1bf),'name':a3_0x473cec(0x1b6),'description':a3_0x473cec(0x1b7)},{'id':'deepseek/deepseek-chat','name':'DeepSeek\x20V3','description':a3_0x473cec(0x1cc)},{'id':a3_0x473cec(0x1da),'name':'DeepSeek\x20R1','description':a3_0x473cec(0x1ad)},{'id':a3_0x473cec(0x1c2),'name':a3_0x473cec(0x1ce),'description':a3_0x473cec(0x1b1)},{'id':a3_0x473cec(0x1d9),'name':a3_0x473cec(0x1d4),'description':a3_0x473cec(0x1a9)}];export const DEFAULT_MODEL=a3_0x473cec(0x1c1);
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a4_0x44d59b=a4_0x1b25;(function(_0x1a007b,_0x401bcd){const _0x2332f5=a4_0x1b25,_0x10293d=_0x1a007b();while(!![]){try{const _0x229f56=parseInt(_0x2332f5(0x24d))/0x1*(-parseInt(_0x2332f5(0x221))/0x2)+parseInt(_0x2332f5(0x208))/0x3+parseInt(_0x2332f5(0x219))/0x4*(parseInt(_0x2332f5(0x238))/0x5)+-parseInt(_0x2332f5(0x22d))/0x6*(parseInt(_0x2332f5(0x23f))/0x7)+parseInt(_0x2332f5(0x212))/0x8*(-parseInt(_0x2332f5(0x217))/0x9)+parseInt(_0x2332f5(0x24f))/0xa+parseInt(_0x2332f5(0x210))/0xb*(parseInt(_0x2332f5(0x226))/0xc);if(_0x229f56===_0x401bcd)break;else _0x10293d['push'](_0x10293d['shift']());}catch(_0x26453b){_0x10293d['push'](_0x10293d['shift']());}}}(a4_0x28e7,0xc94b1));import{Command}from'commander';import{login,logout,isLoggedIn}from'./auth/login.js';import{startChat}from'./chat/agent.js';import{selectModel,getSelectedModel}from'./ui/select.js';import{listRules,addRule,clearRules}from'./tools/rules.js';import{getUser}from'./utils/storage.js';import{addMcpServer,addMcpHttpServer,removeMcpServer,getMcpServers,ensureDefaultServers,getConfigFilePath}from'./config/mcp.js';function a4_0x28e7(){const _0x1e8aba=['ask\x20<message>','Logged\x20in\x20as\x20','11642517zlXOSR','Already\x20logged\x20in\x20as\x20','1573060lKzWzP','chat\x20[message]','list','some','List\x20all\x20MCP\x20servers','start','Configure\x20CLI\x20settings','Login\x20with\x20your\x20Woozlit\x20account','2TZEYUK','N/A','You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.','./utils/mcp-installer.js','add\x20<rule>','12zfkkSq','Show\x20current\x20user\x20info','Login\x20failed\x20or\x20timed\x20out','URL:\x20','version','keys','write','6564fqSUlN','success',':\x20[HTTP]\x20','Initialize\x20Woozlit\x20in\x20current\x20directory','All\x20rules\x20cleared','Initialized\x20Woozlit\x20in\x20current\x20directory','woozlit','length','entries','stop','logout','20wlKhMS','Logged\x20out\x20successfully','args','Start\x20an\x20AI\x20chat\x20session','info','Model\x20set\x20to:\x20','config','10101EUkDta','displayName','command',':\x20[stdio]\x20','Added\x20HTTP\x20MCP\x20server:\x20','.woozlit/context.md','Opening\x20browser\x20for\x20login...','\x0aConfig\x20file:\x20','model','remove\x20<name>','Created\x20.woozlit/rules.md\x20and\x20.woozlit/context.md','url','Add\x20an\x20HTTP\x20MCP\x20server\x20(streamable-http)','#\x20Project\x20Context\x0a\x0aDescribe\x20your\x20project\x20here.\x0a','1009504tBDUHz','name','13529390cZGHaj','Add\x20a\x20new\x20rule','header','Config\x20file:\x20','error','You\x20can\x20also\x20add\x20servers\x20via\x20mcp.json\x20in\x20your\x20project\x20directory','Waiting\x20for\x20authentication...','.woozlit','showLogo','action','./tools/file.js','mcp','Ask\x20a\x20single\x20question','dim','Removed\x20MCP\x20server:\x20','whoami','Added\x20stdio\x20MCP\x20server:\x20','forEach','warn','rules','Add\x20a\x20stdio\x20MCP\x20server','\x27\x20not\x20found','1.1.1','email','description','stdout','add-http\x20<name>\x20<url>','Select\x20AI\x20model','265200xPTsrE','Woozlit\x20already\x20initialized\x20in\x20this\x20directory','No\x20rules\x20defined','MCP\x20server\x20\x27','createSpinner','No\x20MCP\x20servers\x20configured','Remove\x20an\x20MCP\x20server','login','18610427WrYRPs','#\x20Project\x20Rules\x0a\x0aAdd\x20your\x20project-specific\x20rules\x20here.\x0a','8wcMCmD','Manage\x20MCP\x20servers','install\x20<source>\x20[name]'];a4_0x28e7=function(){return _0x1e8aba;};return a4_0x28e7();}import{checkForUpdate}from'./utils/update-check.js';function a4_0x1b25(_0x24db4a,_0x5aabac){_0x24db4a=_0x24db4a-0x1f0;const _0x28e77c=a4_0x28e7();let _0x1b2562=_0x28e77c[_0x24db4a];return _0x1b2562;}import*as a4_0x5e4935 from'./ui/output.js';const program=new Command();program[a4_0x44d59b(0x24e)](a4_0x44d59b(0x233))['description']('Woozlit\x20AI\x20-\x20Agentic\x20Coding\x20Assistant')[a4_0x44d59b(0x22a)](a4_0x44d59b(0x202))[a4_0x44d59b(0x1f5)](async()=>{const _0x303732=a4_0x44d59b;await checkForUpdate(),ensureDefaultServers(),a4_0x5e4935[_0x303732(0x1f4)]();if(!isLoggedIn()){a4_0x5e4935[_0x303732(0x1fe)]('You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.'),a4_0x5e4935['dim'](''),a4_0x5e4935[_0x303732(0x23c)](_0x303732(0x245));const _0x23cfe1=a4_0x5e4935['createSpinner'](_0x303732(0x1f2));_0x23cfe1['start']();const _0x4c3d5d=await login();_0x23cfe1[_0x303732(0x236)]();if(!_0x4c3d5d){a4_0x5e4935['error'](_0x303732(0x228));return;}const _0x186242=getUser();a4_0x5e4935['success']('Logged\x20in\x20as\x20'+(_0x186242[_0x303732(0x240)]||_0x186242['email']));}await startChat();}),program[a4_0x44d59b(0x241)](a4_0x44d59b(0x20f))[a4_0x44d59b(0x204)](a4_0x44d59b(0x220))[a4_0x44d59b(0x1f5)](async()=>{const _0x15dcf4=a4_0x44d59b;if(isLoggedIn()){const _0x4b05cd=getUser();a4_0x5e4935[_0x15dcf4(0x23c)](_0x15dcf4(0x218)+_0x4b05cd[_0x15dcf4(0x203)]);return;}a4_0x5e4935[_0x15dcf4(0x23c)](_0x15dcf4(0x245));const _0xf516c5=a4_0x5e4935[_0x15dcf4(0x20c)](_0x15dcf4(0x1f2));_0xf516c5[_0x15dcf4(0x21e)]();const _0x555c5d=await login();_0xf516c5[_0x15dcf4(0x236)]();if(_0x555c5d){const _0x47d2b5=getUser();a4_0x5e4935[_0x15dcf4(0x22e)](_0x15dcf4(0x216)+(_0x47d2b5[_0x15dcf4(0x240)]||_0x47d2b5[_0x15dcf4(0x203)]));}else a4_0x5e4935['error']('Login\x20failed\x20or\x20timed\x20out');}),program['command'](a4_0x44d59b(0x237))[a4_0x44d59b(0x204)]('Logout\x20from\x20your\x20Woozlit\x20account')[a4_0x44d59b(0x1f5)](()=>{const _0x235976=a4_0x44d59b;logout(),a4_0x5e4935[_0x235976(0x22e)](_0x235976(0x239));}),program[a4_0x44d59b(0x241)](a4_0x44d59b(0x1fb))[a4_0x44d59b(0x204)](a4_0x44d59b(0x227))[a4_0x44d59b(0x1f5)](()=>{const _0x443254=a4_0x44d59b;if(!isLoggedIn()){a4_0x5e4935[_0x443254(0x1fe)]('Not\x20logged\x20in.\x20Use\x20\x27woozlit\x20login\x27\x20to\x20authenticate.');return;}const _0x25faa0=getUser();a4_0x5e4935['header']('Current\x20User'),a4_0x5e4935['info']('Name:\x20'+(_0x25faa0[_0x443254(0x240)]||_0x443254(0x222))),a4_0x5e4935[_0x443254(0x23c)]('Email:\x20'+(_0x25faa0[_0x443254(0x203)]||_0x443254(0x222))),a4_0x5e4935[_0x443254(0x23c)]('Model:\x20'+getSelectedModel());}),program[a4_0x44d59b(0x241)](a4_0x44d59b(0x21a))[a4_0x44d59b(0x204)](a4_0x44d59b(0x23b))[a4_0x44d59b(0x1f5)](async _0xa9a1b3=>{const _0x47de03=a4_0x44d59b;a4_0x5e4935['showLogo']();if(!isLoggedIn()){a4_0x5e4935['warn'](_0x47de03(0x223)),a4_0x5e4935[_0x47de03(0x1f9)](''),a4_0x5e4935[_0x47de03(0x23c)]('Opening\x20browser\x20for\x20login...');const _0x437593=a4_0x5e4935[_0x47de03(0x20c)](_0x47de03(0x1f2));_0x437593[_0x47de03(0x21e)]();const _0x56bc90=await login();_0x437593[_0x47de03(0x236)]();if(!_0x56bc90){a4_0x5e4935['error'](_0x47de03(0x228));return;}const _0x2122db=getUser();a4_0x5e4935[_0x47de03(0x22e)](_0x47de03(0x216)+(_0x2122db[_0x47de03(0x240)]||_0x2122db['email']));}await startChat(_0xa9a1b3);}),program[a4_0x44d59b(0x241)](a4_0x44d59b(0x215))[a4_0x44d59b(0x204)](a4_0x44d59b(0x1f8))['action'](async _0x14bc4b=>{const _0x495e47=a4_0x44d59b;a4_0x5e4935[_0x495e47(0x1f4)]();if(!isLoggedIn()){a4_0x5e4935[_0x495e47(0x1fe)]('You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.'),a4_0x5e4935['dim'](''),a4_0x5e4935[_0x495e47(0x23c)](_0x495e47(0x245));const _0x3315f0=a4_0x5e4935[_0x495e47(0x20c)](_0x495e47(0x1f2));_0x3315f0['start']();const _0x24b03e=await login();_0x3315f0[_0x495e47(0x236)]();if(!_0x24b03e){a4_0x5e4935[_0x495e47(0x1f0)](_0x495e47(0x228));return;}const _0x3c6555=getUser();a4_0x5e4935[_0x495e47(0x22e)](_0x495e47(0x216)+(_0x3c6555['displayName']||_0x3c6555[_0x495e47(0x203)]));}await startChat(_0x14bc4b);});const configCmd=program[a4_0x44d59b(0x241)](a4_0x44d59b(0x23e))[a4_0x44d59b(0x204)](a4_0x44d59b(0x21f));configCmd['command'](a4_0x44d59b(0x247))[a4_0x44d59b(0x204)](a4_0x44d59b(0x207))[a4_0x44d59b(0x1f5)](async()=>{const _0xc4adcd=a4_0x44d59b,_0x54495d=await selectModel();a4_0x5e4935['success'](_0xc4adcd(0x23d)+_0x54495d);});const rulesCmd=program[a4_0x44d59b(0x241)](a4_0x44d59b(0x1ff))[a4_0x44d59b(0x204)]('Manage\x20AI\x20behavior\x20rules');rulesCmd[a4_0x44d59b(0x241)]('list')['description']('List\x20all\x20rules')[a4_0x44d59b(0x1f5)](()=>{const _0x1cc71c=a4_0x44d59b,_0x3fef73=listRules();if(_0x3fef73[_0x1cc71c(0x234)]===0x0){a4_0x5e4935['info'](_0x1cc71c(0x20a));return;}a4_0x5e4935[_0x1cc71c(0x251)]('Rules'),_0x3fef73[_0x1cc71c(0x1fd)]((_0x27bd39,_0x52a050)=>{const _0x1d941b=_0x1cc71c;process[_0x1d941b(0x205)][_0x1d941b(0x22c)](_0x52a050+0x1+'.\x20'+_0x27bd39+'\x0a');});}),rulesCmd[a4_0x44d59b(0x241)](a4_0x44d59b(0x225))[a4_0x44d59b(0x204)](a4_0x44d59b(0x250))['action'](_0x410116=>{const _0x13396b=a4_0x44d59b;addRule(_0x410116),a4_0x5e4935[_0x13396b(0x22e)]('Added\x20rule:\x20'+_0x410116);})[a4_0x44d59b(0x1f5)](()=>{const _0x1758c5=a4_0x44d59b;clearRules(),a4_0x5e4935[_0x1758c5(0x22e)](_0x1758c5(0x231));});const mcpCmd=program[a4_0x44d59b(0x241)](a4_0x44d59b(0x1f7))[a4_0x44d59b(0x204)](a4_0x44d59b(0x213));mcpCmd['command'](a4_0x44d59b(0x21b))['description'](a4_0x44d59b(0x21d))[a4_0x44d59b(0x1f5)](()=>{const _0x49ccb6=a4_0x44d59b,_0x4ed639=getMcpServers(),_0xd8791c=Object[_0x49ccb6(0x22b)](_0x4ed639);if(_0xd8791c[_0x49ccb6(0x234)]===0x0){a4_0x5e4935[_0x49ccb6(0x23c)](_0x49ccb6(0x20d)),a4_0x5e4935['dim'](_0x49ccb6(0x252)+getConfigFilePath());return;}a4_0x5e4935[_0x49ccb6(0x251)]('MCP\x20Servers'),_0xd8791c[_0x49ccb6(0x1fd)](_0x46ed82=>{const _0x2f9e21=_0x49ccb6,_0x52485a=_0x4ed639[_0x46ed82];_0x52485a['type']==='streamable-http'?a4_0x5e4935[_0x2f9e21(0x23c)]('-\x20'+_0x46ed82+_0x2f9e21(0x22f)+_0x52485a[_0x2f9e21(0x24a)]):a4_0x5e4935[_0x2f9e21(0x23c)]('-\x20'+_0x46ed82+_0x2f9e21(0x242)+_0x52485a[_0x2f9e21(0x241)]+'\x20'+(_0x52485a[_0x2f9e21(0x23a)]?.['join']('\x20')||''));}),a4_0x5e4935[_0x49ccb6(0x1f9)](_0x49ccb6(0x246)+getConfigFilePath()),a4_0x5e4935[_0x49ccb6(0x1f9)](_0x49ccb6(0x1f1));}),mcpCmd[a4_0x44d59b(0x241)]('add\x20<name>\x20<command>\x20[args...]')[a4_0x44d59b(0x204)](a4_0x44d59b(0x200))[a4_0x44d59b(0x1f5)]((_0x4449fd,_0x56cc7f,_0x5c501f)=>{const _0x37041a=a4_0x44d59b;addMcpServer(_0x4449fd,_0x56cc7f,_0x5c501f),a4_0x5e4935[_0x37041a(0x22e)](_0x37041a(0x1fc)+_0x4449fd);}),mcpCmd['command'](a4_0x44d59b(0x206))['description'](a4_0x44d59b(0x24b))['action']((_0x253669,_0x26eb7f)=>{const _0x5197aa=a4_0x44d59b;addMcpHttpServer(_0x253669,_0x26eb7f),a4_0x5e4935[_0x5197aa(0x22e)](_0x5197aa(0x243)+_0x253669),a4_0x5e4935[_0x5197aa(0x1f9)](_0x5197aa(0x229)+_0x26eb7f);}),mcpCmd[a4_0x44d59b(0x241)](a4_0x44d59b(0x214))['description']('Install\x20an\x20MCP\x20server\x20from\x20GitHub\x20or\x20registry\x20(e.g.\x20\x27mcp-chrome-bridge\x27,\x20\x27owner/repo\x27)')[a4_0x44d59b(0x1f5)](async(_0x57d361,_0x58c814)=>{const _0x6140ee=a4_0x44d59b,{installMcpServer:_0x4cb455}=await import(_0x6140ee(0x224));await _0x4cb455(_0x57d361,_0x58c814);}),mcpCmd[a4_0x44d59b(0x241)](a4_0x44d59b(0x248))[a4_0x44d59b(0x204)](a4_0x44d59b(0x20e))['action'](_0x25079c=>{const _0x279404=a4_0x44d59b;removeMcpServer(_0x25079c)?a4_0x5e4935[_0x279404(0x22e)](_0x279404(0x1fa)+_0x25079c):a4_0x5e4935['error'](_0x279404(0x20b)+_0x25079c+_0x279404(0x201));}),program[a4_0x44d59b(0x241)]('init')[a4_0x44d59b(0x204)](a4_0x44d59b(0x230))[a4_0x44d59b(0x1f5)](()=>{const _0x2ad2ae=a4_0x44d59b,{createFile:_0x265ad2,listDirectory:_0x3bfacd}=require(_0x2ad2ae(0x1f6)),_0x4b9b9a=_0x3bfacd('.'),_0x183a27=_0x4b9b9a[_0x2ad2ae(0x235)]?.[_0x2ad2ae(0x21c)](_0x23a17a=>_0x23a17a[_0x2ad2ae(0x24e)]===_0x2ad2ae(0x1f3));if(_0x183a27){a4_0x5e4935[_0x2ad2ae(0x1fe)](_0x2ad2ae(0x209));return;}_0x265ad2('.woozlit/rules.md',_0x2ad2ae(0x211)),_0x265ad2(_0x2ad2ae(0x244),_0x2ad2ae(0x24c)),a4_0x5e4935[_0x2ad2ae(0x22e)](_0x2ad2ae(0x232)),a4_0x5e4935['dim'](_0x2ad2ae(0x249));}),program['parse']();
|
|
2
|
+
const a4_0x59ea26=a4_0x3b68;(function(_0x4bf72f,_0x5623b9){const _0x4aa524=a4_0x3b68,_0x384688=_0x4bf72f();while(!![]){try{const _0x1df667=parseInt(_0x4aa524(0xa9))/0x1+-parseInt(_0x4aa524(0x89))/0x2*(-parseInt(_0x4aa524(0x9f))/0x3)+-parseInt(_0x4aa524(0xb4))/0x4+parseInt(_0x4aa524(0xa2))/0x5*(-parseInt(_0x4aa524(0x8b))/0x6)+-parseInt(_0x4aa524(0x9a))/0x7+-parseInt(_0x4aa524(0x78))/0x8*(-parseInt(_0x4aa524(0xb7))/0x9)+-parseInt(_0x4aa524(0x9c))/0xa;if(_0x1df667===_0x5623b9)break;else _0x384688['push'](_0x384688['shift']());}catch(_0x3ae7c1){_0x384688['push'](_0x384688['shift']());}}}(a4_0xde3d,0xb68c6));import{Command}from'commander';import{login,logout,isLoggedIn}from'./auth/login.js';import{startChat}from'./chat/agent.js';import{selectModel,getSelectedModel}from'./ui/select.js';import{listRules,addRule,clearRules}from'./tools/rules.js';function a4_0xde3d(){const _0x18e415=['parse','1556720nrumXu','header','Rules','27REDYLt','init',':\x20[HTTP]\x20','showLogo','stop','All\x20MCP\x20servers\x20removed','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20ALL\x20MCP\x20servers?','stdout','add\x20<name>\x20<command>\x20[args...]','email','Remove\x20an\x20MCP\x20server','description','Removed\x20MCP\x20server:\x20','No\x20rules\x20defined','keys','Add\x20an\x20HTTP\x20MCP\x20server\x20(streamable-http)','Initialize\x20Woozlit\x20in\x20current\x20directory','entries','URL:\x20','Opening\x20browser\x20for\x20login...','delete-all','createSpinner','Email:\x20','add\x20<rule>','Configure\x20CLI\x20settings','displayName','List\x20all\x20rules','You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.','Name:\x20','type','ask\x20<message>','start','config','\x27\x20not\x20found','warn','Logged\x20in\x20as\x20','whoami','Woozlit\x20AI\x20-\x20Agentic\x20Coding\x20Assistant','./tools/file.js','command','2621320XmHOrk','Model\x20set\x20to:\x20','url','Already\x20logged\x20in\x20as\x20','Manage\x20AI\x20behavior\x20rules','Show\x20current\x20user\x20info','MCP\x20Servers','length','success','All\x20rules\x20cleared','N/A','Woozlit\x20already\x20initialized\x20in\x20this\x20directory','remove-all','join','You\x20can\x20also\x20add\x20servers\x20via\x20mcp.json\x20in\x20your\x20project\x20directory','install\x20<source>\x20[name]','Initialized\x20Woozlit\x20in\x20current\x20directory','611062knwVEc','Model:\x20','23478fPxGTh','some','#\x20Project\x20Context\x0a\x0aDescribe\x20your\x20project\x20here.\x0a','Not\x20logged\x20in.\x20Use\x20\x27woozlit\x20login\x27\x20to\x20authenticate.','Default\x20servers\x20will\x20be\x20restored\x20on\x20next\x20restart\x20unless\x20you\x20remove\x20them\x20again.','write','dim','action','model','add-http\x20<name>\x20<url>','Config\x20file:\x20','Login\x20failed\x20or\x20timed\x20out','aliases','name','streamable-http','6092471oeyFvg','delete','4951430XJqhGM','Add\x20a\x20new\x20rule','Login\x20with\x20your\x20Woozlit\x20account','9UDBtOs','forEach','Start\x20an\x20AI\x20chat\x20session','1090SvevMI','Logged\x20out\x20successfully','info','remove\x20<name>','error','\x0aConfig\x20file:\x20','Current\x20User','1455840fTAClL','list','Waiting\x20for\x20authentication...','.woozlit/rules.md','Created\x20.woozlit/rules.md\x20and\x20.woozlit/context.md','1.1.3','login','Remove\x20all\x20MCP\x20servers','clear','Ask\x20a\x20single\x20question'];a4_0xde3d=function(){return _0x18e415;};return a4_0xde3d();}import{getUser}from'./utils/storage.js';import{addMcpServer,addMcpHttpServer,removeMcpServer,clearMcpServers,getMcpServers,ensureDefaultServers,getConfigFilePath}from'./config/mcp.js';import{checkForUpdate}from'./utils/update-check.js';import*as a4_0xd313b9 from'./ui/output.js';const program=new Command();program['name']('woozlit')[a4_0x59ea26(0xc2)](a4_0x59ea26(0x75))['version'](a4_0x59ea26(0xae))[a4_0x59ea26(0x92)](async()=>{const _0x3ac934=a4_0x59ea26;await checkForUpdate(),ensureDefaultServers(),a4_0xd313b9['showLogo']();if(!isLoggedIn()){a4_0xd313b9[_0x3ac934(0x72)]('You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.'),a4_0xd313b9[_0x3ac934(0x91)](''),a4_0xd313b9[_0x3ac934(0xa4)](_0x3ac934(0xca));const _0x154808=a4_0xd313b9[_0x3ac934(0x65)]('Waiting\x20for\x20authentication...');_0x154808['start']();const _0x40dd45=await login();_0x154808[_0x3ac934(0xbb)]();if(!_0x40dd45){a4_0xd313b9[_0x3ac934(0xa6)](_0x3ac934(0x96));return;}const _0x5dac9d=getUser();a4_0xd313b9[_0x3ac934(0x80)]('Logged\x20in\x20as\x20'+(_0x5dac9d[_0x3ac934(0x69)]||_0x5dac9d['email']));}await startChat();}),program[a4_0x59ea26(0x77)](a4_0x59ea26(0xaf))[a4_0x59ea26(0xc2)](a4_0x59ea26(0x9e))['action'](async()=>{const _0x5ccec4=a4_0x59ea26;if(isLoggedIn()){const _0x3f75de=getUser();a4_0xd313b9[_0x5ccec4(0xa4)](_0x5ccec4(0x7b)+_0x3f75de[_0x5ccec4(0xc0)]);return;}a4_0xd313b9[_0x5ccec4(0xa4)]('Opening\x20browser\x20for\x20login...');const _0xa9036c=a4_0xd313b9['createSpinner'](_0x5ccec4(0xab));_0xa9036c['start']();const _0x3b2afc=await login();_0xa9036c['stop']();if(_0x3b2afc){const _0x192ded=getUser();a4_0xd313b9['success'](_0x5ccec4(0x73)+(_0x192ded[_0x5ccec4(0x69)]||_0x192ded[_0x5ccec4(0xc0)]));}else a4_0xd313b9[_0x5ccec4(0xa6)]('Login\x20failed\x20or\x20timed\x20out');}),program[a4_0x59ea26(0x77)]('logout')[a4_0x59ea26(0xc2)]('Logout\x20from\x20your\x20Woozlit\x20account')[a4_0x59ea26(0x92)](()=>{const _0x1cc2b5=a4_0x59ea26;logout(),a4_0xd313b9[_0x1cc2b5(0x80)](_0x1cc2b5(0xa3));}),program[a4_0x59ea26(0x77)](a4_0x59ea26(0x74))[a4_0x59ea26(0xc2)](a4_0x59ea26(0x7d))[a4_0x59ea26(0x92)](()=>{const _0x5bab75=a4_0x59ea26;if(!isLoggedIn()){a4_0xd313b9[_0x5bab75(0x72)](_0x5bab75(0x8e));return;}const _0x19a1b3=getUser();a4_0xd313b9[_0x5bab75(0xb5)](_0x5bab75(0xa8)),a4_0xd313b9[_0x5bab75(0xa4)](_0x5bab75(0x6c)+(_0x19a1b3[_0x5bab75(0x69)]||_0x5bab75(0x82))),a4_0xd313b9[_0x5bab75(0xa4)](_0x5bab75(0x66)+(_0x19a1b3[_0x5bab75(0xc0)]||'N/A')),a4_0xd313b9['info'](_0x5bab75(0x8a)+getSelectedModel());}),program[a4_0x59ea26(0x77)]('chat\x20[message]')[a4_0x59ea26(0xc2)](a4_0x59ea26(0xa1))['action'](async _0x194bbf=>{const _0x17f50c=a4_0x59ea26;a4_0xd313b9['showLogo']();if(!isLoggedIn()){a4_0xd313b9['warn']('You\x20must\x20be\x20logged\x20in\x20to\x20use\x20chat.'),a4_0xd313b9[_0x17f50c(0x91)](''),a4_0xd313b9[_0x17f50c(0xa4)](_0x17f50c(0xca));const _0x1f29e2=a4_0xd313b9[_0x17f50c(0x65)](_0x17f50c(0xab));_0x1f29e2[_0x17f50c(0x6f)]();const _0x15c927=await login();_0x1f29e2[_0x17f50c(0xbb)]();if(!_0x15c927){a4_0xd313b9[_0x17f50c(0xa6)]('Login\x20failed\x20or\x20timed\x20out');return;}const _0x348a3f=getUser();a4_0xd313b9[_0x17f50c(0x80)]('Logged\x20in\x20as\x20'+(_0x348a3f[_0x17f50c(0x69)]||_0x348a3f['email']));}await startChat(_0x194bbf);}),program[a4_0x59ea26(0x77)](a4_0x59ea26(0x6e))[a4_0x59ea26(0xc2)](a4_0x59ea26(0xb2))['action'](async _0x427167=>{const _0x2432f1=a4_0x59ea26;a4_0xd313b9[_0x2432f1(0xba)]();if(!isLoggedIn()){a4_0xd313b9['warn'](_0x2432f1(0x6b)),a4_0xd313b9['dim'](''),a4_0xd313b9['info']('Opening\x20browser\x20for\x20login...');const _0x56d03a=a4_0xd313b9[_0x2432f1(0x65)](_0x2432f1(0xab));_0x56d03a[_0x2432f1(0x6f)]();const _0x1e77cd=await login();_0x56d03a[_0x2432f1(0xbb)]();if(!_0x1e77cd){a4_0xd313b9[_0x2432f1(0xa6)]('Login\x20failed\x20or\x20timed\x20out');return;}const _0x14e342=getUser();a4_0xd313b9[_0x2432f1(0x80)](_0x2432f1(0x73)+(_0x14e342[_0x2432f1(0x69)]||_0x14e342[_0x2432f1(0xc0)]));}await startChat(_0x427167);});const configCmd=program['command'](a4_0x59ea26(0x70))[a4_0x59ea26(0xc2)](a4_0x59ea26(0x68));configCmd[a4_0x59ea26(0x77)](a4_0x59ea26(0x93))[a4_0x59ea26(0xc2)]('Select\x20AI\x20model')['action'](async()=>{const _0x400f96=a4_0x59ea26,_0x2ce918=await selectModel();a4_0xd313b9[_0x400f96(0x80)](_0x400f96(0x79)+_0x2ce918);});const rulesCmd=program[a4_0x59ea26(0x77)]('rules')[a4_0x59ea26(0xc2)](a4_0x59ea26(0x7c));rulesCmd[a4_0x59ea26(0x77)](a4_0x59ea26(0xaa))[a4_0x59ea26(0xc2)](a4_0x59ea26(0x6a))[a4_0x59ea26(0x92)](()=>{const _0x249f7a=a4_0x59ea26,_0x5a2943=listRules();if(_0x5a2943[_0x249f7a(0x7f)]===0x0){a4_0xd313b9[_0x249f7a(0xa4)](_0x249f7a(0xc4));return;}a4_0xd313b9['header'](_0x249f7a(0xb6)),_0x5a2943[_0x249f7a(0xa0)]((_0x5a7233,_0x2adc8a)=>{const _0x1c67d4=_0x249f7a;process[_0x1c67d4(0xbe)][_0x1c67d4(0x90)](_0x2adc8a+0x1+'.\x20'+_0x5a7233+'\x0a');});}),rulesCmd['command'](a4_0x59ea26(0x67))[a4_0x59ea26(0xc2)](a4_0x59ea26(0x9d))[a4_0x59ea26(0x92)](_0x49ecaa=>{const _0x10d2f3=a4_0x59ea26;addRule(_0x49ecaa),a4_0xd313b9[_0x10d2f3(0x80)]('Added\x20rule:\x20'+_0x49ecaa);})[a4_0x59ea26(0x92)](()=>{const _0x2d012a=a4_0x59ea26;clearRules(),a4_0xd313b9[_0x2d012a(0x80)](_0x2d012a(0x81));});const mcpCmd=program[a4_0x59ea26(0x77)]('mcp')['description']('Manage\x20MCP\x20servers');function a4_0x3b68(_0xb2c16e,_0x598cdf){_0xb2c16e=_0xb2c16e-0x65;const _0xde3dc8=a4_0xde3d();let _0x3b68c3=_0xde3dc8[_0xb2c16e];return _0x3b68c3;}mcpCmd[a4_0x59ea26(0x77)](a4_0x59ea26(0xaa))[a4_0x59ea26(0xc2)]('List\x20all\x20MCP\x20servers')[a4_0x59ea26(0x92)](()=>{const _0x117b72=a4_0x59ea26,_0x285678=getMcpServers(),_0x55e944=Object[_0x117b72(0xc5)](_0x285678);if(_0x55e944['length']===0x0){a4_0xd313b9[_0x117b72(0xa4)]('No\x20MCP\x20servers\x20configured'),a4_0xd313b9[_0x117b72(0x91)](_0x117b72(0x95)+getConfigFilePath());return;}a4_0xd313b9[_0x117b72(0xb5)](_0x117b72(0x7e)),_0x55e944[_0x117b72(0xa0)](_0x59e6ed=>{const _0x1c9147=_0x117b72,_0x94aebe=_0x285678[_0x59e6ed];_0x94aebe[_0x1c9147(0x6d)]===_0x1c9147(0x99)?a4_0xd313b9[_0x1c9147(0xa4)]('-\x20'+_0x59e6ed+_0x1c9147(0xb9)+_0x94aebe[_0x1c9147(0x7a)]):a4_0xd313b9[_0x1c9147(0xa4)]('-\x20'+_0x59e6ed+':\x20[stdio]\x20'+_0x94aebe['command']+'\x20'+(_0x94aebe['args']?.[_0x1c9147(0x85)]('\x20')||''));}),a4_0xd313b9[_0x117b72(0x91)](_0x117b72(0xa7)+getConfigFilePath()),a4_0xd313b9[_0x117b72(0x91)](_0x117b72(0x86));}),mcpCmd['command'](a4_0x59ea26(0xbf))[a4_0x59ea26(0xc2)]('Add\x20a\x20stdio\x20MCP\x20server')['action']((_0x160cb9,_0x39148a,_0x3e86d7)=>{addMcpServer(_0x160cb9,_0x39148a,_0x3e86d7),a4_0xd313b9['success']('Added\x20stdio\x20MCP\x20server:\x20'+_0x160cb9);}),mcpCmd[a4_0x59ea26(0x77)](a4_0x59ea26(0x94))['description'](a4_0x59ea26(0xc6))[a4_0x59ea26(0x92)]((_0x2fc0d8,_0x5a36df)=>{const _0xaf91d2=a4_0x59ea26;addMcpHttpServer(_0x2fc0d8,_0x5a36df),a4_0xd313b9[_0xaf91d2(0x80)]('Added\x20HTTP\x20MCP\x20server:\x20'+_0x2fc0d8),a4_0xd313b9[_0xaf91d2(0x91)](_0xaf91d2(0xc9)+_0x5a36df);}),mcpCmd[a4_0x59ea26(0x77)](a4_0x59ea26(0x87))['description']('Install\x20an\x20MCP\x20server\x20from\x20GitHub\x20or\x20registry\x20(e.g.\x20\x27mcp-chrome-bridge\x27,\x20\x27owner/repo\x27)')[a4_0x59ea26(0x92)](async(_0x1897a4,_0x4e5f55)=>{const {installMcpServer:_0x5b81d4}=await import('./utils/mcp-installer.js');await _0x5b81d4(_0x1897a4,_0x4e5f55);}),mcpCmd[a4_0x59ea26(0x77)](a4_0x59ea26(0xa5))['aliases']([a4_0x59ea26(0x9b),'rm'])[a4_0x59ea26(0xc2)](a4_0x59ea26(0xc1))[a4_0x59ea26(0x92)](_0x3bbd35=>{const _0x3379f5=a4_0x59ea26;removeMcpServer(_0x3bbd35)?a4_0xd313b9[_0x3379f5(0x80)](_0x3379f5(0xc3)+_0x3bbd35):a4_0xd313b9[_0x3379f5(0xa6)]('MCP\x20server\x20\x27'+_0x3bbd35+_0x3379f5(0x71));}),mcpCmd[a4_0x59ea26(0x77)](a4_0x59ea26(0x84))[a4_0x59ea26(0x97)]([a4_0x59ea26(0xcb),a4_0x59ea26(0xb1)])[a4_0x59ea26(0xc2)](a4_0x59ea26(0xb0))[a4_0x59ea26(0x92)](async()=>{const _0x19ec5c=a4_0x59ea26,{confirm:_0x4e3a83}=await import('@inquirer/prompts'),_0x46cf8e=await _0x4e3a83({'message':_0x19ec5c(0xbd),'default':![]});_0x46cf8e?(clearMcpServers(),a4_0xd313b9['success'](_0x19ec5c(0xbc)),a4_0xd313b9[_0x19ec5c(0x91)](_0x19ec5c(0x8f))):a4_0xd313b9['info']('Operation\x20cancelled');}),program[a4_0x59ea26(0x77)](a4_0x59ea26(0xb8))[a4_0x59ea26(0xc2)](a4_0x59ea26(0xc7))['action'](()=>{const _0x348f45=a4_0x59ea26,{createFile:_0x336997,listDirectory:_0x54ecca}=require(_0x348f45(0x76)),_0x4d702b=_0x54ecca('.'),_0x49bf27=_0x4d702b[_0x348f45(0xc8)]?.[_0x348f45(0x8c)](_0x3d3741=>_0x3d3741[_0x348f45(0x98)]==='.woozlit');if(_0x49bf27){a4_0xd313b9[_0x348f45(0x72)](_0x348f45(0x83));return;}_0x336997(_0x348f45(0xac),'#\x20Project\x20Rules\x0a\x0aAdd\x20your\x20project-specific\x20rules\x20here.\x0a'),_0x336997('.woozlit/context.md',_0x348f45(0x8d)),a4_0xd313b9[_0x348f45(0x80)](_0x348f45(0x88)),a4_0xd313b9['dim'](_0x348f45(0xad));}),program[a4_0x59ea26(0xb3)]();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a5_0x8b8edb=a5_0x5a24;(function(_0x169b4e,_0x5808e8){const _0x54534e=a5_0x5a24,_0x3cf467=_0x169b4e();while(!![]){try{const _0x1b52dd=parseInt(_0x54534e(0x1ae))/0x1+-parseInt(_0x54534e(0x1a6))/0x2*(-parseInt(_0x54534e(0x1b3))/0x3)+-parseInt(_0x54534e(0x1bb))/0x4+parseInt(_0x54534e(0x1c4))/0x5*(parseInt(_0x54534e(0x1c5))/0x6)+parseInt(_0x54534e(0x1d0))/0x7+-parseInt(_0x54534e(0x1c8))/0x8+-parseInt(_0x54534e(0x1d7))/0x9;if(_0x1b52dd===_0x5808e8)break;else _0x3cf467['push'](_0x3cf467['shift']());}catch(_0x2a8bb5){_0x3cf467['push'](_0x3cf467['shift']());}}}(a5_0x1b21,0x58ab3));import{Server}from'@modelcontextprotocol/sdk/server/index.js';function a5_0x1b21(){const _0x39b35d=['key','robotjs','1235sASXhM','7530pjFTYR','computer_key_tap','number','3058608KzlMoi','Move\x20the\x20mouse\x20cursor\x20to\x20specific\x20coordinates.','shift','Type\x20a\x20string\x20of\x20text.','computer_screenshot','Click\x20the\x20mouse\x20button.','computer_mouse_move','Error:\x20','2567222poypaz','join','string','left','Key\x20to\x20tap\x20(e.g.\x20\x27enter\x27,\x20\x27a\x27,\x20\x27backspace\x27)','height','text','949194AZlkrL','Clicked\x20','command','\x20button','resize','image','Typed:\x20\x22','boolean','Tap\x20a\x20single\x20key\x20with\x20optional\x20modifiers.','connect','34qbDOBA','\x20(double)','alt','X\x20coordinate','setRequestHandler','typeString','Text\x20to\x20type','Moved\x20mouse\x20to\x20','285908NhULWN','image/jpeg','mouseClick','control','params','66765fdJtgG','computer_type','object','read','width','toString','keyTap','computer_screen_size','1959980gDEmqC','Get\x20the\x20screen\x20resolution.','bitmap','with\x20','computer_mouse_click','Unknown\x20tool:\x20','Screenshot\x20taken.'];a5_0x1b21=function(){return _0x39b35d;};return a5_0x1b21();}import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema}from'@modelcontextprotocol/sdk/types.js';import{Jimp}from'jimp';function a5_0x5a24(_0x570eca,_0x4b2a65){_0x570eca=_0x570eca-0x19f;const _0x1b2143=a5_0x1b21();let _0x5a24ff=_0x1b2143[_0x570eca];return _0x5a24ff;}import{createRequire}from'module';const require=createRequire(import.meta.url);let robot,screenshot;try{robot=require(a5_0x8b8edb(0x1c3));}catch(a5_0x4c0805){}try{screenshot=require('screenshot-desktop');}catch(a5_0x1ee8b1){}const AUTO=-0x1,MIME_JPEG=a5_0x8b8edb(0x1af),server=new Server({'name':'computer-use','version':'1.0.0'},{'capabilities':{'tools':{}}});server[a5_0x8b8edb(0x1aa)](ListToolsRequestSchema,async()=>{const _0x4fab1b=a5_0x8b8edb;return{'tools':[{'name':_0x4fab1b(0x1cc),'description':'Take\x20a\x20screenshot\x20of\x20the\x20primary\x20display.\x20Returns\x20base64\x20encoded\x20image.','inputSchema':{'type':_0x4fab1b(0x1b5),'properties':{}}},{'name':'computer_mouse_move','description':_0x4fab1b(0x1c9),'inputSchema':{'type':_0x4fab1b(0x1b5),'properties':{'x':{'type':_0x4fab1b(0x1c7),'description':_0x4fab1b(0x1a9)},'y':{'type':'number','description':'Y\x20coordinate'}},'required':['x','y']}},{'name':_0x4fab1b(0x1bf),'description':_0x4fab1b(0x1cd),'inputSchema':{'type':_0x4fab1b(0x1b5),'properties':{'button':{'type':_0x4fab1b(0x1d2),'enum':[_0x4fab1b(0x1d3),'right','middle'],'default':_0x4fab1b(0x1d3)},'double':{'type':_0x4fab1b(0x1a3),'default':![]}}}},{'name':_0x4fab1b(0x1b4),'description':_0x4fab1b(0x1cb),'inputSchema':{'type':_0x4fab1b(0x1b5),'properties':{'text':{'type':_0x4fab1b(0x1d2),'description':_0x4fab1b(0x1ac)}},'required':[_0x4fab1b(0x1d6)]}},{'name':_0x4fab1b(0x1c6),'description':_0x4fab1b(0x1a4),'inputSchema':{'type':_0x4fab1b(0x1b5),'properties':{'key':{'type':_0x4fab1b(0x1d2),'description':_0x4fab1b(0x1d4)},'modifiers':{'type':'array','items':{'type':'string','enum':[_0x4fab1b(0x1a8),_0x4fab1b(0x1d9),_0x4fab1b(0x1b1),_0x4fab1b(0x1ca)]},'description':'Modifier\x20keys'}},'required':[_0x4fab1b(0x1c2)]}},{'name':'computer_screen_size','description':_0x4fab1b(0x1bc),'inputSchema':{'type':_0x4fab1b(0x1b5),'properties':{}}}]};}),server[a5_0x8b8edb(0x1aa)](CallToolRequestSchema,async _0x23e285=>{const _0x583b2f=a5_0x8b8edb,{name:_0x2938fe,arguments:_0x3d2c4c}=_0x23e285[_0x583b2f(0x1b2)];try{if(_0x2938fe==='computer_screenshot'){const _0x144fa5=await screenshot(),_0x16eb71=await Jimp[_0x583b2f(0x1b6)](_0x144fa5);_0x16eb71[_0x583b2f(0x1bd)][_0x583b2f(0x1b7)]>0x400&&_0x16eb71[_0x583b2f(0x1a0)]({'w':0x400});const _0x2d47d5=await _0x16eb71['getBuffer'](MIME_JPEG),_0x40c351=_0x2d47d5[_0x583b2f(0x1b8)]('base64');return{'content':[{'type':_0x583b2f(0x1d6),'text':_0x583b2f(0x1c1)},{'type':_0x583b2f(0x1a1),'data':_0x40c351,'mimeType':_0x583b2f(0x1af)}]};}if(_0x2938fe===_0x583b2f(0x1ce)){const {x:_0x339e1c,y:_0x2b4b17}=_0x3d2c4c;return robot['moveMouse'](_0x339e1c,_0x2b4b17),{'content':[{'type':'text','text':_0x583b2f(0x1ad)+_0x339e1c+',\x20'+_0x2b4b17}]};}if(_0x2938fe==='computer_mouse_click'){const {button:button=_0x583b2f(0x1d3),double:double=![]}=_0x3d2c4c;return robot[_0x583b2f(0x1b0)](button,double),{'content':[{'type':_0x583b2f(0x1d6),'text':_0x583b2f(0x1d8)+button+_0x583b2f(0x19f)+(double?_0x583b2f(0x1a7):'')}]};}if(_0x2938fe==='computer_type'){const {text:_0x35559a}=_0x3d2c4c;return robot[_0x583b2f(0x1ab)](_0x35559a),{'content':[{'type':_0x583b2f(0x1d6),'text':_0x583b2f(0x1a2)+_0x35559a+'\x22'}]};}if(_0x2938fe===_0x583b2f(0x1c6)){const {key:_0xc04ab2,modifiers:_0x285bb6}=_0x3d2c4c;return robot[_0x583b2f(0x1b9)](_0xc04ab2,_0x285bb6),{'content':[{'type':_0x583b2f(0x1d6),'text':'Tapped\x20key:\x20'+_0xc04ab2+'\x20'+(_0x285bb6?_0x583b2f(0x1be)+_0x285bb6[_0x583b2f(0x1d1)]('+'):'')}]};}if(_0x2938fe===_0x583b2f(0x1ba)){const _0x31a434=robot['getScreenSize']();return{'content':[{'type':_0x583b2f(0x1d6),'text':'Screen\x20size:\x20'+_0x31a434[_0x583b2f(0x1b7)]+'x'+_0x31a434[_0x583b2f(0x1d5)]}]};}throw new Error(_0x583b2f(0x1c0)+_0x2938fe);}catch(_0x1927fe){return{'content':[{'type':_0x583b2f(0x1d6),'text':_0x583b2f(0x1cf)+_0x1927fe}],'isError':!![]};}});const transport=new StdioServerTransport();await server[a5_0x8b8edb(0x1a5)](transport);
|
package/dist/tools/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a6_0x1f83(_0x34fba2,_0x5466e5){_0x34fba2=_0x34fba2-0x17c;const _0x48425b=a6_0x4842();let _0x1f83e0=_0x48425b[_0x34fba2];return _0x1f83e0;}(function(_0x22f174,_0x52d9df){const _0x57bf65=a6_0x1f83,_0x21f69c=_0x22f174();while(!![]){try{const _0x41e812=-parseInt(_0x57bf65(0x185))/0x1+parseInt(_0x57bf65(0x18a))/0x2*(-parseInt(_0x57bf65(0x192))/0x3)+-parseInt(_0x57bf65(0x17e))/0x4+-parseInt(_0x57bf65(0x17f))/0x5*(parseInt(_0x57bf65(0x191))/0x6)+parseInt(_0x57bf65(0x17d))/0x7+parseInt(_0x57bf65(0x180))/0x8*(-parseInt(_0x57bf65(0x184))/0x9)+parseInt(_0x57bf65(0x18b))/0xa;if(_0x41e812===_0x52d9df)break;else _0x21f69c['push'](_0x21f69c['shift']());}catch(_0x3f5d7d){_0x21f69c['push'](_0x21f69c['shift']());}}}(a6_0x4842,0xa4038));import{spawn}from'child_process';function a6_0x4842(){const _0x365ef5=['43122yDOhvG','9cTzoia','env','5816195MYRtWC','730600qwHlSk','5ZjOUkC','8IQEtQi','cmd.exe','ms...]','cwd','3096594zezqpz','103144ydpDPv','stderr','win32','data','toString','828376GRcMeK','17205260mqFYGx','message','close','platform','stdout','removeAllListeners'];a6_0x4842=function(){return _0x365ef5;};return a6_0x4842();}export async function runCommand(_0x5e1ab6,_0x95f5af,_0x321d3a=![],_0x531af6=0xbb8){return new Promise(_0x10e189=>{const _0x53edcc=a6_0x1f83,_0x3c78d9=process[_0x53edcc(0x18e)]===_0x53edcc(0x187),_0x176301=_0x3c78d9?_0x53edcc(0x181):'/bin/sh',_0x3d16bc=_0x3c78d9?'/c':'-c',_0x3e4738=spawn(_0x176301,[_0x3d16bc,_0x5e1ab6],{'cwd':process[_0x53edcc(0x183)](),'env':process[_0x53edcc(0x17c)],'detached':_0x321d3a,'stdio':'pipe'});let _0x1b89fd='',_0x5d821f='',_0x3c0b6c=![];_0x321d3a&&setTimeout(()=>{const _0x2d5dca=_0x53edcc;if(!_0x3c0b6c){_0x3c0b6c=!![];if(_0x3e4738['unref'])_0x3e4738['unref']();_0x3e4738['stdout']?.['removeAllListeners'](_0x2d5dca(0x188)),_0x3e4738[_0x2d5dca(0x186)]?.[_0x2d5dca(0x190)](_0x2d5dca(0x188)),_0x10e189({'success':!![],'stdout':_0x1b89fd+('\x0a[Woozlit:\x20Command\x20continuing\x20in\x20background\x20after\x20'+_0x531af6+_0x2d5dca(0x182)),'stderr':_0x5d821f,'exitCode':0x0});}},_0x531af6),_0x3e4738[_0x53edcc(0x18f)]?.['on']('data',_0x532829=>{const _0x25832d=_0x53edcc;if(_0x3c0b6c)return;const _0x29b9e3=_0x532829[_0x25832d(0x189)]();_0x1b89fd+=_0x29b9e3;if(_0x95f5af)_0x95f5af(_0x29b9e3);}),_0x3e4738[_0x53edcc(0x186)]?.['on'](_0x53edcc(0x188),_0x4411cb=>{const _0x1e9808=_0x53edcc;if(_0x3c0b6c)return;const _0x12cf14=_0x4411cb[_0x1e9808(0x189)]();_0x5d821f+=_0x12cf14;if(_0x95f5af)_0x95f5af(_0x12cf14);}),_0x3e4738['on'](_0x53edcc(0x18d),_0x549624=>{!_0x3c0b6c&&(_0x3c0b6c=!![],_0x10e189({'success':_0x549624===0x0,'stdout':_0x1b89fd,'stderr':_0x5d821f,'exitCode':_0x549624||0x0}));}),_0x3e4738['on']('error',_0x3e8a98=>{const _0x441515=_0x53edcc;!_0x3c0b6c&&(_0x3c0b6c=!![],_0x10e189({'success':![],'stdout':_0x1b89fd,'stderr':_0x3e8a98[_0x441515(0x18c)],'exitCode':0x1}));});});}
|
package/dist/tools/file.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3fd4b6,_0x3d34ae){const _0x425151=a7_0x2de2,_0x508794=_0x3fd4b6();while(!![]){try{const _0x2d26b2=parseInt(_0x425151(0x1c2))/0x1+parseInt(_0x425151(0x1c3))/0x2*(parseInt(_0x425151(0x1be))/0x3)+parseInt(_0x425151(0x1bc))/0x4*(-parseInt(_0x425151(0x1c4))/0x5)+parseInt(_0x425151(0x1dc))/0x6*(parseInt(_0x425151(0x1ea))/0x7)+parseInt(_0x425151(0x1e2))/0x8*(parseInt(_0x425151(0x1bf))/0x9)+-parseInt(_0x425151(0x1ee))/0xa*(-parseInt(_0x425151(0x1e4))/0xb)+-parseInt(_0x425151(0x1d1))/0xc*(parseInt(_0x425151(0x1ba))/0xd);if(_0x2d26b2===_0x3d34ae)break;else _0x508794['push'](_0x508794['shift']());}catch(_0x2ed184){_0x508794['push'](_0x508794['shift']());}}}(a7_0x5d08,0xc3358));import{readFileSync,writeFileSync,existsSync,readdirSync,statSync,mkdirSync}from'fs';import{dirname,resolve,relative}from'path';import{trackFileCreate,trackFileModify}from'./rollback.js';export function createFile(_0x28c868,_0x2bb308){const _0x23a3b1=a7_0x2de2;try{const _0x409fcd=resolve(process[_0x23a3b1(0x1cf)](),_0x28c868),_0xd69064=dirname(_0x409fcd);return!existsSync(_0xd69064)&&mkdirSync(_0xd69064,{'recursive':!![]}),writeFileSync(_0x409fcd,_0x2bb308,_0x23a3b1(0x1ce)),trackFileCreate(_0x409fcd),{'success':!![],'message':_0x23a3b1(0x1c5)+_0x28c868};}catch(_0x450fb8){return{'success':![],'message':_0x23a3b1(0x1d5)+_0x28c868+':\x20'+_0x450fb8};}}function a7_0x2de2(_0x2c5973,_0x16c5ab){_0x2c5973=_0x2c5973-0x1b3;const _0x5d087d=a7_0x5d08();let _0x2de243=_0x5d087d[_0x2c5973];return _0x2de243;}export function readFile(_0x4c5cfe){const _0x3e36c0=a7_0x2de2;try{const _0x1bb707=resolve(process[_0x3e36c0(0x1cf)](),_0x4c5cfe);if(!existsSync(_0x1bb707))return{'success':![],'message':'File\x20not\x20found:\x20'+_0x4c5cfe};const _0x22fee7=['.png','.jpg',_0x3e36c0(0x1d9),_0x3e36c0(0x1d3),_0x3e36c0(0x1e0),_0x3e36c0(0x1e3),'.bin'],_0x5008be=_0x1bb707[_0x3e36c0(0x1bb)]('.')[_0x3e36c0(0x1de)]()?.['toLowerCase']();if(_0x5008be&&_0x22fee7[_0x3e36c0(0x1ed)]('.'+_0x5008be))return{'success':![],'message':_0x3e36c0(0x1ca)+_0x5008be+_0x3e36c0(0x1d4)};const _0x21bc99=readFileSync(_0x1bb707,_0x3e36c0(0x1ce));return{'success':!![],'content':_0x21bc99,'message':_0x3e36c0(0x1b4)+_0x4c5cfe};}catch(_0x593557){return{'success':![],'message':_0x3e36c0(0x1b8)+_0x4c5cfe+':\x20'+_0x593557};}}export function listDirectory(_0x61e08f='.'){const _0x524266=a7_0x2de2;try{const _0x3e03e3=resolve(process['cwd'](),_0x61e08f);if(!existsSync(_0x3e03e3))return{'success':![],'message':_0x524266(0x1c7)+_0x61e08f};const _0x11f719=readdirSync(_0x3e03e3),_0x4c9a43=_0x11f719['map'](_0x4379f6=>{const _0xd6530d=_0x524266,_0x5d14f1=resolve(_0x3e03e3,_0x4379f6),_0x2f2446=statSync(_0x5d14f1);return{'name':_0x4379f6,'type':_0x2f2446['isDirectory']()?_0xd6530d(0x1eb):_0xd6530d(0x1e7),'size':_0x2f2446['isFile']()?_0x2f2446['size']:undefined};});return{'success':!![],'entries':_0x4c9a43,'message':'Listed\x20'+_0x4c9a43[_0x524266(0x1ef)]+_0x524266(0x1c1)+_0x61e08f};}catch(_0x3fe9e8){return{'success':![],'message':_0x524266(0x1dd)+_0x61e08f+':\x20'+_0x3fe9e8};}}export function editFile(_0x489b19,_0x41d8e3,_0x5de9d4){const _0x46fdb4=a7_0x2de2;try{const _0x448b61=resolve(process[_0x46fdb4(0x1cf)](),_0x489b19);if(!existsSync(_0x448b61))return{'success':![],'message':_0x46fdb4(0x1d2)+_0x489b19};const _0x553808=readFileSync(_0x448b61,_0x46fdb4(0x1ce));if(!_0x553808[_0x46fdb4(0x1ed)](_0x41d8e3))return{'success':![],'message':'Search\x20string\x20not\x20found\x20in\x20'+_0x489b19};trackFileModify(_0x448b61,_0x553808);const _0x52be5c=_0x553808['replace'](_0x41d8e3,_0x5de9d4);return writeFileSync(_0x448b61,_0x52be5c,'utf-8'),{'success':!![],'message':_0x46fdb4(0x1e1)+_0x489b19};}catch(_0x373e69){return{'success':![],'message':'Failed\x20to\x20edit\x20'+_0x489b19+':\x20'+_0x373e69};}}export function searchFile(_0x429e3b,_0x50fa95){const _0x5d9eb7=a7_0x2de2;try{const _0x3bf01e=resolve(process[_0x5d9eb7(0x1cf)](),_0x429e3b);if(!existsSync(_0x3bf01e))return{'success':![],'message':_0x5d9eb7(0x1d2)+_0x429e3b};const _0x402283=readFileSync(_0x3bf01e,_0x5d9eb7(0x1ce)),_0x2b5ca9=new RegExp(_0x50fa95,'g'),_0x24901a=_0x402283[_0x5d9eb7(0x1bd)](_0x2b5ca9)||[],_0x3db5bf=_0x402283[_0x5d9eb7(0x1bb)]('\x0a'),_0x37bf54=_0x3db5bf[_0x5d9eb7(0x1f1)]((_0x4a8b10,_0x54155c)=>new RegExp(_0x50fa95)[_0x5d9eb7(0x1e5)](_0x4a8b10));return{'success':!![],'matches':_0x37bf54,'message':_0x5d9eb7(0x1d8)+_0x37bf54[_0x5d9eb7(0x1ef)]+_0x5d9eb7(0x1b3)+_0x429e3b};}catch(_0x4550df){return{'success':![],'message':'Failed\x20to\x20search\x20'+_0x429e3b+':\x20'+_0x4550df};}}export function findFiles(_0xaaf7d4,_0x3515de){const _0x3c99ba=a7_0x2de2;try{const _0x4ea981=resolve(process[_0x3c99ba(0x1cf)](),_0xaaf7d4);if(!existsSync(_0x4ea981))return{'success':![],'message':_0x3c99ba(0x1c7)+_0xaaf7d4};const _0x3e5e5b=[],_0x3c52a7=new RegExp(_0x3515de,'i');function _0xc3fb04(_0x509d6c){const _0x47b528=_0x3c99ba,_0x3cf6da=readdirSync(_0x509d6c);for(const _0xd923bc of _0x3cf6da){if(_0xd923bc[_0x47b528(0x1b7)]('.')||_0xd923bc===_0x47b528(0x1cd))continue;const _0xa25fa6=resolve(_0x509d6c,_0xd923bc),_0x3b2f8e=statSync(_0xa25fa6);if(_0x3b2f8e[_0x47b528(0x1c0)]())_0xc3fb04(_0xa25fa6);else _0x3c52a7['test'](_0xd923bc)&&_0x3e5e5b[_0x47b528(0x1df)](relative(_0x4ea981,_0xa25fa6));}}return _0xc3fb04(_0x4ea981),{'success':!![],'files':_0x3e5e5b['slice'](0x0,0x32),'message':_0x3c99ba(0x1d8)+_0x3e5e5b['length']+_0x3c99ba(0x1ec)+_0x3515de+'\x22'};}catch(_0x1b9daf){return{'success':![],'message':_0x3c99ba(0x1f0)+_0x1b9daf};}}function a7_0x5d08(){const _0x3e2793=['1367898IlqKsq','21249NicaCz','isDirectory','\x20items\x20in\x20','783435GUgNjA','2CqHPTU','6284105wrDrqC','Created\x20','toLowerCase','Directory\x20not\x20found:\x20','Failed\x20to\x20search\x20directory:\x20','slice','[Binary\x20file\x20detected\x20(.','.py','substring','node_modules','utf-8','cwd','.ts','12ZCgkXx','File\x20not\x20found:\x20','.gif',').\x20Use\x20\x27computer_screenshot\x27\x20or\x20specific\x20tools\x20to\x20handle\x20this\x20file\x20type.\x20Direct\x20reading\x20is\x20not\x20supported.]','Failed\x20to\x20create\x20','.jsx','.md','Found\x20','.jpeg','.txt','.go','60vcOTcI','Failed\x20to\x20list\x20','pop','push','.exe','Edited\x20','1544jzegze','.dll','1401521ijSlGJ','test','.css','file','trim','.js','437185ZLRiPz','directory','\x20files\x20matching\x20\x22','includes','30xnuIfi','length','Failed\x20to\x20find\x20files:\x20','filter','\x20output\x20matches\x20in\x20','Read\x20','.tsx','.html','startsWith','Failed\x20to\x20read\x20','\x20matches\x20for\x20\x22','8390980vawxwr','split','4GZnozN','match'];a7_0x5d08=function(){return _0x3e2793;};return a7_0x5d08();}export function searchDirectory(_0x54941b,_0x3ac0e9){const _0x410046=a7_0x2de2;try{const _0x999f93=resolve(process[_0x410046(0x1cf)](),_0x54941b);if(!existsSync(_0x999f93))return{'success':![],'message':_0x410046(0x1c7)+_0x54941b};const _0x44c174=[],_0x4bcd32=new RegExp(_0x3ac0e9,'i'),_0x2f8285=[_0x410046(0x1d0),_0x410046(0x1e9),_0x410046(0x1b5),_0x410046(0x1d6),'.json',_0x410046(0x1d7),_0x410046(0x1da),_0x410046(0x1e6),_0x410046(0x1b6),_0x410046(0x1cb),_0x410046(0x1db),'.rs'];function _0x3b4c65(_0x42cf9a){const _0x5c62be=_0x410046,_0x2a9ab8=readdirSync(_0x42cf9a);for(const _0x18a6cf of _0x2a9ab8){if(_0x18a6cf[_0x5c62be(0x1b7)]('.')||_0x18a6cf===_0x5c62be(0x1cd))continue;const _0x2242d9=resolve(_0x42cf9a,_0x18a6cf),_0x519628=statSync(_0x2242d9);if(_0x519628[_0x5c62be(0x1c0)]())_0x3b4c65(_0x2242d9);else{const _0x3f4967='.'+_0x18a6cf[_0x5c62be(0x1bb)]('.')['pop']()?.[_0x5c62be(0x1c6)]();if(_0x2f8285[_0x5c62be(0x1ed)](_0x3f4967))try{const _0x3b7e72=readFileSync(_0x2242d9,_0x5c62be(0x1ce)),_0x558a36=_0x3b7e72['split']('\x0a');_0x558a36['forEach']((_0x162e39,_0x40bc87)=>{const _0x5c36a6=_0x5c62be;_0x4bcd32[_0x5c36a6(0x1e5)](_0x162e39)&&_0x44c174['push']({'file':relative(_0x999f93,_0x2242d9),'line':_0x40bc87+0x1,'content':_0x162e39[_0x5c36a6(0x1e8)]()[_0x5c36a6(0x1cc)](0x0,0x64)});});}catch{}}}}return _0x3b4c65(_0x999f93),{'success':!![],'results':_0x44c174[_0x410046(0x1c9)](0x0,0x1e),'message':'Found\x20'+_0x44c174['length']+_0x410046(0x1b9)+_0x3ac0e9+'\x22'};}catch(_0x280ec0){return{'success':![],'message':_0x410046(0x1c8)+_0x280ec0};}}
|
package/dist/tools/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x18c29f,_0x39ceff){var _0x5535ba=a8_0x4d2a,_0x51af59=_0x18c29f();while(!![]){try{var _0x576979=-parseInt(_0x5535ba(0xe8))/0x1+parseInt(_0x5535ba(0xec))/0x2*(-parseInt(_0x5535ba(0xe6))/0x3)+-parseInt(_0x5535ba(0xeb))/0x4+parseInt(_0x5535ba(0xe5))/0x5*(-parseInt(_0x5535ba(0xe4))/0x6)+-parseInt(_0x5535ba(0xe7))/0x7*(parseInt(_0x5535ba(0xea))/0x8)+-parseInt(_0x5535ba(0xe9))/0x9*(-parseInt(_0x5535ba(0xe3))/0xa)+parseInt(_0x5535ba(0xed))/0xb;if(_0x576979===_0x39ceff)break;else _0x51af59['push'](_0x51af59['shift']());}catch(_0x4aacc8){_0x51af59['push'](_0x51af59['shift']());}}}(a8_0x1478,0xb53ef));function a8_0x4d2a(_0x16f302,_0x324fab){_0x16f302=_0x16f302-0xe3;var _0x1478ca=a8_0x1478();var _0x4d2ab9=_0x1478ca[_0x16f302];return _0x4d2ab9;}export{createFile,readFile,listDirectory,editFile,searchFile,findFiles,searchDirectory}from'./file.js';function a8_0x1478(){var _0xb58e75=['6eBBbQX','31384595OiNPCX','6521530lgKyTD','18JmkUoy','2241830jHLUKc','802719aMTgFB','3325bKvQMS','291279dhqeqh','9MgJXbk','256DcDnfN','1234476FepzkB'];a8_0x1478=function(){return _0xb58e75;};return a8_0x1478();}export{runCommand}from'./command.js';export{listRules,addRule,clearRules,formatRulesForSystem}from'./rules.js';export{connectToMcpServers,getMcpTools,executeMcpTool,closeMcpClients}from'./mcp.js';export{trackFileCreate,trackFileModify,rollbackLast,rollbackAll,getChanges,clearChanges}from'./rollback.js';
|
package/dist/tools/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d268f,_0x1cc5f7){const _0x2af6e2=a9_0x54d9,_0x153738=_0x4d268f();while(!![]){try{const _0x679df6=parseInt(_0x2af6e2(0x139))/0x1+parseInt(_0x2af6e2(0x14e))/0x2*(-parseInt(_0x2af6e2(0x13e))/0x3)+-parseInt(_0x2af6e2(0x14c))/0x4*(parseInt(_0x2af6e2(0x13a))/0x5)+parseInt(_0x2af6e2(0x148))/0x6*(parseInt(_0x2af6e2(0x134))/0x7)+-parseInt(_0x2af6e2(0x133))/0x8+parseInt(_0x2af6e2(0x13b))/0x9+-parseInt(_0x2af6e2(0x14f))/0xa*(-parseInt(_0x2af6e2(0x129))/0xb);if(_0x679df6===_0x1cc5f7)break;else _0x153738['push'](_0x153738['shift']());}catch(_0x3919f8){_0x153738['push'](_0x153738['shift']());}}}(a9_0x3ec5,0x1ce30));import{Client}from'@modelcontextprotocol/sdk/client/index.js';import{StdioClientTransport}from'@modelcontextprotocol/sdk/client/stdio.js';import{StreamableHTTPClientTransport}from'@modelcontextprotocol/sdk/client/streamableHttp.js';import{getMcpServers}from'../config/mcp.js';import*as a9_0x4b99e9 from'../ui/output.js';const clients=new Map();async function connectStdioServer(_0x5b206b,_0x35a8ff){const _0x294394=a9_0x54d9;try{const _0x31860b={...process[_0x294394(0x137)],..._0x35a8ff['env']};Object['keys'](_0x31860b)[_0x294394(0x12a)](_0x8be5ef=>_0x31860b[_0x8be5ef]===undefined&&delete _0x31860b[_0x8be5ef]);const _0x56c828=new StdioClientTransport({'command':_0x35a8ff[_0x294394(0x12c)],'args':_0x35a8ff[_0x294394(0x132)],'env':_0x31860b,'stderr':_0x294394(0x131)}),_0x109bb7=new Client({'name':_0x294394(0x14b),'version':'1.0.0'},{'capabilities':{}});return await _0x109bb7['connect'](_0x56c828),_0x109bb7;}catch(_0x5473df){return a9_0x4b99e9['error'](_0x294394(0x12e)+_0x5b206b+_0x294394(0x144)+_0x5473df),null;}}function a9_0x3ec5(){const _0x2644ea=['info','streamable-http','url','MCP\x20server\x20\x27','name','\x27:\x20','connect','description','get','1030002nPJygm','\x27\x20not\x20connected','clear','woozlit-cli','37036DCMtTj','has','1468ulKuMf','830yaRjet','map','14113hEQYwm','forEach','inputSchema','command','MCP\x20tool\x20execution\x20failed:\x20','Failed\x20to\x20connect\x20to\x20stdio\x20MCP\x20server\x20\x27','close','Failed\x20to\x20connect\x20to\x20HTTP\x20MCP\x20server\x20\x27','pipe','args','1206496pqONaP','7yRwZsO','type','push','env','keys','174446vtQoqx','35cYfCJp','28683YzosNE','entries','Failed\x20to\x20list\x20tools\x20for\x20\x27','498XLLWqg'];a9_0x3ec5=function(){return _0x2644ea;};return a9_0x3ec5();}async function connectHttpServer(_0x2c06ff,_0x1d0259){const _0x4f353e=a9_0x54d9;try{const _0x399f81=new StreamableHTTPClientTransport(new URL(_0x1d0259)),_0x4a3808=new Client({'name':_0x4f353e(0x14b),'version':'1.0.0'},{'capabilities':{}});return await _0x4a3808[_0x4f353e(0x145)](_0x399f81),_0x4a3808;}catch(_0x58818f){return a9_0x4b99e9['error'](_0x4f353e(0x130)+_0x2c06ff+_0x4f353e(0x144)+_0x58818f),null;}}export async function connectToMcpServers(){const _0x30e4f2=a9_0x54d9,_0x25c13d=getMcpServers(),_0xb41e7a=Object[_0x30e4f2(0x138)](_0x25c13d);if(_0xb41e7a['length']===0x0)return;a9_0x4b99e9[_0x30e4f2(0x13f)]('Connecting\x20to\x20MCP\x20servers...');for(const _0x48b123 of _0xb41e7a){if(clients[_0x30e4f2(0x14d)](_0x48b123))continue;const _0x34bfb7=_0x25c13d[_0x48b123];let _0x616734=null;_0x34bfb7[_0x30e4f2(0x135)]===_0x30e4f2(0x140)?_0x616734=await connectHttpServer(_0x48b123,_0x34bfb7[_0x30e4f2(0x141)]):_0x616734=await connectStdioServer(_0x48b123,_0x34bfb7),_0x616734&&clients['set'](_0x48b123,_0x616734);}}export async function getMcpTools(){const _0xa162ff=a9_0x54d9,_0x3950d0=[];for(const [_0x28904c,_0x2fd949]of clients[_0xa162ff(0x13c)]()){try{const _0x40e31c=await _0x2fd949['listTools'](),_0x7d1a90=_0x40e31c['tools'][_0xa162ff(0x128)](_0x1976cc=>({'name':_0x1976cc[_0xa162ff(0x143)],'description':_0x1976cc[_0xa162ff(0x146)],'inputSchema':_0x1976cc[_0xa162ff(0x12b)],'serverName':_0x28904c}));_0x3950d0[_0xa162ff(0x136)](..._0x7d1a90);}catch(_0x1b39f3){a9_0x4b99e9['error'](_0xa162ff(0x13d)+_0x28904c+_0xa162ff(0x144)+_0x1b39f3);}}return _0x3950d0;}export async function executeMcpTool(_0x29413f,_0x14933c,_0x2d0983){const _0x53b5a1=a9_0x54d9,_0x25093e=clients[_0x53b5a1(0x147)](_0x29413f);if(!_0x25093e)throw new Error(_0x53b5a1(0x142)+_0x29413f+_0x53b5a1(0x149));try{const _0x991d5f=await _0x25093e['callTool']({'name':_0x14933c,'arguments':_0x2d0983});return _0x991d5f;}catch(_0x15cdba){throw new Error(_0x53b5a1(0x12d)+_0x15cdba);}}function a9_0x54d9(_0x3ac81a,_0x3ad087){_0x3ac81a=_0x3ac81a-0x128;const _0x3ec55d=a9_0x3ec5();let _0x54d946=_0x3ec55d[_0x3ac81a];return _0x54d946;}export function closeMcpClients(){const _0x527f9e=a9_0x54d9;for(const _0x1877f8 of clients['values']()){try{_0x1877f8[_0x527f9e(0x12f)]();}catch(_0x1572e9){}}clients[_0x527f9e(0x14a)]();}
|
package/dist/tools/rollback.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e47a3,_0x1043c2){const _0x3ae38e=a10_0x21f2,_0x8b0d8e=_0x5e47a3();while(!![]){try{const _0x41b8e6=parseInt(_0x3ae38e(0x20a))/0x1+-parseInt(_0x3ae38e(0x209))/0x2*(-parseInt(_0x3ae38e(0x208))/0x3)+-parseInt(_0x3ae38e(0x206))/0x4+parseInt(_0x3ae38e(0x1f4))/0x5+parseInt(_0x3ae38e(0x1fc))/0x6+-parseInt(_0x3ae38e(0x202))/0x7*(-parseInt(_0x3ae38e(0x203))/0x8)+-parseInt(_0x3ae38e(0x1ff))/0x9*(parseInt(_0x3ae38e(0x205))/0xa);if(_0x41b8e6===_0x1043c2)break;else _0x8b0d8e['push'](_0x8b0d8e['shift']());}catch(_0x678a1c){_0x8b0d8e['push'](_0x8b0d8e['shift']());}}}(a10_0x4882,0xc1595));import*as a10_0x323bd1 from'fs';import*as a10_0x26381d from'path';const changes=[];export function trackFileCreate(_0x3795b1){const _0x3a7f79=a10_0x21f2;changes[_0x3a7f79(0x1f6)]({'path':a10_0x26381d[_0x3a7f79(0x1f9)](_0x3795b1),'type':_0x3a7f79(0x1fd),'previousContent':null,'timestamp':Date['now']()});}export function trackFileModify(_0x5a11fe,_0x15daac){const _0x34f15a=a10_0x21f2;changes[_0x34f15a(0x1f6)]({'path':a10_0x26381d[_0x34f15a(0x1f9)](_0x5a11fe),'type':_0x34f15a(0x1fe),'previousContent':_0x15daac,'timestamp':Date['now']()});}function a10_0x21f2(_0x42581a,_0x20a6cd){_0x42581a=_0x42581a-0x1f4;const _0x488265=a10_0x4882();let _0x21f2ff=_0x488265[_0x42581a];return _0x21f2ff;}export function trackFileDelete(_0x2de2cf,_0x56da84){const _0x252a21=a10_0x21f2;changes[_0x252a21(0x1f6)]({'path':a10_0x26381d[_0x252a21(0x1f9)](_0x2de2cf),'type':'delete','previousContent':_0x56da84,'timestamp':Date[_0x252a21(0x204)]()});}function a10_0x4882(){const _0x4ec250=['length','path','resolve','delete','previousContent','6608328SItbzY','create','modify','1868787GRWigB','Rollback\x20failed:\x20','No\x20changes\x20to\x20rollback','875EisPLg','17872WDNpix','now','80xEIoVx','2636124FgJlGJ','Restored:\x20','2964BFmCwD','1858jAJebP','387527AqaRGw','unlinkSync','existsSync','2130575GKFXMt','writeFileSync','push'];a10_0x4882=function(){return _0x4ec250;};return a10_0x4882();}export function getChanges(){return[...changes];}export function rollbackLast(){const _0x38f052=a10_0x21f2;if(changes[_0x38f052(0x1f7)]===0x0)return{'success':![],'message':_0x38f052(0x201)};const _0x3f0154=changes['pop']();try{switch(_0x3f0154['type']){case _0x38f052(0x1fd):a10_0x323bd1[_0x38f052(0x20c)](_0x3f0154['path'])&&a10_0x323bd1[_0x38f052(0x20b)](_0x3f0154[_0x38f052(0x1f8)]);return{'success':!![],'message':'Deleted:\x20'+_0x3f0154[_0x38f052(0x1f8)]};case _0x38f052(0x1fe):_0x3f0154[_0x38f052(0x1fb)]!==null&&a10_0x323bd1[_0x38f052(0x1f5)](_0x3f0154[_0x38f052(0x1f8)],_0x3f0154[_0x38f052(0x1fb)]);return{'success':!![],'message':_0x38f052(0x207)+_0x3f0154[_0x38f052(0x1f8)]};case _0x38f052(0x1fa):_0x3f0154['previousContent']!==null&&a10_0x323bd1[_0x38f052(0x1f5)](_0x3f0154[_0x38f052(0x1f8)],_0x3f0154[_0x38f052(0x1fb)]);return{'success':!![],'message':_0x38f052(0x207)+_0x3f0154['path']};default:return{'success':![],'message':'Unknown\x20change\x20type'};}}catch(_0xe2381b){return{'success':![],'message':_0x38f052(0x200)+_0xe2381b};}}export function rollbackAll(){const _0x2c122b=a10_0x21f2,_0x19bfc9=[];let _0x51486d=0x0;while(changes[_0x2c122b(0x1f7)]>0x0){const _0x20f87c=rollbackLast();_0x20f87c['success']&&(_0x51486d++,_0x19bfc9[_0x2c122b(0x1f6)](_0x20f87c['message']));}return{'success':_0x51486d>0x0,'count':_0x51486d,'messages':_0x19bfc9};}export function clearChanges(){const _0x2d648e=a10_0x21f2;changes[_0x2d648e(0x1f7)]=0x0;}
|
package/dist/tools/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3cb93b,_0x366586){const _0x3c63a1=a11_0x1a47,_0x208442=_0x3cb93b();while(!![]){try{const _0xdb65cc=-parseInt(_0x3c63a1(0xfe))/0x1+-parseInt(_0x3c63a1(0xfd))/0x2+-parseInt(_0x3c63a1(0xf5))/0x3+parseInt(_0x3c63a1(0xf9))/0x4*(-parseInt(_0x3c63a1(0xf7))/0x5)+parseInt(_0x3c63a1(0xfc))/0x6*(-parseInt(_0x3c63a1(0xf4))/0x7)+-parseInt(_0x3c63a1(0xff))/0x8*(-parseInt(_0x3c63a1(0xfa))/0x9)+parseInt(_0x3c63a1(0xfb))/0xa;if(_0xdb65cc===_0x366586)break;else _0x208442['push'](_0x208442['shift']());}catch(_0x229cb0){_0x208442['push'](_0x208442['shift']());}}}(a11_0x5c0d,0x621ce));import{getRules,addRule as a11_0x59268c,clearRules as a11_0x202072}from'../utils/storage.js';export function listRules(){return getRules();}export function addRule(_0x1ce4fa){a11_0x59268c(_0x1ce4fa);}function a11_0x1a47(_0x503a4e,_0x3a7788){_0x503a4e=_0x503a4e-0xf4;const _0x5c0df0=a11_0x5c0d();let _0x1a47ff=_0x5c0df0[_0x503a4e];return _0x1a47ff;}function a11_0x5c0d(){const _0x50f8eb=['map','join','159824oSeteb','687120oywvFQ','\x0a\x0aUser-defined\x20rules:\x0a','55bOkQyp','length','118316KKMfaY','9wPKlWr','13451130HUANRd','6RRqgkS','336654XbRyRb','680406oYooxr','3861848VaMQzq'];a11_0x5c0d=function(){return _0x50f8eb;};return a11_0x5c0d();}export function clearRules(){a11_0x202072();}export function formatRulesForSystem(){const _0x42bc33=a11_0x1a47,_0x23e06f=getRules();if(_0x23e06f[_0x42bc33(0xf8)]===0x0)return'';return _0x42bc33(0xf6)+_0x23e06f[_0x42bc33(0x100)]((_0x7aecca,_0x291214)=>_0x291214+0x1+'.\x20'+_0x7aecca)[_0x42bc33(0x101)]('\x0a');}
|
package/dist/ui/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a12_0x4926ab=a12_0x324b;(function(_0x320475,_0x308579){const _0x2c6752=a12_0x324b,_0x35bc13=_0x320475();while(!![]){try{const _0x5b3b40=parseInt(_0x2c6752(0x107))/0x1*(-parseInt(_0x2c6752(0x10e))/0x2)+parseInt(_0x2c6752(0xec))/0x3+parseInt(_0x2c6752(0x12c))/0x4+parseInt(_0x2c6752(0xda))/0x5*(-parseInt(_0x2c6752(0xeb))/0x6)+parseInt(_0x2c6752(0xd9))/0x7+-parseInt(_0x2c6752(0xf3))/0x8+-parseInt(_0x2c6752(0x101))/0x9*(parseInt(_0x2c6752(0xe2))/0xa);if(_0x5b3b40===_0x308579)break;else _0x35bc13['push'](_0x35bc13['shift']());}catch(_0x2e351c){_0x35bc13['push'](_0x35bc13['shift']());}}}(a12_0x5325,0x26685));import a12_0x37f995 from'chalk';import a12_0x12f93e from'ora';const LOGO='\x0a'+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xed))(a12_0x4926ab(0xdc))+a12_0x37f995[a12_0x4926ab(0x11d)]('#60a5fa')(a12_0x4926ab(0xdf))+a12_0x37f995[a12_0x4926ab(0x11d)]('#3b82f6')(a12_0x4926ab(0x10c))+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xee))(a12_0x4926ab(0xe6))+'\x0a'+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xed))('██║\x20\x20\x20\x20██║')+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xe1))(a12_0x4926ab(0x11e))+a12_0x37f995[a12_0x4926ab(0x11d)]('#3b82f6')(a12_0x4926ab(0xf0))+a12_0x37f995[a12_0x4926ab(0x11d)]('#2563eb')(a12_0x4926ab(0x119))+'\x0a'+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xed))(a12_0x4926ab(0xff))+a12_0x37f995['hex'](a12_0x4926ab(0xe1))(a12_0x4926ab(0x11b))+a12_0x37f995[a12_0x4926ab(0x11d)]('#3b82f6')(a12_0x4926ab(0xf9))+a12_0x37f995[a12_0x4926ab(0x11d)]('#2563eb')(a12_0x4926ab(0xf1))+'\x0a'+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xed))(a12_0x4926ab(0x10f))+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xe1))(a12_0x4926ab(0x11b))+a12_0x37f995[a12_0x4926ab(0x11d)]('#3b82f6')(a12_0x4926ab(0x114))+a12_0x37f995['hex'](a12_0x4926ab(0xee))(a12_0x4926ab(0xf1))+'\x0a'+a12_0x37f995['hex'](a12_0x4926ab(0xed))(a12_0x4926ab(0x103))+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xe1))(a12_0x4926ab(0x110))+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xfa))(a12_0x4926ab(0xf8))+a12_0x37f995[a12_0x4926ab(0x11d)]('#2563eb')('██║\x20\x20\x20██║\x20\x20\x20')+'\x0a'+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xed))(a12_0x4926ab(0x105))+a12_0x37f995[a12_0x4926ab(0x11d)]('#60a5fa')(a12_0x4926ab(0x127))+a12_0x37f995[a12_0x4926ab(0x11d)](a12_0x4926ab(0xfa))(a12_0x4926ab(0x129))+a12_0x37f995[a12_0x4926ab(0x11d)]('#2563eb')(a12_0x4926ab(0x123))+'\x0a';export function showLogo(){const _0x29553c=a12_0x4926ab;process['stdout'][_0x29553c(0x12a)](LOGO+'\x0a');}function a12_0x324b(_0x33b2bd,_0xa3616f){_0x33b2bd=_0x33b2bd-0xd8;const _0x5325c8=a12_0x5325();let _0x324bc9=_0x5325c8[_0x33b2bd];return _0x324bc9;}export function createSpinner(_0x591206){const _0x491a29=a12_0x4926ab;return a12_0x12f93e({'text':_0x591206,'color':_0x491a29(0x104),'spinner':_0x491a29(0xea)});}export function success(_0x2d38c4){const _0x26bce8=a12_0x4926ab;process['stdout'][_0x26bce8(0x12a)](a12_0x37f995['hex'](_0x26bce8(0xfa))('\x20\x20')+_0x2d38c4+'\x0a');}export function error(_0xa0665e){const _0x18a3b0=a12_0x4926ab;process[_0x18a3b0(0x10d)]['write'](a12_0x37f995[_0x18a3b0(0x124)]('\x20\x20')+_0xa0665e+'\x0a');}export function info(_0x261aa1){const _0x3a651a=a12_0x4926ab;process[_0x3a651a(0x10d)][_0x3a651a(0x12a)](a12_0x37f995['hex'](_0x3a651a(0xe1))('\x20\x20')+_0x261aa1+'\x0a');}export function warn(_0xe64a6c){const _0x1620af=a12_0x4926ab;process[_0x1620af(0x10d)][_0x1620af(0x12a)](a12_0x37f995[_0x1620af(0x122)]('\x20\x20')+_0xe64a6c+'\x0a');}export function dim(_0x3a01a4){const _0x19d3a7=a12_0x4926ab;process[_0x19d3a7(0x10d)][_0x19d3a7(0x12a)](a12_0x37f995[_0x19d3a7(0x11f)]('\x20\x20'+_0x3a01a4)+'\x0a');}export function header(_0x289e7c){const _0x31ef44=a12_0x4926ab;process[_0x31ef44(0x10d)][_0x31ef44(0x12a)]('\x0a'+a12_0x37f995['bold'][_0x31ef44(0x11d)]('#3b82f6')(_0x289e7c)+'\x0a');}export function divider(){const _0x232044=a12_0x4926ab;process[_0x232044(0x10d)][_0x232044(0x12a)](a12_0x37f995[_0x232044(0x11f)]('\x20\x20'+'-'['repeat'](0x32))+'\x0a');}export function tip(_0x50a079,_0x192447){const _0x285477=a12_0x4926ab;process[_0x285477(0x10d)][_0x285477(0x12a)](a12_0x37f995[_0x285477(0x11f)]('\x20\x20')+a12_0x37f995[_0x285477(0x12d)](_0x50a079)+a12_0x37f995['dim']('\x20'+_0x192447)+'\x0a');}export function userMessage(_0x4bee34){const _0x1e70e9=a12_0x4926ab;process[_0x1e70e9(0x10d)][_0x1e70e9(0x12a)](a12_0x37f995[_0x1e70e9(0x10b)][_0x1e70e9(0x11d)](_0x1e70e9(0xe1))(_0x1e70e9(0x108))+_0x4bee34+'\x0a');}export function aiMessage(_0x6f7bc3){const _0x1a9571=a12_0x4926ab;process[_0x1a9571(0x10d)]['write'](_0x1a9571(0x120)+_0x6f7bc3);}export function aiMessageEnd(){const _0x4f5734=a12_0x4926ab;process['stdout'][_0x4f5734(0x12a)]('\x0a');}export function toolCall(_0x1ef382,_0x487e1f){const _0x38e044=a12_0x4926ab;process[_0x38e044(0x10d)][_0x38e044(0x12a)](a12_0x37f995[_0x38e044(0x11f)](_0x38e044(0xe3))+a12_0x37f995[_0x38e044(0x11d)](_0x38e044(0xe1))(_0x1ef382)+a12_0x37f995['dim'](':\x20'+_0x487e1f)+'\x0a');}export function statusBar(_0x16ffcb,_0x2ca418){const _0x1fa291=a12_0x4926ab,_0x5d61fa=_0x16ffcb[_0x1fa291(0x116)]('/')['pop']()?.[_0x1fa291(0xf2)](_0x1fa291(0xfb),'')||_0x16ffcb,_0x51551e=a12_0x37f995['hex']('#3b82f6')(_0x5d61fa),_0x59797e=a12_0x37f995[_0x1fa291(0x11f)](_0x2ca418+_0x1fa291(0x115));process[_0x1fa291(0x10d)]['write']('\x20\x20'+_0x51551e+'\x20\x20'+a12_0x37f995[_0x1fa291(0x11f)]('|')+'\x20\x20'+_0x59797e+'\x0a');}export function prompt(){const _0x2b7a7f=a12_0x4926ab;process[_0x2b7a7f(0x10d)]['write'](a12_0x37f995['hex'](_0x2b7a7f(0xfa))(_0x2b7a7f(0x12b)));}function a12_0x5325(){const _0x791764=['Unlimited','dots','1374fvRAfQ','777105pZDybg','#93c5fd','#2563eb','max','╚══███╔╝██║\x20\x20\x20\x20\x20','██║\x20\x20\x20██║\x20\x20\x20','replace','2122264jBqjWf','repeat','trim','green','│\x20\x20','███████╗███████╗','\x20\x20███╔╝\x20██║\x20\x20\x20\x20\x20','#3b82f6',':free','\x20\x20\x20','\x20\x20│','\x20\x20Limit\x20Reached\x0a','██║\x20█╗\x20██║','Editing','56187XhsYid','Running','╚███╔███╔╝','blue','\x20╚══╝╚══╝\x20','min','2yGAVro','\x0a\x20\x20You:\x20','servers','\x20\x20Working\x20in:\x20','bold','███████╗██╗\x20\x20\x20\x20\x20','stdout','12166UgIuJU','██║███╗██║','╚██████╔╝╚██████╔╝','Searching','toString','\x20\x20Done\x20in\x20','\x20███╔╝\x20\x20██║\x20\x20\x20\x20\x20','%\x20context\x20left','split','run_command','slice','██║╚══██╔══╝','map','██║\x20\x20\x20██║██║\x20\x20\x20██║','substring','hex','██╔═══██╗██╔═══██╗','dim','\x0a\x20\x20','path','yellow','╚═╝\x20\x20\x20╚═╝\x20\x20\x20','red','Listing','\x20/\x20','\x20╚═════╝\x20\x20╚═════╝\x20','round','╚══════╝╚══════╝','write','\x20\x20>\x20','482512wYjVtv','white','Reading','Logged\x20in\x20as:\x20','Finding','766129lbBfIU','505CkYsgq','command','██╗\x20\x20\x20\x20██╗','Creating','length','\x20██████╗\x20\x20██████╗\x20','\x20connected\x20(','#60a5fa','50dBzdut','\x20\x20\x20\x20->\x20','pattern','floor','██╗████████╗','join','server'];a12_0x5325=function(){return _0x791764;};return a12_0x5325();}function lerpColor(_0x3390dc,_0x3dea0e,_0x3d06a1){const _0x56a982=a12_0x4926ab,_0x37ee60=parseInt(_0x3390dc[_0x56a982(0xf2)]('#',''),0x10),_0x47e4d5=parseInt(_0x3dea0e['replace']('#',''),0x10),_0x5b33b4=_0x37ee60>>0x10&0xff,_0xac346d=_0x37ee60>>0x8&0xff,_0x386667=_0x37ee60&0xff,_0x22c05e=_0x47e4d5>>0x10&0xff,_0x3ffab8=_0x47e4d5>>0x8&0xff,_0x137f33=_0x47e4d5&0xff,_0x3395b6=Math[_0x56a982(0x128)](_0x5b33b4+(_0x22c05e-_0x5b33b4)*_0x3d06a1),_0x275c56=Math['round'](_0xac346d+(_0x3ffab8-_0xac346d)*_0x3d06a1),_0x5413e9=Math[_0x56a982(0x128)](_0x386667+(_0x137f33-_0x386667)*_0x3d06a1);return'#'+((0x1<<0x18)+(_0x3395b6<<0x10)+(_0x275c56<<0x8)+_0x5413e9)[_0x56a982(0x112)](0x10)[_0x56a982(0x118)](0x1);}export function gradientText(_0x25b2b2,_0x4a3bd1,_0x4b62b2){const _0x30a118=a12_0x4926ab,_0x2018d4=_0x25b2b2['split']('');return _0x2018d4[_0x30a118(0x11a)]((_0x88248,_0x3345da)=>{const _0x2e0b01=_0x30a118,_0xe92df4=_0x3345da/Math[_0x2e0b01(0xef)](_0x2018d4[_0x2e0b01(0xde)]-0x1,0x1);return a12_0x37f995[_0x2e0b01(0x11d)](lerpColor(_0x4a3bd1,_0x4b62b2,_0xe92df4))(_0x88248);})[_0x30a118(0xe7)]('');}export function loggedInBox(_0x547987){const _0x39d4a2=a12_0x4926ab,_0x29343b=_0x39d4a2(0x12f),_0x40d581=_0x547987[_0x39d4a2(0xf5)](),_0x1158ec=_0x29343b[_0x39d4a2(0xde)]+_0x40d581[_0x39d4a2(0xde)]+0x4,_0x2e07f1=a12_0x37f995[_0x39d4a2(0x11d)]('#3b82f6')('─'['repeat'](_0x1158ec)),_0x414464=a12_0x37f995[_0x39d4a2(0x11d)](_0x39d4a2(0xfa))('╭'+_0x2e07f1+'╮'),_0x305c4f=a12_0x37f995[_0x39d4a2(0x11d)](_0x39d4a2(0xfa))('╰'+_0x2e07f1+'╯'),_0x50d864=gradientText(_0x40d581,_0x39d4a2(0xe1),_0x39d4a2(0xee));process[_0x39d4a2(0x10d)][_0x39d4a2(0x12a)](_0x39d4a2(0x120)+_0x414464+'\x0a'),process[_0x39d4a2(0x10d)][_0x39d4a2(0x12a)]('\x20\x20'+a12_0x37f995[_0x39d4a2(0x11d)]('#3b82f6')(_0x39d4a2(0xf7))+a12_0x37f995[_0x39d4a2(0x11f)](_0x29343b)+_0x50d864+a12_0x37f995['hex']('#3b82f6')(_0x39d4a2(0xfd))+'\x0a'),process[_0x39d4a2(0x10d)][_0x39d4a2(0x12a)]('\x20\x20'+_0x305c4f+'\x0a');}export function actionSpinner(_0x4cbb72){const _0x96e5dc=a12_0x4926ab;return a12_0x12f93e({'text':a12_0x37f995[_0x96e5dc(0x11d)](_0x96e5dc(0xe1))(_0x4cbb72),'color':'blue','spinner':_0x96e5dc(0xea)});}export function toolActivity(_0x31271a,_0x37fbab){const _0x505f36=a12_0x4926ab,_0x162218={'create_file':_0x505f36(0xdd),'read_file':_0x505f36(0x12e),'edit_file':_0x505f36(0x100),'list_directory':_0x505f36(0x125),'search_file':_0x505f36(0x111),'find_files':_0x505f36(0xd8),'search_directory':_0x505f36(0x111),'run_command':_0x505f36(0x102)},_0x4fd8ad=_0x162218[_0x31271a]||_0x31271a;let _0x37273e='';if(_0x31271a===_0x505f36(0x117)&&_0x37fbab[_0x505f36(0xdb)])_0x37273e=_0x37fbab[_0x505f36(0xdb)][_0x505f36(0x11c)](0x0,0x32);else{if(_0x37fbab[_0x505f36(0x121)])_0x37273e=_0x37fbab[_0x505f36(0x121)];else _0x37fbab['pattern']&&(_0x37273e='\x22'+_0x37fbab[_0x505f36(0xe4)]+'\x22');}process[_0x505f36(0x10d)][_0x505f36(0x12a)](a12_0x37f995[_0x505f36(0x11f)]('\x20\x20'+_0x4fd8ad+'\x20'+_0x37273e+'\x0a'));}export function commandOutput(_0x44c9dd){const _0xd9b3c=a12_0x4926ab,_0x2d400e=_0x44c9dd[_0xd9b3c(0x116)]('\x0a');_0x2d400e['forEach'](_0xe9bf09=>{const _0x3f8e9f=_0xd9b3c;_0xe9bf09['trim']()&&process[_0x3f8e9f(0x10d)]['write'](a12_0x37f995[_0x3f8e9f(0x11f)](_0x3f8e9f(0xfc))+a12_0x37f995['dim'](_0xe9bf09)+'\x0a');});}export function usageBox(_0x38bc8d,_0xb0f838,_0x48d141){const _0x1ccc43=a12_0x4926ab,_0x25adc9=_0xb0f838>0x0?Math[_0x1ccc43(0x106)](Math['round'](_0x38bc8d/_0xb0f838*0x64),0x64):0x0,_0x1bd430=0x1e,_0x2301d4=Math[_0x1ccc43(0x128)](_0x25adc9/0x64*_0x1bd430),_0x13891d=_0x1bd430-_0x2301d4,_0x3937bc=_0x48d141?a12_0x37f995[_0x1ccc43(0x124)]:_0x25adc9>0x50?a12_0x37f995['yellow']:a12_0x37f995[_0x1ccc43(0xf6)],_0x23ec63=_0x3937bc('█'[_0x1ccc43(0xf4)](_0x2301d4))+a12_0x37f995[_0x1ccc43(0x11f)]('░'[_0x1ccc43(0xf4)](_0x13891d)),_0x1cebd5=_0xb0f838>=0x3b9ac9ff?_0x1ccc43(0xe9):_0xb0f838['toLocaleString'](),_0x3ef2fb=_0x38bc8d['toLocaleString']()+_0x1ccc43(0x126)+_0x1cebd5+'\x20tokens';process[_0x1ccc43(0x10d)]['write']('\x0a'),process[_0x1ccc43(0x10d)]['write'](a12_0x37f995[_0x1ccc43(0x10b)][_0x1ccc43(0x11d)](_0x1ccc43(0xe1))('\x20\x20Token\x20Usage\x0a')),process['stdout'][_0x1ccc43(0x12a)]('\x20\x20'+_0x23ec63+'\x20'+a12_0x37f995[_0x1ccc43(0x11f)](_0x25adc9+'%')+'\x0a'),process[_0x1ccc43(0x10d)][_0x1ccc43(0x12a)](a12_0x37f995[_0x1ccc43(0x11f)]('\x20\x20'+_0x3ef2fb+'\x0a')),_0x48d141&&process['stdout']['write'](a12_0x37f995[_0x1ccc43(0x124)](_0x1ccc43(0xfe))),process['stdout']['write']('\x0a');}export function mcpConnected(_0x58a3ac,_0x44fe2a){const _0x3ab666=a12_0x4926ab,_0xe8d38a=_0x58a3ac===0x1?_0x3ab666(0xe8):_0x3ab666(0x109);process['stdout'][_0x3ab666(0x12a)](a12_0x37f995[_0x3ab666(0x11f)]('\x20\x20'+a12_0x37f995[_0x3ab666(0x11d)](_0x3ab666(0xfa))(_0x58a3ac[_0x3ab666(0x112)]())+'\x20MCP\x20'+_0xe8d38a+_0x3ab666(0xe0)+_0x44fe2a+'\x20tools)\x0a'));}export function elapsedTime(_0x7f6745){const _0x11b8ab=a12_0x4926ab,_0x4c2d86=_0x7f6745<0x3c?_0x7f6745['toFixed'](0x1)+'s':Math[_0x11b8ab(0xe5)](_0x7f6745/0x3c)+'m\x20'+(_0x7f6745%0x3c)['toFixed'](0x0)+'s';process[_0x11b8ab(0x10d)][_0x11b8ab(0x12a)](a12_0x37f995[_0x11b8ab(0x11f)](_0x11b8ab(0x113)+_0x4c2d86+'\x0a'));}export function currentDir(_0x182e27){const _0x5bb7d8=a12_0x4926ab;process[_0x5bb7d8(0x10d)][_0x5bb7d8(0x12a)](a12_0x37f995[_0x5bb7d8(0x11f)](_0x5bb7d8(0x10a))+a12_0x37f995[_0x5bb7d8(0x11d)]('#60a5fa')(_0x182e27)+'\x0a');}
|
|
1
|
+
const a12_0xe9dbf=a12_0x3bd4;(function(_0x4db1a8,_0x4cc5dd){const _0x5ceed1=a12_0x3bd4,_0x602091=_0x4db1a8();while(!![]){try{const _0x21e7f1=parseInt(_0x5ceed1(0x1a6))/0x1+-parseInt(_0x5ceed1(0x1a4))/0x2*(-parseInt(_0x5ceed1(0x1a2))/0x3)+parseInt(_0x5ceed1(0x1ae))/0x4+parseInt(_0x5ceed1(0x1cd))/0x5*(parseInt(_0x5ceed1(0x1d7))/0x6)+parseInt(_0x5ceed1(0x1be))/0x7+parseInt(_0x5ceed1(0x1ba))/0x8+-parseInt(_0x5ceed1(0x1df))/0x9*(parseInt(_0x5ceed1(0x1ca))/0xa);if(_0x21e7f1===_0x4cc5dd)break;else _0x602091['push'](_0x602091['shift']());}catch(_0x519e28){_0x602091['push'](_0x602091['shift']());}}}(a12_0x3d37,0x60397));import a12_0x56616a from'chalk';import a12_0x3fca41 from'ora';const LOGO='\x0a'+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1d9))(a12_0xe9dbf(0x1b6))+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1bc))(a12_0xe9dbf(0x1db))+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x19e))('███████╗██╗\x20\x20\x20\x20\x20')+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1e7))(a12_0xe9dbf(0x1e5))+'\x0a'+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1d9))(a12_0xe9dbf(0x1d2))+a12_0x56616a[a12_0xe9dbf(0x1ce)]('#60a5fa')('██╔═══██╗██╔═══██╗')+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x19e))(a12_0xe9dbf(0x1c3))+a12_0x56616a[a12_0xe9dbf(0x1ce)]('#2563eb')(a12_0xe9dbf(0x1e1))+'\x0a'+a12_0x56616a['hex']('#93c5fd')('██║\x20█╗\x20██║')+a12_0x56616a['hex']('#60a5fa')(a12_0xe9dbf(0x1a5))+a12_0x56616a['hex'](a12_0xe9dbf(0x19e))(a12_0xe9dbf(0x1a7))+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1e7))(a12_0xe9dbf(0x1c0))+'\x0a'+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1d9))('██║███╗██║')+a12_0x56616a[a12_0xe9dbf(0x1ce)]('#60a5fa')(a12_0xe9dbf(0x1a5))+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x19e))(a12_0xe9dbf(0x1b5))+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1e7))(a12_0xe9dbf(0x1c0))+'\x0a'+a12_0x56616a[a12_0xe9dbf(0x1ce)]('#93c5fd')('╚███╔███╔╝')+a12_0x56616a['hex'](a12_0xe9dbf(0x1bc))(a12_0xe9dbf(0x1a0))+a12_0x56616a[a12_0xe9dbf(0x1ce)]('#3b82f6')('███████╗███████╗')+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1e7))('██║\x20\x20\x20██║\x20\x20\x20')+'\x0a'+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1d9))('\x20╚══╝╚══╝\x20')+a12_0x56616a[a12_0xe9dbf(0x1ce)]('#60a5fa')(a12_0xe9dbf(0x1bb))+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x19e))('╚══════╝╚══════╝')+a12_0x56616a[a12_0xe9dbf(0x1ce)](a12_0xe9dbf(0x1e7))('╚═╝\x20\x20\x20╚═╝\x20\x20\x20')+'\x0a';export function showLogo(){const _0x5ee0ad=a12_0xe9dbf;process['stdout'][_0x5ee0ad(0x1bf)](LOGO+'\x0a');}export function createSpinner(_0x19bf5a){const _0x1e1fb4=a12_0xe9dbf;return a12_0x3fca41({'text':_0x19bf5a,'color':_0x1e1fb4(0x1c5),'spinner':_0x1e1fb4(0x1d6)});}export function success(_0x2f0e49){const _0x11d459=a12_0xe9dbf;process[_0x11d459(0x1cc)][_0x11d459(0x1bf)](a12_0x56616a['hex'](_0x11d459(0x19e))('\x20\x20')+_0x2f0e49+'\x0a');}export function error(_0x1c3ca8){const _0x4380de=a12_0xe9dbf;process[_0x4380de(0x1cc)]['write'](a12_0x56616a[_0x4380de(0x1c8)]('\x20\x20')+_0x1c3ca8+'\x0a');}export function info(_0x47cf11){const _0x15d95e=a12_0xe9dbf;process[_0x15d95e(0x1cc)][_0x15d95e(0x1bf)](a12_0x56616a['hex'](_0x15d95e(0x1bc))('\x20\x20')+_0x47cf11+'\x0a');}function a12_0x3bd4(_0x128be3,_0x34188c){_0x128be3=_0x128be3-0x19b;const _0x3d37c9=a12_0x3d37();let _0x3bd46c=_0x3d37c9[_0x128be3];return _0x3bd46c;}export function warn(_0x185172){const _0x4c7554=a12_0xe9dbf;process['stdout'][_0x4c7554(0x1bf)](a12_0x56616a['yellow']('\x20\x20')+_0x185172+'\x0a');}export function dim(_0x5be021){const _0x3c4dfc=a12_0xe9dbf;process[_0x3c4dfc(0x1cc)][_0x3c4dfc(0x1bf)](a12_0x56616a[_0x3c4dfc(0x1b7)]('\x20\x20'+_0x5be021)+'\x0a');}export function header(_0x438f77){const _0x3f9ff0=a12_0xe9dbf;process[_0x3f9ff0(0x1cc)]['write']('\x0a'+a12_0x56616a[_0x3f9ff0(0x1dc)][_0x3f9ff0(0x1ce)](_0x3f9ff0(0x19e))(_0x438f77)+'\x0a');}function a12_0x3d37(){const _0x352835=['substring','Reading','\x20\x20>\x20','██╗████████╗','yellow','#2563eb','\x20/\x20','replace','floor','#3b82f6','round','╚██████╔╝╚██████╔╝','\x20tokens','971409Vyqkzb','server','2xhnFKW','██║\x20\x20\x20██║██║\x20\x20\x20██║','645741yjlMPx','\x20\x20███╔╝\x20██║\x20\x20\x20\x20\x20','%\x20context\x20left','map','Logged\x20in\x20as:\x20','join','pop','Editing','1412584xjiuYu','toString','\x20connected\x20(','Running','│\x20\x20','min','length','\x20███╔╝\x20\x20██║\x20\x20\x20\x20\x20','██╗\x20\x20\x20\x20██╗','dim','trim','path','3443304HkPjrK','\x20╚═════╝\x20\x20╚═════╝\x20','#60a5fa','forEach','1896160aXvYqA','write','██║\x20\x20\x20██║\x20\x20\x20','pattern','\x20\x20\x20','╚══███╔╝██║\x20\x20\x20\x20\x20','Searching','blue','\x0a\x20\x20','split','red','Creating','4080vNOpWg','servers','stdout','140nANFfu','hex','\x20\x20Token\x20Usage\x0a','command','repeat','██║\x20\x20\x20\x20██║','\x20\x20Working\x20in:\x20','green',':free','dots','165876fCdDPG','max','#93c5fd','\x20\x20\x20\x20->\x20','\x20██████╗\x20\x20██████╗\x20','bold','Listing','slice','53028qGhJbV','toLocaleString','██║╚══██╔══╝'];a12_0x3d37=function(){return _0x352835;};return a12_0x3d37();}export function divider(){const _0x3a1c4e=a12_0xe9dbf;process[_0x3a1c4e(0x1cc)][_0x3a1c4e(0x1bf)](a12_0x56616a[_0x3a1c4e(0x1b7)]('\x20\x20'+'-'[_0x3a1c4e(0x1d1)](0x32))+'\x0a');}export function tip(_0x39053d,_0x511e57){const _0x114994=a12_0xe9dbf;process[_0x114994(0x1cc)][_0x114994(0x1bf)](a12_0x56616a[_0x114994(0x1b7)]('\x20\x20')+a12_0x56616a['white'](_0x39053d)+a12_0x56616a[_0x114994(0x1b7)]('\x20'+_0x511e57)+'\x0a');}export function userMessage(_0x3595ea){const _0x117adf=a12_0xe9dbf;process[_0x117adf(0x1cc)][_0x117adf(0x1bf)](a12_0x56616a['bold'][_0x117adf(0x1ce)](_0x117adf(0x1bc))('\x0a\x20\x20You:\x20')+_0x3595ea+'\x0a');}export function aiMessage(_0x2046bc){const _0x551b95=a12_0xe9dbf;process['stdout'][_0x551b95(0x1bf)](_0x551b95(0x1c6)+_0x2046bc);}export function aiMessageEnd(){const _0xd97da1=a12_0xe9dbf;process[_0xd97da1(0x1cc)]['write']('\x0a');}export function toolCall(_0xcd479d,_0x1ae5fa){const _0x35f9a3=a12_0xe9dbf;process[_0x35f9a3(0x1cc)][_0x35f9a3(0x1bf)](a12_0x56616a['dim'](_0x35f9a3(0x1da))+a12_0x56616a[_0x35f9a3(0x1ce)]('#60a5fa')(_0xcd479d)+a12_0x56616a[_0x35f9a3(0x1b7)](':\x20'+_0x1ae5fa)+'\x0a');}export function statusBar(_0xa996eb,_0x1ea8aa){const _0x139830=a12_0xe9dbf,_0x5d9b14=_0xa996eb['split']('/')[_0x139830(0x1ac)]()?.[_0x139830(0x19c)](_0x139830(0x1d5),'')||_0xa996eb,_0x50418f=a12_0x56616a[_0x139830(0x1ce)]('#3b82f6')(_0x5d9b14),_0x3f5a92=a12_0x56616a['dim'](_0x1ea8aa+_0x139830(0x1a8));process[_0x139830(0x1cc)][_0x139830(0x1bf)]('\x20\x20'+_0x50418f+'\x20\x20'+a12_0x56616a[_0x139830(0x1b7)]('|')+'\x20\x20'+_0x3f5a92+'\x0a');}export function prompt(){const _0x1acb05=a12_0xe9dbf;process[_0x1acb05(0x1cc)]['write'](a12_0x56616a['hex'](_0x1acb05(0x19e))(_0x1acb05(0x1e4)));}function lerpColor(_0x188eb4,_0x4f5184,_0x5ec156){const _0x461105=a12_0xe9dbf,_0x5c403a=parseInt(_0x188eb4[_0x461105(0x19c)]('#',''),0x10),_0x5addbd=parseInt(_0x4f5184[_0x461105(0x19c)]('#',''),0x10),_0x1d38ad=_0x5c403a>>0x10&0xff,_0x42a8cc=_0x5c403a>>0x8&0xff,_0x32b6fe=_0x5c403a&0xff,_0x4d6b19=_0x5addbd>>0x10&0xff,_0x4e86da=_0x5addbd>>0x8&0xff,_0x682965=_0x5addbd&0xff,_0x368de3=Math[_0x461105(0x19f)](_0x1d38ad+(_0x4d6b19-_0x1d38ad)*_0x5ec156),_0x55f36d=Math[_0x461105(0x19f)](_0x42a8cc+(_0x4e86da-_0x42a8cc)*_0x5ec156),_0x230aec=Math[_0x461105(0x19f)](_0x32b6fe+(_0x682965-_0x32b6fe)*_0x5ec156);return'#'+((0x1<<0x18)+(_0x368de3<<0x10)+(_0x55f36d<<0x8)+_0x230aec)[_0x461105(0x1af)](0x10)[_0x461105(0x1de)](0x1);}export function gradientText(_0x4df732,_0x1aeec1,_0x2e23ad){const _0x38f04b=a12_0xe9dbf,_0x34fce1=_0x4df732[_0x38f04b(0x1c7)]('');return _0x34fce1[_0x38f04b(0x1a9)]((_0x4c3bc5,_0x2d0fb5)=>{const _0x1a48f7=_0x38f04b,_0xc4e43e=_0x2d0fb5/Math[_0x1a48f7(0x1d8)](_0x34fce1[_0x1a48f7(0x1b4)]-0x1,0x1);return a12_0x56616a[_0x1a48f7(0x1ce)](lerpColor(_0x1aeec1,_0x2e23ad,_0xc4e43e))(_0x4c3bc5);})[_0x38f04b(0x1ab)]('');}export function loggedInBox(_0x4e6f72){const _0x17fccc=a12_0xe9dbf,_0x5f49dc=_0x17fccc(0x1aa),_0x34bec0=_0x4e6f72[_0x17fccc(0x1b8)](),_0x50a1ad=_0x5f49dc[_0x17fccc(0x1b4)]+_0x34bec0[_0x17fccc(0x1b4)]+0x4,_0x1a768d=a12_0x56616a[_0x17fccc(0x1ce)](_0x17fccc(0x19e))('─'[_0x17fccc(0x1d1)](_0x50a1ad)),_0x34ff15=a12_0x56616a[_0x17fccc(0x1ce)](_0x17fccc(0x19e))('╭'+_0x1a768d+'╮'),_0x6572b0=a12_0x56616a[_0x17fccc(0x1ce)](_0x17fccc(0x19e))('╰'+_0x1a768d+'╯'),_0x4bc6bf=gradientText(_0x34bec0,_0x17fccc(0x1bc),_0x17fccc(0x1e7));process[_0x17fccc(0x1cc)][_0x17fccc(0x1bf)]('\x0a\x20\x20'+_0x34ff15+'\x0a'),process[_0x17fccc(0x1cc)][_0x17fccc(0x1bf)]('\x20\x20'+a12_0x56616a[_0x17fccc(0x1ce)](_0x17fccc(0x19e))(_0x17fccc(0x1b2))+a12_0x56616a[_0x17fccc(0x1b7)](_0x5f49dc)+_0x4bc6bf+a12_0x56616a[_0x17fccc(0x1ce)](_0x17fccc(0x19e))('\x20\x20│')+'\x0a'),process[_0x17fccc(0x1cc)][_0x17fccc(0x1bf)]('\x20\x20'+_0x6572b0+'\x0a');}export function actionSpinner(_0x2ac12e){const _0x51a26a=a12_0xe9dbf;return a12_0x3fca41({'text':a12_0x56616a['hex']('#60a5fa')(_0x2ac12e),'color':_0x51a26a(0x1c5),'spinner':_0x51a26a(0x1d6)});}export function toolActivity(_0xa4bb88,_0xb8e11){const _0x3f4316=a12_0xe9dbf,_0x4a590f={'create_file':_0x3f4316(0x1c9),'read_file':_0x3f4316(0x1e3),'edit_file':_0x3f4316(0x1ad),'list_directory':_0x3f4316(0x1dd),'search_file':_0x3f4316(0x1c4),'find_files':'Finding','search_directory':'Searching','run_command':_0x3f4316(0x1b1)},_0x4b6a28=_0x4a590f[_0xa4bb88]||_0xa4bb88;let _0x590cf5='';if(_0xa4bb88==='run_command'&&_0xb8e11[_0x3f4316(0x1d0)])_0x590cf5=_0xb8e11[_0x3f4316(0x1d0)][_0x3f4316(0x1e2)](0x0,0x32);else{if(_0xb8e11[_0x3f4316(0x1b9)])_0x590cf5=_0xb8e11[_0x3f4316(0x1b9)];else _0xb8e11[_0x3f4316(0x1c1)]&&(_0x590cf5='\x22'+_0xb8e11[_0x3f4316(0x1c1)]+'\x22');}process[_0x3f4316(0x1cc)][_0x3f4316(0x1bf)](a12_0x56616a[_0x3f4316(0x1b7)]('\x20\x20'+_0x4b6a28+'\x20'+_0x590cf5+'\x0a'));}export function commandOutput(_0x18e531){const _0x300de6=a12_0xe9dbf,_0x45e54f=_0x18e531[_0x300de6(0x1c7)]('\x0a');_0x45e54f[_0x300de6(0x1bd)](_0x4c393b=>{const _0x29b50a=_0x300de6;_0x4c393b['trim']()&&process['stdout'][_0x29b50a(0x1bf)](a12_0x56616a[_0x29b50a(0x1b7)](_0x29b50a(0x1c2))+a12_0x56616a[_0x29b50a(0x1b7)](_0x4c393b)+'\x0a');});}export function usageBox(_0x56d5ba,_0x4880b8,_0x506c32){const _0x292940=a12_0xe9dbf,_0x45df16=_0x4880b8>0x0?Math[_0x292940(0x1b3)](Math[_0x292940(0x19f)](_0x56d5ba/_0x4880b8*0x64),0x64):0x0,_0x2ed824=0x1e,_0x4d45ba=Math[_0x292940(0x19f)](_0x45df16/0x64*_0x2ed824),_0x131e10=_0x2ed824-_0x4d45ba,_0x6f2307=_0x506c32?a12_0x56616a[_0x292940(0x1c8)]:_0x45df16>0x50?a12_0x56616a[_0x292940(0x1e6)]:a12_0x56616a[_0x292940(0x1d4)],_0x2088b2=_0x6f2307('█'[_0x292940(0x1d1)](_0x4d45ba))+a12_0x56616a[_0x292940(0x1b7)]('░'[_0x292940(0x1d1)](_0x131e10)),_0xc06207=_0x4880b8>=0x3b9ac9ff?'Unlimited':_0x4880b8[_0x292940(0x1e0)](),_0x278b73=_0x56d5ba[_0x292940(0x1e0)]()+_0x292940(0x19b)+_0xc06207+_0x292940(0x1a1);process[_0x292940(0x1cc)][_0x292940(0x1bf)]('\x0a'),process[_0x292940(0x1cc)]['write'](a12_0x56616a[_0x292940(0x1dc)][_0x292940(0x1ce)](_0x292940(0x1bc))(_0x292940(0x1cf))),process[_0x292940(0x1cc)][_0x292940(0x1bf)]('\x20\x20'+_0x2088b2+'\x20'+a12_0x56616a[_0x292940(0x1b7)](_0x45df16+'%')+'\x0a'),process['stdout'][_0x292940(0x1bf)](a12_0x56616a['dim']('\x20\x20'+_0x278b73+'\x0a')),_0x506c32&&process[_0x292940(0x1cc)][_0x292940(0x1bf)](a12_0x56616a[_0x292940(0x1c8)]('\x20\x20Limit\x20Reached\x0a')),process[_0x292940(0x1cc)]['write']('\x0a');}export function mcpConnected(_0x389586,_0x34c5d0){const _0x425a40=a12_0xe9dbf,_0x1ccfae=_0x389586===0x1?_0x425a40(0x1a3):_0x425a40(0x1cb);process['stdout'][_0x425a40(0x1bf)](a12_0x56616a[_0x425a40(0x1b7)]('\x20\x20'+a12_0x56616a['hex']('#3b82f6')(_0x389586[_0x425a40(0x1af)]())+'\x20MCP\x20'+_0x1ccfae+_0x425a40(0x1b0)+_0x34c5d0+'\x20tools)\x0a'));}export function elapsedTime(_0xa1365e){const _0xf92d93=a12_0xe9dbf,_0x54ab87=_0xa1365e<0x3c?_0xa1365e['toFixed'](0x1)+'s':Math[_0xf92d93(0x19d)](_0xa1365e/0x3c)+'m\x20'+(_0xa1365e%0x3c)['toFixed'](0x0)+'s';process[_0xf92d93(0x1cc)][_0xf92d93(0x1bf)](a12_0x56616a[_0xf92d93(0x1b7)]('\x20\x20Done\x20in\x20'+_0x54ab87+'\x0a'));}export function currentDir(_0xa76d9){const _0x473972=a12_0xe9dbf;process[_0x473972(0x1cc)][_0x473972(0x1bf)](a12_0x56616a[_0x473972(0x1b7)](_0x473972(0x1d3))+a12_0x56616a[_0x473972(0x1ce)](_0x473972(0x1bc))(_0xa76d9)+'\x0a');}
|
package/dist/ui/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4ef4d3,_0x1af5fa){const _0x46a29a=a13_0x2d38,_0x9284a8=_0x4ef4d3();while(!![]){try{const _0x39c217=-parseInt(_0x46a29a(0x17c))/0x1+-parseInt(_0x46a29a(0x179))/0x2+parseInt(_0x46a29a(0x177))/0x3+parseInt(_0x46a29a(0x175))/0x4+-parseInt(_0x46a29a(0x171))/0x5+-parseInt(_0x46a29a(0x174))/0x6*(parseInt(_0x46a29a(0x173))/0x7)+parseInt(_0x46a29a(0x17b))/0x8;if(_0x39c217===_0x1af5fa)break;else _0x9284a8['push'](_0x9284a8['shift']());}catch(_0x2ae4ed){_0x9284a8['push'](_0x9284a8['shift']());}}}(a13_0x20be,0xe9e0d));import{select}from'@inquirer/prompts';function a13_0x20be(){const _0x5b1ce7=['Select\x20AI\x20Model','41486288PaeBLz','66527nvzHlk','map','7038005DtPqeW','description','581AAdNaH','127698nUKggn','1357988NtzkeB','\x20(current)','595572TuLIsy','name','3050450aCGfwo'];a13_0x20be=function(){return _0x5b1ce7;};return a13_0x20be();}import{MODELS}from'../config/settings.js';import{getSelectedModel,setSelectedModel}from'../utils/storage.js';export async function selectModel(){const _0x3478dc=a13_0x2d38,_0x194b82=getSelectedModel(),_0x342e04=MODELS[_0x3478dc(0x17d)](_0x7a03ac=>({'name':''+_0x7a03ac[_0x3478dc(0x178)]+(_0x7a03ac['id']===_0x194b82?_0x3478dc(0x176):''),'value':_0x7a03ac['id'],'description':_0x7a03ac[_0x3478dc(0x172)]})),_0x4bd600=await select({'message':_0x3478dc(0x17a),'choices':_0x342e04,'default':_0x194b82});return setSelectedModel(_0x4bd600),_0x4bd600;}function a13_0x2d38(_0x3021c9,_0x145b07){_0x3021c9=_0x3021c9-0x171;const _0x20be26=a13_0x20be();let _0x2d38ae=_0x20be26[_0x3021c9];return _0x2d38ae;}export{getSelectedModel,setSelectedModel};
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface ToolCall {
|
|
|
10
10
|
name: string;
|
|
11
11
|
arguments: Record<string, unknown>;
|
|
12
12
|
}
|
|
13
|
-
export declare function sendChatMessage(model: string, messages: ChatMessage[], onChunk?: (chunk: string) => void): Promise<ChatResponse>;
|
|
13
|
+
export declare function sendChatMessage(model: string, messages: ChatMessage[], onChunk?: (chunk: string) => void, signal?: AbortSignal): Promise<ChatResponse>;
|
|
14
14
|
export declare function checkAuth(): Promise<boolean>;
|
|
15
15
|
export interface UserUsage {
|
|
16
16
|
tokensUsed: number;
|
package/dist/utils/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xead122,_0x53d247){const _0x3a82a3=a14_0x5d54,_0x8a1031=_0xead122();while(!![]){try{const _0x3ebadc=-parseInt(_0x3a82a3(0x1a3))/0x1+-parseInt(_0x3a82a3(0x1b5))/0x2+parseInt(_0x3a82a3(0x1a8))/0x3*(parseInt(_0x3a82a3(0x1b7))/0x4)+-parseInt(_0x3a82a3(0x1b9))/0x5+parseInt(_0x3a82a3(0x1bb))/0x6*(-parseInt(_0x3a82a3(0x1ad))/0x7)+parseInt(_0x3a82a3(0x1b0))/0x8*(parseInt(_0x3a82a3(0x1c0))/0x9)+parseInt(_0x3a82a3(0x1c1))/0xa*(parseInt(_0x3a82a3(0x1c7))/0xb);if(_0x3ebadc===_0x53d247)break;else _0x8a1031['push'](_0x8a1031['shift']());}catch(_0x441d7a){_0x8a1031['push'](_0x8a1031['shift']());}}}(a14_0x2153,0x59d75));import{getApiUrl}from'../config/settings.js';function a14_0x2153(){const _0x1d04a8=['../env.woozlit','8f7d6','../../env.woozlit','hex','/api/user/usage','true','startsWith','woozlit_internal_secure_key_2026_v2_!!!','substring','stringify','aes-256-cbc','read','utf8','toString','547083cwReJe','API\x20error:\x20','digest','platform','existsSync','10275cGEibE','readFileSync','parse','https://woozlit.com','version','399WnqIVx','/api/auth/verify','body','341864BPGNPE','Not\x20authenticated.\x20Please\x20run\x20\x27woozlit\x20login\x27\x20first.','cwd','includes','random','1262828DjIoUx','map','212cNWvat','env.woozlit','3334600LtEmRg','1.1.0','70194YfpngS','json','arch','e5c','No\x20response\x20body','63CUrFOk','23995930QuIhhX','join','Bearer\x20','slice','\x20-\x20','trim','11dtmZWk','endsWith','3a2_','createDecipheriv','from','/api/chat'];a14_0x2153=function(){return _0x1d04a8;};return a14_0x2153();}import{getToken,getUser}from'./storage.js';import a14_0x4d5fd8 from'crypto';import a14_0x84aceb from'fs';function a14_0x5d54(_0x3c1a17,_0x292b26){_0x3c1a17=_0x3c1a17-0x1a1;const _0x21534b=a14_0x2153();let _0x5d54fc=_0x21534b[_0x3c1a17];return _0x5d54fc;}import a14_0x5d2b43 from'path';import{dirname}from'path';import{fileURLToPath}from'url';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getDecryptedSecret(){const _0x2f8fa3=a14_0x5d54;try{const _0x4edd6b=[a14_0x5d2b43[_0x2f8fa3(0x1c2)](__dirname,_0x2f8fa3(0x1cf)),a14_0x5d2b43[_0x2f8fa3(0x1c2)](__dirname,'../../../env.woozlit'),a14_0x5d2b43['join'](__dirname,_0x2f8fa3(0x1cd)),a14_0x5d2b43['join'](process[_0x2f8fa3(0x1b2)](),_0x2f8fa3(0x1b8))];let _0x18740b='';for(const _0x5e99ff of _0x4edd6b){if(a14_0x84aceb[_0x2f8fa3(0x1a7)](_0x5e99ff)){_0x18740b=a14_0x84aceb[_0x2f8fa3(0x1a9)](_0x5e99ff,_0x2f8fa3(0x1a1))[_0x2f8fa3(0x1c6)]();break;}}if(!_0x18740b)return reconstructSecret();const [_0x2f0992,_0x4d4eca]=_0x18740b['split'](':');if(!_0x2f0992||!_0x4d4eca)return reconstructSecret();const _0x515f81=Buffer[_0x2f8fa3(0x1cb)](_0x2f0992,_0x2f8fa3(0x1d0)),_0x5ea36c=a14_0x4d5fd8['createHash']('sha256')['update'](_0x2f8fa3(0x1d4))[_0x2f8fa3(0x1a5)](),_0x362864=a14_0x4d5fd8[_0x2f8fa3(0x1ca)](_0x2f8fa3(0x1d7),_0x5ea36c,_0x515f81);let _0x3856c4=_0x362864['update'](_0x4d4eca,_0x2f8fa3(0x1d0),_0x2f8fa3(0x1a1));return _0x3856c4+=_0x362864['final'](_0x2f8fa3(0x1a1)),_0x3856c4;}catch(_0x61683b){return reconstructSecret();}}function reconstructSecret(){const _0x20f40b=a14_0x5d54,_0x2dc945=[0x77,0x7a,0x5f,0x63,0x6c,0x69,0x5f,0x70,0x72,0x6f,0x64,0x5f][_0x20f40b(0x1b6)](_0x4fc8f0=>String['fromCharCode'](_0x4fc8f0))['join'](''),_0x12e68f=String['fromCharCode'](0x73,0x33,0x63,0x72,0x33,0x74,0x5f,0x78,0x39,0x32,0x5f),_0x152abb=(0x8*0x186a0+0x26610+0x190+0x32+0x6)[_0x20f40b(0x1a2)](0x10)+_0x20f40b(0x1be)+(0x4*0xa+0x3)[_0x20f40b(0x1a2)](0x10)+_0x20f40b(0x1c9),_0x1b9653=['s','e','c','u','r','e','_','h','a','s','h'][_0x20f40b(0x1c2)]('');return _0x2dc945+_0x12e68f+_0x20f40b(0x1ce)+_0x152abb[_0x20f40b(0x1d5)](0x5)+_0x1b9653;}export async function sendChatMessage(_0x5986ef,_0x5b1bbd,_0x29bd70,_0x1093e6){const _0x3c9ac7=a14_0x5d54,_0x56c705=getToken(),_0x113b67=getApiUrl(),{userId:_0x544a22}=getUser();if(!_0x56c705||!_0x544a22)throw new Error(_0x3c9ac7(0x1b1));const _0x3389c5='cli-'+Date['now']()+'-'+Math[_0x3c9ac7(0x1b4)]()[_0x3c9ac7(0x1a2)](0x24)[_0x3c9ac7(0x1d5)](0x2,0x9),_0x13babd=process[_0x3c9ac7(0x1a6)]+'-'+process[_0x3c9ac7(0x1bd)]+'-'+process[_0x3c9ac7(0x1ac)],_0x120899=getDecryptedSecret(),_0x4794c2=await fetch(_0x113b67+_0x3c9ac7(0x1cc),{'method':'POST','headers':{'Content-Type':'application/json','X-Woozlit-CLI':_0x3c9ac7(0x1d2),'X-Woozlit-CLI-Version':_0x3c9ac7(0x1ba),'X-Request-ID':_0x3389c5,'X-Device-Fingerprint':_0x13babd,'Authorization':_0x3c9ac7(0x1c3)+_0x56c705,'X-Woozlit-Token':'Bearer\x20'+_0x56c705,'Origin':_0x3c9ac7(0x1ab),'X-Woozlit-App-Secret':_0x120899},'body':JSON[_0x3c9ac7(0x1d6)]({'model':_0x5986ef,'messages':_0x5b1bbd,'stream':!![],'userId':_0x544a22}),'signal':_0x1093e6});if(!_0x4794c2['ok']){const _0x24027f=await _0x4794c2['text']();throw new Error(_0x3c9ac7(0x1a4)+_0x4794c2['status']+_0x3c9ac7(0x1c5)+_0x24027f);}if(!_0x4794c2[_0x3c9ac7(0x1af)])throw new Error(_0x3c9ac7(0x1bf));const _0x1bda84=_0x4794c2[_0x3c9ac7(0x1af)]['getReader'](),_0x4fe9a8=new TextDecoder();let _0x84b439='';const _0x115a46=[];while(!![]){const {done:_0x94f452,value:_0xf76386}=await _0x1bda84[_0x3c9ac7(0x1d8)]();if(_0x94f452)break;const _0x13d4df=_0x4fe9a8['decode'](_0xf76386,{'stream':!![]});if(_0x13d4df[_0x3c9ac7(0x1b3)]('0:')){const _0x555b9e=_0x13d4df['split']('\x0a');for(const _0x386acc of _0x555b9e){if(_0x386acc[_0x3c9ac7(0x1d3)]('0:')){const _0x26a875=_0x386acc[_0x3c9ac7(0x1c4)](0x2)[_0x3c9ac7(0x1c6)]();if(_0x26a875[_0x3c9ac7(0x1d3)]('\x22')&&_0x26a875[_0x3c9ac7(0x1c8)]('\x22'))try{const _0x4d9f7e=JSON[_0x3c9ac7(0x1aa)](_0x26a875);_0x84b439+=_0x4d9f7e;if(_0x29bd70)_0x29bd70(_0x4d9f7e);}catch{}}}}else{_0x84b439+=_0x13d4df;if(_0x29bd70)_0x29bd70(_0x13d4df);}}return{'content':_0x84b439,'toolCalls':_0x115a46};}export async function checkAuth(){const _0x3e3070=a14_0x5d54,_0x132112=getToken();if(!_0x132112)return![];try{const _0x1ded0c=getApiUrl(),_0x4c7ca1=await fetch(_0x1ded0c+_0x3e3070(0x1ae),{'headers':{'Authorization':_0x3e3070(0x1c3)+_0x132112}});return _0x4c7ca1['ok'];}catch{return![];}}export async function getUserUsage(){const _0x1da1c4=a14_0x5d54,_0x5a560f=getToken();if(!_0x5a560f)return null;try{const _0x3114b5=getApiUrl(),_0x4c8d44=await fetch(_0x3114b5+_0x1da1c4(0x1d1),{'headers':{'Authorization':_0x1da1c4(0x1c3)+_0x5a560f}});if(!_0x4c8d44['ok'])return null;return await _0x4c8d44[_0x1da1c4(0x1bc)]();}catch(_0x374548){return null;}}
|
package/dist/utils/history.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x555ae2=a15_0x4e22;(function(_0x7b22ec,_0x42922d){const _0x32b614=a15_0x4e22,_0xf21b34=_0x7b22ec();while(!![]){try{const _0x424e46=parseInt(_0x32b614(0xd2))/0x1*(-parseInt(_0x32b614(0xd3))/0x2)+-parseInt(_0x32b614(0xce))/0x3+parseInt(_0x32b614(0xcf))/0x4*(parseInt(_0x32b614(0xc5))/0x5)+-parseInt(_0x32b614(0xcc))/0x6+-parseInt(_0x32b614(0xc0))/0x7*(parseInt(_0x32b614(0xcd))/0x8)+parseInt(_0x32b614(0xc1))/0x9*(-parseInt(_0x32b614(0xcb))/0xa)+parseInt(_0x32b614(0xc3))/0xb;if(_0x424e46===_0x42922d)break;else _0xf21b34['push'](_0xf21b34['shift']());}catch(_0x585b18){_0xf21b34['push'](_0xf21b34['shift']());}}}(a15_0x44a1,0x5c00c));import a15_0x4d5ee8 from'conf';const WEEK_MS=0x7*0x18*0x3c*0x3c*0x3e8,config=new a15_0x4d5ee8({'projectName':'woozlit-cli-history','defaults':{'entries':[],'lastCleanup':Date[a15_0x555ae2(0xc7)]()}});function a15_0x44a1(){const _0x56b8b9=['3228392DJgZVB','212799uTmwtV','2031604TqLIJR','lastCleanup','get','1VexhmM','816034UvmXVi','message','7rodeby','3654NYFXSH','set','17231632gngghn','push','5XhJdba','filter','now','length','timestamp','entries','4060sZnpmg','3901404QcuAxE'];a15_0x44a1=function(){return _0x56b8b9;};return a15_0x44a1();}function cleanup(){const _0x4d2024=a15_0x555ae2,_0x1dd19f=Date[_0x4d2024(0xc7)](),_0x165a28=config[_0x4d2024(0xd1)](_0x4d2024(0xd0));if(_0x1dd19f-_0x165a28<0x18*0x3c*0x3c*0x3e8)return;const _0x17114b=config[_0x4d2024(0xd1)](_0x4d2024(0xca)),_0x1841d3=_0x17114b[_0x4d2024(0xc6)](_0x3edda5=>_0x1dd19f-_0x3edda5[_0x4d2024(0xc9)]<WEEK_MS);config['set'](_0x4d2024(0xca),_0x1841d3),config['set'](_0x4d2024(0xd0),_0x1dd19f);}export function addToHistory(_0x470b25){const _0x34ac92=a15_0x555ae2;cleanup();const _0x58d23f=config[_0x34ac92(0xd1)](_0x34ac92(0xca));_0x58d23f[_0x34ac92(0xc4)]({'message':_0x470b25,'timestamp':Date[_0x34ac92(0xc7)]()});if(_0x58d23f[_0x34ac92(0xc8)]>0x64)_0x58d23f['shift']();config[_0x34ac92(0xc2)](_0x34ac92(0xca),_0x58d23f);}export function getHistory(){const _0x59b150=a15_0x555ae2;return cleanup(),config[_0x59b150(0xd1)](_0x59b150(0xca))['map'](_0x2b97cd=>_0x2b97cd[_0x59b150(0xbf)]);}function a15_0x4e22(_0x1d4986,_0x95a52b){_0x1d4986=_0x1d4986-0xbf;const _0x44a1f3=a15_0x44a1();let _0x4e22f8=_0x44a1f3[_0x1d4986];return _0x4e22f8;}export function clearHistory(){const _0x4c4294=a15_0x555ae2;config['set'](_0x4c4294(0xca),[]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x120131=a16_0x4faa;(function(_0x5a95c5,_0x4ad4a6){const _0x3e886f=a16_0x4faa,_0x27d87b=_0x5a95c5();while(!![]){try{const _0x11066d=parseInt(_0x3e886f(0x148))/0x1+parseInt(_0x3e886f(0x146))/0x2*(-parseInt(_0x3e886f(0x16e))/0x3)+parseInt(_0x3e886f(0x142))/0x4+parseInt(_0x3e886f(0x13e))/0x5+parseInt(_0x3e886f(0x178))/0x6+-parseInt(_0x3e886f(0x161))/0x7+parseInt(_0x3e886f(0x14a))/0x8*(parseInt(_0x3e886f(0x149))/0x9);if(_0x11066d===_0x4ad4a6)break;else _0x27d87b['push'](_0x27d87b['shift']());}catch(_0x4f8c21){_0x27d87b['push'](_0x27d87b['shift']());}}}(a16_0x5d1a,0xf000b));import{execSync}from'child_process';function a16_0x5d1a(){const _0x255999=['info','build','8419518Tysfqb','npm','string','package.json','utf-8','join','\x20run\x20build','Building\x20project...','main','9455810CRpbbk','yarn\x20install','chrome','...','939964lahepq','Unknown\x20installation\x20source.\x20Please\x20provide\x20a\x20GitHub\x20URL\x20or\x20\x27mcp-chrome-bridge\x27.','tsx','yarn','330384EcsyTx','split','31177qtyDOv','1942254KmhWlG','32ZBHnmn','git\x20clone\x20','mcp-chrome-bridge','github.com','homedir','error','keys','mkdirSync','\x20to\x20','includes','git\x20pull','length','success','\x20already\x20exists.\x20Updating...','dist/index.js','Could\x20not\x20auto-detect\x20entry\x20point.\x20Please\x20add\x20the\x20server\x20manually\x20using\x20\x27woozlit\x20mcp\x20add\x27.','object','Successfully\x20installed\x20and\x20added\x20\x27','inherit','Failed\x20to\x20install/build:\x20','4.\x20Make\x20sure\x20\x27mcp-chrome-bridge\x27\x20is\x20running\x20(if\x20not\x20started\x20automatically)','1.\x20Download\x20the\x20Chrome\x20Extension:\x20https://github.com/hangwin/mcp-chrome/releases','.git','13678196uYvOMx','Failed\x20to\x20clone\x20repository:\x20','pnpm-lock.yaml','slice','existsSync','.woozlit','readFileSync','endsWith','Failed\x20to\x20install\x20mcp-chrome-bridge\x20using\x20pnpm:\x20','parse','Try\x20running\x20with\x20sudo\x20or\x20administrative\x20privileges.','scripts','src/index.ts','27YCQwrI','yarn.lock','index.js','bin','\x27\x20from\x20GitHub!','Directory\x20','pnpm\x20install','3.\x20Click\x20extension\x20icon\x20and\x20\x27Connect\x27'];a16_0x5d1a=function(){return _0x255999;};return a16_0x5d1a();}import a16_0x32da96 from'path';import a16_0x42ce8e from'fs';import a16_0x17964b from'os';import*as a16_0x5b3781 from'../ui/output.js';function a16_0x4faa(_0x1cae60,_0x103267){_0x1cae60=_0x1cae60-0x13e;const _0x5d1a59=a16_0x5d1a();let _0x4faaa6=_0x5d1a59[_0x1cae60];return _0x4faaa6;}import{addMcpServer,addMcpHttpServer}from'../config/mcp.js';const SERVERS_DIR=a16_0x32da96[a16_0x120131(0x17d)](a16_0x17964b[a16_0x120131(0x14e)](),a16_0x120131(0x166),'servers');function ensureServersDir(){const _0x2479e4=a16_0x120131;!a16_0x42ce8e['existsSync'](SERVERS_DIR)&&a16_0x42ce8e[_0x2479e4(0x151)](SERVERS_DIR,{'recursive':!![]});}function getRepoName(_0x3784c3){const _0x4ae6f4=a16_0x120131,_0x3639ca=_0x3784c3[_0x4ae6f4(0x147)]('/');let _0x1b3a9e=_0x3639ca[_0x3639ca[_0x4ae6f4(0x155)]-0x1];return _0x1b3a9e[_0x4ae6f4(0x168)](_0x4ae6f4(0x160))&&(_0x1b3a9e=_0x1b3a9e[_0x4ae6f4(0x164)](0x0,-0x4)),_0x1b3a9e;}async function installFromGithub(_0x5babac,_0x4fc475){const _0x154add=a16_0x120131;ensureServersDir();const _0x4501de=_0x4fc475||getRepoName(_0x5babac),_0x28e4ec=a16_0x32da96[_0x154add(0x17d)](SERVERS_DIR,_0x4501de);a16_0x5b3781[_0x154add(0x176)]('Cloning\x20'+_0x5babac+_0x154add(0x152)+_0x28e4ec+_0x154add(0x141));if(a16_0x42ce8e[_0x154add(0x165)](_0x28e4ec)){a16_0x5b3781['warn'](_0x154add(0x173)+_0x28e4ec+_0x154add(0x157));try{execSync(_0x154add(0x154),{'cwd':_0x28e4ec,'stdio':_0x154add(0x15c)});}catch(_0x5f4bc1){a16_0x5b3781[_0x154add(0x14f)]('Failed\x20to\x20update\x20repo.\x20Try\x20checking\x20it\x20out\x20manually\x20or\x20deleting\x20the\x20folder.');return;}}else try{execSync(_0x154add(0x14b)+_0x5babac+'\x20'+_0x28e4ec,{'stdio':_0x154add(0x15c)});}catch(_0x3c1409){a16_0x5b3781['error'](_0x154add(0x162)+_0x3c1409);return;}a16_0x5b3781['info']('Installing\x20dependencies...');try{const _0x39b1ea=a16_0x42ce8e[_0x154add(0x165)](a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x154add(0x163))),_0x46eeb4=a16_0x42ce8e['existsSync'](a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x154add(0x16f))),_0x3cb4c6=_0x39b1ea?_0x154add(0x174):_0x46eeb4?_0x154add(0x13f):'npm\x20install';execSync(_0x3cb4c6,{'cwd':_0x28e4ec,'stdio':_0x154add(0x15c)});const _0x345ff9=a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x154add(0x17b));if(a16_0x42ce8e[_0x154add(0x165)](_0x345ff9)){const _0x125aa2=JSON['parse'](a16_0x42ce8e[_0x154add(0x167)](_0x345ff9,_0x154add(0x17c)));_0x125aa2['scripts']&&_0x125aa2[_0x154add(0x16c)][_0x154add(0x177)]&&(a16_0x5b3781[_0x154add(0x176)](_0x154add(0x17f)),execSync((_0x39b1ea?'pnpm':_0x46eeb4?_0x154add(0x145):_0x154add(0x179))+_0x154add(0x17e),{'cwd':_0x28e4ec,'stdio':'inherit'}));}}catch(_0x9e3c52){a16_0x5b3781['error'](_0x154add(0x15d)+_0x9e3c52);return;}const _0x4b484e=a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x154add(0x17b));let _0xa1369a='';if(a16_0x42ce8e[_0x154add(0x165)](_0x4b484e)){const _0x4b4c76=JSON[_0x154add(0x16a)](a16_0x42ce8e[_0x154add(0x167)](_0x4b484e,_0x154add(0x17c)));if(_0x4b4c76[_0x154add(0x171)]){if(typeof _0x4b4c76[_0x154add(0x171)]===_0x154add(0x17a))_0xa1369a=a16_0x32da96['join'](_0x28e4ec,_0x4b4c76[_0x154add(0x171)]);else{if(typeof _0x4b4c76['bin']===_0x154add(0x15a)){const _0xcc8f9b=Object[_0x154add(0x150)](_0x4b4c76[_0x154add(0x171)])[0x0];_0xa1369a=a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x4b4c76['bin'][_0xcc8f9b]);}}}else _0x4b4c76[_0x154add(0x180)]&&(_0xa1369a=a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x4b4c76[_0x154add(0x180)]));}if(!_0xa1369a){const _0xdf0f94=[_0x154add(0x158),'build/index.js',_0x154add(0x16d),_0x154add(0x170)];for(const _0x55673c of _0xdf0f94){if(a16_0x42ce8e[_0x154add(0x165)](a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x55673c))){_0xa1369a=a16_0x32da96[_0x154add(0x17d)](_0x28e4ec,_0x55673c);break;}}}if(!_0xa1369a){a16_0x5b3781[_0x154add(0x14f)](_0x154add(0x159));return;}const _0x2b09f5=_0xa1369a[_0x154add(0x168)]('.ts')?_0x154add(0x144):'node';a16_0x5b3781[_0x154add(0x176)]('Detected\x20entry\x20point:\x20'+_0xa1369a),addMcpServer(_0x4501de,_0x2b09f5,[_0xa1369a]),a16_0x5b3781[_0x154add(0x156)](_0x154add(0x15b)+_0x4501de+_0x154add(0x172));}async function installMcpChromeBridge(){const _0x193c39=a16_0x120131;a16_0x5b3781[_0x193c39(0x176)]('Installing\x20mcp-chrome-bridge\x20globally...');try{execSync('pnpm\x20add\x20-g\x20mcp-chrome-bridge',{'stdio':'inherit'});}catch(_0x214f82){a16_0x5b3781[_0x193c39(0x14f)](_0x193c39(0x169)+_0x214f82),a16_0x5b3781[_0x193c39(0x176)]('Trying\x20npm\x20as\x20fallback...');try{execSync('npm\x20install\x20-g\x20mcp-chrome-bridge',{'stdio':_0x193c39(0x15c)});}catch(_0x203b19){a16_0x5b3781['error']('Failed\x20to\x20install\x20mcp-chrome-bridge:\x20'+_0x203b19),a16_0x5b3781[_0x193c39(0x176)](_0x193c39(0x16b));return;}}const _0x500c1e='http://127.0.0.1:12306/mcp';addMcpHttpServer('mcp-chrome',_0x500c1e),a16_0x5b3781[_0x193c39(0x156)]('Installed\x20mcp-chrome-bridge\x20and\x20added\x20configuration!'),a16_0x5b3781['header']('Next\x20Steps:'),a16_0x5b3781['info'](_0x193c39(0x15f)),a16_0x5b3781[_0x193c39(0x176)]('2.\x20Load\x20unpacked\x20extension\x20in\x20Chrome\x20Developer\x20Mode'),a16_0x5b3781[_0x193c39(0x176)](_0x193c39(0x175)),a16_0x5b3781[_0x193c39(0x176)](_0x193c39(0x15e));}export async function installMcpServer(_0xdabadd,_0x4864f0){const _0x4b165e=a16_0x120131;if(_0xdabadd===_0x4b165e(0x14c)||_0xdabadd===_0x4b165e(0x140))return installMcpChromeBridge();if(_0xdabadd[_0x4b165e(0x153)](_0x4b165e(0x14d))||_0xdabadd[_0x4b165e(0x168)](_0x4b165e(0x160)))return installFromGithub(_0xdabadd,_0x4864f0);if(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/['test'](_0xdabadd))return installFromGithub('https://github.com/'+_0xdabadd+'.git',_0x4864f0);a16_0x5b3781[_0x4b165e(0x14f)](_0x4b165e(0x143));}
|
package/dist/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x121c24=a17_0x4e21;(function(_0x23c86d,_0x58100a){const _0x3a90e5=a17_0x4e21,_0x173ed5=_0x23c86d();while(!![]){try{const _0x28728c=parseInt(_0x3a90e5(0x95))/0x1*(-parseInt(_0x3a90e5(0xa1))/0x2)+-parseInt(_0x3a90e5(0x8f))/0x3*(-parseInt(_0x3a90e5(0x92))/0x4)+parseInt(_0x3a90e5(0xa0))/0x5+parseInt(_0x3a90e5(0x98))/0x6*(-parseInt(_0x3a90e5(0x8d))/0x7)+-parseInt(_0x3a90e5(0x97))/0x8*(parseInt(_0x3a90e5(0x96))/0x9)+-parseInt(_0x3a90e5(0x99))/0xa*(-parseInt(_0x3a90e5(0x90))/0xb)+parseInt(_0x3a90e5(0x9b))/0xc;if(_0x28728c===_0x58100a)break;else _0x173ed5['push'](_0x173ed5['shift']());}catch(_0x11edc6){_0x173ed5['push'](_0x173ed5['shift']());}}}(a17_0x1a99,0x6b9d6));const platform=process['platform'],arch=process[a17_0x121c24(0x9e)];export function getPlatform(){const _0x5c9f26=a17_0x121c24;if(platform==='win32')return _0x5c9f26(0x93);if(platform===_0x5c9f26(0x9f))return _0x5c9f26(0x8e);return'linux';}function a17_0x4e21(_0xe04d24,_0x3dd7ad){_0xe04d24=_0xe04d24-0x8d;const _0x1a9950=a17_0x1a99();let _0x4e210d=_0x1a9950[_0xe04d24];return _0x4e210d;}export function getArch(){return arch;}export function isWindows(){const _0x2580bc=a17_0x121c24;return platform===_0x2580bc(0x9a);}export function isMac(){const _0x4e8d13=a17_0x121c24;return platform===_0x4e8d13(0x9f);}export function isLinux(){const _0x11d873=a17_0x121c24;return platform===_0x11d873(0x94);}export function getShellPrefix(){const _0x1f5b4d=a17_0x121c24;return isWindows()?'':_0x1f5b4d(0x91);}function a17_0x1a99(){const _0x35ef87=['macos','3MxbMKp','1972817KLJjvf','sudo\x20','2308676lGmlwe','windows','linux','24026zGHcMV','2070ZetQjP','28472sitsFk','54RQnxBu','10YQdMwv','win32','9750780CfcaeP','macOS','Windows','arch','darwin','1623110UQgIQE','2QQCwkJ','474691fiuOGi'];a17_0x1a99=function(){return _0x35ef87;};return a17_0x1a99();}export function getPlatformInfo(){const _0x1ed593=a17_0x121c24,_0x36af03=getPlatform(),_0x587a4b=_0x36af03===_0x1ed593(0x93)?_0x1ed593(0x9d):_0x36af03===_0x1ed593(0x8e)?_0x1ed593(0x9c):'Linux';return _0x587a4b+'\x20('+arch+')';}
|
package/dist/utils/storage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a18_0x41fade=a18_0x237d;(function(_0x5a3a7f,_0x5ed42f){const _0x3b837=a18_0x237d,_0x341176=_0x5a3a7f();while(!![]){try{const _0x1beca6=-parseInt(_0x3b837(0x1ff))/0x1*(-parseInt(_0x3b837(0x200))/0x2)+-parseInt(_0x3b837(0x1f3))/0x3+parseInt(_0x3b837(0x1f9))/0x4*(-parseInt(_0x3b837(0x1ed))/0x5)+-parseInt(_0x3b837(0x1f5))/0x6+parseInt(_0x3b837(0x201))/0x7*(-parseInt(_0x3b837(0x1ec))/0x8)+-parseInt(_0x3b837(0x1fa))/0x9+parseInt(_0x3b837(0x1ee))/0xa;if(_0x1beca6===_0x5ed42f)break;else _0x341176['push'](_0x341176['shift']());}catch(_0x545025){_0x341176['push'](_0x341176['shift']());}}}(a18_0x36fc,0xe2975));import a18_0x2d122c from'conf';const config=new a18_0x2d122c({'projectName':a18_0x41fade(0x1fe)});export function getToken(){const _0x3b7677=a18_0x41fade;return config['get'](_0x3b7677(0x1f8));}export function setToken(_0x679886){const _0x569ed1=a18_0x41fade;config[_0x569ed1(0x1ef)](_0x569ed1(0x1f8),_0x679886);}export function clearToken(){const _0x410500=a18_0x41fade;config[_0x410500(0x1fc)]('token');}export function getUser(){const _0x382021=a18_0x41fade;return{'userId':config[_0x382021(0x1f7)](_0x382021(0x1f6)),'email':config['get'](_0x382021(0x1f2)),'displayName':config['get'](_0x382021(0x1f1))};}export function setUser(_0x3d3ff6,_0x7ab8bb,_0x4ae71d){const _0xc6c3bd=a18_0x41fade;config['set'](_0xc6c3bd(0x1f6),_0x3d3ff6),config[_0xc6c3bd(0x1ef)](_0xc6c3bd(0x1f2),_0x7ab8bb),config[_0xc6c3bd(0x1ef)](_0xc6c3bd(0x1f1),_0x4ae71d);}export function clearUser(){const _0x3546f5=a18_0x41fade;config['delete'](_0x3546f5(0x1f6)),config[_0x3546f5(0x1fc)]('email'),config[_0x3546f5(0x1fc)]('displayName');}function a18_0x237d(_0x48e5d2,_0x4479da){_0x48e5d2=_0x48e5d2-0x1ec;const _0x36fc69=a18_0x36fc();let _0x237d06=_0x36fc69[_0x48e5d2];return _0x237d06;}function a18_0x36fc(){const _0x2a8775=['set','rules','displayName','email','2813226hioReI','push','3347118YATFwV','userId','get','token','32856jMspBS','7576002AhnZcd','xiaomi/mimo-v2-flash:free','delete','selectedModel','woozlit-cli','1657wxQoNo','970fzuoCI','1036JnUsGj','15744CNAqup','1095fykcIJ','45519750daUWAC'];a18_0x36fc=function(){return _0x2a8775;};return a18_0x36fc();}export function getSelectedModel(){const _0x2800a9=a18_0x41fade;return config[_0x2800a9(0x1f7)](_0x2800a9(0x1fd))||_0x2800a9(0x1fb);}export function setSelectedModel(_0x5101e1){config['set']('selectedModel',_0x5101e1);}export function getRules(){const _0x457beb=a18_0x41fade;return config[_0x457beb(0x1f7)](_0x457beb(0x1f0))||[];}export function addRule(_0x483612){const _0x3e9d29=a18_0x41fade,_0x2e36ac=getRules();_0x2e36ac[_0x3e9d29(0x1f4)](_0x483612),config['set'](_0x3e9d29(0x1f0),_0x2e36ac);}export function clearRules(){const _0x539aa8=a18_0x41fade;config[_0x539aa8(0x1ef)](_0x539aa8(0x1f0),[]);}export function isLoggedIn(){const _0x5767ba=a18_0x41fade;return!!config[_0x5767ba(0x1f7)](_0x5767ba(0x1f8))&&!!config[_0x5767ba(0x1f7)](_0x5767ba(0x1f6));}export function logout(){clearToken(),clearUser();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a19_0x50fb(_0x5bf712,_0x23b31f){_0x5bf712=_0x5bf712-0x11e;const _0x3c0f81=a19_0x3c0f();let _0x50fb24=_0x3c0f81[_0x5bf712];return _0x50fb24;}const a19_0x18a17e=a19_0x50fb;(function(_0x130cbe,_0x5a9442){const _0x900f2b=a19_0x50fb,_0x49fac5=_0x130cbe();while(!![]){try{const _0x538054=-parseInt(_0x900f2b(0x137))/0x1*(parseInt(_0x900f2b(0x13b))/0x2)+parseInt(_0x900f2b(0x123))/0x3+-parseInt(_0x900f2b(0x135))/0x4+-parseInt(_0x900f2b(0x132))/0x5+parseInt(_0x900f2b(0x127))/0x6+parseInt(_0x900f2b(0x133))/0x7*(parseInt(_0x900f2b(0x128))/0x8)+-parseInt(_0x900f2b(0x11e))/0x9;if(_0x538054===_0x5a9442)break;else _0x49fac5['push'](_0x49fac5['shift']());}catch(_0x2ffbcc){_0x49fac5['push'](_0x49fac5['shift']());}}}(a19_0x3c0f,0x69278));import a19_0x3c46ac from'chalk';const CURRENT_VERSION=a19_0x18a17e(0x120);function a19_0x3c0f(){const _0x39c3d9=['\x20\x20Please\x20restart\x20the\x20CLI\x20to\x20use\x20the\x20new\x20version.','gray','red','split','inherit','1294005ZjKqgn','4524681HFfUsP','\x20\x20Auto-updating\x20to\x20version\x20','1564748OorEqI','latest','431861zkevpg','\x20\x20Failed\x20to\x20auto-update.\x20Please\x20run:\x20npm\x20install\x20-g\x20woozlit','https://registry.npmjs.org/woozlit','log','2YGgJZw','exit','\x20→\x20','3297456xJyxRl','green','1.1.3','\x20\x20Update\x20Available!\x20','repeat','2305218WXgDwW','json','timeout','map','2784936wSlieo','8ZgKtTt','dim','error','application/json','yellow'];a19_0x3c0f=function(){return _0x39c3d9;};return a19_0x3c0f();}export async function checkForUpdate(){const _0x51007a=a19_0x18a17e;try{const _0x356bdf=await fetch(_0x51007a(0x139),{'headers':{'Accept':_0x51007a(0x12b)},'signal':AbortSignal[_0x51007a(0x125)](0x5dc)});if(!_0x356bdf['ok'])return;const _0x372fc1=await _0x356bdf[_0x51007a(0x124)](),_0x502927=_0x372fc1['dist-tags']?.[_0x51007a(0x136)];_0x502927&&_0x502927!==CURRENT_VERSION&&(isNewer(_0x502927,CURRENT_VERSION)&&printUpdateBox(_0x502927,CURRENT_VERSION));}catch{}}function isNewer(_0x2fc6c4,_0x2d479f){const _0x327d6d=a19_0x18a17e,_0x2e49c3=_0x2fc6c4[_0x327d6d(0x130)]('.')[_0x327d6d(0x126)](Number),_0x37f4eb=_0x2d479f['split']('.')[_0x327d6d(0x126)](Number);for(let _0x38f59c=0x0;_0x38f59c<0x3;_0x38f59c++){if(_0x2e49c3[_0x38f59c]>_0x37f4eb[_0x38f59c])return!![];if(_0x2e49c3[_0x38f59c]<_0x37f4eb[_0x38f59c])return![];}return![];}function printUpdateBox(_0x22f003,_0x40d89e){const _0xf01c38=a19_0x18a17e,_0x157ea2=a19_0x3c46ac[_0xf01c38(0x12c)]('─'[_0xf01c38(0x122)](0x32));console['log'](),console['log'](_0x157ea2),console[_0xf01c38(0x13a)](a19_0x3c46ac[_0xf01c38(0x12c)](_0xf01c38(0x121)+a19_0x3c46ac[_0xf01c38(0x129)](_0x40d89e)+_0xf01c38(0x13d)+a19_0x3c46ac['green'](_0x22f003))),console[_0xf01c38(0x13a)](a19_0x3c46ac[_0xf01c38(0x12e)](_0xf01c38(0x134)+_0x22f003+'...')),console[_0xf01c38(0x13a)](_0x157ea2),console[_0xf01c38(0x13a)]();try{const {execSync:_0x4ebb80}=require('child_process');_0x4ebb80('npm\x20install\x20-g\x20woozlit',{'stdio':_0xf01c38(0x131)}),console[_0xf01c38(0x13a)](),console[_0xf01c38(0x13a)](a19_0x3c46ac[_0xf01c38(0x11f)]('\x20\x20✔\x20Woozlit\x20updated\x20successfully!')),console[_0xf01c38(0x13a)](a19_0x3c46ac[_0xf01c38(0x129)](_0xf01c38(0x12d))),console[_0xf01c38(0x13a)](),process[_0xf01c38(0x13c)](0x0);}catch(_0x250333){console[_0xf01c38(0x12a)](a19_0x3c46ac[_0xf01c38(0x12f)](_0xf01c38(0x138)));}}
|