@morphllm/morphmcp 0.8.132 → 0.8.133
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 +1 -1
- package/dist/log-utils.js +1 -1
- package/dist/path-utils.js +1 -1
- package/dist/path-validation.js +1 -1
- package/dist/roots-utils.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a0_0x516777=a0_0x55da;(function(_0x4a5278,_0x3e0763){const _0x2f1800=a0_0x55da,_0x3ca585=_0x4a5278();while(!![]){try{const _0x1ff306=-parseInt(_0x2f1800(0x1f2))/0x1+parseInt(_0x2f1800(0x216))/0x2*(-parseInt(_0x2f1800(0x12b))/0x3)+-parseInt(_0x2f1800(0x19f))/0x4+-parseInt(_0x2f1800(0x125))/0x5+parseInt(_0x2f1800(0x1eb))/0x6+-parseInt(_0x2f1800(0x1b5))/0x7+parseInt(_0x2f1800(0x1d6))/0x8;if(_0x1ff306===_0x3e0763)break;else _0x3ca585['push'](_0x3ca585['shift']());}catch(_0x36b4f0){_0x3ca585['push'](_0x3ca585['shift']());}}}(a0_0x526b,0x2a5cf));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_0xe4ef90 from'fs/promises';import a0_0x4d30fe from'path';import a0_0x1a3d20 from'os';import{createRequire}from'module';import{z}from'zod';import{zodToJsonSchema}from'zod-to-json-schema';import{getValidRootDirectories}from'./roots-utils.js';import{getOperatingSystemType,logMcpStderr}from'./log-utils.js';import{executeEditFile}from'@morphllm/morphsdk/tools/fastapply';import{runWarpGrep,LocalRipgrepProvider,GITHUB_SEARCH_TOOL_NAME,GITHUB_SEARCH_DESCRIPTION}from'@morphllm/morphsdk/tools/warp-grep';import{WarpGrepClient,formatResult}from'@morphllm/morphsdk/tools/warp-grep/client';import a0_0x5ab2ca from'axios';function fixPathRepetition(_0x4b15bc){const _0x50195d=a0_0x55da,_0x387db9=_0x4b15bc['split'](a0_0x4d30fe['sep'])['filter'](Boolean);if(_0x387db9[_0x50195d(0x169)]<0x2)return null;for(let _0x1fc15b=Math['floor'](_0x387db9[_0x50195d(0x169)]/0x2);_0x1fc15b>=0x1;_0x1fc15b--){for(let _0x462803=0x0;_0x462803<=_0x387db9[_0x50195d(0x169)]-0x2*_0x1fc15b;_0x462803++){const _0x578a45=_0x387db9['slice'](_0x462803,_0x462803+_0x1fc15b),_0x22b3c3=_0x387db9['slice'](_0x462803+_0x1fc15b,_0x462803+0x2*_0x1fc15b);if(_0x578a45['every']((_0x2cf512,_0x10dfb9)=>_0x2cf512===_0x22b3c3[_0x10dfb9])){const _0x230536=[..._0x387db9[_0x50195d(0x21e)](0x0,_0x462803),..._0x387db9['slice'](_0x462803+_0x1fc15b)];return a0_0x4d30fe[_0x50195d(0x161)]+_0x230536[_0x50195d(0x1d1)](a0_0x4d30fe['sep']);}}}return null;}const require=createRequire(import.meta.url);function getPackageVersion(){const _0xfdd50a=a0_0x55da;try{const _0x53012d=require(_0xfdd50a(0x155));return _0x53012d[_0xfdd50a(0x16b)]??_0xfdd50a(0x224);}catch(_0x6d26e){return logMcpStderr(_0xfdd50a(0x14f),_0x6d26e),'unknown';}}function printHelp(){const _0x3f8105=a0_0x55da;console[_0x3f8105(0x14a)](_0x3f8105(0x1ff)+getPackageVersion()),console[_0x3f8105(0x14a)](_0x3f8105(0x183)),console[_0x3f8105(0x14a)](_0x3f8105(0x1f6)),console['log'](_0x3f8105(0x1ba)),console['log'](_0x3f8105(0x1e5)),console['log'](_0x3f8105(0x1a3)),console[_0x3f8105(0x14a)]('\x0aExamples:'),console[_0x3f8105(0x14a)](_0x3f8105(0x1b7)),console[_0x3f8105(0x14a)](_0x3f8105(0x16f));}const cliArgs=process[a0_0x516777(0x1c2)][a0_0x516777(0x21e)](0x2),VERSION_FLAGS=new Set([a0_0x516777(0x1ab),'-v','-V']),HELP_FLAGS=new Set([a0_0x516777(0x1e9),'-h']);cliArgs[a0_0x516777(0x20f)](_0x1b27eb=>VERSION_FLAGS[a0_0x516777(0x193)](_0x1b27eb))&&(console[a0_0x516777(0x14a)](a0_0x516777(0x1ff)+getPackageVersion()),process['exit'](0x0));cliArgs[a0_0x516777(0x20f)](_0x272fa4=>HELP_FLAGS[a0_0x516777(0x193)](_0x272fa4))&&(printHelp(),process['exit'](0x0));function getCliArg(_0xda1552){const _0x459c95=a0_0x516777;for(let _0x13751e=0x0;_0x13751e<cliArgs['length'];_0x13751e++){const _0x1f18a8=cliArgs[_0x13751e];if(_0x1f18a8[_0x459c95(0x154)]('--'+_0xda1552+'='))return _0x1f18a8[_0x459c95(0x21e)](('--'+_0xda1552+'=')[_0x459c95(0x169)]);if(_0x1f18a8==='--'+_0xda1552&&_0x13751e+0x1<cliArgs[_0x459c95(0x169)])return cliArgs[_0x13751e+0x1];}return undefined;}const args=[];for(let i=0x0;i<cliArgs[a0_0x516777(0x169)];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x516777(0x193)](arg)||HELP_FLAGS['has'](arg))continue;if(arg[a0_0x516777(0x154)]('--api-key='))continue;if(arg===a0_0x516777(0x12f)){i++;continue;}args['push'](arg);}const WORKSPACE_ROOT=process[a0_0x516777(0x1b3)][a0_0x516777(0x12c)]||process['env']['PWD']||process[a0_0x516777(0x163)](),ENABLE_WORKSPACE_MODE=process[a0_0x516777(0x1b3)][a0_0x516777(0x1d7)]!==a0_0x516777(0x1d0),MORPH_API_KEY=getCliArg(a0_0x516777(0x1dc))??process['env'][a0_0x516777(0x13f)],MORPH_API_URL=process[a0_0x516777(0x1b3)][a0_0x516777(0x170)],MORPH_WARP_GREP_TIMEOUT=process[a0_0x516777(0x1b3)][a0_0x516777(0x140)]?parseInt(process[a0_0x516777(0x1b3)][a0_0x516777(0x140)],0xa):undefined,OPERATING_SYSTEM_TYPE=getOperatingSystemType(),KNOWN_TOOL_NAMES=new Set([a0_0x516777(0x184),a0_0x516777(0x175),a0_0x516777(0x150)]),DISABLED_TOOLS=process['env'][a0_0x516777(0x136)]?new Set(process[a0_0x516777(0x1b3)][a0_0x516777(0x136)][a0_0x516777(0x1fc)](',')[a0_0x516777(0x1c9)](_0x11b44e=>_0x11b44e[a0_0x516777(0x19a)]())['filter'](_0x2644ab=>_0x2644ab[a0_0x516777(0x169)]>0x0)):new Set();if(DISABLED_TOOLS[a0_0x516777(0x226)]>0x0){for(const tool of DISABLED_TOOLS){!KNOWN_TOOL_NAMES[a0_0x516777(0x193)](tool)&&console[a0_0x516777(0x190)]('Warning:\x20DISABLED_TOOLS\x20contains\x20unknown\x20tool\x20\x22'+tool+a0_0x516777(0x18c)+[...KNOWN_TOOL_NAMES][a0_0x516777(0x1d1)](',\x20'));}console[a0_0x516777(0x190)](a0_0x516777(0x195)+[...DISABLED_TOOLS][a0_0x516777(0x1d1)](',\x20'));}MORPH_API_KEY&&!MORPH_API_KEY[a0_0x516777(0x154)]('sk-')&&!MORPH_API_KEY[a0_0x516777(0x154)](a0_0x516777(0x130))&&logMcpStderr('Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27');async function reportMorphError(_0x4796f2){const _0x5dfa67=a0_0x516777;try{await a0_0x5ab2ca[_0x5dfa67(0x1e1)](_0x5dfa67(0x209),{..._0x4796f2,'timestamp':new Date()['toISOString'](),'source':_0x4796f2['source']||'mcp-filesystem','os_type':OPERATING_SYSTEM_TYPE,'context':{'os_type':OPERATING_SYSTEM_TYPE,..._0x4796f2[_0x5dfa67(0x192)]}},{'timeout':0x1388,'headers':{'Content-Type':_0x5dfa67(0x199),'Authorization':_0x5dfa67(0x19b)+MORPH_API_KEY}});}catch{}}args[a0_0x516777(0x169)]===0x0&&!ENABLE_WORKSPACE_MODE&&(logMcpStderr(a0_0x516777(0x1de)),logMcpStderr(a0_0x516777(0x15a)),logMcpStderr(a0_0x516777(0x168)),logMcpStderr('\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)'),logMcpStderr(a0_0x516777(0x180)),logMcpStderr(a0_0x516777(0x134)));function normalizePath(_0x54ef0e){const _0xb8c9dd=a0_0x516777;return a0_0x4d30fe[_0xb8c9dd(0x1dd)](_0x54ef0e);}function expandHome(_0x573403){const _0x295287=a0_0x516777;if(_0x573403[_0x295287(0x154)]('~/')||_0x573403==='~')return a0_0x4d30fe[_0x295287(0x1d1)](a0_0x1a3d20[_0x295287(0x172)](),_0x573403['slice'](0x1));return _0x573403;}let allowedDirectories=await Promise[a0_0x516777(0x17a)](args[a0_0x516777(0x1c9)](async _0x38433b=>{const _0x26bccb=a0_0x516777,_0x1e2a72=expandHome(_0x38433b),_0x519901=a0_0x4d30fe[_0x26bccb(0x151)](_0x1e2a72);try{const _0x4e8950=await a0_0xe4ef90['realpath'](_0x519901);return normalizePath(_0x4e8950);}catch(_0x20d388){return normalizePath(_0x519901);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x516777(0x169)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories[a0_0x516777(0x21f)](workspaceDir),logMcpStderr(a0_0x516777(0x12d)+workspaceDir+a0_0x516777(0x1db)));}catch(a0_0x47009d){logMcpStderr(a0_0x516777(0x198)+a0_0x47009d);}async function detectWorkspaceRoot(_0x36cf6a){const _0x37e4d3=a0_0x516777;let _0x1b8b8d=a0_0x4d30fe[_0x37e4d3(0x151)](_0x36cf6a);const _0x1fc996=[_0x37e4d3(0x185),_0x37e4d3(0x1b1),_0x37e4d3(0x1ea),_0x37e4d3(0x129),'pyproject.toml',_0x37e4d3(0x131),_0x37e4d3(0x13e),_0x37e4d3(0x148),_0x37e4d3(0x1f3)];while(_0x1b8b8d!==a0_0x4d30fe['dirname'](_0x1b8b8d)){for(const _0x41d646 of _0x1fc996){const _0x3ebece=a0_0x4d30fe[_0x37e4d3(0x1d1)](_0x1b8b8d,_0x41d646);try{return await a0_0xe4ef90[_0x37e4d3(0x124)](_0x3ebece),normalizePath(_0x1b8b8d);}catch{}}_0x1b8b8d=a0_0x4d30fe[_0x37e4d3(0x1d8)](_0x1b8b8d);}return normalizePath(_0x36cf6a);}function a0_0x55da(_0x288ff4,_0x3752ae){_0x288ff4=_0x288ff4-0x124;const _0x526b5d=a0_0x526b();let _0x55da86=_0x526b5d[_0x288ff4];return _0x55da86;}await Promise[a0_0x516777(0x17a)](args[a0_0x516777(0x1c9)](async _0x2612e3=>{const _0x17080e=a0_0x516777;try{const _0x2ffb68=await a0_0xe4ef90[_0x17080e(0x12a)](expandHome(_0x2612e3));!_0x2ffb68['isDirectory']()&&(logMcpStderr('Error:\x20'+_0x2612e3+_0x17080e(0x14c)),process['exit'](0x1));}catch(_0x23c97d){logMcpStderr(_0x17080e(0x1ee)+_0x2612e3+':',_0x23c97d),process[_0x17080e(0x128)](0x1);}}));async function validatePath(_0x6e1593){const _0xbbfd1=a0_0x516777,_0x227b2b=expandHome(_0x6e1593),_0x4a33d5=a0_0x4d30fe['resolve'](_0x227b2b);try{const _0x663d22=await a0_0xe4ef90[_0xbbfd1(0x157)](_0x4a33d5);return _0x663d22;}catch(_0x22f134){if(_0x22f134[_0xbbfd1(0x1f1)]===_0xbbfd1(0x1c6)){const _0x591943=a0_0x4d30fe[_0xbbfd1(0x1d8)](_0x4a33d5);try{const _0x349959=await a0_0xe4ef90[_0xbbfd1(0x157)](_0x591943);return a0_0x4d30fe['join'](_0x349959,a0_0x4d30fe[_0xbbfd1(0x1f8)](_0x4a33d5));}catch{throw new Error('Parent\x20directory\x20does\x20not\x20exist:\x20'+_0x591943);}}throw _0x22f134;}}function a0_0x526b(){const _0x2e22bc=['[github_codebase_search]\x20Searching\x20','connect','isArray','text','message','slice','push','name','catch','timings','linesAdded','unknown','indexOf','size','<file\x20path=\x22','access','1105665GJNDBW','terminationReason','SubToolError','exit','Cargo.toml','stat','328197iykTJY','WORKSPACE_ROOT','Workspace\x20mode\x20enabled:\x20Using\x20','TimeoutError','--api-key','morph-','go.mod','Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','Morph\x20Edit\x20','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.','boolean','DISABLED_TOOLS','content','messages','Morph\x20FastApply\x20failed\x20without\x20error\x20message','files','timeout','searchGitHub','-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a','.cursor','MORPH_API_KEY','MORPH_WARP_GREP_TIMEOUT','dryRun','Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)','Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a','params','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.','.\x20Path:\x20','now','tsconfig.json','array','log','PathError','\x20is\x20not\x20a\x20directory','roots','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','Warning:\x20Unable\x20to\x20determine\x20package\x20version:','github_codebase_search','resolve','Branch\x20to\x20search\x20(uses\x20latest\x20commit)','mcp-filesystem','startsWith','../package.json','Created\x20File','realpath','</file>','No\x20relevant\x20code\x20found\x20for\x20the\x20query.','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','grep\x20\x27','0.2.0','\x27\x20in\x20`','FileReadError','metadata','completed_with_file_errors','sep','stack','cwd','-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a','WarpGrepError','user','code_edit','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','length','Max\x20results\x20to\x20return','version','branch','data','ms:','\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo','MORPH_API_URL','-\x20Grepped\x20\x27','homedir','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','Tool\x20','codebase_search','payload','A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.','readFile','search_string','all','🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a','ToolException','ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a','\x20error(s)','object','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:','listRoots','\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]','edit_file','.git','\x20-\x20','read\x20','added\x20','Repository\x20identifier','terminated','description','\x22.\x20Known\x20tools:\x20','completionId','role','stringify','error','-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a','context','has','path','Disabled\x20tools:\x20','Unknown\x20error','Invalid\x20arguments:\x20','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','application/json','trim','Bearer\x20','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a','morph-v3-fast','143156hUHBYe','Tool\x20\x22','etimedout','linesModified','\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit','min','Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.\x20','-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a','GitHub\x20repository\x20URL\x20to\x20search\x20(e.g.\x20\x27https://github.com/vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','toLowerCase','github_url','--version','Error\x20running\x20fast\x20context\x20search:\x20','Warning:\x20Workspace\x20fallback\x20failed:\x20','\x20chars)','For\x20deletions:\x0a','ReadError','.vscode','Specific\x20commit\x20hash\x20to\x20search','env','string','1296848VjZHvo','substring','\x20\x20morph-mcp','FileNotFound','Unknown\x20tool:\x20','\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)','default','getClientCapabilities','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','Benefits:\x0a','node_modules','constructor','grep','argv','setRequestHandler','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20toolin\x20its\x20search.\x20','\x20for:\x20\x22','ENOENT','-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a','map','includes',',\x20removed\x20','describe','RipgrepNotAvailable','Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.','utf-8','false','join','safeParse','\x20(new\x20file)','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:','[github_codebase_search]\x20Failed\x20in\x20','6563544MPvSoH','ENABLE_WORKSPACE_MODE','dirname','list_directory\x20','morph-warp-grep-v1-1111v0','\x20as\x20allowed\x20directory','api-key','normalize','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','runWarpGrep_call','-\x20Listed\x20directory\x20`','post','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','[could\x20not\x20read\x20file:\x20','RipgrepError','\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit','Warning:\x20','instruction','-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','--help','package.json','544128oWHzZz','\x20disabled\x20via\x20DISABLED_TOOLS','-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a','Error\x20accessing\x20directory\x20','UnknownError','Relevant\x20context\x20found:','code','186027qWHzjG','composer.json','Fatal\x20error\x20running\x20server:','source','\x0aOptions:','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','basename','filter','.\x20Changes:\x20','❌\x20Morph\x20Edit\x20Failed:\x20','split','enum','finish','@morphllm/morphmcp\x20','unknown\x20error','SymlinkError','assistant','Here\x20is\x20the\x20content\x20of\x20files:\x0a','success','optional','linesRemoved',',\x20modified\x20','read','https://morphllm.com/api/error-report','Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all','Error:\x20','errors','-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a','match','some','Natural-language\x20question/description\x20about\x20the\x20code\x20you\x20want\x20to\x20understand.\x20Good\x20example:\x20\x22Where\x20does\x20auth\x20get\x20handled,\x20what\x20are\x20the\x20different\x20oauth\x20methods\x20supported?\x22,\x20\x22Trace\x20all\x20code\x20that\x20relates\x20to\x20how\x20data\x20is\x20injested\x20and\x20processed\x22.\x20Bad\x20example:\x20\x22auth()\x22,\x20\x22auth\x20login\x20dashoard\x20google\x20email\x22.\x20This\x20tool\x20does\x20NOT\x20accept\x20regex,\x20keyword\x20dumps,\x20or\x20symbol-only\x20queries.','repo_path','completed','oninitialized','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','requiresApiKey','2LWZOEW','BinaryFile','lines'];a0_0x526b=function(){return _0x2e22bc;};return a0_0x526b();}const MorphEditFileArgsSchema=z[a0_0x516777(0x17f)]({'path':z[a0_0x516777(0x1b4)](),'code_edit':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x1cc)]('Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.'),'instruction':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x1cc)](a0_0x516777(0x177)),'dryRun':z[a0_0x516777(0x135)]()[a0_0x516777(0x1bb)](![])['describe']('Preview\x20changes\x20without\x20applying\x20them.')}),CODEBASE_SEARCH_QUERY_DESCRIPTION=a0_0x516777(0x210),WarpGrepArgsSchema=z[a0_0x516777(0x17f)]({'search_string':z['string']()[a0_0x516777(0x1cc)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repo_path':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x1cc)]('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'),'search_type':z[a0_0x516777(0x1fd)](['default',a0_0x516777(0x1bf)])[a0_0x516777(0x205)]()[a0_0x516777(0x1cc)](a0_0x516777(0x1ce))}),WarpGrepGitHubArgsSchema=z['object']({'search_string':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x1cc)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'github_url':z['string']()[a0_0x516777(0x205)]()[a0_0x516777(0x1cc)](a0_0x516777(0x1a8)),'owner_repo':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x205)]()[a0_0x516777(0x1cc)](a0_0x516777(0x132)),'branch':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x205)]()[a0_0x516777(0x1cc)](a0_0x516777(0x142))}),CodebaseSearchArgsSchema=z[a0_0x516777(0x17f)]({'query':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x1cc)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repoId':z[a0_0x516777(0x1b4)]()[a0_0x516777(0x1cc)](a0_0x516777(0x189)),'branch':z['string']()[a0_0x516777(0x205)]()['describe'](a0_0x516777(0x152)),'commitHash':z['string']()[a0_0x516777(0x205)]()[a0_0x516777(0x1cc)](a0_0x516777(0x1b2)),'targetDirectories':z[a0_0x516777(0x149)](z[a0_0x516777(0x1b4)]())['default']([])['describe'](a0_0x516777(0x20a)),'limit':z['number']()[a0_0x516777(0x205)]()[a0_0x516777(0x1bb)](0xa)[a0_0x516777(0x1cc)](a0_0x516777(0x16a))}),server=new Server({'name':'morph-mcp','version':a0_0x516777(0x15c)},{'capabilities':{'tools':{}}});server['setRequestHandler'](ListToolsRequestSchema,async()=>{const _0x1e90b9=a0_0x516777,_0x3bb26c=[{'name':_0x1e90b9(0x184),'description':_0x1e90b9(0x1c8)+'⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a'+_0x1e90b9(0x17b)+'IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a'+_0x1e90b9(0x1be)+'-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a'+_0x1e90b9(0x20d)+'-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a'+_0x1e90b9(0x1a7)+'Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a'+_0x1e90b9(0x17d)+_0x1e90b9(0x143)+_0x1e90b9(0x1af)+_0x1e90b9(0x164)+_0x1e90b9(0x19d)+'Rules:\x0a'+_0x1e90b9(0x191)+_0x1e90b9(0x1ed)+'-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a'+_0x1e90b9(0x13d)+_0x1e90b9(0x1e8)+_0x1e90b9(0x1c7)+_0x1e90b9(0x1f7),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x1e90b9(0x175),'description':'A\x20code\x20exploration\x20tool,\x20use\x20this\x20tool\x20when\x20exploring\x20an\x20unfamiliar\x20codebase,\x20and\x20you\x27re\x20unsure\x20of\x20the\x20exact\x20file\x20or\x20string\x20to\x20look\x20for.\x20This\x20tool\x20will\x20find\x20all\x20relevant\x20bits\x20of\x20code\x20given\x20a\x20natural\x20lanugage\x20description,\x20or\x20questin\x20of\x20the\x20thing\x20you\x27re\x20looking\x20for.\x20'+CODEBASE_SEARCH_QUERY_DESCRIPTION+'\x20'+_0x1e90b9(0x1c4)+_0x1e90b9(0x1a6)+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]}],_0x2a22c5=_0x3bb26c[_0x1e90b9(0x1f9)](_0x55a9dd=>{const _0x5e489e=_0x1e90b9;if(DISABLED_TOOLS[_0x5e489e(0x193)](_0x55a9dd[_0x5e489e(0x220)]))return console['error'](_0x5e489e(0x174)+_0x55a9dd['name']+_0x5e489e(0x1ec)),![];if('requiresApiKey'in _0x55a9dd&&_0x55a9dd[_0x5e489e(0x215)]&&!MORPH_API_KEY)return logMcpStderr(_0x5e489e(0x1e6)+_0x55a9dd['name']+_0x5e489e(0x1e2)),![];return!![];});return{'tools':_0x2a22c5[_0x1e90b9(0x1c9)](_0x5dd0e9=>({'name':_0x5dd0e9[_0x1e90b9(0x220)],'description':_0x5dd0e9[_0x1e90b9(0x18b)],'inputSchema':_0x5dd0e9['inputSchema']}))};}),server[a0_0x516777(0x1c3)](CallToolRequestSchema,async _0xef050=>{const _0x57e482=a0_0x516777,{name:_0x4880b4,arguments:_0x3dcbc1}=_0xef050[_0x57e482(0x144)];try{if(DISABLED_TOOLS[_0x57e482(0x193)](_0x4880b4))throw new Error(_0x57e482(0x1a0)+_0x4880b4+'\x22\x20is\x20disabled\x20via\x20DISABLED_TOOLS\x20environment\x20variable');switch(_0x4880b4){case _0x57e482(0x184):{const _0x1b6df0=MorphEditFileArgsSchema['safeParse'](_0x3dcbc1);if(!_0x1b6df0['success'])throw new Error(_0x57e482(0x14e)+_0x1b6df0[_0x57e482(0x190)]);const _0x48a3e4=await validatePath(_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x194)]);let _0x1a284b=null,_0x32525c=!![],_0x3d0bdf=null;try{_0x1a284b=await a0_0xe4ef90['readFile'](_0x48a3e4,_0x57e482(0x1cf));}catch(_0x39d47d){const _0xd7a829=_0x39d47d['code'];_0xd7a829===_0x57e482(0x1c6)?(_0x32525c=![],_0x1a284b=''):(_0x3d0bdf='Failed\x20to\x20read\x20file:\x20'+(_0xd7a829||_0x57e482(0x224))+_0x57e482(0x186)+(_0x39d47d instanceof Error?_0x39d47d[_0x57e482(0x21d)]:String(_0x39d47d)),logMcpStderr(_0x57e482(0x1e6)+_0x3d0bdf));}let _0x1fa96c;try{const _0x168fb5=MORPH_API_KEY;if(!_0x168fb5)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.');const _0x3d944b=a0_0x4d30fe[_0x57e482(0x1d8)](_0x48a3e4),_0x2af01a=a0_0x4d30fe[_0x57e482(0x1f8)](_0x48a3e4),_0x4f9034=await executeEditFile({'target_filepath':_0x2af01a,'code_edit':_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x167)],'instructions':_0x1b6df0['data'][_0x57e482(0x1e7)]},{'morphApiKey':_0x168fb5,'morphApiUrl':MORPH_API_URL,'baseDir':_0x3d944b,'autoWrite':!_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x141)],'generateUdiff':![],'debug':![]});_0x1fa96c=_0x4f9034[_0x57e482(0x18d)];if(!_0x4f9034[_0x57e482(0x204)])throw new Error(_0x4f9034[_0x57e482(0x190)]||_0x57e482(0x139));const _0x2ab230=_0x4f9034['changes'],_0x22cbdc=_0x57e482(0x188)+_0x2ab230[_0x57e482(0x223)]+_0x57e482(0x1cb)+_0x2ab230[_0x57e482(0x206)]+_0x57e482(0x207)+_0x2ab230[_0x57e482(0x1a2)];if(_0x1b6df0['data'][_0x57e482(0x141)])return{'content':[{'type':_0x57e482(0x21c),'text':'Morph\x20Edit\x20Preview'+(_0x32525c?'':_0x57e482(0x1d3))+':\x20'+_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x1e7)]+_0x57e482(0x1fa)+_0x22cbdc+_0x57e482(0x146)+_0x1b6df0['data'][_0x57e482(0x194)]+'.'}]};return{'content':[{'type':_0x57e482(0x21c),'text':_0x57e482(0x133)+(_0x32525c?'Applied':_0x57e482(0x156))+':\x20'+_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x1e7)]+_0x57e482(0x1fa)+_0x22cbdc+_0x57e482(0x146)+_0x1b6df0['data'][_0x57e482(0x194)]+'.'}]};}catch(_0xe36a75){const _0x1eadef=_0xe36a75 instanceof Error?_0xe36a75[_0x57e482(0x21d)]:String(_0xe36a75);return reportMorphError({'error_message':_0x1eadef,'error_type':_0xe36a75 instanceof Error?_0xe36a75[_0x57e482(0x1c0)][_0x57e482(0x220)]:_0x57e482(0x1ef),'context':{'tool':_0x57e482(0x184),'completion_id':_0x1fa96c,'file_path':_0x1b6df0['data'][_0x57e482(0x194)],'validated_path':_0x48a3e4,'instruction':_0x1b6df0[_0x57e482(0x16d)]['instruction'],'model':_0x57e482(0x19e),'dry_run':_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x141)],'file_exists':_0x32525c,'file_read_error':_0x3d0bdf,'file_readable':_0x1a284b!==null,'request_content':{'path':_0x1b6df0['data'][_0x57e482(0x194)],'code_edit':_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x167)],'instruction':_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x1e7)],'original_code':_0x1a284b!==null?_0x1a284b[_0x57e482(0x169)]>0xc350?_0x1a284b[_0x57e482(0x1b6)](0x0,0xc350)+'\x0a...\x20(truncated,\x20total:\x20'+_0x1a284b[_0x57e482(0x169)]+_0x57e482(0x1ae):_0x1a284b:_0x57e482(0x1e3)+(_0x3d0bdf||_0x57e482(0x200))+']','original_code_length':_0x1a284b?.[_0x57e482(0x169)]??0x0,'model':_0x57e482(0x19e),'dry_run':_0x1b6df0[_0x57e482(0x16d)][_0x57e482(0x141)]}},'stack_trace':_0xe36a75 instanceof Error?_0xe36a75[_0x57e482(0x162)]:undefined,'source':_0x57e482(0x153)})[_0x57e482(0x221)](()=>{}),{'content':[{'type':_0x57e482(0x21c),'text':_0x57e482(0x1fb)+_0x1eadef}],'isError':!![]};}}case'codebase_search':{const _0x586427=WarpGrepArgsSchema['safeParse'](_0x3dcbc1);if(!_0x586427[_0x57e482(0x204)])return{'content':[{'type':_0x57e482(0x21c),'text':_0x57e482(0x197)+_0x586427[_0x57e482(0x190)]}],'isError':!![]};const _0x223a73=_0x463f98=>{const _0xb5b3aa=_0x57e482,_0x351a3f=[];for(const _0x323d9e of _0x463f98||[]){const _0x4bcbac=_0x323d9e[_0xb5b3aa(0x18e)],_0x598566=_0x323d9e['content'];if(_0x4bcbac===_0xb5b3aa(0x202)&&_0x598566){const _0x1170bf=_0x598566[_0xb5b3aa(0x1fc)]('\x0a')[_0xb5b3aa(0x1f9)](_0x1525bd=>_0x1525bd[_0xb5b3aa(0x19a)]());for(const _0x4aaf4c of _0x1170bf){const _0x5d68de=_0x4aaf4c[_0xb5b3aa(0x20e)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x5d68de){_0x351a3f[_0xb5b3aa(0x21f)](_0xb5b3aa(0x15b)+_0x5d68de[0x1]+'\x27\x20'+_0x5d68de[0x2]);continue;}const _0x4ea50c=_0x4aaf4c['match'](/^read\s+(.+)$/);if(_0x4ea50c){_0x351a3f[_0xb5b3aa(0x21f)](_0xb5b3aa(0x187)+_0x4ea50c[0x1]);continue;}const _0x5a41be=_0x4aaf4c[_0xb5b3aa(0x20e)](/^list_directory\s+(.+)$/);if(_0x5a41be){_0x351a3f['push'](_0xb5b3aa(0x1d9)+_0x5a41be[0x1]);continue;}}}}return _0x351a3f;},_0x4fb404=_0x5efd75=>{const _0x56e8f3=_0x57e482,_0x34f074=[];if(!_0x5efd75||!Array[_0x56e8f3(0x21b)](_0x5efd75))return _0x34f074;const _0x1dfc35=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':_0x56e8f3(0x1b8),'tool':_0x56e8f3(0x208)},{'pattern':/\[PATH ERROR\]/,'error_type':_0x56e8f3(0x14b),'tool':_0x56e8f3(0x208)},{'pattern':/\[READ ERROR\]/,'error_type':_0x56e8f3(0x1b0),'tool':_0x56e8f3(0x208)},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0x56e8f3(0x217),'tool':_0x56e8f3(0x208)},{'pattern':/\[RIPGREP ERROR\]/,'error_type':_0x56e8f3(0x1e4),'tool':_0x56e8f3(0x1c1)},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':_0x56e8f3(0x1cd),'tool':_0x56e8f3(0x1c1)},{'pattern':/\[BINARY FILE\]/,'error_type':_0x56e8f3(0x217),'tool':'read'},{'pattern':/\[SYMLINK\]/,'error_type':'SymlinkError','tool':'read'},{'pattern':/not a text file/,'error_type':_0x56e8f3(0x217),'tool':'read'},{'pattern':/symbolic link/,'error_type':_0x56e8f3(0x201),'tool':_0x56e8f3(0x208)},{'pattern':/Error reading file:/,'error_type':_0x56e8f3(0x1b0),'tool':_0x56e8f3(0x208)},{'pattern':/status="error"/,'error_type':_0x56e8f3(0x17c),'tool':'unknown'}];let _0x200bbc=0x0;for(const _0x56e18b of _0x5efd75){if(_0x56e18b[_0x56e8f3(0x18e)]===_0x56e8f3(0x166)){_0x200bbc++;const _0x202f0f=_0x56e18b['content'];if(!_0x202f0f||typeof _0x202f0f!=='string')continue;for(const {pattern:_0x4db7ae,error_type:_0x16402f,tool:_0x18f6bd}of _0x1dfc35){const _0x1de3a2=_0x202f0f[_0x56e8f3(0x20e)](new RegExp(_0x4db7ae[_0x56e8f3(0x1f5)],'g'));if(_0x1de3a2)for(const _0x488ebd of _0x1de3a2){const _0x32c016=_0x202f0f[_0x56e8f3(0x225)](_0x488ebd),_0x2f344e=_0x202f0f[_0x56e8f3(0x1b6)](_0x32c016,Math[_0x56e8f3(0x1a4)](_0x32c016+0xc8,_0x202f0f[_0x56e8f3(0x169)]));_0x34f074[_0x56e8f3(0x21f)]({'tool':_0x18f6bd,'error_type':_0x16402f,'error_message':_0x2f344e['split']('\x0a')[0x0],'turn':_0x200bbc});}}}}return _0x34f074;};try{const _0x58744d=a0_0x4d30fe[_0x57e482(0x151)](_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)]),_0x1a30cb=_0x586427['data']['search_type'],_0x128092=_0x1a30cb===_0x57e482(0x1bf)?{'allowNames':['node_modules']}:undefined,_0xfd53b8=new LocalRipgrepProvider(_0x58744d,undefined,_0x128092),_0x322d67=await runWarpGrep({'searchTerm':_0x586427[_0x57e482(0x16d)][_0x57e482(0x179)],'repoRoot':_0x58744d,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0xfd53b8,'search_type':_0x1a30cb}),_0x34396e=_0x4fb404(_0x322d67[_0x57e482(0x138)]);_0x34396e[_0x57e482(0x169)]>0x0&&reportMorphError({'error_message':'WarpGrep\x20sub-tool\x20errors:\x20'+_0x34396e['length']+_0x57e482(0x17e),'error_type':_0x57e482(0x127),'level':'warn','tool':'codebase_search','context':{'repo_path':_0x586427['data'][_0x57e482(0x211)],'query':_0x586427['data'][_0x57e482(0x179)],'model':_0x57e482(0x1da),'termination_reason':_0x322d67[_0x57e482(0x126)],'sub_tool_errors':_0x34396e,'timings':_0x322d67[_0x57e482(0x222)],'tool_calls':_0x223a73(_0x322d67['messages']),'messages':_0x322d67[_0x57e482(0x138)]?.[_0x57e482(0x1c9)](_0x155884=>({'role':_0x155884[_0x57e482(0x18e)],'content':_0x155884[_0x57e482(0x137)]}))},'source':_0x57e482(0x153)})['catch'](()=>{});let _0x1d901a='';if(_0x322d67[_0x57e482(0x126)]===_0x57e482(0x212)&&_0x322d67[_0x57e482(0x1fe)]?.['metadata']?.['files']){const _0x3847cb=_0x322d67[_0x57e482(0x1fe)][_0x57e482(0x15f)][_0x57e482(0x13a)];if(_0x3847cb[_0x57e482(0x169)]===0x0)return _0x1d901a=_0x322d67['finish'][_0x57e482(0x176)]||_0x57e482(0x159),{'content':[{'type':'text','text':_0x1d901a}]};const _0x482779=[],_0x47acda=[_0x57e482(0x19c)];for(const _0x389700 of _0x322d67[_0x57e482(0x138)]){const _0x97a639=_0x389700[_0x57e482(0x18e)],_0x195d5e=_0x389700['content'];if(_0x97a639===_0x57e482(0x202)&&_0x195d5e){const _0x447130=_0x195d5e[_0x57e482(0x1fc)]('\x0a')[_0x57e482(0x1f9)](_0x39f1a3=>_0x39f1a3['trim']());for(const _0x404246 of _0x447130){const _0x56f614=_0x404246[_0x57e482(0x20e)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x56f614){_0x47acda[_0x57e482(0x21f)](_0x57e482(0x171)+_0x56f614[0x1]+_0x57e482(0x15d)+_0x56f614[0x2]+'`');continue;}const _0x1f776f=_0x404246[_0x57e482(0x20e)](/^read\s+(.+)$/);if(_0x1f776f){_0x47acda[_0x57e482(0x21f)]('-\x20Read\x20file\x20`'+_0x1f776f[0x1]+'`');continue;}const _0x36667f=_0x404246[_0x57e482(0x20e)](/^list_directory\s+(.+)$/);if(_0x36667f){_0x47acda[_0x57e482(0x21f)](_0x57e482(0x1e0)+_0x36667f[0x1]+'`');continue;}}}}_0x482779[_0x57e482(0x21f)](_0x47acda[_0x57e482(0x1d1)]('\x0a'));const _0x2a439a=['',_0x57e482(0x1f0)];for(const _0x137ccc of _0x3847cb){if(_0x137ccc[_0x57e482(0x218)]==='*')_0x2a439a['push']('-\x20'+_0x137ccc['path']+':*');else{if(Array[_0x57e482(0x21b)](_0x137ccc['lines'])){const _0x31cb93=_0x137ccc[_0x57e482(0x218)][_0x57e482(0x1c9)](([_0xe1973c,_0x45d77f])=>{if(_0xe1973c===_0x45d77f)return''+_0xe1973c;return _0xe1973c+'-'+_0x45d77f;});_0x2a439a['push']('-\x20'+_0x137ccc[_0x57e482(0x194)]+':'+_0x31cb93['join'](','));}else _0x2a439a['push']('-\x20'+_0x137ccc[_0x57e482(0x194)]+':*');}}_0x2a439a[_0x57e482(0x21f)](''),_0x482779['push'](_0x2a439a[_0x57e482(0x1d1)]('\x0a')),_0x482779[_0x57e482(0x21f)](_0x57e482(0x203));const _0x6f5dbd=[];for(const _0x2ca3d3 of _0x3847cb){let _0x55510a=a0_0x4d30fe[_0x57e482(0x151)](_0x586427[_0x57e482(0x16d)]['repo_path'],_0x2ca3d3['path']),_0x2077b6=null,_0x2b3326=null;try{_0x2077b6=await a0_0xe4ef90[_0x57e482(0x178)](_0x55510a,{'encoding':_0x57e482(0x1cf)});}catch(_0x25396){const _0x405052=fixPathRepetition(_0x55510a);if(_0x405052)try{_0x2077b6=await a0_0xe4ef90[_0x57e482(0x178)](_0x405052,{'encoding':'utf-8'}),_0x55510a=_0x405052;}catch{_0x2b3326=_0x25396 instanceof Error?_0x25396:new Error(String(_0x25396));}else _0x2b3326=_0x25396 instanceof Error?_0x25396:new Error(String(_0x25396));}if(_0x2077b6!==null){const _0x373d2b=_0x2077b6[_0x57e482(0x1fc)](/\r?\n/),_0x5f245d=[_0x57e482(0x227)+_0x2ca3d3[_0x57e482(0x194)]+'\x22>'];if(_0x2ca3d3[_0x57e482(0x218)]==='*'||!Array[_0x57e482(0x21b)](_0x2ca3d3[_0x57e482(0x218)]))for(let _0x346dc8=0x1;_0x346dc8<=_0x373d2b[_0x57e482(0x169)];_0x346dc8++){const _0x1cafaa=_0x373d2b[_0x346dc8-0x1];_0x5f245d['push'](_0x346dc8+'|\x20'+_0x1cafaa);}else for(const [_0x99d447,_0x1a3957]of _0x2ca3d3['lines']){_0x5f245d[_0x57e482(0x169)]>0x1&&_0x5f245d[_0x57e482(0x21f)]('');for(let _0x593387=_0x99d447;_0x593387<=_0x1a3957&&_0x593387<=_0x373d2b[_0x57e482(0x169)];_0x593387++){const _0x4783ce=_0x373d2b[_0x593387-0x1];_0x5f245d['push'](_0x593387+'|\x20'+_0x4783ce);}}_0x5f245d[_0x57e482(0x21f)](_0x57e482(0x158)),_0x6f5dbd[_0x57e482(0x21f)](_0x5f245d[_0x57e482(0x1d1)]('\x0a'));}else _0x6f5dbd[_0x57e482(0x21f)](_0x57e482(0x227)+_0x2ca3d3[_0x57e482(0x194)]+'\x22>\x0aError\x20reading\x20file:\x20'+(_0x2b3326?.[_0x57e482(0x21d)]||_0x57e482(0x196))+'\x0a</file>');}_0x482779[_0x57e482(0x21f)](_0x6f5dbd['join']('\x0a\x0a')),_0x1d901a=_0x482779[_0x57e482(0x1d1)]('\x0a');const _0x38b29c=_0x322d67[_0x57e482(0x20c)]?.[_0x57e482(0x1f9)](_0x44b75b=>_0x44b75b[_0x57e482(0x21d)]?.[_0x57e482(0x154)]('File\x20read\x20error:'))||[];if(_0x38b29c['length']>0x0){const _0x3dca4a=_0x38b29c[_0x57e482(0x1c9)](_0x54edd4=>_0x54edd4[_0x57e482(0x21d)])[_0x57e482(0x1d1)](';\x20');reportMorphError({'error_message':_0x3dca4a,'error_type':_0x57e482(0x15e),'context':{'tool':'codebase_search','repo_path':_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)],'query':_0x586427[_0x57e482(0x16d)][_0x57e482(0x179)],'model':_0x57e482(0x1da),'termination_reason':_0x57e482(0x160),'error_count':_0x38b29c[_0x57e482(0x169)],'is_timeout':![],'timings':_0x322d67[_0x57e482(0x222)],'files_attempted':_0x3847cb[_0x57e482(0x1c9)](_0x457103=>({'path':_0x457103['path'],'lines':_0x457103[_0x57e482(0x218)]})),'tool_calls':_0x223a73(_0x322d67[_0x57e482(0x138)]),'messages':_0x322d67['messages']?.[_0x57e482(0x1c9)](_0x5ca33a=>({'role':_0x5ca33a[_0x57e482(0x18e)],'content':_0x5ca33a[_0x57e482(0x137)]})),'request_content':{'query':_0x586427[_0x57e482(0x16d)][_0x57e482(0x179)],'repo_path':_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)],'repoRoot':a0_0x4d30fe[_0x57e482(0x151)](_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)]),'model':_0x57e482(0x1da)}},'source':_0x57e482(0x153)})['catch'](()=>{});}}else{if(_0x322d67[_0x57e482(0x126)]===_0x57e482(0x18a)&&_0x322d67['errors'][_0x57e482(0x169)]>0x0){const _0x429ae7=_0x322d67[_0x57e482(0x20c)][_0x57e482(0x1c9)](_0x28560b=>_0x28560b['message'])[_0x57e482(0x1d1)](';\x20');_0x1d901a=_0x57e482(0x20b)+_0x429ae7;const _0x187679=_0x429ae7[_0x57e482(0x1a9)]()[_0x57e482(0x1ca)](_0x57e482(0x13b))||_0x429ae7[_0x57e482(0x1a9)]()['includes']('timed\x20out')||_0x429ae7[_0x57e482(0x1a9)]()[_0x57e482(0x1ca)](_0x57e482(0x1a1)),_0x57655e=_0x322d67[_0x57e482(0x1fe)]?.['metadata']?.[_0x57e482(0x13a)],_0x2e2569=_0x322d67[_0x57e482(0x20c)][0x0];reportMorphError({'error_message':_0x429ae7,'error_type':_0x187679?_0x57e482(0x12e):_0x2e2569?.[_0x57e482(0x1c0)]?.[_0x57e482(0x220)]||_0x57e482(0x165),'context':{'tool':_0x57e482(0x175),'repo_path':_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)],'query':_0x586427[_0x57e482(0x16d)][_0x57e482(0x179)],'model':_0x57e482(0x1da),'termination_reason':_0x322d67[_0x57e482(0x126)],'error_count':_0x322d67[_0x57e482(0x20c)][_0x57e482(0x169)],'is_timeout':_0x187679,'timings':_0x322d67[_0x57e482(0x222)],'files_attempted':_0x57655e?.[_0x57e482(0x1c9)](_0x3765ca=>({'path':_0x3765ca[_0x57e482(0x194)],'lines':_0x3765ca[_0x57e482(0x218)]})),'tool_calls':_0x223a73(_0x322d67[_0x57e482(0x138)]),'messages':_0x322d67[_0x57e482(0x138)]?.[_0x57e482(0x1c9)](_0x1a3dc6=>({'role':_0x1a3dc6[_0x57e482(0x18e)],'content':_0x1a3dc6['content']})),'request_content':{'query':_0x586427[_0x57e482(0x16d)][_0x57e482(0x179)],'repo_path':_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)],'repoRoot':a0_0x4d30fe[_0x57e482(0x151)](_0x586427[_0x57e482(0x16d)]['repo_path']),'model':'morph-warp-grep-v1-1111v0'}},'stack_trace':_0x2e2569?.['stack']||undefined,'source':_0x57e482(0x153)})[_0x57e482(0x221)](()=>{});}else _0x1d901a='Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.';}return{'content':[{'type':_0x57e482(0x21c),'text':_0x1d901a}]};}catch(_0x150ac5){const _0x213d2d=_0x150ac5 instanceof Error?_0x150ac5[_0x57e482(0x21d)]:String(_0x150ac5),_0x21005b=_0x213d2d[_0x57e482(0x1a9)]()['includes'](_0x57e482(0x13b))||_0x213d2d['toLowerCase']()[_0x57e482(0x1ca)]('timed\x20out')||_0x213d2d[_0x57e482(0x1a9)]()[_0x57e482(0x1ca)]('etimedout')||_0x150ac5 instanceof Error&&_0x150ac5['name']===_0x57e482(0x12e);return reportMorphError({'error_message':_0x213d2d,'error_type':_0x21005b?_0x57e482(0x12e):_0x150ac5 instanceof Error?_0x150ac5['constructor'][_0x57e482(0x220)]:'UnknownError','context':{'tool':_0x57e482(0x175),'repo_path':_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)],'query':_0x586427[_0x57e482(0x16d)][_0x57e482(0x179)],'model':_0x57e482(0x1da),'is_timeout':_0x21005b,'exception_phase':_0x57e482(0x1df),'request_content':{'query':_0x586427[_0x57e482(0x16d)][_0x57e482(0x179)],'repo_path':_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)],'repoRoot':a0_0x4d30fe[_0x57e482(0x151)](_0x586427[_0x57e482(0x16d)][_0x57e482(0x211)]),'model':_0x57e482(0x1da)}},'stack_trace':_0x150ac5 instanceof Error?_0x150ac5[_0x57e482(0x162)]:undefined,'source':_0x57e482(0x153)})[_0x57e482(0x221)](()=>{}),{'content':[{'type':'text','text':_0x57e482(0x1ac)+_0x213d2d}],'isError':![]};}}case _0x57e482(0x150):{const _0xa44b15=WarpGrepGitHubArgsSchema[_0x57e482(0x1d2)](_0x3dcbc1);if(!_0xa44b15['success'])return{'content':[{'type':_0x57e482(0x21c),'text':'Invalid\x20arguments:\x20'+_0xa44b15[_0x57e482(0x190)]}],'isError':!![]};const _0x3c1421=_0xa44b15[_0x57e482(0x16d)][_0x57e482(0x1aa)]||_0xa44b15[_0x57e482(0x16d)]['owner_repo'];if(!_0x3c1421)return{'content':[{'type':_0x57e482(0x21c),'text':_0x57e482(0x1a5)}],'isError':!![]};const _0x3e85b9=MORPH_API_KEY;if(!_0x3e85b9)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.');const _0x5b1d8a=Date[_0x57e482(0x147)]();logMcpStderr(_0x57e482(0x219)+_0x3c1421+_0x57e482(0x1c5)+_0xa44b15[_0x57e482(0x16d)][_0x57e482(0x179)]+'\x22');try{const _0x2201f8=new WarpGrepClient({'morphApiKey':_0x3e85b9,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x4e5f1c=await _0x2201f8[_0x57e482(0x13c)]({'searchTerm':_0xa44b15['data'][_0x57e482(0x179)],'github':_0x3c1421,'branch':_0xa44b15[_0x57e482(0x16d)][_0x57e482(0x16c)]}),_0x4d4aa7=Date[_0x57e482(0x147)]()-_0x5b1d8a;logMcpStderr('[github_codebase_search]\x20Done\x20in\x20'+_0x4d4aa7+'ms.\x20Success:\x20'+_0x4e5f1c[_0x57e482(0x204)]);const _0x49875f=formatResult(_0x4e5f1c);return{'content':[{'type':_0x57e482(0x21c),'text':_0x49875f}]};}catch(_0x4fc322){const _0x1375a2=Date[_0x57e482(0x147)]()-_0x5b1d8a,_0x239904=_0x4fc322 instanceof Error?_0x4fc322[_0x57e482(0x21d)]:String(_0x4fc322);return logMcpStderr(_0x57e482(0x1d5)+_0x1375a2+_0x57e482(0x16e),_0x239904),reportMorphError({'error_message':_0x239904,'error_type':_0x4fc322 instanceof Error?_0x4fc322[_0x57e482(0x1c0)][_0x57e482(0x220)]:_0x57e482(0x1ef),'context':{'tool':_0x57e482(0x150),'github_url':_0x3c1421,'search_string':_0xa44b15[_0x57e482(0x16d)][_0x57e482(0x179)],'branch':_0xa44b15['data'][_0x57e482(0x16c)]},'stack_trace':_0x4fc322 instanceof Error?_0x4fc322[_0x57e482(0x162)]:undefined,'source':_0x57e482(0x153),'tool':_0x57e482(0x150),'latency_ms':_0x1375a2})[_0x57e482(0x221)](()=>{}),{'content':[{'type':_0x57e482(0x21c),'text':'GitHub\x20search\x20failed:\x20'+_0x239904}],'isError':![]};}}default:throw new Error(_0x57e482(0x1b9)+_0x4880b4);}}catch(_0x344520){const _0x497099=_0x344520 instanceof Error?_0x344520[_0x57e482(0x21d)]:String(_0x344520);return reportMorphError({'error_message':_0x497099,'error_type':_0x344520 instanceof Error?_0x344520[_0x57e482(0x1c0)][_0x57e482(0x220)]:_0x57e482(0x1ef),'context':{'tool':_0x4880b4,'arguments':_0x3dcbc1?JSON[_0x57e482(0x18f)](_0x3dcbc1)[_0x57e482(0x1b6)](0x0,0x1f4):undefined,'mcp_server_version':_0x57e482(0x15c)},'stack_trace':_0x344520 instanceof Error?_0x344520[_0x57e482(0x162)]:undefined,'source':'mcp-filesystem'})[_0x57e482(0x221)](()=>{}),{'content':[{'type':_0x57e482(0x21c),'text':'Error:\x20'+_0x497099}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x4a9d21){const _0x2e9e6b=a0_0x516777,_0x1cd4aa=await getValidRootDirectories(_0x4a9d21);if(_0x1cd4aa[_0x2e9e6b(0x169)]>0x0)allowedDirectories=[..._0x1cd4aa],logMcpStderr(_0x2e9e6b(0x1bd)+_0x1cd4aa['length']+'\x20valid\x20directories');else{logMcpStderr(_0x2e9e6b(0x214));if(ENABLE_WORKSPACE_MODE)try{const _0x4d3cd7=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x4d3cd7&&(allowedDirectories=[_0x4d3cd7],logMcpStderr('Fallback:\x20Using\x20workspace\x20root\x20'+_0x4d3cd7));}catch(_0xcd0834){logMcpStderr(_0x2e9e6b(0x1ad)+_0xcd0834);}}}server['setNotificationHandler'](RootsListChangedNotificationSchema,async()=>{const _0x10ef48=a0_0x516777;try{const _0x12b7dd=await server[_0x10ef48(0x182)]();_0x12b7dd&&_0x10ef48(0x14d)in _0x12b7dd&&await updateAllowedDirectoriesFromRoots(_0x12b7dd[_0x10ef48(0x14d)]);}catch(_0x23c5cb){logMcpStderr('Failed\x20to\x20request\x20roots\x20from\x20client:',_0x23c5cb instanceof Error?_0x23c5cb['message']:String(_0x23c5cb));}}),server[a0_0x516777(0x213)]=async()=>{const _0x42eba1=a0_0x516777,_0x47bbf7=server[_0x42eba1(0x1bc)]();if(_0x47bbf7?.[_0x42eba1(0x14d)])try{const _0x2f22d2=await server[_0x42eba1(0x182)]();_0x2f22d2&&_0x42eba1(0x14d)in _0x2f22d2?await updateAllowedDirectoriesFromRoots(_0x2f22d2['roots']):logMcpStderr('Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings');}catch(_0x5e3b49){logMcpStderr(_0x42eba1(0x181),_0x5e3b49 instanceof Error?_0x5e3b49[_0x42eba1(0x21d)]:String(_0x5e3b49));}else{if(allowedDirectories['length']>0x0)logMcpStderr(_0x42eba1(0x1d4),allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)logMcpStderr(_0x42eba1(0x173));else throw new Error(_0x42eba1(0x145));}}};async function runServer(){const _0x147f75=a0_0x516777,_0x34e601=new StdioServerTransport();await server[_0x147f75(0x21a)](_0x34e601),logMcpStderr('Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio'),allowedDirectories[_0x147f75(0x169)]===0x0&&logMcpStderr('Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol');}runServer()['catch'](_0x4b24d2=>{const _0x544618=a0_0x516777;logMcpStderr(_0x544618(0x1f4),_0x4b24d2),process['exit'](0x1);});
|
|
2
|
+
const a0_0x3c1c96=a0_0x12b6;(function(_0x27ff1b,_0x4ecfd3){const _0x164875=a0_0x12b6,_0x3d4718=_0x27ff1b();while(!![]){try{const _0x166039=-parseInt(_0x164875(0x2a7))/0x1+-parseInt(_0x164875(0x20b))/0x2*(parseInt(_0x164875(0x1fd))/0x3)+parseInt(_0x164875(0x2ae))/0x4+-parseInt(_0x164875(0x2b5))/0x5+-parseInt(_0x164875(0x250))/0x6*(-parseInt(_0x164875(0x2bd))/0x7)+parseInt(_0x164875(0x1ed))/0x8*(parseInt(_0x164875(0x29a))/0x9)+-parseInt(_0x164875(0x249))/0xa*(parseInt(_0x164875(0x286))/0xb);if(_0x166039===_0x4ecfd3)break;else _0x3d4718['push'](_0x3d4718['shift']());}catch(_0x5078e5){_0x3d4718['push'](_0x3d4718['shift']());}}}(a0_0x3a20,0xf3684));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_0x2f75b0 from'fs/promises';import a0_0x488644 from'path';import a0_0x9d9998 from'os';import{createRequire}from'module';import{z}from'zod';import{zodToJsonSchema}from'zod-to-json-schema';import{getValidRootDirectories}from'./roots-utils.js';import{getOperatingSystemType,logMcpStderr}from'./log-utils.js';import{executeEditFile}from'@morphllm/morphsdk/tools/fastapply';import{runWarpGrep,LocalRipgrepProvider,GITHUB_SEARCH_TOOL_NAME,GITHUB_SEARCH_DESCRIPTION}from'@morphllm/morphsdk/tools/warp-grep';import{WarpGrepClient,formatResult}from'@morphllm/morphsdk/tools/warp-grep/client';import a0_0x5dc1d2 from'axios';function a0_0x3a20(){const _0x3e3c43=['Workspace\x20mode\x20enabled:\x20Using\x20','match','has','runWarpGrep_call','Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a','object','added\x20','Error\x20accessing\x20directory\x20','assistant','Created\x20File','code','path','21ATQKWH','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','searchGitHub','describe','false','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','No\x20relevant\x20code\x20found\x20for\x20the\x20query.','UnknownError','MORPH_WARP_GREP_TIMEOUT','includes','terminationReason','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','etimedout','warn','55358ueRJcu','\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]','listRoots','GitHub\x20repository\x20URL\x20to\x20search\x20(e.g.\x20\x27https://github.com/vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','composer.json','\x20chars)','terminated','connect','morph-v3-fast','TimeoutError','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a','node_modules','ENABLE_WORKSPACE_MODE','search_string','safeParse','[github_codebase_search]\x20Done\x20in\x20','changes','log','setRequestHandler','Benefits:\x0a','\x20valid\x20directories','-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a','\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)','join','-\x20Read\x20file\x20`','timed\x20out','\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo','message','split','-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a','trim','ms:','messages','post','user','filter','\x20is\x20not\x20a\x20directory','all','role','A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.','every',',\x20removed\x20','-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','push','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','RipgrepError','success','Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a','default','Unknown\x20tool:\x20','morph-warp-grep-v1-1111v0','0.2.0','\x0a</file>','substring','../package.json','files','\x22\x20is\x20disabled\x20via\x20DISABLED_TOOLS\x20environment\x20variable','⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a','access','\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit','oninitialized','errors','8180vNXCbx','https://morphllm.com/api/error-report','toLowerCase','File\x20read\x20error:','Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.','-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a','\x20disabled\x20via\x20DISABLED_TOOLS','5604IOgmVO','read','Invalid\x20arguments:\x20','setNotificationHandler','normalize','string','Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings','github_codebase_search','version','Unknown\x20error','instruction','slice','❌\x20Morph\x20Edit\x20Failed:\x20','Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.','-\x20Listed\x20directory\x20`','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.','name','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','some','ToolException','tsconfig.json','Parent\x20directory\x20does\x20not\x20exist:\x20','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','morph-','repo_path','resolve','isDirectory','linesAdded','Preview\x20changes\x20without\x20applying\x20them.','unknown','IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a','A\x20code\x20exploration\x20tool,\x20use\x20this\x20tool\x20when\x20exploring\x20an\x20unfamiliar\x20codebase,\x20and\x20you\x27re\x20unsure\x20of\x20the\x20exact\x20file\x20or\x20string\x20to\x20look\x20for.\x20This\x20tool\x20will\x20find\x20all\x20relevant\x20bits\x20of\x20code\x20given\x20a\x20natural\x20lanugage\x20description,\x20or\x20questin\x20of\x20the\x20thing\x20you\x27re\x20looking\x20for.\x20','ENOENT','Warning:\x20Unable\x20to\x20determine\x20package\x20version:','now','Warning:\x20Workspace\x20fallback\x20failed:\x20','number','stringify','indexOf','.git','sep','owner_repo','\x22>\x0aError\x20reading\x20file:\x20','.cursor','isArray','lines','error','.\x20Changes:\x20','Bearer\x20','branch','basename','timings','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','PWD','30151kpUJWa','edit_file','mcp-filesystem','BinaryFile','constructor','-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a','pyproject.toml','\x20\x20morph-mcp','boolean','--version','data','--api-key=','text','map','Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio','source','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','WarpGrep\x20sub-tool\x20errors:\x20','dirname','\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)','48582cOZybz','search_type','stack','catch','Morph\x20Edit\x20','Cargo.toml','github_url','env','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','size','completed','Tool\x20\x22','api-key','953350sWlcVb','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','requiresApiKey','\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit','homedir','DISABLED_TOOLS','stat','6224420GHucNb','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','SubToolError','Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)','metadata','Applied','Here\x20is\x20the\x20content\x20of\x20files:\x0a','371900KTXCzZ','startsWith','roots','completed_with_file_errors','[github_codebase_search]\x20Searching\x20','\x20for:\x20\x22','cwd','argv','14203gePCeP','grep','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','Disabled\x20tools:\x20','optional','package.json','readFile','ReadError','min','realpath','SymlinkError','dryRun','morph-mcp','getClientCapabilities','\x0aOptions:','Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:','sk-','Error:\x20','timeout','\x20-\x20','codebase_search','🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a','content','params','Warning:\x20DISABLED_TOOLS\x20contains\x20unknown\x20tool\x20\x22','Specific\x20commit\x20hash\x20to\x20search','Failed\x20to\x20read\x20file:\x20','<file\x20path=\x22','-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a','Error\x20running\x20fast\x20context\x20search:\x20','-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a','utf-8','length','enum','.vscode','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','toISOString','-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a','exit','ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a','Fatal\x20error\x20running\x20server:','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','\x20(new\x20file)','finish','[github_codebase_search]\x20Failed\x20in\x20','1496BMGfgb','For\x20deletions:\x0a','\x27\x20in\x20`','</file>'];a0_0x3a20=function(){return _0x3e3c43;};return a0_0x3a20();}function fixPathRepetition(_0x1c4ae2){const _0x570bb6=a0_0x12b6,_0x58ba7e=_0x1c4ae2[_0x570bb6(0x227)](a0_0x488644[_0x570bb6(0x278)])[_0x570bb6(0x22e)](Boolean);if(_0x58ba7e[_0x570bb6(0x1e0)]<0x2)return null;for(let _0x25e901=Math['floor'](_0x58ba7e[_0x570bb6(0x1e0)]/0x2);_0x25e901>=0x1;_0x25e901--){for(let _0x18523a=0x0;_0x18523a<=_0x58ba7e[_0x570bb6(0x1e0)]-0x2*_0x25e901;_0x18523a++){const _0x468a85=_0x58ba7e[_0x570bb6(0x25b)](_0x18523a,_0x18523a+_0x25e901),_0x2acdce=_0x58ba7e[_0x570bb6(0x25b)](_0x18523a+_0x25e901,_0x18523a+0x2*_0x25e901);if(_0x468a85[_0x570bb6(0x233)]((_0x7e9ce8,_0x4581e1)=>_0x7e9ce8===_0x2acdce[_0x4581e1])){const _0x1b3560=[..._0x58ba7e[_0x570bb6(0x25b)](0x0,_0x18523a),..._0x58ba7e[_0x570bb6(0x25b)](_0x18523a+_0x25e901)];return a0_0x488644['sep']+_0x1b3560[_0x570bb6(0x222)](a0_0x488644['sep']);}}}return null;}const require=createRequire(import.meta.url);function getPackageVersion(){const _0x352166=a0_0x12b6;try{const _0x15e935=require(_0x352166(0x241));return _0x15e935[_0x352166(0x258)]??_0x352166(0x26d);}catch(_0x1403e0){return logMcpStderr(_0x352166(0x271),_0x1403e0),_0x352166(0x26d);}}function printHelp(){const _0x329f21=a0_0x12b6;console[_0x329f21(0x21c)]('@morphllm/morphmcp\x20'+getPackageVersion()),console[_0x329f21(0x21c)](_0x329f21(0x20c)),console[_0x329f21(0x21c)](_0x329f21(0x1ce)),console[_0x329f21(0x21c)](_0x329f21(0x299)),console[_0x329f21(0x21c)](_0x329f21(0x246)),console[_0x329f21(0x21c)](_0x329f21(0x2aa)),console[_0x329f21(0x21c)]('\x0aExamples:'),console[_0x329f21(0x21c)](_0x329f21(0x28d)),console[_0x329f21(0x21c)](_0x329f21(0x225));}const cliArgs=process[a0_0x3c1c96(0x2bc)][a0_0x3c1c96(0x25b)](0x2),VERSION_FLAGS=new Set([a0_0x3c1c96(0x28f),'-v','-V']),HELP_FLAGS=new Set(['--help','-h']);cliArgs[a0_0x3c1c96(0x262)](_0x31b983=>VERSION_FLAGS['has'](_0x31b983))&&(console[a0_0x3c1c96(0x21c)]('@morphllm/morphmcp\x20'+getPackageVersion()),process[a0_0x3c1c96(0x1e6)](0x0));cliArgs[a0_0x3c1c96(0x262)](_0x3b7840=>HELP_FLAGS[a0_0x3c1c96(0x1f3)](_0x3b7840))&&(printHelp(),process[a0_0x3c1c96(0x1e6)](0x0));function getCliArg(_0x195fbd){const _0x2b2efd=a0_0x3c1c96;for(let _0x857065=0x0;_0x857065<cliArgs[_0x2b2efd(0x1e0)];_0x857065++){const _0x463ea6=cliArgs[_0x857065];if(_0x463ea6[_0x2b2efd(0x2b6)]('--'+_0x195fbd+'='))return _0x463ea6[_0x2b2efd(0x25b)](('--'+_0x195fbd+'=')[_0x2b2efd(0x1e0)]);if(_0x463ea6==='--'+_0x195fbd&&_0x857065+0x1<cliArgs[_0x2b2efd(0x1e0)])return cliArgs[_0x857065+0x1];}return undefined;}const args=[];for(let i=0x0;i<cliArgs[a0_0x3c1c96(0x1e0)];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x3c1c96(0x1f3)](arg)||HELP_FLAGS[a0_0x3c1c96(0x1f3)](arg))continue;if(arg[a0_0x3c1c96(0x2b6)](a0_0x3c1c96(0x291)))continue;if(arg==='--api-key'){i++;continue;}args[a0_0x3c1c96(0x236)](arg);}const WORKSPACE_ROOT=process['env']['WORKSPACE_ROOT']||process[a0_0x3c1c96(0x2a1)][a0_0x3c1c96(0x285)]||process[a0_0x3c1c96(0x2bb)](),ENABLE_WORKSPACE_MODE=process[a0_0x3c1c96(0x2a1)][a0_0x3c1c96(0x217)]!==a0_0x3c1c96(0x201),MORPH_API_KEY=getCliArg(a0_0x3c1c96(0x2a6))??process['env']['MORPH_API_KEY'],MORPH_API_URL=process[a0_0x3c1c96(0x2a1)]['MORPH_API_URL'],MORPH_WARP_GREP_TIMEOUT=process[a0_0x3c1c96(0x2a1)][a0_0x3c1c96(0x205)]?parseInt(process[a0_0x3c1c96(0x2a1)]['MORPH_WARP_GREP_TIMEOUT'],0xa):undefined,OPERATING_SYSTEM_TYPE=getOperatingSystemType(),KNOWN_TOOL_NAMES=new Set(['edit_file','codebase_search','github_codebase_search']),DISABLED_TOOLS=process[a0_0x3c1c96(0x2a1)][a0_0x3c1c96(0x2ac)]?new Set(process[a0_0x3c1c96(0x2a1)][a0_0x3c1c96(0x2ac)]['split'](',')[a0_0x3c1c96(0x293)](_0x3a69fc=>_0x3a69fc['trim']())[a0_0x3c1c96(0x22e)](_0x182980=>_0x182980[a0_0x3c1c96(0x1e0)]>0x0)):new Set();if(DISABLED_TOOLS[a0_0x3c1c96(0x2a3)]>0x0){for(const tool of DISABLED_TOOLS){!KNOWN_TOOL_NAMES[a0_0x3c1c96(0x1f3)](tool)&&console[a0_0x3c1c96(0x27e)](a0_0x3c1c96(0x1d8)+tool+'\x22.\x20Known\x20tools:\x20'+[...KNOWN_TOOL_NAMES][a0_0x3c1c96(0x222)](',\x20'));}console['error'](a0_0x3c1c96(0x2c0)+[...DISABLED_TOOLS][a0_0x3c1c96(0x222)](',\x20'));}MORPH_API_KEY&&!MORPH_API_KEY['startsWith'](a0_0x3c1c96(0x1d0))&&!MORPH_API_KEY[a0_0x3c1c96(0x2b6)](a0_0x3c1c96(0x267))&&logMcpStderr('Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27');async function reportMorphError(_0x4c6752){const _0x4a2de4=a0_0x3c1c96;try{await a0_0x5dc1d2[_0x4a2de4(0x22c)](_0x4a2de4(0x24a),{..._0x4c6752,'timestamp':new Date()[_0x4a2de4(0x1e4)](),'source':_0x4c6752[_0x4a2de4(0x295)]||_0x4a2de4(0x288),'os_type':OPERATING_SYSTEM_TYPE,'context':{'os_type':OPERATING_SYSTEM_TYPE,..._0x4c6752['context']}},{'timeout':0x1388,'headers':{'Content-Type':'application/json','Authorization':_0x4a2de4(0x280)+MORPH_API_KEY}});}catch{}}args[a0_0x3c1c96(0x1e0)]===0x0&&!ENABLE_WORKSPACE_MODE&&(logMcpStderr(a0_0x3c1c96(0x284)),logMcpStderr(a0_0x3c1c96(0x296)),logMcpStderr(a0_0x3c1c96(0x2a2)),logMcpStderr(a0_0x3c1c96(0x221)),logMcpStderr(a0_0x3c1c96(0x208)),logMcpStderr(a0_0x3c1c96(0x25f)));function normalizePath(_0x2866fc){const _0x1d9976=a0_0x3c1c96;return a0_0x488644[_0x1d9976(0x254)](_0x2866fc);}function expandHome(_0x4c85cd){const _0x513435=a0_0x3c1c96;if(_0x4c85cd[_0x513435(0x2b6)]('~/')||_0x4c85cd==='~')return a0_0x488644['join'](a0_0x9d9998[_0x513435(0x2ab)](),_0x4c85cd[_0x513435(0x25b)](0x1));return _0x4c85cd;}let allowedDirectories=await Promise[a0_0x3c1c96(0x230)](args[a0_0x3c1c96(0x293)](async _0x5508f7=>{const _0xc97d4e=a0_0x3c1c96,_0x37fde7=expandHome(_0x5508f7),_0x2ee9a5=a0_0x488644['resolve'](_0x37fde7);try{const _0x4eb75f=await a0_0x2f75b0[_0xc97d4e(0x2c6)](_0x2ee9a5);return normalizePath(_0x4eb75f);}catch(_0x2f09b2){return normalizePath(_0x2ee9a5);}}));function a0_0x12b6(_0x3ba3ca,_0x121204){_0x3ba3ca=_0x3ba3ca-0x1ca;const _0x3a20b0=a0_0x3a20();let _0x12b69d=_0x3a20b0[_0x3ba3ca];return _0x12b69d;}if(ENABLE_WORKSPACE_MODE&&args[a0_0x3c1c96(0x1e0)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories[a0_0x3c1c96(0x236)](workspaceDir),logMcpStderr(a0_0x3c1c96(0x1f1)+workspaceDir+'\x20as\x20allowed\x20directory'));}catch(a0_0x338be5){logMcpStderr(a0_0x3c1c96(0x237)+a0_0x338be5);}async function detectWorkspaceRoot(_0x35b7e9){const _0x3f4f45=a0_0x3c1c96;let _0x3b6cf7=a0_0x488644[_0x3f4f45(0x269)](_0x35b7e9);const _0x6e7034=[_0x3f4f45(0x277),_0x3f4f45(0x1e2),_0x3f4f45(0x2c2),_0x3f4f45(0x29f),_0x3f4f45(0x28c),'go.mod',_0x3f4f45(0x27b),_0x3f4f45(0x264),_0x3f4f45(0x20f)];while(_0x3b6cf7!==a0_0x488644[_0x3f4f45(0x298)](_0x3b6cf7)){for(const _0x316d1 of _0x6e7034){const _0xa6c0ea=a0_0x488644['join'](_0x3b6cf7,_0x316d1);try{return await a0_0x2f75b0[_0x3f4f45(0x245)](_0xa6c0ea),normalizePath(_0x3b6cf7);}catch{}}_0x3b6cf7=a0_0x488644['dirname'](_0x3b6cf7);}return normalizePath(_0x35b7e9);}await Promise[a0_0x3c1c96(0x230)](args[a0_0x3c1c96(0x293)](async _0x548a74=>{const _0x10e7a2=a0_0x3c1c96;try{const _0x3136f6=await a0_0x2f75b0[_0x10e7a2(0x2ad)](expandHome(_0x548a74));!_0x3136f6[_0x10e7a2(0x26a)]()&&(logMcpStderr(_0x10e7a2(0x1d1)+_0x548a74+_0x10e7a2(0x22f)),process[_0x10e7a2(0x1e6)](0x1));}catch(_0x5c168d){logMcpStderr(_0x10e7a2(0x1f8)+_0x548a74+':',_0x5c168d),process[_0x10e7a2(0x1e6)](0x1);}}));async function validatePath(_0x499f18){const _0x436ca7=a0_0x3c1c96,_0x376166=expandHome(_0x499f18),_0xc39112=a0_0x488644[_0x436ca7(0x269)](_0x376166);try{const _0xcd7369=await a0_0x2f75b0[_0x436ca7(0x2c6)](_0xc39112);return _0xcd7369;}catch(_0x3b6084){if(_0x3b6084['code']===_0x436ca7(0x270)){const _0x47af4d=a0_0x488644[_0x436ca7(0x298)](_0xc39112);try{const _0x60e339=await a0_0x2f75b0['realpath'](_0x47af4d);return a0_0x488644['join'](_0x60e339,a0_0x488644[_0x436ca7(0x282)](_0xc39112));}catch{throw new Error(_0x436ca7(0x265)+_0x47af4d);}}throw _0x3b6084;}}const MorphEditFileArgsSchema=z[a0_0x3c1c96(0x1f6)]({'path':z[a0_0x3c1c96(0x255)](),'code_edit':z[a0_0x3c1c96(0x255)]()[a0_0x3c1c96(0x200)](a0_0x3c1c96(0x266)),'instruction':z['string']()[a0_0x3c1c96(0x200)](a0_0x3c1c96(0x232)),'dryRun':z[a0_0x3c1c96(0x28e)]()[a0_0x3c1c96(0x23b)](![])['describe'](a0_0x3c1c96(0x26c))}),CODEBASE_SEARCH_QUERY_DESCRIPTION='Natural-language\x20question/description\x20about\x20the\x20code\x20you\x20want\x20to\x20understand.\x20Good\x20example:\x20\x22Where\x20does\x20auth\x20get\x20handled,\x20what\x20are\x20the\x20different\x20oauth\x20methods\x20supported?\x22,\x20\x22Trace\x20all\x20code\x20that\x20relates\x20to\x20how\x20data\x20is\x20injested\x20and\x20processed\x22.\x20Bad\x20example:\x20\x22auth()\x22,\x20\x22auth\x20login\x20dashoard\x20google\x20email\x22.\x20This\x20tool\x20does\x20NOT\x20accept\x20regex,\x20keyword\x20dumps,\x20or\x20symbol-only\x20queries.',WarpGrepArgsSchema=z['object']({'search_string':z['string']()[a0_0x3c1c96(0x200)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repo_path':z[a0_0x3c1c96(0x255)]()[a0_0x3c1c96(0x200)]('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'),'search_type':z[a0_0x3c1c96(0x1e1)](['default',a0_0x3c1c96(0x216)])[a0_0x3c1c96(0x2c1)]()[a0_0x3c1c96(0x200)](a0_0x3c1c96(0x25d))}),WarpGrepGitHubArgsSchema=z[a0_0x3c1c96(0x1f6)]({'search_string':z[a0_0x3c1c96(0x255)]()[a0_0x3c1c96(0x200)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'github_url':z['string']()['optional']()['describe'](a0_0x3c1c96(0x20e)),'owner_repo':z[a0_0x3c1c96(0x255)]()['optional']()['describe']('Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.'),'branch':z[a0_0x3c1c96(0x255)]()['optional']()['describe'](a0_0x3c1c96(0x2b1))}),CodebaseSearchArgsSchema=z[a0_0x3c1c96(0x1f6)]({'query':z[a0_0x3c1c96(0x255)]()['describe'](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repoId':z[a0_0x3c1c96(0x255)]()[a0_0x3c1c96(0x200)]('Repository\x20identifier'),'branch':z[a0_0x3c1c96(0x255)]()[a0_0x3c1c96(0x2c1)]()[a0_0x3c1c96(0x200)]('Branch\x20to\x20search\x20(uses\x20latest\x20commit)'),'commitHash':z['string']()[a0_0x3c1c96(0x2c1)]()[a0_0x3c1c96(0x200)](a0_0x3c1c96(0x1d9)),'targetDirectories':z['array'](z[a0_0x3c1c96(0x255)]())[a0_0x3c1c96(0x23b)]([])[a0_0x3c1c96(0x200)]('Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all'),'limit':z[a0_0x3c1c96(0x274)]()[a0_0x3c1c96(0x2c1)]()[a0_0x3c1c96(0x23b)](0xa)[a0_0x3c1c96(0x200)]('Max\x20results\x20to\x20return')}),server=new Server({'name':a0_0x3c1c96(0x1cc),'version':a0_0x3c1c96(0x23e)},{'capabilities':{'tools':{}}});server['setRequestHandler'](ListToolsRequestSchema,async()=>{const _0x33bd49=a0_0x3c1c96,_0x43a273=[{'name':_0x33bd49(0x287),'description':_0x33bd49(0x215)+_0x33bd49(0x244)+_0x33bd49(0x1d5)+_0x33bd49(0x26e)+_0x33bd49(0x21e)+_0x33bd49(0x28b)+_0x33bd49(0x1de)+_0x33bd49(0x228)+'-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a'+_0x33bd49(0x23a)+_0x33bd49(0x1e7)+_0x33bd49(0x1f5)+_0x33bd49(0x1ee)+_0x33bd49(0x1dc)+'-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a'+'Rules:\x0a'+'-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a'+_0x33bd49(0x220)+_0x33bd49(0x24e)+'-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a'+_0x33bd49(0x235)+_0x33bd49(0x1e5)+_0x33bd49(0x202),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x33bd49(0x1d4),'description':_0x33bd49(0x26f)+CODEBASE_SEARCH_QUERY_DESCRIPTION+'\x20'+'Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20toolin\x20its\x20search.\x20'+'You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.\x20'+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]}],_0xf5cbe7=_0x43a273[_0x33bd49(0x22e)](_0x54a113=>{const _0x3e240d=_0x33bd49;if(DISABLED_TOOLS[_0x3e240d(0x1f3)](_0x54a113[_0x3e240d(0x260)]))return console[_0x3e240d(0x27e)]('Tool\x20'+_0x54a113[_0x3e240d(0x260)]+_0x3e240d(0x24f)),![];if(_0x3e240d(0x2a9)in _0x54a113&&_0x54a113[_0x3e240d(0x2a9)]&&!MORPH_API_KEY)return logMcpStderr('Warning:\x20'+_0x54a113['name']+_0x3e240d(0x261)),![];return!![];});return{'tools':_0xf5cbe7[_0x33bd49(0x293)](_0x3faa4d=>({'name':_0x3faa4d[_0x33bd49(0x260)],'description':_0x3faa4d['description'],'inputSchema':_0x3faa4d['inputSchema']}))};}),server[a0_0x3c1c96(0x21d)](CallToolRequestSchema,async _0x1818e4=>{const _0x4640db=a0_0x3c1c96,{name:_0x3d9370,arguments:_0x1555b4}=_0x1818e4[_0x4640db(0x1d7)];try{if(DISABLED_TOOLS[_0x4640db(0x1f3)](_0x3d9370))throw new Error(_0x4640db(0x2a5)+_0x3d9370+_0x4640db(0x243));switch(_0x3d9370){case'edit_file':{const _0xd0ea4f=MorphEditFileArgsSchema[_0x4640db(0x219)](_0x1555b4);if(!_0xd0ea4f['success'])throw new Error(_0x4640db(0x2af)+_0xd0ea4f['error']);const _0x1b334f=await validatePath(_0xd0ea4f['data'][_0x4640db(0x1fc)]);let _0x54339f=null,_0x5bccbf=!![],_0x40b66e=null;try{_0x54339f=await a0_0x2f75b0[_0x4640db(0x2c3)](_0x1b334f,_0x4640db(0x1df));}catch(_0x325493){const _0x3b59c5=_0x325493[_0x4640db(0x1fb)];_0x3b59c5===_0x4640db(0x270)?(_0x5bccbf=![],_0x54339f=''):(_0x40b66e=_0x4640db(0x1da)+(_0x3b59c5||'unknown')+_0x4640db(0x1d3)+(_0x325493 instanceof Error?_0x325493[_0x4640db(0x226)]:String(_0x325493)),logMcpStderr('Warning:\x20'+_0x40b66e));}let _0x2767aa;try{const _0x2aa3e7=MORPH_API_KEY;if(!_0x2aa3e7)throw new Error(_0x4640db(0x1e3));const _0x2c144c=a0_0x488644['dirname'](_0x1b334f),_0x1cbf94=a0_0x488644[_0x4640db(0x282)](_0x1b334f),_0x52b737=await executeEditFile({'target_filepath':_0x1cbf94,'code_edit':_0xd0ea4f['data']['code_edit'],'instructions':_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x25a)]},{'morphApiKey':_0x2aa3e7,'morphApiUrl':MORPH_API_URL,'baseDir':_0x2c144c,'autoWrite':!_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x1cb)],'generateUdiff':![],'debug':![]});_0x2767aa=_0x52b737['completionId'];if(!_0x52b737[_0x4640db(0x239)])throw new Error(_0x52b737[_0x4640db(0x27e)]||'Morph\x20FastApply\x20failed\x20without\x20error\x20message');const _0x42d3de=_0x52b737[_0x4640db(0x21b)],_0x10708a=_0x4640db(0x1f7)+_0x42d3de[_0x4640db(0x26b)]+_0x4640db(0x234)+_0x42d3de['linesRemoved']+',\x20modified\x20'+_0x42d3de['linesModified'];if(_0xd0ea4f['data'][_0x4640db(0x1cb)])return{'content':[{'type':_0x4640db(0x292),'text':'Morph\x20Edit\x20Preview'+(_0x5bccbf?'':_0x4640db(0x1ea))+':\x20'+_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x25a)]+_0x4640db(0x27f)+_0x10708a+'.\x20Path:\x20'+_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x1fc)]+'.'}]};return{'content':[{'type':_0x4640db(0x292),'text':_0x4640db(0x29e)+(_0x5bccbf?_0x4640db(0x2b3):_0x4640db(0x1fa))+':\x20'+_0xd0ea4f[_0x4640db(0x290)]['instruction']+_0x4640db(0x27f)+_0x10708a+'.\x20Path:\x20'+_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x1fc)]+'.'}]};}catch(_0x4773ab){const _0x3002f4=_0x4773ab instanceof Error?_0x4773ab['message']:String(_0x4773ab);return reportMorphError({'error_message':_0x3002f4,'error_type':_0x4773ab instanceof Error?_0x4773ab['constructor'][_0x4640db(0x260)]:_0x4640db(0x204),'context':{'tool':'edit_file','completion_id':_0x2767aa,'file_path':_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x1fc)],'validated_path':_0x1b334f,'instruction':_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x25a)],'model':_0x4640db(0x213),'dry_run':_0xd0ea4f[_0x4640db(0x290)][_0x4640db(0x1cb)],'file_exists':_0x5bccbf,'file_read_error':_0x40b66e,'file_readable':_0x54339f!==null,'request_content':{'path':_0xd0ea4f['data']['path'],'code_edit':_0xd0ea4f[_0x4640db(0x290)]['code_edit'],'instruction':_0xd0ea4f['data'][_0x4640db(0x25a)],'original_code':_0x54339f!==null?_0x54339f[_0x4640db(0x1e0)]>0xc350?_0x54339f[_0x4640db(0x240)](0x0,0xc350)+'\x0a...\x20(truncated,\x20total:\x20'+_0x54339f[_0x4640db(0x1e0)]+_0x4640db(0x210):_0x54339f:'[could\x20not\x20read\x20file:\x20'+(_0x40b66e||'unknown\x20error')+']','original_code_length':_0x54339f?.[_0x4640db(0x1e0)]??0x0,'model':_0x4640db(0x213),'dry_run':_0xd0ea4f['data'][_0x4640db(0x1cb)]}},'stack_trace':_0x4773ab instanceof Error?_0x4773ab[_0x4640db(0x29c)]:undefined,'source':'mcp-filesystem'})[_0x4640db(0x29d)](()=>{}),{'content':[{'type':'text','text':_0x4640db(0x25c)+_0x3002f4}],'isError':!![]};}}case _0x4640db(0x1d4):{const _0x2d6b94=WarpGrepArgsSchema[_0x4640db(0x219)](_0x1555b4);if(!_0x2d6b94['success'])return{'content':[{'type':_0x4640db(0x292),'text':_0x4640db(0x252)+_0x2d6b94['error']}],'isError':!![]};const _0x55f3f4=_0x1a733f=>{const _0xdfff2d=_0x4640db,_0x5b2a26=[];for(const _0x2002e6 of _0x1a733f||[]){const _0x5ab7dc=_0x2002e6[_0xdfff2d(0x231)],_0x4b959e=_0x2002e6[_0xdfff2d(0x1d6)];if(_0x5ab7dc===_0xdfff2d(0x1f9)&&_0x4b959e){const _0x27fb5f=_0x4b959e[_0xdfff2d(0x227)]('\x0a')[_0xdfff2d(0x22e)](_0x17702f=>_0x17702f[_0xdfff2d(0x229)]());for(const _0x41978e of _0x27fb5f){const _0xb4aeca=_0x41978e[_0xdfff2d(0x1f2)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0xb4aeca){_0x5b2a26['push']('grep\x20\x27'+_0xb4aeca[0x1]+'\x27\x20'+_0xb4aeca[0x2]);continue;}const _0x475348=_0x41978e[_0xdfff2d(0x1f2)](/^read\s+(.+)$/);if(_0x475348){_0x5b2a26[_0xdfff2d(0x236)]('read\x20'+_0x475348[0x1]);continue;}const _0x23e2bc=_0x41978e[_0xdfff2d(0x1f2)](/^list_directory\s+(.+)$/);if(_0x23e2bc){_0x5b2a26[_0xdfff2d(0x236)]('list_directory\x20'+_0x23e2bc[0x1]);continue;}}}}return _0x5b2a26;},_0x3f3967=_0x6aaf17=>{const _0x44ff35=_0x4640db,_0x1de50b=[];if(!_0x6aaf17||!Array[_0x44ff35(0x27c)](_0x6aaf17))return _0x1de50b;const _0x5b701d=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':'FileNotFound','tool':_0x44ff35(0x251)},{'pattern':/\[PATH ERROR\]/,'error_type':'PathError','tool':'read'},{'pattern':/\[READ ERROR\]/,'error_type':_0x44ff35(0x2c4),'tool':'read'},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0x44ff35(0x289),'tool':_0x44ff35(0x251)},{'pattern':/\[RIPGREP ERROR\]/,'error_type':_0x44ff35(0x238),'tool':_0x44ff35(0x2be)},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':'RipgrepNotAvailable','tool':_0x44ff35(0x2be)},{'pattern':/\[BINARY FILE\]/,'error_type':_0x44ff35(0x289),'tool':_0x44ff35(0x251)},{'pattern':/\[SYMLINK\]/,'error_type':_0x44ff35(0x1ca),'tool':_0x44ff35(0x251)},{'pattern':/not a text file/,'error_type':_0x44ff35(0x289),'tool':_0x44ff35(0x251)},{'pattern':/symbolic link/,'error_type':_0x44ff35(0x1ca),'tool':_0x44ff35(0x251)},{'pattern':/Error reading file:/,'error_type':_0x44ff35(0x2c4),'tool':_0x44ff35(0x251)},{'pattern':/status="error"/,'error_type':_0x44ff35(0x263),'tool':'unknown'}];let _0x376e19=0x0;for(const _0x5f5ded of _0x6aaf17){if(_0x5f5ded[_0x44ff35(0x231)]===_0x44ff35(0x22d)){_0x376e19++;const _0x1a23f8=_0x5f5ded['content'];if(!_0x1a23f8||typeof _0x1a23f8!==_0x44ff35(0x255))continue;for(const {pattern:_0x7429f6,error_type:_0x2172f7,tool:_0x19b869}of _0x5b701d){const _0x4a0ae6=_0x1a23f8[_0x44ff35(0x1f2)](new RegExp(_0x7429f6[_0x44ff35(0x295)],'g'));if(_0x4a0ae6)for(const _0x1a775 of _0x4a0ae6){const _0x21c9a2=_0x1a23f8[_0x44ff35(0x276)](_0x1a775),_0xb5c50a=_0x1a23f8[_0x44ff35(0x240)](_0x21c9a2,Math[_0x44ff35(0x2c5)](_0x21c9a2+0xc8,_0x1a23f8['length']));_0x1de50b['push']({'tool':_0x19b869,'error_type':_0x2172f7,'error_message':_0xb5c50a[_0x44ff35(0x227)]('\x0a')[0x0],'turn':_0x376e19});}}}}return _0x1de50b;};try{const _0x3c6e14=a0_0x488644[_0x4640db(0x269)](_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x268)]),_0x2708c7=_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x29b)],_0x2dea27=_0x2708c7===_0x4640db(0x216)?{'allowNames':[_0x4640db(0x216)]}:undefined,_0x18e052=new LocalRipgrepProvider(_0x3c6e14,undefined,_0x2dea27),_0x232017=await runWarpGrep({'searchTerm':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x218)],'repoRoot':_0x3c6e14,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x18e052,'search_type':_0x2708c7}),_0x4acc0f=_0x3f3967(_0x232017[_0x4640db(0x22b)]);_0x4acc0f[_0x4640db(0x1e0)]>0x0&&reportMorphError({'error_message':_0x4640db(0x297)+_0x4acc0f[_0x4640db(0x1e0)]+'\x20error(s)','error_type':_0x4640db(0x2b0),'level':_0x4640db(0x20a),'tool':_0x4640db(0x1d4),'context':{'repo_path':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x268)],'query':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x218)],'model':'morph-warp-grep-v1-1111v0','termination_reason':_0x232017[_0x4640db(0x207)],'sub_tool_errors':_0x4acc0f,'timings':_0x232017[_0x4640db(0x283)],'tool_calls':_0x55f3f4(_0x232017[_0x4640db(0x22b)]),'messages':_0x232017['messages']?.[_0x4640db(0x293)](_0x3af395=>({'role':_0x3af395[_0x4640db(0x231)],'content':_0x3af395[_0x4640db(0x1d6)]}))},'source':_0x4640db(0x288)})[_0x4640db(0x29d)](()=>{});let _0x2e7fe1='';if(_0x232017['terminationReason']===_0x4640db(0x2a4)&&_0x232017['finish']?.[_0x4640db(0x2b2)]?.[_0x4640db(0x242)]){const _0x20ca64=_0x232017['finish']['metadata']['files'];if(_0x20ca64[_0x4640db(0x1e0)]===0x0)return _0x2e7fe1=_0x232017['finish']['payload']||_0x4640db(0x203),{'content':[{'type':'text','text':_0x2e7fe1}]};const _0x3c5b3c=[],_0x53df20=[_0x4640db(0x1e9)];for(const _0x388d75 of _0x232017[_0x4640db(0x22b)]){const _0x48d1d0=_0x388d75[_0x4640db(0x231)],_0x1e6464=_0x388d75[_0x4640db(0x1d6)];if(_0x48d1d0===_0x4640db(0x1f9)&&_0x1e6464){const _0x3357d9=_0x1e6464[_0x4640db(0x227)]('\x0a')[_0x4640db(0x22e)](_0x154e7d=>_0x154e7d[_0x4640db(0x229)]());for(const _0x15c650 of _0x3357d9){const _0x26fed4=_0x15c650[_0x4640db(0x1f2)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x26fed4){_0x53df20[_0x4640db(0x236)]('-\x20Grepped\x20\x27'+_0x26fed4[0x1]+_0x4640db(0x1ef)+_0x26fed4[0x2]+'`');continue;}const _0x5612b9=_0x15c650[_0x4640db(0x1f2)](/^read\s+(.+)$/);if(_0x5612b9){_0x53df20[_0x4640db(0x236)](_0x4640db(0x223)+_0x5612b9[0x1]+'`');continue;}const _0x34f551=_0x15c650[_0x4640db(0x1f2)](/^list_directory\s+(.+)$/);if(_0x34f551){_0x53df20[_0x4640db(0x236)](_0x4640db(0x25e)+_0x34f551[0x1]+'`');continue;}}}}_0x3c5b3c[_0x4640db(0x236)](_0x53df20[_0x4640db(0x222)]('\x0a'));const _0x2b8b95=['','Relevant\x20context\x20found:'];for(const _0x1ea5ce of _0x20ca64){if(_0x1ea5ce[_0x4640db(0x27d)]==='*')_0x2b8b95[_0x4640db(0x236)]('-\x20'+_0x1ea5ce[_0x4640db(0x1fc)]+':*');else{if(Array[_0x4640db(0x27c)](_0x1ea5ce[_0x4640db(0x27d)])){const _0x372b42=_0x1ea5ce['lines']['map'](([_0x1cbf96,_0x545d16])=>{if(_0x1cbf96===_0x545d16)return''+_0x1cbf96;return _0x1cbf96+'-'+_0x545d16;});_0x2b8b95[_0x4640db(0x236)]('-\x20'+_0x1ea5ce[_0x4640db(0x1fc)]+':'+_0x372b42[_0x4640db(0x222)](','));}else _0x2b8b95[_0x4640db(0x236)]('-\x20'+_0x1ea5ce[_0x4640db(0x1fc)]+':*');}}_0x2b8b95['push'](''),_0x3c5b3c[_0x4640db(0x236)](_0x2b8b95[_0x4640db(0x222)]('\x0a')),_0x3c5b3c[_0x4640db(0x236)](_0x4640db(0x2b4));const _0x1cc813=[];for(const _0x583717 of _0x20ca64){let _0x36e2ab=a0_0x488644[_0x4640db(0x269)](_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x268)],_0x583717[_0x4640db(0x1fc)]),_0x396d5a=null,_0x3de687=null;try{_0x396d5a=await a0_0x2f75b0['readFile'](_0x36e2ab,{'encoding':'utf-8'});}catch(_0x2b8afd){const _0x3496ea=fixPathRepetition(_0x36e2ab);if(_0x3496ea)try{_0x396d5a=await a0_0x2f75b0[_0x4640db(0x2c3)](_0x3496ea,{'encoding':_0x4640db(0x1df)}),_0x36e2ab=_0x3496ea;}catch{_0x3de687=_0x2b8afd instanceof Error?_0x2b8afd:new Error(String(_0x2b8afd));}else _0x3de687=_0x2b8afd instanceof Error?_0x2b8afd:new Error(String(_0x2b8afd));}if(_0x396d5a!==null){const _0x1093b8=_0x396d5a[_0x4640db(0x227)](/\r?\n/),_0x539206=[_0x4640db(0x1db)+_0x583717[_0x4640db(0x1fc)]+'\x22>'];if(_0x583717['lines']==='*'||!Array[_0x4640db(0x27c)](_0x583717['lines']))for(let _0x5c8925=0x1;_0x5c8925<=_0x1093b8[_0x4640db(0x1e0)];_0x5c8925++){const _0x18c8fe=_0x1093b8[_0x5c8925-0x1];_0x539206[_0x4640db(0x236)](_0x5c8925+'|\x20'+_0x18c8fe);}else for(const [_0x3bb5c3,_0x274ed7]of _0x583717[_0x4640db(0x27d)]){_0x539206['length']>0x1&&_0x539206[_0x4640db(0x236)]('');for(let _0x117659=_0x3bb5c3;_0x117659<=_0x274ed7&&_0x117659<=_0x1093b8['length'];_0x117659++){const _0x4fe8c0=_0x1093b8[_0x117659-0x1];_0x539206[_0x4640db(0x236)](_0x117659+'|\x20'+_0x4fe8c0);}}_0x539206['push'](_0x4640db(0x1f0)),_0x1cc813[_0x4640db(0x236)](_0x539206['join']('\x0a'));}else _0x1cc813[_0x4640db(0x236)]('<file\x20path=\x22'+_0x583717[_0x4640db(0x1fc)]+_0x4640db(0x27a)+(_0x3de687?.[_0x4640db(0x226)]||_0x4640db(0x259))+_0x4640db(0x23f));}_0x3c5b3c['push'](_0x1cc813[_0x4640db(0x222)]('\x0a\x0a')),_0x2e7fe1=_0x3c5b3c[_0x4640db(0x222)]('\x0a');const _0x422eae=_0x232017['errors']?.[_0x4640db(0x22e)](_0x4d9cff=>_0x4d9cff['message']?.[_0x4640db(0x2b6)](_0x4640db(0x24c)))||[];if(_0x422eae[_0x4640db(0x1e0)]>0x0){const _0x2c7749=_0x422eae[_0x4640db(0x293)](_0x1dff67=>_0x1dff67[_0x4640db(0x226)])['join'](';\x20');reportMorphError({'error_message':_0x2c7749,'error_type':'FileReadError','context':{'tool':_0x4640db(0x1d4),'repo_path':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x268)],'query':_0x2d6b94[_0x4640db(0x290)]['search_string'],'model':_0x4640db(0x23d),'termination_reason':_0x4640db(0x2b8),'error_count':_0x422eae['length'],'is_timeout':![],'timings':_0x232017[_0x4640db(0x283)],'files_attempted':_0x20ca64[_0x4640db(0x293)](_0x28b630=>({'path':_0x28b630[_0x4640db(0x1fc)],'lines':_0x28b630[_0x4640db(0x27d)]})),'tool_calls':_0x55f3f4(_0x232017[_0x4640db(0x22b)]),'messages':_0x232017['messages']?.[_0x4640db(0x293)](_0x3cafc6=>({'role':_0x3cafc6['role'],'content':_0x3cafc6[_0x4640db(0x1d6)]})),'request_content':{'query':_0x2d6b94[_0x4640db(0x290)]['search_string'],'repo_path':_0x2d6b94['data'][_0x4640db(0x268)],'repoRoot':a0_0x488644['resolve'](_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x268)]),'model':_0x4640db(0x23d)}},'source':_0x4640db(0x288)})[_0x4640db(0x29d)](()=>{});}}else{if(_0x232017[_0x4640db(0x207)]===_0x4640db(0x211)&&_0x232017['errors'][_0x4640db(0x1e0)]>0x0){const _0x3b2100=_0x232017[_0x4640db(0x248)][_0x4640db(0x293)](_0x506bf1=>_0x506bf1[_0x4640db(0x226)])[_0x4640db(0x222)](';\x20');_0x2e7fe1=_0x4640db(0x1d1)+_0x3b2100;const _0x11bbef=_0x3b2100['toLowerCase']()[_0x4640db(0x206)]('timeout')||_0x3b2100[_0x4640db(0x24b)]()[_0x4640db(0x206)](_0x4640db(0x224))||_0x3b2100[_0x4640db(0x24b)]()[_0x4640db(0x206)](_0x4640db(0x209)),_0x38ba91=_0x232017[_0x4640db(0x1eb)]?.['metadata']?.['files'],_0x88f0e3=_0x232017['errors'][0x0];reportMorphError({'error_message':_0x3b2100,'error_type':_0x11bbef?'TimeoutError':_0x88f0e3?.[_0x4640db(0x28a)]?.[_0x4640db(0x260)]||'WarpGrepError','context':{'tool':_0x4640db(0x1d4),'repo_path':_0x2d6b94[_0x4640db(0x290)]['repo_path'],'query':_0x2d6b94['data']['search_string'],'model':_0x4640db(0x23d),'termination_reason':_0x232017['terminationReason'],'error_count':_0x232017[_0x4640db(0x248)][_0x4640db(0x1e0)],'is_timeout':_0x11bbef,'timings':_0x232017[_0x4640db(0x283)],'files_attempted':_0x38ba91?.['map'](_0x253691=>({'path':_0x253691[_0x4640db(0x1fc)],'lines':_0x253691[_0x4640db(0x27d)]})),'tool_calls':_0x55f3f4(_0x232017[_0x4640db(0x22b)]),'messages':_0x232017['messages']?.[_0x4640db(0x293)](_0x6aaa3c=>({'role':_0x6aaa3c[_0x4640db(0x231)],'content':_0x6aaa3c['content']})),'request_content':{'query':_0x2d6b94['data']['search_string'],'repo_path':_0x2d6b94['data'][_0x4640db(0x268)],'repoRoot':a0_0x488644[_0x4640db(0x269)](_0x2d6b94[_0x4640db(0x290)]['repo_path']),'model':_0x4640db(0x23d)}},'stack_trace':_0x88f0e3?.[_0x4640db(0x29c)]||undefined,'source':_0x4640db(0x288)})['catch'](()=>{});}else _0x2e7fe1=_0x4640db(0x24d);}return{'content':[{'type':'text','text':_0x2e7fe1}]};}catch(_0x519dc2){const _0x503193=_0x519dc2 instanceof Error?_0x519dc2[_0x4640db(0x226)]:String(_0x519dc2),_0x8b09e2=_0x503193[_0x4640db(0x24b)]()['includes'](_0x4640db(0x1d2))||_0x503193['toLowerCase']()[_0x4640db(0x206)](_0x4640db(0x224))||_0x503193[_0x4640db(0x24b)]()[_0x4640db(0x206)](_0x4640db(0x209))||_0x519dc2 instanceof Error&&_0x519dc2[_0x4640db(0x260)]===_0x4640db(0x214);return reportMorphError({'error_message':_0x503193,'error_type':_0x8b09e2?_0x4640db(0x214):_0x519dc2 instanceof Error?_0x519dc2['constructor'][_0x4640db(0x260)]:_0x4640db(0x204),'context':{'tool':'codebase_search','repo_path':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x268)],'query':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x218)],'model':_0x4640db(0x23d),'is_timeout':_0x8b09e2,'exception_phase':_0x4640db(0x1f4),'request_content':{'query':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x218)],'repo_path':_0x2d6b94[_0x4640db(0x290)][_0x4640db(0x268)],'repoRoot':a0_0x488644[_0x4640db(0x269)](_0x2d6b94['data'][_0x4640db(0x268)]),'model':'morph-warp-grep-v1-1111v0'}},'stack_trace':_0x519dc2 instanceof Error?_0x519dc2[_0x4640db(0x29c)]:undefined,'source':_0x4640db(0x288)})[_0x4640db(0x29d)](()=>{}),{'content':[{'type':_0x4640db(0x292),'text':_0x4640db(0x1dd)+_0x503193}],'isError':![]};}}case _0x4640db(0x257):{const _0x5988e9=WarpGrepGitHubArgsSchema[_0x4640db(0x219)](_0x1555b4);if(!_0x5988e9[_0x4640db(0x239)])return{'content':[{'type':_0x4640db(0x292),'text':'Invalid\x20arguments:\x20'+_0x5988e9[_0x4640db(0x27e)]}],'isError':!![]};const _0x3c8500=_0x5988e9[_0x4640db(0x290)][_0x4640db(0x2a0)]||_0x5988e9[_0x4640db(0x290)][_0x4640db(0x279)];if(!_0x3c8500)return{'content':[{'type':'text','text':'Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id'}],'isError':!![]};const _0x5b335b=MORPH_API_KEY;if(!_0x5b335b)throw new Error(_0x4640db(0x1e3));const _0x4f9afd=Date[_0x4640db(0x272)]();logMcpStderr(_0x4640db(0x2b9)+_0x3c8500+_0x4640db(0x2ba)+_0x5988e9['data'][_0x4640db(0x218)]+'\x22');try{const _0x153000=new WarpGrepClient({'morphApiKey':_0x5b335b,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x36eb7c=await _0x153000[_0x4640db(0x1ff)]({'searchTerm':_0x5988e9['data'][_0x4640db(0x218)],'github':_0x3c8500,'branch':_0x5988e9[_0x4640db(0x290)][_0x4640db(0x281)]}),_0x19344e=Date['now']()-_0x4f9afd;logMcpStderr(_0x4640db(0x21a)+_0x19344e+'ms.\x20Success:\x20'+_0x36eb7c[_0x4640db(0x239)]);const _0xd9c5af=formatResult(_0x36eb7c);return{'content':[{'type':_0x4640db(0x292),'text':_0xd9c5af}]};}catch(_0x21d5cd){const _0x16130a=Date[_0x4640db(0x272)]()-_0x4f9afd,_0x10a730=_0x21d5cd instanceof Error?_0x21d5cd[_0x4640db(0x226)]:String(_0x21d5cd);return logMcpStderr(_0x4640db(0x1ec)+_0x16130a+_0x4640db(0x22a),_0x10a730),reportMorphError({'error_message':_0x10a730,'error_type':_0x21d5cd instanceof Error?_0x21d5cd[_0x4640db(0x28a)][_0x4640db(0x260)]:_0x4640db(0x204),'context':{'tool':_0x4640db(0x257),'github_url':_0x3c8500,'search_string':_0x5988e9['data'][_0x4640db(0x218)],'branch':_0x5988e9[_0x4640db(0x290)][_0x4640db(0x281)]},'stack_trace':_0x21d5cd instanceof Error?_0x21d5cd[_0x4640db(0x29c)]:undefined,'source':_0x4640db(0x288),'tool':_0x4640db(0x257),'latency_ms':_0x16130a})['catch'](()=>{}),{'content':[{'type':'text','text':'GitHub\x20search\x20failed:\x20'+_0x10a730}],'isError':![]};}}default:throw new Error(_0x4640db(0x23c)+_0x3d9370);}}catch(_0x4e5fc1){const _0x32f111=_0x4e5fc1 instanceof Error?_0x4e5fc1['message']:String(_0x4e5fc1);return reportMorphError({'error_message':_0x32f111,'error_type':_0x4e5fc1 instanceof Error?_0x4e5fc1[_0x4640db(0x28a)][_0x4640db(0x260)]:_0x4640db(0x204),'context':{'tool':_0x3d9370,'arguments':_0x1555b4?JSON[_0x4640db(0x275)](_0x1555b4)[_0x4640db(0x240)](0x0,0x1f4):undefined,'mcp_server_version':_0x4640db(0x23e)},'stack_trace':_0x4e5fc1 instanceof Error?_0x4e5fc1[_0x4640db(0x29c)]:undefined,'source':_0x4640db(0x288)})[_0x4640db(0x29d)](()=>{}),{'content':[{'type':_0x4640db(0x292),'text':_0x4640db(0x1d1)+_0x32f111}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x3fbd88){const _0x4de2cc=a0_0x3c1c96,_0x4ebcb2=await getValidRootDirectories(_0x3fbd88);if(_0x4ebcb2[_0x4de2cc(0x1e0)]>0x0)allowedDirectories=[..._0x4ebcb2],logMcpStderr(_0x4de2cc(0x2bf)+_0x4ebcb2[_0x4de2cc(0x1e0)]+_0x4de2cc(0x21f));else{logMcpStderr(_0x4de2cc(0x1fe));if(ENABLE_WORKSPACE_MODE)try{const _0x4b242b=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x4b242b&&(allowedDirectories=[_0x4b242b],logMcpStderr('Fallback:\x20Using\x20workspace\x20root\x20'+_0x4b242b));}catch(_0x1d7fc5){logMcpStderr(_0x4de2cc(0x273)+_0x1d7fc5);}}}server[a0_0x3c1c96(0x253)](RootsListChangedNotificationSchema,async()=>{const _0x404f44=a0_0x3c1c96;try{const _0xc2ba25=await server[_0x404f44(0x20d)]();_0xc2ba25&&_0x404f44(0x2b7)in _0xc2ba25&&await updateAllowedDirectoriesFromRoots(_0xc2ba25['roots']);}catch(_0xdfbf42){logMcpStderr('Failed\x20to\x20request\x20roots\x20from\x20client:',_0xdfbf42 instanceof Error?_0xdfbf42[_0x404f44(0x226)]:String(_0xdfbf42));}}),server[a0_0x3c1c96(0x247)]=async()=>{const _0x3b7a93=a0_0x3c1c96,_0x4a7bf4=server[_0x3b7a93(0x1cd)]();if(_0x4a7bf4?.[_0x3b7a93(0x2b7)])try{const _0x226cbb=await server[_0x3b7a93(0x20d)]();_0x226cbb&&'roots'in _0x226cbb?await updateAllowedDirectoriesFromRoots(_0x226cbb[_0x3b7a93(0x2b7)]):logMcpStderr(_0x3b7a93(0x256));}catch(_0x17d971){logMcpStderr(_0x3b7a93(0x1cf),_0x17d971 instanceof Error?_0x17d971[_0x3b7a93(0x226)]:String(_0x17d971));}else{if(allowedDirectories[_0x3b7a93(0x1e0)]>0x0)logMcpStderr('Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:',allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)logMcpStderr(_0x3b7a93(0x2a8));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 _0x243259=a0_0x3c1c96,_0x437b52=new StdioServerTransport();await server[_0x243259(0x212)](_0x437b52),logMcpStderr(_0x243259(0x294)),allowedDirectories[_0x243259(0x1e0)]===0x0&&logMcpStderr('Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol');}runServer()['catch'](_0x53cb6f=>{const _0x15c46d=a0_0x3c1c96;logMcpStderr(_0x15c46d(0x1e8),_0x53cb6f),process[_0x15c46d(0x1e6)](0x1);});
|
package/dist/log-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a1_0x54c5(_0x1cb46f,_0x185fd8){_0x1cb46f=_0x1cb46f-0x64;var _0x564501=a1_0x5645();var _0x54c509=_0x564501[_0x1cb46f];return _0x54c509;}var a1_0x3b44f3=a1_0x54c5;(function(_0x419123,_0x170292){var _0x55d2df=a1_0x54c5,_0xb20f09=_0x419123();while(!![]){try{var _0x5f0be9=parseInt(_0x55d2df(0x75))/0x1*(parseInt(_0x55d2df(0x67))/0x2)+parseInt(_0x55d2df(0x68))/0x3*(-parseInt(_0x55d2df(0x6e))/0x4)+-parseInt(_0x55d2df(0x64))/0x5+parseInt(_0x55d2df(0x71))/0x6*(-parseInt(_0x55d2df(0x6b))/0x7)+-parseInt(_0x55d2df(0x6d))/0x8+-parseInt(_0x55d2df(0x77))/0x9*(parseInt(_0x55d2df(0x73))/0xa)+-parseInt(_0x55d2df(0x65))/0xb*(-parseInt(_0x55d2df(0x76))/0xc);if(_0x5f0be9===_0x170292)break;else _0xb20f09['push'](_0xb20f09['shift']());}catch(_0x4eaffd){_0xb20f09['push'](_0xb20f09['shift']());}}}(a1_0x5645,0x43292));function a1_0x5645(){var _0x1e8f3c=['linux','[os=','1750IbYzir','Unknown','3427416tzQiSV','50276gvSeoA','Windows','macOS','3246oSsHlE','error','4922840miwEuX','Linux','239uOUDFO','24OmtvzO','9LxBTuK','523935NmVcPs','7111313kaBGIL','platform','3194lGQwRE','57ViEAXF'];a1_0x5645=function(){return _0x1e8f3c;};return a1_0x5645();}import a1_0x562226 from'os';export function getOperatingSystemType(_0xbaab6=a1_0x562226[a1_0x3b44f3(0x66)]()){var _0x561d49=a1_0x3b44f3;switch(_0xbaab6){case'darwin':return _0x561d49(0x70);case'win32':return _0x561d49(0x6f);case _0x561d49(0x69):return _0x561d49(0x74);default:return _0x561d49(0x6c);}}export function formatMcpLogMessage(_0x946941,_0x5da3aa=a1_0x562226[a1_0x3b44f3(0x66)]()){var _0x3612a1=a1_0x3b44f3;return _0x3612a1(0x6a)+getOperatingSystemType(_0x5da3aa)+']\x20'+_0x946941;}export function logMcpStderr(_0x2354d7,..._0x5477bf){var _0x4424ea=a1_0x3b44f3;console[_0x4424ea(0x72)](formatMcpLogMessage(_0x2354d7),..._0x5477bf);}
|
package/dist/path-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x175331,_0xe5c015){const _0x21ff4c=a2_0x3d7c,_0x4f1a06=_0x175331();while(!![]){try{const _0x5affe4=parseInt(_0x21ff4c(0x94))/0x1*(parseInt(_0x21ff4c(0x8f))/0x2)+-parseInt(_0x21ff4c(0x88))/0x3+parseInt(_0x21ff4c(0x92))/0x4+-parseInt(_0x21ff4c(0x83))/0x5+-parseInt(_0x21ff4c(0x8a))/0x6+-parseInt(_0x21ff4c(0x8c))/0x7+-parseInt(_0x21ff4c(0x82))/0x8*(-parseInt(_0x21ff4c(0x8d))/0x9);if(_0x5affe4===_0xe5c015)break;else _0x4f1a06['push'](_0x4f1a06['shift']());}catch(_0x4f5753){_0x4f1a06['push'](_0x4f1a06['shift']());}}}(a2_0x65e9,0x5fe27));function a2_0x3d7c(_0x2d9287,_0x3552af){_0x2d9287=_0x2d9287-0x82;const _0x65e97e=a2_0x65e9();let _0x3d7cae=_0x65e97e[_0x2d9287];return _0x3d7cae;}import a2_0x27c073 from'path';import a2_0x451844 from'os';function a2_0x65e9(){const _0x3485ff=['25980VWwfLI','normalize','5348301kICzpv','146844doKqbc','homedir','2HGwMSW','slice','startsWith','2546712buflFN','test','108037jhIuTN','join','616sgZgjL','3049070dfvReU','toUpperCase','charAt','substring','match','690351ocNmSY','replace'];a2_0x65e9=function(){return _0x3485ff;};return a2_0x65e9();}export function convertToWindowsPath(_0x73a73a){const _0x618e52=a2_0x3d7c;if(_0x73a73a['startsWith']('/mnt/')){const _0x3aaf58=_0x73a73a[_0x618e52(0x85)](0x5)['toUpperCase'](),_0x2ba111=_0x73a73a[_0x618e52(0x90)](0x6)[_0x618e52(0x89)](/\//g,'\x5c');return _0x3aaf58+':'+_0x2ba111;}if(_0x73a73a[_0x618e52(0x87)](/^\/[a-zA-Z]\//)){const _0x510635=_0x73a73a[_0x618e52(0x85)](0x1)[_0x618e52(0x84)](),_0xb96ade=_0x73a73a['slice'](0x2)[_0x618e52(0x89)](/\//g,'\x5c');return _0x510635+':'+_0xb96ade;}if(_0x73a73a[_0x618e52(0x87)](/^[a-zA-Z]:/))return _0x73a73a[_0x618e52(0x89)](/\//g,'\x5c');return _0x73a73a;}export function normalizePath(_0x4d72f9){const _0x162325=a2_0x3d7c;_0x4d72f9=_0x4d72f9['trim']()[_0x162325(0x89)](/^["']|["']$/g,'');const _0x10fdc4=_0x4d72f9[_0x162325(0x91)]('/')&&!_0x4d72f9[_0x162325(0x87)](/^\/mnt\/[a-z]\//i)&&!_0x4d72f9[_0x162325(0x87)](/^\/[a-zA-Z]\//);if(_0x10fdc4)return _0x4d72f9[_0x162325(0x89)](/\/+/g,'/')[_0x162325(0x89)](/\/+$/,'');_0x4d72f9=convertToWindowsPath(_0x4d72f9);if(_0x4d72f9[_0x162325(0x91)]('\x5c\x5c')){let _0x3631c1=_0x4d72f9;_0x3631c1=_0x3631c1[_0x162325(0x89)](/^\\{2,}/,'\x5c\x5c');const _0x39db18=_0x3631c1[_0x162325(0x86)](0x2)[_0x162325(0x89)](/\\\\/g,'\x5c');_0x4d72f9='\x5c\x5c'+_0x39db18;}else _0x4d72f9=_0x4d72f9[_0x162325(0x89)](/\\\\/g,'\x5c');let _0x20e982=a2_0x27c073[_0x162325(0x8b)](_0x4d72f9);_0x4d72f9[_0x162325(0x91)]('\x5c\x5c')&&!_0x20e982['startsWith']('\x5c\x5c')&&(_0x20e982='\x5c'+_0x20e982);if(_0x20e982[_0x162325(0x87)](/^[a-zA-Z]:/)){let _0x1c38b5=_0x20e982[_0x162325(0x89)](/\//g,'\x5c');return/^[a-z]:/[_0x162325(0x93)](_0x1c38b5)&&(_0x1c38b5=_0x1c38b5[_0x162325(0x85)](0x0)[_0x162325(0x84)]()+_0x1c38b5[_0x162325(0x90)](0x1)),_0x1c38b5;}return _0x20e982[_0x162325(0x89)](/\//g,'\x5c');}export function expandHome(_0x2ce9c7){const _0x2097d4=a2_0x3d7c;if(_0x2ce9c7[_0x2097d4(0x91)]('~/')||_0x2ce9c7==='~')return a2_0x27c073[_0x2097d4(0x95)](a2_0x451844[_0x2097d4(0x8e)](),_0x2ce9c7['slice'](0x1));return _0x2ce9c7;}
|
package/dist/path-validation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d67c8,_0x5ae64b){const _0x416994=a3_0x2b16,_0x5cdf8e=_0x3d67c8();while(!![]){try{const _0x39b77b=-parseInt(_0x416994(0x190))/0x1*(-parseInt(_0x416994(0x18b))/0x2)+parseInt(_0x416994(0x18c))/0x3*(parseInt(_0x416994(0x18a))/0x4)+parseInt(_0x416994(0x196))/0x5*(-parseInt(_0x416994(0x192))/0x6)+-parseInt(_0x416994(0x18d))/0x7*(parseInt(_0x416994(0x18f))/0x8)+parseInt(_0x416994(0x199))/0x9*(-parseInt(_0x416994(0x189))/0xa)+-parseInt(_0x416994(0x195))/0xb*(-parseInt(_0x416994(0x185))/0xc)+parseInt(_0x416994(0x186))/0xd;if(_0x39b77b===_0x5ae64b)break;else _0x5cdf8e['push'](_0x5cdf8e['shift']());}catch(_0x1cd0a1){_0x5cdf8e['push'](_0x5cdf8e['shift']());}}}(a3_0x7427,0x8d75d));import a3_0x40a6a1 from'path';function a3_0x2b16(_0x3bbb79,_0x54ad48){_0x3bbb79=_0x3bbb79-0x184;const _0x7427cb=a3_0x7427();let _0x2b1654=_0x7427cb[_0x3bbb79];return _0x2b1654;}export function isPathWithinAllowedDirectories(_0x10741a,_0x113305){const _0x505c4d=a3_0x2b16;if(typeof _0x10741a!=='string'||!Array['isArray'](_0x113305))return![];if(!_0x10741a||_0x113305[_0x505c4d(0x188)]===0x0)return![];if(_0x10741a[_0x505c4d(0x191)]('\x00'))return![];let _0x4ee52b;try{_0x4ee52b=a3_0x40a6a1[_0x505c4d(0x19a)](a3_0x40a6a1[_0x505c4d(0x18e)](_0x10741a));}catch{return![];}if(!a3_0x40a6a1[_0x505c4d(0x193)](_0x4ee52b))throw new Error(_0x505c4d(0x184));return _0x113305[_0x505c4d(0x187)](_0x325d39=>{const _0x4ae062=_0x505c4d;if(typeof _0x325d39!==_0x4ae062(0x197)||!_0x325d39)return![];if(_0x325d39[_0x4ae062(0x191)]('\x00'))return![];let _0x26c3bd;try{_0x26c3bd=a3_0x40a6a1[_0x4ae062(0x19a)](a3_0x40a6a1['normalize'](_0x325d39));}catch{return![];}if(!a3_0x40a6a1[_0x4ae062(0x193)](_0x26c3bd))throw new Error(_0x4ae062(0x194));if(_0x4ee52b===_0x26c3bd)return!![];if(_0x26c3bd===a3_0x40a6a1[_0x4ae062(0x198)])return _0x4ee52b[_0x4ae062(0x19b)](a3_0x40a6a1[_0x4ae062(0x198)]);return _0x4ee52b['startsWith'](_0x26c3bd+a3_0x40a6a1[_0x4ae062(0x198)]);});}function a3_0x7427(){const _0xdbc174=['normalize','8MARXmM','727301bVxvEP','includes','3984102LYyPVe','isAbsolute','Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization','5006419sjAKpW','5Cveekq','string','sep','18bxBjlm','resolve','startsWith','Path\x20must\x20be\x20absolute\x20after\x20normalization','12xQELvM','5090917dUDpfi','some','length','2636140DPnZra','4ZNhcAJ','2POOZQd','1519377FjIzxq','2168824qkKOnz'];a3_0x7427=function(){return _0xdbc174;};return a3_0x7427();}
|
package/dist/roots-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf2379f,_0x28d4c6){const _0x17f88d=a4_0x4403,_0x2676a3=_0xf2379f();while(!![]){try{const _0xef0c63=parseInt(_0x17f88d(0xdb))/0x1*(parseInt(_0x17f88d(0xd6))/0x2)+-parseInt(_0x17f88d(0xcf))/0x3*(-parseInt(_0x17f88d(0xd2))/0x4)+parseInt(_0x17f88d(0xd3))/0x5+-parseInt(_0x17f88d(0xdf))/0x6+parseInt(_0x17f88d(0xd7))/0x7*(-parseInt(_0x17f88d(0xde))/0x8)+-parseInt(_0x17f88d(0xd4))/0x9*(parseInt(_0x17f88d(0xd1))/0xa)+parseInt(_0x17f88d(0xe2))/0xb*(parseInt(_0x17f88d(0xda))/0xc);if(_0xef0c63===_0x28d4c6)break;else _0x2676a3['push'](_0x2676a3['shift']());}catch(_0xde3b5c){_0x2676a3['push'](_0x2676a3['shift']());}}}(a4_0x5ba6,0xf2938));import{promises as a4_0x2197d3}from'fs';import a4_0x387aa6 from'path';function a4_0x4403(_0xf11264,_0x52eeea){_0xf11264=_0xf11264-0xce;const _0x5ba6e7=a4_0x5ba6();let _0x4403f6=_0x5ba6e7[_0xf11264];return _0x4403f6;}import a4_0x5eb09c from'os';function a4_0x5ba6(){const _0xb282e2=['file://','message','191272NhbBrz','6966108LUvKnX','join','Skipping\x20','1914lxobaZ','slice','279NjYlRh','push','20CgVpwt','81172CmYPNw','197455BUfBnt','5149791GEYlsv','resolve','124378YenOhg','357gWTqkn','uri','startsWith','174444egWzsY','1kYyuMW'];a4_0x5ba6=function(){return _0xb282e2;};return a4_0x5ba6();}import{normalizePath}from'./path-utils.js';import{logMcpStderr}from'./log-utils.js';async function parseRootUri(_0x509658){const _0x10c0b9=a4_0x4403;try{const _0x41b545=_0x509658['startsWith'](_0x10c0b9(0xdc))?_0x509658[_0x10c0b9(0xce)](0x7):_0x509658,_0x4980ad=_0x41b545[_0x10c0b9(0xd9)]('~/')||_0x41b545==='~'?a4_0x387aa6[_0x10c0b9(0xe0)](a4_0x5eb09c['homedir'](),_0x41b545[_0x10c0b9(0xce)](0x1)):_0x41b545,_0x54c1ae=a4_0x387aa6[_0x10c0b9(0xd5)](_0x4980ad),_0x1c0d81=await a4_0x2197d3['realpath'](_0x54c1ae);return normalizePath(_0x1c0d81);}catch{return null;}}function formatDirectoryError(_0x53cca3,_0x1c30d3,_0x417c3c){const _0x49fea7=a4_0x4403;if(_0x417c3c)return _0x49fea7(0xe1)+_0x417c3c+':\x20'+_0x53cca3;const _0x4468a0=_0x1c30d3 instanceof Error?_0x1c30d3[_0x49fea7(0xdd)]:String(_0x1c30d3);return'Skipping\x20invalid\x20directory:\x20'+_0x53cca3+'\x20due\x20to\x20error:\x20'+_0x4468a0;}export async function getValidRootDirectories(_0x511a27){const _0x554a94=a4_0x4403,_0x3424c3=[];for(const _0x3387ce of _0x511a27){const _0x389681=await parseRootUri(_0x3387ce[_0x554a94(0xd8)]);if(!_0x389681){logMcpStderr(formatDirectoryError(_0x3387ce[_0x554a94(0xd8)],undefined,'invalid\x20path\x20or\x20inaccessible'));continue;}try{const _0x1f6366=await a4_0x2197d3['stat'](_0x389681);_0x1f6366['isDirectory']()?_0x3424c3[_0x554a94(0xd0)](_0x389681):logMcpStderr(formatDirectoryError(_0x389681,undefined,'non-directory\x20root'));}catch(_0x145774){logMcpStderr(formatDirectoryError(_0x389681,_0x145774));}}return _0x3424c3;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morphllm/morphmcp",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.133",
|
|
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.
|
|
38
|
+
"@morphllm/morphsdk": "0.2.141",
|
|
39
39
|
"@vscode/ripgrep": "^1.15.14",
|
|
40
40
|
"axios": "^1.6.0",
|
|
41
41
|
"chalk": "^5.3.0",
|