@morphllm/morphmcp 0.8.194 → 0.8.196

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x56a8fe=a0_0x4e75;(function(_0x59f9e7,_0x435f22){const _0x4e2c9f=a0_0x4e75,_0x52c45c=_0x59f9e7();while(!![]){try{const _0x49d585=parseInt(_0x4e2c9f(0x258))/0x1*(parseInt(_0x4e2c9f(0x1da))/0x2)+parseInt(_0x4e2c9f(0x1e9))/0x3*(-parseInt(_0x4e2c9f(0x1bb))/0x4)+-parseInt(_0x4e2c9f(0x25b))/0x5*(-parseInt(_0x4e2c9f(0x1be))/0x6)+-parseInt(_0x4e2c9f(0x1d5))/0x7+parseInt(_0x4e2c9f(0x16d))/0x8*(-parseInt(_0x4e2c9f(0x19d))/0x9)+-parseInt(_0x4e2c9f(0x262))/0xa+parseInt(_0x4e2c9f(0x161))/0xb*(parseInt(_0x4e2c9f(0x223))/0xc);if(_0x49d585===_0x435f22)break;else _0x52c45c['push'](_0x52c45c['shift']());}catch(_0x45d84f){_0x52c45c['push'](_0x52c45c['shift']());}}}(a0_0x30e6,0x7c4f4));import{Server}from'@modelcontextprotocol/sdk/server/index.js';function a0_0x30e6(){const _0x1904c5=['includes','unknown','\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]','\x22>\x0a','\x0a...\x20(truncated,\x20total:\x20','push','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','linesModified','Tool\x20\x22','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20toolin\x20its\x20search.\x20','Preview\x20changes\x20without\x20applying\x20them.','GitHub\x20search\x20failed:\x20','map','Parent\x20directory\x20does\x20not\x20exist:\x20','mcp-filesystem','default','description','go.mod','composer.json','../package.json','optional','listRoots','all','list_directory\x20','size','214713mSGgMZ','\x20error(s)','isDirectory','exit','min','false','-\x20Read\x20file\x20`','Rules:\x0a','Example\x20format:\x0a','❌\x20Morph\x20Edit\x20Failed:\x20','Failed\x20to\x20read\x20file:\x20','text','tool_call_error','Warning:\x20','lines','warn','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.','-\x20Listed\x20directory\x20`','messages','Morph\x20FastApply\x20failed\x20without\x20error\x20message','@morphllm/morphmcp\x20','success','response','-\x20code_edit:\x20Only\x20the\x20changed\x20lines\x20with\x20//\x20...\x20existing\x20code\x20...\x20markers\x0a\x0a','\x20disabled\x20via\x20DISABLED_TOOLS','toISOString','path_validation_failed','Bearer\x20','post','startsWith','4ZtQEmW','dirname','\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)','6ILunZG','inputSchema','TimeoutError','resolve','errors','A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.','FileNotFound','setNotificationHandler','branch','File\x20read\x20error:','--version','stack','toLowerCase','roots','search_type','substring','Specific\x20commit\x20hash\x20to\x20search','0.2.0','split','edit','Here\x20is\x20the\x20content\x20of\x20files:\x0a','file_read_complete','No\x20Morph\x20API\x20key\x20configured.\x20Please\x20visit\x20https://morphllm.com\x20to\x20get\x20an\x20API\x20key,\x20then\x20set\x20MORPH_API_KEY\x20in\x20your\x20MCP\x20configuration.','6543411Gpgyxi','morph-','Error\x20running\x20fast\x20context\x20search:\x20','instructions','stat','322068VlbNJo','now','Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol','oninitialized','completed','PathError','BinaryFile','Authentication\x20failed:\x20Your\x20Morph\x20API\x20key\x20is\x20invalid\x20or\x20has\x20been\x20revoked.\x20Please\x20visit\x20https://morphllm.com\x20to\x20get\x20a\x20valid\x20API\x20key,\x20then\x20update\x20your\x20MCP\x20configuration.','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','version','Warning:\x20DISABLED_TOOLS\x20contains\x20unknown\x20tool\x20\x22','number','api-key','terminated','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.','2300913WdBoOU','Applied','Created\x20File','argv','Unknown\x20tool:\x20','RipgrepNotAvailable','\x22.\x20Known\x20tools:\x20','\x0a</file>','WarpGrep\x20sub-tool\x20errors:\x20','FileReadError','\x22>\x0aError\x20reading\x20file:\x20','Max\x20results\x20to\x20return','glob','Warning:\x20Unable\x20to\x20determine\x20package\x20version:','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','Invalid\x20Morph\x20API\x20key\x20format.\x20API\x20keys\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27.\x20Please\x20visit\x20https://morphllm.com\x20to\x20get\x20a\x20valid\x20API\x20key.','[github_codebase_search]\x20Failed\x20in\x20','trim','MORPH_WARP_GREP_TIMEOUT','Failed\x20to\x20request\x20roots\x20from\x20client:','instruction','EDIT_FILE','list_directory','describe','UnknownError','read','SymlinkError','.\x20Path:\x20','boolean','morph-v3-large','floor','message','isArray','github_search_start','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','catch','timeout','requiresApiKey','Unknown\x20error','-\x20path:\x20Absolute\x20file\x20path\x20to\x20edit\x0a','\x0aOptions:','changes','//\x20...\x20existing\x20code\x20...\x0aFIRST_EDIT\x0a//\x20...\x20existing\x20code\x20...\x0aSECOND_EDIT\x0a//\x20...\x20existing\x20code\x20...\x0a\x0a','Error\x20accessing\x20directory\x20','<file\x20path=\x22','grep','log','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.','\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit','setRequestHandler','PWD','ENABLE_WORKSPACE_MODE','ms:','file_read_failed','\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)','tool_call_received','132564hcpKTQ','connect','https://morphllm.com/api/error-report','repo_path','MCP','stringify','some','code','\x20is\x20not\x20a\x20directory','unknown\x20error','linesRemoved','Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:','new_string','file','CODEBASE_SEARCH','.vscode','-\x20Grepped\x20\x27','user','object','turns','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','function','completionId','edit_file','LocalRipgrepProvider','array','MORPH_API_URL','code_edit','timed\x20out','morph-mcp','tsconfig.json','.\x20Changes:\x20',',\x20modified\x20','ReadError','parse','payload','metadata','timings','normalize','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.\x20','target_filepath','linesAdded','files','morph-v3-fast','github_codebase_search','context','utf-8','ms.\x20Success:\x20','data','\x20as\x20allowed\x20directory','owner_repo','2CfQBNa','Use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code\x20blocks.\x20Include\x20just\x20enough\x20surrounding\x20context\x20to\x20locate\x20each\x20edit\x20precisely.\x0a\x0a','grep\x20\x27','384315NeiIHT','Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','name','morph-warp-grep-v2.1','etimedout','readFile','4204470zFEkrg','node_modules','.cursor','-\x20Batch\x20multiple\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a','finish','homedir','role','-\x20instruction:\x20Brief\x20first-person\x20description\x20of\x20what\x20you\x27re\x20changing\x0a','api_request_start','Error:\x20','path_validation_resolved','env','API\x20error\x20(auth/rate-limit)','--help','length','tool_call_id','dryRun','runWarpGrep_call','sk-','warp_grep_complete','\x20-\x20','string','\x20chars)','constructor','debug','has','Repository\x20identifier','filter','--api-key','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES.**\x20Fast,\x20accurate,\x20and\x20prevents\x20context\x20pollution.\x20Especially\x20useful\x20when\x20making\x20multiple\x20edits\x20in\x20one\x20file:\x20describe\x20all\x20changes\x20in\x20a\x20single\x20call\x20and\x20the\x20semantic\x20edit\x20applies\x20them\x20all\x20at\x20once,\x20more\x20accurately\x20and\x20faster\x20than\x20sequential\x20edits.\x20Unlike\x20search-and-replace\x20or\x20patch\x20edits\x20which\x20do\x20narrow\x20edits\x20one\x20at\x20a\x20time,\x20with\x20this\x20tool\x20you\x20should\x20do\x20all\x20your\x20code\x20changes\x20in\x20one\x20go\x20separated\x20by\x20`//\x20...\x20existing\x20code\x20...`\x20markers.\x20This\x20saves\x20tokens\x20and\x20improves\x20performance\x20because\x20you\x20do\x20not\x20need\x20to\x20reread\x20files\x20before\x20edits.\x20All\x20three\x20parameters\x20are\x20required.\x0a\x0a','\x0aExamples:','status','-\x20Preserve\x20exact\x20indentation\x0a','Morph\x20Edit\x20Preview','join','No\x20relevant\x20code\x20found\x20for\x20the\x20query.','pyproject.toml','-\x20ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20for\x20unchanged\x20sections\x20(omitting\x20this\x20marker\x20will\x20cause\x20deletions)\x0a','Invalid\x20arguments:\x20','Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','arguments','\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit','searchGitHub','\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo','slice','2508PwbSIH','every','codebase_search','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','path','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','safeParse','[could\x20not\x20read\x20file:\x20','match','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.','pattern','sep','96UeNHXB','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','completed_with_file_errors','tool','Rate\x20limited:\x20You\x27ve\x20exceeded\x20your\x20Morph\x20API\x20usage\x20limits.\x20Please\x20visit\x20https://morphllm.com\x20to\x20check\x20your\x20plan\x20and\x20purchase\x20additional\x20credits.','Fallback:\x20Using\x20workspace\x20root\x20','terminationReason','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all','ToolException','command','basename','tool_calls','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','content','Morph\x20Edit\x20','package.json','--api-key=','error','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','realpath','search_string','enum'];a0_0x30e6=function(){return _0x1904c5;};return a0_0x30e6();}import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema,RootsListChangedNotificationSchema}from'@modelcontextprotocol/sdk/types.js';import a0_0x4dc500 from'fs/promises';import a0_0x27fcca from'path';import a0_0x1b25bd 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{logger}from'./logger.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{compactFileContexts}from'@morphllm/morphsdk/tools/compact';import a0_0x19c627 from'axios';import{KNOWN_TOOL_NAMES,TOOL_NAMES}from'./tool-definitions.js';function fixPathRepetition(_0x685caf){const _0x35bad4=a0_0x4e75,_0x38478e=_0x685caf[_0x35bad4(0x1d0)](a0_0x27fcca['sep'])[_0x35bad4(0x14f)](Boolean);if(_0x38478e[_0x35bad4(0x270)]<0x2)return null;for(let _0x4678fe=Math[_0x35bad4(0x207)](_0x38478e[_0x35bad4(0x270)]/0x2);_0x4678fe>=0x1;_0x4678fe--){for(let _0x1b78bb=0x0;_0x1b78bb<=_0x38478e['length']-0x2*_0x4678fe;_0x1b78bb++){const _0x1a6d54=_0x38478e[_0x35bad4(0x160)](_0x1b78bb,_0x1b78bb+_0x4678fe),_0x21f162=_0x38478e[_0x35bad4(0x160)](_0x1b78bb+_0x4678fe,_0x1b78bb+0x2*_0x4678fe);if(_0x1a6d54[_0x35bad4(0x162)]((_0x35f82d,_0x473ee0)=>_0x35f82d===_0x21f162[_0x473ee0])){const _0x3079cb=[..._0x38478e[_0x35bad4(0x160)](0x0,_0x1b78bb),..._0x38478e[_0x35bad4(0x160)](_0x1b78bb+_0x4678fe)];return a0_0x27fcca[_0x35bad4(0x16c)]+_0x3079cb[_0x35bad4(0x156)](a0_0x27fcca['sep']);}}}return null;}const require=createRequire(import.meta.url);function getPackageVersion(){const _0x1e8372=a0_0x4e75;try{const _0x4c684f=require(_0x1e8372(0x197));return _0x4c684f[_0x1e8372(0x1e3)]??_0x1e8372(0x185);}catch(_0x4b838a){return logMcpStderr(_0x1e8372(0x1f6),_0x4b838a),_0x1e8372(0x185);}}function printHelp(){const _0x11e1a6=a0_0x4e75;console[_0x11e1a6(0x217)](_0x11e1a6(0x1b1)+getPackageVersion()),console[_0x11e1a6(0x217)](_0x11e1a6(0x186)),console['log'](_0x11e1a6(0x211)),console[_0x11e1a6(0x217)](_0x11e1a6(0x221)),console['log'](_0x11e1a6(0x15d)),console[_0x11e1a6(0x217)](_0x11e1a6(0x21b)),console['log'](_0x11e1a6(0x152)),console['log']('\x20\x20morph-mcp'),console[_0x11e1a6(0x217)](_0x11e1a6(0x15f));}const cliArgs=process[a0_0x56a8fe(0x1ec)]['slice'](0x2),VERSION_FLAGS=new Set([a0_0x56a8fe(0x1c8),'-v','-V']),HELP_FLAGS=new Set([a0_0x56a8fe(0x26f),'-h']);cliArgs[a0_0x56a8fe(0x229)](_0x1de975=>VERSION_FLAGS[a0_0x56a8fe(0x14d)](_0x1de975))&&(console['log']('@morphllm/morphmcp\x20'+getPackageVersion()),process[a0_0x56a8fe(0x1a0)](0x0));cliArgs[a0_0x56a8fe(0x229)](_0x3503fa=>HELP_FLAGS[a0_0x56a8fe(0x14d)](_0x3503fa))&&(printHelp(),process[a0_0x56a8fe(0x1a0)](0x0));function getCliArg(_0x1e40f4){const _0x3d92f7=a0_0x56a8fe;for(let _0x547987=0x0;_0x547987<cliArgs[_0x3d92f7(0x270)];_0x547987++){const _0x1c600c=cliArgs[_0x547987];if(_0x1c600c[_0x3d92f7(0x1ba)]('--'+_0x1e40f4+'='))return _0x1c600c[_0x3d92f7(0x160)](('--'+_0x1e40f4+'=')[_0x3d92f7(0x270)]);if(_0x1c600c==='--'+_0x1e40f4&&_0x547987+0x1<cliArgs[_0x3d92f7(0x270)])return cliArgs[_0x547987+0x1];}return undefined;}const args=[];for(let i=0x0;i<cliArgs[a0_0x56a8fe(0x270)];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x56a8fe(0x14d)](arg)||HELP_FLAGS[a0_0x56a8fe(0x14d)](arg))continue;if(arg[a0_0x56a8fe(0x1ba)](a0_0x56a8fe(0x17e)))continue;if(arg===a0_0x56a8fe(0x150)){i++;continue;}args[a0_0x56a8fe(0x189)](arg);}const WORKSPACE_ROOT=process[a0_0x56a8fe(0x26d)]['WORKSPACE_ROOT']||process[a0_0x56a8fe(0x26d)][a0_0x56a8fe(0x21d)]||process['cwd'](),ENABLE_WORKSPACE_MODE=process[a0_0x56a8fe(0x26d)][a0_0x56a8fe(0x21e)]!==a0_0x56a8fe(0x1a2),MORPH_API_KEY=getCliArg(a0_0x56a8fe(0x1e6))??process['env']['MORPH_API_KEY'],MORPH_API_URL=process['env'][a0_0x56a8fe(0x23f)],MORPH_LARGE_APPLY=process[a0_0x56a8fe(0x26d)]['MORPH_LARGE_APPLY']!==a0_0x56a8fe(0x1a2),MORPH_WARP_GREP_TIMEOUT=process['env']['MORPH_WARP_GREP_TIMEOUT']?parseInt(process[a0_0x56a8fe(0x26d)][a0_0x56a8fe(0x1fb)],0xa):undefined,OPERATING_SYSTEM_TYPE=getOperatingSystemType(),DEFAULT_DISABLED_TOOLS=new Set(),DISABLED_TOOLS=process[a0_0x56a8fe(0x26d)]['DISABLED_TOOLS']?new Set(process['env']['DISABLED_TOOLS'][a0_0x56a8fe(0x1d0)](',')['map'](_0x4a2a6f=>_0x4a2a6f[a0_0x56a8fe(0x1fa)]())[a0_0x56a8fe(0x14f)](_0x11b4dc=>_0x11b4dc['length']>0x0)):DEFAULT_DISABLED_TOOLS;function a0_0x4e75(_0xa3e864,_0x3497cf){_0xa3e864=_0xa3e864-0x144;const _0x30e6f4=a0_0x30e6();let _0x4e75d6=_0x30e6f4[_0xa3e864];return _0x4e75d6;}if(DISABLED_TOOLS[a0_0x56a8fe(0x19c)]>0x0){for(const tool of DISABLED_TOOLS){!KNOWN_TOOL_NAMES[a0_0x56a8fe(0x14d)](tool)&&console['error'](a0_0x56a8fe(0x1e4)+tool+a0_0x56a8fe(0x1ef)+[...KNOWN_TOOL_NAMES][a0_0x56a8fe(0x156)](',\x20'));}console['error']('Disabled\x20tools:\x20'+[...DISABLED_TOOLS][a0_0x56a8fe(0x156)](',\x20'));}MORPH_API_KEY&&!MORPH_API_KEY[a0_0x56a8fe(0x1ba)](a0_0x56a8fe(0x146))&&!MORPH_API_KEY['startsWith'](a0_0x56a8fe(0x1d6))&&logMcpStderr(a0_0x56a8fe(0x25c));async function reportMorphError(_0x24caa8){const _0x596cbc=a0_0x56a8fe;try{await a0_0x19c627[_0x596cbc(0x1b9)](_0x596cbc(0x225),{..._0x24caa8,'timestamp':new Date()[_0x596cbc(0x1b6)](),'source':_0x24caa8['source']||_0x596cbc(0x192),'os_type':OPERATING_SYSTEM_TYPE,'context':{'os_type':OPERATING_SYSTEM_TYPE,..._0x24caa8[_0x596cbc(0x252)]}},{'timeout':0x1388,'headers':{'Content-Type':'application/json','Authorization':_0x596cbc(0x1b8)+MORPH_API_KEY}});}catch{}}function extractStatusCode(_0x5a0375,_0x43486c){const _0x2b009a=a0_0x56a8fe;if(_0x5a0375&&typeof _0x5a0375===_0x2b009a(0x236)&&_0x2b009a(0x153)in _0x5a0375)return _0x5a0375[_0x2b009a(0x153)];if(_0x5a0375&&typeof _0x5a0375==='object'&&_0x2b009a(0x1b3)in _0x5a0375)return _0x5a0375[_0x2b009a(0x1b3)]?.[_0x2b009a(0x153)];const _0x215c24=_0x43486c[_0x2b009a(0x169)](/\b(401|429)\b/);return _0x215c24?parseInt(_0x215c24[0x1],0xa):null;}function handleMorphAPIError(_0x32e2ce){const _0x44c71d=a0_0x56a8fe,_0x5b66d5=_0x32e2ce instanceof Error?_0x32e2ce['message']:String(_0x32e2ce),_0x3aa23f=extractStatusCode(_0x32e2ce,_0x5b66d5);switch(_0x3aa23f){case 0x191:return{'content':[{'type':'text','text':_0x44c71d(0x1e1)}],'isError':!![]};case 0x1ad:return{'content':[{'type':'text','text':_0x44c71d(0x171)}],'isError':!![]};default:return null;}}args[a0_0x56a8fe(0x270)]===0x0&&!ENABLE_WORKSPACE_MODE&&(logMcpStderr(a0_0x56a8fe(0x238)),logMcpStderr(a0_0x56a8fe(0x180)),logMcpStderr('\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)'),logMcpStderr(a0_0x56a8fe(0x1bd)),logMcpStderr(a0_0x56a8fe(0x18a)),logMcpStderr(a0_0x56a8fe(0x218)));function normalizePath(_0x2b685c){const _0x124d44=a0_0x56a8fe;return a0_0x27fcca[_0x124d44(0x24b)](_0x2b685c);}function expandHome(_0x1b5075){const _0x750bb2=a0_0x56a8fe;if(_0x1b5075[_0x750bb2(0x1ba)]('~/')||_0x1b5075==='~')return a0_0x27fcca['join'](a0_0x1b25bd[_0x750bb2(0x267)](),_0x1b5075[_0x750bb2(0x160)](0x1));return _0x1b5075;}let allowedDirectories=await Promise[a0_0x56a8fe(0x19a)](args[a0_0x56a8fe(0x190)](async _0x2e78d0=>{const _0x16d17a=expandHome(_0x2e78d0),_0x2dcdd8=a0_0x27fcca['resolve'](_0x16d17a);try{const _0x5781ae=await a0_0x4dc500['realpath'](_0x2dcdd8);return normalizePath(_0x5781ae);}catch(_0x4241d1){return normalizePath(_0x2dcdd8);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x56a8fe(0x270)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories['push'](workspaceDir),logMcpStderr('Workspace\x20mode\x20enabled:\x20Using\x20'+workspaceDir+a0_0x56a8fe(0x256)));}catch(a0_0xde4a0d){logMcpStderr(a0_0x56a8fe(0x239)+a0_0xde4a0d);}async function detectWorkspaceRoot(_0x281b4a){const _0x2e07ae=a0_0x56a8fe;let _0x3817fa=a0_0x27fcca[_0x2e07ae(0x1c1)](_0x281b4a);const _0x29a3cb=['.git',_0x2e07ae(0x233),_0x2e07ae(0x17d),'Cargo.toml',_0x2e07ae(0x158),_0x2e07ae(0x195),_0x2e07ae(0x264),_0x2e07ae(0x243),_0x2e07ae(0x196)];while(_0x3817fa!==a0_0x27fcca['dirname'](_0x3817fa)){for(const _0x122b12 of _0x29a3cb){const _0x311805=a0_0x27fcca['join'](_0x3817fa,_0x122b12);try{return await a0_0x4dc500['access'](_0x311805),normalizePath(_0x3817fa);}catch{}}_0x3817fa=a0_0x27fcca[_0x2e07ae(0x1bc)](_0x3817fa);}return normalizePath(_0x281b4a);}await Promise[a0_0x56a8fe(0x19a)](args[a0_0x56a8fe(0x190)](async _0x23928c=>{const _0x3c6933=a0_0x56a8fe;try{const _0x2f65cf=await a0_0x4dc500[_0x3c6933(0x1d9)](expandHome(_0x23928c));!_0x2f65cf[_0x3c6933(0x19f)]()&&(logMcpStderr(_0x3c6933(0x26b)+_0x23928c+_0x3c6933(0x22b)),process[_0x3c6933(0x1a0)](0x1));}catch(_0x54e11f){logMcpStderr(_0x3c6933(0x214)+_0x23928c+':',_0x54e11f),process['exit'](0x1);}}));async function validatePath(_0x46d74b){const _0x3acb09=a0_0x56a8fe,_0x4e8414=expandHome(_0x46d74b),_0x4bcc9e=a0_0x27fcca[_0x3acb09(0x1c1)](_0x4e8414);logger['debug']('MCP','path_validation_start',{'raw_path':_0x46d74b,'absolute':_0x4bcc9e});try{const _0x469e04=await a0_0x4dc500[_0x3acb09(0x181)](_0x4bcc9e);return logger['debug'](_0x3acb09(0x227),_0x3acb09(0x26c),{'resolved':_0x469e04,'symlink':_0x469e04!==_0x4bcc9e}),_0x469e04;}catch(_0x3e8b18){if(_0x3e8b18[_0x3acb09(0x22a)]==='ENOENT'){const _0x3dfcf2=a0_0x27fcca[_0x3acb09(0x1bc)](_0x4bcc9e);try{const _0x2c966c=await a0_0x4dc500[_0x3acb09(0x181)](_0x3dfcf2),_0x35f23f=a0_0x27fcca[_0x3acb09(0x156)](_0x2c966c,a0_0x27fcca[_0x3acb09(0x178)](_0x4bcc9e));return logger[_0x3acb09(0x14c)]('MCP',_0x3acb09(0x26c),{'resolved':_0x35f23f,'new_file':!![]}),_0x35f23f;}catch{logger['error'](_0x3acb09(0x227),_0x3acb09(0x1b7),{'raw_path':_0x46d74b,'error':_0x3acb09(0x191)+_0x3dfcf2});throw new Error(_0x3acb09(0x191)+_0x3dfcf2);}}logger[_0x3acb09(0x17f)](_0x3acb09(0x227),_0x3acb09(0x1b7),{'raw_path':_0x46d74b,'error':_0x3e8b18[_0x3acb09(0x208)]});throw _0x3e8b18;}}const MorphEditFileArgsSchema=z[a0_0x56a8fe(0x236)]({'path':z[a0_0x56a8fe(0x149)](),'code_edit':z['string']()[a0_0x56a8fe(0x200)](a0_0x56a8fe(0x25d)),'instruction':z[a0_0x56a8fe(0x149)]()['describe'](a0_0x56a8fe(0x1c3)),'dryRun':z[a0_0x56a8fe(0x205)]()[a0_0x56a8fe(0x193)](![])[a0_0x56a8fe(0x200)](a0_0x56a8fe(0x18e))}),CODEBASE_SEARCH_QUERY_DESCRIPTION=a0_0x56a8fe(0x1e8),WarpGrepArgsSchema=z[a0_0x56a8fe(0x236)]({'search_string':z['string']()[a0_0x56a8fe(0x200)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repo_path':z[a0_0x56a8fe(0x149)]()['describe'](a0_0x56a8fe(0x17a)),'search_type':z[a0_0x56a8fe(0x183)]([a0_0x56a8fe(0x193),a0_0x56a8fe(0x263)])['optional']()[a0_0x56a8fe(0x200)](a0_0x56a8fe(0x21a))}),WarpGrepGitHubArgsSchema=z['object']({'search_string':z['string']()['describe'](CODEBASE_SEARCH_QUERY_DESCRIPTION),'github_url':z[a0_0x56a8fe(0x149)]()['optional']()['describe'](a0_0x56a8fe(0x1ad)),'owner_repo':z[a0_0x56a8fe(0x149)]()[a0_0x56a8fe(0x198)]()[a0_0x56a8fe(0x200)](a0_0x56a8fe(0x15b)),'branch':z[a0_0x56a8fe(0x149)]()['optional']()['describe']('Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)')}),CodebaseSearchArgsSchema=z[a0_0x56a8fe(0x236)]({'query':z[a0_0x56a8fe(0x149)]()[a0_0x56a8fe(0x200)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repoId':z['string']()['describe'](a0_0x56a8fe(0x14e)),'branch':z['string']()[a0_0x56a8fe(0x198)]()[a0_0x56a8fe(0x200)]('Branch\x20to\x20search\x20(uses\x20latest\x20commit)'),'commitHash':z[a0_0x56a8fe(0x149)]()[a0_0x56a8fe(0x198)]()[a0_0x56a8fe(0x200)](a0_0x56a8fe(0x1ce)),'targetDirectories':z[a0_0x56a8fe(0x23e)](z[a0_0x56a8fe(0x149)]())['default']([])[a0_0x56a8fe(0x200)](a0_0x56a8fe(0x175)),'limit':z[a0_0x56a8fe(0x1e5)]()[a0_0x56a8fe(0x198)]()[a0_0x56a8fe(0x193)](0xa)['describe'](a0_0x56a8fe(0x1f4))}),server=new Server({'name':a0_0x56a8fe(0x242),'version':a0_0x56a8fe(0x1cf)},{'capabilities':{'tools':{}}});server[a0_0x56a8fe(0x21c)](ListToolsRequestSchema,async()=>{const _0x417dad=a0_0x56a8fe,_0x7e6b72=[{'name':TOOL_NAMES[_0x417dad(0x1fe)],'description':_0x417dad(0x151)+'Parameters:\x0a'+_0x417dad(0x210)+_0x417dad(0x269)+_0x417dad(0x1b4)+_0x417dad(0x259)+_0x417dad(0x1a5)+_0x417dad(0x213)+_0x417dad(0x1a4)+_0x417dad(0x159)+_0x417dad(0x154)+'-\x20For\x20deletions:\x20show\x20context\x20before\x20and\x20after,\x20omit\x20the\x20deleted\x20lines\x0a'+_0x417dad(0x265),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':TOOL_NAMES[_0x417dad(0x232)],'description':_0x417dad(0x20b)+CODEBASE_SEARCH_QUERY_DESCRIPTION+'\x20'+_0x417dad(0x18d)+_0x417dad(0x24c)+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]}],_0x1255f4=_0x7e6b72['filter'](_0x508518=>{const _0x6b99b1=_0x417dad;if(DISABLED_TOOLS['has'](_0x508518[_0x6b99b1(0x25e)]))return console['error']('Tool\x20'+_0x508518[_0x6b99b1(0x25e)]+_0x6b99b1(0x1b5)),![];if(_0x6b99b1(0x20e)in _0x508518&&_0x508518[_0x6b99b1(0x20e)]&&!MORPH_API_KEY)return logMcpStderr(_0x6b99b1(0x1aa)+_0x508518[_0x6b99b1(0x25e)]+_0x6b99b1(0x16e)),![];return!![];});return{'tools':_0x1255f4[_0x417dad(0x190)](_0x5de66f=>({'name':_0x5de66f[_0x417dad(0x25e)],'description':_0x5de66f[_0x417dad(0x194)],'inputSchema':_0x5de66f[_0x417dad(0x1bf)]}))};}),server[a0_0x56a8fe(0x21c)](CallToolRequestSchema,async _0x591462=>{const _0x36f654=a0_0x56a8fe,{name:_0x33cf74,arguments:_0x431357}=_0x591462['params'],_0x64da5a=Date[_0x36f654(0x1db)]();logger[_0x36f654(0x14c)](_0x36f654(0x227),_0x36f654(0x222),{'tool':_0x33cf74,'args':_0x33cf74===_0x36f654(0x23c)?{'path':_0x431357?.['path'],'instruction':_0x431357?.[_0x36f654(0x1fd)]||_0x431357?.[_0x36f654(0x1d8)],'dryRun':_0x431357?.[_0x36f654(0x144)]}:_0x431357});try{if(!MORPH_API_KEY)return{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x1d4)}],'isError':!![]};if(!MORPH_API_KEY[_0x36f654(0x1ba)](_0x36f654(0x146))&&!MORPH_API_KEY[_0x36f654(0x1ba)](_0x36f654(0x1d6)))return{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x1f8)}],'isError':!![]};if(DISABLED_TOOLS[_0x36f654(0x14d)](_0x33cf74))return{'content':[{'type':'text','text':_0x36f654(0x18c)+_0x33cf74+'\x22\x20is\x20disabled\x20via\x20the\x20DISABLED_TOOLS\x20environment\x20variable\x20in\x20your\x20MCP\x20configuration.\x20Please\x20use\x20an\x20alternative\x20approach.'}],'isError':![]};switch(_0x33cf74){case TOOL_NAMES[_0x36f654(0x1fe)]:{let _0x4c2323=_0x431357;if(_0x4c2323&&typeof _0x4c2323===_0x36f654(0x236)){if(!(_0x36f654(0x165)in _0x4c2323)){const _0x1da241=_0x4c2323['target_file']??_0x4c2323['filePath']??_0x4c2323[_0x36f654(0x24d)]??_0x4c2323['file_path']??_0x4c2323[_0x36f654(0x231)];if(_0x1da241)_0x4c2323={..._0x4c2323,'path':_0x1da241};}_0x36f654(0x1d8)in _0x4c2323&&!(_0x36f654(0x1fd)in _0x4c2323)&&(_0x4c2323={..._0x4c2323,'instruction':_0x4c2323[_0x36f654(0x1d8)]});if(!(_0x36f654(0x240)in _0x4c2323)){const _0x1e731a=_0x4c2323['code']??_0x4c2323[_0x36f654(0x230)]??_0x4c2323[_0x36f654(0x17b)]??_0x4c2323[_0x36f654(0x1d1)];if(_0x1e731a)_0x4c2323={..._0x4c2323,'code_edit':_0x1e731a};}}const _0x245ff0=MorphEditFileArgsSchema[_0x36f654(0x167)](_0x4c2323);if(!_0x245ff0[_0x36f654(0x1b2)])throw new Error(_0x36f654(0x1e2)+_0x245ff0[_0x36f654(0x17f)]);const _0x487e49=await validatePath(_0x245ff0[_0x36f654(0x255)][_0x36f654(0x165)]);let _0x1b4aae=null,_0x5e087d=!![],_0x4f40df=null;try{_0x1b4aae=await a0_0x4dc500['readFile'](_0x487e49,_0x36f654(0x253)),logger[_0x36f654(0x14c)](_0x36f654(0x227),_0x36f654(0x1d3),{'path':_0x487e49,'size_bytes':_0x1b4aae[_0x36f654(0x270)]});}catch(_0xd4b36f){const _0x309e8=_0xd4b36f[_0x36f654(0x22a)];_0x309e8==='ENOENT'?(_0x5e087d=![],_0x1b4aae='',logger[_0x36f654(0x14c)](_0x36f654(0x227),_0x36f654(0x1d3),{'path':_0x487e49,'exists':![]})):(_0x4f40df=_0x36f654(0x1a7)+(_0x309e8||_0x36f654(0x185))+_0x36f654(0x148)+(_0xd4b36f instanceof Error?_0xd4b36f[_0x36f654(0x208)]:String(_0xd4b36f)),logger[_0x36f654(0x17f)](_0x36f654(0x227),_0x36f654(0x220),{'path':_0x487e49,'error':_0x4f40df}),logMcpStderr(_0x36f654(0x1aa)+_0x4f40df));}let _0xcd5c72;try{const _0x4b803e=MORPH_API_KEY;if(!_0x4b803e)throw new Error(_0x36f654(0x1f7));const _0x31e2b6=a0_0x27fcca[_0x36f654(0x1bc)](_0x487e49),_0x215b7e=a0_0x27fcca[_0x36f654(0x178)](_0x487e49);logger[_0x36f654(0x14c)](_0x36f654(0x227),_0x36f654(0x26a),{'model':'morph-v3-fast','path':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x165)],'instruction_len':_0x245ff0['data'][_0x36f654(0x1fd)][_0x36f654(0x270)],'code_edit_len':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x240)]['length'],'original_code_len':_0x1b4aae?.[_0x36f654(0x270)]??0x0,'dry_run':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x144)]});const _0x44dcd3=Date[_0x36f654(0x1db)](),_0x1f3d1b=await executeEditFile({'target_filepath':_0x215b7e,'code_edit':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x240)],'instruction':_0x245ff0['data'][_0x36f654(0x1fd)]},{'morphApiKey':_0x4b803e,'morphApiUrl':MORPH_API_URL,'large':MORPH_LARGE_APPLY,'baseDir':_0x31e2b6,'autoWrite':!_0x245ff0['data']['dryRun'],'generateUdiff':![],'debug':![]}),_0x1a0880=Date['now']()-_0x44dcd3;_0xcd5c72=_0x1f3d1b[_0x36f654(0x23b)];if(!_0x1f3d1b['success'])throw new Error(_0x1f3d1b[_0x36f654(0x17f)]||_0x36f654(0x1b0));const _0xeb1789=_0x1f3d1b[_0x36f654(0x212)],_0x165ef1='added\x20'+_0xeb1789[_0x36f654(0x24e)]+',\x20removed\x20'+_0xeb1789['linesRemoved']+_0x36f654(0x245)+_0xeb1789[_0x36f654(0x18b)];logger[_0x36f654(0x14c)](_0x36f654(0x227),'tool_call_complete',{'tool':'edit_file','success':!![],'latency_ms':Date['now']()-_0x64da5a,'edit_latency_ms':_0x1a0880,'changes':{'added':_0xeb1789['linesAdded'],'removed':_0xeb1789[_0x36f654(0x22d)],'modified':_0xeb1789[_0x36f654(0x18b)]},'completion_id':_0xcd5c72});if(_0x245ff0[_0x36f654(0x255)]['dryRun'])return{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x155)+(_0x5e087d?'':'\x20(new\x20file)')+':\x20'+_0x245ff0[_0x36f654(0x255)][_0x36f654(0x1fd)]+_0x36f654(0x244)+_0x165ef1+'.\x20Path:\x20'+_0x245ff0[_0x36f654(0x255)][_0x36f654(0x165)]+'.'}]};return{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x17c)+(_0x5e087d?_0x36f654(0x1ea):_0x36f654(0x1eb))+':\x20'+_0x245ff0[_0x36f654(0x255)][_0x36f654(0x1fd)]+_0x36f654(0x244)+_0x165ef1+_0x36f654(0x204)+_0x245ff0[_0x36f654(0x255)][_0x36f654(0x165)]+'.'}]};}catch(_0x1e181f){const _0x4bb6c6=handleMorphAPIError(_0x1e181f);if(_0x4bb6c6)return logger[_0x36f654(0x17f)](_0x36f654(0x227),_0x36f654(0x1a9),{'tool':_0x36f654(0x23c),'error':_0x36f654(0x26e),'latency_ms':Date[_0x36f654(0x1db)]()-_0x64da5a}),_0x4bb6c6;const _0x4de622=_0x1e181f instanceof Error?_0x1e181f[_0x36f654(0x208)]:String(_0x1e181f);return logger[_0x36f654(0x17f)](_0x36f654(0x227),_0x36f654(0x1a9),{'tool':_0x36f654(0x23c),'error':_0x4de622,'path':_0x245ff0[_0x36f654(0x255)]['path'],'validated_path':_0x487e49,'latency_ms':Date[_0x36f654(0x1db)]()-_0x64da5a,'stack':_0x1e181f instanceof Error?_0x1e181f[_0x36f654(0x1c9)]:undefined}),reportMorphError({'error_message':_0x4de622,'error_type':_0x1e181f instanceof Error?_0x1e181f[_0x36f654(0x14b)][_0x36f654(0x25e)]:'UnknownError','context':{'tool':_0x36f654(0x23c),'completion_id':_0xcd5c72,'file_path':_0x245ff0['data'][_0x36f654(0x165)],'validated_path':_0x487e49,'instruction':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x1fd)],'model':MORPH_LARGE_APPLY?_0x36f654(0x206):_0x36f654(0x250),'dry_run':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x144)],'file_exists':_0x5e087d,'file_read_error':_0x4f40df,'file_readable':_0x1b4aae!==null,'request_content':{'path':_0x245ff0[_0x36f654(0x255)]['path'],'code_edit':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x240)],'instruction':_0x245ff0[_0x36f654(0x255)][_0x36f654(0x1fd)],'original_code':_0x1b4aae!==null?_0x1b4aae[_0x36f654(0x270)]>0xc350?_0x1b4aae['substring'](0x0,0xc350)+_0x36f654(0x188)+_0x1b4aae[_0x36f654(0x270)]+_0x36f654(0x14a):_0x1b4aae:_0x36f654(0x168)+(_0x4f40df||_0x36f654(0x22c))+']','original_code_length':_0x1b4aae?.[_0x36f654(0x270)]??0x0,'model':MORPH_LARGE_APPLY?'morph-v3-large':_0x36f654(0x250),'dry_run':_0x245ff0[_0x36f654(0x255)]['dryRun']}},'stack_trace':_0x1e181f instanceof Error?_0x1e181f[_0x36f654(0x1c9)]:undefined,'source':'mcp-filesystem'})[_0x36f654(0x20c)](()=>{}),{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x1a6)+_0x4de622}],'isError':!![]};}}case TOOL_NAMES[_0x36f654(0x232)]:{const _0x14cf1c=WarpGrepArgsSchema[_0x36f654(0x167)](_0x431357);if(!_0x14cf1c[_0x36f654(0x1b2)])return{'content':[{'type':'text','text':_0x36f654(0x15a)+_0x14cf1c[_0x36f654(0x17f)]}],'isError':!![]};const _0x1fd9e8=_0x1b9cc6=>{const _0x146211=_0x36f654,_0x482b6a=[];for(const _0x3d13ce of _0x1b9cc6||[]){if(_0x3d13ce[_0x146211(0x268)]==='assistant'&&Array['isArray'](_0x3d13ce[_0x146211(0x179)]))for(const _0x31f4b7 of _0x3d13ce['tool_calls']){try{const _0x47e7b7=_0x31f4b7[_0x146211(0x23a)]?.['name'],_0x181326=JSON[_0x146211(0x247)](_0x31f4b7[_0x146211(0x23a)]?.['arguments']||'{}');if(_0x47e7b7==='grep_search')_0x482b6a[_0x146211(0x189)](_0x146211(0x25a)+_0x181326[_0x146211(0x16b)]+'\x27\x20'+(_0x181326[_0x146211(0x165)]||'.'));else{if(_0x47e7b7===_0x146211(0x202))_0x482b6a[_0x146211(0x189)]('read\x20'+_0x181326[_0x146211(0x165)]);else{if(_0x47e7b7===_0x146211(0x1ff))_0x482b6a[_0x146211(0x189)](_0x146211(0x19b)+(_0x181326[_0x146211(0x177)]||'.'));else{if(_0x47e7b7==='glob')_0x482b6a[_0x146211(0x189)]('glob\x20\x27'+_0x181326[_0x146211(0x16b)]+'\x27\x20'+(_0x181326[_0x146211(0x165)]||'.'));else _0x47e7b7===_0x146211(0x266)&&_0x482b6a[_0x146211(0x189)](_0x146211(0x266));}}}}catch{}}}return _0x482b6a;},_0x4c524d=_0x1187fe=>{const _0x38df6e=_0x36f654,_0x5f0166=[];if(!_0x1187fe||!Array['isArray'](_0x1187fe))return _0x5f0166;const _0x202fc4=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':_0x38df6e(0x1c4),'tool':_0x38df6e(0x202)},{'pattern':/\[PATH ERROR\]/,'error_type':_0x38df6e(0x1df),'tool':'read'},{'pattern':/\[READ ERROR\]/,'error_type':_0x38df6e(0x246),'tool':_0x38df6e(0x202)},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0x38df6e(0x1e0),'tool':_0x38df6e(0x202)},{'pattern':/\[RIPGREP ERROR\]/,'error_type':'RipgrepError','tool':'grep'},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':_0x38df6e(0x1ee),'tool':_0x38df6e(0x216)},{'pattern':/\[BINARY FILE\]/,'error_type':'BinaryFile','tool':'read'},{'pattern':/\[SYMLINK\]/,'error_type':'SymlinkError','tool':_0x38df6e(0x202)},{'pattern':/not a text file/,'error_type':'BinaryFile','tool':_0x38df6e(0x202)},{'pattern':/symbolic link/,'error_type':_0x38df6e(0x203),'tool':_0x38df6e(0x202)},{'pattern':/Error reading file:/,'error_type':_0x38df6e(0x246),'tool':'read'},{'pattern':/status="error"/,'error_type':_0x38df6e(0x176),'tool':_0x38df6e(0x185)}];let _0x11674a=0x0;for(const _0x42351a of _0x1187fe){_0x42351a[_0x38df6e(0x268)]==='assistant'&&Array[_0x38df6e(0x209)](_0x42351a['tool_calls'])&&_0x11674a++;const _0x1459f6=_0x42351a['content'];if((_0x42351a[_0x38df6e(0x268)]===_0x38df6e(0x170)||_0x42351a[_0x38df6e(0x268)]===_0x38df6e(0x235))&&_0x1459f6&&typeof _0x1459f6===_0x38df6e(0x149))for(const {pattern:_0x36c4c0,error_type:_0x56bf53,tool:_0x245751}of _0x202fc4){const _0x560fff=_0x1459f6[_0x38df6e(0x169)](new RegExp(_0x36c4c0['source'],'g'));if(_0x560fff)for(const _0x5734cb of _0x560fff){const _0x57fcb5=_0x1459f6['indexOf'](_0x5734cb),_0xdebf4d=_0x1459f6['substring'](_0x57fcb5,Math[_0x38df6e(0x1a1)](_0x57fcb5+0xc8,_0x1459f6[_0x38df6e(0x270)]));_0x5f0166[_0x38df6e(0x189)]({'tool':_0x245751,'error_type':_0x56bf53,'error_message':_0xdebf4d['split']('\x0a')[0x0],'turn':_0x11674a});}}}return _0x5f0166;};try{const _0x1228b=a0_0x27fcca[_0x36f654(0x1c1)](_0x14cf1c[_0x36f654(0x255)]['repo_path']),_0x1e663d=_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x1cc)],_0x499cb3=_0x1e663d==='node_modules'?{'allowNames':['node_modules']}:undefined,_0x30dcec=new LocalRipgrepProvider(_0x1228b,undefined,_0x499cb3);logger[_0x36f654(0x14c)]('MCP','provider_created',{'type':_0x36f654(0x23d),'repo_root':_0x1228b,'search_type':_0x1e663d||_0x36f654(0x193)}),logger[_0x36f654(0x14c)]('MCP','warp_grep_start',{'query':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x182)],'repo_root':_0x1228b,'timeout_ms':MORPH_WARP_GREP_TIMEOUT});const _0x14b848=Date['now'](),_0x4b2dd3=await runWarpGrep({'searchTerm':_0x14cf1c['data'][_0x36f654(0x182)],'repoRoot':_0x1228b,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x30dcec,'search_type':_0x1e663d}),_0x1f61d1=Date[_0x36f654(0x1db)]()-_0x14b848,_0x19af0a=_0x4b2dd3[_0x36f654(0x266)]?.[_0x36f654(0x249)]?.['files']?.[_0x36f654(0x270)]??0x0;logger[_0x36f654(0x14c)](_0x36f654(0x227),_0x36f654(0x147),{'termination':_0x4b2dd3[_0x36f654(0x173)],'turns':_0x4b2dd3[_0x36f654(0x24a)]?.[_0x36f654(0x237)]??0x0,'files_found':_0x19af0a,'latency_ms':_0x1f61d1});const _0x5ee55b=_0x4c524d(_0x4b2dd3[_0x36f654(0x1af)]);_0x5ee55b['length']>0x0&&reportMorphError({'error_message':_0x36f654(0x1f1)+_0x5ee55b[_0x36f654(0x270)]+_0x36f654(0x19e),'error_type':'SubToolError','level':_0x36f654(0x1ac),'tool':_0x36f654(0x163),'context':{'repo_path':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)],'query':_0x14cf1c[_0x36f654(0x255)]['search_string'],'model':_0x36f654(0x25f),'termination_reason':_0x4b2dd3[_0x36f654(0x173)],'sub_tool_errors':_0x5ee55b,'timings':_0x4b2dd3[_0x36f654(0x24a)],'tool_calls':_0x1fd9e8(_0x4b2dd3[_0x36f654(0x1af)]),'messages':_0x4b2dd3['messages']?.['map'](_0x1f70e9=>({'role':_0x1f70e9['role'],'content':_0x1f70e9['content'],..._0x1f70e9[_0x36f654(0x179)]?{'tool_calls':_0x1f70e9[_0x36f654(0x179)][_0x36f654(0x270)]}:{},..._0x1f70e9[_0x36f654(0x271)]?{'tool_call_id':_0x1f70e9[_0x36f654(0x271)]}:{}}))},'source':'mcp-filesystem'})[_0x36f654(0x20c)](()=>{});let _0x233d6f='';if(_0x4b2dd3[_0x36f654(0x173)]===_0x36f654(0x1de)&&_0x4b2dd3['finish']?.['metadata']?.[_0x36f654(0x24f)]){const _0x4d8c92=_0x4b2dd3[_0x36f654(0x266)][_0x36f654(0x249)]['files'];if(_0x4d8c92[_0x36f654(0x270)]===0x0)return _0x233d6f=_0x4b2dd3[_0x36f654(0x266)][_0x36f654(0x248)]||_0x36f654(0x157),{'content':[{'type':_0x36f654(0x1a8),'text':_0x233d6f}]};const _0xa0d50=[],_0x14dfee=[_0x36f654(0x174)];for(const _0x408faf of _0x4b2dd3[_0x36f654(0x1af)]){if(_0x408faf[_0x36f654(0x268)]==='assistant'&&Array[_0x36f654(0x209)](_0x408faf[_0x36f654(0x179)]))for(const _0x35619b of _0x408faf[_0x36f654(0x179)]){try{const _0xcbd6a=_0x35619b['function']?.[_0x36f654(0x25e)],_0x1a1a4f=JSON[_0x36f654(0x247)](_0x35619b['function']?.[_0x36f654(0x15c)]||'{}');if(_0xcbd6a==='grep_search')_0x14dfee[_0x36f654(0x189)](_0x36f654(0x234)+_0x1a1a4f[_0x36f654(0x16b)]+'\x27\x20in\x20`'+(_0x1a1a4f[_0x36f654(0x165)]||'.')+'`');else{if(_0xcbd6a===_0x36f654(0x202))_0x14dfee[_0x36f654(0x189)](_0x36f654(0x1a3)+_0x1a1a4f['path']+'`');else{if(_0xcbd6a==='list_directory')_0x14dfee[_0x36f654(0x189)](_0x36f654(0x1ae)+(_0x1a1a4f['command']||'.')+'`');else _0xcbd6a===_0x36f654(0x1f5)&&_0x14dfee[_0x36f654(0x189)]('-\x20Glob\x20search\x20`'+_0x1a1a4f['pattern']+'`\x20in\x20`'+(_0x1a1a4f[_0x36f654(0x165)]||'.')+'`');}}}catch{}}}_0xa0d50[_0x36f654(0x189)](_0x14dfee[_0x36f654(0x156)]('\x0a'));const _0x3565dd=['','Relevant\x20context\x20found:'];for(const _0x5fbdc1 of _0x4d8c92){if(_0x5fbdc1[_0x36f654(0x1ab)]==='*')_0x3565dd['push']('-\x20'+_0x5fbdc1[_0x36f654(0x165)]+':*');else{if(Array[_0x36f654(0x209)](_0x5fbdc1[_0x36f654(0x1ab)])){const _0x208a5a=_0x5fbdc1[_0x36f654(0x1ab)][_0x36f654(0x190)](([_0x5dd74e,_0x369ae6])=>{if(_0x5dd74e===_0x369ae6)return''+_0x5dd74e;return _0x5dd74e+'-'+_0x369ae6;});_0x3565dd['push']('-\x20'+_0x5fbdc1['path']+':'+_0x208a5a[_0x36f654(0x156)](','));}else _0x3565dd[_0x36f654(0x189)]('-\x20'+_0x5fbdc1['path']+':*');}}_0x3565dd['push'](''),_0xa0d50[_0x36f654(0x189)](_0x3565dd[_0x36f654(0x156)]('\x0a')),_0xa0d50[_0x36f654(0x189)](_0x36f654(0x1d2));const _0x36fa76=[],_0x187b8f=[];for(const _0x103638 of _0x4d8c92){let _0x4b66d4=a0_0x27fcca[_0x36f654(0x1c1)](_0x14cf1c[_0x36f654(0x255)]['repo_path'],_0x103638[_0x36f654(0x165)]),_0x5a2185=null,_0x53bfa5=null;try{_0x5a2185=await a0_0x4dc500[_0x36f654(0x261)](_0x4b66d4,{'encoding':_0x36f654(0x253)});}catch(_0x5eaf32){const _0xffc80c=fixPathRepetition(_0x4b66d4);if(_0xffc80c)try{_0x5a2185=await a0_0x4dc500[_0x36f654(0x261)](_0xffc80c,{'encoding':_0x36f654(0x253)}),_0x4b66d4=_0xffc80c;}catch{_0x53bfa5=_0x5eaf32 instanceof Error?_0x5eaf32:new Error(String(_0x5eaf32));}else _0x53bfa5=_0x5eaf32 instanceof Error?_0x5eaf32:new Error(String(_0x5eaf32));}if(_0x5a2185!==null){const _0x502d53=_0x5a2185[_0x36f654(0x1d0)](/\r?\n/),_0x582d8f=[];if(_0x103638[_0x36f654(0x1ab)]==='*'||!Array[_0x36f654(0x209)](_0x103638[_0x36f654(0x1ab)]))for(let _0x3174a6=0x1;_0x3174a6<=_0x502d53[_0x36f654(0x270)];_0x3174a6++){const _0xeabbbf=_0x502d53[_0x3174a6-0x1];_0x582d8f[_0x36f654(0x189)](_0x3174a6+'|\x20'+_0xeabbbf);}else for(const [_0x7b7e6f,_0x414659]of _0x103638[_0x36f654(0x1ab)]){_0x582d8f[_0x36f654(0x270)]>0x0&&_0x582d8f[_0x36f654(0x189)]('');for(let _0x50735e=_0x7b7e6f;_0x50735e<=_0x414659&&_0x50735e<=_0x502d53[_0x36f654(0x270)];_0x50735e++){const _0x5af397=_0x502d53[_0x50735e-0x1];_0x582d8f[_0x36f654(0x189)](_0x50735e+'|\x20'+_0x5af397);}}_0x187b8f[_0x36f654(0x189)]({'path':_0x103638[_0x36f654(0x165)],'content':_0x582d8f['join']('\x0a')});}else _0x36fa76[_0x36f654(0x189)](_0x36f654(0x215)+_0x103638[_0x36f654(0x165)]+_0x36f654(0x1f3)+(_0x53bfa5?.['message']||_0x36f654(0x20f))+_0x36f654(0x1f0));}try{const _0x2bab0f=await compactFileContexts(_0x187b8f,_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x182)],MORPH_API_KEY,MORPH_API_URL);for(const _0x526760 of _0x2bab0f){_0x36fa76[_0x36f654(0x189)](_0x36f654(0x215)+_0x526760[_0x36f654(0x165)]+_0x36f654(0x187)+_0x526760['content']+_0x36f654(0x1f0));}}catch(_0x13ebbe){logger[_0x36f654(0x1ac)](_0x36f654(0x227),'compaction_failed',{'error':_0x13ebbe instanceof Error?_0x13ebbe[_0x36f654(0x208)]:String(_0x13ebbe),'files_count':_0x187b8f[_0x36f654(0x270)]});for(const _0x23a705 of _0x187b8f){_0x36fa76[_0x36f654(0x189)](_0x36f654(0x215)+_0x23a705[_0x36f654(0x165)]+_0x36f654(0x187)+_0x23a705[_0x36f654(0x17b)]+_0x36f654(0x1f0));}}_0xa0d50[_0x36f654(0x189)](_0x36fa76[_0x36f654(0x156)]('\x0a\x0a')),_0x233d6f=_0xa0d50[_0x36f654(0x156)]('\x0a');const _0x4efe1a=_0x4b2dd3['errors']?.['filter'](_0x53cd09=>_0x53cd09[_0x36f654(0x208)]?.[_0x36f654(0x1ba)](_0x36f654(0x1c7)))||[];if(_0x4efe1a['length']>0x0){const _0x411446=_0x4efe1a[_0x36f654(0x190)](_0x5c9bbc=>_0x5c9bbc['message'])['join'](';\x20');reportMorphError({'error_message':_0x411446,'error_type':_0x36f654(0x1f2),'context':{'tool':_0x36f654(0x163),'repo_path':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)],'query':_0x14cf1c[_0x36f654(0x255)]['search_string'],'model':'morph-warp-grep-v2.1','termination_reason':_0x36f654(0x16f),'error_count':_0x4efe1a[_0x36f654(0x270)],'is_timeout':![],'timings':_0x4b2dd3[_0x36f654(0x24a)],'files_attempted':_0x4d8c92['map'](_0x5bfb70=>({'path':_0x5bfb70[_0x36f654(0x165)],'lines':_0x5bfb70[_0x36f654(0x1ab)]})),'tool_calls':_0x1fd9e8(_0x4b2dd3['messages']),'messages':_0x4b2dd3[_0x36f654(0x1af)]?.['map'](_0x2902f7=>({'role':_0x2902f7['role'],'content':_0x2902f7[_0x36f654(0x17b)],..._0x2902f7[_0x36f654(0x179)]?{'tool_calls':_0x2902f7[_0x36f654(0x179)][_0x36f654(0x270)]}:{},..._0x2902f7[_0x36f654(0x271)]?{'tool_call_id':_0x2902f7[_0x36f654(0x271)]}:{}})),'request_content':{'query':_0x14cf1c[_0x36f654(0x255)]['search_string'],'repo_path':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)],'repoRoot':a0_0x27fcca[_0x36f654(0x1c1)](_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)]),'model':'morph-warp-grep-v2.1'}},'source':_0x36f654(0x192)})[_0x36f654(0x20c)](()=>{});}}else{if(_0x4b2dd3[_0x36f654(0x173)]===_0x36f654(0x1e7)&&_0x4b2dd3[_0x36f654(0x1c2)]['length']>0x0){const _0x3817e2=_0x4b2dd3[_0x36f654(0x1c2)][_0x36f654(0x190)](_0x4b8f5d=>_0x4b8f5d[_0x36f654(0x208)])['join'](';\x20');_0x233d6f=_0x36f654(0x26b)+_0x3817e2;const _0x163eeb=_0x3817e2[_0x36f654(0x1ca)]()['includes'](_0x36f654(0x20d))||_0x3817e2[_0x36f654(0x1ca)]()[_0x36f654(0x184)](_0x36f654(0x241))||_0x3817e2['toLowerCase']()['includes'](_0x36f654(0x260)),_0x4f213e=_0x4b2dd3[_0x36f654(0x266)]?.[_0x36f654(0x249)]?.[_0x36f654(0x24f)],_0x30833e=_0x4b2dd3[_0x36f654(0x1c2)][0x0];reportMorphError({'error_message':_0x3817e2,'error_type':_0x163eeb?_0x36f654(0x1c0):_0x30833e?.['constructor']?.[_0x36f654(0x25e)]||'WarpGrepError','context':{'tool':'codebase_search','repo_path':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)],'query':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x182)],'model':_0x36f654(0x25f),'termination_reason':_0x4b2dd3[_0x36f654(0x173)],'error_count':_0x4b2dd3[_0x36f654(0x1c2)][_0x36f654(0x270)],'is_timeout':_0x163eeb,'timings':_0x4b2dd3['timings'],'files_attempted':_0x4f213e?.[_0x36f654(0x190)](_0x340fc0=>({'path':_0x340fc0[_0x36f654(0x165)],'lines':_0x340fc0[_0x36f654(0x1ab)]})),'tool_calls':_0x1fd9e8(_0x4b2dd3['messages']),'messages':_0x4b2dd3[_0x36f654(0x1af)]?.[_0x36f654(0x190)](_0x38e507=>({'role':_0x38e507[_0x36f654(0x268)],'content':_0x38e507[_0x36f654(0x17b)],..._0x38e507[_0x36f654(0x179)]?{'tool_calls':_0x38e507[_0x36f654(0x179)][_0x36f654(0x270)]}:{},..._0x38e507[_0x36f654(0x271)]?{'tool_call_id':_0x38e507[_0x36f654(0x271)]}:{}})),'request_content':{'query':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x182)],'repo_path':_0x14cf1c[_0x36f654(0x255)]['repo_path'],'repoRoot':a0_0x27fcca[_0x36f654(0x1c1)](_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)]),'model':'morph-warp-grep-v2.1'}},'stack_trace':_0x30833e?.[_0x36f654(0x1c9)]||undefined,'source':_0x36f654(0x192)})[_0x36f654(0x20c)](()=>{});}else _0x233d6f='Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.';}return{'content':[{'type':_0x36f654(0x1a8),'text':_0x233d6f}]};}catch(_0xa97157){const _0x4032cf=handleMorphAPIError(_0xa97157);if(_0x4032cf)return logger['error'](_0x36f654(0x227),_0x36f654(0x1a9),{'tool':_0x36f654(0x163),'error':_0x36f654(0x26e),'latency_ms':Date['now']()-_0x64da5a}),_0x4032cf;const _0x1f72ef=_0xa97157 instanceof Error?_0xa97157[_0x36f654(0x208)]:String(_0xa97157);logger[_0x36f654(0x17f)]('MCP',_0x36f654(0x1a9),{'tool':_0x36f654(0x163),'error':_0x1f72ef,'repo_path':_0x14cf1c[_0x36f654(0x255)]['repo_path'],'query':_0x14cf1c[_0x36f654(0x255)]['search_string'],'latency_ms':Date[_0x36f654(0x1db)]()-_0x64da5a});const _0x2d8f2b=_0x1f72ef[_0x36f654(0x1ca)]()[_0x36f654(0x184)](_0x36f654(0x20d))||_0x1f72ef[_0x36f654(0x1ca)]()[_0x36f654(0x184)](_0x36f654(0x241))||_0x1f72ef['toLowerCase']()[_0x36f654(0x184)]('etimedout')||_0xa97157 instanceof Error&&_0xa97157[_0x36f654(0x25e)]===_0x36f654(0x1c0);return reportMorphError({'error_message':_0x1f72ef,'error_type':_0x2d8f2b?'TimeoutError':_0xa97157 instanceof Error?_0xa97157[_0x36f654(0x14b)]['name']:_0x36f654(0x201),'context':{'tool':_0x36f654(0x163),'repo_path':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)],'query':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x182)],'model':_0x36f654(0x25f),'is_timeout':_0x2d8f2b,'exception_phase':_0x36f654(0x145),'request_content':{'query':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x182)],'repo_path':_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)],'repoRoot':a0_0x27fcca[_0x36f654(0x1c1)](_0x14cf1c[_0x36f654(0x255)][_0x36f654(0x226)]),'model':'morph-warp-grep-v2.1'}},'stack_trace':_0xa97157 instanceof Error?_0xa97157[_0x36f654(0x1c9)]:undefined,'source':_0x36f654(0x192)})['catch'](()=>{}),{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x1d7)+_0x1f72ef}],'isError':![]};}}case TOOL_NAMES['GITHUB_CODEBASE_SEARCH']:{const _0x474f1f=WarpGrepGitHubArgsSchema[_0x36f654(0x167)](_0x431357);if(!_0x474f1f['success'])return{'content':[{'type':_0x36f654(0x1a8),'text':'Invalid\x20arguments:\x20'+_0x474f1f['error']}],'isError':!![]};const _0x11fa01=_0x474f1f[_0x36f654(0x255)]['github_url']||_0x474f1f['data'][_0x36f654(0x257)];if(!_0x11fa01)return{'content':[{'type':_0x36f654(0x1a8),'text':'Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id'}],'isError':!![]};const _0x5821e9=MORPH_API_KEY;if(!_0x5821e9)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.');const _0xe18c2b=Date[_0x36f654(0x1db)]();logger[_0x36f654(0x14c)]('MCP',_0x36f654(0x20a),{'identifier':_0x11fa01,'query':_0x474f1f[_0x36f654(0x255)][_0x36f654(0x182)],'branch':_0x474f1f[_0x36f654(0x255)][_0x36f654(0x1c6)]});try{const _0x1f3515=new WarpGrepClient({'morphApiKey':_0x5821e9,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x5d2254=await _0x1f3515[_0x36f654(0x15e)]({'searchTerm':_0x474f1f[_0x36f654(0x255)]['search_string'],'github':_0x11fa01,'branch':_0x474f1f[_0x36f654(0x255)][_0x36f654(0x1c6)]}),_0x3ff45e=Date[_0x36f654(0x1db)]()-_0xe18c2b;logMcpStderr('[github_codebase_search]\x20Done\x20in\x20'+_0x3ff45e+_0x36f654(0x254)+_0x5d2254[_0x36f654(0x1b2)]);const _0x22daca=formatResult(_0x5d2254);return{'content':[{'type':'text','text':_0x22daca}]};}catch(_0x4311d4){const _0x42ec38=handleMorphAPIError(_0x4311d4);if(_0x42ec38)return _0x42ec38;const _0x5c89ef=Date[_0x36f654(0x1db)]()-_0xe18c2b,_0x537f1c=_0x4311d4 instanceof Error?_0x4311d4[_0x36f654(0x208)]:String(_0x4311d4);return logMcpStderr(_0x36f654(0x1f9)+_0x5c89ef+_0x36f654(0x21f),_0x537f1c),reportMorphError({'error_message':_0x537f1c,'error_type':_0x4311d4 instanceof Error?_0x4311d4[_0x36f654(0x14b)][_0x36f654(0x25e)]:_0x36f654(0x201),'context':{'tool':_0x36f654(0x251),'github_url':_0x11fa01,'search_string':_0x474f1f['data'][_0x36f654(0x182)],'branch':_0x474f1f['data'][_0x36f654(0x1c6)]},'stack_trace':_0x4311d4 instanceof Error?_0x4311d4[_0x36f654(0x1c9)]:undefined,'source':_0x36f654(0x192),'tool':'github_codebase_search','latency_ms':_0x5c89ef})[_0x36f654(0x20c)](()=>{}),{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x18f)+_0x537f1c}],'isError':![]};}}default:throw new Error(_0x36f654(0x1ed)+_0x33cf74);}}catch(_0x150f2b){const _0x48f2a4=_0x150f2b instanceof Error?_0x150f2b['message']:String(_0x150f2b);return reportMorphError({'error_message':_0x48f2a4,'error_type':_0x150f2b instanceof Error?_0x150f2b['constructor'][_0x36f654(0x25e)]:_0x36f654(0x201),'context':{'tool':_0x33cf74,'arguments':_0x431357?JSON[_0x36f654(0x228)](_0x431357)[_0x36f654(0x1cd)](0x0,0x1f4):undefined,'mcp_server_version':_0x36f654(0x1cf)},'stack_trace':_0x150f2b instanceof Error?_0x150f2b[_0x36f654(0x1c9)]:undefined,'source':_0x36f654(0x192)})[_0x36f654(0x20c)](()=>{}),{'content':[{'type':_0x36f654(0x1a8),'text':_0x36f654(0x26b)+_0x48f2a4}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x59a480){const _0x5c506c=a0_0x56a8fe,_0x5034e3=await getValidRootDirectories(_0x59a480);if(_0x5034e3[_0x5c506c(0x270)]>0x0)allowedDirectories=[..._0x5034e3],logMcpStderr(_0x5c506c(0x219)+_0x5034e3['length']+'\x20valid\x20directories');else{logMcpStderr(_0x5c506c(0x166));if(ENABLE_WORKSPACE_MODE)try{const _0x46bc26=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x46bc26&&(allowedDirectories=[_0x46bc26],logMcpStderr(_0x5c506c(0x172)+_0x46bc26));}catch(_0x383dcd){logMcpStderr('Warning:\x20Workspace\x20fallback\x20failed:\x20'+_0x383dcd);}}}server[a0_0x56a8fe(0x1c5)](RootsListChangedNotificationSchema,async()=>{const _0x68fc37=a0_0x56a8fe;try{const _0x1cac3d=await server[_0x68fc37(0x199)]();_0x1cac3d&&_0x68fc37(0x1cb)in _0x1cac3d&&await updateAllowedDirectoriesFromRoots(_0x1cac3d[_0x68fc37(0x1cb)]);}catch(_0x413cd5){logMcpStderr(_0x68fc37(0x1fc),_0x413cd5 instanceof Error?_0x413cd5[_0x68fc37(0x208)]:String(_0x413cd5));}}),server[a0_0x56a8fe(0x1dd)]=async()=>{const _0x18c4ae=a0_0x56a8fe,_0x124320=server['getClientCapabilities']();if(_0x124320?.[_0x18c4ae(0x1cb)])try{const _0x4b9d3e=await server['listRoots']();_0x4b9d3e&&_0x18c4ae(0x1cb)in _0x4b9d3e?await updateAllowedDirectoriesFromRoots(_0x4b9d3e[_0x18c4ae(0x1cb)]):logMcpStderr(_0x18c4ae(0x22e));}catch(_0x207b77){logMcpStderr('Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:',_0x207b77 instanceof Error?_0x207b77[_0x18c4ae(0x208)]:String(_0x207b77));}else{if(allowedDirectories['length']>0x0)logMcpStderr(_0x18c4ae(0x22f),allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)logMcpStderr(_0x18c4ae(0x164));else throw new Error(_0x18c4ae(0x16a));}}};async function runServer(){const _0x431daa=a0_0x56a8fe,_0x159eed=new StdioServerTransport();await server[_0x431daa(0x224)](_0x159eed),logMcpStderr('Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio'),allowedDirectories[_0x431daa(0x270)]===0x0&&logMcpStderr(_0x431daa(0x1dc));}runServer()[a0_0x56a8fe(0x20c)](_0x1a5b3c=>{const _0x23ab40=a0_0x56a8fe;logMcpStderr('Fatal\x20error\x20running\x20server:',_0x1a5b3c),process[_0x23ab40(0x1a0)](0x1);});
2
+ const a0_0x525535=a0_0x4b31;(function(_0x3f2428,_0x129863){const _0x3ee4e4=a0_0x4b31,_0x11ae3e=_0x3f2428();while(!![]){try{const _0x120332=parseInt(_0x3ee4e4(0x25f))/0x1*(parseInt(_0x3ee4e4(0x152))/0x2)+-parseInt(_0x3ee4e4(0x26f))/0x3+-parseInt(_0x3ee4e4(0x1c8))/0x4*(-parseInt(_0x3ee4e4(0x1ae))/0x5)+-parseInt(_0x3ee4e4(0x157))/0x6*(parseInt(_0x3ee4e4(0x236))/0x7)+-parseInt(_0x3ee4e4(0x1dc))/0x8+parseInt(_0x3ee4e4(0x275))/0x9*(-parseInt(_0x3ee4e4(0x1ec))/0xa)+parseInt(_0x3ee4e4(0x197))/0xb*(parseInt(_0x3ee4e4(0x150))/0xc);if(_0x120332===_0x129863)break;else _0x11ae3e['push'](_0x11ae3e['shift']());}catch(_0x585d19){_0x11ae3e['push'](_0x11ae3e['shift']());}}}(a0_0x2805,0x76da9));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_0x4128a0 from'fs/promises';import a0_0x368898 from'path';import a0_0x55064c 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{logger}from'./logger.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{compactFileContexts}from'@morphllm/morphsdk/tools/compact';import a0_0x598df from'axios';import{KNOWN_TOOL_NAMES,TOOL_NAMES}from'./tool-definitions.js';function fixPathRepetition(_0x35a4c3){const _0x97e2d0=a0_0x4b31,_0x5d759e=_0x35a4c3[_0x97e2d0(0x253)](a0_0x368898[_0x97e2d0(0x1b8)])['filter'](Boolean);if(_0x5d759e[_0x97e2d0(0x1b2)]<0x2)return null;for(let _0x2beec2=Math[_0x97e2d0(0x158)](_0x5d759e[_0x97e2d0(0x1b2)]/0x2);_0x2beec2>=0x1;_0x2beec2--){for(let _0x32e744=0x0;_0x32e744<=_0x5d759e[_0x97e2d0(0x1b2)]-0x2*_0x2beec2;_0x32e744++){const _0x48946c=_0x5d759e[_0x97e2d0(0x1bf)](_0x32e744,_0x32e744+_0x2beec2),_0x1f68ee=_0x5d759e[_0x97e2d0(0x1bf)](_0x32e744+_0x2beec2,_0x32e744+0x2*_0x2beec2);if(_0x48946c['every']((_0x50444a,_0x45f659)=>_0x50444a===_0x1f68ee[_0x45f659])){const _0x2031f4=[..._0x5d759e[_0x97e2d0(0x1bf)](0x0,_0x32e744),..._0x5d759e[_0x97e2d0(0x1bf)](_0x32e744+_0x2beec2)];return a0_0x368898[_0x97e2d0(0x1b8)]+_0x2031f4[_0x97e2d0(0x25b)](a0_0x368898[_0x97e2d0(0x1b8)]);}}}return null;}const require=createRequire(import.meta.url);function getPackageVersion(){const _0xec0b91=a0_0x4b31;try{const _0x30d7ab=require(_0xec0b91(0x23c));return _0x30d7ab[_0xec0b91(0x24c)]??_0xec0b91(0x199);}catch(_0x3f3593){return logMcpStderr('Warning:\x20Unable\x20to\x20determine\x20package\x20version:',_0x3f3593),_0xec0b91(0x199);}}function printHelp(){const _0x1bdc9c=a0_0x4b31;console[_0x1bdc9c(0x1c3)]('@morphllm/morphmcp\x20'+getPackageVersion()),console[_0x1bdc9c(0x1c3)](_0x1bdc9c(0x1cc)),console[_0x1bdc9c(0x1c3)](_0x1bdc9c(0x15c)),console['log'](_0x1bdc9c(0x1cd)),console[_0x1bdc9c(0x1c3)](_0x1bdc9c(0x1bd)),console[_0x1bdc9c(0x1c3)]('\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit'),console[_0x1bdc9c(0x1c3)](_0x1bdc9c(0x189)),console[_0x1bdc9c(0x1c3)]('\x20\x20morph-mcp'),console['log']('\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo');}const cliArgs=process[a0_0x525535(0x1ee)]['slice'](0x2),VERSION_FLAGS=new Set([a0_0x525535(0x181),'-v','-V']),HELP_FLAGS=new Set([a0_0x525535(0x18f),'-h']);cliArgs[a0_0x525535(0x26d)](_0x1408e7=>VERSION_FLAGS['has'](_0x1408e7))&&(console[a0_0x525535(0x1c3)](a0_0x525535(0x271)+getPackageVersion()),process[a0_0x525535(0x1d8)](0x0));cliArgs[a0_0x525535(0x26d)](_0x60b7b6=>HELP_FLAGS[a0_0x525535(0x187)](_0x60b7b6))&&(printHelp(),process['exit'](0x0));function getCliArg(_0x2bfa02){const _0xa5613e=a0_0x525535;for(let _0x55de95=0x0;_0x55de95<cliArgs['length'];_0x55de95++){const _0x5ee86d=cliArgs[_0x55de95];if(_0x5ee86d[_0xa5613e(0x1c9)]('--'+_0x2bfa02+'='))return _0x5ee86d[_0xa5613e(0x1bf)](('--'+_0x2bfa02+'=')[_0xa5613e(0x1b2)]);if(_0x5ee86d==='--'+_0x2bfa02&&_0x55de95+0x1<cliArgs[_0xa5613e(0x1b2)])return cliArgs[_0x55de95+0x1];}return undefined;}const args=[];for(let i=0x0;i<cliArgs[a0_0x525535(0x1b2)];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x525535(0x187)](arg)||HELP_FLAGS[a0_0x525535(0x187)](arg))continue;if(arg[a0_0x525535(0x1c9)](a0_0x525535(0x20b)))continue;if(arg===a0_0x525535(0x1e2)){i++;continue;}args['push'](arg);}const WORKSPACE_ROOT=process[a0_0x525535(0x1d2)][a0_0x525535(0x21d)]||process[a0_0x525535(0x1d2)]['PWD']||process[a0_0x525535(0x1ad)](),ENABLE_WORKSPACE_MODE=process[a0_0x525535(0x1d2)]['ENABLE_WORKSPACE_MODE']!==a0_0x525535(0x1c2),MORPH_API_KEY=getCliArg('api-key')??process[a0_0x525535(0x1d2)][a0_0x525535(0x25c)],MORPH_API_URL=process['env']['MORPH_API_URL'],MORPH_LARGE_APPLY=process[a0_0x525535(0x1d2)][a0_0x525535(0x215)]!==a0_0x525535(0x1c2),MORPH_WARP_GREP_TIMEOUT=process[a0_0x525535(0x1d2)][a0_0x525535(0x22b)]?parseInt(process['env']['MORPH_WARP_GREP_TIMEOUT'],0xa):undefined,OPERATING_SYSTEM_TYPE=getOperatingSystemType(),DEFAULT_DISABLED_TOOLS=new Set(),DISABLED_TOOLS=process[a0_0x525535(0x1d2)][a0_0x525535(0x1e5)]?new Set(process['env'][a0_0x525535(0x1e5)][a0_0x525535(0x253)](',')[a0_0x525535(0x1bb)](_0x1ff9f5=>_0x1ff9f5[a0_0x525535(0x237)]())[a0_0x525535(0x1c7)](_0x154417=>_0x154417[a0_0x525535(0x1b2)]>0x0)):DEFAULT_DISABLED_TOOLS;if(DISABLED_TOOLS[a0_0x525535(0x1f1)]>0x0){for(const tool of DISABLED_TOOLS){!KNOWN_TOOL_NAMES[a0_0x525535(0x187)](tool)&&console[a0_0x525535(0x225)](a0_0x525535(0x244)+tool+a0_0x525535(0x23d)+[...KNOWN_TOOL_NAMES][a0_0x525535(0x25b)](',\x20'));}console[a0_0x525535(0x225)](a0_0x525535(0x19c)+[...DISABLED_TOOLS][a0_0x525535(0x25b)](',\x20'));}function a0_0x4b31(_0x27aa1a,_0x2b0f35){_0x27aa1a=_0x27aa1a-0x14f;const _0x2805c9=a0_0x2805();let _0x4b3180=_0x2805c9[_0x27aa1a];return _0x4b3180;}function a0_0x2805(){const _0x5685ff=['normalize','Branch\x20to\x20search\x20(uses\x20latest\x20commit)','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','default','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.','role','unknown\x20error','file','\x20as\x20allowed\x20directory','mcp-filesystem','api_request_start','min','completed','now','etimedout','Here\x20is\x20the\x20content\x20of\x20files:\x0a','<file\x20path=\x22','-\x20Read\x20file\x20`','--version','ToolException','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:','array','glob','tool','has','read\x20','\x0aExamples:','toISOString','Rate\x20limited:\x20You\x27ve\x20exceeded\x20your\x20Morph\x20API\x20usage\x20limits.\x20Please\x20visit\x20https://morphllm.com\x20to\x20check\x20your\x20plan\x20and\x20purchase\x20additional\x20credits.','Bearer\x20','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','Tool\x20','--help','-\x20instruction:\x20Brief\x20first-person\x20description\x20of\x20what\x20you\x27re\x20changing\x0a','timeout','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','morph-warp-grep-v2.1','Unknown\x20tool:\x20','Fatal\x20error\x20running\x20server:','stringify','193017TfTZPQ','Tool\x20\x22','unknown','TimeoutError','changes','Disabled\x20tools:\x20','morph-v3-large','Morph\x20Edit\x20','Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','string','path_validation_resolved','tool_call_error','.\x20Path:\x20','\x0a...\x20(truncated,\x20total:\x20','UnknownError','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES.**\x20Fast,\x20accurate,\x20and\x20prevents\x20context\x20pollution.\x20Especially\x20useful\x20when\x20making\x20multiple\x20edits\x20in\x20one\x20file:\x20describe\x20all\x20changes\x20in\x20a\x20single\x20call\x20and\x20the\x20semantic\x20edit\x20applies\x20them\x20all\x20at\x20once,\x20more\x20accurately\x20and\x20faster\x20than\x20sequential\x20edits.\x20Unlike\x20search-and-replace\x20or\x20patch\x20edits\x20which\x20do\x20narrow\x20edits\x20one\x20at\x20a\x20time,\x20with\x20this\x20tool\x20you\x20should\x20do\x20all\x20your\x20code\x20changes\x20in\x20one\x20go\x20separated\x20by\x20`//\x20...\x20existing\x20code\x20...`\x20markers.\x20This\x20saves\x20tokens\x20and\x20improves\x20performance\x20because\x20you\x20do\x20not\x20need\x20to\x20reread\x20files\x20before\x20edits.\x20All\x20three\x20parameters\x20are\x20required.\x0a\x0a','Error:\x20','Authentication\x20failed:\x20Your\x20Morph\x20API\x20key\x20is\x20invalid\x20or\x20has\x20been\x20revoked.\x20Please\x20visit\x20https://morphllm.com\x20to\x20get\x20a\x20valid\x20API\x20key,\x20then\x20update\x20your\x20MCP\x20configuration.','Warning:\x20','BinaryFile','describe','cwd','2461210jmEfBv','No\x20relevant\x20code\x20found\x20for\x20the\x20query.','user','file_read_complete','length','-\x20Preserve\x20exact\x20indentation\x0a','MCP','SymlinkError','success','timings','sep','.cursor','Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.','map','dryRun','\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit','0.2.0','slice','\x20valid\x20directories','code','false','log','search_type','ReadError','No\x20Morph\x20API\x20key\x20configured.\x20Please\x20visit\x20https://morphllm.com\x20to\x20get\x20an\x20API\x20key,\x20then\x20set\x20MORPH_API_KEY\x20in\x20your\x20MCP\x20configuration.','filter','4FikJNP','startsWith','Morph\x20FastApply\x20failed\x20without\x20error\x20message','match','\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]','\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)','instructions','Invalid\x20arguments:\x20','searchGitHub','function','env','isArray','Specific\x20commit\x20hash\x20to\x20search','linesRemoved','terminationReason','\x20(new\x20file)','exit','grep','text','pyproject.toml','1450440TxwPhD','go.mod','includes','lines','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','[github_codebase_search]\x20Done\x20in\x20','--api-key','tool_call_id','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.\x20','DISABLED_TOOLS','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','metadata','safeParse','morph-v3-fast','listRoots','RipgrepNotAvailable','1970ElHsHK','https://morphllm.com/api/error-report','argv','.git','read','size','enum','number',',\x20removed\x20','turns','Warning:\x20Workspace\x20fallback\x20failed:\x20','Preview\x20changes\x20without\x20applying\x20them.','push','setRequestHandler','list_directory\x20','Unknown\x20error','instruction','warp_grep_start','morph-mcp','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','sk-','debug','github_url','code_edit','path_validation_failed','package.json','linesModified','terminated','optional','ms:','WarpGrepError','--api-key=','payload','oninitialized','Error\x20accessing\x20directory\x20','\x27\x20in\x20`','.\x20Changes:\x20','parse','search_string','realpath','path_validation_start','MORPH_LARGE_APPLY','\x0a</file>','codebase_search','runWarpGrep_call','roots','.vscode','status','morph-','WORKSPACE_ROOT','content','repo_path','A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.','new_string','name','Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:','target_filepath','error','Fallback:\x20Using\x20workspace\x20root\x20','tool_calls','arguments','isDirectory','message','MORPH_WARP_GREP_TIMEOUT','object','-\x20Grepped\x20\x27','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','RipgrepError','Invalid\x20Morph\x20API\x20key\x20format.\x20API\x20keys\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27.\x20Please\x20visit\x20https://morphllm.com\x20to\x20get\x20a\x20valid\x20API\x20key.','all','-\x20Glob\x20search\x20`','Created\x20File','-\x20For\x20deletions:\x20show\x20context\x20before\x20and\x20after,\x20omit\x20the\x20deleted\x20lines\x0a','File\x20read\x20error:','21YdTWKp','trim','Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all','grep_search','\x22\x20is\x20disabled\x20via\x20the\x20DISABLED_TOOLS\x20environment\x20variable\x20in\x20your\x20MCP\x20configuration.\x20Please\x20use\x20an\x20alternative\x20approach.','Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings','../package.json','\x22.\x20Known\x20tools:\x20','Cargo.toml','filePath','readFile','owner_repo','GitHub\x20search\x20failed:\x20','constructor','Warning:\x20DISABLED_TOOLS\x20contains\x20unknown\x20tool\x20\x22','grep\x20\x27','\x20disabled\x20via\x20DISABLED_TOOLS','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','source','EDIT_FILE','node_modules','substring','version','edit','ms.\x20Success:\x20','file_path','Workspace\x20mode\x20enabled:\x20Using\x20','composer.json','errors','split','Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)','Relevant\x20context\x20found:','finish','command','Parameters:\x0a','CODEBASE_SEARCH','timed\x20out','join','MORPH_API_KEY','toLowerCase','-\x20Batch\x20multiple\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a','176138mqauNo','ENOENT','catch','warn','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','stack','Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.','pattern','getClientCapabilities','added\x20','dirname','\x20-\x20','boolean','params','some','edit_file','60888OcpUYh','\x20is\x20not\x20a\x20directory','@morphllm/morphmcp\x20','data','files','context','33507seOadF','\x20error(s)','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','828FAtKhW','Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27','2GZEBjX','github_codebase_search','description','messages','\x22>\x0a','914532lCgqQo','floor','branch','completionId','assistant','\x0aOptions:','utf-8','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','-\x20Listed\x20directory\x20`','LocalRipgrepProvider','Applied','resolve','API\x20error\x20(auth/rate-limit)','indexOf','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20toolin\x20its\x20search.\x20','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.','\x20chars)','path','glob\x20\x27','response','❌\x20Morph\x20Edit\x20Failed:\x20','-\x20ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20for\x20unchanged\x20sections\x20(omitting\x20this\x20marker\x20will\x20cause\x20deletions)\x0a','`\x20in\x20`','[could\x20not\x20read\x20file:\x20'];a0_0x2805=function(){return _0x5685ff;};return a0_0x2805();}MORPH_API_KEY&&!MORPH_API_KEY[a0_0x525535(0x1c9)](a0_0x525535(0x200))&&!MORPH_API_KEY[a0_0x525535(0x1c9)]('morph-')&&logMcpStderr(a0_0x525535(0x151));async function reportMorphError(_0x47ead2){const _0x41f676=a0_0x525535;try{await a0_0x598df['post'](_0x41f676(0x1ed),{..._0x47ead2,'timestamp':new Date()[_0x41f676(0x18a)](),'source':_0x47ead2['source']||_0x41f676(0x178),'os_type':OPERATING_SYSTEM_TYPE,'context':{'os_type':OPERATING_SYSTEM_TYPE,..._0x47ead2[_0x41f676(0x274)]}},{'timeout':0x1388,'headers':{'Content-Type':'application/json','Authorization':_0x41f676(0x18c)+MORPH_API_KEY}});}catch{}}function extractStatusCode(_0x2eaf42,_0xe11803){const _0x13b306=a0_0x525535;if(_0x2eaf42&&typeof _0x2eaf42===_0x13b306(0x22c)&&'status'in _0x2eaf42)return _0x2eaf42[_0x13b306(0x21b)];if(_0x2eaf42&&typeof _0x2eaf42===_0x13b306(0x22c)&&_0x13b306(0x16a)in _0x2eaf42)return _0x2eaf42['response']?.['status'];const _0xba1d84=_0xe11803[_0x13b306(0x1cb)](/\b(401|429)\b/);return _0xba1d84?parseInt(_0xba1d84[0x1],0xa):null;}function handleMorphAPIError(_0x7c5507){const _0x2fdf45=a0_0x525535,_0x5dcfac=_0x7c5507 instanceof Error?_0x7c5507['message']:String(_0x7c5507),_0x2d3de8=extractStatusCode(_0x7c5507,_0x5dcfac);switch(_0x2d3de8){case 0x191:return{'content':[{'type':'text','text':_0x2fdf45(0x1a9)}],'isError':!![]};case 0x1ad:return{'content':[{'type':'text','text':_0x2fdf45(0x18b)}],'isError':!![]};default:return null;}}args[a0_0x525535(0x1b2)]===0x0&&!ENABLE_WORKSPACE_MODE&&(logMcpStderr('Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]'),logMcpStderr(a0_0x525535(0x1ff)),logMcpStderr(a0_0x525535(0x15e)),logMcpStderr('\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)'),logMcpStderr(a0_0x525535(0x247)),logMcpStderr('At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.'));function normalizePath(_0x4becee){const _0x43b16c=a0_0x525535;return a0_0x368898[_0x43b16c(0x16f)](_0x4becee);}function expandHome(_0x20acc7){const _0x190c16=a0_0x525535;if(_0x20acc7[_0x190c16(0x1c9)]('~/')||_0x20acc7==='~')return a0_0x368898[_0x190c16(0x25b)](a0_0x55064c['homedir'](),_0x20acc7[_0x190c16(0x1bf)](0x1));return _0x20acc7;}let allowedDirectories=await Promise[a0_0x525535(0x231)](args['map'](async _0x232691=>{const _0x44c3a6=a0_0x525535,_0x303ab1=expandHome(_0x232691),_0xc4839=a0_0x368898[_0x44c3a6(0x162)](_0x303ab1);try{const _0x480f82=await a0_0x4128a0['realpath'](_0xc4839);return normalizePath(_0x480f82);}catch(_0x4b206c){return normalizePath(_0xc4839);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x525535(0x1b2)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories[a0_0x525535(0x1f8)](workspaceDir),logMcpStderr(a0_0x525535(0x250)+workspaceDir+a0_0x525535(0x177)));}catch(a0_0x29d551){logMcpStderr(a0_0x525535(0x1a0)+a0_0x29d551);}async function detectWorkspaceRoot(_0x3653e7){const _0x57a79a=a0_0x525535;let _0x1c2d2d=a0_0x368898['resolve'](_0x3653e7);const _0x2767a1=[_0x57a79a(0x1ef),_0x57a79a(0x21a),_0x57a79a(0x205),_0x57a79a(0x23e),_0x57a79a(0x1db),_0x57a79a(0x1dd),_0x57a79a(0x1b9),'tsconfig.json',_0x57a79a(0x251)];while(_0x1c2d2d!==a0_0x368898['dirname'](_0x1c2d2d)){for(const _0x5ce410 of _0x2767a1){const _0x308231=a0_0x368898['join'](_0x1c2d2d,_0x5ce410);try{return await a0_0x4128a0['access'](_0x308231),normalizePath(_0x1c2d2d);}catch{}}_0x1c2d2d=a0_0x368898[_0x57a79a(0x269)](_0x1c2d2d);}return normalizePath(_0x3653e7);}await Promise[a0_0x525535(0x231)](args[a0_0x525535(0x1bb)](async _0x4e200e=>{const _0x519e98=a0_0x525535;try{const _0x18e91d=await a0_0x4128a0['stat'](expandHome(_0x4e200e));!_0x18e91d[_0x519e98(0x229)]()&&(logMcpStderr(_0x519e98(0x1a8)+_0x4e200e+_0x519e98(0x270)),process[_0x519e98(0x1d8)](0x1));}catch(_0xb341e8){logMcpStderr(_0x519e98(0x20e)+_0x4e200e+':',_0xb341e8),process[_0x519e98(0x1d8)](0x1);}}));async function validatePath(_0x151ca4){const _0xc59c0b=a0_0x525535,_0x199e95=expandHome(_0x151ca4),_0x9eff54=a0_0x368898[_0xc59c0b(0x162)](_0x199e95);logger[_0xc59c0b(0x201)](_0xc59c0b(0x1b4),_0xc59c0b(0x214),{'raw_path':_0x151ca4,'absolute':_0x9eff54});try{const _0xbaae6f=await a0_0x4128a0[_0xc59c0b(0x213)](_0x9eff54);return logger['debug'](_0xc59c0b(0x1b4),_0xc59c0b(0x1a2),{'resolved':_0xbaae6f,'symlink':_0xbaae6f!==_0x9eff54}),_0xbaae6f;}catch(_0x3c2a44){if(_0x3c2a44['code']===_0xc59c0b(0x260)){const _0x26ede2=a0_0x368898['dirname'](_0x9eff54);try{const _0x482dbc=await a0_0x4128a0['realpath'](_0x26ede2),_0x2b604d=a0_0x368898['join'](_0x482dbc,a0_0x368898['basename'](_0x9eff54));return logger[_0xc59c0b(0x201)](_0xc59c0b(0x1b4),'path_validation_resolved',{'resolved':_0x2b604d,'new_file':!![]}),_0x2b604d;}catch{logger[_0xc59c0b(0x225)](_0xc59c0b(0x1b4),_0xc59c0b(0x204),{'raw_path':_0x151ca4,'error':'Parent\x20directory\x20does\x20not\x20exist:\x20'+_0x26ede2});throw new Error('Parent\x20directory\x20does\x20not\x20exist:\x20'+_0x26ede2);}}logger[_0xc59c0b(0x225)](_0xc59c0b(0x1b4),_0xc59c0b(0x204),{'raw_path':_0x151ca4,'error':_0x3c2a44[_0xc59c0b(0x22a)]});throw _0x3c2a44;}}const MorphEditFileArgsSchema=z[a0_0x525535(0x22c)]({'path':z['string'](),'code_edit':z[a0_0x525535(0x1a1)]()[a0_0x525535(0x1ac)](a0_0x525535(0x22e)),'instruction':z[a0_0x525535(0x1a1)]()['describe'](a0_0x525535(0x220)),'dryRun':z[a0_0x525535(0x26b)]()[a0_0x525535(0x172)](![])[a0_0x525535(0x1ac)](a0_0x525535(0x1f7))}),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[a0_0x525535(0x22c)]({'search_string':z[a0_0x525535(0x1a1)]()['describe'](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repo_path':z[a0_0x525535(0x1a1)]()['describe'](a0_0x525535(0x18d)),'search_type':z[a0_0x525535(0x1f2)]([a0_0x525535(0x172),a0_0x525535(0x24a)])[a0_0x525535(0x208)]()['describe'](a0_0x525535(0x1ba))}),WarpGrepGitHubArgsSchema=z['object']({'search_string':z[a0_0x525535(0x1a1)]()['describe'](CODEBASE_SEARCH_QUERY_DESCRIPTION),'github_url':z[a0_0x525535(0x1a1)]()[a0_0x525535(0x208)]()['describe'](a0_0x525535(0x173)),'owner_repo':z[a0_0x525535(0x1a1)]()[a0_0x525535(0x208)]()[a0_0x525535(0x1ac)]('Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.'),'branch':z[a0_0x525535(0x1a1)]()[a0_0x525535(0x208)]()[a0_0x525535(0x1ac)](a0_0x525535(0x254))}),CodebaseSearchArgsSchema=z[a0_0x525535(0x22c)]({'query':z['string']()[a0_0x525535(0x1ac)](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repoId':z['string']()['describe']('Repository\x20identifier'),'branch':z[a0_0x525535(0x1a1)]()[a0_0x525535(0x208)]()[a0_0x525535(0x1ac)](a0_0x525535(0x170)),'commitHash':z[a0_0x525535(0x1a1)]()[a0_0x525535(0x208)]()[a0_0x525535(0x1ac)](a0_0x525535(0x1d4)),'targetDirectories':z[a0_0x525535(0x184)](z['string']())[a0_0x525535(0x172)]([])[a0_0x525535(0x1ac)](a0_0x525535(0x238)),'limit':z[a0_0x525535(0x1f3)]()[a0_0x525535(0x208)]()[a0_0x525535(0x172)](0xa)[a0_0x525535(0x1ac)]('Max\x20results\x20to\x20return')}),server=new Server({'name':a0_0x525535(0x1fe),'version':a0_0x525535(0x1be)},{'capabilities':{'tools':{}}});server[a0_0x525535(0x1f9)](ListToolsRequestSchema,async()=>{const _0x4ae465=a0_0x525535,_0x5374e5=[{'name':TOOL_NAMES[_0x4ae465(0x249)],'description':_0x4ae465(0x1a7)+_0x4ae465(0x258)+'-\x20path:\x20Absolute\x20file\x20path\x20to\x20edit\x0a'+_0x4ae465(0x190)+'-\x20code_edit:\x20Only\x20the\x20changed\x20lines\x20with\x20//\x20...\x20existing\x20code\x20...\x20markers\x0a\x0a'+'Use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code\x20blocks.\x20Include\x20just\x20enough\x20surrounding\x20context\x20to\x20locate\x20each\x20edit\x20precisely.\x0a\x0a'+'Example\x20format:\x0a'+'//\x20...\x20existing\x20code\x20...\x0aFIRST_EDIT\x0a//\x20...\x20existing\x20code\x20...\x0aSECOND_EDIT\x0a//\x20...\x20existing\x20code\x20...\x0a\x0a'+'Rules:\x0a'+_0x4ae465(0x16c)+_0x4ae465(0x1b3)+_0x4ae465(0x234)+_0x4ae465(0x25e),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':TOOL_NAMES['CODEBASE_SEARCH'],'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'+_0x4ae465(0x165)+_0x4ae465(0x1e4)+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]}],_0x35b960=_0x5374e5[_0x4ae465(0x1c7)](_0x3cafad=>{const _0x285bf1=_0x4ae465;if(DISABLED_TOOLS['has'](_0x3cafad['name']))return console[_0x285bf1(0x225)](_0x285bf1(0x18e)+_0x3cafad[_0x285bf1(0x222)]+_0x285bf1(0x246)),![];if('requiresApiKey'in _0x3cafad&&_0x3cafad['requiresApiKey']&&!MORPH_API_KEY)return logMcpStderr(_0x285bf1(0x1aa)+_0x3cafad[_0x285bf1(0x222)]+_0x285bf1(0x1e0)),![];return!![];});return{'tools':_0x35b960[_0x4ae465(0x1bb)](_0xa9cb7b=>({'name':_0xa9cb7b['name'],'description':_0xa9cb7b[_0x4ae465(0x154)],'inputSchema':_0xa9cb7b['inputSchema']}))};}),server[a0_0x525535(0x1f9)](CallToolRequestSchema,async _0x2e96b0=>{const _0x170471=a0_0x525535,{name:_0x2a3159,arguments:_0x592b7e}=_0x2e96b0[_0x170471(0x26c)],_0x9fc9d0=Date[_0x170471(0x17c)]();logger[_0x170471(0x201)](_0x170471(0x1b4),'tool_call_received',{'tool':_0x2a3159,'args':_0x2a3159==='edit_file'?{'path':_0x592b7e?.[_0x170471(0x168)],'instruction':_0x592b7e?.[_0x170471(0x1fc)]||_0x592b7e?.[_0x170471(0x1ce)],'dryRun':_0x592b7e?.[_0x170471(0x1bc)]}:_0x592b7e});try{if(!MORPH_API_KEY)return{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x1c6)}],'isError':!![]};if(!MORPH_API_KEY[_0x170471(0x1c9)](_0x170471(0x200))&&!MORPH_API_KEY['startsWith'](_0x170471(0x21c)))return{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x230)}],'isError':!![]};if(DISABLED_TOOLS[_0x170471(0x187)](_0x2a3159))return{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x198)+_0x2a3159+_0x170471(0x23a)}],'isError':![]};switch(_0x2a3159){case TOOL_NAMES['EDIT_FILE']:{let _0x41f18c=_0x592b7e;if(_0x41f18c&&typeof _0x41f18c===_0x170471(0x22c)){if(!(_0x170471(0x168)in _0x41f18c)){const _0x20e92a=_0x41f18c['target_file']??_0x41f18c[_0x170471(0x23f)]??_0x41f18c[_0x170471(0x224)]??_0x41f18c[_0x170471(0x24f)]??_0x41f18c[_0x170471(0x176)];if(_0x20e92a)_0x41f18c={..._0x41f18c,'path':_0x20e92a};}_0x170471(0x1ce)in _0x41f18c&&!(_0x170471(0x1fc)in _0x41f18c)&&(_0x41f18c={..._0x41f18c,'instruction':_0x41f18c['instructions']});if(!(_0x170471(0x203)in _0x41f18c)){const _0x23aae2=_0x41f18c[_0x170471(0x1c1)]??_0x41f18c[_0x170471(0x221)]??_0x41f18c[_0x170471(0x21e)]??_0x41f18c[_0x170471(0x24d)];if(_0x23aae2)_0x41f18c={..._0x41f18c,'code_edit':_0x23aae2};}}const _0x30d794=MorphEditFileArgsSchema[_0x170471(0x1e8)](_0x41f18c);if(!_0x30d794[_0x170471(0x1b6)])throw new Error(_0x170471(0x263)+_0x30d794[_0x170471(0x225)]);const _0x224a38=await validatePath(_0x30d794[_0x170471(0x272)][_0x170471(0x168)]);let _0x24ab25=null,_0x182e08=!![],_0x153626=null;try{_0x24ab25=await a0_0x4128a0[_0x170471(0x240)](_0x224a38,_0x170471(0x15d)),logger[_0x170471(0x201)](_0x170471(0x1b4),_0x170471(0x1b1),{'path':_0x224a38,'size_bytes':_0x24ab25[_0x170471(0x1b2)]});}catch(_0x271951){const _0x452092=_0x271951['code'];_0x452092==='ENOENT'?(_0x182e08=![],_0x24ab25='',logger['debug']('MCP',_0x170471(0x1b1),{'path':_0x224a38,'exists':![]})):(_0x153626='Failed\x20to\x20read\x20file:\x20'+(_0x452092||_0x170471(0x199))+_0x170471(0x26a)+(_0x271951 instanceof Error?_0x271951[_0x170471(0x22a)]:String(_0x271951)),logger[_0x170471(0x225)]('MCP','file_read_failed',{'path':_0x224a38,'error':_0x153626}),logMcpStderr(_0x170471(0x1aa)+_0x153626));}let _0x23793d;try{const _0x7e2abb=MORPH_API_KEY;if(!_0x7e2abb)throw new Error(_0x170471(0x192));const _0x590bec=a0_0x368898[_0x170471(0x269)](_0x224a38),_0xd92589=a0_0x368898['basename'](_0x224a38);logger[_0x170471(0x201)](_0x170471(0x1b4),_0x170471(0x179),{'model':_0x170471(0x1e9),'path':_0x30d794[_0x170471(0x272)]['path'],'instruction_len':_0x30d794[_0x170471(0x272)]['instruction'][_0x170471(0x1b2)],'code_edit_len':_0x30d794['data'][_0x170471(0x203)][_0x170471(0x1b2)],'original_code_len':_0x24ab25?.['length']??0x0,'dry_run':_0x30d794['data'][_0x170471(0x1bc)]});const _0x502b74=Date[_0x170471(0x17c)](),_0x417f7f=await executeEditFile({'target_filepath':_0xd92589,'code_edit':_0x30d794['data'][_0x170471(0x203)],'instruction':_0x30d794['data'][_0x170471(0x1fc)]},{'morphApiKey':_0x7e2abb,'morphApiUrl':MORPH_API_URL,'large':MORPH_LARGE_APPLY,'baseDir':_0x590bec,'autoWrite':!_0x30d794[_0x170471(0x272)][_0x170471(0x1bc)],'generateUdiff':![],'debug':![]}),_0x1df48b=Date[_0x170471(0x17c)]()-_0x502b74;_0x23793d=_0x417f7f[_0x170471(0x15a)];if(!_0x417f7f['success'])throw new Error(_0x417f7f[_0x170471(0x225)]||_0x170471(0x1ca));const _0x21de4e=_0x417f7f[_0x170471(0x19b)],_0x200408=_0x170471(0x268)+_0x21de4e['linesAdded']+_0x170471(0x1f4)+_0x21de4e['linesRemoved']+',\x20modified\x20'+_0x21de4e[_0x170471(0x206)];logger[_0x170471(0x201)](_0x170471(0x1b4),'tool_call_complete',{'tool':_0x170471(0x26e),'success':!![],'latency_ms':Date[_0x170471(0x17c)]()-_0x9fc9d0,'edit_latency_ms':_0x1df48b,'changes':{'added':_0x21de4e['linesAdded'],'removed':_0x21de4e[_0x170471(0x1d5)],'modified':_0x21de4e[_0x170471(0x206)]},'completion_id':_0x23793d});if(_0x30d794[_0x170471(0x272)][_0x170471(0x1bc)])return{'content':[{'type':'text','text':'Morph\x20Edit\x20Preview'+(_0x182e08?'':_0x170471(0x1d7))+':\x20'+_0x30d794[_0x170471(0x272)][_0x170471(0x1fc)]+_0x170471(0x210)+_0x200408+_0x170471(0x1a4)+_0x30d794['data'][_0x170471(0x168)]+'.'}]};return{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x19e)+(_0x182e08?_0x170471(0x161):_0x170471(0x233))+':\x20'+_0x30d794[_0x170471(0x272)][_0x170471(0x1fc)]+'.\x20Changes:\x20'+_0x200408+_0x170471(0x1a4)+_0x30d794[_0x170471(0x272)]['path']+'.'}]};}catch(_0x270cff){const _0x8d0af2=handleMorphAPIError(_0x270cff);if(_0x8d0af2)return logger[_0x170471(0x225)]('MCP',_0x170471(0x1a3),{'tool':_0x170471(0x26e),'error':_0x170471(0x163),'latency_ms':Date['now']()-_0x9fc9d0}),_0x8d0af2;const _0x541309=_0x270cff instanceof Error?_0x270cff[_0x170471(0x22a)]:String(_0x270cff);return logger[_0x170471(0x225)](_0x170471(0x1b4),'tool_call_error',{'tool':_0x170471(0x26e),'error':_0x541309,'path':_0x30d794['data'][_0x170471(0x168)],'validated_path':_0x224a38,'latency_ms':Date[_0x170471(0x17c)]()-_0x9fc9d0,'stack':_0x270cff instanceof Error?_0x270cff[_0x170471(0x264)]:undefined}),reportMorphError({'error_message':_0x541309,'error_type':_0x270cff instanceof Error?_0x270cff[_0x170471(0x243)][_0x170471(0x222)]:_0x170471(0x1a6),'context':{'tool':_0x170471(0x26e),'completion_id':_0x23793d,'file_path':_0x30d794[_0x170471(0x272)][_0x170471(0x168)],'validated_path':_0x224a38,'instruction':_0x30d794[_0x170471(0x272)][_0x170471(0x1fc)],'model':MORPH_LARGE_APPLY?_0x170471(0x19d):'morph-v3-fast','dry_run':_0x30d794[_0x170471(0x272)]['dryRun'],'file_exists':_0x182e08,'file_read_error':_0x153626,'file_readable':_0x24ab25!==null,'request_content':{'path':_0x30d794[_0x170471(0x272)]['path'],'code_edit':_0x30d794['data'][_0x170471(0x203)],'instruction':_0x30d794[_0x170471(0x272)]['instruction'],'original_code':_0x24ab25!==null?_0x24ab25[_0x170471(0x1b2)]>0xc350?_0x24ab25[_0x170471(0x24b)](0x0,0xc350)+_0x170471(0x1a5)+_0x24ab25['length']+_0x170471(0x167):_0x24ab25:_0x170471(0x16e)+(_0x153626||_0x170471(0x175))+']','original_code_length':_0x24ab25?.[_0x170471(0x1b2)]??0x0,'model':MORPH_LARGE_APPLY?'morph-v3-large':_0x170471(0x1e9),'dry_run':_0x30d794[_0x170471(0x272)][_0x170471(0x1bc)]}},'stack_trace':_0x270cff instanceof Error?_0x270cff[_0x170471(0x264)]:undefined,'source':_0x170471(0x178)})[_0x170471(0x261)](()=>{}),{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x16b)+_0x541309}],'isError':!![]};}}case TOOL_NAMES[_0x170471(0x259)]:{const _0x46d926=WarpGrepArgsSchema[_0x170471(0x1e8)](_0x592b7e);if(!_0x46d926[_0x170471(0x1b6)])return{'content':[{'type':_0x170471(0x1da),'text':'Invalid\x20arguments:\x20'+_0x46d926['error']}],'isError':!![]};const _0x31547b=_0x40e023=>{const _0x4323f9=_0x170471,_0x2c2393=[];for(const _0x3f921a of _0x40e023||[]){if(_0x3f921a[_0x4323f9(0x174)]==='assistant'&&Array[_0x4323f9(0x1d3)](_0x3f921a['tool_calls']))for(const _0x64045c of _0x3f921a[_0x4323f9(0x227)]){try{const _0x58a0d6=_0x64045c[_0x4323f9(0x1d1)]?.[_0x4323f9(0x222)],_0x5814d5=JSON[_0x4323f9(0x211)](_0x64045c[_0x4323f9(0x1d1)]?.['arguments']||'{}');if(_0x58a0d6===_0x4323f9(0x239))_0x2c2393['push'](_0x4323f9(0x245)+_0x5814d5[_0x4323f9(0x266)]+'\x27\x20'+(_0x5814d5[_0x4323f9(0x168)]||'.'));else{if(_0x58a0d6===_0x4323f9(0x1f0))_0x2c2393[_0x4323f9(0x1f8)](_0x4323f9(0x188)+_0x5814d5[_0x4323f9(0x168)]);else{if(_0x58a0d6==='list_directory')_0x2c2393['push'](_0x4323f9(0x1fa)+(_0x5814d5['command']||'.'));else{if(_0x58a0d6===_0x4323f9(0x185))_0x2c2393[_0x4323f9(0x1f8)](_0x4323f9(0x169)+_0x5814d5[_0x4323f9(0x266)]+'\x27\x20'+(_0x5814d5['path']||'.'));else _0x58a0d6===_0x4323f9(0x256)&&_0x2c2393[_0x4323f9(0x1f8)](_0x4323f9(0x256));}}}}catch{}}}return _0x2c2393;},_0x308a52=_0x316c84=>{const _0x5b04f2=_0x170471,_0x330a3c=[];if(!_0x316c84||!Array['isArray'](_0x316c84))return _0x330a3c;const _0x5416fe=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':'FileNotFound','tool':_0x5b04f2(0x1f0)},{'pattern':/\[PATH ERROR\]/,'error_type':'PathError','tool':_0x5b04f2(0x1f0)},{'pattern':/\[READ ERROR\]/,'error_type':_0x5b04f2(0x1c5),'tool':'read'},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0x5b04f2(0x1ab),'tool':'read'},{'pattern':/\[RIPGREP ERROR\]/,'error_type':_0x5b04f2(0x22f),'tool':_0x5b04f2(0x1d9)},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':_0x5b04f2(0x1eb),'tool':_0x5b04f2(0x1d9)},{'pattern':/\[BINARY FILE\]/,'error_type':'BinaryFile','tool':_0x5b04f2(0x1f0)},{'pattern':/\[SYMLINK\]/,'error_type':_0x5b04f2(0x1b5),'tool':_0x5b04f2(0x1f0)},{'pattern':/not a text file/,'error_type':_0x5b04f2(0x1ab),'tool':'read'},{'pattern':/symbolic link/,'error_type':_0x5b04f2(0x1b5),'tool':_0x5b04f2(0x1f0)},{'pattern':/Error reading file:/,'error_type':_0x5b04f2(0x1c5),'tool':_0x5b04f2(0x1f0)},{'pattern':/status="error"/,'error_type':_0x5b04f2(0x182),'tool':_0x5b04f2(0x199)}];let _0xdc5fd3=0x0;for(const _0x50f484 of _0x316c84){_0x50f484[_0x5b04f2(0x174)]===_0x5b04f2(0x15b)&&Array['isArray'](_0x50f484[_0x5b04f2(0x227)])&&_0xdc5fd3++;const _0xb12f3e=_0x50f484[_0x5b04f2(0x21e)];if((_0x50f484[_0x5b04f2(0x174)]===_0x5b04f2(0x186)||_0x50f484[_0x5b04f2(0x174)]===_0x5b04f2(0x1b0))&&_0xb12f3e&&typeof _0xb12f3e===_0x5b04f2(0x1a1))for(const {pattern:_0x2ec384,error_type:_0x1c4ffc,tool:_0x27066a}of _0x5416fe){const _0x9ac5b4=_0xb12f3e[_0x5b04f2(0x1cb)](new RegExp(_0x2ec384[_0x5b04f2(0x248)],'g'));if(_0x9ac5b4)for(const _0x1c74a2 of _0x9ac5b4){const _0x3d4e9c=_0xb12f3e[_0x5b04f2(0x164)](_0x1c74a2),_0x1b3902=_0xb12f3e[_0x5b04f2(0x24b)](_0x3d4e9c,Math[_0x5b04f2(0x17a)](_0x3d4e9c+0xc8,_0xb12f3e[_0x5b04f2(0x1b2)]));_0x330a3c[_0x5b04f2(0x1f8)]({'tool':_0x27066a,'error_type':_0x1c4ffc,'error_message':_0x1b3902[_0x5b04f2(0x253)]('\x0a')[0x0],'turn':_0xdc5fd3});}}}return _0x330a3c;};try{const _0x2eecb8=a0_0x368898[_0x170471(0x162)](_0x46d926[_0x170471(0x272)][_0x170471(0x21f)]),_0x375040=_0x46d926[_0x170471(0x272)][_0x170471(0x1c4)],_0x6d7054=_0x375040===_0x170471(0x24a)?{'allowNames':[_0x170471(0x24a)]}:undefined,_0x2fa7b4=new LocalRipgrepProvider(_0x2eecb8,undefined,_0x6d7054);logger['debug']('MCP','provider_created',{'type':_0x170471(0x160),'repo_root':_0x2eecb8,'search_type':_0x375040||_0x170471(0x172)}),logger[_0x170471(0x201)](_0x170471(0x1b4),_0x170471(0x1fd),{'query':_0x46d926[_0x170471(0x272)][_0x170471(0x212)],'repo_root':_0x2eecb8,'timeout_ms':MORPH_WARP_GREP_TIMEOUT});const _0x1da3f5=Date[_0x170471(0x17c)](),_0x31047f=await runWarpGrep({'searchTerm':_0x46d926[_0x170471(0x272)][_0x170471(0x212)],'repoRoot':_0x2eecb8,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x2fa7b4,'search_type':_0x375040}),_0x516e17=Date[_0x170471(0x17c)]()-_0x1da3f5,_0x375aa6=_0x31047f[_0x170471(0x256)]?.[_0x170471(0x1e7)]?.[_0x170471(0x273)]?.[_0x170471(0x1b2)]??0x0;logger['debug'](_0x170471(0x1b4),'warp_grep_complete',{'termination':_0x31047f[_0x170471(0x1d6)],'turns':_0x31047f[_0x170471(0x1b7)]?.[_0x170471(0x1f5)]??0x0,'files_found':_0x375aa6,'latency_ms':_0x516e17});const _0xe9b0e=_0x308a52(_0x31047f[_0x170471(0x155)]);_0xe9b0e[_0x170471(0x1b2)]>0x0&&reportMorphError({'error_message':'WarpGrep\x20sub-tool\x20errors:\x20'+_0xe9b0e[_0x170471(0x1b2)]+_0x170471(0x276),'error_type':'SubToolError','level':_0x170471(0x262),'tool':_0x170471(0x217),'context':{'repo_path':_0x46d926[_0x170471(0x272)][_0x170471(0x21f)],'query':_0x46d926[_0x170471(0x272)][_0x170471(0x212)],'model':_0x170471(0x193),'termination_reason':_0x31047f[_0x170471(0x1d6)],'sub_tool_errors':_0xe9b0e,'timings':_0x31047f[_0x170471(0x1b7)],'tool_calls':_0x31547b(_0x31047f['messages']),'messages':_0x31047f[_0x170471(0x155)]?.[_0x170471(0x1bb)](_0x4610c1=>({'role':_0x4610c1[_0x170471(0x174)],'content':_0x4610c1['content'],..._0x4610c1['tool_calls']?{'tool_calls':_0x4610c1[_0x170471(0x227)][_0x170471(0x1b2)]}:{},..._0x4610c1['tool_call_id']?{'tool_call_id':_0x4610c1['tool_call_id']}:{}}))},'source':_0x170471(0x178)})[_0x170471(0x261)](()=>{});let _0x383ee7='';if(_0x31047f['terminationReason']===_0x170471(0x17b)&&_0x31047f[_0x170471(0x256)]?.[_0x170471(0x1e7)]?.[_0x170471(0x273)]){const _0x17f043=_0x31047f['finish'][_0x170471(0x1e7)][_0x170471(0x273)];if(_0x17f043[_0x170471(0x1b2)]===0x0)return _0x383ee7=_0x31047f[_0x170471(0x256)][_0x170471(0x20c)]||_0x170471(0x1af),{'content':[{'type':_0x170471(0x1da),'text':_0x383ee7}]};const _0x567377=[],_0x200235=[_0x170471(0x14f)];for(const _0x508670 of _0x31047f[_0x170471(0x155)]){if(_0x508670[_0x170471(0x174)]===_0x170471(0x15b)&&Array[_0x170471(0x1d3)](_0x508670[_0x170471(0x227)]))for(const _0x1a4398 of _0x508670[_0x170471(0x227)]){try{const _0x385af2=_0x1a4398[_0x170471(0x1d1)]?.['name'],_0x1142c9=JSON[_0x170471(0x211)](_0x1a4398[_0x170471(0x1d1)]?.[_0x170471(0x228)]||'{}');if(_0x385af2===_0x170471(0x239))_0x200235[_0x170471(0x1f8)](_0x170471(0x22d)+_0x1142c9[_0x170471(0x266)]+_0x170471(0x20f)+(_0x1142c9[_0x170471(0x168)]||'.')+'`');else{if(_0x385af2===_0x170471(0x1f0))_0x200235[_0x170471(0x1f8)](_0x170471(0x180)+_0x1142c9[_0x170471(0x168)]+'`');else{if(_0x385af2==='list_directory')_0x200235['push'](_0x170471(0x15f)+(_0x1142c9[_0x170471(0x257)]||'.')+'`');else _0x385af2===_0x170471(0x185)&&_0x200235['push'](_0x170471(0x232)+_0x1142c9[_0x170471(0x266)]+_0x170471(0x16d)+(_0x1142c9['path']||'.')+'`');}}}catch{}}}_0x567377['push'](_0x200235[_0x170471(0x25b)]('\x0a'));const _0x226cb2=['',_0x170471(0x255)];for(const _0x577cf2 of _0x17f043){if(_0x577cf2[_0x170471(0x1df)]==='*')_0x226cb2[_0x170471(0x1f8)]('-\x20'+_0x577cf2[_0x170471(0x168)]+':*');else{if(Array[_0x170471(0x1d3)](_0x577cf2[_0x170471(0x1df)])){const _0x30dc6f=_0x577cf2['lines'][_0x170471(0x1bb)](([_0x576fd7,_0x34ccd0])=>{if(_0x576fd7===_0x34ccd0)return''+_0x576fd7;return _0x576fd7+'-'+_0x34ccd0;});_0x226cb2[_0x170471(0x1f8)]('-\x20'+_0x577cf2[_0x170471(0x168)]+':'+_0x30dc6f['join'](','));}else _0x226cb2[_0x170471(0x1f8)]('-\x20'+_0x577cf2[_0x170471(0x168)]+':*');}}_0x226cb2[_0x170471(0x1f8)](''),_0x567377[_0x170471(0x1f8)](_0x226cb2[_0x170471(0x25b)]('\x0a')),_0x567377[_0x170471(0x1f8)](_0x170471(0x17e));const _0x2e4ea5=[],_0x954db3=[];for(const _0x309c84 of _0x17f043){let _0x460bc7=a0_0x368898[_0x170471(0x162)](_0x46d926[_0x170471(0x272)][_0x170471(0x21f)],_0x309c84['path']),_0x470d9a=null,_0xb19f0f=null;try{_0x470d9a=await a0_0x4128a0[_0x170471(0x240)](_0x460bc7,{'encoding':'utf-8'});}catch(_0x473e08){const _0x34b469=fixPathRepetition(_0x460bc7);if(_0x34b469)try{_0x470d9a=await a0_0x4128a0[_0x170471(0x240)](_0x34b469,{'encoding':_0x170471(0x15d)}),_0x460bc7=_0x34b469;}catch{_0xb19f0f=_0x473e08 instanceof Error?_0x473e08:new Error(String(_0x473e08));}else _0xb19f0f=_0x473e08 instanceof Error?_0x473e08:new Error(String(_0x473e08));}if(_0x470d9a!==null){const _0x249117=_0x470d9a[_0x170471(0x253)](/\r?\n/),_0x481d22=[];if(_0x309c84['lines']==='*'||!Array[_0x170471(0x1d3)](_0x309c84[_0x170471(0x1df)]))for(let _0x150e27=0x1;_0x150e27<=_0x249117['length'];_0x150e27++){const _0x231405=_0x249117[_0x150e27-0x1];_0x481d22[_0x170471(0x1f8)](_0x150e27+'|\x20'+_0x231405);}else for(const [_0x1a8e4c,_0x422a94]of _0x309c84['lines']){_0x481d22[_0x170471(0x1b2)]>0x0&&_0x481d22[_0x170471(0x1f8)]('');for(let _0x2f40b9=_0x1a8e4c;_0x2f40b9<=_0x422a94&&_0x2f40b9<=_0x249117[_0x170471(0x1b2)];_0x2f40b9++){const _0x233d06=_0x249117[_0x2f40b9-0x1];_0x481d22[_0x170471(0x1f8)](_0x2f40b9+'|\x20'+_0x233d06);}}_0x954db3['push']({'path':_0x309c84[_0x170471(0x168)],'content':_0x481d22[_0x170471(0x25b)]('\x0a')});}else _0x2e4ea5['push']('<file\x20path=\x22'+_0x309c84[_0x170471(0x168)]+'\x22>\x0aError\x20reading\x20file:\x20'+(_0xb19f0f?.['message']||_0x170471(0x1fb))+_0x170471(0x216));}try{const _0x5f49a2=await compactFileContexts(_0x954db3,_0x46d926[_0x170471(0x272)][_0x170471(0x212)],MORPH_API_KEY,MORPH_API_URL);for(const _0x4a492e of _0x5f49a2){_0x2e4ea5['push'](_0x170471(0x17f)+_0x4a492e['path']+'\x22>\x0a'+_0x4a492e[_0x170471(0x21e)]+'\x0a</file>');}}catch(_0x1a0602){logger[_0x170471(0x262)](_0x170471(0x1b4),'compaction_failed',{'error':_0x1a0602 instanceof Error?_0x1a0602[_0x170471(0x22a)]:String(_0x1a0602),'files_count':_0x954db3['length']});for(const _0x42895b of _0x954db3){_0x2e4ea5[_0x170471(0x1f8)]('<file\x20path=\x22'+_0x42895b[_0x170471(0x168)]+_0x170471(0x156)+_0x42895b[_0x170471(0x21e)]+'\x0a</file>');}}_0x567377[_0x170471(0x1f8)](_0x2e4ea5[_0x170471(0x25b)]('\x0a\x0a')),_0x383ee7=_0x567377[_0x170471(0x25b)]('\x0a');const _0x5019b2=_0x31047f[_0x170471(0x252)]?.[_0x170471(0x1c7)](_0x5c66c5=>_0x5c66c5[_0x170471(0x22a)]?.[_0x170471(0x1c9)](_0x170471(0x235)))||[];if(_0x5019b2[_0x170471(0x1b2)]>0x0){const _0x1cdc0f=_0x5019b2[_0x170471(0x1bb)](_0x241717=>_0x241717['message'])['join'](';\x20');reportMorphError({'error_message':_0x1cdc0f,'error_type':'FileReadError','context':{'tool':_0x170471(0x217),'repo_path':_0x46d926[_0x170471(0x272)][_0x170471(0x21f)],'query':_0x46d926[_0x170471(0x272)][_0x170471(0x212)],'model':_0x170471(0x193),'termination_reason':'completed_with_file_errors','error_count':_0x5019b2[_0x170471(0x1b2)],'is_timeout':![],'timings':_0x31047f['timings'],'files_attempted':_0x17f043[_0x170471(0x1bb)](_0x292a8b=>({'path':_0x292a8b[_0x170471(0x168)],'lines':_0x292a8b[_0x170471(0x1df)]})),'tool_calls':_0x31547b(_0x31047f['messages']),'messages':_0x31047f[_0x170471(0x155)]?.[_0x170471(0x1bb)](_0x3fc007=>({'role':_0x3fc007[_0x170471(0x174)],'content':_0x3fc007[_0x170471(0x21e)],..._0x3fc007[_0x170471(0x227)]?{'tool_calls':_0x3fc007[_0x170471(0x227)][_0x170471(0x1b2)]}:{},..._0x3fc007['tool_call_id']?{'tool_call_id':_0x3fc007['tool_call_id']}:{}})),'request_content':{'query':_0x46d926['data'][_0x170471(0x212)],'repo_path':_0x46d926['data'][_0x170471(0x21f)],'repoRoot':a0_0x368898[_0x170471(0x162)](_0x46d926[_0x170471(0x272)][_0x170471(0x21f)]),'model':_0x170471(0x193)}},'source':_0x170471(0x178)})[_0x170471(0x261)](()=>{});}}else{if(_0x31047f['terminationReason']===_0x170471(0x207)&&_0x31047f['errors'][_0x170471(0x1b2)]>0x0){const _0x198c80=_0x31047f[_0x170471(0x252)][_0x170471(0x1bb)](_0x21dc19=>_0x21dc19[_0x170471(0x22a)])[_0x170471(0x25b)](';\x20');_0x383ee7=_0x170471(0x1a8)+_0x198c80;const _0x27da2a=_0x198c80['toLowerCase']()[_0x170471(0x1de)](_0x170471(0x191))||_0x198c80[_0x170471(0x25d)]()['includes'](_0x170471(0x25a))||_0x198c80[_0x170471(0x25d)]()[_0x170471(0x1de)](_0x170471(0x17d)),_0x447a9d=_0x31047f['finish']?.[_0x170471(0x1e7)]?.[_0x170471(0x273)],_0x3adc85=_0x31047f[_0x170471(0x252)][0x0];reportMorphError({'error_message':_0x198c80,'error_type':_0x27da2a?'TimeoutError':_0x3adc85?.[_0x170471(0x243)]?.[_0x170471(0x222)]||_0x170471(0x20a),'context':{'tool':'codebase_search','repo_path':_0x46d926['data'][_0x170471(0x21f)],'query':_0x46d926[_0x170471(0x272)]['search_string'],'model':_0x170471(0x193),'termination_reason':_0x31047f[_0x170471(0x1d6)],'error_count':_0x31047f['errors'][_0x170471(0x1b2)],'is_timeout':_0x27da2a,'timings':_0x31047f['timings'],'files_attempted':_0x447a9d?.['map'](_0x57c868=>({'path':_0x57c868[_0x170471(0x168)],'lines':_0x57c868[_0x170471(0x1df)]})),'tool_calls':_0x31547b(_0x31047f['messages']),'messages':_0x31047f[_0x170471(0x155)]?.[_0x170471(0x1bb)](_0x487352=>({'role':_0x487352[_0x170471(0x174)],'content':_0x487352[_0x170471(0x21e)],..._0x487352[_0x170471(0x227)]?{'tool_calls':_0x487352['tool_calls'][_0x170471(0x1b2)]}:{},..._0x487352[_0x170471(0x1e3)]?{'tool_call_id':_0x487352['tool_call_id']}:{}})),'request_content':{'query':_0x46d926[_0x170471(0x272)]['search_string'],'repo_path':_0x46d926['data'][_0x170471(0x21f)],'repoRoot':a0_0x368898[_0x170471(0x162)](_0x46d926[_0x170471(0x272)][_0x170471(0x21f)]),'model':'morph-warp-grep-v2.1'}},'stack_trace':_0x3adc85?.[_0x170471(0x264)]||undefined,'source':_0x170471(0x178)})[_0x170471(0x261)](()=>{});}else _0x383ee7=_0x170471(0x265);}return{'content':[{'type':_0x170471(0x1da),'text':_0x383ee7}]};}catch(_0x46f62f){const _0x402524=handleMorphAPIError(_0x46f62f);if(_0x402524)return logger[_0x170471(0x225)](_0x170471(0x1b4),_0x170471(0x1a3),{'tool':_0x170471(0x217),'error':'API\x20error\x20(auth/rate-limit)','latency_ms':Date[_0x170471(0x17c)]()-_0x9fc9d0}),_0x402524;const _0x2328f2=_0x46f62f instanceof Error?_0x46f62f[_0x170471(0x22a)]:String(_0x46f62f);logger[_0x170471(0x225)](_0x170471(0x1b4),_0x170471(0x1a3),{'tool':'codebase_search','error':_0x2328f2,'repo_path':_0x46d926[_0x170471(0x272)][_0x170471(0x21f)],'query':_0x46d926[_0x170471(0x272)][_0x170471(0x212)],'latency_ms':Date['now']()-_0x9fc9d0});const _0x4e03b8=_0x2328f2[_0x170471(0x25d)]()['includes']('timeout')||_0x2328f2['toLowerCase']()['includes'](_0x170471(0x25a))||_0x2328f2['toLowerCase']()[_0x170471(0x1de)]('etimedout')||_0x46f62f instanceof Error&&_0x46f62f[_0x170471(0x222)]===_0x170471(0x19a);return reportMorphError({'error_message':_0x2328f2,'error_type':_0x4e03b8?'TimeoutError':_0x46f62f instanceof Error?_0x46f62f[_0x170471(0x243)]['name']:_0x170471(0x1a6),'context':{'tool':_0x170471(0x217),'repo_path':_0x46d926[_0x170471(0x272)][_0x170471(0x21f)],'query':_0x46d926['data'][_0x170471(0x212)],'model':_0x170471(0x193),'is_timeout':_0x4e03b8,'exception_phase':_0x170471(0x218),'request_content':{'query':_0x46d926[_0x170471(0x272)][_0x170471(0x212)],'repo_path':_0x46d926['data'][_0x170471(0x21f)],'repoRoot':a0_0x368898[_0x170471(0x162)](_0x46d926[_0x170471(0x272)][_0x170471(0x21f)]),'model':'morph-warp-grep-v2.1'}},'stack_trace':_0x46f62f instanceof Error?_0x46f62f['stack']:undefined,'source':_0x170471(0x178)})[_0x170471(0x261)](()=>{}),{'content':[{'type':_0x170471(0x1da),'text':'Error\x20running\x20fast\x20context\x20search:\x20'+_0x2328f2}],'isError':![]};}}case TOOL_NAMES['GITHUB_CODEBASE_SEARCH']:{const _0x1766ad=WarpGrepGitHubArgsSchema['safeParse'](_0x592b7e);if(!_0x1766ad[_0x170471(0x1b6)])return{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x1cf)+_0x1766ad[_0x170471(0x225)]}],'isError':!![]};const _0x1bdf0f=_0x1766ad[_0x170471(0x272)][_0x170471(0x202)]||_0x1766ad[_0x170471(0x272)][_0x170471(0x241)];if(!_0x1bdf0f)return{'content':[{'type':'text','text':'Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id'}],'isError':!![]};const _0x225bd3=MORPH_API_KEY;if(!_0x225bd3)throw new Error(_0x170471(0x192));const _0x159b09=Date[_0x170471(0x17c)]();logger[_0x170471(0x201)]('MCP','github_search_start',{'identifier':_0x1bdf0f,'query':_0x1766ad[_0x170471(0x272)][_0x170471(0x212)],'branch':_0x1766ad[_0x170471(0x272)]['branch']});try{const _0x25be65=new WarpGrepClient({'morphApiKey':_0x225bd3,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x43dd84=await _0x25be65[_0x170471(0x1d0)]({'searchTerm':_0x1766ad[_0x170471(0x272)][_0x170471(0x212)],'github':_0x1bdf0f,'branch':_0x1766ad[_0x170471(0x272)][_0x170471(0x159)]}),_0x11876b=Date['now']()-_0x159b09;logMcpStderr(_0x170471(0x1e1)+_0x11876b+_0x170471(0x24e)+_0x43dd84['success']);const _0xd083e3=formatResult(_0x43dd84);return{'content':[{'type':_0x170471(0x1da),'text':_0xd083e3}]};}catch(_0x4cc456){const _0x3f4000=handleMorphAPIError(_0x4cc456);if(_0x3f4000)return _0x3f4000;const _0x5394df=Date[_0x170471(0x17c)]()-_0x159b09,_0x1dcb73=_0x4cc456 instanceof Error?_0x4cc456[_0x170471(0x22a)]:String(_0x4cc456);return logMcpStderr('[github_codebase_search]\x20Failed\x20in\x20'+_0x5394df+_0x170471(0x209),_0x1dcb73),reportMorphError({'error_message':_0x1dcb73,'error_type':_0x4cc456 instanceof Error?_0x4cc456[_0x170471(0x243)][_0x170471(0x222)]:_0x170471(0x1a6),'context':{'tool':_0x170471(0x153),'github_url':_0x1bdf0f,'search_string':_0x1766ad['data']['search_string'],'branch':_0x1766ad[_0x170471(0x272)][_0x170471(0x159)]},'stack_trace':_0x4cc456 instanceof Error?_0x4cc456[_0x170471(0x264)]:undefined,'source':_0x170471(0x178),'tool':_0x170471(0x153),'latency_ms':_0x5394df})[_0x170471(0x261)](()=>{}),{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x242)+_0x1dcb73}],'isError':![]};}}default:throw new Error(_0x170471(0x194)+_0x2a3159);}}catch(_0x3513e9){const _0x2829ae=_0x3513e9 instanceof Error?_0x3513e9[_0x170471(0x22a)]:String(_0x3513e9);return reportMorphError({'error_message':_0x2829ae,'error_type':_0x3513e9 instanceof Error?_0x3513e9[_0x170471(0x243)]['name']:_0x170471(0x1a6),'context':{'tool':_0x2a3159,'arguments':_0x592b7e?JSON[_0x170471(0x196)](_0x592b7e)['substring'](0x0,0x1f4):undefined,'mcp_server_version':'0.2.0'},'stack_trace':_0x3513e9 instanceof Error?_0x3513e9[_0x170471(0x264)]:undefined,'source':_0x170471(0x178)})[_0x170471(0x261)](()=>{}),{'content':[{'type':_0x170471(0x1da),'text':_0x170471(0x1a8)+_0x2829ae}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x17e096){const _0x4d9650=a0_0x525535,_0x2fd797=await getValidRootDirectories(_0x17e096);if(_0x2fd797['length']>0x0)allowedDirectories=[..._0x2fd797],logMcpStderr(_0x4d9650(0x1e6)+_0x2fd797['length']+_0x4d9650(0x1c0));else{logMcpStderr('No\x20valid\x20root\x20directories\x20provided\x20by\x20client');if(ENABLE_WORKSPACE_MODE)try{const _0x2952b0=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x2952b0&&(allowedDirectories=[_0x2952b0],logMcpStderr(_0x4d9650(0x226)+_0x2952b0));}catch(_0x3fa6f8){logMcpStderr(_0x4d9650(0x1f6)+_0x3fa6f8);}}}server['setNotificationHandler'](RootsListChangedNotificationSchema,async()=>{const _0xe9775d=a0_0x525535;try{const _0xe03072=await server[_0xe9775d(0x1ea)]();_0xe03072&&'roots'in _0xe03072&&await updateAllowedDirectoriesFromRoots(_0xe03072[_0xe9775d(0x219)]);}catch(_0x490afe){logMcpStderr('Failed\x20to\x20request\x20roots\x20from\x20client:',_0x490afe instanceof Error?_0x490afe[_0xe9775d(0x22a)]:String(_0x490afe));}}),server[a0_0x525535(0x20d)]=async()=>{const _0x4488de=a0_0x525535,_0x139f42=server[_0x4488de(0x267)]();if(_0x139f42?.[_0x4488de(0x219)])try{const _0x182172=await server['listRoots']();_0x182172&&_0x4488de(0x219)in _0x182172?await updateAllowedDirectoriesFromRoots(_0x182172[_0x4488de(0x219)]):logMcpStderr(_0x4488de(0x23b));}catch(_0x6f29d5){logMcpStderr(_0x4488de(0x223),_0x6f29d5 instanceof Error?_0x6f29d5[_0x4488de(0x22a)]:String(_0x6f29d5));}else{if(allowedDirectories['length']>0x0)logMcpStderr(_0x4488de(0x183),allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)logMcpStderr(_0x4488de(0x171));else throw new Error(_0x4488de(0x166));}}};async function runServer(){const _0x109d00=a0_0x525535,_0x54d1fb=new StdioServerTransport();await server['connect'](_0x54d1fb),logMcpStderr(_0x109d00(0x19f)),allowedDirectories['length']===0x0&&logMcpStderr('Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol');}runServer()[a0_0x525535(0x261)](_0xd49bec=>{const _0x380009=a0_0x525535;logMcpStderr(_0x380009(0x195),_0xd49bec),process[_0x380009(0x1d8)](0x1);});
package/dist/log-utils.js CHANGED
@@ -1 +1 @@
1
- function a1_0x7e5c(_0x3907db,_0x41e6a6){_0x3907db=_0x3907db-0x180;var _0x4e8fc4=a1_0x4e8f();var _0x7e5c85=_0x4e8fc4[_0x3907db];return _0x7e5c85;}var a1_0x327885=a1_0x7e5c;(function(_0x10b3a9,_0x2ff58c){var _0x24c585=a1_0x7e5c,_0x4d047f=_0x10b3a9();while(!![]){try{var _0x52147a=parseInt(_0x24c585(0x18d))/0x1*(parseInt(_0x24c585(0x187))/0x2)+parseInt(_0x24c585(0x189))/0x3+parseInt(_0x24c585(0x185))/0x4+parseInt(_0x24c585(0x195))/0x5*(parseInt(_0x24c585(0x18c))/0x6)+parseInt(_0x24c585(0x18e))/0x7*(-parseInt(_0x24c585(0x184))/0x8)+parseInt(_0x24c585(0x18b))/0x9+-parseInt(_0x24c585(0x18a))/0xa;if(_0x52147a===_0x2ff58c)break;else _0x4d047f['push'](_0x4d047f['shift']());}catch(_0x106d4d){_0x4d047f['push'](_0x4d047f['shift']());}}}(a1_0x4e8f,0x375ee));import a1_0x3c547c from'os';import{logger}from'./logger.js';export function getOperatingSystemType(_0x5671d6=a1_0x3c547c[a1_0x327885(0x18f)]()){var _0x52d4ea=a1_0x327885;switch(_0x5671d6){case _0x52d4ea(0x192):return _0x52d4ea(0x181);case _0x52d4ea(0x180):return _0x52d4ea(0x182);case _0x52d4ea(0x190):return'Linux';default:return _0x52d4ea(0x194);}}export function formatMcpLogMessage(_0x44a3bd,_0x1b3d1f=a1_0x3c547c[a1_0x327885(0x18f)]()){var _0x3ec1b6=a1_0x327885;return _0x3ec1b6(0x191)+getOperatingSystemType(_0x1b3d1f)+']\x20'+_0x44a3bd;}export function logMcpStderr(_0x458364,..._0x450fe4){var _0x425782=a1_0x327885;console[_0x425782(0x183)](formatMcpLogMessage(_0x458364),..._0x450fe4),logger['info'](_0x425782(0x188),_0x458364,_0x450fe4[_0x425782(0x193)]?{'args':_0x450fe4[_0x425782(0x186)](_0x542baa=>String(_0x542baa))}:undefined);}function a1_0x4e8f(){var _0x3af947=['[os=','darwin','length','Unknown','560DDgEZd','win32','macOS','Windows','error','1329928gXREnQ','178084KFDRCA','map','886586ntvGNi','MCP','482082GLxTNO','1743340egJkGN','71442pKvTtu','4134GSKwPy','1hFntOe','14GryVgD','platform','linux'];a1_0x4e8f=function(){return _0x3af947;};return a1_0x4e8f();}
1
+ var a1_0x3cb76d=a1_0x34c4;function a1_0x34c4(_0x409289,_0x27886f){_0x409289=_0x409289-0x67;var _0x32c4ed=a1_0x32c4();var _0x34c464=_0x32c4ed[_0x409289];return _0x34c464;}(function(_0x1f693d,_0xa01517){var _0x399970=a1_0x34c4,_0x45cc68=_0x1f693d();while(!![]){try{var _0x123b3c=parseInt(_0x399970(0x7b))/0x1+parseInt(_0x399970(0x71))/0x2+-parseInt(_0x399970(0x70))/0x3*(-parseInt(_0x399970(0x74))/0x4)+-parseInt(_0x399970(0x69))/0x5*(-parseInt(_0x399970(0x79))/0x6)+-parseInt(_0x399970(0x78))/0x7+-parseInt(_0x399970(0x6e))/0x8+-parseInt(_0x399970(0x76))/0x9*(parseInt(_0x399970(0x77))/0xa);if(_0x123b3c===_0xa01517)break;else _0x45cc68['push'](_0x45cc68['shift']());}catch(_0x1a2334){_0x45cc68['push'](_0x45cc68['shift']());}}}(a1_0x32c4,0x28bb4));import a1_0x57b329 from'os';import{logger}from'./logger.js';function a1_0x32c4(){var _0x4feb6e=['Windows','2403MiIGct','14640cvSIEi','368305DwofrE','504tDNpjq','macOS','182246nbcAia','platform','map','8090CkKsoS','win32','linux','Linux','Unknown','1948272WKxSDf','info','699819oEikvU','604884zLklrN','MCP','length','4zqCGfR'];a1_0x32c4=function(){return _0x4feb6e;};return a1_0x32c4();}export function getOperatingSystemType(_0x1412d0=a1_0x57b329['platform']()){var _0x320fc9=a1_0x34c4;switch(_0x1412d0){case'darwin':return _0x320fc9(0x7a);case _0x320fc9(0x6a):return _0x320fc9(0x75);case _0x320fc9(0x6b):return _0x320fc9(0x6c);default:return _0x320fc9(0x6d);}}export function formatMcpLogMessage(_0x4a010e,_0x32364d=a1_0x57b329[a1_0x3cb76d(0x67)]()){return'[os='+getOperatingSystemType(_0x32364d)+']\x20'+_0x4a010e;}export function logMcpStderr(_0x48cbb1,..._0x5bd2e6){var _0x16c640=a1_0x3cb76d;console['error'](formatMcpLogMessage(_0x48cbb1),..._0x5bd2e6),logger[_0x16c640(0x6f)](_0x16c640(0x72),_0x48cbb1,_0x5bd2e6[_0x16c640(0x73)]?{'args':_0x5bd2e6[_0x16c640(0x68)](_0x2f8e80=>String(_0x2f8e80))}:undefined);}
package/dist/logger.js CHANGED
@@ -1 +1 @@
1
- function a2_0x23be(){const _0x152208=['22824hhzUbv','enable','MORPH_LOG_FILE',']\x20[','33400ZjoYWt','179694OBvdds','info','1344paCycd','debug','fileStream','9492480rFCwNq','stringify','3352671UqWlSF','384366iTcmOf','3006612PLqzqN','enabled','env','toUpperCase','2URkloM','warn','write','error','_log','120qkDRni','toISOString'];a2_0x23be=function(){return _0x152208;};return a2_0x23be();}const a2_0x24fef4=a2_0x3787;(function(_0x387f01,_0x535cf9){const _0x1f45b8=a2_0x3787,_0x18b0b0=_0x387f01();while(!![]){try{const _0x3c1618=-parseInt(_0x1f45b8(0x1c8))/0x1+-parseInt(_0x1f45b8(0x1cd))/0x2*(parseInt(_0x1f45b8(0x1d9))/0x3)+parseInt(_0x1f45b8(0x1d2))/0x4*(parseInt(_0x1f45b8(0x1d8))/0x5)+parseInt(_0x1f45b8(0x1c9))/0x6+parseInt(_0x1f45b8(0x1db))/0x7*(-parseInt(_0x1f45b8(0x1d4))/0x8)+-parseInt(_0x1f45b8(0x1e0))/0x9+parseInt(_0x1f45b8(0x1de))/0xa;if(_0x3c1618===_0x535cf9)break;else _0x18b0b0['push'](_0x18b0b0['shift']());}catch(_0x17bcf2){_0x18b0b0['push'](_0x18b0b0['shift']());}}}(a2_0x23be,0x45def));function a2_0x3787(_0x3e85be,_0x1d08c0){_0x3e85be=_0x3e85be-0x1c8;const _0x23beb5=a2_0x23be();let _0x37878c=_0x23beb5[_0x3e85be];return _0x37878c;}import{createWriteStream}from'fs';class MorphLogger{['enabled'];[a2_0x24fef4(0x1dd)];constructor(){const _0x122377=a2_0x24fef4;this[_0x122377(0x1ca)]=process['env']['MORPH_DEBUG']==='1'||!!process[_0x122377(0x1cb)][_0x122377(0x1d6)];const _0x5f22aa=process[_0x122377(0x1cb)][_0x122377(0x1d6)];this[_0x122377(0x1dd)]=_0x5f22aa?createWriteStream(_0x5f22aa,{'flags':'a'}):null;}[a2_0x24fef4(0x1dc)](_0x39d7ad,_0x161105,_0x2aeba8){const _0x4ebf93=a2_0x24fef4;this[_0x4ebf93(0x1d1)](_0x4ebf93(0x1dc),_0x39d7ad,_0x161105,_0x2aeba8);}[a2_0x24fef4(0x1da)](_0x16b9ce,_0x249a1c,_0x49f46f){const _0x408c54=a2_0x24fef4;this['_log'](_0x408c54(0x1da),_0x16b9ce,_0x249a1c,_0x49f46f);}[a2_0x24fef4(0x1ce)](_0x556ad9,_0x200e2c,_0x1642ae){const _0x390b9f=a2_0x24fef4;this['_log'](_0x390b9f(0x1ce),_0x556ad9,_0x200e2c,_0x1642ae);}[a2_0x24fef4(0x1d0)](_0x27c213,_0x3a31cc,_0x3f712c){const _0x345d47=a2_0x24fef4;this[_0x345d47(0x1d1)](_0x345d47(0x1d0),_0x27c213,_0x3a31cc,_0x3f712c);}[a2_0x24fef4(0x1d5)](){const _0x4ab7a3=a2_0x24fef4;this[_0x4ab7a3(0x1ca)]=!![];}get['isEnabled'](){const _0x310fc6=a2_0x24fef4;return this[_0x310fc6(0x1ca)];}[a2_0x24fef4(0x1d1)](_0x5ed082,_0x14f5e6,_0x503a15,_0x40b87a){const _0x4bbc63=a2_0x24fef4;if(_0x5ed082!==_0x4bbc63(0x1d0)&&!this['enabled'])return;const _0x98ed57=new Date()[_0x4bbc63(0x1d3)](),_0x47bf3a='['+_0x98ed57+_0x4bbc63(0x1d7)+_0x5ed082[_0x4bbc63(0x1cc)]()+_0x4bbc63(0x1d7)+_0x14f5e6+']';console[_0x4bbc63(0x1d0)](_0x40b87a?_0x47bf3a+'\x20'+_0x503a15+'\x20'+JSON[_0x4bbc63(0x1df)](_0x40b87a):_0x47bf3a+'\x20'+_0x503a15),this[_0x4bbc63(0x1dd)]?.[_0x4bbc63(0x1cf)](JSON[_0x4bbc63(0x1df)]({'ts':_0x98ed57,'level':_0x5ed082,'component':_0x14f5e6,'msg':_0x503a15,..._0x40b87a&&{'data':_0x40b87a}})+'\x0a');}}export const logger=new MorphLogger();
1
+ function a2_0x588d(_0x3e406f,_0x2a2f27){_0x3e406f=_0x3e406f-0x1b5;const _0x541694=a2_0x5416();let _0x588d90=_0x541694[_0x3e406f];return _0x588d90;}const a2_0x4d5afb=a2_0x588d;(function(_0x207068,_0x5bd4af){const _0x27826d=a2_0x588d,_0x2c4132=_0x207068();while(!![]){try{const _0x2e89c9=-parseInt(_0x27826d(0x1c6))/0x1+-parseInt(_0x27826d(0x1c0))/0x2*(-parseInt(_0x27826d(0x1cc))/0x3)+-parseInt(_0x27826d(0x1c4))/0x4*(parseInt(_0x27826d(0x1c7))/0x5)+parseInt(_0x27826d(0x1b6))/0x6+parseInt(_0x27826d(0x1c3))/0x7*(-parseInt(_0x27826d(0x1bd))/0x8)+parseInt(_0x27826d(0x1c8))/0x9+-parseInt(_0x27826d(0x1ba))/0xa*(-parseInt(_0x27826d(0x1cb))/0xb);if(_0x2e89c9===_0x5bd4af)break;else _0x2c4132['push'](_0x2c4132['shift']());}catch(_0x1dd694){_0x2c4132['push'](_0x2c4132['shift']());}}}(a2_0x5416,0x83f96));function a2_0x5416(){const _0x5c89f9=['debug','_log','40873ktldyn','4259572cvXRfA','write','409302qOQoYv','5VStpxa','2497896ssmlAr','enable','stringify','11GBmkBm','39pCmApD','warn',']\x20[','fileStream','4853190iPBRDB','info','MORPH_LOG_FILE','env','5076530zJqkPv','error','toUpperCase','704XIwNbc','enabled','isEnabled','143774OGjpJG'];a2_0x5416=function(){return _0x5c89f9;};return a2_0x5416();}import{createWriteStream}from'fs';class MorphLogger{[a2_0x4d5afb(0x1be)];[a2_0x4d5afb(0x1b5)];constructor(){const _0x521b5c=a2_0x4d5afb;this[_0x521b5c(0x1be)]=process[_0x521b5c(0x1b9)]['MORPH_DEBUG']==='1'||!!process['env'][_0x521b5c(0x1b8)];const _0x2bd6bd=process[_0x521b5c(0x1b9)][_0x521b5c(0x1b8)];this[_0x521b5c(0x1b5)]=_0x2bd6bd?createWriteStream(_0x2bd6bd,{'flags':'a'}):null;}[a2_0x4d5afb(0x1c1)](_0x3b0fad,_0xe84ba0,_0x58a962){const _0x346d9d=a2_0x4d5afb;this['_log'](_0x346d9d(0x1c1),_0x3b0fad,_0xe84ba0,_0x58a962);}[a2_0x4d5afb(0x1b7)](_0x492f9b,_0x404df4,_0x2aab30){const _0x527a06=a2_0x4d5afb;this[_0x527a06(0x1c2)](_0x527a06(0x1b7),_0x492f9b,_0x404df4,_0x2aab30);}[a2_0x4d5afb(0x1cd)](_0x13226a,_0x461ab9,_0x19dd06){const _0x4e611a=a2_0x4d5afb;this[_0x4e611a(0x1c2)](_0x4e611a(0x1cd),_0x13226a,_0x461ab9,_0x19dd06);}[a2_0x4d5afb(0x1bb)](_0x3b7b6f,_0x28195a,_0x125315){this['_log']('error',_0x3b7b6f,_0x28195a,_0x125315);}[a2_0x4d5afb(0x1c9)](){const _0x898663=a2_0x4d5afb;this[_0x898663(0x1be)]=!![];}get[a2_0x4d5afb(0x1bf)](){const _0x2b3223=a2_0x4d5afb;return this[_0x2b3223(0x1be)];}['_log'](_0x69274f,_0x946175,_0x476c7d,_0x13a92b){const _0x3fe6f7=a2_0x4d5afb;if(_0x69274f!==_0x3fe6f7(0x1bb)&&!this['enabled'])return;const _0x95a9bc=new Date()['toISOString'](),_0x4c15ef='['+_0x95a9bc+_0x3fe6f7(0x1ce)+_0x69274f[_0x3fe6f7(0x1bc)]()+']\x20['+_0x946175+']';console[_0x3fe6f7(0x1bb)](_0x13a92b?_0x4c15ef+'\x20'+_0x476c7d+'\x20'+JSON[_0x3fe6f7(0x1ca)](_0x13a92b):_0x4c15ef+'\x20'+_0x476c7d),this[_0x3fe6f7(0x1b5)]?.[_0x3fe6f7(0x1c5)](JSON[_0x3fe6f7(0x1ca)]({'ts':_0x95a9bc,'level':_0x69274f,'component':_0x946175,'msg':_0x476c7d,..._0x13a92b&&{'data':_0x13a92b}})+'\x0a');}}export const logger=new MorphLogger();
@@ -1 +1 @@
1
- (function(_0x2dc26b,_0x43a874){const _0x1d4989=a3_0x17a1,_0x53d0b8=_0x2dc26b();while(!![]){try{const _0x39dfee=-parseInt(_0x1d4989(0x9a))/0x1*(-parseInt(_0x1d4989(0x99))/0x2)+-parseInt(_0x1d4989(0x92))/0x3+parseInt(_0x1d4989(0x9b))/0x4+parseInt(_0x1d4989(0x8a))/0x5*(parseInt(_0x1d4989(0x98))/0x6)+parseInt(_0x1d4989(0x8e))/0x7+-parseInt(_0x1d4989(0x89))/0x8+-parseInt(_0x1d4989(0x97))/0x9;if(_0x39dfee===_0x43a874)break;else _0x53d0b8['push'](_0x53d0b8['shift']());}catch(_0x32d6ca){_0x53d0b8['push'](_0x53d0b8['shift']());}}}(a3_0x11f6,0xe3033));function a3_0x11f6(){const _0x142c93=['6coBXKW','2396sPbaCB','23AabPnY','519960PLAfef','trim','2344960MaYAjl','5522365NaSiFF','startsWith','charAt','replace','12271483tTVRCv','match','test','/mnt/','2583396llYMuN','join','slice','toUpperCase','normalize','8378919cAbXPf'];a3_0x11f6=function(){return _0x142c93;};return a3_0x11f6();}import a3_0x157c57 from'path';import a3_0x157f7a from'os';export function convertToWindowsPath(_0x2e8b6a){const _0x2c4238=a3_0x17a1;if(_0x2e8b6a[_0x2c4238(0x8b)](_0x2c4238(0x91))){const _0xacc346=_0x2e8b6a['charAt'](0x5)['toUpperCase'](),_0x8c7434=_0x2e8b6a[_0x2c4238(0x94)](0x6)['replace'](/\//g,'\x5c');return _0xacc346+':'+_0x8c7434;}if(_0x2e8b6a[_0x2c4238(0x8f)](/^\/[a-zA-Z]\//)){const _0x348b36=_0x2e8b6a[_0x2c4238(0x8c)](0x1)['toUpperCase'](),_0x51c8c2=_0x2e8b6a[_0x2c4238(0x94)](0x2)[_0x2c4238(0x8d)](/\//g,'\x5c');return _0x348b36+':'+_0x51c8c2;}if(_0x2e8b6a[_0x2c4238(0x8f)](/^[a-zA-Z]:/))return _0x2e8b6a[_0x2c4238(0x8d)](/\//g,'\x5c');return _0x2e8b6a;}function a3_0x17a1(_0x10bdb4,_0x789406){_0x10bdb4=_0x10bdb4-0x89;const _0x11f67b=a3_0x11f6();let _0x17a1f7=_0x11f67b[_0x10bdb4];return _0x17a1f7;}export function normalizePath(_0x3b1b92){const _0x592170=a3_0x17a1;_0x3b1b92=_0x3b1b92[_0x592170(0x9c)]()[_0x592170(0x8d)](/^["']|["']$/g,'');const _0x5ee501=_0x3b1b92['startsWith']('/')&&!_0x3b1b92[_0x592170(0x8f)](/^\/mnt\/[a-z]\//i)&&!_0x3b1b92[_0x592170(0x8f)](/^\/[a-zA-Z]\//);if(_0x5ee501)return _0x3b1b92[_0x592170(0x8d)](/\/+/g,'/')[_0x592170(0x8d)](/\/+$/,'');_0x3b1b92=convertToWindowsPath(_0x3b1b92);if(_0x3b1b92[_0x592170(0x8b)]('\x5c\x5c')){let _0x5038de=_0x3b1b92;_0x5038de=_0x5038de[_0x592170(0x8d)](/^\\{2,}/,'\x5c\x5c');const _0x254159=_0x5038de['substring'](0x2)[_0x592170(0x8d)](/\\\\/g,'\x5c');_0x3b1b92='\x5c\x5c'+_0x254159;}else _0x3b1b92=_0x3b1b92[_0x592170(0x8d)](/\\\\/g,'\x5c');let _0x3f6500=a3_0x157c57[_0x592170(0x96)](_0x3b1b92);_0x3b1b92[_0x592170(0x8b)]('\x5c\x5c')&&!_0x3f6500[_0x592170(0x8b)]('\x5c\x5c')&&(_0x3f6500='\x5c'+_0x3f6500);if(_0x3f6500[_0x592170(0x8f)](/^[a-zA-Z]:/)){let _0x24e5d1=_0x3f6500[_0x592170(0x8d)](/\//g,'\x5c');return/^[a-z]:/[_0x592170(0x90)](_0x24e5d1)&&(_0x24e5d1=_0x24e5d1['charAt'](0x0)[_0x592170(0x95)]()+_0x24e5d1[_0x592170(0x94)](0x1)),_0x24e5d1;}return _0x3f6500['replace'](/\//g,'\x5c');}export function expandHome(_0x266c62){const _0x3c274a=a3_0x17a1;if(_0x266c62[_0x3c274a(0x8b)]('~/')||_0x266c62==='~')return a3_0x157c57[_0x3c274a(0x93)](a3_0x157f7a['homedir'](),_0x266c62[_0x3c274a(0x94)](0x1));return _0x266c62;}
1
+ (function(_0x20f23c,_0x113203){const _0x4efce6=a3_0x1bbe,_0x4e72d1=_0x20f23c();while(!![]){try{const _0x40ec2a=parseInt(_0x4efce6(0x1b8))/0x1*(-parseInt(_0x4efce6(0x1b3))/0x2)+-parseInt(_0x4efce6(0x1bc))/0x3+parseInt(_0x4efce6(0x1b6))/0x4+-parseInt(_0x4efce6(0x1b1))/0x5*(-parseInt(_0x4efce6(0x1b2))/0x6)+-parseInt(_0x4efce6(0x1c0))/0x7+parseInt(_0x4efce6(0x1ad))/0x8*(-parseInt(_0x4efce6(0x1af))/0x9)+-parseInt(_0x4efce6(0x1ae))/0xa*(-parseInt(_0x4efce6(0x1be))/0xb);if(_0x40ec2a===_0x113203)break;else _0x4e72d1['push'](_0x4e72d1['shift']());}catch(_0x3ef217){_0x4e72d1['push'](_0x4e72d1['shift']());}}}(a3_0x18ee,0x3d7cb));import a3_0x964d14 from'path';function a3_0x1bbe(_0x116cfa,_0x4a5bd0){_0x116cfa=_0x116cfa-0x1ac;const _0x18ee66=a3_0x18ee();let _0x1bbe6b=_0x18ee66[_0x116cfa];return _0x1bbe6b;}import a3_0xc155c3 from'os';function a3_0x18ee(){const _0x5a8d24=['16xKpuzf','16470Mrqnpv','909747kmRGuE','slice','115735LAJmLW','114sPqbXs','1658YYsfLb','/mnt/','join','464188IwrznB','match','7sRHLfc','substring','charAt','toUpperCase','821970rPFpJs','startsWith','4433sKOzbX','replace','3400397SiQsHw','trim','homedir'];a3_0x18ee=function(){return _0x5a8d24;};return a3_0x18ee();}export function convertToWindowsPath(_0x4ed4fd){const _0x1ec95f=a3_0x1bbe;if(_0x4ed4fd[_0x1ec95f(0x1bd)](_0x1ec95f(0x1b4))){const _0x36f478=_0x4ed4fd[_0x1ec95f(0x1ba)](0x5)[_0x1ec95f(0x1bb)](),_0xd67d67=_0x4ed4fd[_0x1ec95f(0x1b0)](0x6)[_0x1ec95f(0x1bf)](/\//g,'\x5c');return _0x36f478+':'+_0xd67d67;}if(_0x4ed4fd['match'](/^\/[a-zA-Z]\//)){const _0x1d2ee6=_0x4ed4fd[_0x1ec95f(0x1ba)](0x1)[_0x1ec95f(0x1bb)](),_0x2e2ed0=_0x4ed4fd[_0x1ec95f(0x1b0)](0x2)[_0x1ec95f(0x1bf)](/\//g,'\x5c');return _0x1d2ee6+':'+_0x2e2ed0;}if(_0x4ed4fd[_0x1ec95f(0x1b7)](/^[a-zA-Z]:/))return _0x4ed4fd[_0x1ec95f(0x1bf)](/\//g,'\x5c');return _0x4ed4fd;}export function normalizePath(_0x542f84){const _0x1e1fcc=a3_0x1bbe;_0x542f84=_0x542f84[_0x1e1fcc(0x1c1)]()[_0x1e1fcc(0x1bf)](/^["']|["']$/g,'');const _0x296e8c=_0x542f84[_0x1e1fcc(0x1bd)]('/')&&!_0x542f84[_0x1e1fcc(0x1b7)](/^\/mnt\/[a-z]\//i)&&!_0x542f84[_0x1e1fcc(0x1b7)](/^\/[a-zA-Z]\//);if(_0x296e8c)return _0x542f84[_0x1e1fcc(0x1bf)](/\/+/g,'/')[_0x1e1fcc(0x1bf)](/\/+$/,'');_0x542f84=convertToWindowsPath(_0x542f84);if(_0x542f84[_0x1e1fcc(0x1bd)]('\x5c\x5c')){let _0x44cca3=_0x542f84;_0x44cca3=_0x44cca3['replace'](/^\\{2,}/,'\x5c\x5c');const _0x15d661=_0x44cca3[_0x1e1fcc(0x1b9)](0x2)[_0x1e1fcc(0x1bf)](/\\\\/g,'\x5c');_0x542f84='\x5c\x5c'+_0x15d661;}else _0x542f84=_0x542f84[_0x1e1fcc(0x1bf)](/\\\\/g,'\x5c');let _0x56c301=a3_0x964d14['normalize'](_0x542f84);_0x542f84[_0x1e1fcc(0x1bd)]('\x5c\x5c')&&!_0x56c301[_0x1e1fcc(0x1bd)]('\x5c\x5c')&&(_0x56c301='\x5c'+_0x56c301);if(_0x56c301['match'](/^[a-zA-Z]:/)){let _0x451323=_0x56c301[_0x1e1fcc(0x1bf)](/\//g,'\x5c');return/^[a-z]:/['test'](_0x451323)&&(_0x451323=_0x451323[_0x1e1fcc(0x1ba)](0x0)[_0x1e1fcc(0x1bb)]()+_0x451323[_0x1e1fcc(0x1b0)](0x1)),_0x451323;}return _0x56c301['replace'](/\//g,'\x5c');}export function expandHome(_0x4f2194){const _0x207e3f=a3_0x1bbe;if(_0x4f2194[_0x207e3f(0x1bd)]('~/')||_0x4f2194==='~')return a3_0x964d14[_0x207e3f(0x1b5)](a3_0xc155c3[_0x207e3f(0x1ac)](),_0x4f2194[_0x207e3f(0x1b0)](0x1));return _0x4f2194;}
@@ -1 +1 @@
1
- (function(_0x472dd0,_0x16f56d){const _0x5e674f=a4_0x490b,_0x43c92d=_0x472dd0();while(!![]){try{const _0x2a024e=-parseInt(_0x5e674f(0x12f))/0x1+parseInt(_0x5e674f(0x12e))/0x2+parseInt(_0x5e674f(0x126))/0x3+-parseInt(_0x5e674f(0x138))/0x4*(-parseInt(_0x5e674f(0x137))/0x5)+parseInt(_0x5e674f(0x133))/0x6+parseInt(_0x5e674f(0x12d))/0x7+parseInt(_0x5e674f(0x135))/0x8*(-parseInt(_0x5e674f(0x134))/0x9);if(_0x2a024e===_0x16f56d)break;else _0x43c92d['push'](_0x43c92d['shift']());}catch(_0x254185){_0x43c92d['push'](_0x43c92d['shift']());}}}(a4_0x27e8,0xcc979));import a4_0x4ccad0 from'path';export function isPathWithinAllowedDirectories(_0x23a533,_0x1c5d8b){const _0x211fec=a4_0x490b;if(typeof _0x23a533!=='string'||!Array[_0x211fec(0x125)](_0x1c5d8b))return![];if(!_0x23a533||_0x1c5d8b[_0x211fec(0x12b)]===0x0)return![];if(_0x23a533[_0x211fec(0x136)]('\x00'))return![];let _0x533f56;try{_0x533f56=a4_0x4ccad0['resolve'](a4_0x4ccad0['normalize'](_0x23a533));}catch{return![];}if(!a4_0x4ccad0[_0x211fec(0x132)](_0x533f56))throw new Error(_0x211fec(0x12c));return _0x1c5d8b[_0x211fec(0x12a)](_0x248ba0=>{const _0x3738bc=_0x211fec;if(typeof _0x248ba0!==_0x3738bc(0x139)||!_0x248ba0)return![];if(_0x248ba0['includes']('\x00'))return![];let _0x3f9f42;try{_0x3f9f42=a4_0x4ccad0[_0x3738bc(0x130)](a4_0x4ccad0[_0x3738bc(0x127)](_0x248ba0));}catch{return![];}if(!a4_0x4ccad0[_0x3738bc(0x132)](_0x3f9f42))throw new Error(_0x3738bc(0x129));if(_0x533f56===_0x3f9f42)return!![];if(_0x3f9f42===a4_0x4ccad0[_0x3738bc(0x128)])return _0x533f56[_0x3738bc(0x131)](a4_0x4ccad0[_0x3738bc(0x128)]);return _0x533f56[_0x3738bc(0x131)](_0x3f9f42+a4_0x4ccad0['sep']);});}function a4_0x490b(_0x492773,_0x313e63){_0x492773=_0x492773-0x125;const _0x27e825=a4_0x27e8();let _0x490b99=_0x27e825[_0x492773];return _0x490b99;}function a4_0x27e8(){const _0x40c1e4=['isArray','4464792MAwxqb','normalize','sep','Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization','some','length','Path\x20must\x20be\x20absolute\x20after\x20normalization','5740665iNTCwO','1377478pkwfjN','1205518WSZCzi','resolve','startsWith','isAbsolute','1113810IBtfrd','138879psmJnN','768gbnhin','includes','171085eIKOwR','40ghUeCt','string'];a4_0x27e8=function(){return _0x40c1e4;};return a4_0x27e8();}
1
+ (function(_0x36684f,_0x2bd14c){const _0x28599f=a4_0x534d,_0x4e924a=_0x36684f();while(!![]){try{const _0xadfc29=parseInt(_0x28599f(0x1d9))/0x1*(parseInt(_0x28599f(0x1d1))/0x2)+parseInt(_0x28599f(0x1e4))/0x3*(parseInt(_0x28599f(0x1db))/0x4)+parseInt(_0x28599f(0x1da))/0x5*(-parseInt(_0x28599f(0x1d3))/0x6)+-parseInt(_0x28599f(0x1e0))/0x7*(-parseInt(_0x28599f(0x1d2))/0x8)+parseInt(_0x28599f(0x1dc))/0x9+parseInt(_0x28599f(0x1e1))/0xa*(parseInt(_0x28599f(0x1d6))/0xb)+-parseInt(_0x28599f(0x1e3))/0xc;if(_0xadfc29===_0x2bd14c)break;else _0x4e924a['push'](_0x4e924a['shift']());}catch(_0x5c0f2e){_0x4e924a['push'](_0x4e924a['shift']());}}}(a4_0x20fa,0xd90be));function a4_0x20fa(){const _0x274b59=['429dhGudj','includes','some','30789fxveMh','3760qQpMlr','1132RYJkcV','1949445uPvRbX','isAbsolute','Path\x20must\x20be\x20absolute\x20after\x20normalization','length','14IbPVqi','101550qHojtE','startsWith','14739060pNKwPw','15927sJengX','4qgVuiu','3916456EAeEcY','8286iPAtum','sep','resolve'];a4_0x20fa=function(){return _0x274b59;};return a4_0x20fa();}import a4_0x470a2e from'path';function a4_0x534d(_0x521886,_0x247f1d){_0x521886=_0x521886-0x1d1;const _0x20fa95=a4_0x20fa();let _0x534df8=_0x20fa95[_0x521886];return _0x534df8;}export function isPathWithinAllowedDirectories(_0xbd203a,_0x5d8d36){const _0x523ba4=a4_0x534d;if(typeof _0xbd203a!=='string'||!Array['isArray'](_0x5d8d36))return![];if(!_0xbd203a||_0x5d8d36[_0x523ba4(0x1df)]===0x0)return![];if(_0xbd203a[_0x523ba4(0x1d7)]('\x00'))return![];let _0x2f4eb5;try{_0x2f4eb5=a4_0x470a2e['resolve'](a4_0x470a2e['normalize'](_0xbd203a));}catch{return![];}if(!a4_0x470a2e[_0x523ba4(0x1dd)](_0x2f4eb5))throw new Error(_0x523ba4(0x1de));return _0x5d8d36[_0x523ba4(0x1d8)](_0x39bb07=>{const _0x2e18ba=_0x523ba4;if(typeof _0x39bb07!=='string'||!_0x39bb07)return![];if(_0x39bb07['includes']('\x00'))return![];let _0x58787e;try{_0x58787e=a4_0x470a2e[_0x2e18ba(0x1d5)](a4_0x470a2e['normalize'](_0x39bb07));}catch{return![];}if(!a4_0x470a2e[_0x2e18ba(0x1dd)](_0x58787e))throw new Error('Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization');if(_0x2f4eb5===_0x58787e)return!![];if(_0x58787e===a4_0x470a2e[_0x2e18ba(0x1d4)])return _0x2f4eb5[_0x2e18ba(0x1e2)](a4_0x470a2e['sep']);return _0x2f4eb5['startsWith'](_0x58787e+a4_0x470a2e[_0x2e18ba(0x1d4)]);});}
@@ -1 +1 @@
1
- (function(_0x228c0c,_0x2e3e4d){const _0x205f34=a5_0x4669,_0x37f96c=_0x228c0c();while(!![]){try{const _0x2c4a56=-parseInt(_0x205f34(0x176))/0x1+-parseInt(_0x205f34(0x171))/0x2*(parseInt(_0x205f34(0x170))/0x3)+parseInt(_0x205f34(0x173))/0x4*(parseInt(_0x205f34(0x17a))/0x5)+-parseInt(_0x205f34(0x174))/0x6+parseInt(_0x205f34(0x16a))/0x7+-parseInt(_0x205f34(0x17b))/0x8+parseInt(_0x205f34(0x169))/0x9;if(_0x2c4a56===_0x2e3e4d)break;else _0x37f96c['push'](_0x37f96c['shift']());}catch(_0x2096ab){_0x37f96c['push'](_0x37f96c['shift']());}}}(a5_0x29c3,0x3172a));import{promises as a5_0x209606}from'fs';function a5_0x4669(_0x75fece,_0x498da7){_0x75fece=_0x75fece-0x169;const _0x29c3fe=a5_0x29c3();let _0x4669d0=_0x29c3fe[_0x75fece];return _0x4669d0;}import a5_0x2acb68 from'path';import a5_0x14b95c from'os';import{normalizePath}from'./path-utils.js';function a5_0x29c3(){const _0x27ee84=['3583197gqLcjN','245910lwMVpd','file://','homedir','Skipping\x20invalid\x20directory:\x20','startsWith','uri','27RoNokG','13358uOkJxc','stat','36QTooIE','624534LflfQS','slice','96142pkFcQH','\x20due\x20to\x20error:\x20','push','message','202715bKhepA','2682160KjcadH','non-directory\x20root','isDirectory','Skipping\x20'];a5_0x29c3=function(){return _0x27ee84;};return a5_0x29c3();}import{logMcpStderr}from'./log-utils.js';async function parseRootUri(_0x120feb){const _0x131a2e=a5_0x4669;try{const _0x4f7363=_0x120feb[_0x131a2e(0x16e)](_0x131a2e(0x16b))?_0x120feb[_0x131a2e(0x175)](0x7):_0x120feb,_0x58bbee=_0x4f7363['startsWith']('~/')||_0x4f7363==='~'?a5_0x2acb68['join'](a5_0x14b95c[_0x131a2e(0x16c)](),_0x4f7363[_0x131a2e(0x175)](0x1)):_0x4f7363,_0x22ee0b=a5_0x2acb68['resolve'](_0x58bbee),_0x502e2a=await a5_0x209606['realpath'](_0x22ee0b);return normalizePath(_0x502e2a);}catch{return null;}}function formatDirectoryError(_0x20738d,_0x17ecab,_0x554bbe){const _0x3f61f0=a5_0x4669;if(_0x554bbe)return _0x3f61f0(0x17e)+_0x554bbe+':\x20'+_0x20738d;const _0xdd5c5b=_0x17ecab instanceof Error?_0x17ecab[_0x3f61f0(0x179)]:String(_0x17ecab);return _0x3f61f0(0x16d)+_0x20738d+_0x3f61f0(0x177)+_0xdd5c5b;}export async function getValidRootDirectories(_0x392db6){const _0x3ca68f=a5_0x4669,_0x1b4b72=[];for(const _0x41520a of _0x392db6){const _0x111fd7=await parseRootUri(_0x41520a['uri']);if(!_0x111fd7){logMcpStderr(formatDirectoryError(_0x41520a[_0x3ca68f(0x16f)],undefined,'invalid\x20path\x20or\x20inaccessible'));continue;}try{const _0x1cb6ec=await a5_0x209606[_0x3ca68f(0x172)](_0x111fd7);_0x1cb6ec[_0x3ca68f(0x17d)]()?_0x1b4b72[_0x3ca68f(0x178)](_0x111fd7):logMcpStderr(formatDirectoryError(_0x111fd7,undefined,_0x3ca68f(0x17c)));}catch(_0x761331){logMcpStderr(formatDirectoryError(_0x111fd7,_0x761331));}}return _0x1b4b72;}
1
+ (function(_0x5b30dd,_0x3fa288){const _0x27f909=a5_0x3c49,_0x512716=_0x5b30dd();while(!![]){try{const _0x2e9c7e=-parseInt(_0x27f909(0x104))/0x1*(-parseInt(_0x27f909(0x109))/0x2)+parseInt(_0x27f909(0x10b))/0x3+-parseInt(_0x27f909(0x111))/0x4*(-parseInt(_0x27f909(0x108))/0x5)+parseInt(_0x27f909(0x10c))/0x6*(-parseInt(_0x27f909(0x107))/0x7)+-parseInt(_0x27f909(0x115))/0x8+parseInt(_0x27f909(0x106))/0x9*(-parseInt(_0x27f909(0x105))/0xa)+-parseInt(_0x27f909(0x102))/0xb*(parseInt(_0x27f909(0x10e))/0xc);if(_0x2e9c7e===_0x3fa288)break;else _0x512716['push'](_0x512716['shift']());}catch(_0x2d562a){_0x512716['push'](_0x512716['shift']());}}}(a5_0xb138,0x33aab));import{promises as a5_0x211077}from'fs';function a5_0xb138(){const _0x24292c=['push','2105ecYivf','387540kYyXlr','27XoQheR','187593xuesNd','1507745KZzjms','334SMJXrO','homedir','482781yzQMhc','24GrFaWR','Skipping\x20invalid\x20directory:\x20','19440qmZGlJ','join','file://','4LmxIfZ','startsWith','uri','isDirectory','2849968DlIiuX','\x20due\x20to\x20error:\x20','realpath','resolve','stat','Skipping\x20','slice','154ZgUzse'];a5_0xb138=function(){return _0x24292c;};return a5_0xb138();}import a5_0x13367d from'path';import a5_0x64426d from'os';import{normalizePath}from'./path-utils.js';import{logMcpStderr}from'./log-utils.js';function a5_0x3c49(_0x402407,_0x3e2b80){_0x402407=_0x402407-0xff;const _0xb1383d=a5_0xb138();let _0x3c497c=_0xb1383d[_0x402407];return _0x3c497c;}async function parseRootUri(_0x45ed22){const _0x5d4a99=a5_0x3c49;try{const _0x38dcd1=_0x45ed22[_0x5d4a99(0x112)](_0x5d4a99(0x110))?_0x45ed22[_0x5d4a99(0x101)](0x7):_0x45ed22,_0x395a89=_0x38dcd1[_0x5d4a99(0x112)]('~/')||_0x38dcd1==='~'?a5_0x13367d[_0x5d4a99(0x10f)](a5_0x64426d[_0x5d4a99(0x10a)](),_0x38dcd1[_0x5d4a99(0x101)](0x1)):_0x38dcd1,_0x1b3b10=a5_0x13367d[_0x5d4a99(0x118)](_0x395a89),_0x429752=await a5_0x211077[_0x5d4a99(0x117)](_0x1b3b10);return normalizePath(_0x429752);}catch{return null;}}function formatDirectoryError(_0x28bdfa,_0x2ac8f7,_0x98cedc){const _0x3e888c=a5_0x3c49;if(_0x98cedc)return _0x3e888c(0x100)+_0x98cedc+':\x20'+_0x28bdfa;const _0x7e4842=_0x2ac8f7 instanceof Error?_0x2ac8f7['message']:String(_0x2ac8f7);return _0x3e888c(0x10d)+_0x28bdfa+_0x3e888c(0x116)+_0x7e4842;}export async function getValidRootDirectories(_0x1f2ce1){const _0x4ba348=a5_0x3c49,_0x5256e4=[];for(const _0x189ff6 of _0x1f2ce1){const _0x47c783=await parseRootUri(_0x189ff6['uri']);if(!_0x47c783){logMcpStderr(formatDirectoryError(_0x189ff6[_0x4ba348(0x113)],undefined,'invalid\x20path\x20or\x20inaccessible'));continue;}try{const _0x5be49b=await a5_0x211077[_0x4ba348(0xff)](_0x47c783);_0x5be49b[_0x4ba348(0x114)]()?_0x5256e4[_0x4ba348(0x103)](_0x47c783):logMcpStderr(formatDirectoryError(_0x47c783,undefined,'non-directory\x20root'));}catch(_0x2fdb66){logMcpStderr(formatDirectoryError(_0x47c783,_0x2fdb66));}}return _0x5256e4;}
@@ -1 +1 @@
1
- const a6_0x272bb6=a6_0x3f2f;(function(_0x24e3aa,_0x4e7375){const _0x2d646c=a6_0x3f2f,_0x259eb1=_0x24e3aa();while(!![]){try{const _0x410f81=-parseInt(_0x2d646c(0x18f))/0x1+parseInt(_0x2d646c(0x195))/0x2+parseInt(_0x2d646c(0x193))/0x3+parseInt(_0x2d646c(0x196))/0x4*(parseInt(_0x2d646c(0x18d))/0x5)+parseInt(_0x2d646c(0x198))/0x6+parseInt(_0x2d646c(0x191))/0x7+parseInt(_0x2d646c(0x190))/0x8*(-parseInt(_0x2d646c(0x192))/0x9);if(_0x410f81===_0x4e7375)break;else _0x259eb1['push'](_0x259eb1['shift']());}catch(_0x9d866){_0x259eb1['push'](_0x259eb1['shift']());}}}(a6_0x36b9,0x99a6a));export const TOOL_NAMES={'EDIT_FILE':'edit_file','CODEBASE_SEARCH':a6_0x272bb6(0x18e),'GITHUB_CODEBASE_SEARCH':a6_0x272bb6(0x197)};function a6_0x36b9(){const _0xc32c22=['705404OESDad','56360CSeMfg','2334934cZydpn','729GKdznc','1134804RJRCCr','values','956724RdeoZX','4jiPjLF','github_codebase_search','1983780IxvDol','1922905lSFpNp','codebase_search'];a6_0x36b9=function(){return _0xc32c22;};return a6_0x36b9();}export const ALL_TOOL_NAMES=Object[a6_0x272bb6(0x194)](TOOL_NAMES);function a6_0x3f2f(_0x3f8856,_0x3138b0){_0x3f8856=_0x3f8856-0x18d;const _0x36b9db=a6_0x36b9();let _0x3f2f6c=_0x36b9db[_0x3f8856];return _0x3f2f6c;}export const KNOWN_TOOL_NAMES=new Set(ALL_TOOL_NAMES);
1
+ function a6_0x3419(){const _0x2129d7=['1058755rAOlKh','3YzOxGV','1710556FsTUiS','2422764qnljap','1000843ycVwzy','712Vuaekp','6cCrYPt','codebase_search','1345918RZcpzV','25058890GHetWk','103230XtFWDd'];a6_0x3419=function(){return _0x2129d7;};return a6_0x3419();}const a6_0x1c502f=a6_0x472f;(function(_0x594d25,_0x473098){const _0x403aa9=a6_0x472f,_0x43ce5e=_0x594d25();while(!![]){try{const _0x89e19b=-parseInt(_0x403aa9(0xa5))/0x1+-parseInt(_0x403aa9(0xa3))/0x2+-parseInt(_0x403aa9(0xad))/0x3*(parseInt(_0x403aa9(0xa4))/0x4)+-parseInt(_0x403aa9(0xac))/0x5+parseInt(_0x403aa9(0xa7))/0x6*(-parseInt(_0x403aa9(0xa9))/0x7)+parseInt(_0x403aa9(0xa6))/0x8*(parseInt(_0x403aa9(0xab))/0x9)+parseInt(_0x403aa9(0xaa))/0xa;if(_0x89e19b===_0x473098)break;else _0x43ce5e['push'](_0x43ce5e['shift']());}catch(_0x536571){_0x43ce5e['push'](_0x43ce5e['shift']());}}}(a6_0x3419,0xa1592));export const TOOL_NAMES={'EDIT_FILE':'edit_file','CODEBASE_SEARCH':a6_0x1c502f(0xa8),'GITHUB_CODEBASE_SEARCH':'github_codebase_search'};function a6_0x472f(_0x428397,_0x36e1ef){_0x428397=_0x428397-0xa3;const _0x341955=a6_0x3419();let _0x472f73=_0x341955[_0x428397];return _0x472f73;}export const ALL_TOOL_NAMES=Object['values'](TOOL_NAMES);export const KNOWN_TOOL_NAMES=new Set(ALL_TOOL_NAMES);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morphllm/morphmcp",
3
- "version": "0.8.194",
3
+ "version": "0.8.196",
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.184",
38
+ "@morphllm/morphsdk": "0.2.186",
39
39
  "@vscode/ripgrep": "^1.15.14",
40
40
  "axios": "^1.6.0",
41
41
  "chalk": "^5.3.0",