@morphllm/morphmcp 0.8.60 → 0.8.62

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
- const a0_0x451934=a0_0x5376;(function(_0x1a29be,_0x2cf68f){const _0x37bcd1=a0_0x5376,_0x32095e=_0x1a29be();while(!![]){try{const _0x33dae7=parseInt(_0x37bcd1(0x2a1))/0x1+-parseInt(_0x37bcd1(0x2be))/0x2+-parseInt(_0x37bcd1(0x222))/0x3*(parseInt(_0x37bcd1(0x21c))/0x4)+-parseInt(_0x37bcd1(0x218))/0x5+parseInt(_0x37bcd1(0x255))/0x6*(parseInt(_0x37bcd1(0x1f9))/0x7)+parseInt(_0x37bcd1(0x2a2))/0x8*(parseInt(_0x37bcd1(0x265))/0x9)+-parseInt(_0x37bcd1(0x2a6))/0xa*(-parseInt(_0x37bcd1(0x1f6))/0xb);if(_0x33dae7===_0x2cf68f)break;else _0x32095e['push'](_0x32095e['shift']());}catch(_0x18241c){_0x32095e['push'](_0x32095e['shift']());}}}(a0_0x3784,0x71cd3));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_0x2fff5a from'fs/promises';import a0_0x5076a1 from'path';import a0_0x1bdea5 from'os';import{z}from'zod';import{zodToJsonSchema}from'zod-to-json-schema';import{getValidRootDirectories}from'./roots-utils.js';import{executeEditFile}from'@morphllm/morphsdk/tools/fastapply';function a0_0x5376(_0x615921,_0x4a9420){_0x615921=_0x615921-0x1ea;const _0x378492=a0_0x3784();let _0x5376ee=_0x378492[_0x615921];return _0x5376ee;}function a0_0x3784(){const _0x3ac78b=['access','\x20results\x20in\x20','diff\x0a','Cargo.toml','ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a','stringify','limit','Returns\x20ranked\x20code\x20chunks\x20with\x20relevance\x20scores,\x20file\x20paths,\x20and\x20line\x20numbers.\x20','TimeoutError','includes','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.','For\x20deletions:\x0a','Rules:\x0a','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20subagent\x20in\x20its\x20search.\x20','created','FileReadError','IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a','Fallback:\x20Using\x20workspace\x20root\x20','isArray','Failed\x20to\x20request\x20roots\x20from\x20client:','unknown','Search\x20problem\x20statement\x20that\x20this\x20subagent\x20is\x20supposed\x20to\x20research\x20for','list_directory\x20','325623VfBZqy','45896TyEqZC','searchTimeMs','params','toLowerCase','310aiKjfq','Repository\x20identifier','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a','edit_file','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','all','application/json','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','Warning:\x20','target_directories','timings','toISOString','Failed\x20to\x20read\x20file:\x20','Max\x20results\x20to\x20return','string','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','\x20(new\x20file)','cwd','applied\x20edits\x20to','dirname','\x20-\x20','code_edit','env','pyproject.toml','1737062TZotwh','PWD','safeParse','success','requiresApiKey','etimedout','Parent\x20directory\x20does\x20not\x20exist:\x20','constructor','0.2.0','-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a','🔍\x20Morph\x20Edit\x20Preview','grep\x20\x27','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','-\x20Works\x20across\x20all\x20files\x20and\x20languages\x0a\x0a','Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a','\x20chars)','Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings','ms:\x0a\x0a','\x0a</file>','unknown\x20error','dryRun','content','length','[could\x20not\x20read\x20file:\x20','warpgrep_codebase_search','.vscode','🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a','repoId','errors','Here\x20is\x20the\x20content\x20of\x20files:\x0a','data','basename','timed\x20out','163999DfsgyP','File\x20read\x20error:','UnknownError','21NvstLD','ENOENT','\x20valid\x20directories','-\x20Searches\x20by\x20semantic\x20meaning,\x20not\x20just\x20keywords\x0a','boolean','...','MORPH_WARP_GREP_TIMEOUT','false','-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a','sk-','metadata','stat','branch','setRequestHandler','completed_with_file_errors','-\x20Grepped\x20\x27','catch','Error\x20accessing\x20directory\x20','morph-warp-grep-v1-1111v0','message','query','toFixed','utf-8','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','Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','roots','filepath','describe','readFile','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','2061730HnDwcI','Enabled\x20tools:\x20','resolve','path','534728abNdKy','apply\x20these\x20changes','assistant','🎯\x20USE\x20THIS\x20TOOL\x20to\x20find\x20code\x20when\x20you\x20need\x20to\x20understand\x20existing\x20implementations.\x0a\x0a','rerankScore','Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol','6OhESjV','Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','timeout','Successfully\x20','ENABLED_TOOLS','listRoots','runWarpGrep_call','Relevant\x20context\x20found:','Created\x20File','Morph\x20FastApply\x20failed\x20without\x20error\x20message','error','number','https://morphllm.com/api/error-report','\x0a...\x20(truncated,\x20total:\x20','results','slice','-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a','\x20is\x20not\x20a\x20directory','\x20\x20\x20','split','\x27\x20in\x20`','lines','exit','create\x20this\x20file','-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','default','stack','every','isDirectory','morph-v3-fast','realpath','-\x20Listed\x20directory\x20`','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','setNotificationHandler','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','instruction','mcp-filesystem','%\x20match)\x0a','files','sep','-\x20Returns\x20precise\x20code\x20chunks\x20with\x20relevance\x20scores\x0a','<file\x20path=\x22','Natural\x20language\x20query\x20to\x20search\x20for\x20code','Warning:\x20Workspace\x20fallback\x20failed:\x20','-\x20Two-stage\x20retrieval:\x20vector\x20search\x20(~240ms)\x20+\x20GPU\x20reranking\x20(~630ms)\x0a','description','codebase_search','Use\x20dryRun=false\x20to\x20','Error:\x20','search_string','1845018LNtEUO','Morph\x20Edit\x20','name','Example\x20queries:\x20\x27Where\x20is\x20JWT\x20validation?\x27,\x20\x27How\x20does\x20auth\x20work?\x27,\x20\x27Find\x20database\x20connection\x20logic\x27.','repeat','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','text','morph-mcp','filter','messages','startsWith','role','.cursor','read\x20','trim','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','477woYiWT','WarpGrepError','❌\x20Morph\x20Edit\x20Failed:\x20','Fatal\x20error\x20running\x20server:','Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:','source','substring','No\x20results\x20found\x20for\x20query:\x20\x22','object','startLine','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','Invalid\x20arguments:\x20','Applied','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.','argv','match','optional','join','finish','.git','package.json','-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a','\x22>\x0aError\x20reading\x20file:\x20','terminationReason','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','code','Search\x20your\x20codebase\x20using\x20natural\x20language\x20queries.\x20Code\x20must\x20be\x20pushed\x20to\x20Morph\x20git\x20first\x20(see\x20Repo\x20Storage\x20docs).\x20','repo_path','-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a','array','Benefits:\x0a','push','udiff','ENABLE_WORKSPACE_MODE','map','-\x20Read\x20file\x20`','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.'];a0_0x3784=function(){return _0x3ac78b;};return a0_0x3784();}import{runWarpGrep,LocalRipgrepProvider}from'@morphllm/morphsdk/tools/warp-grep';import{executeCodebaseSearch}from'@morphllm/morphsdk/tools/codebase-search';import a0_0xea2620 from'axios';function fixPathRepetition(_0x2096cf){const _0x16a99b=a0_0x5376,_0x29a498=_0x2096cf[_0x16a99b(0x236)](a0_0x5076a1[_0x16a99b(0x24a)])[_0x16a99b(0x25d)](Boolean);if(_0x29a498[_0x16a99b(0x1eb)]<0x2)return null;for(let _0x336363=Math['floor'](_0x29a498[_0x16a99b(0x1eb)]/0x2);_0x336363>=0x1;_0x336363--){for(let _0x5b1266=0x0;_0x5b1266<=_0x29a498[_0x16a99b(0x1eb)]-0x2*_0x336363;_0x5b1266++){const _0x4f023a=_0x29a498[_0x16a99b(0x232)](_0x5b1266,_0x5b1266+_0x336363),_0x45ea22=_0x29a498['slice'](_0x5b1266+_0x336363,_0x5b1266+0x2*_0x336363);if(_0x4f023a[_0x16a99b(0x23e)]((_0x43259a,_0x7e87a5)=>_0x43259a===_0x45ea22[_0x7e87a5])){const _0x16ea1c=[..._0x29a498[_0x16a99b(0x232)](0x0,_0x5b1266),..._0x29a498[_0x16a99b(0x232)](_0x5b1266+_0x336363)];return a0_0x5076a1['sep']+_0x16ea1c[_0x16a99b(0x276)](a0_0x5076a1[_0x16a99b(0x24a)]);}}}return null;}const args=process[a0_0x451934(0x273)]['slice'](0x2),ALL_TOOLS=[a0_0x451934(0x2a9),a0_0x451934(0x1ed),a0_0x451934(0x251)],DEFAULT_TOOLS=['edit_file',a0_0x451934(0x1ed)],ENABLED_TOOLS=process['env'][a0_0x451934(0x227)]?process[a0_0x451934(0x2bc)][a0_0x451934(0x227)]===a0_0x451934(0x2ab)?ALL_TOOLS:process[a0_0x451934(0x2bc)]['ENABLED_TOOLS']['split'](',')[a0_0x451934(0x287)](_0x2dbc6d=>_0x2dbc6d['trim']()):DEFAULT_TOOLS;console['error'](a0_0x451934(0x219)+ENABLED_TOOLS[a0_0x451934(0x276)](',\x20'));const WORKSPACE_ROOT=process[a0_0x451934(0x2bc)]['WORKSPACE_ROOT']||process[a0_0x451934(0x2bc)][a0_0x451934(0x2bf)]||process[a0_0x451934(0x2b7)](),ENABLE_WORKSPACE_MODE=process[a0_0x451934(0x2bc)][a0_0x451934(0x286)]!==a0_0x451934(0x200),MORPH_API_KEY=process['env']['MORPH_API_KEY'],MORPH_API_URL=process[a0_0x451934(0x2bc)]['MORPH_API_URL'],MORPH_WARP_GREP_TIMEOUT=process[a0_0x451934(0x2bc)]['MORPH_WARP_GREP_TIMEOUT']?parseInt(process[a0_0x451934(0x2bc)][a0_0x451934(0x1ff)],0xa):undefined;MORPH_API_KEY&&!MORPH_API_KEY[a0_0x451934(0x25f)](a0_0x451934(0x202))&&!MORPH_API_KEY[a0_0x451934(0x25f)]('morph-')&&console[a0_0x451934(0x22d)]('Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27');async function reportMorphError(_0x47d1e1){const _0x16b292=a0_0x451934;try{await a0_0xea2620['post'](_0x16b292(0x22f),{..._0x47d1e1,'timestamp':new Date()[_0x16b292(0x2b1)](),'source':_0x47d1e1[_0x16b292(0x26a)]||_0x16b292(0x247)},{'timeout':0x1388,'headers':{'Content-Type':_0x16b292(0x2ac),'Authorization':'Bearer\x20'+MORPH_API_KEY}});}catch{}}args[a0_0x451934(0x1eb)]===0x0&&!ENABLE_WORKSPACE_MODE&&(console[a0_0x451934(0x22d)](a0_0x451934(0x2b5)),console[a0_0x451934(0x22d)](a0_0x451934(0x26f)),console[a0_0x451934(0x22d)]('\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)'),console['error']('\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)'),console[a0_0x451934(0x22d)](a0_0x451934(0x27d)),console['error'](a0_0x451934(0x289)));function normalizePath(_0x7db960){return a0_0x5076a1['normalize'](_0x7db960);}function expandHome(_0x28ff24){const _0x4d42ca=a0_0x451934;if(_0x28ff24[_0x4d42ca(0x25f)]('~/')||_0x28ff24==='~')return a0_0x5076a1['join'](a0_0x1bdea5['homedir'](),_0x28ff24['slice'](0x1));return _0x28ff24;}let allowedDirectories=await Promise[a0_0x451934(0x2ab)](args[a0_0x451934(0x287)](async _0x284161=>{const _0x5d3b39=a0_0x451934,_0x1fca59=expandHome(_0x284161),_0x39de21=a0_0x5076a1[_0x5d3b39(0x21a)](_0x1fca59);try{const _0x4fb13=await a0_0x2fff5a[_0x5d3b39(0x241)](_0x39de21);return normalizePath(_0x4fb13);}catch(_0x12db26){return normalizePath(_0x39de21);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x451934(0x1eb)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories['push'](workspaceDir),console['error']('Workspace\x20mode\x20enabled:\x20Using\x20'+workspaceDir+'\x20as\x20allowed\x20directory'));}catch(a0_0x37c31b){console[a0_0x451934(0x22d)](a0_0x451934(0x264)+a0_0x37c31b);}async function detectWorkspaceRoot(_0x5803d2){const _0x101bb8=a0_0x451934;let _0x3e1891=a0_0x5076a1[_0x101bb8(0x21a)](_0x5803d2);const _0x53aac0=[_0x101bb8(0x278),_0x101bb8(0x1ee),_0x101bb8(0x279),_0x101bb8(0x28d),_0x101bb8(0x2bd),'go.mod',_0x101bb8(0x261),'tsconfig.json','composer.json'];while(_0x3e1891!==a0_0x5076a1['dirname'](_0x3e1891)){for(const _0x766a37 of _0x53aac0){const _0x2a312d=a0_0x5076a1['join'](_0x3e1891,_0x766a37);try{return await a0_0x2fff5a[_0x101bb8(0x28a)](_0x2a312d),normalizePath(_0x3e1891);}catch{}}_0x3e1891=a0_0x5076a1[_0x101bb8(0x2b9)](_0x3e1891);}return normalizePath(_0x5803d2);}await Promise[a0_0x451934(0x2ab)](args[a0_0x451934(0x287)](async _0x5022bc=>{const _0x5d0529=a0_0x451934;try{const _0x4810a7=await a0_0x2fff5a[_0x5d0529(0x204)](expandHome(_0x5022bc));!_0x4810a7[_0x5d0529(0x23f)]()&&(console[_0x5d0529(0x22d)]('Error:\x20'+_0x5022bc+_0x5d0529(0x234)),process[_0x5d0529(0x239)](0x1));}catch(_0x46483b){console[_0x5d0529(0x22d)](_0x5d0529(0x20a)+_0x5022bc+':',_0x46483b),process['exit'](0x1);}}));async function validatePath(_0x7e1997){const _0x4aff33=a0_0x451934,_0x3418e6=expandHome(_0x7e1997),_0x47c9a1=a0_0x5076a1[_0x4aff33(0x21a)](_0x3418e6);try{const _0x4d3cf8=await a0_0x2fff5a[_0x4aff33(0x241)](_0x47c9a1);return _0x4d3cf8;}catch(_0x93d1b5){if(_0x93d1b5[_0x4aff33(0x27e)]===_0x4aff33(0x1fa)){const _0x449669=a0_0x5076a1['dirname'](_0x47c9a1);try{const _0x23ea8b=await a0_0x2fff5a[_0x4aff33(0x241)](_0x449669);return a0_0x5076a1[_0x4aff33(0x276)](_0x23ea8b,a0_0x5076a1[_0x4aff33(0x1f4)](_0x47c9a1));}catch{throw new Error(_0x4aff33(0x2c4)+_0x449669);}}throw _0x93d1b5;}}const MorphEditFileArgsSchema=z[a0_0x451934(0x26d)]({'path':z['string'](),'code_edit':z[a0_0x451934(0x2b4)]()[a0_0x451934(0x215)](a0_0x451934(0x212)),'instruction':z['string']()[a0_0x451934(0x215)]('A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.'),'dryRun':z[a0_0x451934(0x1fd)]()[a0_0x451934(0x23c)](![])[a0_0x451934(0x215)]('Preview\x20changes\x20without\x20applying\x20them.')}),WarpGrepArgsSchema=z[a0_0x451934(0x26d)]({'search_string':z[a0_0x451934(0x2b4)]()[a0_0x451934(0x215)](a0_0x451934(0x29f)),'repo_path':z['string']()[a0_0x451934(0x215)](a0_0x451934(0x2ad))}),CodebaseSearchArgsSchema=z['object']({'query':z['string']()[a0_0x451934(0x215)](a0_0x451934(0x24d)),'repoId':z[a0_0x451934(0x2b4)]()['describe'](a0_0x451934(0x2a7)),'branch':z[a0_0x451934(0x2b4)]()[a0_0x451934(0x275)]()[a0_0x451934(0x215)]('Branch\x20to\x20search\x20(uses\x20latest\x20commit)'),'commitHash':z[a0_0x451934(0x2b4)]()[a0_0x451934(0x275)]()[a0_0x451934(0x215)]('Specific\x20commit\x20hash\x20to\x20search'),'target_directories':z[a0_0x451934(0x282)](z[a0_0x451934(0x2b4)]())[a0_0x451934(0x23c)]([])[a0_0x451934(0x215)](a0_0x451934(0x223)),'limit':z[a0_0x451934(0x22e)]()['optional']()['default'](0xa)[a0_0x451934(0x215)](a0_0x451934(0x2b3))}),server=new Server({'name':a0_0x451934(0x25c),'version':'0.2.0'},{'capabilities':{'tools':{}}});server[a0_0x451934(0x206)](ListToolsRequestSchema,async()=>{const _0x11e935=a0_0x451934,_0x578354=[{'name':_0x11e935(0x2a9),'description':_0x11e935(0x2a8)+'⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a'+_0x11e935(0x1ef)+_0x11e935(0x29a)+_0x11e935(0x283)+'-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a'+_0x11e935(0x201)+_0x11e935(0x27a)+'-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a'+_0x11e935(0x2cd)+_0x11e935(0x28e)+_0x11e935(0x211)+_0x11e935(0x295)+_0x11e935(0x233)+'-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a'+_0x11e935(0x296)+'-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a'+'-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a'+_0x11e935(0x2c7)+'-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a'+_0x11e935(0x23b)+_0x11e935(0x281)+_0x11e935(0x2aa),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x11e935(0x1ed),'description':_0x11e935(0x2cb)+_0x11e935(0x210)+'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'+_0x11e935(0x297)+_0x11e935(0x294)+'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'+'You\x20should\x20consider\x20using\x20classical\x20search\x20tools\x20afterwards\x20to\x20locate\x20the\x20rest,\x20but\x20only\x20if\x20necessary.\x20'+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':_0x11e935(0x251),'description':'**SEMANTIC\x20CODE\x20SEARCH\x20-\x20USE\x20FOR\x20FINDING\x20CODE**\x0a\x0a'+'⚡\x20INTELLIGENT:\x20Natural\x20language\x20search\x20across\x20your\x20entire\x20codebase\x20using\x20AI\x20embeddings.\x0a'+_0x11e935(0x21f)+_0x11e935(0x283)+_0x11e935(0x24f)+_0x11e935(0x24b)+_0x11e935(0x1fc)+_0x11e935(0x2cc)+_0x11e935(0x27f)+_0x11e935(0x291)+_0x11e935(0x258),'inputSchema':zodToJsonSchema(CodebaseSearchArgsSchema),'requiresApiKey':!![]}],_0x257ed6=_0x578354[_0x11e935(0x25d)](_0x2ec0cd=>{const _0x373ccf=_0x11e935;if(!ENABLED_TOOLS['includes'](_0x2ec0cd[_0x373ccf(0x257)]))return![];if(_0x373ccf(0x2c2)in _0x2ec0cd&&_0x2ec0cd['requiresApiKey']&&!MORPH_API_KEY)return console[_0x373ccf(0x22d)]('Warning:\x20'+_0x2ec0cd['name']+_0x373ccf(0x245)),![];return!![];});return{'tools':_0x257ed6[_0x11e935(0x287)](_0x52164c=>({'name':_0x52164c['name'],'description':_0x52164c[_0x11e935(0x250)],'inputSchema':_0x52164c['inputSchema']}))};}),server[a0_0x451934(0x206)](CallToolRequestSchema,async _0x2dc6c4=>{const _0xf5c817=a0_0x451934;try{const {name:_0x4ecbfa,arguments:_0x2596fc}=_0x2dc6c4[_0xf5c817(0x2a4)];switch(_0x4ecbfa){case _0xf5c817(0x2a9):{const _0x1a5980=MorphEditFileArgsSchema[_0xf5c817(0x2c0)](_0x2596fc);if(!_0x1a5980[_0xf5c817(0x2c1)])throw new Error(_0xf5c817(0x217)+_0x1a5980[_0xf5c817(0x22d)]);const _0x233284=await validatePath(_0x1a5980[_0xf5c817(0x1f3)]['path']);let _0x300768=null,_0x56906b=!![],_0x4c3bca=null;try{_0x300768=await a0_0x2fff5a['readFile'](_0x233284,_0xf5c817(0x20f));}catch(_0x165b8d){const _0x146d2a=_0x165b8d[_0xf5c817(0x27e)];_0x146d2a===_0xf5c817(0x1fa)?(_0x56906b=![],_0x300768=''):(_0x4c3bca=_0xf5c817(0x2b2)+(_0x146d2a||_0xf5c817(0x29e))+_0xf5c817(0x2ba)+(_0x165b8d instanceof Error?_0x165b8d[_0xf5c817(0x20c)]:String(_0x165b8d)),console['error'](_0xf5c817(0x2ae)+_0x4c3bca));}try{const _0x150c4c=MORPH_API_KEY;if(!_0x150c4c)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.');const _0x40e21c=a0_0x5076a1[_0xf5c817(0x2b9)](_0x233284),_0x572691=a0_0x5076a1[_0xf5c817(0x1f4)](_0x233284),_0x3e09e2=await executeEditFile({'target_filepath':_0x572691,'code_edit':_0x1a5980['data'][_0xf5c817(0x2bb)],'instructions':_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x246)]},{'morphApiKey':_0x150c4c,'morphApiUrl':MORPH_API_URL,'baseDir':_0x40e21c,'autoWrite':!_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x2d3)],'generateUdiff':!![],'debug':![]});if(!_0x3e09e2['success'])throw new Error(_0x3e09e2[_0xf5c817(0x22d)]||_0xf5c817(0x22c));const _0x45fef2=_0x3e09e2[_0xf5c817(0x285)]||'';let _0x10bd63=0x3;while(_0x45fef2[_0xf5c817(0x293)]('`'[_0xf5c817(0x259)](_0x10bd63))){_0x10bd63++;}const _0x40b322='`'[_0xf5c817(0x259)](_0x10bd63)+_0xf5c817(0x28c)+_0x45fef2+'`'[_0xf5c817(0x259)](_0x10bd63)+'\x0a\x0a';if(_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x2d3)])return{'content':[{'type':'text','text':_0xf5c817(0x2c8)+(_0x56906b?'':_0xf5c817(0x2b6))+':\x20'+_0x1a5980[_0xf5c817(0x1f3)]['instruction']+'\x0a\x0a'+_0x40b322+_0xf5c817(0x252)+(_0x56906b?_0xf5c817(0x21d):_0xf5c817(0x23a))+'.'}]};return{'content':[{'type':_0xf5c817(0x25b),'text':_0xf5c817(0x256)+(_0x56906b?_0xf5c817(0x271):_0xf5c817(0x22b))+':\x20'+_0x1a5980[_0xf5c817(0x1f3)]['instruction']+'\x0a\x0a'+_0x40b322+_0xf5c817(0x226)+(_0x56906b?_0xf5c817(0x2b8):_0xf5c817(0x298))+'\x20'+_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x21b)]}]};}catch(_0xc8e121){const _0x4c9f06=_0xc8e121 instanceof Error?_0xc8e121[_0xf5c817(0x20c)]:String(_0xc8e121);return reportMorphError({'error_message':_0x4c9f06,'error_type':_0xc8e121 instanceof Error?_0xc8e121[_0xf5c817(0x2c5)][_0xf5c817(0x257)]:_0xf5c817(0x1f8),'context':{'tool':'edit_file','file_path':_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x21b)],'validated_path':_0x233284,'instruction':_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x246)],'model':_0xf5c817(0x240),'dry_run':_0x1a5980['data'][_0xf5c817(0x2d3)],'file_exists':_0x56906b,'file_read_error':_0x4c3bca,'file_readable':_0x300768!==null,'request_content':{'path':_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x21b)],'code_edit':_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x2bb)],'instruction':_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x246)],'original_code':_0x300768!==null?_0x300768[_0xf5c817(0x1eb)]>0xc350?_0x300768[_0xf5c817(0x26b)](0x0,0xc350)+_0xf5c817(0x230)+_0x300768[_0xf5c817(0x1eb)]+_0xf5c817(0x2ce):_0x300768:_0xf5c817(0x1ec)+(_0x4c3bca||_0xf5c817(0x2d2))+']','original_code_length':_0x300768?.[_0xf5c817(0x1eb)]??0x0,'model':'morph-v3-fast','dry_run':_0x1a5980[_0xf5c817(0x1f3)][_0xf5c817(0x2d3)]}},'stack_trace':_0xc8e121 instanceof Error?_0xc8e121[_0xf5c817(0x23d)]:undefined,'source':_0xf5c817(0x247)})[_0xf5c817(0x209)](()=>{}),{'content':[{'type':_0xf5c817(0x25b),'text':_0xf5c817(0x267)+_0x4c9f06}],'isError':!![]};}}case _0xf5c817(0x1ed):{const _0x4c3214=WarpGrepArgsSchema[_0xf5c817(0x2c0)](_0x2596fc);if(!_0x4c3214['success'])return{'content':[{'type':_0xf5c817(0x25b),'text':_0xf5c817(0x270)+_0x4c3214[_0xf5c817(0x22d)]}],'isError':!![]};const _0x2ff92e=_0x510318=>{const _0x2f7de6=_0xf5c817,_0x324980=[];for(const _0x5c0674 of _0x510318||[]){const _0x2ca8ce=_0x5c0674['role'],_0x302eb5=_0x5c0674[_0x2f7de6(0x1ea)];if(_0x2ca8ce===_0x2f7de6(0x21e)&&_0x302eb5){const _0x319d08=_0x302eb5['split']('\x0a')[_0x2f7de6(0x25d)](_0x1f8aa2=>_0x1f8aa2[_0x2f7de6(0x263)]());for(const _0x341a32 of _0x319d08){const _0x569150=_0x341a32['match'](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x569150){_0x324980[_0x2f7de6(0x284)](_0x2f7de6(0x2c9)+_0x569150[0x1]+'\x27\x20'+_0x569150[0x2]);continue;}const _0x525b1f=_0x341a32[_0x2f7de6(0x274)](/^read\s+(.+)$/);if(_0x525b1f){_0x324980[_0x2f7de6(0x284)](_0x2f7de6(0x262)+_0x525b1f[0x1]);continue;}const _0x52d24c=_0x341a32[_0x2f7de6(0x274)](/^list_directory\s+(.+)$/);if(_0x52d24c){_0x324980['push'](_0x2f7de6(0x2a0)+_0x52d24c[0x1]);continue;}}}}return _0x324980;};try{const _0x122589=a0_0x5076a1[_0xf5c817(0x21a)](_0x4c3214['data'][_0xf5c817(0x280)]),_0x773248=new LocalRipgrepProvider(_0x122589),_0x45d4ab=await runWarpGrep({'query':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x254)],'repoRoot':_0x122589,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x773248});let _0x4f4bfc='';if(_0x45d4ab[_0xf5c817(0x27c)]==='completed'&&_0x45d4ab[_0xf5c817(0x277)]?.[_0xf5c817(0x203)]?.[_0xf5c817(0x249)]){const _0x1f3b9a=_0x45d4ab['finish']['metadata'][_0xf5c817(0x249)],_0x2e0c29=[],_0x5119d1=[_0xf5c817(0x25a)];for(const _0x6fee0d of _0x45d4ab['messages']){const _0x3abef7=_0x6fee0d[_0xf5c817(0x260)],_0x1c92a6=_0x6fee0d['content'];if(_0x3abef7===_0xf5c817(0x21e)&&_0x1c92a6){const _0x3746d5=_0x1c92a6[_0xf5c817(0x236)]('\x0a')[_0xf5c817(0x25d)](_0x4bb60f=>_0x4bb60f[_0xf5c817(0x263)]());for(const _0x2bc44e of _0x3746d5){const _0x3977b3=_0x2bc44e[_0xf5c817(0x274)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x3977b3){_0x5119d1[_0xf5c817(0x284)](_0xf5c817(0x208)+_0x3977b3[0x1]+_0xf5c817(0x237)+_0x3977b3[0x2]+'`');continue;}const _0x585e8e=_0x2bc44e[_0xf5c817(0x274)](/^read\s+(.+)$/);if(_0x585e8e){_0x5119d1[_0xf5c817(0x284)](_0xf5c817(0x288)+_0x585e8e[0x1]+'`');continue;}const _0x1a3ffe=_0x2bc44e[_0xf5c817(0x274)](/^list_directory\s+(.+)$/);if(_0x1a3ffe){_0x5119d1['push'](_0xf5c817(0x242)+_0x1a3ffe[0x1]+'`');continue;}}}}_0x2e0c29[_0xf5c817(0x284)](_0x5119d1['join']('\x0a'));const _0x71bc46=['',_0xf5c817(0x22a)];for(const _0x2fe8af of _0x1f3b9a){if(_0x2fe8af[_0xf5c817(0x238)]==='*')_0x71bc46['push']('-\x20'+_0x2fe8af[_0xf5c817(0x21b)]+':*');else{if(Array[_0xf5c817(0x29c)](_0x2fe8af[_0xf5c817(0x238)])){const _0x43a85e=_0x2fe8af[_0xf5c817(0x238)][_0xf5c817(0x287)](([_0x226fc5,_0x3450d9])=>{if(_0x226fc5===_0x3450d9)return''+_0x226fc5;return _0x226fc5+'-'+_0x3450d9;});_0x71bc46[_0xf5c817(0x284)]('-\x20'+_0x2fe8af['path']+':'+_0x43a85e['join'](','));}else _0x71bc46['push']('-\x20'+_0x2fe8af[_0xf5c817(0x21b)]+':*');}}_0x71bc46['push'](''),_0x2e0c29[_0xf5c817(0x284)](_0x71bc46['join']('\x0a')),_0x2e0c29['push'](_0xf5c817(0x1f2));const _0x5313cb=[];for(const _0x479d9d of _0x1f3b9a){let _0x1400a1=a0_0x5076a1[_0xf5c817(0x21a)](_0x4c3214['data'][_0xf5c817(0x280)],_0x479d9d[_0xf5c817(0x21b)]),_0x2deb9e=null,_0x15a58d=null;try{_0x2deb9e=await a0_0x2fff5a[_0xf5c817(0x216)](_0x1400a1,{'encoding':_0xf5c817(0x20f)});}catch(_0x1676c2){const _0x44832c=fixPathRepetition(_0x1400a1);if(_0x44832c)try{_0x2deb9e=await a0_0x2fff5a[_0xf5c817(0x216)](_0x44832c,{'encoding':_0xf5c817(0x20f)}),_0x1400a1=_0x44832c;}catch{_0x15a58d=_0x1676c2 instanceof Error?_0x1676c2:new Error(String(_0x1676c2));}else _0x15a58d=_0x1676c2 instanceof Error?_0x1676c2:new Error(String(_0x1676c2));}if(_0x2deb9e!==null){const _0x3f7edb=_0x2deb9e[_0xf5c817(0x236)](/\r?\n/),_0x5ae879=[_0xf5c817(0x24c)+_0x479d9d[_0xf5c817(0x21b)]+'\x22>'];if(_0x479d9d[_0xf5c817(0x238)]==='*'||!Array[_0xf5c817(0x29c)](_0x479d9d['lines']))for(let _0x11d25a=0x1;_0x11d25a<=_0x3f7edb[_0xf5c817(0x1eb)];_0x11d25a++){const _0x5e574a=_0x3f7edb[_0x11d25a-0x1];_0x5ae879['push'](_0x11d25a+'|\x20'+_0x5e574a);}else for(const [_0x4b166c,_0x5a8148]of _0x479d9d[_0xf5c817(0x238)]){_0x5ae879[_0xf5c817(0x1eb)]>0x1&&_0x5ae879[_0xf5c817(0x284)]('');for(let _0x4c2c98=_0x4b166c;_0x4c2c98<=_0x5a8148&&_0x4c2c98<=_0x3f7edb[_0xf5c817(0x1eb)];_0x4c2c98++){const _0x231c34=_0x3f7edb[_0x4c2c98-0x1];_0x5ae879[_0xf5c817(0x284)](_0x4c2c98+'|\x20'+_0x231c34);}}_0x5ae879[_0xf5c817(0x284)]('</file>'),_0x5313cb[_0xf5c817(0x284)](_0x5ae879[_0xf5c817(0x276)]('\x0a'));}else _0x5313cb[_0xf5c817(0x284)](_0xf5c817(0x24c)+_0x479d9d[_0xf5c817(0x21b)]+_0xf5c817(0x27b)+(_0x15a58d?.[_0xf5c817(0x20c)]||_0xf5c817(0x2ca))+_0xf5c817(0x2d1));}_0x2e0c29[_0xf5c817(0x284)](_0x5313cb[_0xf5c817(0x276)]('\x0a\x0a')),_0x4f4bfc=_0x2e0c29[_0xf5c817(0x276)]('\x0a');const _0x3803eb=_0x45d4ab[_0xf5c817(0x1f1)]?.[_0xf5c817(0x25d)](_0x349a7b=>_0x349a7b[_0xf5c817(0x20c)]?.[_0xf5c817(0x25f)](_0xf5c817(0x1f7)))||[];if(_0x3803eb['length']>0x0){const _0x104b99=_0x3803eb['map'](_0x44f857=>_0x44f857[_0xf5c817(0x20c)])['join'](';\x20');reportMorphError({'error_message':_0x104b99,'error_type':_0xf5c817(0x299),'context':{'tool':_0xf5c817(0x1ed),'repo_path':_0x4c3214['data'][_0xf5c817(0x280)],'query':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x254)],'model':_0xf5c817(0x20b),'termination_reason':_0xf5c817(0x207),'error_count':_0x3803eb[_0xf5c817(0x1eb)],'is_timeout':![],'timings':_0x45d4ab[_0xf5c817(0x2b0)],'files_attempted':_0x1f3b9a[_0xf5c817(0x287)](_0x139a3e=>({'path':_0x139a3e['path'],'lines':_0x139a3e[_0xf5c817(0x238)]})),'tool_calls':_0x2ff92e(_0x45d4ab[_0xf5c817(0x25e)]),'messages':_0x45d4ab[_0xf5c817(0x25e)]?.['map'](_0x13f812=>({'role':_0x13f812['role'],'content':_0x13f812[_0xf5c817(0x1ea)]})),'request_content':{'query':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x254)],'repo_path':_0x4c3214['data'][_0xf5c817(0x280)],'repoRoot':a0_0x5076a1[_0xf5c817(0x21a)](_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x280)]),'model':_0xf5c817(0x20b)}},'source':_0xf5c817(0x247)})[_0xf5c817(0x209)](()=>{});}}else{if(_0x45d4ab[_0xf5c817(0x27c)]==='terminated'&&_0x45d4ab[_0xf5c817(0x1f1)][_0xf5c817(0x1eb)]>0x0){const _0xcc084=_0x45d4ab[_0xf5c817(0x1f1)][_0xf5c817(0x287)](_0x4abb2f=>_0x4abb2f[_0xf5c817(0x20c)])[_0xf5c817(0x276)](';\x20');_0x4f4bfc=_0xf5c817(0x253)+_0xcc084;const _0x59ac58=_0xcc084[_0xf5c817(0x2a5)]()[_0xf5c817(0x293)](_0xf5c817(0x225))||_0xcc084[_0xf5c817(0x2a5)]()['includes'](_0xf5c817(0x1f5))||_0xcc084[_0xf5c817(0x2a5)]()[_0xf5c817(0x293)](_0xf5c817(0x2c3)),_0x52f3b3=_0x45d4ab[_0xf5c817(0x277)]?.['metadata']?.[_0xf5c817(0x249)],_0x9168f6=_0x45d4ab['errors'][0x0];reportMorphError({'error_message':_0xcc084,'error_type':_0x59ac58?_0xf5c817(0x292):_0x9168f6?.[_0xf5c817(0x2c5)]?.[_0xf5c817(0x257)]||_0xf5c817(0x266),'context':{'tool':'warpgrep_codebase_search','repo_path':_0x4c3214['data']['repo_path'],'query':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x254)],'model':_0xf5c817(0x20b),'termination_reason':_0x45d4ab[_0xf5c817(0x27c)],'error_count':_0x45d4ab['errors'][_0xf5c817(0x1eb)],'is_timeout':_0x59ac58,'timings':_0x45d4ab['timings'],'files_attempted':_0x52f3b3?.[_0xf5c817(0x287)](_0x1a644c=>({'path':_0x1a644c['path'],'lines':_0x1a644c[_0xf5c817(0x238)]})),'tool_calls':_0x2ff92e(_0x45d4ab[_0xf5c817(0x25e)]),'messages':_0x45d4ab[_0xf5c817(0x25e)]?.[_0xf5c817(0x287)](_0x256d6f=>({'role':_0x256d6f[_0xf5c817(0x260)],'content':_0x256d6f['content']})),'request_content':{'query':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x254)],'repo_path':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x280)],'repoRoot':a0_0x5076a1[_0xf5c817(0x21a)](_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x280)]),'model':_0xf5c817(0x20b)}},'stack_trace':_0x9168f6?.[_0xf5c817(0x23d)]||undefined,'source':_0xf5c817(0x247)})['catch'](()=>{});}else _0x4f4bfc='Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.';}return{'content':[{'type':_0xf5c817(0x25b),'text':_0x4f4bfc}]};}catch(_0x4b8106){const _0x1246ee=_0x4b8106 instanceof Error?_0x4b8106[_0xf5c817(0x20c)]:String(_0x4b8106),_0x3605f8=_0x1246ee[_0xf5c817(0x2a5)]()[_0xf5c817(0x293)]('timeout')||_0x1246ee[_0xf5c817(0x2a5)]()[_0xf5c817(0x293)](_0xf5c817(0x1f5))||_0x1246ee['toLowerCase']()[_0xf5c817(0x293)](_0xf5c817(0x2c3))||_0x4b8106 instanceof Error&&_0x4b8106['name']==='TimeoutError';return reportMorphError({'error_message':_0x1246ee,'error_type':_0x3605f8?_0xf5c817(0x292):_0x4b8106 instanceof Error?_0x4b8106['constructor'][_0xf5c817(0x257)]:_0xf5c817(0x1f8),'context':{'tool':_0xf5c817(0x1ed),'repo_path':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x280)],'query':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x254)],'model':_0xf5c817(0x20b),'is_timeout':_0x3605f8,'exception_phase':_0xf5c817(0x229),'request_content':{'query':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x254)],'repo_path':_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x280)],'repoRoot':a0_0x5076a1[_0xf5c817(0x21a)](_0x4c3214[_0xf5c817(0x1f3)][_0xf5c817(0x280)]),'model':'morph-warp-grep-v1-1111v0'}},'stack_trace':_0x4b8106 instanceof Error?_0x4b8106['stack']:undefined,'source':_0xf5c817(0x247)})[_0xf5c817(0x209)](()=>{}),{'content':[{'type':_0xf5c817(0x25b),'text':'Error\x20running\x20fast\x20context\x20search:\x20'+_0x1246ee}],'isError':![]};}}case _0xf5c817(0x251):{const _0x4c75cc=CodebaseSearchArgsSchema[_0xf5c817(0x2c0)](_0x2596fc);if(!_0x4c75cc[_0xf5c817(0x2c1)])return{'content':[{'type':_0xf5c817(0x25b),'text':_0xf5c817(0x270)+_0x4c75cc[_0xf5c817(0x22d)]}],'isError':!![]};try{const _0x5936af=MORPH_API_KEY;if(!_0x5936af)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.');const _0x5865b9=await executeCodebaseSearch({'query':_0x4c75cc[_0xf5c817(0x1f3)][_0xf5c817(0x20d)],'target_directories':_0x4c75cc[_0xf5c817(0x1f3)][_0xf5c817(0x2af)],'limit':_0x4c75cc[_0xf5c817(0x1f3)][_0xf5c817(0x290)]},{'apiKey':_0x5936af,'repoId':_0x4c75cc[_0xf5c817(0x1f3)][_0xf5c817(0x1f0)],'branch':_0x4c75cc['data'][_0xf5c817(0x205)],'commitHash':_0x4c75cc['data']['commitHash'],'debug':![]});if(!_0x5865b9['success'])return{'content':[{'type':_0xf5c817(0x25b),'text':'Search\x20failed:\x20'+_0x5865b9['error']}],'isError':!![]};const _0x5f2043=_0x5865b9[_0xf5c817(0x231)][_0xf5c817(0x1eb)]===0x0?_0xf5c817(0x26c)+_0x4c75cc[_0xf5c817(0x1f3)][_0xf5c817(0x20d)]+'\x22':'Found\x20'+_0x5865b9['results'][_0xf5c817(0x1eb)]+_0xf5c817(0x28b)+_0x5865b9['stats'][_0xf5c817(0x2a3)]+_0xf5c817(0x2d0)+_0x5865b9[_0xf5c817(0x231)]['map']((_0x1c3da7,_0x584b49)=>_0x584b49+0x1+'.\x20'+_0x1c3da7[_0xf5c817(0x214)]+'\x20('+(_0x1c3da7[_0xf5c817(0x220)]*0x64)[_0xf5c817(0x20e)](0x1)+_0xf5c817(0x248)+('\x20\x20\x20Lines\x20'+_0x1c3da7[_0xf5c817(0x26e)]+'-'+_0x1c3da7['endLine']+'\x0a')+(_0xf5c817(0x235)+_0x1c3da7[_0xf5c817(0x1ea)][_0xf5c817(0x26b)](0x0,0xc8)+(_0x1c3da7[_0xf5c817(0x1ea)]['length']>0xc8?_0xf5c817(0x1fe):'')+'\x0a'))[_0xf5c817(0x276)]('\x0a');return{'content':[{'type':'text','text':_0x5f2043}]};}catch(_0x88de0e){const _0x4eee6a=_0x88de0e instanceof Error?_0x88de0e[_0xf5c817(0x20c)]:String(_0x88de0e);return reportMorphError({'error_message':_0x4eee6a,'error_type':_0x88de0e instanceof Error?_0x88de0e['constructor']['name']:_0xf5c817(0x1f8),'context':{'tool':'codebase_search','query':_0x4c75cc['data'][_0xf5c817(0x20d)],'repo_id':_0x4c75cc[_0xf5c817(0x1f3)][_0xf5c817(0x1f0)]},'stack_trace':_0x88de0e instanceof Error?_0x88de0e[_0xf5c817(0x23d)]:undefined,'source':_0xf5c817(0x247)})[_0xf5c817(0x209)](()=>{}),{'content':[{'type':_0xf5c817(0x25b),'text':_0xf5c817(0x253)+_0x4eee6a}],'isError':!![]};}}default:throw new Error('Unknown\x20tool:\x20'+_0x4ecbfa);}}catch(_0xd6ca71){const _0x19e1a2=_0xd6ca71 instanceof Error?_0xd6ca71['message']:String(_0xd6ca71);return reportMorphError({'error_message':_0x19e1a2,'error_type':_0xd6ca71 instanceof Error?_0xd6ca71[_0xf5c817(0x2c5)]['name']:_0xf5c817(0x1f8),'context':{'tool':name,'arguments':args?JSON[_0xf5c817(0x28f)](args)[_0xf5c817(0x26b)](0x0,0x1f4):undefined,'mcp_server_version':_0xf5c817(0x2c6)},'stack_trace':_0xd6ca71 instanceof Error?_0xd6ca71[_0xf5c817(0x23d)]:undefined,'source':_0xf5c817(0x247)})[_0xf5c817(0x209)](()=>{}),{'content':[{'type':_0xf5c817(0x25b),'text':_0xf5c817(0x253)+_0x19e1a2}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x5f3b2a){const _0x399786=a0_0x451934,_0xe520dc=await getValidRootDirectories(_0x5f3b2a);if(_0xe520dc[_0x399786(0x1eb)]>0x0)allowedDirectories=[..._0xe520dc],console[_0x399786(0x22d)]('Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20'+_0xe520dc[_0x399786(0x1eb)]+_0x399786(0x1fb));else{console['error'](_0x399786(0x243));if(ENABLE_WORKSPACE_MODE)try{const _0x2dee77=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x2dee77&&(allowedDirectories=[_0x2dee77],console['error'](_0x399786(0x29b)+_0x2dee77));}catch(_0x1a020d){console[_0x399786(0x22d)](_0x399786(0x24e)+_0x1a020d);}}}server[a0_0x451934(0x244)](RootsListChangedNotificationSchema,async()=>{const _0x2dba8e=a0_0x451934;try{const _0x56695d=await server[_0x2dba8e(0x228)]();_0x56695d&&_0x2dba8e(0x213)in _0x56695d&&await updateAllowedDirectoriesFromRoots(_0x56695d[_0x2dba8e(0x213)]);}catch(_0x3fd362){console[_0x2dba8e(0x22d)](_0x2dba8e(0x29d),_0x3fd362 instanceof Error?_0x3fd362[_0x2dba8e(0x20c)]:String(_0x3fd362));}}),server['oninitialized']=async()=>{const _0x57aae6=a0_0x451934,_0x231d69=server['getClientCapabilities']();if(_0x231d69?.['roots'])try{const _0x2c1471=await server[_0x57aae6(0x228)]();_0x2c1471&&_0x57aae6(0x213)in _0x2c1471?await updateAllowedDirectoriesFromRoots(_0x2c1471[_0x57aae6(0x213)]):console[_0x57aae6(0x22d)](_0x57aae6(0x2cf));}catch(_0x2f30bd){console[_0x57aae6(0x22d)](_0x57aae6(0x269),_0x2f30bd instanceof Error?_0x2f30bd['message']:String(_0x2f30bd));}else{if(allowedDirectories[_0x57aae6(0x1eb)]>0x0)console['error']('Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:',allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)console['error'](_0x57aae6(0x224));else throw new Error(_0x57aae6(0x272));}}};async function runServer(){const _0x521660=a0_0x451934,_0x426ef7=new StdioServerTransport();await server['connect'](_0x426ef7),console[_0x521660(0x22d)]('Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio'),allowedDirectories[_0x521660(0x1eb)]===0x0&&console['error'](_0x521660(0x221));}runServer()['catch'](_0x1d9004=>{const _0x422ae6=a0_0x451934;console['error'](_0x422ae6(0x268),_0x1d9004),process[_0x422ae6(0x239)](0x1);});
2
+ const a0_0xdab3d8=a0_0x4bc3;(function(_0x375564,_0x54cb0c){const _0x12995a=a0_0x4bc3,_0x58dc4f=_0x375564();while(!![]){try{const _0x2e0f40=parseInt(_0x12995a(0x226))/0x1*(parseInt(_0x12995a(0x1bb))/0x2)+parseInt(_0x12995a(0x20b))/0x3+-parseInt(_0x12995a(0x255))/0x4+-parseInt(_0x12995a(0x25d))/0x5*(-parseInt(_0x12995a(0x1e5))/0x6)+-parseInt(_0x12995a(0x1e6))/0x7*(parseInt(_0x12995a(0x26a))/0x8)+-parseInt(_0x12995a(0x202))/0x9+parseInt(_0x12995a(0x1a1))/0xa*(parseInt(_0x12995a(0x1e9))/0xb);if(_0x2e0f40===_0x54cb0c)break;else _0x58dc4f['push'](_0x58dc4f['shift']());}catch(_0x45d84c){_0x58dc4f['push'](_0x58dc4f['shift']());}}}(a0_0x89d8,0x6def5));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_0x1821d2 from'fs/promises';import a0_0x369cc9 from'path';import a0_0x253d81 from'os';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}from'@morphllm/morphsdk/tools/warp-grep';import{executeCodebaseSearch}from'@morphllm/morphsdk/tools/codebase-search';import a0_0x4b5e00 from'axios';function fixPathRepetition(_0x3c9b00){const _0x547ad6=a0_0x4bc3,_0x549d45=_0x3c9b00['split'](a0_0x369cc9[_0x547ad6(0x1dc)])[_0x547ad6(0x1c5)](Boolean);if(_0x549d45[_0x547ad6(0x27b)]<0x2)return null;for(let _0x3ee2f6=Math[_0x547ad6(0x227)](_0x549d45['length']/0x2);_0x3ee2f6>=0x1;_0x3ee2f6--){for(let _0x278dac=0x0;_0x278dac<=_0x549d45['length']-0x2*_0x3ee2f6;_0x278dac++){const _0x1ebd27=_0x549d45[_0x547ad6(0x25e)](_0x278dac,_0x278dac+_0x3ee2f6),_0x31cb68=_0x549d45[_0x547ad6(0x25e)](_0x278dac+_0x3ee2f6,_0x278dac+0x2*_0x3ee2f6);if(_0x1ebd27['every']((_0x501c73,_0x4bbf62)=>_0x501c73===_0x31cb68[_0x4bbf62])){const _0x16f66e=[..._0x549d45[_0x547ad6(0x25e)](0x0,_0x278dac),..._0x549d45[_0x547ad6(0x25e)](_0x278dac+_0x3ee2f6)];return a0_0x369cc9[_0x547ad6(0x1dc)]+_0x16f66e[_0x547ad6(0x260)](a0_0x369cc9[_0x547ad6(0x1dc)]);}}}return null;}const args=process[a0_0xdab3d8(0x1fe)][a0_0xdab3d8(0x25e)](0x2),ALL_TOOLS=[a0_0xdab3d8(0x223),'warpgrep_codebase_search',a0_0xdab3d8(0x1fc)],DEFAULT_TOOLS=[a0_0xdab3d8(0x223),a0_0xdab3d8(0x1aa)],ENABLED_TOOLS=process[a0_0xdab3d8(0x1d4)][a0_0xdab3d8(0x27d)]?process[a0_0xdab3d8(0x1d4)][a0_0xdab3d8(0x27d)]==='all'?ALL_TOOLS:process[a0_0xdab3d8(0x1d4)][a0_0xdab3d8(0x27d)][a0_0xdab3d8(0x1e2)](',')[a0_0xdab3d8(0x1ac)](_0x35e670=>_0x35e670[a0_0xdab3d8(0x1e4)]()):DEFAULT_TOOLS;console[a0_0xdab3d8(0x1a8)](a0_0xdab3d8(0x1a5)+ENABLED_TOOLS[a0_0xdab3d8(0x260)](',\x20'));const WORKSPACE_ROOT=process[a0_0xdab3d8(0x1d4)][a0_0xdab3d8(0x258)]||process[a0_0xdab3d8(0x1d4)][a0_0xdab3d8(0x25b)]||process[a0_0xdab3d8(0x245)](),ENABLE_WORKSPACE_MODE=process[a0_0xdab3d8(0x1d4)][a0_0xdab3d8(0x253)]!==a0_0xdab3d8(0x1ab),MORPH_API_KEY=process[a0_0xdab3d8(0x1d4)]['MORPH_API_KEY'],MORPH_API_URL=process['env'][a0_0xdab3d8(0x281)],MORPH_WARP_GREP_TIMEOUT=process['env'][a0_0xdab3d8(0x235)]?parseInt(process[a0_0xdab3d8(0x1d4)][a0_0xdab3d8(0x235)],0xa):undefined;MORPH_API_KEY&&!MORPH_API_KEY[a0_0xdab3d8(0x1b0)](a0_0xdab3d8(0x1d3))&&!MORPH_API_KEY['startsWith'](a0_0xdab3d8(0x27e))&&console[a0_0xdab3d8(0x1a8)](a0_0xdab3d8(0x225));async function reportMorphError(_0x5a75c6){const _0x123980=a0_0xdab3d8;try{await a0_0x4b5e00[_0x123980(0x203)](_0x123980(0x246),{..._0x5a75c6,'timestamp':new Date()['toISOString'](),'source':_0x5a75c6['source']||_0x123980(0x240)},{'timeout':0x1388,'headers':{'Content-Type':'application/json','Authorization':_0x123980(0x27a)+MORPH_API_KEY}});}catch{}}args[a0_0xdab3d8(0x27b)]===0x0&&!ENABLE_WORKSPACE_MODE&&(console[a0_0xdab3d8(0x1a8)](a0_0xdab3d8(0x24c)),console[a0_0xdab3d8(0x1a8)](a0_0xdab3d8(0x27f)),console['error'](a0_0xdab3d8(0x266)),console['error'](a0_0xdab3d8(0x1eb)),console['error'](a0_0xdab3d8(0x20e)),console[a0_0xdab3d8(0x1a8)](a0_0xdab3d8(0x1c8)));function normalizePath(_0x2144ce){return a0_0x369cc9['normalize'](_0x2144ce);}function expandHome(_0x1886b2){const _0x26176d=a0_0xdab3d8;if(_0x1886b2[_0x26176d(0x1b0)]('~/')||_0x1886b2==='~')return a0_0x369cc9[_0x26176d(0x260)](a0_0x253d81['homedir'](),_0x1886b2[_0x26176d(0x25e)](0x1));return _0x1886b2;}let allowedDirectories=await Promise[a0_0xdab3d8(0x278)](args['map'](async _0x10d777=>{const _0x71eb4b=a0_0xdab3d8,_0x122076=expandHome(_0x10d777),_0x339b86=a0_0x369cc9[_0x71eb4b(0x1bf)](_0x122076);try{const _0xb04dfc=await a0_0x1821d2['realpath'](_0x339b86);return normalizePath(_0xb04dfc);}catch(_0x1f76fe){return normalizePath(_0x339b86);}}));function a0_0x4bc3(_0x3fe97a,_0x1f9cbb){_0x3fe97a=_0x3fe97a-0x19b;const _0x89d858=a0_0x89d8();let _0x4bc3aa=_0x89d858[_0x3fe97a];return _0x4bc3aa;}if(ENABLE_WORKSPACE_MODE&&args[a0_0xdab3d8(0x27b)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories['push'](workspaceDir),console[a0_0xdab3d8(0x1a8)](a0_0xdab3d8(0x1da)+workspaceDir+'\x20as\x20allowed\x20directory'));}catch(a0_0x34380c){console[a0_0xdab3d8(0x1a8)](a0_0xdab3d8(0x222)+a0_0x34380c);}async function detectWorkspaceRoot(_0x2e2436){const _0x211b08=a0_0xdab3d8;let _0x2c21dd=a0_0x369cc9['resolve'](_0x2e2436);const _0x21e827=[_0x211b08(0x213),_0x211b08(0x1d2),_0x211b08(0x1fa),_0x211b08(0x1ea),_0x211b08(0x21a),_0x211b08(0x1ce),_0x211b08(0x1b5),_0x211b08(0x1a7),'composer.json'];while(_0x2c21dd!==a0_0x369cc9['dirname'](_0x2c21dd)){for(const _0x2a9b87 of _0x21e827){const _0x184225=a0_0x369cc9[_0x211b08(0x260)](_0x2c21dd,_0x2a9b87);try{return await a0_0x1821d2[_0x211b08(0x1c4)](_0x184225),normalizePath(_0x2c21dd);}catch{}}_0x2c21dd=a0_0x369cc9['dirname'](_0x2c21dd);}return normalizePath(_0x2e2436);}await Promise[a0_0xdab3d8(0x278)](args[a0_0xdab3d8(0x1ac)](async _0x4cd1f1=>{const _0x580554=a0_0xdab3d8;try{const _0x141aea=await a0_0x1821d2[_0x580554(0x1cd)](expandHome(_0x4cd1f1));!_0x141aea['isDirectory']()&&(console[_0x580554(0x1a8)](_0x580554(0x1e0)+_0x4cd1f1+_0x580554(0x208)),process[_0x580554(0x236)](0x1));}catch(_0x50bd93){console[_0x580554(0x1a8)]('Error\x20accessing\x20directory\x20'+_0x4cd1f1+':',_0x50bd93),process[_0x580554(0x236)](0x1);}}));async function validatePath(_0x1528b5){const _0x59a64f=a0_0xdab3d8,_0x30479c=expandHome(_0x1528b5),_0x4913d3=a0_0x369cc9['resolve'](_0x30479c);try{const _0x4bd4d1=await a0_0x1821d2[_0x59a64f(0x1df)](_0x4913d3);return _0x4bd4d1;}catch(_0x55fbca){if(_0x55fbca[_0x59a64f(0x256)]===_0x59a64f(0x21c)){const _0x3d805f=a0_0x369cc9[_0x59a64f(0x26b)](_0x4913d3);try{const _0x43cfb4=await a0_0x1821d2[_0x59a64f(0x1df)](_0x3d805f);return a0_0x369cc9['join'](_0x43cfb4,a0_0x369cc9['basename'](_0x4913d3));}catch{throw new Error('Parent\x20directory\x20does\x20not\x20exist:\x20'+_0x3d805f);}}throw _0x55fbca;}}function a0_0x89d8(){const _0x346057=['path','PWD','-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a','10eMjKIc','slice','⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a','join','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','repeat','0.2.0','repoId','describe','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','message','Here\x20is\x20the\x20content\x20of\x20files:\x0a','files','1445656FMrjcj','dirname','object','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','startLine','utf-8','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:','Benefits:\x0a','-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a','catch','File\x20read\x20error:','isArray','-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a','results','all','<file\x20path=\x22','Bearer\x20','length','Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:','ENABLED_TOOLS','morph-','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','assistant','MORPH_API_URL','Search\x20your\x20codebase\x20using\x20natural\x20language\x20queries.\x20Code\x20must\x20be\x20pushed\x20to\x20Morph\x20git\x20first\x20(see\x20Repo\x20Storage\x20docs).\x20','Created\x20File','safeParse','lines','boolean','requiresApiKey','Search\x20problem\x20statement\x20that\x20this\x20subagent\x20is\x20supposed\x20to\x20research\x20for','success','58510YDkaRk','</file>','setRequestHandler','ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a','Enabled\x20tools:\x20','code_edit','tsconfig.json','error','FileReadError','warpgrep_codebase_search','false','map','morph-v3-fast','\x20\x20\x20Lines\x20','target_directories','startsWith','-\x20Searches\x20by\x20semantic\x20meaning,\x20not\x20just\x20keywords\x0a','branch','For\x20deletions:\x0a','array','.cursor','optional','-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a','TimeoutError','\x27\x20in\x20`','terminated','493948AnJlJK','Failed\x20to\x20read\x20file:\x20','Fallback:\x20Using\x20workspace\x20root\x20','timeout','resolve','number','IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a','Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.','default','access','filter','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a','Found\x20','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.','[could\x20not\x20read\x20file:\x20','-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a','dryRun','limit','stat','go.mod','listRoots','-\x20Grepped\x20\x27','constructor','.vscode','sk-','env','oninitialized','messages','repo_path','roots','Applied','Workspace\x20mode\x20enabled:\x20Using\x20','search_string','sep','connect','unknown\x20error','realpath','Error:\x20','Returns\x20ranked\x20code\x20chunks\x20with\x20relevance\x20scores,\x20file\x20paths,\x20and\x20line\x20numbers.\x20','split','morph-warp-grep-v1-1111v0','trim','627870ShRWUR','14TymHPd','Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol','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','1364dVvDHi','Cargo.toml','\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)','\x20chars)','Branch\x20to\x20search\x20(uses\x20latest\x20commit)','readFile','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','timings','Search\x20failed:\x20','Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio','runWarpGrep_call','apply\x20these\x20changes','stringify','unknown','instruction','-\x20Two-stage\x20retrieval:\x20vector\x20search\x20(~240ms)\x20+\x20GPU\x20reranking\x20(~630ms)\x0a','data','package.json','timed\x20out','codebase_search','stats','argv','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','applied\x20edits\x20to','\x0a...\x20(truncated,\x20total:\x20','2256921WlMTmc','post','Invalid\x20arguments:\x20','UnknownError','-\x20Works\x20across\x20all\x20files\x20and\x20languages\x0a\x0a','etimedout','\x20is\x20not\x20a\x20directory','No\x20results\x20found\x20for\x20query:\x20\x22','commitHash','1181655WewWXP','Fatal\x20error\x20running\x20server:','Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','Example\x20queries:\x20\x27Where\x20is\x20JWT\x20validation?\x27,\x20\x27How\x20does\x20auth\x20work?\x27,\x20\x27Find\x20database\x20connection\x20logic\x27.','create\x20this\x20file','content','.git','completed_with_file_errors','filepath','A\x20search\x20subagent\x20the\x20user\x20refers\x20to\x20as\x20\x27WarpGrep\x27\x20that\x20is\x20ideal\x20for\x20exploring\x20the\x20codebase\x20based\x20on\x20a\x20request.\x20','\x20valid\x20directories','read\x20','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20subagent\x20in\x20its\x20search.\x20','pyproject.toml','params','ENOENT','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','stack','Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a','searchTimeMs','name','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','edit_file','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.','Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27','1LFOaaA','floor','Morph\x20FastApply\x20failed\x20without\x20error\x20message','morph-mcp','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','push','toLowerCase','created','Warning:\x20','Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all','finish','string','Rules:\x0a','toFixed','match','MORPH_WARP_GREP_TIMEOUT','exit','\x20-\x20','endLine','\x20(new\x20file)','❌\x20Morph\x20Edit\x20Failed:\x20','query','substring','-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a','\x0a</file>','list_directory\x20','mcp-filesystem','text','Error\x20running\x20fast\x20context\x20search:\x20','-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a','inputSchema','cwd','https://morphllm.com/api/error-report','terminationReason','includes','udiff','You\x20should\x20consider\x20using\x20classical\x20search\x20tools\x20afterwards\x20to\x20locate\x20the\x20rest,\x20but\x20only\x20if\x20necessary.\x20','Failed\x20to\x20request\x20roots\x20from\x20client:','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','🎯\x20USE\x20THIS\x20TOOL\x20to\x20find\x20code\x20when\x20you\x20need\x20to\x20understand\x20existing\x20implementations.\x0a\x0a','role','metadata','rerankScore','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','ENABLE_WORKSPACE_MODE','Successfully\x20','2052788HHkEhh','code','errors','WORKSPACE_ROOT','Specific\x20commit\x20hash\x20to\x20search'];a0_0x89d8=function(){return _0x346057;};return a0_0x89d8();}const MorphEditFileArgsSchema=z[a0_0xdab3d8(0x26c)]({'path':z[a0_0xdab3d8(0x231)](),'code_edit':z[a0_0xdab3d8(0x231)]()[a0_0xdab3d8(0x265)]('Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.'),'instruction':z[a0_0xdab3d8(0x231)]()[a0_0xdab3d8(0x265)]('A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.'),'dryRun':z[a0_0xdab3d8(0x19d)]()['default'](![])[a0_0xdab3d8(0x265)]('Preview\x20changes\x20without\x20applying\x20them.')}),WarpGrepArgsSchema=z[a0_0xdab3d8(0x26c)]({'search_string':z[a0_0xdab3d8(0x231)]()[a0_0xdab3d8(0x265)](a0_0xdab3d8(0x19f)),'repo_path':z['string']()['describe']('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')}),CodebaseSearchArgsSchema=z[a0_0xdab3d8(0x26c)]({'query':z[a0_0xdab3d8(0x231)]()[a0_0xdab3d8(0x265)]('Natural\x20language\x20query\x20to\x20search\x20for\x20code'),'repoId':z[a0_0xdab3d8(0x231)]()[a0_0xdab3d8(0x265)]('Repository\x20identifier'),'branch':z[a0_0xdab3d8(0x231)]()[a0_0xdab3d8(0x1b6)]()['describe'](a0_0xdab3d8(0x1ed)),'commitHash':z[a0_0xdab3d8(0x231)]()[a0_0xdab3d8(0x1b6)]()['describe'](a0_0xdab3d8(0x259)),'target_directories':z[a0_0xdab3d8(0x1b4)](z['string']())[a0_0xdab3d8(0x1c3)]([])[a0_0xdab3d8(0x265)](a0_0xdab3d8(0x22f)),'limit':z[a0_0xdab3d8(0x1c0)]()[a0_0xdab3d8(0x1b6)]()[a0_0xdab3d8(0x1c3)](0xa)[a0_0xdab3d8(0x265)]('Max\x20results\x20to\x20return')}),server=new Server({'name':a0_0xdab3d8(0x229),'version':a0_0xdab3d8(0x263)},{'capabilities':{'tools':{}}});server[a0_0xdab3d8(0x1a3)](ListToolsRequestSchema,async()=>{const _0x254641=a0_0xdab3d8,_0x5b2add=[{'name':_0x254641(0x223),'description':_0x254641(0x1c6)+_0x254641(0x25f)+'🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a'+_0x254641(0x1c1)+'Benefits:\x0a'+'-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a'+_0x254641(0x1ca)+'-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a'+'-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a'+_0x254641(0x20d)+_0x254641(0x1a4)+_0x254641(0x21f)+_0x254641(0x1b3)+_0x254641(0x25c)+_0x254641(0x1b7)+_0x254641(0x232)+_0x254641(0x272)+_0x254641(0x276)+'-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a'+_0x254641(0x23d)+_0x254641(0x20f)+_0x254641(0x243)+_0x254641(0x1ff),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x254641(0x1aa),'description':_0x254641(0x216)+_0x254641(0x1ef)+_0x254641(0x1e8)+_0x254641(0x219)+_0x254641(0x224)+'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'+_0x254641(0x24a)+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':'codebase_search','description':'**SEMANTIC\x20CODE\x20SEARCH\x20-\x20USE\x20FOR\x20FINDING\x20CODE**\x0a\x0a'+'⚡\x20INTELLIGENT:\x20Natural\x20language\x20search\x20across\x20your\x20entire\x20codebase\x20using\x20AI\x20embeddings.\x0a'+_0x254641(0x24e)+_0x254641(0x271)+_0x254641(0x1f8)+'-\x20Returns\x20precise\x20code\x20chunks\x20with\x20relevance\x20scores\x0a'+_0x254641(0x1b1)+_0x254641(0x206)+_0x254641(0x282)+_0x254641(0x1e1)+_0x254641(0x210),'inputSchema':zodToJsonSchema(CodebaseSearchArgsSchema),'requiresApiKey':!![]}],_0x203a65=_0x5b2add[_0x254641(0x1c5)](_0x453313=>{const _0x167f87=_0x254641;if(!ENABLED_TOOLS[_0x167f87(0x248)](_0x453313[_0x167f87(0x221)]))return![];if(_0x167f87(0x19e)in _0x453313&&_0x453313[_0x167f87(0x19e)]&&!MORPH_API_KEY)return console[_0x167f87(0x1a8)](_0x167f87(0x22e)+_0x453313[_0x167f87(0x221)]+_0x167f87(0x261)),![];return!![];});return{'tools':_0x203a65[_0x254641(0x1ac)](_0x8cb9ee=>({'name':_0x8cb9ee[_0x254641(0x221)],'description':_0x8cb9ee['description'],'inputSchema':_0x8cb9ee[_0x254641(0x244)]}))};}),server[a0_0xdab3d8(0x1a3)](CallToolRequestSchema,async _0x3ec89b=>{const _0x51e21e=a0_0xdab3d8;try{const {name:_0x69a882,arguments:_0xde3037}=_0x3ec89b[_0x51e21e(0x21b)];switch(_0x69a882){case'edit_file':{const _0x2e8bde=MorphEditFileArgsSchema['safeParse'](_0xde3037);if(!_0x2e8bde[_0x51e21e(0x1a0)])throw new Error('Invalid\x20arguments\x20for\x20morph_edit_file:\x20'+_0x2e8bde[_0x51e21e(0x1a8)]);const _0x2bf156=await validatePath(_0x2e8bde[_0x51e21e(0x1f9)][_0x51e21e(0x25a)]);let _0x5caecb=null,_0xa9ee26=!![],_0x3eaf4a=null;try{_0x5caecb=await a0_0x1821d2[_0x51e21e(0x1ee)](_0x2bf156,_0x51e21e(0x26f));}catch(_0x99980e){const _0x2aad64=_0x99980e[_0x51e21e(0x256)];_0x2aad64===_0x51e21e(0x21c)?(_0xa9ee26=![],_0x5caecb=''):(_0x3eaf4a=_0x51e21e(0x1bc)+(_0x2aad64||_0x51e21e(0x1f6))+_0x51e21e(0x237)+(_0x99980e instanceof Error?_0x99980e[_0x51e21e(0x267)]:String(_0x99980e)),console[_0x51e21e(0x1a8)](_0x51e21e(0x22e)+_0x3eaf4a));}try{const _0x438741=MORPH_API_KEY;if(!_0x438741)throw new Error(_0x51e21e(0x24d));const _0x173597=a0_0x369cc9['dirname'](_0x2bf156),_0x24f521=a0_0x369cc9['basename'](_0x2bf156),_0x123dd9=await executeEditFile({'target_filepath':_0x24f521,'code_edit':_0x2e8bde[_0x51e21e(0x1f9)]['code_edit'],'instructions':_0x2e8bde[_0x51e21e(0x1f9)][_0x51e21e(0x1f7)]},{'morphApiKey':_0x438741,'morphApiUrl':MORPH_API_URL,'baseDir':_0x173597,'autoWrite':!_0x2e8bde['data'][_0x51e21e(0x1cb)],'generateUdiff':!![],'debug':![]});if(!_0x123dd9[_0x51e21e(0x1a0)])throw new Error(_0x123dd9['error']||_0x51e21e(0x228));const _0x31ae9a=_0x123dd9[_0x51e21e(0x249)]||'';let _0x269c2b=0x3;while(_0x31ae9a['includes']('`'[_0x51e21e(0x262)](_0x269c2b))){_0x269c2b++;}const _0x4f0459='`'[_0x51e21e(0x262)](_0x269c2b)+'diff\x0a'+_0x31ae9a+'`'[_0x51e21e(0x262)](_0x269c2b)+'\x0a\x0a';if(_0x2e8bde[_0x51e21e(0x1f9)]['dryRun'])return{'content':[{'type':_0x51e21e(0x241),'text':'🔍\x20Morph\x20Edit\x20Preview'+(_0xa9ee26?'':_0x51e21e(0x239))+':\x20'+_0x2e8bde[_0x51e21e(0x1f9)][_0x51e21e(0x1f7)]+'\x0a\x0a'+_0x4f0459+'Use\x20dryRun=false\x20to\x20'+(_0xa9ee26?_0x51e21e(0x1f4):_0x51e21e(0x211))+'.'}]};return{'content':[{'type':_0x51e21e(0x241),'text':'Morph\x20Edit\x20'+(_0xa9ee26?_0x51e21e(0x1d9):_0x51e21e(0x283))+':\x20'+_0x2e8bde[_0x51e21e(0x1f9)]['instruction']+'\x0a\x0a'+_0x4f0459+_0x51e21e(0x254)+(_0xa9ee26?_0x51e21e(0x200):_0x51e21e(0x22d))+'\x20'+_0x2e8bde[_0x51e21e(0x1f9)][_0x51e21e(0x25a)]}]};}catch(_0x25f12e){const _0x15a1ad=_0x25f12e instanceof Error?_0x25f12e[_0x51e21e(0x267)]:String(_0x25f12e);return reportMorphError({'error_message':_0x15a1ad,'error_type':_0x25f12e instanceof Error?_0x25f12e['constructor'][_0x51e21e(0x221)]:_0x51e21e(0x205),'context':{'tool':_0x51e21e(0x223),'file_path':_0x2e8bde[_0x51e21e(0x1f9)]['path'],'validated_path':_0x2bf156,'instruction':_0x2e8bde[_0x51e21e(0x1f9)][_0x51e21e(0x1f7)],'model':_0x51e21e(0x1ad),'dry_run':_0x2e8bde[_0x51e21e(0x1f9)]['dryRun'],'file_exists':_0xa9ee26,'file_read_error':_0x3eaf4a,'file_readable':_0x5caecb!==null,'request_content':{'path':_0x2e8bde[_0x51e21e(0x1f9)]['path'],'code_edit':_0x2e8bde['data'][_0x51e21e(0x1a6)],'instruction':_0x2e8bde['data'][_0x51e21e(0x1f7)],'original_code':_0x5caecb!==null?_0x5caecb[_0x51e21e(0x27b)]>0xc350?_0x5caecb[_0x51e21e(0x23c)](0x0,0xc350)+_0x51e21e(0x201)+_0x5caecb[_0x51e21e(0x27b)]+_0x51e21e(0x1ec):_0x5caecb:_0x51e21e(0x1c9)+(_0x3eaf4a||_0x51e21e(0x1de))+']','original_code_length':_0x5caecb?.[_0x51e21e(0x27b)]??0x0,'model':'morph-v3-fast','dry_run':_0x2e8bde['data']['dryRun']}},'stack_trace':_0x25f12e instanceof Error?_0x25f12e[_0x51e21e(0x21e)]:undefined,'source':'mcp-filesystem'})['catch'](()=>{}),{'content':[{'type':_0x51e21e(0x241),'text':_0x51e21e(0x23a)+_0x15a1ad}],'isError':!![]};}}case'warpgrep_codebase_search':{const _0x4be38b=WarpGrepArgsSchema[_0x51e21e(0x19b)](_0xde3037);if(!_0x4be38b['success'])return{'content':[{'type':'text','text':_0x51e21e(0x204)+_0x4be38b[_0x51e21e(0x1a8)]}],'isError':!![]};const _0xcb9aee=_0x241fe8=>{const _0x46cb99=_0x51e21e,_0x2f834b=[];for(const _0x52e637 of _0x241fe8||[]){const _0x370d7b=_0x52e637[_0x46cb99(0x24f)],_0x2d0acf=_0x52e637[_0x46cb99(0x212)];if(_0x370d7b===_0x46cb99(0x280)&&_0x2d0acf){const _0x286094=_0x2d0acf[_0x46cb99(0x1e2)]('\x0a')[_0x46cb99(0x1c5)](_0x589dc5=>_0x589dc5['trim']());for(const _0x3c195d of _0x286094){const _0x5df682=_0x3c195d[_0x46cb99(0x234)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x5df682){_0x2f834b[_0x46cb99(0x22b)]('grep\x20\x27'+_0x5df682[0x1]+'\x27\x20'+_0x5df682[0x2]);continue;}const _0x32d7f3=_0x3c195d['match'](/^read\s+(.+)$/);if(_0x32d7f3){_0x2f834b['push'](_0x46cb99(0x218)+_0x32d7f3[0x1]);continue;}const _0x5ed034=_0x3c195d['match'](/^list_directory\s+(.+)$/);if(_0x5ed034){_0x2f834b[_0x46cb99(0x22b)](_0x46cb99(0x23f)+_0x5ed034[0x1]);continue;}}}}return _0x2f834b;};try{const _0x31e017=a0_0x369cc9[_0x51e21e(0x1bf)](_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)]),_0x10bd39=new LocalRipgrepProvider(_0x31e017),_0x558caf=await runWarpGrep({'query':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1db)],'repoRoot':_0x31e017,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x10bd39});let _0x553d63='';if(_0x558caf[_0x51e21e(0x247)]==='completed'&&_0x558caf['finish']?.[_0x51e21e(0x250)]?.[_0x51e21e(0x269)]){const _0x2b9496=_0x558caf['finish']['metadata'][_0x51e21e(0x269)],_0xcef0c4=[],_0xe4a103=[_0x51e21e(0x26d)];for(const _0x421614 of _0x558caf[_0x51e21e(0x1d6)]){const _0x3b7b9f=_0x421614['role'],_0x51cd8a=_0x421614[_0x51e21e(0x212)];if(_0x3b7b9f==='assistant'&&_0x51cd8a){const _0x2fc428=_0x51cd8a[_0x51e21e(0x1e2)]('\x0a')['filter'](_0x19822a=>_0x19822a['trim']());for(const _0xc36d1e of _0x2fc428){const _0xea9772=_0xc36d1e[_0x51e21e(0x234)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0xea9772){_0xe4a103[_0x51e21e(0x22b)](_0x51e21e(0x1d0)+_0xea9772[0x1]+_0x51e21e(0x1b9)+_0xea9772[0x2]+'`');continue;}const _0x102fb7=_0xc36d1e[_0x51e21e(0x234)](/^read\s+(.+)$/);if(_0x102fb7){_0xe4a103[_0x51e21e(0x22b)]('-\x20Read\x20file\x20`'+_0x102fb7[0x1]+'`');continue;}const _0x7f08d1=_0xc36d1e[_0x51e21e(0x234)](/^list_directory\s+(.+)$/);if(_0x7f08d1){_0xe4a103[_0x51e21e(0x22b)]('-\x20Listed\x20directory\x20`'+_0x7f08d1[0x1]+'`');continue;}}}}_0xcef0c4[_0x51e21e(0x22b)](_0xe4a103['join']('\x0a'));const _0x2fb68=['','Relevant\x20context\x20found:'];for(const _0x26b30c of _0x2b9496){if(_0x26b30c[_0x51e21e(0x19c)]==='*')_0x2fb68[_0x51e21e(0x22b)]('-\x20'+_0x26b30c[_0x51e21e(0x25a)]+':*');else{if(Array[_0x51e21e(0x275)](_0x26b30c[_0x51e21e(0x19c)])){const _0x372375=_0x26b30c[_0x51e21e(0x19c)][_0x51e21e(0x1ac)](([_0xec33c4,_0x554f9c])=>{if(_0xec33c4===_0x554f9c)return''+_0xec33c4;return _0xec33c4+'-'+_0x554f9c;});_0x2fb68[_0x51e21e(0x22b)]('-\x20'+_0x26b30c[_0x51e21e(0x25a)]+':'+_0x372375[_0x51e21e(0x260)](','));}else _0x2fb68[_0x51e21e(0x22b)]('-\x20'+_0x26b30c[_0x51e21e(0x25a)]+':*');}}_0x2fb68[_0x51e21e(0x22b)](''),_0xcef0c4['push'](_0x2fb68[_0x51e21e(0x260)]('\x0a')),_0xcef0c4['push'](_0x51e21e(0x268));const _0x2c9810=[];for(const _0x1d978e of _0x2b9496){let _0x188773=a0_0x369cc9[_0x51e21e(0x1bf)](_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)],_0x1d978e[_0x51e21e(0x25a)]),_0x3141dd=null,_0x540d37=null;try{_0x3141dd=await a0_0x1821d2[_0x51e21e(0x1ee)](_0x188773,{'encoding':_0x51e21e(0x26f)});}catch(_0xdf0d30){const _0x5258f5=fixPathRepetition(_0x188773);if(_0x5258f5)try{_0x3141dd=await a0_0x1821d2[_0x51e21e(0x1ee)](_0x5258f5,{'encoding':_0x51e21e(0x26f)}),_0x188773=_0x5258f5;}catch{_0x540d37=_0xdf0d30 instanceof Error?_0xdf0d30:new Error(String(_0xdf0d30));}else _0x540d37=_0xdf0d30 instanceof Error?_0xdf0d30:new Error(String(_0xdf0d30));}if(_0x3141dd!==null){const _0x56d294=_0x3141dd[_0x51e21e(0x1e2)](/\r?\n/),_0x25f7e0=[_0x51e21e(0x279)+_0x1d978e[_0x51e21e(0x25a)]+'\x22>'];if(_0x1d978e[_0x51e21e(0x19c)]==='*'||!Array['isArray'](_0x1d978e[_0x51e21e(0x19c)]))for(let _0x565bec=0x1;_0x565bec<=_0x56d294[_0x51e21e(0x27b)];_0x565bec++){const _0x2732ea=_0x56d294[_0x565bec-0x1];_0x25f7e0[_0x51e21e(0x22b)](_0x565bec+'|\x20'+_0x2732ea);}else for(const [_0x3b17db,_0x16e8fd]of _0x1d978e['lines']){_0x25f7e0[_0x51e21e(0x27b)]>0x1&&_0x25f7e0[_0x51e21e(0x22b)]('');for(let _0x5486bb=_0x3b17db;_0x5486bb<=_0x16e8fd&&_0x5486bb<=_0x56d294[_0x51e21e(0x27b)];_0x5486bb++){const _0x24797a=_0x56d294[_0x5486bb-0x1];_0x25f7e0[_0x51e21e(0x22b)](_0x5486bb+'|\x20'+_0x24797a);}}_0x25f7e0[_0x51e21e(0x22b)](_0x51e21e(0x1a2)),_0x2c9810[_0x51e21e(0x22b)](_0x25f7e0[_0x51e21e(0x260)]('\x0a'));}else _0x2c9810['push'](_0x51e21e(0x279)+_0x1d978e[_0x51e21e(0x25a)]+'\x22>\x0aError\x20reading\x20file:\x20'+(_0x540d37?.[_0x51e21e(0x267)]||'Unknown\x20error')+_0x51e21e(0x23e));}_0xcef0c4['push'](_0x2c9810[_0x51e21e(0x260)]('\x0a\x0a')),_0x553d63=_0xcef0c4[_0x51e21e(0x260)]('\x0a');const _0x4dd53b=_0x558caf['errors']?.[_0x51e21e(0x1c5)](_0x4dbe84=>_0x4dbe84[_0x51e21e(0x267)]?.['startsWith'](_0x51e21e(0x274)))||[];if(_0x4dd53b[_0x51e21e(0x27b)]>0x0){const _0x321bbf=_0x4dd53b[_0x51e21e(0x1ac)](_0x3d8059=>_0x3d8059['message'])[_0x51e21e(0x260)](';\x20');reportMorphError({'error_message':_0x321bbf,'error_type':_0x51e21e(0x1a9),'context':{'tool':_0x51e21e(0x1aa),'repo_path':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)],'query':_0x4be38b[_0x51e21e(0x1f9)]['search_string'],'model':'morph-warp-grep-v1-1111v0','termination_reason':_0x51e21e(0x214),'error_count':_0x4dd53b[_0x51e21e(0x27b)],'is_timeout':![],'timings':_0x558caf[_0x51e21e(0x1f0)],'files_attempted':_0x2b9496['map'](_0x2eaec8=>({'path':_0x2eaec8[_0x51e21e(0x25a)],'lines':_0x2eaec8[_0x51e21e(0x19c)]})),'tool_calls':_0xcb9aee(_0x558caf['messages']),'messages':_0x558caf['messages']?.['map'](_0x14d661=>({'role':_0x14d661[_0x51e21e(0x24f)],'content':_0x14d661[_0x51e21e(0x212)]})),'request_content':{'query':_0x4be38b['data'][_0x51e21e(0x1db)],'repo_path':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)],'repoRoot':a0_0x369cc9[_0x51e21e(0x1bf)](_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)]),'model':_0x51e21e(0x1e3)}},'source':_0x51e21e(0x240)})['catch'](()=>{});}}else{if(_0x558caf[_0x51e21e(0x247)]===_0x51e21e(0x1ba)&&_0x558caf['errors'][_0x51e21e(0x27b)]>0x0){const _0x5bb7b1=_0x558caf[_0x51e21e(0x257)][_0x51e21e(0x1ac)](_0x26764a=>_0x26764a[_0x51e21e(0x267)])[_0x51e21e(0x260)](';\x20');_0x553d63='Error:\x20'+_0x5bb7b1;const _0x4d2ece=_0x5bb7b1['toLowerCase']()[_0x51e21e(0x248)](_0x51e21e(0x1be))||_0x5bb7b1[_0x51e21e(0x22c)]()['includes']('timed\x20out')||_0x5bb7b1[_0x51e21e(0x22c)]()[_0x51e21e(0x248)](_0x51e21e(0x207)),_0x28990f=_0x558caf[_0x51e21e(0x230)]?.[_0x51e21e(0x250)]?.[_0x51e21e(0x269)],_0x4c8359=_0x558caf[_0x51e21e(0x257)][0x0];reportMorphError({'error_message':_0x5bb7b1,'error_type':_0x4d2ece?_0x51e21e(0x1b8):_0x4c8359?.[_0x51e21e(0x1d1)]?.[_0x51e21e(0x221)]||'WarpGrepError','context':{'tool':_0x51e21e(0x1aa),'repo_path':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)],'query':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1db)],'model':_0x51e21e(0x1e3),'termination_reason':_0x558caf['terminationReason'],'error_count':_0x558caf['errors'][_0x51e21e(0x27b)],'is_timeout':_0x4d2ece,'timings':_0x558caf[_0x51e21e(0x1f0)],'files_attempted':_0x28990f?.[_0x51e21e(0x1ac)](_0xc58493=>({'path':_0xc58493[_0x51e21e(0x25a)],'lines':_0xc58493[_0x51e21e(0x19c)]})),'tool_calls':_0xcb9aee(_0x558caf[_0x51e21e(0x1d6)]),'messages':_0x558caf[_0x51e21e(0x1d6)]?.[_0x51e21e(0x1ac)](_0x4af7d1=>({'role':_0x4af7d1[_0x51e21e(0x24f)],'content':_0x4af7d1['content']})),'request_content':{'query':_0x4be38b['data'][_0x51e21e(0x1db)],'repo_path':_0x4be38b[_0x51e21e(0x1f9)]['repo_path'],'repoRoot':a0_0x369cc9[_0x51e21e(0x1bf)](_0x4be38b[_0x51e21e(0x1f9)]['repo_path']),'model':'morph-warp-grep-v1-1111v0'}},'stack_trace':_0x4c8359?.[_0x51e21e(0x21e)]||undefined,'source':'mcp-filesystem'})[_0x51e21e(0x273)](()=>{});}else _0x553d63=_0x51e21e(0x1c2);}return{'content':[{'type':'text','text':_0x553d63}]};}catch(_0xf48713){const _0x433114=_0xf48713 instanceof Error?_0xf48713[_0x51e21e(0x267)]:String(_0xf48713),_0x103f95=_0x433114[_0x51e21e(0x22c)]()[_0x51e21e(0x248)](_0x51e21e(0x1be))||_0x433114[_0x51e21e(0x22c)]()['includes'](_0x51e21e(0x1fb))||_0x433114[_0x51e21e(0x22c)]()[_0x51e21e(0x248)]('etimedout')||_0xf48713 instanceof Error&&_0xf48713[_0x51e21e(0x221)]==='TimeoutError';return reportMorphError({'error_message':_0x433114,'error_type':_0x103f95?'TimeoutError':_0xf48713 instanceof Error?_0xf48713[_0x51e21e(0x1d1)][_0x51e21e(0x221)]:_0x51e21e(0x205),'context':{'tool':_0x51e21e(0x1aa),'repo_path':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)],'query':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1db)],'model':_0x51e21e(0x1e3),'is_timeout':_0x103f95,'exception_phase':_0x51e21e(0x1f3),'request_content':{'query':_0x4be38b['data'][_0x51e21e(0x1db)],'repo_path':_0x4be38b[_0x51e21e(0x1f9)][_0x51e21e(0x1d7)],'repoRoot':a0_0x369cc9[_0x51e21e(0x1bf)](_0x4be38b['data'][_0x51e21e(0x1d7)]),'model':_0x51e21e(0x1e3)}},'stack_trace':_0xf48713 instanceof Error?_0xf48713['stack']:undefined,'source':'mcp-filesystem'})[_0x51e21e(0x273)](()=>{}),{'content':[{'type':_0x51e21e(0x241),'text':_0x51e21e(0x242)+_0x433114}],'isError':![]};}}case _0x51e21e(0x1fc):{const _0x1c0696=CodebaseSearchArgsSchema[_0x51e21e(0x19b)](_0xde3037);if(!_0x1c0696[_0x51e21e(0x1a0)])return{'content':[{'type':_0x51e21e(0x241),'text':'Invalid\x20arguments:\x20'+_0x1c0696[_0x51e21e(0x1a8)]}],'isError':!![]};try{const _0x5f0e8f=MORPH_API_KEY;if(!_0x5f0e8f)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.');const _0x29e81c=await executeCodebaseSearch({'query':_0x1c0696[_0x51e21e(0x1f9)][_0x51e21e(0x23b)],'target_directories':_0x1c0696[_0x51e21e(0x1f9)][_0x51e21e(0x1af)],'limit':_0x1c0696[_0x51e21e(0x1f9)][_0x51e21e(0x1cc)]},{'apiKey':_0x5f0e8f,'repoId':_0x1c0696['data'][_0x51e21e(0x264)],'branch':_0x1c0696[_0x51e21e(0x1f9)][_0x51e21e(0x1b2)],'commitHash':_0x1c0696[_0x51e21e(0x1f9)][_0x51e21e(0x20a)],'debug':![]});if(!_0x29e81c['success'])return{'content':[{'type':_0x51e21e(0x241),'text':_0x51e21e(0x1f1)+_0x29e81c[_0x51e21e(0x1a8)]}],'isError':!![]};const _0x3c4b3a=_0x29e81c[_0x51e21e(0x277)][_0x51e21e(0x27b)]===0x0?_0x51e21e(0x209)+_0x1c0696[_0x51e21e(0x1f9)][_0x51e21e(0x23b)]+'\x22':_0x51e21e(0x1c7)+_0x29e81c[_0x51e21e(0x277)][_0x51e21e(0x27b)]+'\x20results\x20in\x20'+_0x29e81c[_0x51e21e(0x1fd)][_0x51e21e(0x220)]+'ms:\x0a\x0a'+_0x29e81c[_0x51e21e(0x277)][_0x51e21e(0x1ac)]((_0x33b01c,_0x4d98a5)=>_0x4d98a5+0x1+'.\x20'+_0x33b01c[_0x51e21e(0x215)]+'\x20('+(_0x33b01c[_0x51e21e(0x251)]*0x64)[_0x51e21e(0x233)](0x1)+'%\x20match)\x0a'+(_0x51e21e(0x1ae)+_0x33b01c[_0x51e21e(0x26e)]+'-'+_0x33b01c[_0x51e21e(0x238)]+'\x0a')+('\x20\x20\x20'+_0x33b01c['content'][_0x51e21e(0x23c)](0x0,0xc8)+(_0x33b01c['content'][_0x51e21e(0x27b)]>0xc8?'...':'')+'\x0a'))[_0x51e21e(0x260)]('\x0a');return{'content':[{'type':'text','text':_0x3c4b3a}]};}catch(_0x2a56dc){const _0x51c7af=_0x2a56dc instanceof Error?_0x2a56dc[_0x51e21e(0x267)]:String(_0x2a56dc);return reportMorphError({'error_message':_0x51c7af,'error_type':_0x2a56dc instanceof Error?_0x2a56dc[_0x51e21e(0x1d1)][_0x51e21e(0x221)]:_0x51e21e(0x205),'context':{'tool':'codebase_search','query':_0x1c0696['data'][_0x51e21e(0x23b)],'repo_id':_0x1c0696['data'][_0x51e21e(0x264)]},'stack_trace':_0x2a56dc instanceof Error?_0x2a56dc[_0x51e21e(0x21e)]:undefined,'source':_0x51e21e(0x240)})['catch'](()=>{}),{'content':[{'type':'text','text':_0x51e21e(0x1e0)+_0x51c7af}],'isError':!![]};}}default:throw new Error('Unknown\x20tool:\x20'+_0x69a882);}}catch(_0x189dfc){const _0x20ba10=_0x189dfc instanceof Error?_0x189dfc[_0x51e21e(0x267)]:String(_0x189dfc);return reportMorphError({'error_message':_0x20ba10,'error_type':_0x189dfc instanceof Error?_0x189dfc[_0x51e21e(0x1d1)][_0x51e21e(0x221)]:'UnknownError','context':{'tool':name,'arguments':args?JSON[_0x51e21e(0x1f5)](args)[_0x51e21e(0x23c)](0x0,0x1f4):undefined,'mcp_server_version':'0.2.0'},'stack_trace':_0x189dfc instanceof Error?_0x189dfc[_0x51e21e(0x21e)]:undefined,'source':_0x51e21e(0x240)})[_0x51e21e(0x273)](()=>{}),{'content':[{'type':_0x51e21e(0x241),'text':'Error:\x20'+_0x20ba10}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x2f5524){const _0x175dbd=a0_0xdab3d8,_0x2dd379=await getValidRootDirectories(_0x2f5524);if(_0x2dd379['length']>0x0)allowedDirectories=[..._0x2dd379],console[_0x175dbd(0x1a8)](_0x175dbd(0x252)+_0x2dd379[_0x175dbd(0x27b)]+_0x175dbd(0x217));else{console[_0x175dbd(0x1a8)](_0x175dbd(0x21d));if(ENABLE_WORKSPACE_MODE)try{const _0x52a02e=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x52a02e&&(allowedDirectories=[_0x52a02e],console[_0x175dbd(0x1a8)](_0x175dbd(0x1bd)+_0x52a02e));}catch(_0x3670c5){console[_0x175dbd(0x1a8)]('Warning:\x20Workspace\x20fallback\x20failed:\x20'+_0x3670c5);}}}server['setNotificationHandler'](RootsListChangedNotificationSchema,async()=>{const _0x73c126=a0_0xdab3d8;try{const _0x4e92c3=await server[_0x73c126(0x1cf)]();_0x4e92c3&&_0x73c126(0x1d8)in _0x4e92c3&&await updateAllowedDirectoriesFromRoots(_0x4e92c3[_0x73c126(0x1d8)]);}catch(_0x187d29){console[_0x73c126(0x1a8)](_0x73c126(0x24b),_0x187d29 instanceof Error?_0x187d29['message']:String(_0x187d29));}}),server[a0_0xdab3d8(0x1d5)]=async()=>{const _0x3ad1d6=a0_0xdab3d8,_0x40a0c7=server['getClientCapabilities']();if(_0x40a0c7?.[_0x3ad1d6(0x1d8)])try{const _0x3654ef=await server['listRoots']();_0x3654ef&&'roots'in _0x3654ef?await updateAllowedDirectoriesFromRoots(_0x3654ef['roots']):console[_0x3ad1d6(0x1a8)]('Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings');}catch(_0x51069c){console[_0x3ad1d6(0x1a8)](_0x3ad1d6(0x27c),_0x51069c instanceof Error?_0x51069c['message']:String(_0x51069c));}else{if(allowedDirectories[_0x3ad1d6(0x27b)]>0x0)console[_0x3ad1d6(0x1a8)](_0x3ad1d6(0x270),allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)console[_0x3ad1d6(0x1a8)](_0x3ad1d6(0x22a));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 _0x18de9e=a0_0xdab3d8,_0x38994c=new StdioServerTransport();await server[_0x18de9e(0x1dd)](_0x38994c),console[_0x18de9e(0x1a8)](_0x18de9e(0x1f2)),allowedDirectories['length']===0x0&&console[_0x18de9e(0x1a8)](_0x18de9e(0x1e7));}runServer()[a0_0xdab3d8(0x273)](_0x5143f6=>{const _0x50bc74=a0_0xdab3d8;console[_0x50bc74(0x1a8)](_0x50bc74(0x20c),_0x5143f6),process[_0x50bc74(0x236)](0x1);});
@@ -1 +1 @@
1
- (function(_0x2dbd5f,_0x3ac3ef){const _0x338ebd=a1_0x3b2c,_0xbb0713=_0x2dbd5f();while(!![]){try{const _0x309b6b=parseInt(_0x338ebd(0x82))/0x1+-parseInt(_0x338ebd(0x7c))/0x2+parseInt(_0x338ebd(0x8e))/0x3+-parseInt(_0x338ebd(0x81))/0x4*(parseInt(_0x338ebd(0x88))/0x5)+parseInt(_0x338ebd(0x8d))/0x6*(parseInt(_0x338ebd(0x8c))/0x7)+parseInt(_0x338ebd(0x80))/0x8*(parseInt(_0x338ebd(0x89))/0x9)+parseInt(_0x338ebd(0x7a))/0xa*(-parseInt(_0x338ebd(0x8b))/0xb);if(_0x309b6b===_0x3ac3ef)break;else _0xbb0713['push'](_0xbb0713['shift']());}catch(_0x6d5937){_0xbb0713['push'](_0xbb0713['shift']());}}}(a1_0x23cd,0x4bc40));import a1_0x2a9553 from'path';import a1_0x579d37 from'os';function a1_0x23cd(){const _0x59a8ee=['891OefSEC','slice','11660dMzMze','7YryNxQ','2767494warUmF','367272fJuBRv','match','6590PJdZPM','join','91062LnKuBV','replace','charAt','startsWith','26968NSftir','4uLxBtn','162626DcENry','/mnt/','test','substring','trim','toUpperCase','128105lGsTdy'];a1_0x23cd=function(){return _0x59a8ee;};return a1_0x23cd();}export function convertToWindowsPath(_0x28c3e2){const _0x13f0df=a1_0x3b2c;if(_0x28c3e2[_0x13f0df(0x7f)](_0x13f0df(0x83))){const _0x405b9e=_0x28c3e2[_0x13f0df(0x7e)](0x5)[_0x13f0df(0x87)](),_0xb58ee6=_0x28c3e2['slice'](0x6)[_0x13f0df(0x7d)](/\//g,'\x5c');return _0x405b9e+':'+_0xb58ee6;}if(_0x28c3e2['match'](/^\/[a-zA-Z]\//)){const _0x30441f=_0x28c3e2[_0x13f0df(0x7e)](0x1)['toUpperCase'](),_0x17bf33=_0x28c3e2['slice'](0x2)['replace'](/\//g,'\x5c');return _0x30441f+':'+_0x17bf33;}if(_0x28c3e2[_0x13f0df(0x79)](/^[a-zA-Z]:/))return _0x28c3e2['replace'](/\//g,'\x5c');return _0x28c3e2;}export function normalizePath(_0x2edf58){const _0x3c9fba=a1_0x3b2c;_0x2edf58=_0x2edf58[_0x3c9fba(0x86)]()[_0x3c9fba(0x7d)](/^["']|["']$/g,'');const _0x27afc8=_0x2edf58['startsWith']('/')&&!_0x2edf58[_0x3c9fba(0x79)](/^\/mnt\/[a-z]\//i)&&!_0x2edf58[_0x3c9fba(0x79)](/^\/[a-zA-Z]\//);if(_0x27afc8)return _0x2edf58[_0x3c9fba(0x7d)](/\/+/g,'/')[_0x3c9fba(0x7d)](/\/+$/,'');_0x2edf58=convertToWindowsPath(_0x2edf58);if(_0x2edf58['startsWith']('\x5c\x5c')){let _0xa15975=_0x2edf58;_0xa15975=_0xa15975[_0x3c9fba(0x7d)](/^\\{2,}/,'\x5c\x5c');const _0x3c0abc=_0xa15975[_0x3c9fba(0x85)](0x2)[_0x3c9fba(0x7d)](/\\\\/g,'\x5c');_0x2edf58='\x5c\x5c'+_0x3c0abc;}else _0x2edf58=_0x2edf58[_0x3c9fba(0x7d)](/\\\\/g,'\x5c');let _0x274fac=a1_0x2a9553['normalize'](_0x2edf58);_0x2edf58[_0x3c9fba(0x7f)]('\x5c\x5c')&&!_0x274fac['startsWith']('\x5c\x5c')&&(_0x274fac='\x5c'+_0x274fac);if(_0x274fac[_0x3c9fba(0x79)](/^[a-zA-Z]:/)){let _0x2b4b3c=_0x274fac[_0x3c9fba(0x7d)](/\//g,'\x5c');return/^[a-z]:/[_0x3c9fba(0x84)](_0x2b4b3c)&&(_0x2b4b3c=_0x2b4b3c['charAt'](0x0)[_0x3c9fba(0x87)]()+_0x2b4b3c[_0x3c9fba(0x8a)](0x1)),_0x2b4b3c;}return _0x274fac[_0x3c9fba(0x7d)](/\//g,'\x5c');}function a1_0x3b2c(_0x30aa34,_0x362b70){_0x30aa34=_0x30aa34-0x79;const _0x23cd30=a1_0x23cd();let _0x3b2c44=_0x23cd30[_0x30aa34];return _0x3b2c44;}export function expandHome(_0x91e855){const _0x3f3fa=a1_0x3b2c;if(_0x91e855[_0x3f3fa(0x7f)]('~/')||_0x91e855==='~')return a1_0x2a9553[_0x3f3fa(0x7b)](a1_0x579d37['homedir'](),_0x91e855[_0x3f3fa(0x8a)](0x1));return _0x91e855;}
1
+ (function(_0x3d20d7,_0x4c1bbf){const _0x57f464=a1_0x2217,_0x5c3d52=_0x3d20d7();while(!![]){try{const _0x4ecbae=-parseInt(_0x57f464(0x170))/0x1*(-parseInt(_0x57f464(0x177))/0x2)+-parseInt(_0x57f464(0x163))/0x3*(parseInt(_0x57f464(0x175))/0x4)+parseInt(_0x57f464(0x16c))/0x5+parseInt(_0x57f464(0x168))/0x6*(-parseInt(_0x57f464(0x16d))/0x7)+-parseInt(_0x57f464(0x162))/0x8*(-parseInt(_0x57f464(0x174))/0x9)+-parseInt(_0x57f464(0x171))/0xa+parseInt(_0x57f464(0x176))/0xb;if(_0x4ecbae===_0x4c1bbf)break;else _0x5c3d52['push'](_0x5c3d52['shift']());}catch(_0x1c9f3e){_0x5c3d52['push'](_0x5c3d52['shift']());}}}(a1_0x1604,0x5b90c));import a1_0x545c61 from'path';import a1_0x2aff21 from'os';function a1_0x2217(_0xe73604,_0x183c75){_0xe73604=_0xe73604-0x162;const _0x1604e0=a1_0x1604();let _0x2217a6=_0x1604e0[_0xe73604];return _0x2217a6;}function a1_0x1604(){const _0x108343=['333pqGbqS','test','homedir','replace','match','612tShKNN','toUpperCase','charAt','trim','1968450xGdnEf','8722bVFBAs','slice','/mnt/','386aWLtkL','5525750KzHebg','normalize','startsWith','513981mpIiiE','24292vDzNpj','12419297IPTPDW','772UGSFFA','8yFFKjq'];a1_0x1604=function(){return _0x108343;};return a1_0x1604();}export function convertToWindowsPath(_0x9c2717){const _0x2fed66=a1_0x2217;if(_0x9c2717['startsWith'](_0x2fed66(0x16f))){const _0x334f88=_0x9c2717[_0x2fed66(0x16a)](0x5)[_0x2fed66(0x169)](),_0x4d851a=_0x9c2717['slice'](0x6)[_0x2fed66(0x166)](/\//g,'\x5c');return _0x334f88+':'+_0x4d851a;}if(_0x9c2717[_0x2fed66(0x167)](/^\/[a-zA-Z]\//)){const _0x527663=_0x9c2717[_0x2fed66(0x16a)](0x1)['toUpperCase'](),_0x3c1a52=_0x9c2717['slice'](0x2)['replace'](/\//g,'\x5c');return _0x527663+':'+_0x3c1a52;}if(_0x9c2717[_0x2fed66(0x167)](/^[a-zA-Z]:/))return _0x9c2717[_0x2fed66(0x166)](/\//g,'\x5c');return _0x9c2717;}export function normalizePath(_0x2235fc){const _0x2280d3=a1_0x2217;_0x2235fc=_0x2235fc[_0x2280d3(0x16b)]()['replace'](/^["']|["']$/g,'');const _0x3494a5=_0x2235fc[_0x2280d3(0x173)]('/')&&!_0x2235fc['match'](/^\/mnt\/[a-z]\//i)&&!_0x2235fc[_0x2280d3(0x167)](/^\/[a-zA-Z]\//);if(_0x3494a5)return _0x2235fc[_0x2280d3(0x166)](/\/+/g,'/')[_0x2280d3(0x166)](/\/+$/,'');_0x2235fc=convertToWindowsPath(_0x2235fc);if(_0x2235fc[_0x2280d3(0x173)]('\x5c\x5c')){let _0x43661e=_0x2235fc;_0x43661e=_0x43661e['replace'](/^\\{2,}/,'\x5c\x5c');const _0x433ed9=_0x43661e['substring'](0x2)[_0x2280d3(0x166)](/\\\\/g,'\x5c');_0x2235fc='\x5c\x5c'+_0x433ed9;}else _0x2235fc=_0x2235fc[_0x2280d3(0x166)](/\\\\/g,'\x5c');let _0x2525f2=a1_0x545c61[_0x2280d3(0x172)](_0x2235fc);_0x2235fc[_0x2280d3(0x173)]('\x5c\x5c')&&!_0x2525f2[_0x2280d3(0x173)]('\x5c\x5c')&&(_0x2525f2='\x5c'+_0x2525f2);if(_0x2525f2['match'](/^[a-zA-Z]:/)){let _0x47e0cc=_0x2525f2['replace'](/\//g,'\x5c');return/^[a-z]:/[_0x2280d3(0x164)](_0x47e0cc)&&(_0x47e0cc=_0x47e0cc[_0x2280d3(0x16a)](0x0)[_0x2280d3(0x169)]()+_0x47e0cc[_0x2280d3(0x16e)](0x1)),_0x47e0cc;}return _0x2525f2[_0x2280d3(0x166)](/\//g,'\x5c');}export function expandHome(_0x1a1957){const _0x22eeb6=a1_0x2217;if(_0x1a1957[_0x22eeb6(0x173)]('~/')||_0x1a1957==='~')return a1_0x545c61['join'](a1_0x2aff21[_0x22eeb6(0x165)](),_0x1a1957[_0x22eeb6(0x16e)](0x1));return _0x1a1957;}
@@ -1 +1 @@
1
- (function(_0x1b21b3,_0x1816de){const _0x3c5144=a2_0x5aad,_0x2a4453=_0x1b21b3();while(!![]){try{const _0x50ac2e=-parseInt(_0x3c5144(0x82))/0x1*(parseInt(_0x3c5144(0x77))/0x2)+-parseInt(_0x3c5144(0x75))/0x3+parseInt(_0x3c5144(0x81))/0x4+-parseInt(_0x3c5144(0x7b))/0x5*(-parseInt(_0x3c5144(0x7a))/0x6)+-parseInt(_0x3c5144(0x79))/0x7+-parseInt(_0x3c5144(0x83))/0x8+parseInt(_0x3c5144(0x74))/0x9;if(_0x50ac2e===_0x1816de)break;else _0x2a4453['push'](_0x2a4453['shift']());}catch(_0x552540){_0x2a4453['push'](_0x2a4453['shift']());}}}(a2_0x4518,0x658fc));import a2_0x4395e0 from'path';function a2_0x4518(){const _0x439225=['4443232SMXpZd','isAbsolute','resolve','Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization','10204164wLJEKE','547170QAeFWO','some','2fPiRGH','string','399903RMRhjQ','149994IuoQIq','70VPyaFw','includes','isArray','normalize','startsWith','sep','1105884aqpaOb','549334RsBemB'];a2_0x4518=function(){return _0x439225;};return a2_0x4518();}function a2_0x5aad(_0x23642b,_0x4a32af){_0x23642b=_0x23642b-0x72;const _0x4518e2=a2_0x4518();let _0x5aadb5=_0x4518e2[_0x23642b];return _0x5aadb5;}export function isPathWithinAllowedDirectories(_0x363532,_0x221d9e){const _0x56805e=a2_0x5aad;if(typeof _0x363532!==_0x56805e(0x78)||!Array[_0x56805e(0x7d)](_0x221d9e))return![];if(!_0x363532||_0x221d9e['length']===0x0)return![];if(_0x363532[_0x56805e(0x7c)]('\x00'))return![];let _0xfa42ff;try{_0xfa42ff=a2_0x4395e0[_0x56805e(0x72)](a2_0x4395e0[_0x56805e(0x7e)](_0x363532));}catch{return![];}if(!a2_0x4395e0[_0x56805e(0x84)](_0xfa42ff))throw new Error('Path\x20must\x20be\x20absolute\x20after\x20normalization');return _0x221d9e[_0x56805e(0x76)](_0x56d431=>{const _0xcfac3=_0x56805e;if(typeof _0x56d431!=='string'||!_0x56d431)return![];if(_0x56d431[_0xcfac3(0x7c)]('\x00'))return![];let _0x15c4a2;try{_0x15c4a2=a2_0x4395e0[_0xcfac3(0x72)](a2_0x4395e0[_0xcfac3(0x7e)](_0x56d431));}catch{return![];}if(!a2_0x4395e0[_0xcfac3(0x84)](_0x15c4a2))throw new Error(_0xcfac3(0x73));if(_0xfa42ff===_0x15c4a2)return!![];if(_0x15c4a2===a2_0x4395e0['sep'])return _0xfa42ff[_0xcfac3(0x7f)](a2_0x4395e0[_0xcfac3(0x80)]);return _0xfa42ff[_0xcfac3(0x7f)](_0x15c4a2+a2_0x4395e0[_0xcfac3(0x80)]);});}
1
+ function a2_0x4a70(_0x30df38,_0xdfd662){_0x30df38=_0x30df38-0x189;const _0x54572b=a2_0x5457();let _0x4a704a=_0x54572b[_0x30df38];return _0x4a704a;}(function(_0x1f39f0,_0x34801a){const _0x51fae7=a2_0x4a70,_0x4e3426=_0x1f39f0();while(!![]){try{const _0x1c6ea6=parseInt(_0x51fae7(0x192))/0x1+parseInt(_0x51fae7(0x19b))/0x2*(parseInt(_0x51fae7(0x18b))/0x3)+-parseInt(_0x51fae7(0x19f))/0x4*(parseInt(_0x51fae7(0x195))/0x5)+-parseInt(_0x51fae7(0x18f))/0x6*(parseInt(_0x51fae7(0x18a))/0x7)+parseInt(_0x51fae7(0x19a))/0x8+-parseInt(_0x51fae7(0x196))/0x9*(-parseInt(_0x51fae7(0x189))/0xa)+parseInt(_0x51fae7(0x193))/0xb;if(_0x1c6ea6===_0x34801a)break;else _0x4e3426['push'](_0x4e3426['shift']());}catch(_0x358c21){_0x4e3426['push'](_0x4e3426['shift']());}}}(a2_0x5457,0x32769));function a2_0x5457(){const _0x279efb=['14815pXNWvY','1296RUbCAp','string','Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization','Path\x20must\x20be\x20absolute\x20after\x20normalization','818160ZCStSA','1348yHFAFp','startsWith','isAbsolute','includes','548rkCKxR','2720zlOIij','1063839USFoeF','87djQgjm','resolve','normalize','some','6bpZnJX','sep','length','234684WCfLdR','4058307thtbFS','isArray'];a2_0x5457=function(){return _0x279efb;};return a2_0x5457();}import a2_0x5109c7 from'path';export function isPathWithinAllowedDirectories(_0x29525a,_0x2279da){const _0x4d35fb=a2_0x4a70;if(typeof _0x29525a!==_0x4d35fb(0x197)||!Array[_0x4d35fb(0x194)](_0x2279da))return![];if(!_0x29525a||_0x2279da[_0x4d35fb(0x191)]===0x0)return![];if(_0x29525a[_0x4d35fb(0x19e)]('\x00'))return![];let _0x16116;try{_0x16116=a2_0x5109c7['resolve'](a2_0x5109c7[_0x4d35fb(0x18d)](_0x29525a));}catch{return![];}if(!a2_0x5109c7['isAbsolute'](_0x16116))throw new Error(_0x4d35fb(0x199));return _0x2279da[_0x4d35fb(0x18e)](_0x31d346=>{const _0x2adf87=_0x4d35fb;if(typeof _0x31d346!==_0x2adf87(0x197)||!_0x31d346)return![];if(_0x31d346[_0x2adf87(0x19e)]('\x00'))return![];let _0x336941;try{_0x336941=a2_0x5109c7[_0x2adf87(0x18c)](a2_0x5109c7[_0x2adf87(0x18d)](_0x31d346));}catch{return![];}if(!a2_0x5109c7[_0x2adf87(0x19d)](_0x336941))throw new Error(_0x2adf87(0x198));if(_0x16116===_0x336941)return!![];if(_0x336941===a2_0x5109c7[_0x2adf87(0x190)])return _0x16116['startsWith'](a2_0x5109c7[_0x2adf87(0x190)]);return _0x16116[_0x2adf87(0x19c)](_0x336941+a2_0x5109c7[_0x2adf87(0x190)]);});}
@@ -1 +1 @@
1
- (function(_0x50f333,_0x3db708){const _0x43230d=a3_0x3d8d,_0x55ab6f=_0x50f333();while(!![]){try{const _0x117d49=-parseInt(_0x43230d(0x156))/0x1+-parseInt(_0x43230d(0x152))/0x2*(parseInt(_0x43230d(0x154))/0x3)+parseInt(_0x43230d(0x15a))/0x4*(parseInt(_0x43230d(0x15d))/0x5)+-parseInt(_0x43230d(0x14e))/0x6+parseInt(_0x43230d(0x14c))/0x7*(parseInt(_0x43230d(0x158))/0x8)+parseInt(_0x43230d(0x151))/0x9+-parseInt(_0x43230d(0x14b))/0xa*(parseInt(_0x43230d(0x15b))/0xb);if(_0x117d49===_0x3db708)break;else _0x55ab6f['push'](_0x55ab6f['shift']());}catch(_0x4ce176){_0x55ab6f['push'](_0x55ab6f['shift']());}}}(a3_0x17c0,0x98a87));import{promises as a3_0x292f2c}from'fs';function a3_0x17c0(){const _0x2dbaae=['\x20due\x20to\x20error:\x20','4293552AYjgdp','file://','error','6323814KqFnaw','4JzMACY','homedir','116043KsxcIa','startsWith','823377mODNyi','resolve','48TRuoFS','push','4682396LWkwGh','33vPrJSZ','Skipping\x20invalid\x20directory:\x20','5jAWbLY','slice','invalid\x20path\x20or\x20inaccessible','join','stat','realpath','Skipping\x20','898530vOOdpP','744254SKAZHR'];a3_0x17c0=function(){return _0x2dbaae;};return a3_0x17c0();}import a3_0x4d4af3 from'path';import a3_0x34d865 from'os';function a3_0x3d8d(_0x321727,_0x2d106a){_0x321727=_0x321727-0x148;const _0x17c068=a3_0x17c0();let _0x3d8de6=_0x17c068[_0x321727];return _0x3d8de6;}import{normalizePath}from'./path-utils.js';async function parseRootUri(_0x4aeb05){const _0x27a335=a3_0x3d8d;try{const _0xf2bf3f=_0x4aeb05['startsWith'](_0x27a335(0x14f))?_0x4aeb05[_0x27a335(0x15e)](0x7):_0x4aeb05,_0x52d299=_0xf2bf3f[_0x27a335(0x155)]('~/')||_0xf2bf3f==='~'?a3_0x4d4af3[_0x27a335(0x160)](a3_0x34d865[_0x27a335(0x153)](),_0xf2bf3f['slice'](0x1)):_0xf2bf3f,_0x587800=a3_0x4d4af3[_0x27a335(0x157)](_0x52d299),_0x3696d8=await a3_0x292f2c[_0x27a335(0x149)](_0x587800);return normalizePath(_0x3696d8);}catch{return null;}}function formatDirectoryError(_0x1cafc8,_0x2753c9,_0x3b6907){const _0x59cc7a=a3_0x3d8d;if(_0x3b6907)return _0x59cc7a(0x14a)+_0x3b6907+':\x20'+_0x1cafc8;const _0x360cda=_0x2753c9 instanceof Error?_0x2753c9['message']:String(_0x2753c9);return _0x59cc7a(0x15c)+_0x1cafc8+_0x59cc7a(0x14d)+_0x360cda;}export async function getValidRootDirectories(_0x523e8e){const _0x395696=a3_0x3d8d,_0x3ff905=[];for(const _0x4f30c7 of _0x523e8e){const _0x148810=await parseRootUri(_0x4f30c7['uri']);if(!_0x148810){console[_0x395696(0x150)](formatDirectoryError(_0x4f30c7['uri'],undefined,_0x395696(0x15f)));continue;}try{const _0xebae28=await a3_0x292f2c[_0x395696(0x148)](_0x148810);_0xebae28['isDirectory']()?_0x3ff905[_0x395696(0x159)](_0x148810):console['error'](formatDirectoryError(_0x148810,undefined,'non-directory\x20root'));}catch(_0x38d79b){console['error'](formatDirectoryError(_0x148810,_0x38d79b));}}return _0x3ff905;}
1
+ function a3_0x483f(_0x492411,_0x53f9c9){_0x492411=_0x492411-0x15f;const _0x165e5a=a3_0x165e();let _0x483fb8=_0x165e5a[_0x492411];return _0x483fb8;}function a3_0x165e(){const _0x35cc0b=['\x20due\x20to\x20error:\x20','non-directory\x20root','6djvpoc','slice','resolve','1507365QSxalr','886795bjFHuH','21137nZuTBF','8rcaDAJ','167980hzuiNy','4057580LxEvYy','4uXCfaX','uri','stat','380733JbJwFh','invalid\x20path\x20or\x20inaccessible','error','1335579nGAZaB','startsWith','homedir','file://'];a3_0x165e=function(){return _0x35cc0b;};return a3_0x165e();}(function(_0x485230,_0x43d0d0){const _0x19ae96=a3_0x483f,_0x27f8cf=_0x485230();while(!![]){try{const _0x4527a3=parseInt(_0x19ae96(0x160))/0x1*(-parseInt(_0x19ae96(0x164))/0x2)+-parseInt(_0x19ae96(0x167))/0x3+parseInt(_0x19ae96(0x162))/0x4+-parseInt(_0x19ae96(0x15f))/0x5+-parseInt(_0x19ae96(0x170))/0x6*(-parseInt(_0x19ae96(0x16a))/0x7)+-parseInt(_0x19ae96(0x161))/0x8*(parseInt(_0x19ae96(0x173))/0x9)+parseInt(_0x19ae96(0x163))/0xa;if(_0x4527a3===_0x43d0d0)break;else _0x27f8cf['push'](_0x27f8cf['shift']());}catch(_0xa24cec){_0x27f8cf['push'](_0x27f8cf['shift']());}}}(a3_0x165e,0x1e669));import{promises as a3_0x3fe0e3}from'fs';import a3_0x59407b from'path';import a3_0x1bfaf8 from'os';import{normalizePath}from'./path-utils.js';async function parseRootUri(_0x42f13b){const _0x118467=a3_0x483f;try{const _0x36d897=_0x42f13b[_0x118467(0x16b)](_0x118467(0x16d))?_0x42f13b[_0x118467(0x171)](0x7):_0x42f13b,_0x5f2723=_0x36d897[_0x118467(0x16b)]('~/')||_0x36d897==='~'?a3_0x59407b['join'](a3_0x1bfaf8[_0x118467(0x16c)](),_0x36d897[_0x118467(0x171)](0x1)):_0x36d897,_0x340180=a3_0x59407b[_0x118467(0x172)](_0x5f2723),_0x22965e=await a3_0x3fe0e3['realpath'](_0x340180);return normalizePath(_0x22965e);}catch{return null;}}function formatDirectoryError(_0x3b53cf,_0x43308e,_0x3a8eaa){const _0x26ddf9=a3_0x483f;if(_0x3a8eaa)return'Skipping\x20'+_0x3a8eaa+':\x20'+_0x3b53cf;const _0x12dc26=_0x43308e instanceof Error?_0x43308e['message']:String(_0x43308e);return'Skipping\x20invalid\x20directory:\x20'+_0x3b53cf+_0x26ddf9(0x16e)+_0x12dc26;}export async function getValidRootDirectories(_0x4dd82d){const _0x470a72=a3_0x483f,_0x26c219=[];for(const _0x345267 of _0x4dd82d){const _0x4d7f85=await parseRootUri(_0x345267[_0x470a72(0x165)]);if(!_0x4d7f85){console[_0x470a72(0x169)](formatDirectoryError(_0x345267[_0x470a72(0x165)],undefined,_0x470a72(0x168)));continue;}try{const _0x278d7e=await a3_0x3fe0e3[_0x470a72(0x166)](_0x4d7f85);_0x278d7e['isDirectory']()?_0x26c219['push'](_0x4d7f85):console[_0x470a72(0x169)](formatDirectoryError(_0x4d7f85,undefined,_0x470a72(0x16f)));}catch(_0x47b442){console[_0x470a72(0x169)](formatDirectoryError(_0x4d7f85,_0x47b442));}}return _0x26c219;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morphllm/morphmcp",
3
- "version": "0.8.60",
3
+ "version": "0.8.62",
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.87",
38
+ "@morphllm/morphsdk": "0.2.89",
39
39
  "@vscode/ripgrep": "^1.15.14",
40
40
  "axios": "^1.6.0",
41
41
  "chalk": "^5.3.0",