@morphllm/morphmcp 0.8.114 → 0.8.115

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/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function a0_0x5766(_0x3640da,_0x5d444b){_0x3640da=_0x3640da-0x13a;const _0x207d05=a0_0x207d();let _0x5766f0=_0x207d05[_0x3640da];return _0x5766f0;}const a0_0x21b290=a0_0x5766;(function(_0x190bf5,_0x2d9000){const _0x31caf1=a0_0x5766,_0x38eb6d=_0x190bf5();while(!![]){try{const _0x4379cb=parseInt(_0x31caf1(0x1f6))/0x1*(-parseInt(_0x31caf1(0x1d4))/0x2)+parseInt(_0x31caf1(0x13c))/0x3+parseInt(_0x31caf1(0x1bb))/0x4*(-parseInt(_0x31caf1(0x1a0))/0x5)+-parseInt(_0x31caf1(0x1ea))/0x6*(parseInt(_0x31caf1(0x17f))/0x7)+-parseInt(_0x31caf1(0x214))/0x8*(-parseInt(_0x31caf1(0x1f3))/0x9)+-parseInt(_0x31caf1(0x19a))/0xa*(parseInt(_0x31caf1(0x163))/0xb)+parseInt(_0x31caf1(0x23b))/0xc;if(_0x4379cb===_0x2d9000)break;else _0x38eb6d['push'](_0x38eb6d['shift']());}catch(_0x1eab24){_0x38eb6d['push'](_0x38eb6d['shift']());}}}(a0_0x207d,0xc04ef));import{Server}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema,RootsListChangedNotificationSchema}from'@modelcontextprotocol/sdk/types.js';import a0_0x4a5572 from'fs/promises';import a0_0x4e5b94 from'path';import a0_0x55e164 from'os';import{createRequire}from'module';import{z}from'zod';import{zodToJsonSchema}from'zod-to-json-schema';import{getValidRootDirectories}from'./roots-utils.js';import{executeEditFile}from'@morphllm/morphsdk/tools/fastapply';import{runWarpGrep,LocalRipgrepProvider,GITHUB_SEARCH_TOOL_NAME,GITHUB_SEARCH_DESCRIPTION}from'@morphllm/morphsdk/tools/warp-grep';import{WarpGrepClient,formatResult}from'@morphllm/morphsdk/tools/warp-grep/client';import{executeCodebaseSearch}from'@morphllm/morphsdk/tools/codebase-search';import a0_0x3236a6 from'axios';function fixPathRepetition(_0x4b0b7a){const _0x19cc20=a0_0x5766,_0x1eb448=_0x4b0b7a[_0x19cc20(0x14b)](a0_0x4e5b94[_0x19cc20(0x199)])['filter'](Boolean);if(_0x1eb448[_0x19cc20(0x1b7)]<0x2)return null;for(let _0x6c6914=Math['floor'](_0x1eb448['length']/0x2);_0x6c6914>=0x1;_0x6c6914--){for(let _0x16a588=0x0;_0x16a588<=_0x1eb448['length']-0x2*_0x6c6914;_0x16a588++){const _0x59e2b4=_0x1eb448[_0x19cc20(0x1a6)](_0x16a588,_0x16a588+_0x6c6914),_0xb9d969=_0x1eb448[_0x19cc20(0x1a6)](_0x16a588+_0x6c6914,_0x16a588+0x2*_0x6c6914);if(_0x59e2b4[_0x19cc20(0x22a)]((_0x24188d,_0x54fd76)=>_0x24188d===_0xb9d969[_0x54fd76])){const _0x3dc3da=[..._0x1eb448[_0x19cc20(0x1a6)](0x0,_0x16a588),..._0x1eb448[_0x19cc20(0x1a6)](_0x16a588+_0x6c6914)];return a0_0x4e5b94['sep']+_0x3dc3da['join'](a0_0x4e5b94['sep']);}}}return null;}const require=createRequire(import.meta.url);function getPackageVersion(){const _0x3045b0=a0_0x5766;try{const _0x5293b6=require(_0x3045b0(0x21e));return _0x5293b6[_0x3045b0(0x189)]??_0x3045b0(0x201);}catch(_0x21b885){return console[_0x3045b0(0x241)](_0x3045b0(0x1e0),_0x21b885),_0x3045b0(0x201);}}function printHelp(){const _0x5da432=a0_0x5766;console[_0x5da432(0x18f)](_0x5da432(0x1ee)+getPackageVersion()),console['log']('\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]'),console[_0x5da432(0x18f)]('\x0aOptions:'),console[_0x5da432(0x18f)]('\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)'),console[_0x5da432(0x18f)]('\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit'),console['log'](_0x5da432(0x236)),console[_0x5da432(0x18f)](_0x5da432(0x1c1)),console[_0x5da432(0x18f)](_0x5da432(0x246)),console['log'](_0x5da432(0x145));}const cliArgs=process['argv'][a0_0x21b290(0x1a6)](0x2),VERSION_FLAGS=new Set([a0_0x21b290(0x15b),'-v','-V']),HELP_FLAGS=new Set([a0_0x21b290(0x179),'-h']);cliArgs[a0_0x21b290(0x230)](_0x7ae99b=>VERSION_FLAGS['has'](_0x7ae99b))&&(console['log']('@morphllm/morphmcp\x20'+getPackageVersion()),process[a0_0x21b290(0x166)](0x0));cliArgs[a0_0x21b290(0x230)](_0x16a78f=>HELP_FLAGS[a0_0x21b290(0x231)](_0x16a78f))&&(printHelp(),process['exit'](0x0));function getCliArg(_0x4b344d){const _0x35f8e1=a0_0x21b290;for(let _0xadcd8d=0x0;_0xadcd8d<cliArgs[_0x35f8e1(0x1b7)];_0xadcd8d++){const _0x1a6747=cliArgs[_0xadcd8d];if(_0x1a6747[_0x35f8e1(0x23f)]('--'+_0x4b344d+'='))return _0x1a6747[_0x35f8e1(0x1a6)](('--'+_0x4b344d+'=')[_0x35f8e1(0x1b7)]);if(_0x1a6747==='--'+_0x4b344d&&_0xadcd8d+0x1<cliArgs[_0x35f8e1(0x1b7)])return cliArgs[_0xadcd8d+0x1];}return undefined;}function a0_0x207d(){const _0x5d045e=['.vscode','❌\x20Morph\x20Edit\x20Failed:\x20','Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','Rules:\x0a','RipgrepError','some','has','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','Unknown\x20tool:\x20','-\x20Grepped\x20\x27','searchTimeMs','\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit','searchGitHub','IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a','-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','20037972ophJlZ','results','added\x20','\x20as\x20allowed\x20directory','startsWith','etimedout','error','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','package.json','user','\x0a</file>','\x20\x20morph-mcp','A\x20search\x20subagent\x20the\x20user\x20refers\x20to\x20as\x20\x27WarpGrep\x27\x20that\x20is\x20ideal\x20for\x20exploring\x20the\x20codebase\x20based\x20on\x20a\x20request.\x20','-\x20Works\x20across\x20all\x20files\x20and\x20languages\x0a\x0a','warpgrep_codebase_search','number','Note:\x20The\x20files\x20and\x20line\x20ranges\x20returned\x20by\x20this\x20tool\x20may\x20be\x20some\x20of\x20the\x20ones\x20needed\x20to\x20complete\x20the\x20user\x27s\x20request,\x20but\x20you\x20should\x20be\x20careful\x20in\x20evaluating\x20the\x20relevance\x20of\x20the\x20results,\x20since\x20the\x20subagent\x20might\x20make\x20mistakes.\x20','</file>','Unknown\x20error','\x20chars)','stack','map','linesRemoved','safeParse','FileNotFound','code','boolean','172503rVLmMu','ENABLE_WORKSPACE_MODE','.\x20Path:\x20','read','finish','warpgrep_github_search','completionId','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','trim','\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo','repoId','rerankScore','🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a','source','realpath','split','<file\x20path=\x22','%\x20match)\x0a','list_directory\x20','errors','Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a','MORPH_WARP_GREP_TIMEOUT','No\x20results\x20found\x20for\x20query:\x20\x22','-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a','morph-','morph-warp-grep-v1-1111v0','Parent\x20directory\x20does\x20not\x20exist:\x20','Morph\x20Edit\x20','messages','readFile','code_edit','--version','instruction','terminationReason','endLine','post','ReadError','text','runWarpGrep_call','5434ZerPIp','describe','Search\x20problem\x20statement\x20that\x20this\x20subagent\x20is\x20supposed\x20to\x20research\x20for','exit','changes','min','lines','success','pyproject.toml','sk-','Failed\x20to\x20read\x20file:\x20','search_string','\x27\x20in\x20`','stringify','filter','name','push','github_url','Morph\x20Edit\x20Preview','all','[could\x20not\x20read\x20file:\x20','listRoots','--help','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','PathError','WarpGrep\x20sub-tool\x20errors:\x20','MORPH_API_KEY','targetDirectories','913269kzAHAI','SymlinkError','params','timeout','Found\x20','Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.','Server\x20cannot\x20operate:\x20No\x20allowed\x20directories\x20available.\x20Server\x20was\x20started\x20without\x20command-line\x20directories\x20and\x20client\x20either\x20does\x20not\x20support\x20MCP\x20roots\x20protocol\x20or\x20provided\x20empty\x20roots.\x20Please\x20either:\x201)\x20Start\x20server\x20with\x20directory\x20arguments,\x202)\x20Use\x20a\x20client\x20that\x20supports\x20MCP\x20roots\x20protocol\x20and\x20provides\x20valid\x20root\x20directories,\x20or\x203)\x20Enable\x20workspace\x20mode\x20with\x20ENABLE_WORKSPACE_MODE=true.','getClientCapabilities','.git','Preview\x20changes\x20without\x20applying\x20them.','version','node_modules','content','GitHub\x20repository\x20URL\x20to\x20search\x20(e.g.\x20\x27https://github.com/vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','Here\x20is\x20the\x20content\x20of\x20files:\x0a','Fallback:\x20Using\x20workspace\x20root\x20','log','-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a','utf-8','Morph\x20FastApply\x20failed\x20without\x20error\x20message','Relevant\x20context\x20found:','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','isArray','ms:','role','toISOString','sep','17370LTqvNM','match','\x20error(s)','api-key','homedir','\x20results\x20in\x20','2260mplyRc','constructor','https://morphllm.com/api/error-report','You\x20should\x20consider\x20using\x20classical\x20search\x20tools\x20afterwards\x20to\x20locate\x20the\x20rest,\x20but\x20only\x20if\x20necessary.\x20','UnknownError','-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a','slice','access','\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)','-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a','message','Error\x20accessing\x20directory\x20','morph-v3-fast','repo_path','path','enum','.cursor','roots','-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a','Fatal\x20error\x20running\x20server:','oninitialized','composer.json','application/json','length','SubToolError','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.','isDirectory','9556HZYlXy','Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id','[warpgrep_github_search]\x20Searching\x20','timings','string','requiresApiKey','\x0aExamples:','Returns\x20ranked\x20code\x20chunks\x20with\x20relevance\x20scores,\x20file\x20paths,\x20and\x20line\x20numbers.\x20','payload','now','go.mod','Warning:\x20Workspace\x20fallback\x20failed:\x20','Error:\x20','--api-key=','unknown\x20error','File\x20read\x20error:','BinaryFile','-\x20Returns\x20precise\x20code\x20chunks\x20with\x20relevance\x20scores\x0a','Specific\x20commit\x20hash\x20to\x20search','Natural\x20language\x20query\x20to\x20search\x20for\x20code','catch','A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.','env','WarpGrepError',',\x20modified\x20','11492ddbTYU','Example\x20queries:\x20\x27Where\x20is\x20JWT\x20validation?\x27,\x20\x27How\x20does\x20auth\x20work?\x27,\x20\x27Find\x20database\x20connection\x20logic\x27.','linesAdded','linesModified','**SEMANTIC\x20CODE\x20SEARCH\x20-\x20USE\x20FOR\x20FINDING\x20CODE**\x0a\x0a','ms.\x20Success:\x20','\x20\x20\x20','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','join','.\x20Changes:\x20','terminated','mcp-filesystem','Warning:\x20Unable\x20to\x20determine\x20package\x20version:','Invalid\x20arguments:\x20','setNotificationHandler','Repository\x20identifier','Warning:\x20','edit_file','normalize','-\x20Searches\x20by\x20semantic\x20meaning,\x20not\x20just\x20keywords\x0a','commitHash','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:','6KDWDfp','data','connect','toLowerCase','@morphllm/morphmcp\x20','Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)','0.2.0','Workspace\x20mode\x20enabled:\x20Using\x20','substring','36QtlHAj','files','resolve','4cRUlsJ','Created\x20File','\x0a...\x20(truncated,\x20total:\x20','[warpgrep_github_search]\x20Failed\x20in\x20','MORPH_API_URL','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','assistant','TimeoutError','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.','object','branch','unknown','Benefits:\x0a','\x20for:\x20\x22','[warpgrep_github_search]\x20Done\x20in\x20','This\x20tool\x20invokes\x20a\x20subagent\x20that\x20runs\x20parallel\x20grep\x20and\x20readfile\x20calls\x20over\x20multiple\x20turns\x20to\x20locate\x20line\x20ranges\x20and\x20files\x20which\x20might\x20be\x20relevant\x20to\x20the\x20request.\x20','grep','The\x20absolute\x20path\x20of\x20the\x20folder\x20where\x20the\x20search\x20should\x20be\x20performed.\x20In\x20multi-repo\x20workspaces,\x20you\x20have\x20to\x20specify\x20a\x20subfolder\x20where\x20the\x20search\x20should\x20be\x20performed,\x20to\x20avoid\x20searching\x20across\x20all\x20repos','description','Branch\x20to\x20search\x20(uses\x20latest\x20commit)','array','ToolException','ms:\x0a\x0a','timed\x20out','completed_with_file_errors','dirname','basename','\x20is\x20not\x20a\x20directory','🎯\x20USE\x20THIS\x20TOOL\x20to\x20find\x20code\x20when\x20you\x20need\x20to\x20understand\x20existing\x20implementations.\x0a\x0a','-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a','2303440zvZvlD','dryRun','optional','toFixed','Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a','-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','metadata','query','codebase_search','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','../package.json','default','includes','Error\x20running\x20fast\x20context\x20search:\x20','IMPORTANT:\x20If\x20you\x20are\x20running\x20within\x20Cursor,\x20you\x20MUST\x20FIRST\x20use\x20another\x20tool\x20(like\x20search_replace)\x20to\x20add\x20exactly\x20one\x20empty\x20new\x20line\x20somewhere\x20in\x20the\x20file\x20before\x20using\x20this\x20tool.\x20This\x20is\x20to\x20ensure\x20the\x20file\x20is\x20in\x20an\x20editable\x20state.\x0a','ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a','owner_repo','Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27','setRequestHandler','morph-mcp','\x20\x20\x20Lines\x20','WORKSPACE_ROOT','every'];a0_0x207d=function(){return _0x5d045e;};return a0_0x207d();}const args=[];for(let i=0x0;i<cliArgs['length'];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x21b290(0x231)](arg)||HELP_FLAGS[a0_0x21b290(0x231)](arg))continue;if(arg[a0_0x21b290(0x23f)](a0_0x21b290(0x1c8)))continue;if(arg==='--api-key'){i++;continue;}args[a0_0x21b290(0x173)](arg);}const WORKSPACE_ROOT=process[a0_0x21b290(0x1d1)][a0_0x21b290(0x229)]||process[a0_0x21b290(0x1d1)]['PWD']||process['cwd'](),ENABLE_WORKSPACE_MODE=process[a0_0x21b290(0x1d1)][a0_0x21b290(0x13d)]!=='false',MORPH_API_KEY=getCliArg(a0_0x21b290(0x19d))??process[a0_0x21b290(0x1d1)][a0_0x21b290(0x17d)],MORPH_API_URL=process['env'][a0_0x21b290(0x1fa)],MORPH_WARP_GREP_TIMEOUT=process[a0_0x21b290(0x1d1)][a0_0x21b290(0x151)]?parseInt(process['env'][a0_0x21b290(0x151)],0xa):undefined;MORPH_API_KEY&&!MORPH_API_KEY[a0_0x21b290(0x23f)](a0_0x21b290(0x16c))&&!MORPH_API_KEY[a0_0x21b290(0x23f)](a0_0x21b290(0x154))&&console['error'](a0_0x21b290(0x225));async function reportMorphError(_0x446f8d){const _0x15c68b=a0_0x21b290;try{await a0_0x3236a6[_0x15c68b(0x15f)](_0x15c68b(0x1a2),{..._0x446f8d,'timestamp':new Date()[_0x15c68b(0x198)](),'source':_0x446f8d['source']||_0x15c68b(0x1df)},{'timeout':0x1388,'headers':{'Content-Type':_0x15c68b(0x1b6),'Authorization':'Bearer\x20'+MORPH_API_KEY}});}catch{}}args[a0_0x21b290(0x1b7)]===0x0&&!ENABLE_WORKSPACE_MODE&&(console['error']('Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]'),console[a0_0x21b290(0x241)](a0_0x21b290(0x1db)),console[a0_0x21b290(0x241)](a0_0x21b290(0x242)),console[a0_0x21b290(0x241)](a0_0x21b290(0x1a8)),console[a0_0x21b290(0x241)](a0_0x21b290(0x17a)),console[a0_0x21b290(0x241)]('At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.'));function normalizePath(_0x42c297){const _0x28ee83=a0_0x21b290;return a0_0x4e5b94[_0x28ee83(0x1e6)](_0x42c297);}function expandHome(_0x4a1f3c){const _0x83dc13=a0_0x21b290;if(_0x4a1f3c['startsWith']('~/')||_0x4a1f3c==='~')return a0_0x4e5b94['join'](a0_0x55e164[_0x83dc13(0x19e)](),_0x4a1f3c[_0x83dc13(0x1a6)](0x1));return _0x4a1f3c;}let allowedDirectories=await Promise['all'](args['map'](async _0x42a71f=>{const _0x342db2=a0_0x21b290,_0x14459e=expandHome(_0x42a71f),_0x25912f=a0_0x4e5b94['resolve'](_0x14459e);try{const _0x2c130f=await a0_0x4a5572[_0x342db2(0x14a)](_0x25912f);return normalizePath(_0x2c130f);}catch(_0x66501e){return normalizePath(_0x25912f);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x21b290(0x1b7)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories[a0_0x21b290(0x173)](workspaceDir),console[a0_0x21b290(0x241)](a0_0x21b290(0x1f1)+workspaceDir+a0_0x21b290(0x23e)));}catch(a0_0x50eb4b){console[a0_0x21b290(0x241)]('Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20'+a0_0x50eb4b);}async function detectWorkspaceRoot(_0x3931b6){const _0x451424=a0_0x21b290;let _0x5763b2=a0_0x4e5b94[_0x451424(0x1f5)](_0x3931b6);const _0x1c8e9b=[_0x451424(0x187),_0x451424(0x22b),_0x451424(0x243),'Cargo.toml',_0x451424(0x16b),_0x451424(0x1c5),_0x451424(0x1b0),'tsconfig.json',_0x451424(0x1b5)];while(_0x5763b2!==a0_0x4e5b94[_0x451424(0x20f)](_0x5763b2)){for(const _0x25d230 of _0x1c8e9b){const _0x989919=a0_0x4e5b94[_0x451424(0x1dc)](_0x5763b2,_0x25d230);try{return await a0_0x4a5572[_0x451424(0x1a7)](_0x989919),normalizePath(_0x5763b2);}catch{}}_0x5763b2=a0_0x4e5b94[_0x451424(0x20f)](_0x5763b2);}return normalizePath(_0x3931b6);}await Promise[a0_0x21b290(0x176)](args[a0_0x21b290(0x250)](async _0x930af5=>{const _0x109574=a0_0x21b290;try{const _0x53bc24=await a0_0x4a5572['stat'](expandHome(_0x930af5));!_0x53bc24[_0x109574(0x1ba)]()&&(console[_0x109574(0x241)]('Error:\x20'+_0x930af5+_0x109574(0x211)),process[_0x109574(0x166)](0x1));}catch(_0xcde3bc){console[_0x109574(0x241)](_0x109574(0x1ab)+_0x930af5+':',_0xcde3bc),process[_0x109574(0x166)](0x1);}}));async function validatePath(_0x1f69b0){const _0x149c1f=a0_0x21b290,_0x4c39c0=expandHome(_0x1f69b0),_0x4b0c7a=a0_0x4e5b94[_0x149c1f(0x1f5)](_0x4c39c0);try{const _0x562e16=await a0_0x4a5572[_0x149c1f(0x14a)](_0x4b0c7a);return _0x562e16;}catch(_0x1962fc){if(_0x1962fc[_0x149c1f(0x13a)]==='ENOENT'){const _0x1953ff=a0_0x4e5b94[_0x149c1f(0x20f)](_0x4b0c7a);try{const _0x323c04=await a0_0x4a5572['realpath'](_0x1953ff);return a0_0x4e5b94[_0x149c1f(0x1dc)](_0x323c04,a0_0x4e5b94[_0x149c1f(0x210)](_0x4b0c7a));}catch{throw new Error(_0x149c1f(0x156)+_0x1953ff);}}throw _0x1962fc;}}const MorphEditFileArgsSchema=z[a0_0x21b290(0x1ff)]({'path':z[a0_0x21b290(0x1bf)](),'code_edit':z[a0_0x21b290(0x1bf)]()[a0_0x21b290(0x164)](a0_0x21b290(0x21d)),'instruction':z[a0_0x21b290(0x1bf)]()[a0_0x21b290(0x164)](a0_0x21b290(0x1d0)),'dryRun':z[a0_0x21b290(0x13b)]()[a0_0x21b290(0x21f)](![])[a0_0x21b290(0x164)](a0_0x21b290(0x188))}),WarpGrepArgsSchema=z['object']({'search_string':z[a0_0x21b290(0x1bf)]()['describe']('Search\x20problem\x20statement\x20that\x20this\x20subagent\x20is\x20supposed\x20to\x20research\x20for'),'repo_path':z[a0_0x21b290(0x1bf)]()['describe'](a0_0x21b290(0x207)),'search_type':z[a0_0x21b290(0x1af)]([a0_0x21b290(0x21f),a0_0x21b290(0x18a)])[a0_0x21b290(0x216)]()[a0_0x21b290(0x164)]('Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.')}),WarpGrepGitHubArgsSchema=z[a0_0x21b290(0x1ff)]({'search_string':z['string']()[a0_0x21b290(0x164)](a0_0x21b290(0x165)),'github_url':z[a0_0x21b290(0x1bf)]()[a0_0x21b290(0x216)]()[a0_0x21b290(0x164)](a0_0x21b290(0x18c)),'owner_repo':z['string']()[a0_0x21b290(0x216)]()[a0_0x21b290(0x164)](a0_0x21b290(0x22d)),'branch':z[a0_0x21b290(0x1bf)]()['optional']()['describe'](a0_0x21b290(0x1ef))}),CodebaseSearchArgsSchema=z[a0_0x21b290(0x1ff)]({'query':z[a0_0x21b290(0x1bf)]()[a0_0x21b290(0x164)](a0_0x21b290(0x1ce)),'repoId':z['string']()[a0_0x21b290(0x164)](a0_0x21b290(0x1e3)),'branch':z[a0_0x21b290(0x1bf)]()['optional']()[a0_0x21b290(0x164)](a0_0x21b290(0x209)),'commitHash':z['string']()[a0_0x21b290(0x216)]()['describe'](a0_0x21b290(0x1cd)),'targetDirectories':z[a0_0x21b290(0x20a)](z['string']())['default']([])[a0_0x21b290(0x164)]('Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all'),'limit':z[a0_0x21b290(0x24a)]()['optional']()[a0_0x21b290(0x21f)](0xa)[a0_0x21b290(0x164)]('Max\x20results\x20to\x20return')}),server=new Server({'name':a0_0x21b290(0x227),'version':a0_0x21b290(0x1f0)},{'capabilities':{'tools':{}}});server[a0_0x21b290(0x226)](ListToolsRequestSchema,async()=>{const _0x2c29c0=a0_0x21b290,_0x4047ac=[{'name':_0x2c29c0(0x1e5),'description':'**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a'+'⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a'+_0x2c29c0(0x148)+_0x2c29c0(0x238)+'Benefits:\x0a'+_0x2c29c0(0x1a9)+_0x2c29c0(0x213)+'-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a'+_0x2c29c0(0x1b2)+_0x2c29c0(0x150)+_0x2c29c0(0x223)+_0x2c29c0(0x218)+'For\x20deletions:\x0a'+_0x2c29c0(0x1a5)+_0x2c29c0(0x239)+_0x2c29c0(0x22e)+_0x2c29c0(0x153)+_0x2c29c0(0x190)+'-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a'+'-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a'+_0x2c29c0(0x219)+'-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a'+_0x2c29c0(0x222),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x2c29c0(0x249),'description':_0x2c29c0(0x247)+_0x2c29c0(0x205)+'The\x20search\x20term\x20should\x20be\x20a\x20targeted\x20natural\x20language\x20query\x20based\x20on\x20what\x20you\x20are\x20trying\x20to\x20accomplish,\x20like\x20\x27Find\x20where\x20authentication\x20requests\x20are\x20handled\x20in\x20the\x20Express\x20routes\x27\x20or\x20\x27Modify\x20the\x20agentic\x20rollout\x20to\x20use\x20the\x20new\x20tokenizer\x20and\x20chat\x20template\x27\x20or\x20\x27Fix\x20the\x20bug\x20where\x20the\x20user\x20gets\x20redirected\x20from\x20the\x20/feed\x20page\x27.\x20'+'Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20subagent\x20in\x20its\x20search.\x20'+_0x2c29c0(0x1b9)+_0x2c29c0(0x24b)+_0x2c29c0(0x1a3)+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]},{'name':_0x2c29c0(0x21c),'description':_0x2c29c0(0x1d8)+'⚡\x20INTELLIGENT:\x20Natural\x20language\x20search\x20across\x20your\x20entire\x20codebase\x20using\x20AI\x20embeddings.\x0a'+_0x2c29c0(0x212)+_0x2c29c0(0x202)+'-\x20Two-stage\x20retrieval:\x20vector\x20search\x20(~240ms)\x20+\x20GPU\x20reranking\x20(~630ms)\x0a'+_0x2c29c0(0x1cc)+_0x2c29c0(0x1e7)+_0x2c29c0(0x248)+'Search\x20your\x20codebase\x20using\x20natural\x20language\x20queries.\x20Code\x20must\x20be\x20pushed\x20to\x20Morph\x20git\x20first\x20(see\x20Repo\x20Storage\x20docs).\x20'+_0x2c29c0(0x1c2)+_0x2c29c0(0x1d5),'inputSchema':zodToJsonSchema(CodebaseSearchArgsSchema),'requiresApiKey':!![]}],_0x21b2af=_0x4047ac[_0x2c29c0(0x171)](_0x126e1f=>{const _0x387fac=_0x2c29c0;if(_0x387fac(0x1c0)in _0x126e1f&&_0x126e1f['requiresApiKey']&&!MORPH_API_KEY)return console['error'](_0x387fac(0x1e4)+_0x126e1f[_0x387fac(0x172)]+_0x387fac(0x143)),![];return!![];});return{'tools':_0x21b2af[_0x2c29c0(0x250)](_0x3ceebd=>({'name':_0x3ceebd['name'],'description':_0x3ceebd[_0x2c29c0(0x208)],'inputSchema':_0x3ceebd['inputSchema']}))};}),server['setRequestHandler'](CallToolRequestSchema,async _0x5aec4f=>{const _0x354812=a0_0x21b290;try{const {name:_0x4c096b,arguments:_0x25da76}=_0x5aec4f[_0x354812(0x181)];switch(_0x4c096b){case _0x354812(0x1e5):{const _0x55af28=MorphEditFileArgsSchema[_0x354812(0x252)](_0x25da76);if(!_0x55af28[_0x354812(0x16a)])throw new Error(_0x354812(0x1fb)+_0x55af28[_0x354812(0x241)]);const _0x4e32b7=await validatePath(_0x55af28['data'][_0x354812(0x1ae)]);let _0x3feba8=null,_0x2ba4b0=!![],_0x3c05bf=null;try{_0x3feba8=await a0_0x4a5572[_0x354812(0x159)](_0x4e32b7,'utf-8');}catch(_0x417c7d){const _0x45c8e5=_0x417c7d[_0x354812(0x13a)];_0x45c8e5==='ENOENT'?(_0x2ba4b0=![],_0x3feba8=''):(_0x3c05bf=_0x354812(0x16d)+(_0x45c8e5||'unknown')+'\x20-\x20'+(_0x417c7d instanceof Error?_0x417c7d[_0x354812(0x1aa)]:String(_0x417c7d)),console[_0x354812(0x241)](_0x354812(0x1e4)+_0x3c05bf));}let _0x53804b;try{const _0x31094b=MORPH_API_KEY;if(!_0x31094b)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.');const _0x1d4c9e=a0_0x4e5b94['dirname'](_0x4e32b7),_0x54a0bf=a0_0x4e5b94[_0x354812(0x210)](_0x4e32b7),_0x5796af=await executeEditFile({'target_filepath':_0x54a0bf,'code_edit':_0x55af28[_0x354812(0x1eb)]['code_edit'],'instructions':_0x55af28[_0x354812(0x1eb)][_0x354812(0x15c)]},{'morphApiKey':_0x31094b,'morphApiUrl':MORPH_API_URL,'baseDir':_0x1d4c9e,'autoWrite':!_0x55af28['data'][_0x354812(0x215)],'generateUdiff':![],'debug':![]});_0x53804b=_0x5796af[_0x354812(0x142)];if(!_0x5796af[_0x354812(0x16a)])throw new Error(_0x5796af[_0x354812(0x241)]||_0x354812(0x192));const _0x1ce81c=_0x5796af[_0x354812(0x167)],_0x90c65e=_0x354812(0x23d)+_0x1ce81c[_0x354812(0x1d6)]+',\x20removed\x20'+_0x1ce81c[_0x354812(0x251)]+_0x354812(0x1d3)+_0x1ce81c[_0x354812(0x1d7)];if(_0x55af28[_0x354812(0x1eb)][_0x354812(0x215)])return{'content':[{'type':_0x354812(0x161),'text':_0x354812(0x175)+(_0x2ba4b0?'':'\x20(new\x20file)')+':\x20'+_0x55af28[_0x354812(0x1eb)][_0x354812(0x15c)]+_0x354812(0x1dd)+_0x90c65e+_0x354812(0x13e)+_0x55af28['data'][_0x354812(0x1ae)]+'.'}]};return{'content':[{'type':_0x354812(0x161),'text':_0x354812(0x157)+(_0x2ba4b0?'Applied':_0x354812(0x1f7))+':\x20'+_0x55af28[_0x354812(0x1eb)][_0x354812(0x15c)]+_0x354812(0x1dd)+_0x90c65e+'.\x20Path:\x20'+_0x55af28[_0x354812(0x1eb)][_0x354812(0x1ae)]+'.'}]};}catch(_0x547223){const _0xe691e5=_0x547223 instanceof Error?_0x547223[_0x354812(0x1aa)]:String(_0x547223);return reportMorphError({'error_message':_0xe691e5,'error_type':_0x547223 instanceof Error?_0x547223[_0x354812(0x1a1)][_0x354812(0x172)]:_0x354812(0x1a4),'context':{'tool':_0x354812(0x1e5),'completion_id':_0x53804b,'file_path':_0x55af28[_0x354812(0x1eb)]['path'],'validated_path':_0x4e32b7,'instruction':_0x55af28['data'][_0x354812(0x15c)],'model':'morph-v3-fast','dry_run':_0x55af28[_0x354812(0x1eb)][_0x354812(0x215)],'file_exists':_0x2ba4b0,'file_read_error':_0x3c05bf,'file_readable':_0x3feba8!==null,'request_content':{'path':_0x55af28[_0x354812(0x1eb)][_0x354812(0x1ae)],'code_edit':_0x55af28[_0x354812(0x1eb)][_0x354812(0x15a)],'instruction':_0x55af28['data']['instruction'],'original_code':_0x3feba8!==null?_0x3feba8[_0x354812(0x1b7)]>0xc350?_0x3feba8['substring'](0x0,0xc350)+_0x354812(0x1f8)+_0x3feba8[_0x354812(0x1b7)]+_0x354812(0x24e):_0x3feba8:_0x354812(0x177)+(_0x3c05bf||_0x354812(0x1c9))+']','original_code_length':_0x3feba8?.[_0x354812(0x1b7)]??0x0,'model':_0x354812(0x1ac),'dry_run':_0x55af28[_0x354812(0x1eb)][_0x354812(0x215)]}},'stack_trace':_0x547223 instanceof Error?_0x547223[_0x354812(0x24f)]:undefined,'source':'mcp-filesystem'})[_0x354812(0x1cf)](()=>{}),{'content':[{'type':'text','text':_0x354812(0x22c)+_0xe691e5}],'isError':!![]};}}case'warpgrep_codebase_search':{const _0x5a03e0=WarpGrepArgsSchema[_0x354812(0x252)](_0x25da76);if(!_0x5a03e0[_0x354812(0x16a)])return{'content':[{'type':_0x354812(0x161),'text':_0x354812(0x1e1)+_0x5a03e0['error']}],'isError':!![]};const _0x300a4c=_0x86261a=>{const _0x32d9a8=_0x354812,_0x4b1d40=[];for(const _0x2579a6 of _0x86261a||[]){const _0xefd8ed=_0x2579a6[_0x32d9a8(0x197)],_0x8d5446=_0x2579a6['content'];if(_0xefd8ed===_0x32d9a8(0x1fc)&&_0x8d5446){const _0x4ec358=_0x8d5446[_0x32d9a8(0x14b)]('\x0a')[_0x32d9a8(0x171)](_0x1f51dd=>_0x1f51dd['trim']());for(const _0x467be0 of _0x4ec358){const _0x2541ae=_0x467be0[_0x32d9a8(0x19b)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x2541ae){_0x4b1d40['push']('grep\x20\x27'+_0x2541ae[0x1]+'\x27\x20'+_0x2541ae[0x2]);continue;}const _0x572f64=_0x467be0[_0x32d9a8(0x19b)](/^read\s+(.+)$/);if(_0x572f64){_0x4b1d40[_0x32d9a8(0x173)]('read\x20'+_0x572f64[0x1]);continue;}const _0x566572=_0x467be0[_0x32d9a8(0x19b)](/^list_directory\s+(.+)$/);if(_0x566572){_0x4b1d40[_0x32d9a8(0x173)](_0x32d9a8(0x14e)+_0x566572[0x1]);continue;}}}}return _0x4b1d40;},_0x35ab13=_0x311350=>{const _0x4d10e4=_0x354812,_0x2e1d11=[];if(!_0x311350||!Array['isArray'](_0x311350))return _0x2e1d11;const _0x118a5d=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':_0x4d10e4(0x253),'tool':_0x4d10e4(0x13f)},{'pattern':/\[PATH ERROR\]/,'error_type':_0x4d10e4(0x17b),'tool':'read'},{'pattern':/\[READ ERROR\]/,'error_type':'ReadError','tool':_0x4d10e4(0x13f)},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0x4d10e4(0x1cb),'tool':_0x4d10e4(0x13f)},{'pattern':/\[RIPGREP ERROR\]/,'error_type':_0x4d10e4(0x22f),'tool':_0x4d10e4(0x206)},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':'RipgrepNotAvailable','tool':_0x4d10e4(0x206)},{'pattern':/\[BINARY FILE\]/,'error_type':_0x4d10e4(0x1cb),'tool':_0x4d10e4(0x13f)},{'pattern':/\[SYMLINK\]/,'error_type':_0x4d10e4(0x180),'tool':_0x4d10e4(0x13f)},{'pattern':/not a text file/,'error_type':_0x4d10e4(0x1cb),'tool':_0x4d10e4(0x13f)},{'pattern':/symbolic link/,'error_type':_0x4d10e4(0x180),'tool':_0x4d10e4(0x13f)},{'pattern':/Error reading file:/,'error_type':_0x4d10e4(0x160),'tool':_0x4d10e4(0x13f)},{'pattern':/status="error"/,'error_type':_0x4d10e4(0x20b),'tool':'unknown'}];let _0x317da1=0x0;for(const _0x30e34a of _0x311350){if(_0x30e34a[_0x4d10e4(0x197)]===_0x4d10e4(0x244)){_0x317da1++;const _0x48cd75=_0x30e34a[_0x4d10e4(0x18b)];if(!_0x48cd75||typeof _0x48cd75!==_0x4d10e4(0x1bf))continue;for(const {pattern:_0x4d1ec8,error_type:_0x5942e1,tool:_0x5763c1}of _0x118a5d){const _0x57eb5a=_0x48cd75[_0x4d10e4(0x19b)](new RegExp(_0x4d1ec8[_0x4d10e4(0x149)],'g'));if(_0x57eb5a)for(const _0x2defca of _0x57eb5a){const _0x156f6d=_0x48cd75['indexOf'](_0x2defca),_0x2ed0b2=_0x48cd75[_0x4d10e4(0x1f2)](_0x156f6d,Math[_0x4d10e4(0x168)](_0x156f6d+0xc8,_0x48cd75[_0x4d10e4(0x1b7)]));_0x2e1d11[_0x4d10e4(0x173)]({'tool':_0x5763c1,'error_type':_0x5942e1,'error_message':_0x2ed0b2[_0x4d10e4(0x14b)]('\x0a')[0x0],'turn':_0x317da1});}}}}return _0x2e1d11;};try{const _0x360109=a0_0x4e5b94[_0x354812(0x1f5)](_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x1ad)]),_0x419924=_0x5a03e0[_0x354812(0x1eb)]['search_type'],_0x5bd1c1=_0x419924===_0x354812(0x18a)?{'allowNames':[_0x354812(0x18a)]}:undefined,_0x775fa9=new LocalRipgrepProvider(_0x360109,undefined,_0x5bd1c1),_0xffc405=await runWarpGrep({'query':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x16e)],'repoRoot':_0x360109,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x775fa9,'search_type':_0x419924}),_0x453d76=_0x35ab13(_0xffc405[_0x354812(0x158)]);_0x453d76[_0x354812(0x1b7)]>0x0&&reportMorphError({'error_message':_0x354812(0x17c)+_0x453d76[_0x354812(0x1b7)]+_0x354812(0x19c),'error_type':_0x354812(0x1b8),'level':'warn','tool':_0x354812(0x249),'context':{'repo_path':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x1ad)],'query':_0x5a03e0['data'][_0x354812(0x16e)],'model':_0x354812(0x155),'termination_reason':_0xffc405[_0x354812(0x15d)],'sub_tool_errors':_0x453d76,'timings':_0xffc405['timings'],'tool_calls':_0x300a4c(_0xffc405['messages']),'messages':_0xffc405[_0x354812(0x158)]?.['map'](_0x17aef7=>({'role':_0x17aef7['role'],'content':_0x17aef7[_0x354812(0x18b)]}))},'source':_0x354812(0x1df)})['catch'](()=>{});let _0x26033e='';if(_0xffc405['terminationReason']==='completed'&&_0xffc405[_0x354812(0x140)]?.[_0x354812(0x21a)]?.[_0x354812(0x1f4)]){const _0x2e12fc=_0xffc405[_0x354812(0x140)][_0x354812(0x21a)][_0x354812(0x1f4)];if(_0x2e12fc['length']===0x0)return _0x26033e=_0xffc405[_0x354812(0x140)][_0x354812(0x1c3)]||'No\x20relevant\x20code\x20found\x20for\x20the\x20query.',{'content':[{'type':_0x354812(0x161),'text':_0x26033e}]};const _0x5acbab=[],_0x3eec7d=[_0x354812(0x194)];for(const _0x3f0e2b of _0xffc405[_0x354812(0x158)]){const _0x2bfe9c=_0x3f0e2b[_0x354812(0x197)],_0x507631=_0x3f0e2b[_0x354812(0x18b)];if(_0x2bfe9c===_0x354812(0x1fc)&&_0x507631){const _0x6579d5=_0x507631[_0x354812(0x14b)]('\x0a')[_0x354812(0x171)](_0x56932a=>_0x56932a[_0x354812(0x144)]());for(const _0x2e339e of _0x6579d5){const _0x7203d9=_0x2e339e[_0x354812(0x19b)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x7203d9){_0x3eec7d[_0x354812(0x173)](_0x354812(0x234)+_0x7203d9[0x1]+_0x354812(0x16f)+_0x7203d9[0x2]+'`');continue;}const _0x6a55ce=_0x2e339e[_0x354812(0x19b)](/^read\s+(.+)$/);if(_0x6a55ce){_0x3eec7d[_0x354812(0x173)]('-\x20Read\x20file\x20`'+_0x6a55ce[0x1]+'`');continue;}const _0x1cae99=_0x2e339e[_0x354812(0x19b)](/^list_directory\s+(.+)$/);if(_0x1cae99){_0x3eec7d[_0x354812(0x173)]('-\x20Listed\x20directory\x20`'+_0x1cae99[0x1]+'`');continue;}}}}_0x5acbab[_0x354812(0x173)](_0x3eec7d[_0x354812(0x1dc)]('\x0a'));const _0x415378=['',_0x354812(0x193)];for(const _0x2bb657 of _0x2e12fc){if(_0x2bb657[_0x354812(0x169)]==='*')_0x415378['push']('-\x20'+_0x2bb657[_0x354812(0x1ae)]+':*');else{if(Array[_0x354812(0x195)](_0x2bb657[_0x354812(0x169)])){const _0x39d72e=_0x2bb657['lines'][_0x354812(0x250)](([_0x163cbc,_0x795785])=>{if(_0x163cbc===_0x795785)return''+_0x163cbc;return _0x163cbc+'-'+_0x795785;});_0x415378[_0x354812(0x173)]('-\x20'+_0x2bb657[_0x354812(0x1ae)]+':'+_0x39d72e[_0x354812(0x1dc)](','));}else _0x415378[_0x354812(0x173)]('-\x20'+_0x2bb657[_0x354812(0x1ae)]+':*');}}_0x415378[_0x354812(0x173)](''),_0x5acbab['push'](_0x415378['join']('\x0a')),_0x5acbab[_0x354812(0x173)](_0x354812(0x18d));const _0x540981=[];for(const _0xd10a0d of _0x2e12fc){let _0x50f893=a0_0x4e5b94[_0x354812(0x1f5)](_0x5a03e0[_0x354812(0x1eb)]['repo_path'],_0xd10a0d[_0x354812(0x1ae)]),_0x463045=null,_0x5874a7=null;try{_0x463045=await a0_0x4a5572['readFile'](_0x50f893,{'encoding':_0x354812(0x191)});}catch(_0x5b039d){const _0x1700f1=fixPathRepetition(_0x50f893);if(_0x1700f1)try{_0x463045=await a0_0x4a5572['readFile'](_0x1700f1,{'encoding':_0x354812(0x191)}),_0x50f893=_0x1700f1;}catch{_0x5874a7=_0x5b039d instanceof Error?_0x5b039d:new Error(String(_0x5b039d));}else _0x5874a7=_0x5b039d instanceof Error?_0x5b039d:new Error(String(_0x5b039d));}if(_0x463045!==null){const _0x377cf3=_0x463045[_0x354812(0x14b)](/\r?\n/),_0x128996=[_0x354812(0x14c)+_0xd10a0d[_0x354812(0x1ae)]+'\x22>'];if(_0xd10a0d[_0x354812(0x169)]==='*'||!Array[_0x354812(0x195)](_0xd10a0d[_0x354812(0x169)]))for(let _0x22bbcf=0x1;_0x22bbcf<=_0x377cf3[_0x354812(0x1b7)];_0x22bbcf++){const _0x3c2409=_0x377cf3[_0x22bbcf-0x1];_0x128996[_0x354812(0x173)](_0x22bbcf+'|\x20'+_0x3c2409);}else for(const [_0xf782df,_0x203b52]of _0xd10a0d[_0x354812(0x169)]){_0x128996[_0x354812(0x1b7)]>0x1&&_0x128996[_0x354812(0x173)]('');for(let _0x21fb6f=_0xf782df;_0x21fb6f<=_0x203b52&&_0x21fb6f<=_0x377cf3['length'];_0x21fb6f++){const _0x57da1b=_0x377cf3[_0x21fb6f-0x1];_0x128996[_0x354812(0x173)](_0x21fb6f+'|\x20'+_0x57da1b);}}_0x128996[_0x354812(0x173)](_0x354812(0x24c)),_0x540981[_0x354812(0x173)](_0x128996[_0x354812(0x1dc)]('\x0a'));}else _0x540981[_0x354812(0x173)](_0x354812(0x14c)+_0xd10a0d[_0x354812(0x1ae)]+'\x22>\x0aError\x20reading\x20file:\x20'+(_0x5874a7?.[_0x354812(0x1aa)]||_0x354812(0x24d))+_0x354812(0x245));}_0x5acbab['push'](_0x540981[_0x354812(0x1dc)]('\x0a\x0a')),_0x26033e=_0x5acbab[_0x354812(0x1dc)]('\x0a');const _0x52d3ba=_0xffc405[_0x354812(0x14f)]?.[_0x354812(0x171)](_0x36faf0=>_0x36faf0['message']?.[_0x354812(0x23f)](_0x354812(0x1ca)))||[];if(_0x52d3ba['length']>0x0){const _0x47cfe6=_0x52d3ba[_0x354812(0x250)](_0x4db336=>_0x4db336[_0x354812(0x1aa)])[_0x354812(0x1dc)](';\x20');reportMorphError({'error_message':_0x47cfe6,'error_type':'FileReadError','context':{'tool':_0x354812(0x249),'repo_path':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x1ad)],'query':_0x5a03e0['data'][_0x354812(0x16e)],'model':'morph-warp-grep-v1-1111v0','termination_reason':_0x354812(0x20e),'error_count':_0x52d3ba[_0x354812(0x1b7)],'is_timeout':![],'timings':_0xffc405[_0x354812(0x1be)],'files_attempted':_0x2e12fc['map'](_0x4a32dc=>({'path':_0x4a32dc[_0x354812(0x1ae)],'lines':_0x4a32dc[_0x354812(0x169)]})),'tool_calls':_0x300a4c(_0xffc405['messages']),'messages':_0xffc405['messages']?.[_0x354812(0x250)](_0xc53649=>({'role':_0xc53649[_0x354812(0x197)],'content':_0xc53649[_0x354812(0x18b)]})),'request_content':{'query':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x16e)],'repo_path':_0x5a03e0['data'][_0x354812(0x1ad)],'repoRoot':a0_0x4e5b94['resolve'](_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x1ad)]),'model':_0x354812(0x155)}},'source':_0x354812(0x1df)})[_0x354812(0x1cf)](()=>{});}}else{if(_0xffc405[_0x354812(0x15d)]===_0x354812(0x1de)&&_0xffc405[_0x354812(0x14f)][_0x354812(0x1b7)]>0x0){const _0x4f3ec0=_0xffc405[_0x354812(0x14f)]['map'](_0x3f7feb=>_0x3f7feb[_0x354812(0x1aa)])[_0x354812(0x1dc)](';\x20');_0x26033e=_0x354812(0x1c7)+_0x4f3ec0;const _0x4d856f=_0x4f3ec0[_0x354812(0x1ed)]()['includes'](_0x354812(0x182))||_0x4f3ec0[_0x354812(0x1ed)]()[_0x354812(0x220)](_0x354812(0x20d))||_0x4f3ec0[_0x354812(0x1ed)]()[_0x354812(0x220)](_0x354812(0x240)),_0x2f5f00=_0xffc405[_0x354812(0x140)]?.['metadata']?.[_0x354812(0x1f4)],_0x305b1e=_0xffc405[_0x354812(0x14f)][0x0];reportMorphError({'error_message':_0x4f3ec0,'error_type':_0x4d856f?_0x354812(0x1fd):_0x305b1e?.[_0x354812(0x1a1)]?.[_0x354812(0x172)]||_0x354812(0x1d2),'context':{'tool':_0x354812(0x249),'repo_path':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x1ad)],'query':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x16e)],'model':_0x354812(0x155),'termination_reason':_0xffc405[_0x354812(0x15d)],'error_count':_0xffc405[_0x354812(0x14f)][_0x354812(0x1b7)],'is_timeout':_0x4d856f,'timings':_0xffc405['timings'],'files_attempted':_0x2f5f00?.[_0x354812(0x250)](_0x41dfd7=>({'path':_0x41dfd7[_0x354812(0x1ae)],'lines':_0x41dfd7[_0x354812(0x169)]})),'tool_calls':_0x300a4c(_0xffc405[_0x354812(0x158)]),'messages':_0xffc405[_0x354812(0x158)]?.['map'](_0x3dec27=>({'role':_0x3dec27[_0x354812(0x197)],'content':_0x3dec27[_0x354812(0x18b)]})),'request_content':{'query':_0x5a03e0['data'][_0x354812(0x16e)],'repo_path':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x1ad)],'repoRoot':a0_0x4e5b94[_0x354812(0x1f5)](_0x5a03e0[_0x354812(0x1eb)]['repo_path']),'model':_0x354812(0x155)}},'stack_trace':_0x305b1e?.[_0x354812(0x24f)]||undefined,'source':_0x354812(0x1df)})[_0x354812(0x1cf)](()=>{});}else _0x26033e=_0x354812(0x184);}return{'content':[{'type':_0x354812(0x161),'text':_0x26033e}]};}catch(_0x188c77){const _0x478521=_0x188c77 instanceof Error?_0x188c77[_0x354812(0x1aa)]:String(_0x188c77),_0x18b302=_0x478521['toLowerCase']()['includes'](_0x354812(0x182))||_0x478521[_0x354812(0x1ed)]()['includes'](_0x354812(0x20d))||_0x478521[_0x354812(0x1ed)]()[_0x354812(0x220)]('etimedout')||_0x188c77 instanceof Error&&_0x188c77[_0x354812(0x172)]==='TimeoutError';return reportMorphError({'error_message':_0x478521,'error_type':_0x18b302?_0x354812(0x1fd):_0x188c77 instanceof Error?_0x188c77['constructor'][_0x354812(0x172)]:'UnknownError','context':{'tool':'warpgrep_codebase_search','repo_path':_0x5a03e0['data'][_0x354812(0x1ad)],'query':_0x5a03e0[_0x354812(0x1eb)]['search_string'],'model':_0x354812(0x155),'is_timeout':_0x18b302,'exception_phase':_0x354812(0x162),'request_content':{'query':_0x5a03e0[_0x354812(0x1eb)][_0x354812(0x16e)],'repo_path':_0x5a03e0[_0x354812(0x1eb)]['repo_path'],'repoRoot':a0_0x4e5b94['resolve'](_0x5a03e0[_0x354812(0x1eb)]['repo_path']),'model':_0x354812(0x155)}},'stack_trace':_0x188c77 instanceof Error?_0x188c77[_0x354812(0x24f)]:undefined,'source':_0x354812(0x1df)})[_0x354812(0x1cf)](()=>{}),{'content':[{'type':_0x354812(0x161),'text':_0x354812(0x221)+_0x478521}],'isError':![]};}}case _0x354812(0x141):{const _0xe86e55=WarpGrepGitHubArgsSchema[_0x354812(0x252)](_0x25da76);if(!_0xe86e55[_0x354812(0x16a)])return{'content':[{'type':_0x354812(0x161),'text':_0x354812(0x1e1)+_0xe86e55[_0x354812(0x241)]}],'isError':!![]};const _0xb12771=_0xe86e55[_0x354812(0x1eb)][_0x354812(0x174)]||_0xe86e55[_0x354812(0x1eb)][_0x354812(0x224)];if(!_0xb12771)return{'content':[{'type':'text','text':_0x354812(0x1bc)}],'isError':!![]};const _0x26af1b=MORPH_API_KEY;if(!_0x26af1b)throw new Error(_0x354812(0x23a));const _0x3791ea=Date[_0x354812(0x1c4)]();console['error'](_0x354812(0x1bd)+_0xb12771+_0x354812(0x203)+_0xe86e55[_0x354812(0x1eb)][_0x354812(0x16e)]+'\x22');try{const _0x28a8c7=new WarpGrepClient({'morphApiKey':_0x26af1b,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x530527=await _0x28a8c7[_0x354812(0x237)]({'query':_0xe86e55[_0x354812(0x1eb)]['search_string'],'github':_0xb12771,'branch':_0xe86e55[_0x354812(0x1eb)][_0x354812(0x200)]}),_0x2f2cd6=Date[_0x354812(0x1c4)]()-_0x3791ea;console[_0x354812(0x241)](_0x354812(0x204)+_0x2f2cd6+_0x354812(0x1d9)+_0x530527['success']);const _0x137351=formatResult(_0x530527);return{'content':[{'type':_0x354812(0x161),'text':_0x137351}]};}catch(_0x6bcaf0){const _0x848e61=Date[_0x354812(0x1c4)]()-_0x3791ea,_0x18f89d=_0x6bcaf0 instanceof Error?_0x6bcaf0[_0x354812(0x1aa)]:String(_0x6bcaf0);return console['error'](_0x354812(0x1f9)+_0x848e61+_0x354812(0x196),_0x18f89d),reportMorphError({'error_message':_0x18f89d,'error_type':_0x6bcaf0 instanceof Error?_0x6bcaf0[_0x354812(0x1a1)][_0x354812(0x172)]:_0x354812(0x1a4),'context':{'tool':'warpgrep_github_search','github_url':_0xb12771,'search_string':_0xe86e55[_0x354812(0x1eb)]['search_string'],'branch':_0xe86e55[_0x354812(0x1eb)][_0x354812(0x200)]},'stack_trace':_0x6bcaf0 instanceof Error?_0x6bcaf0[_0x354812(0x24f)]:undefined,'source':_0x354812(0x1df),'tool':_0x354812(0x141),'latency_ms':_0x848e61})[_0x354812(0x1cf)](()=>{}),{'content':[{'type':_0x354812(0x161),'text':'GitHub\x20search\x20failed:\x20'+_0x18f89d}],'isError':![]};}}case _0x354812(0x21c):{const _0x4997d4=CodebaseSearchArgsSchema['safeParse'](_0x25da76);if(!_0x4997d4[_0x354812(0x16a)])return{'content':[{'type':_0x354812(0x161),'text':_0x354812(0x1e1)+_0x4997d4['error']}],'isError':!![]};try{const _0x34b29d=MORPH_API_KEY;if(!_0x34b29d)throw new Error(_0x354812(0x1fe));const _0x240fab=_0x4997d4[_0x354812(0x1eb)][_0x354812(0x17e)],_0x4a141f=await executeCodebaseSearch({'query':_0x4997d4[_0x354812(0x1eb)][_0x354812(0x21b)],'target_directories':_0x240fab,'limit':_0x4997d4[_0x354812(0x1eb)]['limit']},{'apiKey':_0x34b29d,'repoId':_0x4997d4[_0x354812(0x1eb)][_0x354812(0x146)],'branch':_0x4997d4[_0x354812(0x1eb)]['branch'],'commitHash':_0x4997d4[_0x354812(0x1eb)][_0x354812(0x1e8)],'debug':![]});if(!_0x4a141f[_0x354812(0x16a)])return{'content':[{'type':'text','text':'Search\x20failed:\x20'+_0x4a141f['error']}],'isError':!![]};const _0x16e1a0=_0x4a141f['results'][_0x354812(0x1b7)]===0x0?_0x354812(0x152)+_0x4997d4[_0x354812(0x1eb)][_0x354812(0x21b)]+'\x22':_0x354812(0x183)+_0x4a141f[_0x354812(0x23c)]['length']+_0x354812(0x19f)+_0x4a141f['stats'][_0x354812(0x235)]+_0x354812(0x20c)+_0x4a141f['results'][_0x354812(0x250)]((_0x1c6c66,_0x5c7e48)=>_0x5c7e48+0x1+'.\x20'+_0x1c6c66['filepath']+'\x20('+(_0x1c6c66[_0x354812(0x147)]*0x64)[_0x354812(0x217)](0x1)+_0x354812(0x14d)+(_0x354812(0x228)+_0x1c6c66['startLine']+'-'+_0x1c6c66[_0x354812(0x15e)]+'\x0a')+(_0x354812(0x1da)+_0x1c6c66[_0x354812(0x18b)][_0x354812(0x1f2)](0x0,0xc8)+(_0x1c6c66[_0x354812(0x18b)]['length']>0xc8?'...':'')+'\x0a'))[_0x354812(0x1dc)]('\x0a');return{'content':[{'type':_0x354812(0x161),'text':_0x16e1a0}]};}catch(_0x353584){const _0x2dac6e=_0x353584 instanceof Error?_0x353584['message']:String(_0x353584);return reportMorphError({'error_message':_0x2dac6e,'error_type':_0x353584 instanceof Error?_0x353584[_0x354812(0x1a1)][_0x354812(0x172)]:_0x354812(0x1a4),'context':{'tool':_0x354812(0x21c),'query':_0x4997d4[_0x354812(0x1eb)][_0x354812(0x21b)],'repo_id':_0x4997d4[_0x354812(0x1eb)]['repoId'],'target_directories':_0x4997d4['data'][_0x354812(0x17e)]},'stack_trace':_0x353584 instanceof Error?_0x353584[_0x354812(0x24f)]:undefined,'source':_0x354812(0x1df)})[_0x354812(0x1cf)](()=>{}),{'content':[{'type':_0x354812(0x161),'text':_0x354812(0x1c7)+_0x2dac6e}],'isError':!![]};}}default:throw new Error(_0x354812(0x233)+_0x4c096b);}}catch(_0x16448c){const _0x21537f=_0x16448c instanceof Error?_0x16448c['message']:String(_0x16448c);return reportMorphError({'error_message':_0x21537f,'error_type':_0x16448c instanceof Error?_0x16448c['constructor'][_0x354812(0x172)]:_0x354812(0x1a4),'context':{'tool':name,'arguments':args?JSON[_0x354812(0x170)](args)[_0x354812(0x1f2)](0x0,0x1f4):undefined,'mcp_server_version':'0.2.0'},'stack_trace':_0x16448c instanceof Error?_0x16448c[_0x354812(0x24f)]:undefined,'source':_0x354812(0x1df)})[_0x354812(0x1cf)](()=>{}),{'content':[{'type':'text','text':_0x354812(0x1c7)+_0x21537f}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x66e157){const _0x47266a=a0_0x21b290,_0x3242a5=await getValidRootDirectories(_0x66e157);if(_0x3242a5['length']>0x0)allowedDirectories=[..._0x3242a5],console[_0x47266a(0x241)](_0x47266a(0x232)+_0x3242a5[_0x47266a(0x1b7)]+'\x20valid\x20directories');else{console['error']('No\x20valid\x20root\x20directories\x20provided\x20by\x20client');if(ENABLE_WORKSPACE_MODE)try{const _0x30d58a=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x30d58a&&(allowedDirectories=[_0x30d58a],console[_0x47266a(0x241)](_0x47266a(0x18e)+_0x30d58a));}catch(_0x52988c){console['error'](_0x47266a(0x1c6)+_0x52988c);}}}server[a0_0x21b290(0x1e2)](RootsListChangedNotificationSchema,async()=>{const _0x2a0661=a0_0x21b290;try{const _0x3167a9=await server['listRoots']();_0x3167a9&&_0x2a0661(0x1b1)in _0x3167a9&&await updateAllowedDirectoriesFromRoots(_0x3167a9[_0x2a0661(0x1b1)]);}catch(_0xb52f46){console[_0x2a0661(0x241)]('Failed\x20to\x20request\x20roots\x20from\x20client:',_0xb52f46 instanceof Error?_0xb52f46['message']:String(_0xb52f46));}}),server[a0_0x21b290(0x1b4)]=async()=>{const _0x150dae=a0_0x21b290,_0x165bfd=server[_0x150dae(0x186)]();if(_0x165bfd?.[_0x150dae(0x1b1)])try{const _0x220df4=await server[_0x150dae(0x178)]();_0x220df4&&'roots'in _0x220df4?await updateAllowedDirectoriesFromRoots(_0x220df4[_0x150dae(0x1b1)]):console['error']('Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings');}catch(_0x5dfede){console['error']('Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:',_0x5dfede instanceof Error?_0x5dfede[_0x150dae(0x1aa)]:String(_0x5dfede));}else{if(allowedDirectories[_0x150dae(0x1b7)]>0x0)console[_0x150dae(0x241)](_0x150dae(0x1e9),allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)console[_0x150dae(0x241)]('Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode');else throw new Error(_0x150dae(0x185));}}};async function runServer(){const _0x36e41f=a0_0x21b290,_0x94e925=new StdioServerTransport();await server[_0x36e41f(0x1ec)](_0x94e925),console['error']('Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio'),allowedDirectories[_0x36e41f(0x1b7)]===0x0&&console[_0x36e41f(0x241)]('Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol');}runServer()['catch'](_0x48d721=>{const _0x52c5b9=a0_0x21b290;console[_0x52c5b9(0x241)](_0x52c5b9(0x1b3),_0x48d721),process[_0x52c5b9(0x166)](0x1);});
2
+ const a0_0x15caa6=a0_0x4531;(function(_0x2af475,_0x2ce4e9){const _0xcfcf35=a0_0x4531,_0x585fe5=_0x2af475();while(!![]){try{const _0x2cb485=-parseInt(_0xcfcf35(0x255))/0x1+parseInt(_0xcfcf35(0x2c4))/0x2+parseInt(_0xcfcf35(0x207))/0x3*(-parseInt(_0xcfcf35(0x1c5))/0x4)+-parseInt(_0xcfcf35(0x2d6))/0x5+parseInt(_0xcfcf35(0x1e4))/0x6*(-parseInt(_0xcfcf35(0x2ab))/0x7)+parseInt(_0xcfcf35(0x2a5))/0x8+parseInt(_0xcfcf35(0x2a3))/0x9*(parseInt(_0xcfcf35(0x1d4))/0xa);if(_0x2cb485===_0x2ce4e9)break;else _0x585fe5['push'](_0x585fe5['shift']());}catch(_0x47a74f){_0x585fe5['push'](_0x585fe5['shift']());}}}(a0_0x2632,0x9af5c));import{Server}from'@modelcontextprotocol/sdk/server/index.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema,RootsListChangedNotificationSchema}from'@modelcontextprotocol/sdk/types.js';import a0_0x397b2d from'fs/promises';import a0_0x1fe176 from'path';import a0_0x3b7341 from'os';import{createRequire}from'module';import{z}from'zod';import{zodToJsonSchema}from'zod-to-json-schema';import{getValidRootDirectories}from'./roots-utils.js';import{executeEditFile}from'@morphllm/morphsdk/tools/fastapply';import{runWarpGrep,LocalRipgrepProvider,GITHUB_SEARCH_TOOL_NAME,GITHUB_SEARCH_DESCRIPTION}from'@morphllm/morphsdk/tools/warp-grep';import{WarpGrepClient,formatResult}from'@morphllm/morphsdk/tools/warp-grep/client';import{executeCodebaseSearch}from'@morphllm/morphsdk/tools/codebase-search';import a0_0x5b8c76 from'axios';function fixPathRepetition(_0x2d4116){const _0x3bf4f4=a0_0x4531,_0x267e6d=_0x2d4116['split'](a0_0x1fe176[_0x3bf4f4(0x276)])[_0x3bf4f4(0x1cb)](Boolean);if(_0x267e6d[_0x3bf4f4(0x2a9)]<0x2)return null;for(let _0x147543=Math[_0x3bf4f4(0x1e0)](_0x267e6d[_0x3bf4f4(0x2a9)]/0x2);_0x147543>=0x1;_0x147543--){for(let _0x22f94d=0x0;_0x22f94d<=_0x267e6d[_0x3bf4f4(0x2a9)]-0x2*_0x147543;_0x22f94d++){const _0x1087b8=_0x267e6d['slice'](_0x22f94d,_0x22f94d+_0x147543),_0x5be626=_0x267e6d[_0x3bf4f4(0x2ba)](_0x22f94d+_0x147543,_0x22f94d+0x2*_0x147543);if(_0x1087b8[_0x3bf4f4(0x245)]((_0x68a7c6,_0x307b17)=>_0x68a7c6===_0x5be626[_0x307b17])){const _0x5135a7=[..._0x267e6d[_0x3bf4f4(0x2ba)](0x0,_0x22f94d),..._0x267e6d[_0x3bf4f4(0x2ba)](_0x22f94d+_0x147543)];return a0_0x1fe176[_0x3bf4f4(0x276)]+_0x5135a7[_0x3bf4f4(0x2c3)](a0_0x1fe176[_0x3bf4f4(0x276)]);}}}return null;}const require=createRequire(import.meta.url);function getPackageVersion(){const _0x22ffd=a0_0x4531;try{const _0xe8dea4=require(_0x22ffd(0x2d4));return _0xe8dea4[_0x22ffd(0x253)]??'unknown';}catch(_0x117568){return console[_0x22ffd(0x1d5)](_0x22ffd(0x270),_0x117568),_0x22ffd(0x2af);}}function printHelp(){const _0x425e63=a0_0x4531;console[_0x425e63(0x1c2)]('@morphllm/morphmcp\x20'+getPackageVersion()),console[_0x425e63(0x1c2)]('\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]'),console['log'](_0x425e63(0x27a)),console[_0x425e63(0x1c2)]('\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)'),console[_0x425e63(0x1c2)]('\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit'),console[_0x425e63(0x1c2)](_0x425e63(0x1c3)),console['log']('\x0aExamples:'),console[_0x425e63(0x1c2)](_0x425e63(0x290)),console[_0x425e63(0x1c2)]('\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo');}function a0_0x4531(_0x5b5cd5,_0x3ffaff){_0x5b5cd5=_0x5b5cd5-0x1be;const _0x263233=a0_0x2632();let _0x453124=_0x263233[_0x5b5cd5];return _0x453124;}const cliArgs=process[a0_0x15caa6(0x2a7)][a0_0x15caa6(0x2ba)](0x2),VERSION_FLAGS=new Set([a0_0x15caa6(0x1f7),'-v','-V']),HELP_FLAGS=new Set([a0_0x15caa6(0x208),'-h']);cliArgs[a0_0x15caa6(0x2c9)](_0x484a92=>VERSION_FLAGS[a0_0x15caa6(0x209)](_0x484a92))&&(console[a0_0x15caa6(0x1c2)](a0_0x15caa6(0x20f)+getPackageVersion()),process['exit'](0x0));cliArgs[a0_0x15caa6(0x2c9)](_0xe765a8=>HELP_FLAGS[a0_0x15caa6(0x209)](_0xe765a8))&&(printHelp(),process['exit'](0x0));function getCliArg(_0x34d177){const _0x3a6e3f=a0_0x15caa6;for(let _0x4161b2=0x0;_0x4161b2<cliArgs['length'];_0x4161b2++){const _0x20360e=cliArgs[_0x4161b2];if(_0x20360e[_0x3a6e3f(0x284)]('--'+_0x34d177+'='))return _0x20360e[_0x3a6e3f(0x2ba)](('--'+_0x34d177+'=')[_0x3a6e3f(0x2a9)]);if(_0x20360e==='--'+_0x34d177&&_0x4161b2+0x1<cliArgs[_0x3a6e3f(0x2a9)])return cliArgs[_0x4161b2+0x1];}return undefined;}const args=[];for(let i=0x0;i<cliArgs['length'];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x15caa6(0x209)](arg)||HELP_FLAGS[a0_0x15caa6(0x209)](arg))continue;if(arg[a0_0x15caa6(0x284)](a0_0x15caa6(0x2dc)))continue;if(arg==='--api-key'){i++;continue;}args[a0_0x15caa6(0x2ce)](arg);}const WORKSPACE_ROOT=process[a0_0x15caa6(0x297)]['WORKSPACE_ROOT']||process['env'][a0_0x15caa6(0x23d)]||process[a0_0x15caa6(0x26c)](),ENABLE_WORKSPACE_MODE=process[a0_0x15caa6(0x297)][a0_0x15caa6(0x266)]!==a0_0x15caa6(0x211),MORPH_API_KEY=getCliArg(a0_0x15caa6(0x235))??process[a0_0x15caa6(0x297)][a0_0x15caa6(0x252)],MORPH_API_URL=process[a0_0x15caa6(0x297)][a0_0x15caa6(0x244)],MORPH_WARP_GREP_TIMEOUT=process[a0_0x15caa6(0x297)]['MORPH_WARP_GREP_TIMEOUT']?parseInt(process[a0_0x15caa6(0x297)][a0_0x15caa6(0x25a)],0xa):undefined;MORPH_API_KEY&&!MORPH_API_KEY[a0_0x15caa6(0x284)](a0_0x15caa6(0x2d3))&&!MORPH_API_KEY[a0_0x15caa6(0x284)](a0_0x15caa6(0x215))&&console[a0_0x15caa6(0x1d5)]('Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27');async function reportMorphError(_0x8933c8){const _0x14f1c0=a0_0x15caa6;try{await a0_0x5b8c76[_0x14f1c0(0x288)]('https://morphllm.com/api/error-report',{..._0x8933c8,'timestamp':new Date()[_0x14f1c0(0x217)](),'source':_0x8933c8[_0x14f1c0(0x2c5)]||_0x14f1c0(0x204)},{'timeout':0x1388,'headers':{'Content-Type':_0x14f1c0(0x2dd),'Authorization':_0x14f1c0(0x1fc)+MORPH_API_KEY}});}catch{}}args['length']===0x0&&!ENABLE_WORKSPACE_MODE&&(console[a0_0x15caa6(0x1d5)](a0_0x15caa6(0x221)),console[a0_0x15caa6(0x1d5)]('Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:'),console[a0_0x15caa6(0x1d5)](a0_0x15caa6(0x24c)),console['error'](a0_0x15caa6(0x29e)),console[a0_0x15caa6(0x1d5)](a0_0x15caa6(0x2da)),console[a0_0x15caa6(0x1d5)](a0_0x15caa6(0x2c6)));function normalizePath(_0xf82e87){const _0x289804=a0_0x15caa6;return a0_0x1fe176[_0x289804(0x1df)](_0xf82e87);}function a0_0x2632(){const _0x16cbf2=['MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol','map','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a','Morph\x20FastApply\x20failed\x20without\x20error\x20message','[warpgrep_github_search]\x20Done\x20in\x20','warn','Fallback:\x20Using\x20workspace\x20root\x20','Error\x20running\x20fast\x20context\x20search:\x20','dirname','Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)','isArray','RipgrepNotAvailable','files','array','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','setRequestHandler','search_string','Unknown\x20tool:\x20','⚡\x20INTELLIGENT:\x20Natural\x20language\x20search\x20across\x20your\x20entire\x20codebase\x20using\x20AI\x20embeddings.\x0a',',\x20removed\x20','UnknownError','api-key','Workspace\x20mode\x20enabled:\x20Using\x20','now','instruction','node_modules','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','branch','Unknown\x20error','PWD','-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a','Cargo.toml','success','etimedout','ms.\x20Success:\x20','results','MORPH_API_URL','every','morph-warp-grep-v1-1111v0','.\x20Changes:\x20','code_edit','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:','-\x20Grepped\x20\x27','.git','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','%\x20match)\x0a','Failed\x20to\x20request\x20roots\x20from\x20client:','SubToolError','[warpgrep_github_search]\x20Failed\x20in\x20','\x20-\x20','MORPH_API_KEY','version','A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.','635296TSecup','Created\x20File','repo_path','code','\x20error(s)','MORPH_WARP_GREP_TIMEOUT','No\x20results\x20found\x20for\x20query:\x20\x22','-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a','boolean','-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','pyproject.toml','stats','list_directory\x20','filepath',',\x20modified\x20','Search\x20failed:\x20','ENABLE_WORKSPACE_MODE','startLine','PathError','metadata','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20subagent\x20in\x20its\x20search.\x20','cwd','Preview\x20changes\x20without\x20applying\x20them.','Error:\x20','finish','Warning:\x20Unable\x20to\x20determine\x20package\x20version:','⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a','describe','setNotificationHandler','unknown\x20error','A\x20search\x20subagent\x20the\x20user\x20refers\x20to\x20as\x20\x27WarpGrep\x27\x20that\x20is\x20ideal\x20for\x20exploring\x20the\x20codebase\x20based\x20on\x20a\x20request.\x20','sep','No\x20relevant\x20code\x20found\x20for\x20the\x20query.','0.2.0','runWarpGrep_call','\x0aOptions:','Returns\x20ranked\x20code\x20chunks\x20with\x20relevance\x20scores,\x20file\x20paths,\x20and\x20line\x20numbers.\x20','timeout','content','targetDirectories','errors','codebase_search','Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings','user','github_url','startsWith','listRoots','-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a','requiresApiKey','post','linesModified','-\x20Two-stage\x20retrieval:\x20vector\x20search\x20(~240ms)\x20+\x20GPU\x20reranking\x20(~630ms)\x0a','-\x20Searches\x20by\x20semantic\x20meaning,\x20not\x20just\x20keywords\x0a','connect','stack','toFixed','Error\x20accessing\x20directory\x20','\x20\x20morph-mcp','Invalid\x20arguments:\x20','data','Warning:\x20Workspace\x20fallback\x20failed:\x20','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','\x20(new\x20file)','ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a','env','description','...','Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a','.vscode','\x20for:\x20\x22','role','\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)','For\x20deletions:\x0a','query','toLowerCase','-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','81hjtEmP','IMPORTANT:\x20If\x20you\x20are\x20running\x20within\x20Cursor,\x20you\x20MUST\x20FIRST\x20use\x20another\x20tool\x20(like\x20search_replace)\x20to\x20add\x20exactly\x20one\x20empty\x20new\x20line\x20somewhere\x20in\x20the\x20file\x20before\x20using\x20this\x20tool.\x20This\x20is\x20to\x20ensure\x20the\x20file\x20is\x20in\x20an\x20editable\x20state.\x0a','6712568ZcWFEV','terminationReason','argv','roots','length','</file>','21910yRPqDT','path','lines','SymlinkError','unknown','ENOENT','split','tsconfig.json','Here\x20is\x20the\x20content\x20of\x20files:\x0a','\x0a</file>','warpgrep_codebase_search','-\x20Works\x20across\x20all\x20files\x20and\x20languages\x0a\x0a','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.','-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a','name','slice','realpath','-\x20Read\x20file\x20`','Applied','assistant','exit','timings','message','substring','join','1917434SqRbSg','source','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.','number','Morph\x20Edit\x20Preview','some','completed_with_file_errors','catch','min','\x22>\x0aError\x20reading\x20file:\x20','push','Max\x20results\x20to\x20return','repoId','messages','Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.','sk-','../package.json','match','2292840ErPcUm','all','access','completionId','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','Benefits:\x0a','--api-key=','application/json','stringify','Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:','Relevant\x20context\x20found:','Repository\x20identifier','Found\x20','searchGitHub','-\x20Listed\x20directory\x20`','\x20is\x20not\x20a\x20directory','homedir','Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','log','\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit','Warning:\x20','1420YfSBsq','indexOf','rerankScore','Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a','constructor','❌\x20Morph\x20Edit\x20Failed:\x20','filter','TimeoutError','WarpGrepError','🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a','.cursor','includes','read','trim','.\x20Path:\x20','1772380ygNqQD','error','The\x20absolute\x20path\x20of\x20the\x20folder\x20where\x20the\x20search\x20should\x20be\x20performed.\x20In\x20multi-repo\x20workspaces,\x20you\x20have\x20to\x20specify\x20a\x20subfolder\x20where\x20the\x20search\x20should\x20be\x20performed,\x20to\x20avoid\x20searching\x20across\x20all\x20repos','params','dryRun','🎯\x20USE\x20THIS\x20TOOL\x20to\x20find\x20code\x20when\x20you\x20need\x20to\x20understand\x20existing\x20implementations.\x0a\x0a','edit_file','\x20\x20\x20','morph-v3-fast','FileReadError','owner_repo','normalize','floor','Search\x20problem\x20statement\x20that\x20this\x20subagent\x20is\x20supposed\x20to\x20research\x20for','Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all','GitHub\x20search\x20failed:\x20','1104PleELN','Search\x20your\x20codebase\x20using\x20natural\x20language\x20queries.\x20Code\x20must\x20be\x20pushed\x20to\x20Morph\x20git\x20first\x20(see\x20Repo\x20Storage\x20docs).\x20','\x20results\x20in\x20','Failed\x20to\x20read\x20file:\x20','morph-mcp','enum','[warpgrep_github_search]\x20Searching\x20','read\x20','utf-8','The\x20search\x20term\x20should\x20be\x20a\x20targeted\x20natural\x20language\x20query\x20based\x20on\x20what\x20you\x20are\x20trying\x20to\x20accomplish,\x20like\x20\x27Find\x20where\x20authentication\x20requests\x20are\x20handled\x20in\x20the\x20Express\x20routes\x27\x20or\x20\x27Modify\x20the\x20agentic\x20rollout\x20to\x20use\x20the\x20new\x20tokenizer\x20and\x20chat\x20template\x27\x20or\x20\x27Fix\x20the\x20bug\x20where\x20the\x20user\x20gets\x20redirected\x20from\x20the\x20/feed\x20page\x27.\x20','linesRemoved','linesAdded','-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a','added\x20','basename','Note:\x20The\x20files\x20and\x20line\x20ranges\x20returned\x20by\x20this\x20tool\x20may\x20be\x20some\x20of\x20the\x20ones\x20needed\x20to\x20complete\x20the\x20user\x27s\x20request,\x20but\x20you\x20should\x20be\x20careful\x20in\x20evaluating\x20the\x20relevance\x20of\x20the\x20results,\x20since\x20the\x20subagent\x20might\x20make\x20mistakes.\x20','readFile','text','Example\x20queries:\x20\x27Where\x20is\x20JWT\x20validation?\x27,\x20\x27How\x20does\x20auth\x20work?\x27,\x20\x27Find\x20database\x20connection\x20logic\x27.','--version','timed\x20out','-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a','commitHash','\x0a...\x20(truncated,\x20total:\x20','Bearer\x20','BinaryFile','string','[could\x20not\x20read\x20file:\x20','Parent\x20directory\x20does\x20not\x20exist:\x20','This\x20tool\x20invokes\x20a\x20subagent\x20that\x20runs\x20parallel\x20grep\x20and\x20readfile\x20calls\x20over\x20multiple\x20turns\x20to\x20locate\x20line\x20ranges\x20and\x20files\x20which\x20might\x20be\x20relevant\x20to\x20the\x20request.\x20','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','FileNotFound','mcp-filesystem','Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio','warpgrep_github_search','9198wGVuQf','--help','has','RipgrepError','Specific\x20commit\x20hash\x20to\x20search','<file\x20path=\x22','default','ReadError','@morphllm/morphmcp\x20','ms:','false','**SEMANTIC\x20CODE\x20SEARCH\x20-\x20USE\x20FOR\x20FINDING\x20CODE**\x0a\x0a','changes','resolve','morph-','object','toISOString','stat','optional','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','safeParse','\x27\x20in\x20`','inputSchema'];a0_0x2632=function(){return _0x16cbf2;};return a0_0x2632();}function expandHome(_0x2b3dbf){const _0x3a6f0b=a0_0x15caa6;if(_0x2b3dbf[_0x3a6f0b(0x284)]('~/')||_0x2b3dbf==='~')return a0_0x1fe176['join'](a0_0x3b7341[_0x3a6f0b(0x1c0)](),_0x2b3dbf['slice'](0x1));return _0x2b3dbf;}let allowedDirectories=await Promise['all'](args['map'](async _0x4466db=>{const _0x3636e3=expandHome(_0x4466db),_0x1d48a8=a0_0x1fe176['resolve'](_0x3636e3);try{const _0x3c3c2d=await a0_0x397b2d['realpath'](_0x1d48a8);return normalizePath(_0x3c3c2d);}catch(_0x52423e){return normalizePath(_0x1d48a8);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x15caa6(0x2a9)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories[a0_0x15caa6(0x2ce)](workspaceDir),console[a0_0x15caa6(0x1d5)](a0_0x15caa6(0x236)+workspaceDir+'\x20as\x20allowed\x20directory'));}catch(a0_0x5a70ea){console[a0_0x15caa6(0x1d5)]('Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20'+a0_0x5a70ea);}async function detectWorkspaceRoot(_0x46581d){const _0x18a4bd=a0_0x15caa6;let _0x27e69a=a0_0x1fe176[_0x18a4bd(0x214)](_0x46581d);const _0x4b5c02=[_0x18a4bd(0x24b),_0x18a4bd(0x29b),'package.json',_0x18a4bd(0x23f),_0x18a4bd(0x260),'go.mod',_0x18a4bd(0x1cf),_0x18a4bd(0x2b2),'composer.json'];while(_0x27e69a!==a0_0x1fe176['dirname'](_0x27e69a)){for(const _0x41ded4 of _0x4b5c02){const _0x4a9e02=a0_0x1fe176['join'](_0x27e69a,_0x41ded4);try{return await a0_0x397b2d[_0x18a4bd(0x2d8)](_0x4a9e02),normalizePath(_0x27e69a);}catch{}}_0x27e69a=a0_0x1fe176[_0x18a4bd(0x228)](_0x27e69a);}return normalizePath(_0x46581d);}await Promise[a0_0x15caa6(0x2d7)](args[a0_0x15caa6(0x220)](async _0x5061ae=>{const _0x444cee=a0_0x15caa6;try{const _0x31c6cc=await a0_0x397b2d[_0x444cee(0x218)](expandHome(_0x5061ae));!_0x31c6cc['isDirectory']()&&(console['error'](_0x444cee(0x26e)+_0x5061ae+_0x444cee(0x1bf)),process[_0x444cee(0x2bf)](0x1));}catch(_0x3b4c5d){console[_0x444cee(0x1d5)](_0x444cee(0x28f)+_0x5061ae+':',_0x3b4c5d),process[_0x444cee(0x2bf)](0x1);}}));async function validatePath(_0x2056fd){const _0x9bab3f=a0_0x15caa6,_0x2c446b=expandHome(_0x2056fd),_0x59e028=a0_0x1fe176[_0x9bab3f(0x214)](_0x2c446b);try{const _0x451f6a=await a0_0x397b2d[_0x9bab3f(0x2bb)](_0x59e028);return _0x451f6a;}catch(_0x564ffe){if(_0x564ffe[_0x9bab3f(0x258)]===_0x9bab3f(0x2b0)){const _0x4e7902=a0_0x1fe176[_0x9bab3f(0x228)](_0x59e028);try{const _0x23d596=await a0_0x397b2d[_0x9bab3f(0x2bb)](_0x4e7902);return a0_0x1fe176['join'](_0x23d596,a0_0x1fe176[_0x9bab3f(0x1f2)](_0x59e028));}catch{throw new Error(_0x9bab3f(0x200)+_0x4e7902);}}throw _0x564ffe;}}const MorphEditFileArgsSchema=z[a0_0x15caa6(0x216)]({'path':z[a0_0x15caa6(0x1fe)](),'code_edit':z[a0_0x15caa6(0x1fe)]()[a0_0x15caa6(0x272)](a0_0x15caa6(0x23a)),'instruction':z[a0_0x15caa6(0x1fe)]()[a0_0x15caa6(0x272)](a0_0x15caa6(0x254)),'dryRun':z[a0_0x15caa6(0x25d)]()[a0_0x15caa6(0x20d)](![])[a0_0x15caa6(0x272)](a0_0x15caa6(0x26d))}),WarpGrepArgsSchema=z[a0_0x15caa6(0x216)]({'search_string':z[a0_0x15caa6(0x1fe)]()[a0_0x15caa6(0x272)](a0_0x15caa6(0x1e1)),'repo_path':z[a0_0x15caa6(0x1fe)]()[a0_0x15caa6(0x272)](a0_0x15caa6(0x1d6)),'search_type':z[a0_0x15caa6(0x1e9)]([a0_0x15caa6(0x20d),a0_0x15caa6(0x239)])[a0_0x15caa6(0x219)]()[a0_0x15caa6(0x272)](a0_0x15caa6(0x2d2))}),WarpGrepGitHubArgsSchema=z[a0_0x15caa6(0x216)]({'search_string':z[a0_0x15caa6(0x1fe)]()[a0_0x15caa6(0x272)](a0_0x15caa6(0x1e1)),'github_url':z[a0_0x15caa6(0x1fe)]()['optional']()['describe']('GitHub\x20repository\x20URL\x20to\x20search\x20(e.g.\x20\x27https://github.com/vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.'),'owner_repo':z['string']()[a0_0x15caa6(0x219)]()[a0_0x15caa6(0x272)](a0_0x15caa6(0x1c1)),'branch':z['string']()[a0_0x15caa6(0x219)]()['describe'](a0_0x15caa6(0x229))}),CodebaseSearchArgsSchema=z[a0_0x15caa6(0x216)]({'query':z[a0_0x15caa6(0x1fe)]()[a0_0x15caa6(0x272)]('Natural\x20language\x20query\x20to\x20search\x20for\x20code'),'repoId':z[a0_0x15caa6(0x1fe)]()['describe'](a0_0x15caa6(0x2e1)),'branch':z[a0_0x15caa6(0x1fe)]()[a0_0x15caa6(0x219)]()['describe']('Branch\x20to\x20search\x20(uses\x20latest\x20commit)'),'commitHash':z['string']()['optional']()[a0_0x15caa6(0x272)](a0_0x15caa6(0x20b)),'targetDirectories':z[a0_0x15caa6(0x22d)](z['string']())[a0_0x15caa6(0x20d)]([])[a0_0x15caa6(0x272)](a0_0x15caa6(0x1e2)),'limit':z[a0_0x15caa6(0x2c7)]()[a0_0x15caa6(0x219)]()['default'](0xa)[a0_0x15caa6(0x272)](a0_0x15caa6(0x2cf))}),server=new Server({'name':a0_0x15caa6(0x1e8),'version':a0_0x15caa6(0x278)},{'capabilities':{'tools':{}}});server[a0_0x15caa6(0x22f)](ListToolsRequestSchema,async()=>{const _0x8ea41a=a0_0x15caa6,_0x50eb81=[{'name':'edit_file','description':_0x8ea41a(0x222)+_0x8ea41a(0x271)+_0x8ea41a(0x1ce)+'IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a'+_0x8ea41a(0x2db)+'-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a'+_0x8ea41a(0x1f0)+_0x8ea41a(0x25e)+_0x8ea41a(0x23e)+_0x8ea41a(0x1c8)+_0x8ea41a(0x296)+_0x8ea41a(0x29a)+_0x8ea41a(0x29f)+_0x8ea41a(0x286)+_0x8ea41a(0x2b8)+'Rules:\x0a'+'-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a'+_0x8ea41a(0x25c)+'-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a'+_0x8ea41a(0x1f9)+_0x8ea41a(0x2a2)+'-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a'+_0x8ea41a(0x2a4),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x8ea41a(0x2b5),'description':_0x8ea41a(0x275)+_0x8ea41a(0x201)+_0x8ea41a(0x1ed)+_0x8ea41a(0x26b)+_0x8ea41a(0x2b7)+_0x8ea41a(0x1f3)+'You\x20should\x20consider\x20using\x20classical\x20search\x20tools\x20afterwards\x20to\x20locate\x20the\x20rest,\x20but\x20only\x20if\x20necessary.\x20'+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]},{'name':_0x8ea41a(0x280),'description':_0x8ea41a(0x212)+_0x8ea41a(0x232)+_0x8ea41a(0x1d9)+'Benefits:\x0a'+_0x8ea41a(0x28a)+'-\x20Returns\x20precise\x20code\x20chunks\x20with\x20relevance\x20scores\x0a'+_0x8ea41a(0x28b)+_0x8ea41a(0x2b6)+_0x8ea41a(0x1e5)+_0x8ea41a(0x27b)+_0x8ea41a(0x1f6),'inputSchema':zodToJsonSchema(CodebaseSearchArgsSchema),'requiresApiKey':!![]}],_0x3bd71f=_0x50eb81[_0x8ea41a(0x1cb)](_0x332487=>{const _0x229931=_0x8ea41a;if(_0x229931(0x287)in _0x332487&&_0x332487[_0x229931(0x287)]&&!MORPH_API_KEY)return console['error'](_0x229931(0x1c4)+_0x332487['name']+_0x229931(0x202)),![];return!![];});return{'tools':_0x3bd71f['map'](_0x515fd9=>({'name':_0x515fd9['name'],'description':_0x515fd9[_0x8ea41a(0x298)],'inputSchema':_0x515fd9[_0x8ea41a(0x21d)]}))};}),server[a0_0x15caa6(0x22f)](CallToolRequestSchema,async _0x5b0931=>{const _0x5f1d5b=a0_0x15caa6;try{const {name:_0x296bec,arguments:_0x2721fe}=_0x5b0931[_0x5f1d5b(0x1d7)];switch(_0x296bec){case _0x5f1d5b(0x1da):{const _0x49a3c6=MorphEditFileArgsSchema[_0x5f1d5b(0x21b)](_0x2721fe);if(!_0x49a3c6[_0x5f1d5b(0x240)])throw new Error(_0x5f1d5b(0x22e)+_0x49a3c6[_0x5f1d5b(0x1d5)]);const _0x553779=await validatePath(_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x2ac)]);let _0x2d6d30=null,_0x349bef=!![],_0x3f7b51=null;try{_0x2d6d30=await a0_0x397b2d[_0x5f1d5b(0x1f4)](_0x553779,_0x5f1d5b(0x1ec));}catch(_0xae454c){const _0x1732fa=_0xae454c[_0x5f1d5b(0x258)];_0x1732fa===_0x5f1d5b(0x2b0)?(_0x349bef=![],_0x2d6d30=''):(_0x3f7b51=_0x5f1d5b(0x1e7)+(_0x1732fa||_0x5f1d5b(0x2af))+_0x5f1d5b(0x251)+(_0xae454c instanceof Error?_0xae454c['message']:String(_0xae454c)),console[_0x5f1d5b(0x1d5)]('Warning:\x20'+_0x3f7b51));}let _0x4e9941;try{const _0x2d2072=MORPH_API_KEY;if(!_0x2d2072)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.');const _0x52c983=a0_0x1fe176[_0x5f1d5b(0x228)](_0x553779),_0xd623aa=a0_0x1fe176['basename'](_0x553779),_0x3d25ea=await executeEditFile({'target_filepath':_0xd623aa,'code_edit':_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x248)],'instructions':_0x49a3c6['data'][_0x5f1d5b(0x238)]},{'morphApiKey':_0x2d2072,'morphApiUrl':MORPH_API_URL,'baseDir':_0x52c983,'autoWrite':!_0x49a3c6['data'][_0x5f1d5b(0x1d8)],'generateUdiff':![],'debug':![]});_0x4e9941=_0x3d25ea[_0x5f1d5b(0x2d9)];if(!_0x3d25ea[_0x5f1d5b(0x240)])throw new Error(_0x3d25ea[_0x5f1d5b(0x1d5)]||_0x5f1d5b(0x223));const _0x3f2622=_0x3d25ea[_0x5f1d5b(0x213)],_0x473ae3=_0x5f1d5b(0x1f1)+_0x3f2622[_0x5f1d5b(0x1ef)]+_0x5f1d5b(0x233)+_0x3f2622[_0x5f1d5b(0x1ee)]+_0x5f1d5b(0x264)+_0x3f2622[_0x5f1d5b(0x289)];if(_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x1d8)])return{'content':[{'type':_0x5f1d5b(0x1f5),'text':_0x5f1d5b(0x2c8)+(_0x349bef?'':_0x5f1d5b(0x295))+':\x20'+_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x238)]+'.\x20Changes:\x20'+_0x473ae3+_0x5f1d5b(0x1d3)+_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x2ac)]+'.'}]};return{'content':[{'type':'text','text':'Morph\x20Edit\x20'+(_0x349bef?_0x5f1d5b(0x2bd):_0x5f1d5b(0x256))+':\x20'+_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x238)]+_0x5f1d5b(0x247)+_0x473ae3+_0x5f1d5b(0x1d3)+_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x2ac)]+'.'}]};}catch(_0x5233cb){const _0x446a6f=_0x5233cb instanceof Error?_0x5233cb[_0x5f1d5b(0x2c1)]:String(_0x5233cb);return reportMorphError({'error_message':_0x446a6f,'error_type':_0x5233cb instanceof Error?_0x5233cb[_0x5f1d5b(0x1c9)][_0x5f1d5b(0x2b9)]:'UnknownError','context':{'tool':_0x5f1d5b(0x1da),'completion_id':_0x4e9941,'file_path':_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x2ac)],'validated_path':_0x553779,'instruction':_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x238)],'model':_0x5f1d5b(0x1dc),'dry_run':_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x1d8)],'file_exists':_0x349bef,'file_read_error':_0x3f7b51,'file_readable':_0x2d6d30!==null,'request_content':{'path':_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x2ac)],'code_edit':_0x49a3c6[_0x5f1d5b(0x292)]['code_edit'],'instruction':_0x49a3c6[_0x5f1d5b(0x292)][_0x5f1d5b(0x238)],'original_code':_0x2d6d30!==null?_0x2d6d30[_0x5f1d5b(0x2a9)]>0xc350?_0x2d6d30[_0x5f1d5b(0x2c2)](0x0,0xc350)+_0x5f1d5b(0x1fb)+_0x2d6d30['length']+'\x20chars)':_0x2d6d30:_0x5f1d5b(0x1ff)+(_0x3f7b51||_0x5f1d5b(0x274))+']','original_code_length':_0x2d6d30?.[_0x5f1d5b(0x2a9)]??0x0,'model':_0x5f1d5b(0x1dc),'dry_run':_0x49a3c6['data']['dryRun']}},'stack_trace':_0x5233cb instanceof Error?_0x5233cb[_0x5f1d5b(0x28d)]:undefined,'source':_0x5f1d5b(0x204)})['catch'](()=>{}),{'content':[{'type':_0x5f1d5b(0x1f5),'text':_0x5f1d5b(0x1ca)+_0x446a6f}],'isError':!![]};}}case _0x5f1d5b(0x2b5):{const _0x17dc7c=WarpGrepArgsSchema[_0x5f1d5b(0x21b)](_0x2721fe);if(!_0x17dc7c['success'])return{'content':[{'type':_0x5f1d5b(0x1f5),'text':'Invalid\x20arguments:\x20'+_0x17dc7c[_0x5f1d5b(0x1d5)]}],'isError':!![]};const _0x19f572=_0x164ffb=>{const _0x5b4a39=_0x5f1d5b,_0x3135c1=[];for(const _0x81d9ee of _0x164ffb||[]){const _0x4dde25=_0x81d9ee[_0x5b4a39(0x29d)],_0x5273cb=_0x81d9ee[_0x5b4a39(0x27d)];if(_0x4dde25===_0x5b4a39(0x2be)&&_0x5273cb){const _0xd297a8=_0x5273cb[_0x5b4a39(0x2b1)]('\x0a')['filter'](_0x5ee67e=>_0x5ee67e[_0x5b4a39(0x1d2)]());for(const _0x29a3be of _0xd297a8){const _0x3e2ccd=_0x29a3be[_0x5b4a39(0x2d5)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x3e2ccd){_0x3135c1['push']('grep\x20\x27'+_0x3e2ccd[0x1]+'\x27\x20'+_0x3e2ccd[0x2]);continue;}const _0x504b63=_0x29a3be[_0x5b4a39(0x2d5)](/^read\s+(.+)$/);if(_0x504b63){_0x3135c1[_0x5b4a39(0x2ce)](_0x5b4a39(0x1eb)+_0x504b63[0x1]);continue;}const _0xc24c19=_0x29a3be[_0x5b4a39(0x2d5)](/^list_directory\s+(.+)$/);if(_0xc24c19){_0x3135c1[_0x5b4a39(0x2ce)](_0x5b4a39(0x262)+_0xc24c19[0x1]);continue;}}}}return _0x3135c1;},_0x4bdf16=_0x30d44b=>{const _0xc4d802=_0x5f1d5b,_0x47b484=[];if(!_0x30d44b||!Array[_0xc4d802(0x22a)](_0x30d44b))return _0x47b484;const _0x26ea6d=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':_0xc4d802(0x203),'tool':_0xc4d802(0x1d1)},{'pattern':/\[PATH ERROR\]/,'error_type':_0xc4d802(0x268),'tool':_0xc4d802(0x1d1)},{'pattern':/\[READ ERROR\]/,'error_type':_0xc4d802(0x20e),'tool':'read'},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0xc4d802(0x1fd),'tool':_0xc4d802(0x1d1)},{'pattern':/\[RIPGREP ERROR\]/,'error_type':_0xc4d802(0x20a),'tool':'grep'},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':_0xc4d802(0x22b),'tool':'grep'},{'pattern':/\[BINARY FILE\]/,'error_type':_0xc4d802(0x1fd),'tool':_0xc4d802(0x1d1)},{'pattern':/\[SYMLINK\]/,'error_type':_0xc4d802(0x2ae),'tool':_0xc4d802(0x1d1)},{'pattern':/not a text file/,'error_type':_0xc4d802(0x1fd),'tool':_0xc4d802(0x1d1)},{'pattern':/symbolic link/,'error_type':_0xc4d802(0x2ae),'tool':_0xc4d802(0x1d1)},{'pattern':/Error reading file:/,'error_type':'ReadError','tool':'read'},{'pattern':/status="error"/,'error_type':'ToolException','tool':'unknown'}];let _0x2dd066=0x0;for(const _0x37f322 of _0x30d44b){if(_0x37f322[_0xc4d802(0x29d)]===_0xc4d802(0x282)){_0x2dd066++;const _0x371386=_0x37f322[_0xc4d802(0x27d)];if(!_0x371386||typeof _0x371386!==_0xc4d802(0x1fe))continue;for(const {pattern:_0x218ac5,error_type:_0x456e54,tool:_0x56434d}of _0x26ea6d){const _0xbbca=_0x371386[_0xc4d802(0x2d5)](new RegExp(_0x218ac5['source'],'g'));if(_0xbbca)for(const _0x48451f of _0xbbca){const _0x3f7a02=_0x371386[_0xc4d802(0x1c6)](_0x48451f),_0x5b0f72=_0x371386['substring'](_0x3f7a02,Math[_0xc4d802(0x2cc)](_0x3f7a02+0xc8,_0x371386[_0xc4d802(0x2a9)]));_0x47b484['push']({'tool':_0x56434d,'error_type':_0x456e54,'error_message':_0x5b0f72[_0xc4d802(0x2b1)]('\x0a')[0x0],'turn':_0x2dd066});}}}}return _0x47b484;};try{const _0x109b8e=a0_0x1fe176[_0x5f1d5b(0x214)](_0x17dc7c[_0x5f1d5b(0x292)]['repo_path']),_0x587104=_0x17dc7c[_0x5f1d5b(0x292)]['search_type'],_0x5eb6d5=_0x587104==='node_modules'?{'allowNames':[_0x5f1d5b(0x239)]}:undefined,_0x344cd6=new LocalRipgrepProvider(_0x109b8e,undefined,_0x5eb6d5),_0x20d932=await runWarpGrep({'query':_0x17dc7c[_0x5f1d5b(0x292)]['search_string'],'repoRoot':_0x109b8e,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x344cd6,'search_type':_0x587104}),_0x15aa89=_0x4bdf16(_0x20d932['messages']);_0x15aa89[_0x5f1d5b(0x2a9)]>0x0&&reportMorphError({'error_message':'WarpGrep\x20sub-tool\x20errors:\x20'+_0x15aa89[_0x5f1d5b(0x2a9)]+_0x5f1d5b(0x259),'error_type':_0x5f1d5b(0x24f),'level':_0x5f1d5b(0x225),'tool':'warpgrep_codebase_search','context':{'repo_path':_0x17dc7c['data'][_0x5f1d5b(0x257)],'query':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x230)],'model':'morph-warp-grep-v1-1111v0','termination_reason':_0x20d932[_0x5f1d5b(0x2a6)],'sub_tool_errors':_0x15aa89,'timings':_0x20d932[_0x5f1d5b(0x2c0)],'tool_calls':_0x19f572(_0x20d932[_0x5f1d5b(0x2d1)]),'messages':_0x20d932[_0x5f1d5b(0x2d1)]?.[_0x5f1d5b(0x220)](_0x2907b3=>({'role':_0x2907b3[_0x5f1d5b(0x29d)],'content':_0x2907b3[_0x5f1d5b(0x27d)]}))},'source':_0x5f1d5b(0x204)})[_0x5f1d5b(0x2cb)](()=>{});let _0x2d66e1='';if(_0x20d932['terminationReason']==='completed'&&_0x20d932[_0x5f1d5b(0x26f)]?.[_0x5f1d5b(0x269)]?.[_0x5f1d5b(0x22c)]){const _0xc37a46=_0x20d932[_0x5f1d5b(0x26f)][_0x5f1d5b(0x269)][_0x5f1d5b(0x22c)];if(_0xc37a46[_0x5f1d5b(0x2a9)]===0x0)return _0x2d66e1=_0x20d932[_0x5f1d5b(0x26f)]['payload']||_0x5f1d5b(0x277),{'content':[{'type':'text','text':_0x2d66e1}]};const _0x53cabc=[],_0x557bce=[_0x5f1d5b(0x294)];for(const _0x264eb9 of _0x20d932['messages']){const _0x131c83=_0x264eb9[_0x5f1d5b(0x29d)],_0x23689f=_0x264eb9['content'];if(_0x131c83===_0x5f1d5b(0x2be)&&_0x23689f){const _0x2cb4b8=_0x23689f[_0x5f1d5b(0x2b1)]('\x0a')[_0x5f1d5b(0x1cb)](_0xd890c6=>_0xd890c6[_0x5f1d5b(0x1d2)]());for(const _0xa354c2 of _0x2cb4b8){const _0x4d1651=_0xa354c2[_0x5f1d5b(0x2d5)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x4d1651){_0x557bce[_0x5f1d5b(0x2ce)](_0x5f1d5b(0x24a)+_0x4d1651[0x1]+_0x5f1d5b(0x21c)+_0x4d1651[0x2]+'`');continue;}const _0x3e261a=_0xa354c2[_0x5f1d5b(0x2d5)](/^read\s+(.+)$/);if(_0x3e261a){_0x557bce[_0x5f1d5b(0x2ce)](_0x5f1d5b(0x2bc)+_0x3e261a[0x1]+'`');continue;}const _0x506852=_0xa354c2[_0x5f1d5b(0x2d5)](/^list_directory\s+(.+)$/);if(_0x506852){_0x557bce[_0x5f1d5b(0x2ce)](_0x5f1d5b(0x1be)+_0x506852[0x1]+'`');continue;}}}}_0x53cabc['push'](_0x557bce[_0x5f1d5b(0x2c3)]('\x0a'));const _0x2acad7=['',_0x5f1d5b(0x2e0)];for(const _0x2ecde8 of _0xc37a46){if(_0x2ecde8[_0x5f1d5b(0x2ad)]==='*')_0x2acad7['push']('-\x20'+_0x2ecde8['path']+':*');else{if(Array[_0x5f1d5b(0x22a)](_0x2ecde8[_0x5f1d5b(0x2ad)])){const _0x53e203=_0x2ecde8[_0x5f1d5b(0x2ad)]['map'](([_0x6c6075,_0x9be05e])=>{if(_0x6c6075===_0x9be05e)return''+_0x6c6075;return _0x6c6075+'-'+_0x9be05e;});_0x2acad7[_0x5f1d5b(0x2ce)]('-\x20'+_0x2ecde8[_0x5f1d5b(0x2ac)]+':'+_0x53e203['join'](','));}else _0x2acad7[_0x5f1d5b(0x2ce)]('-\x20'+_0x2ecde8[_0x5f1d5b(0x2ac)]+':*');}}_0x2acad7[_0x5f1d5b(0x2ce)](''),_0x53cabc[_0x5f1d5b(0x2ce)](_0x2acad7[_0x5f1d5b(0x2c3)]('\x0a')),_0x53cabc[_0x5f1d5b(0x2ce)](_0x5f1d5b(0x2b3));const _0x17b67f=[];for(const _0x496fee of _0xc37a46){let _0x1a6d12=a0_0x1fe176[_0x5f1d5b(0x214)](_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x257)],_0x496fee[_0x5f1d5b(0x2ac)]),_0x5434d6=null,_0xb694fc=null;try{_0x5434d6=await a0_0x397b2d['readFile'](_0x1a6d12,{'encoding':_0x5f1d5b(0x1ec)});}catch(_0x5a6cba){const _0x3bb5ee=fixPathRepetition(_0x1a6d12);if(_0x3bb5ee)try{_0x5434d6=await a0_0x397b2d[_0x5f1d5b(0x1f4)](_0x3bb5ee,{'encoding':_0x5f1d5b(0x1ec)}),_0x1a6d12=_0x3bb5ee;}catch{_0xb694fc=_0x5a6cba instanceof Error?_0x5a6cba:new Error(String(_0x5a6cba));}else _0xb694fc=_0x5a6cba instanceof Error?_0x5a6cba:new Error(String(_0x5a6cba));}if(_0x5434d6!==null){const _0x345265=_0x5434d6[_0x5f1d5b(0x2b1)](/\r?\n/),_0x693fee=[_0x5f1d5b(0x20c)+_0x496fee[_0x5f1d5b(0x2ac)]+'\x22>'];if(_0x496fee[_0x5f1d5b(0x2ad)]==='*'||!Array[_0x5f1d5b(0x22a)](_0x496fee['lines']))for(let _0x2a56dd=0x1;_0x2a56dd<=_0x345265[_0x5f1d5b(0x2a9)];_0x2a56dd++){const _0x11d257=_0x345265[_0x2a56dd-0x1];_0x693fee[_0x5f1d5b(0x2ce)](_0x2a56dd+'|\x20'+_0x11d257);}else for(const [_0x125587,_0x48d67a]of _0x496fee['lines']){_0x693fee[_0x5f1d5b(0x2a9)]>0x1&&_0x693fee[_0x5f1d5b(0x2ce)]('');for(let _0x2eca38=_0x125587;_0x2eca38<=_0x48d67a&&_0x2eca38<=_0x345265[_0x5f1d5b(0x2a9)];_0x2eca38++){const _0x341c23=_0x345265[_0x2eca38-0x1];_0x693fee[_0x5f1d5b(0x2ce)](_0x2eca38+'|\x20'+_0x341c23);}}_0x693fee['push'](_0x5f1d5b(0x2aa)),_0x17b67f[_0x5f1d5b(0x2ce)](_0x693fee[_0x5f1d5b(0x2c3)]('\x0a'));}else _0x17b67f[_0x5f1d5b(0x2ce)](_0x5f1d5b(0x20c)+_0x496fee[_0x5f1d5b(0x2ac)]+_0x5f1d5b(0x2cd)+(_0xb694fc?.[_0x5f1d5b(0x2c1)]||_0x5f1d5b(0x23c))+_0x5f1d5b(0x2b4));}_0x53cabc['push'](_0x17b67f[_0x5f1d5b(0x2c3)]('\x0a\x0a')),_0x2d66e1=_0x53cabc[_0x5f1d5b(0x2c3)]('\x0a');const _0x16abc8=_0x20d932[_0x5f1d5b(0x27f)]?.[_0x5f1d5b(0x1cb)](_0x510a53=>_0x510a53[_0x5f1d5b(0x2c1)]?.[_0x5f1d5b(0x284)]('File\x20read\x20error:'))||[];if(_0x16abc8[_0x5f1d5b(0x2a9)]>0x0){const _0x1c85ba=_0x16abc8['map'](_0x54667e=>_0x54667e[_0x5f1d5b(0x2c1)])[_0x5f1d5b(0x2c3)](';\x20');reportMorphError({'error_message':_0x1c85ba,'error_type':_0x5f1d5b(0x1dd),'context':{'tool':'warpgrep_codebase_search','repo_path':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x257)],'query':_0x17dc7c['data'][_0x5f1d5b(0x230)],'model':_0x5f1d5b(0x246),'termination_reason':_0x5f1d5b(0x2ca),'error_count':_0x16abc8[_0x5f1d5b(0x2a9)],'is_timeout':![],'timings':_0x20d932[_0x5f1d5b(0x2c0)],'files_attempted':_0xc37a46['map'](_0x31ab6c=>({'path':_0x31ab6c[_0x5f1d5b(0x2ac)],'lines':_0x31ab6c[_0x5f1d5b(0x2ad)]})),'tool_calls':_0x19f572(_0x20d932[_0x5f1d5b(0x2d1)]),'messages':_0x20d932[_0x5f1d5b(0x2d1)]?.['map'](_0x49b600=>({'role':_0x49b600['role'],'content':_0x49b600[_0x5f1d5b(0x27d)]})),'request_content':{'query':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x230)],'repo_path':_0x17dc7c[_0x5f1d5b(0x292)]['repo_path'],'repoRoot':a0_0x1fe176['resolve'](_0x17dc7c[_0x5f1d5b(0x292)]['repo_path']),'model':'morph-warp-grep-v1-1111v0'}},'source':_0x5f1d5b(0x204)})[_0x5f1d5b(0x2cb)](()=>{});}}else{if(_0x20d932['terminationReason']==='terminated'&&_0x20d932[_0x5f1d5b(0x27f)]['length']>0x0){const _0x247f9f=_0x20d932[_0x5f1d5b(0x27f)][_0x5f1d5b(0x220)](_0x5608ee=>_0x5608ee[_0x5f1d5b(0x2c1)])['join'](';\x20');_0x2d66e1=_0x5f1d5b(0x26e)+_0x247f9f;const _0x3c1f15=_0x247f9f[_0x5f1d5b(0x2a1)]()[_0x5f1d5b(0x1d0)](_0x5f1d5b(0x27c))||_0x247f9f[_0x5f1d5b(0x2a1)]()[_0x5f1d5b(0x1d0)]('timed\x20out')||_0x247f9f[_0x5f1d5b(0x2a1)]()[_0x5f1d5b(0x1d0)](_0x5f1d5b(0x241)),_0x3383a0=_0x20d932[_0x5f1d5b(0x26f)]?.['metadata']?.[_0x5f1d5b(0x22c)],_0xe41ada=_0x20d932['errors'][0x0];reportMorphError({'error_message':_0x247f9f,'error_type':_0x3c1f15?_0x5f1d5b(0x1cc):_0xe41ada?.[_0x5f1d5b(0x1c9)]?.[_0x5f1d5b(0x2b9)]||_0x5f1d5b(0x1cd),'context':{'tool':_0x5f1d5b(0x2b5),'repo_path':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x257)],'query':_0x17dc7c['data']['search_string'],'model':_0x5f1d5b(0x246),'termination_reason':_0x20d932['terminationReason'],'error_count':_0x20d932[_0x5f1d5b(0x27f)][_0x5f1d5b(0x2a9)],'is_timeout':_0x3c1f15,'timings':_0x20d932['timings'],'files_attempted':_0x3383a0?.[_0x5f1d5b(0x220)](_0x43a434=>({'path':_0x43a434[_0x5f1d5b(0x2ac)],'lines':_0x43a434[_0x5f1d5b(0x2ad)]})),'tool_calls':_0x19f572(_0x20d932[_0x5f1d5b(0x2d1)]),'messages':_0x20d932[_0x5f1d5b(0x2d1)]?.[_0x5f1d5b(0x220)](_0x335328=>({'role':_0x335328[_0x5f1d5b(0x29d)],'content':_0x335328[_0x5f1d5b(0x27d)]})),'request_content':{'query':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x230)],'repo_path':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x257)],'repoRoot':a0_0x1fe176[_0x5f1d5b(0x214)](_0x17dc7c[_0x5f1d5b(0x292)]['repo_path']),'model':_0x5f1d5b(0x246)}},'stack_trace':_0xe41ada?.[_0x5f1d5b(0x28d)]||undefined,'source':_0x5f1d5b(0x204)})[_0x5f1d5b(0x2cb)](()=>{});}else _0x2d66e1='Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.';}return{'content':[{'type':'text','text':_0x2d66e1}]};}catch(_0x188251){const _0x33b196=_0x188251 instanceof Error?_0x188251['message']:String(_0x188251),_0x3c2444=_0x33b196[_0x5f1d5b(0x2a1)]()['includes'](_0x5f1d5b(0x27c))||_0x33b196[_0x5f1d5b(0x2a1)]()[_0x5f1d5b(0x1d0)](_0x5f1d5b(0x1f8))||_0x33b196[_0x5f1d5b(0x2a1)]()[_0x5f1d5b(0x1d0)](_0x5f1d5b(0x241))||_0x188251 instanceof Error&&_0x188251['name']===_0x5f1d5b(0x1cc);return reportMorphError({'error_message':_0x33b196,'error_type':_0x3c2444?_0x5f1d5b(0x1cc):_0x188251 instanceof Error?_0x188251[_0x5f1d5b(0x1c9)][_0x5f1d5b(0x2b9)]:'UnknownError','context':{'tool':'warpgrep_codebase_search','repo_path':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x257)],'query':_0x17dc7c['data'][_0x5f1d5b(0x230)],'model':_0x5f1d5b(0x246),'is_timeout':_0x3c2444,'exception_phase':_0x5f1d5b(0x279),'request_content':{'query':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x230)],'repo_path':_0x17dc7c[_0x5f1d5b(0x292)][_0x5f1d5b(0x257)],'repoRoot':a0_0x1fe176[_0x5f1d5b(0x214)](_0x17dc7c[_0x5f1d5b(0x292)]['repo_path']),'model':_0x5f1d5b(0x246)}},'stack_trace':_0x188251 instanceof Error?_0x188251['stack']:undefined,'source':_0x5f1d5b(0x204)})[_0x5f1d5b(0x2cb)](()=>{}),{'content':[{'type':_0x5f1d5b(0x1f5),'text':_0x5f1d5b(0x227)+_0x33b196}],'isError':![]};}}case _0x5f1d5b(0x206):{const _0x556212=WarpGrepGitHubArgsSchema[_0x5f1d5b(0x21b)](_0x2721fe);if(!_0x556212[_0x5f1d5b(0x240)])return{'content':[{'type':_0x5f1d5b(0x1f5),'text':'Invalid\x20arguments:\x20'+_0x556212[_0x5f1d5b(0x1d5)]}],'isError':!![]};const _0x3108d3=_0x556212['data'][_0x5f1d5b(0x283)]||_0x556212['data'][_0x5f1d5b(0x1de)];if(!_0x3108d3)return{'content':[{'type':'text','text':'Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id'}],'isError':!![]};const _0x19429d=MORPH_API_KEY;if(!_0x19429d)throw new Error(_0x5f1d5b(0x21e));const _0x1dac67=Date[_0x5f1d5b(0x237)]();console[_0x5f1d5b(0x1d5)](_0x5f1d5b(0x1ea)+_0x3108d3+_0x5f1d5b(0x29c)+_0x556212[_0x5f1d5b(0x292)][_0x5f1d5b(0x230)]+'\x22');try{const _0x5a0ecb=new WarpGrepClient({'morphApiKey':_0x19429d,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x4e5835=await _0x5a0ecb[_0x5f1d5b(0x2e3)]({'query':_0x556212[_0x5f1d5b(0x292)][_0x5f1d5b(0x230)],'github':_0x3108d3,'branch':_0x556212[_0x5f1d5b(0x292)][_0x5f1d5b(0x23b)]}),_0x12b9d9=Date[_0x5f1d5b(0x237)]()-_0x1dac67;console[_0x5f1d5b(0x1d5)](_0x5f1d5b(0x224)+_0x12b9d9+_0x5f1d5b(0x242)+_0x4e5835[_0x5f1d5b(0x240)]);const _0x47aee2=formatResult(_0x4e5835);return{'content':[{'type':'text','text':_0x47aee2}]};}catch(_0x3f1e26){const _0x314576=Date[_0x5f1d5b(0x237)]()-_0x1dac67,_0x2fca58=_0x3f1e26 instanceof Error?_0x3f1e26[_0x5f1d5b(0x2c1)]:String(_0x3f1e26);return console[_0x5f1d5b(0x1d5)](_0x5f1d5b(0x250)+_0x314576+_0x5f1d5b(0x210),_0x2fca58),reportMorphError({'error_message':_0x2fca58,'error_type':_0x3f1e26 instanceof Error?_0x3f1e26[_0x5f1d5b(0x1c9)][_0x5f1d5b(0x2b9)]:'UnknownError','context':{'tool':_0x5f1d5b(0x206),'github_url':_0x3108d3,'search_string':_0x556212['data'][_0x5f1d5b(0x230)],'branch':_0x556212[_0x5f1d5b(0x292)]['branch']},'stack_trace':_0x3f1e26 instanceof Error?_0x3f1e26[_0x5f1d5b(0x28d)]:undefined,'source':'mcp-filesystem','tool':_0x5f1d5b(0x206),'latency_ms':_0x314576})['catch'](()=>{}),{'content':[{'type':_0x5f1d5b(0x1f5),'text':_0x5f1d5b(0x1e3)+_0x2fca58}],'isError':![]};}}case _0x5f1d5b(0x280):{const _0xed27dc=CodebaseSearchArgsSchema['safeParse'](_0x2721fe);if(!_0xed27dc[_0x5f1d5b(0x240)])return{'content':[{'type':_0x5f1d5b(0x1f5),'text':_0x5f1d5b(0x291)+_0xed27dc['error']}],'isError':!![]};try{const _0x24f4c1=MORPH_API_KEY;if(!_0x24f4c1)throw new Error(_0x5f1d5b(0x26a));const _0x43e04e=_0xed27dc['data'][_0x5f1d5b(0x27e)],_0x47dfc6=await executeCodebaseSearch({'query':_0xed27dc[_0x5f1d5b(0x292)][_0x5f1d5b(0x2a0)],'target_directories':_0x43e04e,'limit':_0xed27dc['data']['limit']},{'apiKey':_0x24f4c1,'repoId':_0xed27dc[_0x5f1d5b(0x292)][_0x5f1d5b(0x2d0)],'branch':_0xed27dc[_0x5f1d5b(0x292)][_0x5f1d5b(0x23b)],'commitHash':_0xed27dc[_0x5f1d5b(0x292)][_0x5f1d5b(0x1fa)],'debug':![]});if(!_0x47dfc6[_0x5f1d5b(0x240)])return{'content':[{'type':'text','text':_0x5f1d5b(0x265)+_0x47dfc6[_0x5f1d5b(0x1d5)]}],'isError':!![]};const _0x1d54c0=_0x47dfc6[_0x5f1d5b(0x243)][_0x5f1d5b(0x2a9)]===0x0?_0x5f1d5b(0x25b)+_0xed27dc['data'][_0x5f1d5b(0x2a0)]+'\x22':_0x5f1d5b(0x2e2)+_0x47dfc6['results'][_0x5f1d5b(0x2a9)]+_0x5f1d5b(0x1e6)+_0x47dfc6[_0x5f1d5b(0x261)]['searchTimeMs']+'ms:\x0a\x0a'+_0x47dfc6[_0x5f1d5b(0x243)][_0x5f1d5b(0x220)]((_0x5ae61d,_0x48c99e)=>_0x48c99e+0x1+'.\x20'+_0x5ae61d[_0x5f1d5b(0x263)]+'\x20('+(_0x5ae61d[_0x5f1d5b(0x1c7)]*0x64)[_0x5f1d5b(0x28e)](0x1)+_0x5f1d5b(0x24d)+('\x20\x20\x20Lines\x20'+_0x5ae61d[_0x5f1d5b(0x267)]+'-'+_0x5ae61d['endLine']+'\x0a')+(_0x5f1d5b(0x1db)+_0x5ae61d[_0x5f1d5b(0x27d)][_0x5f1d5b(0x2c2)](0x0,0xc8)+(_0x5ae61d[_0x5f1d5b(0x27d)][_0x5f1d5b(0x2a9)]>0xc8?_0x5f1d5b(0x299):'')+'\x0a'))[_0x5f1d5b(0x2c3)]('\x0a');return{'content':[{'type':'text','text':_0x1d54c0}]};}catch(_0x59935a){const _0x45ea12=_0x59935a instanceof Error?_0x59935a[_0x5f1d5b(0x2c1)]:String(_0x59935a);return reportMorphError({'error_message':_0x45ea12,'error_type':_0x59935a instanceof Error?_0x59935a['constructor'][_0x5f1d5b(0x2b9)]:_0x5f1d5b(0x234),'context':{'tool':_0x5f1d5b(0x280),'query':_0xed27dc[_0x5f1d5b(0x292)]['query'],'repo_id':_0xed27dc[_0x5f1d5b(0x292)][_0x5f1d5b(0x2d0)],'target_directories':_0xed27dc[_0x5f1d5b(0x292)][_0x5f1d5b(0x27e)]},'stack_trace':_0x59935a instanceof Error?_0x59935a[_0x5f1d5b(0x28d)]:undefined,'source':_0x5f1d5b(0x204)})[_0x5f1d5b(0x2cb)](()=>{}),{'content':[{'type':_0x5f1d5b(0x1f5),'text':_0x5f1d5b(0x26e)+_0x45ea12}],'isError':!![]};}}default:throw new Error(_0x5f1d5b(0x231)+_0x296bec);}}catch(_0x140f4f){const _0x45ca8f=_0x140f4f instanceof Error?_0x140f4f[_0x5f1d5b(0x2c1)]:String(_0x140f4f);return reportMorphError({'error_message':_0x45ca8f,'error_type':_0x140f4f instanceof Error?_0x140f4f[_0x5f1d5b(0x1c9)][_0x5f1d5b(0x2b9)]:'UnknownError','context':{'tool':name,'arguments':args?JSON[_0x5f1d5b(0x2de)](args)['substring'](0x0,0x1f4):undefined,'mcp_server_version':_0x5f1d5b(0x278)},'stack_trace':_0x140f4f instanceof Error?_0x140f4f[_0x5f1d5b(0x28d)]:undefined,'source':_0x5f1d5b(0x204)})[_0x5f1d5b(0x2cb)](()=>{}),{'content':[{'type':_0x5f1d5b(0x1f5),'text':_0x5f1d5b(0x26e)+_0x45ca8f}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x45a317){const _0x1b841e=a0_0x15caa6,_0x2b5fbd=await getValidRootDirectories(_0x45a317);if(_0x2b5fbd[_0x1b841e(0x2a9)]>0x0)allowedDirectories=[..._0x2b5fbd],console[_0x1b841e(0x1d5)]('Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20'+_0x2b5fbd[_0x1b841e(0x2a9)]+'\x20valid\x20directories');else{console[_0x1b841e(0x1d5)](_0x1b841e(0x21a));if(ENABLE_WORKSPACE_MODE)try{const _0x5ea4dd=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x5ea4dd&&(allowedDirectories=[_0x5ea4dd],console[_0x1b841e(0x1d5)](_0x1b841e(0x226)+_0x5ea4dd));}catch(_0x190d66){console['error'](_0x1b841e(0x293)+_0x190d66);}}}server[a0_0x15caa6(0x273)](RootsListChangedNotificationSchema,async()=>{const _0x18c3a8=a0_0x15caa6;try{const _0x402afe=await server[_0x18c3a8(0x285)]();_0x402afe&&'roots'in _0x402afe&&await updateAllowedDirectoriesFromRoots(_0x402afe['roots']);}catch(_0x13f636){console[_0x18c3a8(0x1d5)](_0x18c3a8(0x24e),_0x13f636 instanceof Error?_0x13f636[_0x18c3a8(0x2c1)]:String(_0x13f636));}}),server['oninitialized']=async()=>{const _0x4828ff=a0_0x15caa6,_0x4360ad=server['getClientCapabilities']();if(_0x4360ad?.[_0x4828ff(0x2a8)])try{const _0xe0ffa1=await server['listRoots']();_0xe0ffa1&&_0x4828ff(0x2a8)in _0xe0ffa1?await updateAllowedDirectoriesFromRoots(_0xe0ffa1[_0x4828ff(0x2a8)]):console[_0x4828ff(0x1d5)](_0x4828ff(0x281));}catch(_0x154376){console[_0x4828ff(0x1d5)](_0x4828ff(0x2df),_0x154376 instanceof Error?_0x154376[_0x4828ff(0x2c1)]:String(_0x154376));}else{if(allowedDirectories[_0x4828ff(0x2a9)]>0x0)console[_0x4828ff(0x1d5)](_0x4828ff(0x249),allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)console[_0x4828ff(0x1d5)](_0x4828ff(0x25f));else throw new Error('Server\x20cannot\x20operate:\x20No\x20allowed\x20directories\x20available.\x20Server\x20was\x20started\x20without\x20command-line\x20directories\x20and\x20client\x20either\x20does\x20not\x20support\x20MCP\x20roots\x20protocol\x20or\x20provided\x20empty\x20roots.\x20Please\x20either:\x201)\x20Start\x20server\x20with\x20directory\x20arguments,\x202)\x20Use\x20a\x20client\x20that\x20supports\x20MCP\x20roots\x20protocol\x20and\x20provides\x20valid\x20root\x20directories,\x20or\x203)\x20Enable\x20workspace\x20mode\x20with\x20ENABLE_WORKSPACE_MODE=true.');}}};async function runServer(){const _0x62b0e7=a0_0x15caa6,_0x265e6e=new StdioServerTransport();await server[_0x62b0e7(0x28c)](_0x265e6e),console[_0x62b0e7(0x1d5)](_0x62b0e7(0x205)),allowedDirectories['length']===0x0&&console[_0x62b0e7(0x1d5)](_0x62b0e7(0x21f));}runServer()[a0_0x15caa6(0x2cb)](_0x3d4659=>{const _0x5ab567=a0_0x15caa6;console[_0x5ab567(0x1d5)]('Fatal\x20error\x20running\x20server:',_0x3d4659),process[_0x5ab567(0x2bf)](0x1);});
@@ -1 +1 @@
1
- function a1_0x2d32(){const _0x1ad9b0=['5068848VjKSTb','normalize','join','/mnt/','substring','startsWith','match','3zNQzKk','194415oIjobJ','3012226sIaBmh','toUpperCase','test','2168166GZsUUz','charAt','3711150HYgXFt','slice','replace','5079992xlmPIU','7178200SiyvXn'];a1_0x2d32=function(){return _0x1ad9b0;};return a1_0x2d32();}(function(_0x4c51eb,_0x33a8f0){const _0x5cb085=a1_0x3483,_0x3bfa18=_0x4c51eb();while(!![]){try{const _0x3e93a0=-parseInt(_0x5cb085(0x143))/0x1+parseInt(_0x5cb085(0x136))/0x2+-parseInt(_0x5cb085(0x142))/0x3*(-parseInt(_0x5cb085(0x139))/0x4)+-parseInt(_0x5cb085(0x13a))/0x5+-parseInt(_0x5cb085(0x147))/0x6+parseInt(_0x5cb085(0x144))/0x7+-parseInt(_0x5cb085(0x13b))/0x8;if(_0x3e93a0===_0x33a8f0)break;else _0x3bfa18['push'](_0x3bfa18['shift']());}catch(_0x21f6a9){_0x3bfa18['push'](_0x3bfa18['shift']());}}}(a1_0x2d32,0xe3435));import a1_0x48c85c from'path';function a1_0x3483(_0x53d9b0,_0x1568f7){_0x53d9b0=_0x53d9b0-0x135;const _0x2d321e=a1_0x2d32();let _0x3483bc=_0x2d321e[_0x53d9b0];return _0x3483bc;}import a1_0x16152c from'os';export function convertToWindowsPath(_0x334f19){const _0x4ece73=a1_0x3483;if(_0x334f19[_0x4ece73(0x140)](_0x4ece73(0x13e))){const _0x3d4cac=_0x334f19[_0x4ece73(0x135)](0x5)[_0x4ece73(0x145)](),_0x1e7ed8=_0x334f19[_0x4ece73(0x137)](0x6)['replace'](/\//g,'\x5c');return _0x3d4cac+':'+_0x1e7ed8;}if(_0x334f19[_0x4ece73(0x141)](/^\/[a-zA-Z]\//)){const _0x3e06a9=_0x334f19[_0x4ece73(0x135)](0x1)[_0x4ece73(0x145)](),_0x5e8b04=_0x334f19[_0x4ece73(0x137)](0x2)[_0x4ece73(0x138)](/\//g,'\x5c');return _0x3e06a9+':'+_0x5e8b04;}if(_0x334f19[_0x4ece73(0x141)](/^[a-zA-Z]:/))return _0x334f19[_0x4ece73(0x138)](/\//g,'\x5c');return _0x334f19;}export function normalizePath(_0x21ffb2){const _0x255466=a1_0x3483;_0x21ffb2=_0x21ffb2['trim']()[_0x255466(0x138)](/^["']|["']$/g,'');const _0x257cd2=_0x21ffb2[_0x255466(0x140)]('/')&&!_0x21ffb2[_0x255466(0x141)](/^\/mnt\/[a-z]\//i)&&!_0x21ffb2[_0x255466(0x141)](/^\/[a-zA-Z]\//);if(_0x257cd2)return _0x21ffb2[_0x255466(0x138)](/\/+/g,'/')['replace'](/\/+$/,'');_0x21ffb2=convertToWindowsPath(_0x21ffb2);if(_0x21ffb2[_0x255466(0x140)]('\x5c\x5c')){let _0x53e5c7=_0x21ffb2;_0x53e5c7=_0x53e5c7[_0x255466(0x138)](/^\\{2,}/,'\x5c\x5c');const _0x21800c=_0x53e5c7[_0x255466(0x13f)](0x2)[_0x255466(0x138)](/\\\\/g,'\x5c');_0x21ffb2='\x5c\x5c'+_0x21800c;}else _0x21ffb2=_0x21ffb2[_0x255466(0x138)](/\\\\/g,'\x5c');let _0x3559db=a1_0x48c85c[_0x255466(0x13c)](_0x21ffb2);_0x21ffb2[_0x255466(0x140)]('\x5c\x5c')&&!_0x3559db['startsWith']('\x5c\x5c')&&(_0x3559db='\x5c'+_0x3559db);if(_0x3559db[_0x255466(0x141)](/^[a-zA-Z]:/)){let _0x410f32=_0x3559db[_0x255466(0x138)](/\//g,'\x5c');return/^[a-z]:/[_0x255466(0x146)](_0x410f32)&&(_0x410f32=_0x410f32[_0x255466(0x135)](0x0)[_0x255466(0x145)]()+_0x410f32[_0x255466(0x137)](0x1)),_0x410f32;}return _0x3559db[_0x255466(0x138)](/\//g,'\x5c');}export function expandHome(_0x444e56){const _0x1769c5=a1_0x3483;if(_0x444e56[_0x1769c5(0x140)]('~/')||_0x444e56==='~')return a1_0x48c85c[_0x1769c5(0x13d)](a1_0x16152c['homedir'](),_0x444e56[_0x1769c5(0x137)](0x1));return _0x444e56;}
1
+ (function(_0x138cc6,_0x1c6410){const _0x376e12=a1_0x1127,_0x2e3a83=_0x138cc6();while(!![]){try{const _0x46cf51=-parseInt(_0x376e12(0x89))/0x1*(parseInt(_0x376e12(0x8c))/0x2)+parseInt(_0x376e12(0x83))/0x3+parseInt(_0x376e12(0x7e))/0x4*(parseInt(_0x376e12(0x80))/0x5)+-parseInt(_0x376e12(0x8a))/0x6+-parseInt(_0x376e12(0x8d))/0x7*(parseInt(_0x376e12(0x8b))/0x8)+-parseInt(_0x376e12(0x82))/0x9*(parseInt(_0x376e12(0x85))/0xa)+parseInt(_0x376e12(0x7c))/0xb;if(_0x46cf51===_0x1c6410)break;else _0x2e3a83['push'](_0x2e3a83['shift']());}catch(_0x104cdf){_0x2e3a83['push'](_0x2e3a83['shift']());}}}(a1_0x47f2,0x39e1b));function a1_0x1127(_0x43b2e4,_0x3a759e){_0x43b2e4=_0x43b2e4-0x7b;const _0x47f28f=a1_0x47f2();let _0x112758=_0x47f28f[_0x43b2e4];return _0x112758;}import a1_0x30935a from'path';import a1_0x33bc00 from'os';function a1_0x47f2(){const _0x20aec7=['58338kNyFui','572058HEWpnV','join','30MsKDzq','replace','startsWith','match','148054ODCpyY','1853058rvTiFM','200kBiqaX','2mODROV','16415qqvEqV','slice','substring','normalize','charAt','toUpperCase','3311726GDgxaz','trim','373732dTooIr','homedir','15ANvNgq','/mnt/'];a1_0x47f2=function(){return _0x20aec7;};return a1_0x47f2();}export function convertToWindowsPath(_0xf1bc9e){const _0x39a9d5=a1_0x1127;if(_0xf1bc9e[_0x39a9d5(0x87)](_0x39a9d5(0x81))){const _0x558e34=_0xf1bc9e[_0x39a9d5(0x91)](0x5)[_0x39a9d5(0x7b)](),_0x237328=_0xf1bc9e[_0x39a9d5(0x8e)](0x6)[_0x39a9d5(0x86)](/\//g,'\x5c');return _0x558e34+':'+_0x237328;}if(_0xf1bc9e['match'](/^\/[a-zA-Z]\//)){const _0x5c9144=_0xf1bc9e[_0x39a9d5(0x91)](0x1)[_0x39a9d5(0x7b)](),_0x19f2bf=_0xf1bc9e[_0x39a9d5(0x8e)](0x2)[_0x39a9d5(0x86)](/\//g,'\x5c');return _0x5c9144+':'+_0x19f2bf;}if(_0xf1bc9e[_0x39a9d5(0x88)](/^[a-zA-Z]:/))return _0xf1bc9e['replace'](/\//g,'\x5c');return _0xf1bc9e;}export function normalizePath(_0x19cc75){const _0x4a65fc=a1_0x1127;_0x19cc75=_0x19cc75[_0x4a65fc(0x7d)]()[_0x4a65fc(0x86)](/^["']|["']$/g,'');const _0x2d9003=_0x19cc75[_0x4a65fc(0x87)]('/')&&!_0x19cc75[_0x4a65fc(0x88)](/^\/mnt\/[a-z]\//i)&&!_0x19cc75[_0x4a65fc(0x88)](/^\/[a-zA-Z]\//);if(_0x2d9003)return _0x19cc75[_0x4a65fc(0x86)](/\/+/g,'/')[_0x4a65fc(0x86)](/\/+$/,'');_0x19cc75=convertToWindowsPath(_0x19cc75);if(_0x19cc75[_0x4a65fc(0x87)]('\x5c\x5c')){let _0x3f8ff1=_0x19cc75;_0x3f8ff1=_0x3f8ff1[_0x4a65fc(0x86)](/^\\{2,}/,'\x5c\x5c');const _0x330c93=_0x3f8ff1[_0x4a65fc(0x8f)](0x2)[_0x4a65fc(0x86)](/\\\\/g,'\x5c');_0x19cc75='\x5c\x5c'+_0x330c93;}else _0x19cc75=_0x19cc75['replace'](/\\\\/g,'\x5c');let _0x4c1331=a1_0x30935a[_0x4a65fc(0x90)](_0x19cc75);_0x19cc75[_0x4a65fc(0x87)]('\x5c\x5c')&&!_0x4c1331['startsWith']('\x5c\x5c')&&(_0x4c1331='\x5c'+_0x4c1331);if(_0x4c1331[_0x4a65fc(0x88)](/^[a-zA-Z]:/)){let _0x78f78d=_0x4c1331[_0x4a65fc(0x86)](/\//g,'\x5c');return/^[a-z]:/['test'](_0x78f78d)&&(_0x78f78d=_0x78f78d[_0x4a65fc(0x91)](0x0)[_0x4a65fc(0x7b)]()+_0x78f78d[_0x4a65fc(0x8e)](0x1)),_0x78f78d;}return _0x4c1331['replace'](/\//g,'\x5c');}export function expandHome(_0x1323a2){const _0x53eba7=a1_0x1127;if(_0x1323a2[_0x53eba7(0x87)]('~/')||_0x1323a2==='~')return a1_0x30935a[_0x53eba7(0x84)](a1_0x33bc00[_0x53eba7(0x7f)](),_0x1323a2[_0x53eba7(0x8e)](0x1));return _0x1323a2;}
@@ -1 +1 @@
1
- (function(_0x513130,_0x41ea89){const _0x283b00=a2_0x404a,_0x19ea7b=_0x513130();while(!![]){try{const _0x82320d=-parseInt(_0x283b00(0x19e))/0x1*(parseInt(_0x283b00(0x1a2))/0x2)+-parseInt(_0x283b00(0x1a0))/0x3+-parseInt(_0x283b00(0x198))/0x4+-parseInt(_0x283b00(0x1a1))/0x5+-parseInt(_0x283b00(0x1a3))/0x6+parseInt(_0x283b00(0x1a4))/0x7*(-parseInt(_0x283b00(0x194))/0x8)+parseInt(_0x283b00(0x195))/0x9;if(_0x82320d===_0x41ea89)break;else _0x19ea7b['push'](_0x19ea7b['shift']());}catch(_0x1066be){_0x19ea7b['push'](_0x19ea7b['shift']());}}}(a2_0x4a2b,0xd89dd));import a2_0x5ac9ae from'path';export function isPathWithinAllowedDirectories(_0x25ee0c,_0x51055c){const _0x7262d0=a2_0x404a;if(typeof _0x25ee0c!=='string'||!Array[_0x7262d0(0x196)](_0x51055c))return![];if(!_0x25ee0c||_0x51055c[_0x7262d0(0x193)]===0x0)return![];if(_0x25ee0c[_0x7262d0(0x197)]('\x00'))return![];let _0x2ef904;try{_0x2ef904=a2_0x5ac9ae[_0x7262d0(0x19c)](a2_0x5ac9ae[_0x7262d0(0x19d)](_0x25ee0c));}catch{return![];}if(!a2_0x5ac9ae['isAbsolute'](_0x2ef904))throw new Error(_0x7262d0(0x19a));return _0x51055c[_0x7262d0(0x192)](_0x1acbbb=>{const _0x4b312c=_0x7262d0;if(typeof _0x1acbbb!==_0x4b312c(0x19b)||!_0x1acbbb)return![];if(_0x1acbbb['includes']('\x00'))return![];let _0x8dd719;try{_0x8dd719=a2_0x5ac9ae['resolve'](a2_0x5ac9ae[_0x4b312c(0x19d)](_0x1acbbb));}catch{return![];}if(!a2_0x5ac9ae['isAbsolute'](_0x8dd719))throw new Error(_0x4b312c(0x199));if(_0x2ef904===_0x8dd719)return!![];if(_0x8dd719===a2_0x5ac9ae[_0x4b312c(0x19f)])return _0x2ef904[_0x4b312c(0x1a5)](a2_0x5ac9ae[_0x4b312c(0x19f)]);return _0x2ef904[_0x4b312c(0x1a5)](_0x8dd719+a2_0x5ac9ae[_0x4b312c(0x19f)]);});}function a2_0x404a(_0x3882fc,_0x2fd872){_0x3882fc=_0x3882fc-0x192;const _0x4a2b36=a2_0x4a2b();let _0x404a2f=_0x4a2b36[_0x3882fc];return _0x404a2f;}function a2_0x4a2b(){const _0x378e7f=['sep','2204373UatszG','3988300WPUReh','2RXjBsl','2700090IBxEbp','1442LcrGeD','startsWith','some','length','11656cIKyvj','57611412UVOqsN','isArray','includes','6846784wcSZKH','Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization','Path\x20must\x20be\x20absolute\x20after\x20normalization','string','resolve','normalize','1519703pauXqF'];a2_0x4a2b=function(){return _0x378e7f;};return a2_0x4a2b();}
1
+ function a2_0x3476(){const _0x1589dd=['length','some','1089452AyeLMR','startsWith','102RhLUcj','772690zrKqal','normalize','2434560Wleaaz','isAbsolute','1851479cwsDWf','sep','resolve','9oJfTJO','string','Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization','574510RsnMSG','167858ZNVYfh','includes','Path\x20must\x20be\x20absolute\x20after\x20normalization','19675hDJlCA','3aCSNcI'];a2_0x3476=function(){return _0x1589dd;};return a2_0x3476();}(function(_0x4d5a11,_0x20ec97){const _0x5fc598=a2_0x3b5e,_0x31c2ac=_0x4d5a11();while(!![]){try{const _0x397f4f=parseInt(_0x5fc598(0x182))/0x1+-parseInt(_0x5fc598(0x177))/0x2+-parseInt(_0x5fc598(0x171))/0x3*(-parseInt(_0x5fc598(0x174))/0x4)+parseInt(_0x5fc598(0x170))/0x5*(parseInt(_0x5fc598(0x176))/0x6)+-parseInt(_0x5fc598(0x17b))/0x7+parseInt(_0x5fc598(0x179))/0x8+parseInt(_0x5fc598(0x17e))/0x9*(parseInt(_0x5fc598(0x181))/0xa);if(_0x397f4f===_0x20ec97)break;else _0x31c2ac['push'](_0x31c2ac['shift']());}catch(_0xc5b98f){_0x31c2ac['push'](_0x31c2ac['shift']());}}}(a2_0x3476,0x353bd));import a2_0x4cf9ad from'path';function a2_0x3b5e(_0x468a48,_0x39f4c3){_0x468a48=_0x468a48-0x16e;const _0x3476ed=a2_0x3476();let _0x3b5e48=_0x3476ed[_0x468a48];return _0x3b5e48;}export function isPathWithinAllowedDirectories(_0x357d11,_0xe34d7){const _0x1f2d2d=a2_0x3b5e;if(typeof _0x357d11!==_0x1f2d2d(0x17f)||!Array['isArray'](_0xe34d7))return![];if(!_0x357d11||_0xe34d7[_0x1f2d2d(0x172)]===0x0)return![];if(_0x357d11[_0x1f2d2d(0x16e)]('\x00'))return![];let _0x33ab9c;try{_0x33ab9c=a2_0x4cf9ad[_0x1f2d2d(0x17d)](a2_0x4cf9ad[_0x1f2d2d(0x178)](_0x357d11));}catch{return![];}if(!a2_0x4cf9ad[_0x1f2d2d(0x17a)](_0x33ab9c))throw new Error(_0x1f2d2d(0x16f));return _0xe34d7[_0x1f2d2d(0x173)](_0x34368f=>{const _0x4b34c8=_0x1f2d2d;if(typeof _0x34368f!==_0x4b34c8(0x17f)||!_0x34368f)return![];if(_0x34368f['includes']('\x00'))return![];let _0x1ced3a;try{_0x1ced3a=a2_0x4cf9ad[_0x4b34c8(0x17d)](a2_0x4cf9ad[_0x4b34c8(0x178)](_0x34368f));}catch{return![];}if(!a2_0x4cf9ad['isAbsolute'](_0x1ced3a))throw new Error(_0x4b34c8(0x180));if(_0x33ab9c===_0x1ced3a)return!![];if(_0x1ced3a===a2_0x4cf9ad['sep'])return _0x33ab9c[_0x4b34c8(0x175)](a2_0x4cf9ad[_0x4b34c8(0x17c)]);return _0x33ab9c[_0x4b34c8(0x175)](_0x1ced3a+a2_0x4cf9ad[_0x4b34c8(0x17c)]);});}
@@ -1 +1 @@
1
- (function(_0x5f0108,_0x7e2f5e){const _0x562a76=a3_0x20c6,_0x562ee8=_0x5f0108();while(!![]){try{const _0x18fd9c=parseInt(_0x562a76(0x1d7))/0x1*(parseInt(_0x562a76(0x1d6))/0x2)+parseInt(_0x562a76(0x1d1))/0x3+-parseInt(_0x562a76(0x1db))/0x4*(-parseInt(_0x562a76(0x1d4))/0x5)+parseInt(_0x562a76(0x1cc))/0x6*(-parseInt(_0x562a76(0x1de))/0x7)+-parseInt(_0x562a76(0x1d8))/0x8+-parseInt(_0x562a76(0x1dc))/0x9+parseInt(_0x562a76(0x1e1))/0xa*(-parseInt(_0x562a76(0x1e2))/0xb);if(_0x18fd9c===_0x7e2f5e)break;else _0x562ee8['push'](_0x562ee8['shift']());}catch(_0xc62330){_0x562ee8['push'](_0x562ee8['shift']());}}}(a3_0x4ff9,0x86b0f));import{promises as a3_0x1396f7}from'fs';import a3_0x249431 from'path';function a3_0x4ff9(){const _0x4a890a=['2640777rVUTTX','non-directory\x20root','invalid\x20path\x20or\x20inaccessible','535QEPlvr','resolve','694378gaMVip','1XLtQrv','2260432QXGdFi','\x20due\x20to\x20error:\x20','isDirectory','38412LjqiiU','6658326yIKnpu','push','49826jxuPze','uri','realpath','20jORJki','3510089BdatsC','error','36SStYtf','Skipping\x20','join','message','slice'];a3_0x4ff9=function(){return _0x4a890a;};return a3_0x4ff9();}import a3_0x1d0e15 from'os';import{normalizePath}from'./path-utils.js';async function parseRootUri(_0x5709bb){const _0x4ca7b2=a3_0x20c6;try{const _0x56ae98=_0x5709bb['startsWith']('file://')?_0x5709bb[_0x4ca7b2(0x1d0)](0x7):_0x5709bb,_0x57a0ee=_0x56ae98['startsWith']('~/')||_0x56ae98==='~'?a3_0x249431[_0x4ca7b2(0x1ce)](a3_0x1d0e15['homedir'](),_0x56ae98[_0x4ca7b2(0x1d0)](0x1)):_0x56ae98,_0x432bb3=a3_0x249431[_0x4ca7b2(0x1d5)](_0x57a0ee),_0x5a6c67=await a3_0x1396f7[_0x4ca7b2(0x1e0)](_0x432bb3);return normalizePath(_0x5a6c67);}catch{return null;}}function formatDirectoryError(_0x4562c9,_0x49494b,_0x32c200){const _0x4d3a1b=a3_0x20c6;if(_0x32c200)return _0x4d3a1b(0x1cd)+_0x32c200+':\x20'+_0x4562c9;const _0x2ae17f=_0x49494b instanceof Error?_0x49494b[_0x4d3a1b(0x1cf)]:String(_0x49494b);return'Skipping\x20invalid\x20directory:\x20'+_0x4562c9+_0x4d3a1b(0x1d9)+_0x2ae17f;}function a3_0x20c6(_0x3fb14d,_0x3fedb4){_0x3fb14d=_0x3fb14d-0x1cc;const _0x4ff9d7=a3_0x4ff9();let _0x20c6cf=_0x4ff9d7[_0x3fb14d];return _0x20c6cf;}export async function getValidRootDirectories(_0x2595d4){const _0x25780d=a3_0x20c6,_0x42f8bc=[];for(const _0x11762d of _0x2595d4){const _0x40a1bc=await parseRootUri(_0x11762d[_0x25780d(0x1df)]);if(!_0x40a1bc){console['error'](formatDirectoryError(_0x11762d['uri'],undefined,_0x25780d(0x1d3)));continue;}try{const _0x1d040a=await a3_0x1396f7['stat'](_0x40a1bc);_0x1d040a[_0x25780d(0x1da)]()?_0x42f8bc[_0x25780d(0x1dd)](_0x40a1bc):console[_0x25780d(0x1e3)](formatDirectoryError(_0x40a1bc,undefined,_0x25780d(0x1d2)));}catch(_0x1c5ae0){console[_0x25780d(0x1e3)](formatDirectoryError(_0x40a1bc,_0x1c5ae0));}}return _0x42f8bc;}
1
+ function a3_0x4011(){const _0x28f344=['283038cygCKy','811820vcmnZi','22ziyqHG','uri','file://','5243904dzHrdc','push','2234165zypFzS','1024SsLyrn','stat','\x20due\x20to\x20error:\x20','slice','invalid\x20path\x20or\x20inaccessible','24XbpYIr','error','join','1590168JelzSU','Skipping\x20invalid\x20directory:\x20','startsWith','6eMPiTy','non-directory\x20root','181618JIxZgn','isDirectory','7609OWtYMD'];a3_0x4011=function(){return _0x28f344;};return a3_0x4011();}(function(_0x9f69fc,_0x4893dd){const _0x1edcc2=a3_0x4924,_0x48a70f=_0x9f69fc();while(!![]){try{const _0x40c0bb=-parseInt(_0x1edcc2(0xea))/0x1+-parseInt(_0x1edcc2(0xe7))/0x2*(-parseInt(_0x1edcc2(0xf7))/0x3)+-parseInt(_0x1edcc2(0xfa))/0x4+-parseInt(_0x1edcc2(0xf1))/0x5*(parseInt(_0x1edcc2(0xe5))/0x6)+parseInt(_0x1edcc2(0xe9))/0x7*(parseInt(_0x1edcc2(0xf2))/0x8)+parseInt(_0x1edcc2(0xef))/0x9+-parseInt(_0x1edcc2(0xeb))/0xa*(-parseInt(_0x1edcc2(0xec))/0xb);if(_0x40c0bb===_0x4893dd)break;else _0x48a70f['push'](_0x48a70f['shift']());}catch(_0x12e803){_0x48a70f['push'](_0x48a70f['shift']());}}}(a3_0x4011,0x75f8f));import{promises as a3_0x3db1e1}from'fs';function a3_0x4924(_0x5c30c0,_0x564e37){_0x5c30c0=_0x5c30c0-0xe4;const _0x4011db=a3_0x4011();let _0x4924a6=_0x4011db[_0x5c30c0];return _0x4924a6;}import a3_0xc299f1 from'path';import a3_0x75bbd7 from'os';import{normalizePath}from'./path-utils.js';async function parseRootUri(_0x304367){const _0x335737=a3_0x4924;try{const _0x1b5a8d=_0x304367[_0x335737(0xe4)](_0x335737(0xee))?_0x304367['slice'](0x7):_0x304367,_0xa2fd37=_0x1b5a8d[_0x335737(0xe4)]('~/')||_0x1b5a8d==='~'?a3_0xc299f1[_0x335737(0xf9)](a3_0x75bbd7['homedir'](),_0x1b5a8d[_0x335737(0xf5)](0x1)):_0x1b5a8d,_0x6d1471=a3_0xc299f1['resolve'](_0xa2fd37),_0x44f229=await a3_0x3db1e1['realpath'](_0x6d1471);return normalizePath(_0x44f229);}catch{return null;}}function formatDirectoryError(_0x45ba02,_0x4e17c4,_0x23113f){const _0x389a88=a3_0x4924;if(_0x23113f)return'Skipping\x20'+_0x23113f+':\x20'+_0x45ba02;const _0x48a2b3=_0x4e17c4 instanceof Error?_0x4e17c4['message']:String(_0x4e17c4);return _0x389a88(0xfb)+_0x45ba02+_0x389a88(0xf4)+_0x48a2b3;}export async function getValidRootDirectories(_0x393eb0){const _0x37522d=a3_0x4924,_0x3093ca=[];for(const _0x5ed48c of _0x393eb0){const _0x30f1f3=await parseRootUri(_0x5ed48c[_0x37522d(0xed)]);if(!_0x30f1f3){console[_0x37522d(0xf8)](formatDirectoryError(_0x5ed48c[_0x37522d(0xed)],undefined,_0x37522d(0xf6)));continue;}try{const _0x3b2ee7=await a3_0x3db1e1[_0x37522d(0xf3)](_0x30f1f3);_0x3b2ee7[_0x37522d(0xe8)]()?_0x3093ca[_0x37522d(0xf0)](_0x30f1f3):console['error'](formatDirectoryError(_0x30f1f3,undefined,_0x37522d(0xe6)));}catch(_0x45f22d){console[_0x37522d(0xf8)](formatDirectoryError(_0x30f1f3,_0x45f22d));}}return _0x3093ca;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morphllm/morphmcp",
3
- "version": "0.8.114",
3
+ "version": "0.8.115",
4
4
  "description": "Fast & accurate MCP server with AI-powered file editing and intelligent code search. Prevents context pollution and saves time for a better user experience.",
5
5
  "license": "MIT",
6
6
  "author": "Morph (https://morphllm.com)",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@google/generative-ai": "^0.21.0",
37
37
  "@modelcontextprotocol/sdk": "^1.12.3",
38
- "@morphllm/morphsdk": "0.2.129",
38
+ "@morphllm/morphsdk": "0.2.130",
39
39
  "@vscode/ripgrep": "^1.15.14",
40
40
  "axios": "^1.6.0",
41
41
  "chalk": "^5.3.0",