@morphllm/morphmcp 0.8.122 → 0.8.124
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/README.md +7 -4
- package/dist/index.js +1 -1
- package/dist/log-utils.d.ts +4 -0
- package/dist/log-utils.js +1 -0
- package/dist/path-utils.js +1 -1
- package/dist/path-validation.js +1 -1
- package/dist/roots-utils.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Supercharge your coding agent. One MCP with two specialized tools for faster edi
|
|
|
7
7
|
| Tool | What it does |
|
|
8
8
|
|------|-------------|
|
|
9
9
|
| `edit_file` | Apply code changes at 10,500+ tokens/sec with 98% accuracy |
|
|
10
|
-
| `
|
|
10
|
+
| `codebase_search` | Natural-language code exploration sub-agent backed by WarpGrep under the hood |
|
|
11
11
|
| `warpgrep_github_search` | Search any public GitHub repo by URL or `owner/repo` shorthand |
|
|
12
12
|
|
|
13
13
|
All three tools are always exposed. Clients can manage tool visibility on their side.
|
|
@@ -81,13 +81,16 @@ Input:
|
|
|
81
81
|
Output: Git-style unified diff showing exactly what changed
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
###
|
|
84
|
+
### codebase_search
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
`codebase_search` is the MCP-facing wrapper around WarpGrep. Ask a natural-language question about what you want to understand and it will use WarpGrep under the hood to locate relevant files and line ranges. It does not accept regex or symbol-only queries.
|
|
87
|
+
|
|
88
|
+
Good: `Where does auth get handled, what are the different oauth methods supported?`
|
|
89
|
+
Bad: `auth()`
|
|
87
90
|
|
|
88
91
|
```
|
|
89
92
|
Input:
|
|
90
|
-
search_string: "
|
|
93
|
+
search_string: "Where does auth get handled, what are the different oauth methods supported?"
|
|
91
94
|
repo_path: "/Users/me/project"
|
|
92
95
|
search_type: "default" # optional: "default" or "node_modules"
|
|
93
96
|
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a0_0x5accd5=a0_0x2735;function a0_0x2735(_0x2c2e80,_0x1f74c9){_0x2c2e80=_0x2c2e80-0xdf;const _0x5beb75=a0_0x5beb();let _0x2735b0=_0x5beb75[_0x2c2e80];return _0x2735b0;}(function(_0x45a722,_0x341859){const _0x14a1d3=a0_0x2735,_0xaf5fa0=_0x45a722();while(!![]){try{const _0x211861=parseInt(_0x14a1d3(0x1a4))/0x1*(-parseInt(_0x14a1d3(0x166))/0x2)+-parseInt(_0x14a1d3(0x17f))/0x3*(-parseInt(_0x14a1d3(0x1a1))/0x4)+-parseInt(_0x14a1d3(0x158))/0x5*(parseInt(_0x14a1d3(0x18f))/0x6)+parseInt(_0x14a1d3(0x18b))/0x7+parseInt(_0x14a1d3(0x149))/0x8+-parseInt(_0x14a1d3(0x11e))/0x9*(parseInt(_0x14a1d3(0xe3))/0xa)+parseInt(_0x14a1d3(0x17c))/0xb*(-parseInt(_0x14a1d3(0x141))/0xc);if(_0x211861===_0x341859)break;else _0xaf5fa0['push'](_0xaf5fa0['shift']());}catch(_0x20c70e){_0xaf5fa0['push'](_0xaf5fa0['shift']());}}}(a0_0x5beb,0xe803e));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_0x17b4df from'fs/promises';import a0_0x4fc884 from'path';import a0_0x43239c from'os';import{createRequire}from'module';import{z}from'zod';import{zodToJsonSchema}from'zod-to-json-schema';import{getValidRootDirectories}from'./roots-utils.js';import{executeEditFile}from'@morphllm/morphsdk/tools/fastapply';import{runWarpGrep,LocalRipgrepProvider,GITHUB_SEARCH_TOOL_NAME,GITHUB_SEARCH_DESCRIPTION}from'@morphllm/morphsdk/tools/warp-grep';import{WarpGrepClient,formatResult}from'@morphllm/morphsdk/tools/warp-grep/client';import a0_0x4262ea from'axios';function fixPathRepetition(_0x3658d0){const _0x551116=a0_0x2735,_0x355240=_0x3658d0[_0x551116(0x16c)](a0_0x4fc884[_0x551116(0x122)])[_0x551116(0x1a6)](Boolean);if(_0x355240[_0x551116(0x1b1)]<0x2)return null;for(let _0x5bd106=Math['floor'](_0x355240['length']/0x2);_0x5bd106>=0x1;_0x5bd106--){for(let _0x504aee=0x0;_0x504aee<=_0x355240['length']-0x2*_0x5bd106;_0x504aee++){const _0x365b06=_0x355240[_0x551116(0xf9)](_0x504aee,_0x504aee+_0x5bd106),_0x23ef5c=_0x355240['slice'](_0x504aee+_0x5bd106,_0x504aee+0x2*_0x5bd106);if(_0x365b06[_0x551116(0x195)]((_0x3791d8,_0x28782d)=>_0x3791d8===_0x23ef5c[_0x28782d])){const _0x27a5cf=[..._0x355240[_0x551116(0xf9)](0x0,_0x504aee),..._0x355240[_0x551116(0xf9)](_0x504aee+_0x5bd106)];return a0_0x4fc884[_0x551116(0x122)]+_0x27a5cf[_0x551116(0x111)](a0_0x4fc884[_0x551116(0x122)]);}}}return null;}const require=createRequire(import.meta.url);function getPackageVersion(){const _0x42daa5=a0_0x2735;try{const _0x111346=require(_0x42daa5(0x191));return _0x111346[_0x42daa5(0x164)]??_0x42daa5(0x10b);}catch(_0x1868a0){return console[_0x42daa5(0x156)](_0x42daa5(0x1d8),_0x1868a0),_0x42daa5(0x10b);}}function printHelp(){const _0xc20cc6=a0_0x2735;console[_0xc20cc6(0xfe)](_0xc20cc6(0xf4)+getPackageVersion()),console[_0xc20cc6(0xfe)](_0xc20cc6(0x1b2)),console['log'](_0xc20cc6(0x16e)),console[_0xc20cc6(0xfe)]('\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)'),console[_0xc20cc6(0xfe)](_0xc20cc6(0x1aa)),console[_0xc20cc6(0xfe)](_0xc20cc6(0xec)),console[_0xc20cc6(0xfe)]('\x0aExamples:'),console[_0xc20cc6(0xfe)]('\x20\x20morph-mcp'),console[_0xc20cc6(0xfe)](_0xc20cc6(0x12e));}const cliArgs=process[a0_0x5accd5(0x1de)]['slice'](0x2),VERSION_FLAGS=new Set([a0_0x5accd5(0xe5),'-v','-V']),HELP_FLAGS=new Set(['--help','-h']);cliArgs[a0_0x5accd5(0xe7)](_0x2cb8f8=>VERSION_FLAGS[a0_0x5accd5(0x125)](_0x2cb8f8))&&(console[a0_0x5accd5(0xfe)](a0_0x5accd5(0xf4)+getPackageVersion()),process[a0_0x5accd5(0x1dc)](0x0));cliArgs[a0_0x5accd5(0xe7)](_0x59fd34=>HELP_FLAGS['has'](_0x59fd34))&&(printHelp(),process[a0_0x5accd5(0x1dc)](0x0));function getCliArg(_0x5e2650){const _0x4c0344=a0_0x5accd5;for(let _0x59187a=0x0;_0x59187a<cliArgs[_0x4c0344(0x1b1)];_0x59187a++){const _0x133b1e=cliArgs[_0x59187a];if(_0x133b1e[_0x4c0344(0x1cf)]('--'+_0x5e2650+'='))return _0x133b1e[_0x4c0344(0xf9)](('--'+_0x5e2650+'=')['length']);if(_0x133b1e==='--'+_0x5e2650&&_0x59187a+0x1<cliArgs[_0x4c0344(0x1b1)])return cliArgs[_0x59187a+0x1];}return undefined;}function a0_0x5beb(){const _0x498144=['content','.cursor','Parent\x20directory\x20does\x20not\x20exist:\x20','files','role','The\x20search\x20term\x20should\x20be\x20a\x20targeted\x20natural\x20language\x20query\x20based\x20on\x20what\x20you\x20are\x20trying\x20to\x20accomplish,\x20like\x20\x27Find\x20where\x20authentication\x20requests\x20are\x20handled\x20in\x20the\x20Express\x20routes\x27\x20or\x20\x27Modify\x20the\x20agentic\x20rollout\x20to\x20use\x20the\x20new\x20tokenizer\x20and\x20chat\x20template\x27\x20or\x20\x27Fix\x20the\x20bug\x20where\x20the\x20user\x20gets\x20redirected\x20from\x20the\x20/feed\x20page\x27.\x20','\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo','Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:','grep','Morph\x20FastApply\x20failed\x20without\x20error\x20message','Morph\x20Edit\x20Preview','Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','morph-v3-fast','.\x20Changes:\x20','completed_with_file_errors','edit_file','Cargo.toml','\x20as\x20allowed\x20directory','RipgrepNotAvailable','.vscode','Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio','homedir','Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.','toLowerCase','12uxaOTJ','\x0a...\x20(truncated,\x20total:\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.','linesAdded','WarpGrep\x20sub-tool\x20errors:\x20','Error:\x20','MORPH_API_URL','Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id','5447608nimSfM','now','source','success','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','setRequestHandler','\x20-\x20','🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a','linesRemoved','PathError','ms.\x20Success:\x20','user','<file\x20path=\x22','error','connect','13210tPsmoj','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','trim','-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','Relevant\x20context\x20found:','grep\x20\x27','access','Applied','errors','-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a','Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol','constructor','version','code_edit','969470VMFkLZ','oninitialized','dirname','normalize','Fatal\x20error\x20running\x20server:','\x0a</file>','split','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','\x0aOptions:','[could\x20not\x20read\x20file:\x20','Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)','setNotificationHandler','tsconfig.json','package.json','min','default','GitHub\x20search\x20failed:\x20','map','File\x20read\x20error:','basename','-\x20Listed\x20directory\x20`','FileNotFound','4606162wLtqiF','Invalid\x20arguments:\x20','-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a','7011LAeDxb','etimedout','-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a','Repository\x20identifier','A\x20search\x20subagent\x20the\x20user\x20refers\x20to\x20as\x20\x27WarpGrep\x27\x20that\x20is\x20ideal\x20for\x20exploring\x20the\x20codebase\x20based\x20on\x20a\x20request.\x20','go.mod','morph-warp-grep-v1-1111v0','describe','data','search_string','cwd','0.2.0','10040926RbtuKC','Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a','warpgrep_github_search','completed','1392MxqXtq','WORKSPACE_ROOT','../package.json','resolve','timed\x20out','added\x20','every','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.','Preview\x20changes\x20without\x20applying\x20them.','object','api-key','\x20for:\x20\x22','requiresApiKey','❌\x20Morph\x20Edit\x20Failed:\x20','match','Created\x20File','branch','-\x20Grepped\x20\x27','688LEzJGx','Benefits:\x0a','Warning:\x20Workspace\x20fallback\x20failed:\x20','1lGtjGY','UnknownError','filter','PWD',',\x20modified\x20','dryRun','\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit','ToolException','all','WarpGrepError','terminationReason','listRoots','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','length','\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]','terminated','ENABLE_WORKSPACE_MODE','Unknown\x20tool:\x20','getClientCapabilities','isDirectory','\x27\x20in\x20`','repo_path','safeParse','sk-','Failed\x20to\x20request\x20roots\x20from\x20client:','Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27','Natural\x20language\x20query\x20to\x20search\x20for\x20code','node_modules','-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a','enum','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','indexOf','lines','timeout','BinaryFile','Note:\x20The\x20files\x20and\x20line\x20ranges\x20returned\x20by\x20this\x20tool\x20may\x20be\x20some\x20of\x20the\x20ones\x20needed\x20to\x20complete\x20the\x20user\x27s\x20request,\x20but\x20you\x20should\x20be\x20careful\x20in\x20evaluating\x20the\x20relevance\x20of\x20the\x20results,\x20since\x20the\x20subagent\x20might\x20make\x20mistakes.\x20','MORPH_API_KEY','Invalid\x20arguments\x20for\x20morph_edit_file:\x20','\x20error(s)','metadata','stack','RipgrepError','name','startsWith','Search\x20problem\x20statement\x20that\x20this\x20subagent\x20is\x20supposed\x20to\x20research\x20for','\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)','params','Error\x20accessing\x20directory\x20','stringify','finish','string','timings','Warning:\x20Unable\x20to\x20determine\x20package\x20version:','For\x20deletions:\x0a','-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a','**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a','exit','payload','argv','roots','ms:','assistant','application/json','[warpgrep_github_search]\x20Searching\x20','readFile','110zLMGRB','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','--version','ENOENT','some','push','.git','SymlinkError','MORPH_WARP_GREP_TIMEOUT','\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit','isArray','stat','Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','optional','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.','IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a','ReadError','@morphllm/morphmcp\x20','morph-','\x20is\x20not\x20a\x20directory','-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a','SubToolError','slice','[warpgrep_github_search]\x20Done\x20in\x20','\x20chars)','warpgrep_codebase_search','\x20valid\x20directories','log','completionId','.\x20Path:\x20','Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all','realpath','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','utf-8','Rules:\x0a','path','github_url','message','catch','</file>','unknown','code','--api-key=','list_directory\x20','[warpgrep_github_search]\x20Failed\x20in\x20','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.','join','instruction','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20subagent\x20in\x20its\x20search.\x20','mcp-filesystem','messages','Morph\x20Edit\x20','TimeoutError','read\x20','includes','-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a','env','unknown\x20error','You\x20should\x20consider\x20using\x20classical\x20search\x20tools\x20afterwards\x20to\x20locate\x20the\x20rest,\x20but\x20only\x20if\x20necessary.\x20','41382fSvkda','substring','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','No\x20relevant\x20code\x20found\x20for\x20the\x20query.','sep','pyproject.toml','text','has','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','read'];a0_0x5beb=function(){return _0x498144;};return a0_0x5beb();}const args=[];for(let i=0x0;i<cliArgs[a0_0x5accd5(0x1b1)];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x5accd5(0x125)](arg)||HELP_FLAGS['has'](arg))continue;if(arg[a0_0x5accd5(0x1cf)](a0_0x5accd5(0x10d)))continue;if(arg==='--api-key'){i++;continue;}args[a0_0x5accd5(0xe8)](arg);}const WORKSPACE_ROOT=process[a0_0x5accd5(0x11b)][a0_0x5accd5(0x190)]||process['env'][a0_0x5accd5(0x1a7)]||process[a0_0x5accd5(0x189)](),ENABLE_WORKSPACE_MODE=process[a0_0x5accd5(0x11b)][a0_0x5accd5(0x1b4)]!=='false',MORPH_API_KEY=getCliArg(a0_0x5accd5(0x199))??process[a0_0x5accd5(0x11b)][a0_0x5accd5(0x1c8)],MORPH_API_URL=process[a0_0x5accd5(0x11b)][a0_0x5accd5(0x147)],MORPH_WARP_GREP_TIMEOUT=process[a0_0x5accd5(0x11b)][a0_0x5accd5(0xeb)]?parseInt(process['env'][a0_0x5accd5(0xeb)],0xa):undefined;MORPH_API_KEY&&!MORPH_API_KEY[a0_0x5accd5(0x1cf)](a0_0x5accd5(0x1bb))&&!MORPH_API_KEY[a0_0x5accd5(0x1cf)](a0_0x5accd5(0xf5))&&console[a0_0x5accd5(0x156)](a0_0x5accd5(0x1bd));async function reportMorphError(_0x2df119){const _0x1c40ee=a0_0x5accd5;try{await a0_0x4262ea['post']('https://morphllm.com/api/error-report',{..._0x2df119,'timestamp':new Date()['toISOString'](),'source':_0x2df119[_0x1c40ee(0x14b)]||_0x1c40ee(0x114)},{'timeout':0x1388,'headers':{'Content-Type':_0x1c40ee(0xe0),'Authorization':'Bearer\x20'+MORPH_API_KEY}});}catch{}}args[a0_0x5accd5(0x1b1)]===0x0&&!ENABLE_WORKSPACE_MODE&&(console['error'](a0_0x5accd5(0x120)),console[a0_0x5accd5(0x156)](a0_0x5accd5(0x14d)),console['error'](a0_0x5accd5(0xe4)),console['error']('\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)'),console[a0_0x5accd5(0x156)](a0_0x5accd5(0x1d1)),console[a0_0x5accd5(0x156)](a0_0x5accd5(0x110)));function normalizePath(_0x2aaf83){const _0x56663c=a0_0x5accd5;return a0_0x4fc884[_0x56663c(0x169)](_0x2aaf83);}function expandHome(_0x5d02d6){const _0x26e0a3=a0_0x5accd5;if(_0x5d02d6[_0x26e0a3(0x1cf)]('~/')||_0x5d02d6==='~')return a0_0x4fc884['join'](a0_0x43239c[_0x26e0a3(0x13e)](),_0x5d02d6['slice'](0x1));return _0x5d02d6;}let allowedDirectories=await Promise['all'](args[a0_0x5accd5(0x177)](async _0xff75c2=>{const _0x4ec22d=a0_0x5accd5,_0x45587b=expandHome(_0xff75c2),_0x414780=a0_0x4fc884[_0x4ec22d(0x192)](_0x45587b);try{const _0xb929ff=await a0_0x17b4df[_0x4ec22d(0x102)](_0x414780);return normalizePath(_0xb929ff);}catch(_0x5c1ef8){return normalizePath(_0x414780);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x5accd5(0x1b1)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories[a0_0x5accd5(0xe8)](workspaceDir),console['error']('Workspace\x20mode\x20enabled:\x20Using\x20'+workspaceDir+a0_0x5accd5(0x13a)));}catch(a0_0x1ac7ea){console['error'](a0_0x5accd5(0x103)+a0_0x1ac7ea);}async function detectWorkspaceRoot(_0x2ca2bb){const _0x4b1cea=a0_0x5accd5;let _0x44d536=a0_0x4fc884[_0x4b1cea(0x192)](_0x2ca2bb);const _0x3b2eb3=[_0x4b1cea(0xe9),_0x4b1cea(0x13c),_0x4b1cea(0x173),_0x4b1cea(0x139),_0x4b1cea(0x123),_0x4b1cea(0x184),_0x4b1cea(0x129),_0x4b1cea(0x172),'composer.json'];while(_0x44d536!==a0_0x4fc884['dirname'](_0x44d536)){for(const _0x332abf of _0x3b2eb3){const _0x877828=a0_0x4fc884['join'](_0x44d536,_0x332abf);try{return await a0_0x17b4df[_0x4b1cea(0x15e)](_0x877828),normalizePath(_0x44d536);}catch{}}_0x44d536=a0_0x4fc884['dirname'](_0x44d536);}return normalizePath(_0x2ca2bb);}await Promise[a0_0x5accd5(0x1ac)](args[a0_0x5accd5(0x177)](async _0x4e7240=>{const _0x36755d=a0_0x5accd5;try{const _0x32754c=await a0_0x17b4df[_0x36755d(0xee)](expandHome(_0x4e7240));!_0x32754c[_0x36755d(0x1b7)]()&&(console[_0x36755d(0x156)](_0x36755d(0x146)+_0x4e7240+_0x36755d(0xf6)),process['exit'](0x1));}catch(_0x28d927){console[_0x36755d(0x156)](_0x36755d(0x1d3)+_0x4e7240+':',_0x28d927),process[_0x36755d(0x1dc)](0x1);}}));async function validatePath(_0x4bec67){const _0x311823=a0_0x5accd5,_0x108311=expandHome(_0x4bec67),_0x776d6c=a0_0x4fc884[_0x311823(0x192)](_0x108311);try{const _0x283c41=await a0_0x17b4df[_0x311823(0x102)](_0x776d6c);return _0x283c41;}catch(_0x47c35d){if(_0x47c35d[_0x311823(0x10c)]===_0x311823(0xe6)){const _0x464704=a0_0x4fc884[_0x311823(0x168)](_0x776d6c);try{const _0xc46aab=await a0_0x17b4df['realpath'](_0x464704);return a0_0x4fc884['join'](_0xc46aab,a0_0x4fc884[_0x311823(0x179)](_0x776d6c));}catch{throw new Error(_0x311823(0x12a)+_0x464704);}}throw _0x47c35d;}}const MorphEditFileArgsSchema=z['object']({'path':z[a0_0x5accd5(0x1d6)](),'code_edit':z[a0_0x5accd5(0x1d6)]()[a0_0x5accd5(0x186)](a0_0x5accd5(0x126)),'instruction':z[a0_0x5accd5(0x1d6)]()[a0_0x5accd5(0x186)]('A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.'),'dryRun':z['boolean']()[a0_0x5accd5(0x175)](![])[a0_0x5accd5(0x186)](a0_0x5accd5(0x197))}),WarpGrepArgsSchema=z[a0_0x5accd5(0x198)]({'search_string':z[a0_0x5accd5(0x1d6)]()['describe'](a0_0x5accd5(0x1d0)),'repo_path':z[a0_0x5accd5(0x1d6)]()[a0_0x5accd5(0x186)]('The\x20absolute\x20path\x20of\x20the\x20folder\x20where\x20the\x20search\x20should\x20be\x20performed.\x20In\x20multi-repo\x20workspaces,\x20you\x20have\x20to\x20specify\x20a\x20subfolder\x20where\x20the\x20search\x20should\x20be\x20performed,\x20to\x20avoid\x20searching\x20across\x20all\x20repos'),'search_type':z[a0_0x5accd5(0x1c1)]([a0_0x5accd5(0x175),'node_modules'])['optional']()[a0_0x5accd5(0x186)](a0_0x5accd5(0x13f))}),WarpGrepGitHubArgsSchema=z[a0_0x5accd5(0x198)]({'search_string':z['string']()[a0_0x5accd5(0x186)](a0_0x5accd5(0x1d0)),'github_url':z[a0_0x5accd5(0x1d6)]()[a0_0x5accd5(0xf0)]()[a0_0x5accd5(0x186)](a0_0x5accd5(0xf1)),'owner_repo':z[a0_0x5accd5(0x1d6)]()['optional']()[a0_0x5accd5(0x186)](a0_0x5accd5(0xef)),'branch':z[a0_0x5accd5(0x1d6)]()['optional']()[a0_0x5accd5(0x186)](a0_0x5accd5(0x170))}),CodebaseSearchArgsSchema=z[a0_0x5accd5(0x198)]({'query':z[a0_0x5accd5(0x1d6)]()[a0_0x5accd5(0x186)](a0_0x5accd5(0x1be)),'repoId':z[a0_0x5accd5(0x1d6)]()[a0_0x5accd5(0x186)](a0_0x5accd5(0x182)),'branch':z[a0_0x5accd5(0x1d6)]()[a0_0x5accd5(0xf0)]()[a0_0x5accd5(0x186)]('Branch\x20to\x20search\x20(uses\x20latest\x20commit)'),'commitHash':z['string']()[a0_0x5accd5(0xf0)]()['describe']('Specific\x20commit\x20hash\x20to\x20search'),'targetDirectories':z['array'](z[a0_0x5accd5(0x1d6)]())[a0_0x5accd5(0x175)]([])[a0_0x5accd5(0x186)](a0_0x5accd5(0x101)),'limit':z['number']()[a0_0x5accd5(0xf0)]()[a0_0x5accd5(0x175)](0xa)[a0_0x5accd5(0x186)]('Max\x20results\x20to\x20return')}),server=new Server({'name':'morph-mcp','version':a0_0x5accd5(0x18a)},{'capabilities':{'tools':{}}});server['setRequestHandler'](ListToolsRequestSchema,async()=>{const _0x243c8e=a0_0x5accd5,_0x2a0751=[{'name':_0x243c8e(0x138),'description':_0x243c8e(0x1db)+'⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a'+_0x243c8e(0x150)+_0x243c8e(0xf2)+_0x243c8e(0x1a2)+_0x243c8e(0xf7)+'-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a'+_0x243c8e(0x1da)+_0x243c8e(0x11a)+_0x243c8e(0x18c)+'ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a'+'Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a'+_0x243c8e(0x1d9)+'-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a'+_0x243c8e(0x1c0)+_0x243c8e(0x105)+'-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a'+_0x243c8e(0x17e)+_0x243c8e(0x161)+'-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a'+_0x243c8e(0x15b)+_0x243c8e(0x181)+'IMPORTANT:\x20If\x20you\x20are\x20running\x20within\x20Cursor,\x20you\x20MUST\x20FIRST\x20use\x20another\x20tool\x20(like\x20search_replace)\x20to\x20add\x20exactly\x20one\x20empty\x20new\x20line\x20somewhere\x20in\x20the\x20file\x20before\x20using\x20this\x20tool.\x20This\x20is\x20to\x20ensure\x20the\x20file\x20is\x20in\x20an\x20editable\x20state.\x0a','inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x243c8e(0xfc),'description':_0x243c8e(0x183)+'This\x20tool\x20invokes\x20a\x20subagent\x20that\x20runs\x20parallel\x20grep\x20and\x20readfile\x20calls\x20over\x20multiple\x20turns\x20to\x20locate\x20line\x20ranges\x20and\x20files\x20which\x20might\x20be\x20relevant\x20to\x20the\x20request.\x20'+_0x243c8e(0x12d)+_0x243c8e(0x113)+_0x243c8e(0x196)+_0x243c8e(0x1c7)+_0x243c8e(0x11d)+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]}],_0x41a5a5=_0x2a0751[_0x243c8e(0x1a6)](_0xbb9862=>{const _0x17ae6c=_0x243c8e;if(_0x17ae6c(0x19b)in _0xbb9862&&_0xbb9862[_0x17ae6c(0x19b)]&&!MORPH_API_KEY)return console[_0x17ae6c(0x156)]('Warning:\x20'+_0xbb9862[_0x17ae6c(0x1ce)]+_0x17ae6c(0x134)),![];return!![];});return{'tools':_0x41a5a5[_0x243c8e(0x177)](_0x78242c=>({'name':_0x78242c[_0x243c8e(0x1ce)],'description':_0x78242c['description'],'inputSchema':_0x78242c['inputSchema']}))};}),server[a0_0x5accd5(0x14e)](CallToolRequestSchema,async _0x4ef3fa=>{const _0x2f1896=a0_0x5accd5;try{const {name:_0xc7b4df,arguments:_0x2710a8}=_0x4ef3fa[_0x2f1896(0x1d2)];switch(_0xc7b4df){case _0x2f1896(0x138):{const _0x460485=MorphEditFileArgsSchema[_0x2f1896(0x1ba)](_0x2710a8);if(!_0x460485[_0x2f1896(0x14c)])throw new Error(_0x2f1896(0x1c9)+_0x460485['error']);const _0x50b496=await validatePath(_0x460485[_0x2f1896(0x187)][_0x2f1896(0x106)]);let _0x4070ff=null,_0x51175f=!![],_0x59a299=null;try{_0x4070ff=await a0_0x17b4df['readFile'](_0x50b496,'utf-8');}catch(_0x22f0f1){const _0x59972c=_0x22f0f1[_0x2f1896(0x10c)];_0x59972c===_0x2f1896(0xe6)?(_0x51175f=![],_0x4070ff=''):(_0x59a299='Failed\x20to\x20read\x20file:\x20'+(_0x59972c||_0x2f1896(0x10b))+_0x2f1896(0x14f)+(_0x22f0f1 instanceof Error?_0x22f0f1[_0x2f1896(0x108)]:String(_0x22f0f1)),console[_0x2f1896(0x156)]('Warning:\x20'+_0x59a299));}let _0x48fc16;try{const _0x2acb41=MORPH_API_KEY;if(!_0x2acb41)throw new Error(_0x2f1896(0x1c2));const _0x84643=a0_0x4fc884[_0x2f1896(0x168)](_0x50b496),_0x595933=a0_0x4fc884[_0x2f1896(0x179)](_0x50b496),_0x5f3023=await executeEditFile({'target_filepath':_0x595933,'code_edit':_0x460485[_0x2f1896(0x187)][_0x2f1896(0x165)],'instructions':_0x460485[_0x2f1896(0x187)]['instruction']},{'morphApiKey':_0x2acb41,'morphApiUrl':MORPH_API_URL,'baseDir':_0x84643,'autoWrite':!_0x460485['data'][_0x2f1896(0x1a9)],'generateUdiff':![],'debug':![]});_0x48fc16=_0x5f3023[_0x2f1896(0xff)];if(!_0x5f3023[_0x2f1896(0x14c)])throw new Error(_0x5f3023[_0x2f1896(0x156)]||_0x2f1896(0x131));const _0xbc5740=_0x5f3023['changes'],_0x44f038=_0x2f1896(0x194)+_0xbc5740[_0x2f1896(0x144)]+',\x20removed\x20'+_0xbc5740[_0x2f1896(0x151)]+_0x2f1896(0x1a8)+_0xbc5740['linesModified'];if(_0x460485[_0x2f1896(0x187)]['dryRun'])return{'content':[{'type':'text','text':_0x2f1896(0x132)+(_0x51175f?'':'\x20(new\x20file)')+':\x20'+_0x460485[_0x2f1896(0x187)][_0x2f1896(0x112)]+_0x2f1896(0x136)+_0x44f038+_0x2f1896(0x100)+_0x460485['data'][_0x2f1896(0x106)]+'.'}]};return{'content':[{'type':'text','text':_0x2f1896(0x116)+(_0x51175f?_0x2f1896(0x15f):_0x2f1896(0x19e))+':\x20'+_0x460485[_0x2f1896(0x187)]['instruction']+_0x2f1896(0x136)+_0x44f038+_0x2f1896(0x100)+_0x460485[_0x2f1896(0x187)][_0x2f1896(0x106)]+'.'}]};}catch(_0x37bc18){const _0x50a3aa=_0x37bc18 instanceof Error?_0x37bc18['message']:String(_0x37bc18);return reportMorphError({'error_message':_0x50a3aa,'error_type':_0x37bc18 instanceof Error?_0x37bc18['constructor']['name']:_0x2f1896(0x1a5),'context':{'tool':_0x2f1896(0x138),'completion_id':_0x48fc16,'file_path':_0x460485[_0x2f1896(0x187)][_0x2f1896(0x106)],'validated_path':_0x50b496,'instruction':_0x460485[_0x2f1896(0x187)][_0x2f1896(0x112)],'model':_0x2f1896(0x135),'dry_run':_0x460485[_0x2f1896(0x187)]['dryRun'],'file_exists':_0x51175f,'file_read_error':_0x59a299,'file_readable':_0x4070ff!==null,'request_content':{'path':_0x460485[_0x2f1896(0x187)][_0x2f1896(0x106)],'code_edit':_0x460485[_0x2f1896(0x187)]['code_edit'],'instruction':_0x460485[_0x2f1896(0x187)][_0x2f1896(0x112)],'original_code':_0x4070ff!==null?_0x4070ff[_0x2f1896(0x1b1)]>0xc350?_0x4070ff['substring'](0x0,0xc350)+_0x2f1896(0x142)+_0x4070ff[_0x2f1896(0x1b1)]+_0x2f1896(0xfb):_0x4070ff:_0x2f1896(0x16f)+(_0x59a299||_0x2f1896(0x11c))+']','original_code_length':_0x4070ff?.[_0x2f1896(0x1b1)]??0x0,'model':_0x2f1896(0x135),'dry_run':_0x460485['data'][_0x2f1896(0x1a9)]}},'stack_trace':_0x37bc18 instanceof Error?_0x37bc18[_0x2f1896(0x1cc)]:undefined,'source':_0x2f1896(0x114)})[_0x2f1896(0x109)](()=>{}),{'content':[{'type':'text','text':_0x2f1896(0x19c)+_0x50a3aa}],'isError':!![]};}}case _0x2f1896(0xfc):{const _0x3eadce=WarpGrepArgsSchema[_0x2f1896(0x1ba)](_0x2710a8);if(!_0x3eadce[_0x2f1896(0x14c)])return{'content':[{'type':'text','text':_0x2f1896(0x17d)+_0x3eadce[_0x2f1896(0x156)]}],'isError':!![]};const _0x5ba31f=_0x506c2b=>{const _0x61a2ac=_0x2f1896,_0x2a708d=[];for(const _0x3f4887 of _0x506c2b||[]){const _0x510f0d=_0x3f4887[_0x61a2ac(0x12c)],_0x385677=_0x3f4887[_0x61a2ac(0x128)];if(_0x510f0d===_0x61a2ac(0xdf)&&_0x385677){const _0x585b20=_0x385677['split']('\x0a')[_0x61a2ac(0x1a6)](_0x382084=>_0x382084[_0x61a2ac(0x15a)]());for(const _0x416435 of _0x585b20){const _0x47c178=_0x416435[_0x61a2ac(0x19d)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x47c178){_0x2a708d[_0x61a2ac(0xe8)](_0x61a2ac(0x15d)+_0x47c178[0x1]+'\x27\x20'+_0x47c178[0x2]);continue;}const _0x463666=_0x416435['match'](/^read\s+(.+)$/);if(_0x463666){_0x2a708d[_0x61a2ac(0xe8)](_0x61a2ac(0x118)+_0x463666[0x1]);continue;}const _0x27c4b5=_0x416435[_0x61a2ac(0x19d)](/^list_directory\s+(.+)$/);if(_0x27c4b5){_0x2a708d[_0x61a2ac(0xe8)](_0x61a2ac(0x10e)+_0x27c4b5[0x1]);continue;}}}}return _0x2a708d;},_0x445630=_0x4032e7=>{const _0x208967=_0x2f1896,_0x5ed422=[];if(!_0x4032e7||!Array['isArray'](_0x4032e7))return _0x5ed422;const _0x5a31ab=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':_0x208967(0x17b),'tool':_0x208967(0x127)},{'pattern':/\[PATH ERROR\]/,'error_type':_0x208967(0x152),'tool':_0x208967(0x127)},{'pattern':/\[READ ERROR\]/,'error_type':_0x208967(0xf3),'tool':_0x208967(0x127)},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0x208967(0x1c6),'tool':'read'},{'pattern':/\[RIPGREP ERROR\]/,'error_type':_0x208967(0x1cd),'tool':_0x208967(0x130)},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':_0x208967(0x13b),'tool':'grep'},{'pattern':/\[BINARY FILE\]/,'error_type':'BinaryFile','tool':_0x208967(0x127)},{'pattern':/\[SYMLINK\]/,'error_type':_0x208967(0xea),'tool':_0x208967(0x127)},{'pattern':/not a text file/,'error_type':_0x208967(0x1c6),'tool':'read'},{'pattern':/symbolic link/,'error_type':_0x208967(0xea),'tool':_0x208967(0x127)},{'pattern':/Error reading file:/,'error_type':_0x208967(0xf3),'tool':_0x208967(0x127)},{'pattern':/status="error"/,'error_type':_0x208967(0x1ab),'tool':_0x208967(0x10b)}];let _0x4959ea=0x0;for(const _0x585ba5 of _0x4032e7){if(_0x585ba5[_0x208967(0x12c)]===_0x208967(0x154)){_0x4959ea++;const _0x96cb65=_0x585ba5[_0x208967(0x128)];if(!_0x96cb65||typeof _0x96cb65!==_0x208967(0x1d6))continue;for(const {pattern:_0x498dd7,error_type:_0x5c4274,tool:_0x2280e9}of _0x5a31ab){const _0x197fa1=_0x96cb65[_0x208967(0x19d)](new RegExp(_0x498dd7[_0x208967(0x14b)],'g'));if(_0x197fa1)for(const _0x18f705 of _0x197fa1){const _0x1fc3b6=_0x96cb65[_0x208967(0x1c3)](_0x18f705),_0x558bce=_0x96cb65[_0x208967(0x11f)](_0x1fc3b6,Math[_0x208967(0x174)](_0x1fc3b6+0xc8,_0x96cb65[_0x208967(0x1b1)]));_0x5ed422[_0x208967(0xe8)]({'tool':_0x2280e9,'error_type':_0x5c4274,'error_message':_0x558bce[_0x208967(0x16c)]('\x0a')[0x0],'turn':_0x4959ea});}}}}return _0x5ed422;};try{const _0x40a25a=a0_0x4fc884[_0x2f1896(0x192)](_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)]),_0x4afd9b=_0x3eadce[_0x2f1896(0x187)]['search_type'],_0x14d310=_0x4afd9b===_0x2f1896(0x1bf)?{'allowNames':['node_modules']}:undefined,_0x34fe17=new LocalRipgrepProvider(_0x40a25a,undefined,_0x14d310),_0x145764=await runWarpGrep({'searchTerm':_0x3eadce['data'][_0x2f1896(0x188)],'repoRoot':_0x40a25a,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x34fe17,'search_type':_0x4afd9b}),_0x1dab85=_0x445630(_0x145764[_0x2f1896(0x115)]);_0x1dab85[_0x2f1896(0x1b1)]>0x0&&reportMorphError({'error_message':_0x2f1896(0x145)+_0x1dab85['length']+_0x2f1896(0x1ca),'error_type':_0x2f1896(0xf8),'level':'warn','tool':_0x2f1896(0xfc),'context':{'repo_path':_0x3eadce[_0x2f1896(0x187)]['repo_path'],'query':_0x3eadce[_0x2f1896(0x187)]['search_string'],'model':'morph-warp-grep-v1-1111v0','termination_reason':_0x145764[_0x2f1896(0x1ae)],'sub_tool_errors':_0x1dab85,'timings':_0x145764[_0x2f1896(0x1d7)],'tool_calls':_0x5ba31f(_0x145764[_0x2f1896(0x115)]),'messages':_0x145764[_0x2f1896(0x115)]?.[_0x2f1896(0x177)](_0x21f486=>({'role':_0x21f486[_0x2f1896(0x12c)],'content':_0x21f486[_0x2f1896(0x128)]}))},'source':_0x2f1896(0x114)})['catch'](()=>{});let _0x346c5f='';if(_0x145764['terminationReason']===_0x2f1896(0x18e)&&_0x145764[_0x2f1896(0x1d5)]?.[_0x2f1896(0x1cb)]?.[_0x2f1896(0x12b)]){const _0x3e98a9=_0x145764[_0x2f1896(0x1d5)][_0x2f1896(0x1cb)]['files'];if(_0x3e98a9['length']===0x0)return _0x346c5f=_0x145764[_0x2f1896(0x1d5)][_0x2f1896(0x1dd)]||_0x2f1896(0x121),{'content':[{'type':_0x2f1896(0x124),'text':_0x346c5f}]};const _0x5f385c=[],_0x101a48=[_0x2f1896(0x12f)];for(const _0x2508ad of _0x145764[_0x2f1896(0x115)]){const _0x21b035=_0x2508ad[_0x2f1896(0x12c)],_0x478e99=_0x2508ad[_0x2f1896(0x128)];if(_0x21b035==='assistant'&&_0x478e99){const _0x14b0e5=_0x478e99[_0x2f1896(0x16c)]('\x0a')[_0x2f1896(0x1a6)](_0x507f56=>_0x507f56[_0x2f1896(0x15a)]());for(const _0x3792c5 of _0x14b0e5){const _0x2c37a1=_0x3792c5[_0x2f1896(0x19d)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x2c37a1){_0x101a48['push'](_0x2f1896(0x1a0)+_0x2c37a1[0x1]+_0x2f1896(0x1b8)+_0x2c37a1[0x2]+'`');continue;}const _0x4cca14=_0x3792c5[_0x2f1896(0x19d)](/^read\s+(.+)$/);if(_0x4cca14){_0x101a48['push']('-\x20Read\x20file\x20`'+_0x4cca14[0x1]+'`');continue;}const _0x2e0e0b=_0x3792c5[_0x2f1896(0x19d)](/^list_directory\s+(.+)$/);if(_0x2e0e0b){_0x101a48[_0x2f1896(0xe8)](_0x2f1896(0x17a)+_0x2e0e0b[0x1]+'`');continue;}}}}_0x5f385c[_0x2f1896(0xe8)](_0x101a48[_0x2f1896(0x111)]('\x0a'));const _0x28c34c=['',_0x2f1896(0x15c)];for(const _0x5a0a22 of _0x3e98a9){if(_0x5a0a22[_0x2f1896(0x1c4)]==='*')_0x28c34c[_0x2f1896(0xe8)]('-\x20'+_0x5a0a22[_0x2f1896(0x106)]+':*');else{if(Array[_0x2f1896(0xed)](_0x5a0a22[_0x2f1896(0x1c4)])){const _0x1395f7=_0x5a0a22[_0x2f1896(0x1c4)][_0x2f1896(0x177)](([_0x3afead,_0x6d656d])=>{if(_0x3afead===_0x6d656d)return''+_0x3afead;return _0x3afead+'-'+_0x6d656d;});_0x28c34c[_0x2f1896(0xe8)]('-\x20'+_0x5a0a22[_0x2f1896(0x106)]+':'+_0x1395f7[_0x2f1896(0x111)](','));}else _0x28c34c[_0x2f1896(0xe8)]('-\x20'+_0x5a0a22[_0x2f1896(0x106)]+':*');}}_0x28c34c[_0x2f1896(0xe8)](''),_0x5f385c[_0x2f1896(0xe8)](_0x28c34c[_0x2f1896(0x111)]('\x0a')),_0x5f385c['push']('Here\x20is\x20the\x20content\x20of\x20files:\x0a');const _0x5f4808=[];for(const _0x251737 of _0x3e98a9){let _0x4b7167=a0_0x4fc884[_0x2f1896(0x192)](_0x3eadce['data']['repo_path'],_0x251737[_0x2f1896(0x106)]),_0x14af59=null,_0x1fd4a6=null;try{_0x14af59=await a0_0x17b4df['readFile'](_0x4b7167,{'encoding':_0x2f1896(0x104)});}catch(_0x5b87fb){const _0x1a0f73=fixPathRepetition(_0x4b7167);if(_0x1a0f73)try{_0x14af59=await a0_0x17b4df[_0x2f1896(0xe2)](_0x1a0f73,{'encoding':_0x2f1896(0x104)}),_0x4b7167=_0x1a0f73;}catch{_0x1fd4a6=_0x5b87fb instanceof Error?_0x5b87fb:new Error(String(_0x5b87fb));}else _0x1fd4a6=_0x5b87fb instanceof Error?_0x5b87fb:new Error(String(_0x5b87fb));}if(_0x14af59!==null){const _0x1f563a=_0x14af59[_0x2f1896(0x16c)](/\r?\n/),_0x232c01=[_0x2f1896(0x155)+_0x251737['path']+'\x22>'];if(_0x251737['lines']==='*'||!Array['isArray'](_0x251737[_0x2f1896(0x1c4)]))for(let _0x3274af=0x1;_0x3274af<=_0x1f563a[_0x2f1896(0x1b1)];_0x3274af++){const _0x1bdd81=_0x1f563a[_0x3274af-0x1];_0x232c01[_0x2f1896(0xe8)](_0x3274af+'|\x20'+_0x1bdd81);}else for(const [_0xcda84f,_0x2df127]of _0x251737['lines']){_0x232c01[_0x2f1896(0x1b1)]>0x1&&_0x232c01[_0x2f1896(0xe8)]('');for(let _0x3fb809=_0xcda84f;_0x3fb809<=_0x2df127&&_0x3fb809<=_0x1f563a[_0x2f1896(0x1b1)];_0x3fb809++){const _0x353279=_0x1f563a[_0x3fb809-0x1];_0x232c01[_0x2f1896(0xe8)](_0x3fb809+'|\x20'+_0x353279);}}_0x232c01['push'](_0x2f1896(0x10a)),_0x5f4808['push'](_0x232c01['join']('\x0a'));}else _0x5f4808['push'](_0x2f1896(0x155)+_0x251737[_0x2f1896(0x106)]+'\x22>\x0aError\x20reading\x20file:\x20'+(_0x1fd4a6?.[_0x2f1896(0x108)]||'Unknown\x20error')+_0x2f1896(0x16b));}_0x5f385c[_0x2f1896(0xe8)](_0x5f4808['join']('\x0a\x0a')),_0x346c5f=_0x5f385c[_0x2f1896(0x111)]('\x0a');const _0x36ecc4=_0x145764[_0x2f1896(0x160)]?.[_0x2f1896(0x1a6)](_0x370dc5=>_0x370dc5[_0x2f1896(0x108)]?.['startsWith'](_0x2f1896(0x178)))||[];if(_0x36ecc4['length']>0x0){const _0x397ab3=_0x36ecc4[_0x2f1896(0x177)](_0x4f3148=>_0x4f3148[_0x2f1896(0x108)])[_0x2f1896(0x111)](';\x20');reportMorphError({'error_message':_0x397ab3,'error_type':'FileReadError','context':{'tool':'warpgrep_codebase_search','repo_path':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)],'query':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x188)],'model':_0x2f1896(0x185),'termination_reason':_0x2f1896(0x137),'error_count':_0x36ecc4[_0x2f1896(0x1b1)],'is_timeout':![],'timings':_0x145764[_0x2f1896(0x1d7)],'files_attempted':_0x3e98a9[_0x2f1896(0x177)](_0x3e5fb=>({'path':_0x3e5fb['path'],'lines':_0x3e5fb[_0x2f1896(0x1c4)]})),'tool_calls':_0x5ba31f(_0x145764['messages']),'messages':_0x145764[_0x2f1896(0x115)]?.[_0x2f1896(0x177)](_0x592bc8=>({'role':_0x592bc8[_0x2f1896(0x12c)],'content':_0x592bc8[_0x2f1896(0x128)]})),'request_content':{'query':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x188)],'repo_path':_0x3eadce[_0x2f1896(0x187)]['repo_path'],'repoRoot':a0_0x4fc884[_0x2f1896(0x192)](_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)]),'model':'morph-warp-grep-v1-1111v0'}},'source':_0x2f1896(0x114)})[_0x2f1896(0x109)](()=>{});}}else{if(_0x145764[_0x2f1896(0x1ae)]===_0x2f1896(0x1b3)&&_0x145764['errors']['length']>0x0){const _0x2f5b66=_0x145764[_0x2f1896(0x160)][_0x2f1896(0x177)](_0xc15fe5=>_0xc15fe5['message'])[_0x2f1896(0x111)](';\x20');_0x346c5f='Error:\x20'+_0x2f5b66;const _0x2e5249=_0x2f5b66['toLowerCase']()['includes'](_0x2f1896(0x1c5))||_0x2f5b66[_0x2f1896(0x140)]()[_0x2f1896(0x119)]('timed\x20out')||_0x2f5b66[_0x2f1896(0x140)]()[_0x2f1896(0x119)](_0x2f1896(0x180)),_0x4a1f59=_0x145764[_0x2f1896(0x1d5)]?.['metadata']?.['files'],_0x353375=_0x145764['errors'][0x0];reportMorphError({'error_message':_0x2f5b66,'error_type':_0x2e5249?_0x2f1896(0x117):_0x353375?.['constructor']?.['name']||_0x2f1896(0x1ad),'context':{'tool':_0x2f1896(0xfc),'repo_path':_0x3eadce['data'][_0x2f1896(0x1b9)],'query':_0x3eadce[_0x2f1896(0x187)]['search_string'],'model':_0x2f1896(0x185),'termination_reason':_0x145764[_0x2f1896(0x1ae)],'error_count':_0x145764['errors'][_0x2f1896(0x1b1)],'is_timeout':_0x2e5249,'timings':_0x145764[_0x2f1896(0x1d7)],'files_attempted':_0x4a1f59?.[_0x2f1896(0x177)](_0xe421c3=>({'path':_0xe421c3[_0x2f1896(0x106)],'lines':_0xe421c3[_0x2f1896(0x1c4)]})),'tool_calls':_0x5ba31f(_0x145764[_0x2f1896(0x115)]),'messages':_0x145764['messages']?.['map'](_0x14ebab=>({'role':_0x14ebab[_0x2f1896(0x12c)],'content':_0x14ebab[_0x2f1896(0x128)]})),'request_content':{'query':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x188)],'repo_path':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)],'repoRoot':a0_0x4fc884['resolve'](_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)]),'model':_0x2f1896(0x185)}},'stack_trace':_0x353375?.[_0x2f1896(0x1cc)]||undefined,'source':_0x2f1896(0x114)})[_0x2f1896(0x109)](()=>{});}else _0x346c5f='Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.';}return{'content':[{'type':'text','text':_0x346c5f}]};}catch(_0x2ee4b8){const _0x537adc=_0x2ee4b8 instanceof Error?_0x2ee4b8[_0x2f1896(0x108)]:String(_0x2ee4b8),_0x3df61b=_0x537adc[_0x2f1896(0x140)]()['includes'](_0x2f1896(0x1c5))||_0x537adc[_0x2f1896(0x140)]()[_0x2f1896(0x119)](_0x2f1896(0x193))||_0x537adc[_0x2f1896(0x140)]()[_0x2f1896(0x119)]('etimedout')||_0x2ee4b8 instanceof Error&&_0x2ee4b8[_0x2f1896(0x1ce)]===_0x2f1896(0x117);return reportMorphError({'error_message':_0x537adc,'error_type':_0x3df61b?_0x2f1896(0x117):_0x2ee4b8 instanceof Error?_0x2ee4b8[_0x2f1896(0x163)]['name']:_0x2f1896(0x1a5),'context':{'tool':'warpgrep_codebase_search','repo_path':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)],'query':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x188)],'model':_0x2f1896(0x185),'is_timeout':_0x3df61b,'exception_phase':'runWarpGrep_call','request_content':{'query':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x188)],'repo_path':_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)],'repoRoot':a0_0x4fc884[_0x2f1896(0x192)](_0x3eadce[_0x2f1896(0x187)][_0x2f1896(0x1b9)]),'model':_0x2f1896(0x185)}},'stack_trace':_0x2ee4b8 instanceof Error?_0x2ee4b8[_0x2f1896(0x1cc)]:undefined,'source':'mcp-filesystem'})[_0x2f1896(0x109)](()=>{}),{'content':[{'type':_0x2f1896(0x124),'text':'Error\x20running\x20fast\x20context\x20search:\x20'+_0x537adc}],'isError':![]};}}case _0x2f1896(0x18d):{const _0x2f169f=WarpGrepGitHubArgsSchema[_0x2f1896(0x1ba)](_0x2710a8);if(!_0x2f169f['success'])return{'content':[{'type':'text','text':'Invalid\x20arguments:\x20'+_0x2f169f[_0x2f1896(0x156)]}],'isError':!![]};const _0x197959=_0x2f169f[_0x2f1896(0x187)][_0x2f1896(0x107)]||_0x2f169f[_0x2f1896(0x187)]['owner_repo'];if(!_0x197959)return{'content':[{'type':_0x2f1896(0x124),'text':_0x2f1896(0x148)}],'isError':!![]};const _0x372ef5=MORPH_API_KEY;if(!_0x372ef5)throw new Error(_0x2f1896(0x1c2));const _0x2445e0=Date[_0x2f1896(0x14a)]();console[_0x2f1896(0x156)](_0x2f1896(0xe1)+_0x197959+_0x2f1896(0x19a)+_0x2f169f[_0x2f1896(0x187)][_0x2f1896(0x188)]+'\x22');try{const _0x48a247=new WarpGrepClient({'morphApiKey':_0x372ef5,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x37b498=await _0x48a247['searchGitHub']({'searchTerm':_0x2f169f[_0x2f1896(0x187)]['search_string'],'github':_0x197959,'branch':_0x2f169f['data'][_0x2f1896(0x19f)]}),_0x414485=Date[_0x2f1896(0x14a)]()-_0x2445e0;console['error'](_0x2f1896(0xfa)+_0x414485+_0x2f1896(0x153)+_0x37b498[_0x2f1896(0x14c)]);const _0x3bcb98=formatResult(_0x37b498);return{'content':[{'type':_0x2f1896(0x124),'text':_0x3bcb98}]};}catch(_0x2ecfbb){const _0x314147=Date[_0x2f1896(0x14a)]()-_0x2445e0,_0x21f76b=_0x2ecfbb instanceof Error?_0x2ecfbb[_0x2f1896(0x108)]:String(_0x2ecfbb);return console[_0x2f1896(0x156)](_0x2f1896(0x10f)+_0x314147+_0x2f1896(0x1e0),_0x21f76b),reportMorphError({'error_message':_0x21f76b,'error_type':_0x2ecfbb instanceof Error?_0x2ecfbb[_0x2f1896(0x163)][_0x2f1896(0x1ce)]:'UnknownError','context':{'tool':_0x2f1896(0x18d),'github_url':_0x197959,'search_string':_0x2f169f['data'][_0x2f1896(0x188)],'branch':_0x2f169f[_0x2f1896(0x187)][_0x2f1896(0x19f)]},'stack_trace':_0x2ecfbb instanceof Error?_0x2ecfbb[_0x2f1896(0x1cc)]:undefined,'source':_0x2f1896(0x114),'tool':_0x2f1896(0x18d),'latency_ms':_0x314147})[_0x2f1896(0x109)](()=>{}),{'content':[{'type':_0x2f1896(0x124),'text':_0x2f1896(0x176)+_0x21f76b}],'isError':![]};}}default:throw new Error(_0x2f1896(0x1b5)+_0xc7b4df);}}catch(_0x59a0af){const _0x5399ec=_0x59a0af instanceof Error?_0x59a0af[_0x2f1896(0x108)]:String(_0x59a0af);return reportMorphError({'error_message':_0x5399ec,'error_type':_0x59a0af instanceof Error?_0x59a0af[_0x2f1896(0x163)][_0x2f1896(0x1ce)]:_0x2f1896(0x1a5),'context':{'tool':name,'arguments':args?JSON[_0x2f1896(0x1d4)](args)['substring'](0x0,0x1f4):undefined,'mcp_server_version':_0x2f1896(0x18a)},'stack_trace':_0x59a0af instanceof Error?_0x59a0af[_0x2f1896(0x1cc)]:undefined,'source':_0x2f1896(0x114)})[_0x2f1896(0x109)](()=>{}),{'content':[{'type':_0x2f1896(0x124),'text':_0x2f1896(0x146)+_0x5399ec}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x1b3ae7){const _0x369fae=a0_0x5accd5,_0x423e40=await getValidRootDirectories(_0x1b3ae7);if(_0x423e40[_0x369fae(0x1b1)]>0x0)allowedDirectories=[..._0x423e40],console[_0x369fae(0x156)](_0x369fae(0x16d)+_0x423e40[_0x369fae(0x1b1)]+_0x369fae(0xfd));else{console[_0x369fae(0x156)](_0x369fae(0x159));if(ENABLE_WORKSPACE_MODE)try{const _0x24f5db=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x24f5db&&(allowedDirectories=[_0x24f5db],console[_0x369fae(0x156)]('Fallback:\x20Using\x20workspace\x20root\x20'+_0x24f5db));}catch(_0x413747){console[_0x369fae(0x156)](_0x369fae(0x1a3)+_0x413747);}}}server[a0_0x5accd5(0x171)](RootsListChangedNotificationSchema,async()=>{const _0x5adec5=a0_0x5accd5;try{const _0x31010b=await server['listRoots']();_0x31010b&&'roots'in _0x31010b&&await updateAllowedDirectoriesFromRoots(_0x31010b['roots']);}catch(_0x4c2703){console[_0x5adec5(0x156)](_0x5adec5(0x1bc),_0x4c2703 instanceof Error?_0x4c2703[_0x5adec5(0x108)]:String(_0x4c2703));}}),server[a0_0x5accd5(0x167)]=async()=>{const _0x13ed4b=a0_0x5accd5,_0x1c1cb9=server[_0x13ed4b(0x1b6)]();if(_0x1c1cb9?.[_0x13ed4b(0x1df)])try{const _0x2cfdd8=await server[_0x13ed4b(0x1af)]();_0x2cfdd8&&_0x13ed4b(0x1df)in _0x2cfdd8?await updateAllowedDirectoriesFromRoots(_0x2cfdd8[_0x13ed4b(0x1df)]):console[_0x13ed4b(0x156)](_0x13ed4b(0x133));}catch(_0xb6f118){console[_0x13ed4b(0x156)]('Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:',_0xb6f118 instanceof Error?_0xb6f118[_0x13ed4b(0x108)]:String(_0xb6f118));}else{if(allowedDirectories[_0x13ed4b(0x1b1)]>0x0)console[_0x13ed4b(0x156)]('Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:',allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)console[_0x13ed4b(0x156)](_0x13ed4b(0x1b0));else throw new Error(_0x13ed4b(0x143));}}};async function runServer(){const _0x3967d8=a0_0x5accd5,_0x3fd187=new StdioServerTransport();await server[_0x3967d8(0x157)](_0x3fd187),console['error'](_0x3967d8(0x13d)),allowedDirectories['length']===0x0&&console[_0x3967d8(0x156)](_0x3967d8(0x162));}runServer()[a0_0x5accd5(0x109)](_0x4b8761=>{const _0xcefe83=a0_0x5accd5;console['error'](_0xcefe83(0x16a),_0x4b8761),process['exit'](0x1);});
|
|
2
|
+
const a0_0x5161e1=a0_0xeed9;(function(_0x5170b9,_0x3ebbd8){const _0x129f4b=a0_0xeed9,_0x3712ac=_0x5170b9();while(!![]){try{const _0x46dfe9=parseInt(_0x129f4b(0x1c6))/0x1+parseInt(_0x129f4b(0x210))/0x2*(-parseInt(_0x129f4b(0x23a))/0x3)+parseInt(_0x129f4b(0x1ef))/0x4*(-parseInt(_0x129f4b(0x1f9))/0x5)+-parseInt(_0x129f4b(0x171))/0x6+parseInt(_0x129f4b(0x178))/0x7*(parseInt(_0x129f4b(0x219))/0x8)+parseInt(_0x129f4b(0x1d2))/0x9+parseInt(_0x129f4b(0x1e0))/0xa;if(_0x46dfe9===_0x3ebbd8)break;else _0x3712ac['push'](_0x3712ac['shift']());}catch(_0x37ddb6){_0x3712ac['push'](_0x3712ac['shift']());}}}(a0_0x5cf2,0x86b56));import{Server}from'@modelcontextprotocol/sdk/server/index.js';function a0_0xeed9(_0x3be1c0,_0xac2014){_0x3be1c0=_0x3be1c0-0x169;const _0x5cf241=a0_0x5cf2();let _0xeed9c2=_0x5cf241[_0x3be1c0];return _0xeed9c2;}import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{CallToolRequestSchema,ListToolsRequestSchema,RootsListChangedNotificationSchema}from'@modelcontextprotocol/sdk/types.js';import a0_0x1c7bdf from'fs/promises';import a0_0x5d3f4b from'path';import a0_0x792fd from'os';import{createRequire}from'module';import{z}from'zod';import{zodToJsonSchema}from'zod-to-json-schema';import{getValidRootDirectories}from'./roots-utils.js';import{getOperatingSystemType,logMcpStderr}from'./log-utils.js';import{executeEditFile}from'@morphllm/morphsdk/tools/fastapply';import{runWarpGrep,LocalRipgrepProvider,GITHUB_SEARCH_TOOL_NAME,GITHUB_SEARCH_DESCRIPTION}from'@morphllm/morphsdk/tools/warp-grep';import{WarpGrepClient,formatResult}from'@morphllm/morphsdk/tools/warp-grep/client';import a0_0x5885bc from'axios';function fixPathRepetition(_0x223100){const _0x3e760b=a0_0xeed9,_0x1bd1ea=_0x223100['split'](a0_0x5d3f4b[_0x3e760b(0x188)])[_0x3e760b(0x242)](Boolean);if(_0x1bd1ea[_0x3e760b(0x23d)]<0x2)return null;for(let _0x523324=Math[_0x3e760b(0x215)](_0x1bd1ea[_0x3e760b(0x23d)]/0x2);_0x523324>=0x1;_0x523324--){for(let _0x5e7ba6=0x0;_0x5e7ba6<=_0x1bd1ea['length']-0x2*_0x523324;_0x5e7ba6++){const _0x68ff82=_0x1bd1ea['slice'](_0x5e7ba6,_0x5e7ba6+_0x523324),_0x6513d1=_0x1bd1ea[_0x3e760b(0x243)](_0x5e7ba6+_0x523324,_0x5e7ba6+0x2*_0x523324);if(_0x68ff82['every']((_0x4f5cdc,_0x4b489f)=>_0x4f5cdc===_0x6513d1[_0x4b489f])){const _0x27b19e=[..._0x1bd1ea[_0x3e760b(0x243)](0x0,_0x5e7ba6),..._0x1bd1ea[_0x3e760b(0x243)](_0x5e7ba6+_0x523324)];return a0_0x5d3f4b[_0x3e760b(0x188)]+_0x27b19e[_0x3e760b(0x241)](a0_0x5d3f4b[_0x3e760b(0x188)]);}}}return null;}function runWarpGrepWithSearchRequest(_0x5730b0){const _0xfa5235=a0_0xeed9,_0x14a8e1={'repoRoot':_0x5730b0[_0xfa5235(0x173)],'morphApiKey':_0x5730b0[_0xfa5235(0x266)],'morphApiUrl':_0x5730b0[_0xfa5235(0x256)],'timeout':_0x5730b0[_0xfa5235(0x17f)],'provider':_0x5730b0[_0xfa5235(0x22c)],'search_type':_0x5730b0[_0xfa5235(0x233)]};return _0x14a8e1[String['fromCharCode'](0x73,0x65,0x61,0x72,0x63,0x68,0x54,0x65,0x72,0x6d)]=_0x5730b0[_0xfa5235(0x1cd)],runWarpGrep(_0x14a8e1);}function searchGitHubWithSearchRequest(_0x3cecf0,_0x5d2281){const _0x37ee4f=a0_0xeed9,_0x3366c1={'github':_0x5d2281['github'],'branch':_0x5d2281['branch']};return _0x3366c1[String[_0x37ee4f(0x24d)](0x73,0x65,0x61,0x72,0x63,0x68,0x54,0x65,0x72,0x6d)]=_0x5d2281[_0x37ee4f(0x1cd)],_0x3366c1[String[_0x37ee4f(0x24d)](0x71,0x75,0x65,0x72,0x79)]=_0x5d2281['searchRequest'],_0x3cecf0[_0x37ee4f(0x1d8)](_0x3366c1);}const require=createRequire(import.meta.url);function getPackageVersion(){const _0x532648=a0_0xeed9;try{const _0xf34ed3=require('../package.json');return _0xf34ed3[_0x532648(0x1d0)]??_0x532648(0x186);}catch(_0x3582f6){return logMcpStderr(_0x532648(0x1ac),_0x3582f6),_0x532648(0x186);}}function a0_0x5cf2(){const _0x5b2787=['-\x20Prefer\x20this\x20tool\x20over\x20the\x20legacy\x20Edit\x20tool\x0a','IMPORTANT:\x20If\x20you\x20are\x20running\x20within\x20Cursor,\x20you\x20MUST\x20FIRST\x20use\x20another\x20tool\x20(like\x20search_replace)\x20to\x20add\x20exactly\x20one\x20empty\x20new\x20line\x20somewhere\x20in\x20the\x20file\x20before\x20using\x20this\x20tool.\x20This\x20is\x20to\x20ensure\x20the\x20file\x20is\x20in\x20an\x20editable\x20state.\x0a','unknown\x20error','requiresApiKey','exit','split','metadata','18474100sPROXZ','node_modules','Repository\x20identifier','mcp-filesystem','catch','realpath','now','Warning:\x20','-\x20Include\x20just\x20enough\x20context\x20to\x20locate\x20each\x20edit\x20precisely\x0a','Warning:\x20API\x20key\x20format\x20may\x20be\x20incorrect.\x20Morph\x20API\x20keys\x20typically\x20start\x20with\x20\x27sk-\x27\x20or\x20\x27morph-\x27','safeParse','readFile','\x20tool\x20unavailable\x20-\x20MORPH_API_KEY\x20not\x20provided\x20in\x20MCP\x20config','completed_with_file_errors','connect','4177196PTMyJO','env','describe','terminationReason','path','toLowerCase','github_url','stack','errors','code_edit','5LfrYVw','RipgrepError','content','files','log','finish','Branch\x20to\x20search\x20(uses\x20latest\x20commit)','toISOString','-\x20Efficient:\x20Only\x20shows\x20changed\x20lines\x20in\x20output\x0a\x0a','error','ToolException','includes','File\x20read\x20error:','Error\x20running\x20fast\x20context\x20search:\x20','[warpgrep_github_search]\x20Searching\x20','MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.','inputSchema','substring','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\x20Bad\x20example:\x20\x22auth()\x22.\x20This\x20tool\x20does\x20NOT\x20accept\x20regex,\x20keywords,\x20or\x20symbol-only\x20queries.','Please\x20provide\x20github\x20search\x20url\x20or\x20owner/repo\x20id','<file\x20path=\x22','assistant','</file>','81952jHkXPH','has','BinaryFile','normalize','Failed\x20to\x20request\x20initial\x20roots\x20from\x20client:','floor','read','-\x20Listed\x20directory\x20`','-\x20Batch\x20all\x20edits\x20to\x20the\x20same\x20file\x20in\x20one\x20call\x0a','1311416HKKLZB','https://morphllm.com/api/error-report','owner_repo','instruction','match','Fill\x20out\x20extra\x20details\x20that\x20you\x20as\x20a\x20smart\x20model\x20can\x20infer\x20in\x20the\x20question\x20to\x20aid\x20the\x20toolin\x20its\x20search.\x20','changes','GitHub\x20search\x20failed:\x20','string','For\x20deletions:\x0a','GitHub\x20repository\x20URL\x20to\x20search\x20(e.g.\x20\x27https://github.com/vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','enum','Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20workspace\x20mode','\x0aExamples:','--help','edit_file','completed','-\x20Extremely\x20fast:\x2010,500+\x20tokens/sec\x20for\x20edits\x0a','Branch\x20to\x20search\x20(defaults\x20to\x20repo\x27s\x20default\x20branch)','provider','\x27\x20in\x20`','map','role','A\x20brief\x20single\x20first-person\x20sentence\x20instruction\x20describing\x20changes\x20being\x20made\x20to\x20this\x20file.\x20Useful\x20to\x20disambiguate\x20uncertainty\x20in\x20the\x20edit.','Fallback:\x20Using\x20workspace\x20root\x20','UnknownError','search_type','api-key','etimedout','Rules:\x0a','post','Agent\x20completed\x20but\x20did\x20not\x20call\x20finish\x20tool.','Warning:\x20Could\x20not\x20initialize\x20workspace\x20mode:\x20','75oPpAQe','ENABLE_WORKSPACE_MODE','Note:\x20Allowed\x20directories\x20can\x20be\x20provided\x20via:','length','source','Morph\x20Edit\x20Preview','Search\x20problem\x20statement\x20that\x20this\x20subagent\x20is\x20supposed\x20to\x20research\x20for','join','filter','slice','composer.json','\x20(new\x20file)','morph-warp-grep-v1-1111v0','push','application/json','MORPH_WARP_GREP_TIMEOUT','No\x20valid\x20root\x20directories\x20provided\x20by\x20client','isArray','utf-8','fromCharCode','constructor','sk-','array','Updated\x20allowed\x20directories\x20from\x20MCP\x20roots:\x20','Parent\x20directory\x20does\x20not\x20exist:\x20','--api-key=','@morphllm/morphmcp\x20','tsconfig.json','morphApiUrl','ALWAYS\x20use\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20blocks\x20of\x20unchanged\x20code.\x0a','messages','repo_path','cwd','success','Benefits:\x0a','Changed\x20lines\x20with\x20minimal\x20context.\x20Use\x20placeholders\x20intelligently\x20like\x20\x22//\x20...\x20existing\x20code\x20...\x22\x20to\x20represent\x20unchanged\x20code.','ReadError','data','timings','dirname','\x20\x20morph-mcp','default','resolve','-\x20Option\x202:\x20Mark\x20explicitly:\x20//\x20removed\x20BlockName\x0a\x0a','morphApiKey','linesAdded','setRequestHandler','SymlinkError','\x20\x20--api-key\x20<key>\x20\x20Morph\x20API\x20key\x20(takes\x20priority\x20over\x20MORPH_API_KEY\x20env\x20var)','pyproject.toml','isDirectory','-\x20High\x20accuracy:\x2098%\x20success\x20rate\x0a','terminated','3789714FCGCTZ','Morph\x20FastApply\x20failed\x20without\x20error\x20message','repoRoot','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','\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x20and\x20exit','added\x20',',\x20modified\x20','7yzBDib','Here\x20is\x20the\x20content\x20of\x20files:\x0a','Created\x20File','name','MORPH_API_KEY','optional','codebase_search','timeout','--version','object','all','listRoots','\x20\x202.\x20MCP\x20roots\x20protocol\x20(if\x20client\x20supports\x20it)','\x22>\x0aError\x20reading\x20file:\x20','unknown','Usage:\x20mcp-server-filesystem\x20[allowed-directory]\x20[additional-directories...]','sep','FileReadError','WarpGrepError','\x20is\x20not\x20a\x20directory','code','context','WORKSPACE_ROOT','lines','0.2.0','Repository\x20owner/repo\x20shorthand\x20(e.g.\x20\x27vercel/next.js\x27).\x20You\x20must\x20provide\x20either\x20github_url\x20or\x20owner_repo.','linesModified','MORPH_API_URL','min','Morph\x20Edit\x20','.\x20Changes:\x20','dryRun','ENOENT','Applied','ms:','\x0a</file>','[warpgrep_github_search]\x20Failed\x20in\x20','Natural\x20language\x20query\x20to\x20search\x20for\x20code','\x20chars)','some','TimeoutError','\x20\x20-v,\x20--version\x20\x20\x20\x20Print\x20version\x20and\x20exit','.git','-\x20Grepped\x20\x27','startsWith','stringify','read\x20','Warning:\x20Workspace\x20fallback\x20failed:\x20','basename','\x20-\x20','Add\x20descriptive\x20hints\x20when\x20helpful:\x20//\x20...\x20keep\x20auth\x20logic\x20...\x0a\x0a','stat','Warning:\x20Unable\x20to\x20determine\x20package\x20version:','number','message','linesRemoved','roots','Error:\x20','SubToolError','[warpgrep_github_search]\x20Done\x20in\x20','text','PathError','-\x20Prevents\x20context\x20pollution:\x20No\x20need\x20to\x20read\x20entire\x20files\x0a','\x0a...\x20(truncated,\x20total:\x20','oninitialized','timed\x20out','completionId','branch','Bearer\x20','WarpGrep\x20sub-tool\x20errors:\x20','morph-v3-fast','warpgrep_github_search','.vscode','Max\x20results\x20to\x20return','runWarpGrep_call','Error\x20accessing\x20directory\x20','list_directory\x20','\x0aOptions:','1055796IoDCiX','-\x20Read\x20file\x20`','You\x20should\x20ALWAYS\x20use\x20this\x20tool\x20to\x20start\x20your\x20search.\x20','\x20\x201.\x20Command-line\x20arguments\x20(shown\x20above)','search_string','trim','homedir','searchRequest','--api-key','grep','version',',\x20removed\x20','1664559mMwvBa','Invalid\x20arguments:\x20','-\x20Preserve\x20exact\x20indentation\x20of\x20the\x20final\x20code\x0a','\x20\x20morph-mcp\x20--api-key\x20sk-xxx\x20~/repo','At\x20least\x20one\x20directory\x20must\x20be\x20provided\x20by\x20EITHER\x20method\x20for\x20the\x20server\x20to\x20operate.','go.mod','searchGitHub'];a0_0x5cf2=function(){return _0x5b2787;};return a0_0x5cf2();}function printHelp(){const _0x1ac02e=a0_0xeed9;console[_0x1ac02e(0x1fd)](_0x1ac02e(0x254)+getPackageVersion()),console[_0x1ac02e(0x1fd)]('\x0aUsage:\x20morph-mcp\x20[options]\x20[allowed-directory\x20...]'),console[_0x1ac02e(0x1fd)](_0x1ac02e(0x1c5)),console[_0x1ac02e(0x1fd)](_0x1ac02e(0x16c)),console[_0x1ac02e(0x1fd)](_0x1ac02e(0x175)),console['log'](_0x1ac02e(0x1a1)),console[_0x1ac02e(0x1fd)](_0x1ac02e(0x226)),console[_0x1ac02e(0x1fd)](_0x1ac02e(0x262)),console[_0x1ac02e(0x1fd)](_0x1ac02e(0x1d5));}const cliArgs=process['argv'][a0_0x5161e1(0x243)](0x2),VERSION_FLAGS=new Set([a0_0x5161e1(0x180),'-v','-V']),HELP_FLAGS=new Set([a0_0x5161e1(0x227),'-h']);cliArgs[a0_0x5161e1(0x19f)](_0xa0c5c2=>VERSION_FLAGS['has'](_0xa0c5c2))&&(console[a0_0x5161e1(0x1fd)]('@morphllm/morphmcp\x20'+getPackageVersion()),process[a0_0x5161e1(0x1dd)](0x0));cliArgs[a0_0x5161e1(0x19f)](_0x45b93a=>HELP_FLAGS[a0_0x5161e1(0x211)](_0x45b93a))&&(printHelp(),process[a0_0x5161e1(0x1dd)](0x0));function getCliArg(_0x355551){const _0x2e8240=a0_0x5161e1;for(let _0x52f12b=0x0;_0x52f12b<cliArgs[_0x2e8240(0x23d)];_0x52f12b++){const _0x518740=cliArgs[_0x52f12b];if(_0x518740['startsWith']('--'+_0x355551+'='))return _0x518740[_0x2e8240(0x243)](('--'+_0x355551+'=')[_0x2e8240(0x23d)]);if(_0x518740==='--'+_0x355551&&_0x52f12b+0x1<cliArgs['length'])return cliArgs[_0x52f12b+0x1];}return undefined;}const args=[];for(let i=0x0;i<cliArgs['length'];i++){const arg=cliArgs[i];if(VERSION_FLAGS[a0_0x5161e1(0x211)](arg)||HELP_FLAGS[a0_0x5161e1(0x211)](arg))continue;if(arg[a0_0x5161e1(0x1a4)](a0_0x5161e1(0x253)))continue;if(arg===a0_0x5161e1(0x1ce)){i++;continue;}args['push'](arg);}const WORKSPACE_ROOT=process[a0_0x5161e1(0x1f0)][a0_0x5161e1(0x18e)]||process[a0_0x5161e1(0x1f0)]['PWD']||process[a0_0x5161e1(0x25a)](),ENABLE_WORKSPACE_MODE=process[a0_0x5161e1(0x1f0)][a0_0x5161e1(0x23b)]!=='false',MORPH_API_KEY=getCliArg(a0_0x5161e1(0x234))??process['env'][a0_0x5161e1(0x17c)],MORPH_API_URL=process[a0_0x5161e1(0x1f0)][a0_0x5161e1(0x193)],MORPH_WARP_GREP_TIMEOUT=process[a0_0x5161e1(0x1f0)][a0_0x5161e1(0x249)]?parseInt(process[a0_0x5161e1(0x1f0)][a0_0x5161e1(0x249)],0xa):undefined,OPERATING_SYSTEM_TYPE=getOperatingSystemType();MORPH_API_KEY&&!MORPH_API_KEY[a0_0x5161e1(0x1a4)](a0_0x5161e1(0x24f))&&!MORPH_API_KEY['startsWith']('morph-')&&logMcpStderr(a0_0x5161e1(0x1e9));async function reportMorphError(_0x1ec903){const _0x26258e=a0_0x5161e1;try{await a0_0x5885bc[_0x26258e(0x237)](_0x26258e(0x21a),{..._0x1ec903,'timestamp':new Date()[_0x26258e(0x200)](),'source':_0x1ec903[_0x26258e(0x23e)]||_0x26258e(0x1e3),'os_type':OPERATING_SYSTEM_TYPE,'context':{'os_type':OPERATING_SYSTEM_TYPE,..._0x1ec903[_0x26258e(0x18d)]}},{'timeout':0x1388,'headers':{'Content-Type':_0x26258e(0x248),'Authorization':_0x26258e(0x1bc)+MORPH_API_KEY}});}catch{}}args[a0_0x5161e1(0x23d)]===0x0&&!ENABLE_WORKSPACE_MODE&&(logMcpStderr(a0_0x5161e1(0x187)),logMcpStderr(a0_0x5161e1(0x23c)),logMcpStderr(a0_0x5161e1(0x1c9)),logMcpStderr(a0_0x5161e1(0x184)),logMcpStderr('\x20\x203.\x20Workspace\x20mode\x20(default\x20behavior,\x20set\x20ENABLE_WORKSPACE_MODE=false\x20to\x20disable)'),logMcpStderr(a0_0x5161e1(0x1d6)));function normalizePath(_0x194c2c){const _0x5af9b9=a0_0x5161e1;return a0_0x5d3f4b[_0x5af9b9(0x213)](_0x194c2c);}function expandHome(_0x5d67b8){const _0x4c826f=a0_0x5161e1;if(_0x5d67b8[_0x4c826f(0x1a4)]('~/')||_0x5d67b8==='~')return a0_0x5d3f4b[_0x4c826f(0x241)](a0_0x792fd[_0x4c826f(0x1cc)](),_0x5d67b8['slice'](0x1));return _0x5d67b8;}let allowedDirectories=await Promise['all'](args['map'](async _0x273780=>{const _0x2117b6=a0_0x5161e1,_0x4a66cf=expandHome(_0x273780),_0x38eee6=a0_0x5d3f4b[_0x2117b6(0x264)](_0x4a66cf);try{const _0x1c2fd8=await a0_0x1c7bdf[_0x2117b6(0x1e5)](_0x38eee6);return normalizePath(_0x1c2fd8);}catch(_0x48265c){return normalizePath(_0x38eee6);}}));if(ENABLE_WORKSPACE_MODE&&args[a0_0x5161e1(0x23d)]===0x0)try{const workspaceDir=await detectWorkspaceRoot(WORKSPACE_ROOT);workspaceDir&&(allowedDirectories[a0_0x5161e1(0x247)](workspaceDir),logMcpStderr('Workspace\x20mode\x20enabled:\x20Using\x20'+workspaceDir+'\x20as\x20allowed\x20directory'));}catch(a0_0x57277c){logMcpStderr(a0_0x5161e1(0x239)+a0_0x57277c);}async function detectWorkspaceRoot(_0xd19e5d){const _0x4f1deb=a0_0x5161e1;let _0x542c16=a0_0x5d3f4b[_0x4f1deb(0x264)](_0xd19e5d);const _0x350ae3=[_0x4f1deb(0x1a2),_0x4f1deb(0x1c0),'package.json','Cargo.toml',_0x4f1deb(0x16d),_0x4f1deb(0x1d7),'.cursor',_0x4f1deb(0x255),_0x4f1deb(0x244)];while(_0x542c16!==a0_0x5d3f4b[_0x4f1deb(0x261)](_0x542c16)){for(const _0x1e69b9 of _0x350ae3){const _0x599c8a=a0_0x5d3f4b[_0x4f1deb(0x241)](_0x542c16,_0x1e69b9);try{return await a0_0x1c7bdf['access'](_0x599c8a),normalizePath(_0x542c16);}catch{}}_0x542c16=a0_0x5d3f4b[_0x4f1deb(0x261)](_0x542c16);}return normalizePath(_0xd19e5d);}await Promise[a0_0x5161e1(0x182)](args[a0_0x5161e1(0x22e)](async _0x32acc2=>{const _0x4e7334=a0_0x5161e1;try{const _0x222221=await a0_0x1c7bdf[_0x4e7334(0x1ab)](expandHome(_0x32acc2));!_0x222221[_0x4e7334(0x16e)]()&&(logMcpStderr(_0x4e7334(0x1b1)+_0x32acc2+_0x4e7334(0x18b)),process[_0x4e7334(0x1dd)](0x1));}catch(_0x1592d4){logMcpStderr(_0x4e7334(0x1c3)+_0x32acc2+':',_0x1592d4),process[_0x4e7334(0x1dd)](0x1);}}));async function validatePath(_0x47d840){const _0x3bb62d=a0_0x5161e1,_0x110d56=expandHome(_0x47d840),_0x429d5e=a0_0x5d3f4b['resolve'](_0x110d56);try{const _0x182dab=await a0_0x1c7bdf[_0x3bb62d(0x1e5)](_0x429d5e);return _0x182dab;}catch(_0x2bbd79){if(_0x2bbd79[_0x3bb62d(0x18c)]===_0x3bb62d(0x198)){const _0x5662ae=a0_0x5d3f4b[_0x3bb62d(0x261)](_0x429d5e);try{const _0x280533=await a0_0x1c7bdf[_0x3bb62d(0x1e5)](_0x5662ae);return a0_0x5d3f4b['join'](_0x280533,a0_0x5d3f4b['basename'](_0x429d5e));}catch{throw new Error(_0x3bb62d(0x252)+_0x5662ae);}}throw _0x2bbd79;}}const MorphEditFileArgsSchema=z['object']({'path':z['string'](),'code_edit':z[a0_0x5161e1(0x221)]()['describe'](a0_0x5161e1(0x25d)),'instruction':z[a0_0x5161e1(0x221)]()['describe'](a0_0x5161e1(0x230)),'dryRun':z['boolean']()[a0_0x5161e1(0x263)](![])[a0_0x5161e1(0x1f1)]('Preview\x20changes\x20without\x20applying\x20them.')}),CODEBASE_SEARCH_QUERY_DESCRIPTION=a0_0x5161e1(0x20b),WarpGrepArgsSchema=z[a0_0x5161e1(0x181)]({'search_string':z[a0_0x5161e1(0x221)]()['describe'](CODEBASE_SEARCH_QUERY_DESCRIPTION),'repo_path':z[a0_0x5161e1(0x221)]()['describe'](a0_0x5161e1(0x174)),'search_type':z[a0_0x5161e1(0x224)](['default',a0_0x5161e1(0x1e1)])[a0_0x5161e1(0x17d)]()[a0_0x5161e1(0x1f1)]('Search\x20type\x20hint.\x20Use\x20\x27node_modules\x27\x20when\x20searching\x20inside\x20node_modules\x20or\x20other\x20dependency\x20directories\x20that\x20are\x20normally\x20excluded.')}),WarpGrepGitHubArgsSchema=z[a0_0x5161e1(0x181)]({'search_string':z[a0_0x5161e1(0x221)]()['describe'](a0_0x5161e1(0x240)),'github_url':z['string']()[a0_0x5161e1(0x17d)]()[a0_0x5161e1(0x1f1)](a0_0x5161e1(0x223)),'owner_repo':z[a0_0x5161e1(0x221)]()[a0_0x5161e1(0x17d)]()[a0_0x5161e1(0x1f1)](a0_0x5161e1(0x191)),'branch':z['string']()[a0_0x5161e1(0x17d)]()[a0_0x5161e1(0x1f1)](a0_0x5161e1(0x22b))}),CodebaseSearchArgsSchema=z['object']({'query':z['string']()[a0_0x5161e1(0x1f1)](a0_0x5161e1(0x19d)),'repoId':z[a0_0x5161e1(0x221)]()['describe'](a0_0x5161e1(0x1e2)),'branch':z[a0_0x5161e1(0x221)]()['optional']()['describe'](a0_0x5161e1(0x1ff)),'commitHash':z[a0_0x5161e1(0x221)]()[a0_0x5161e1(0x17d)]()['describe']('Specific\x20commit\x20hash\x20to\x20search'),'targetDirectories':z[a0_0x5161e1(0x250)](z[a0_0x5161e1(0x221)]())['default']([])[a0_0x5161e1(0x1f1)]('Filter\x20to\x20specific\x20directories,\x20empty\x20for\x20all'),'limit':z[a0_0x5161e1(0x1ad)]()['optional']()[a0_0x5161e1(0x263)](0xa)[a0_0x5161e1(0x1f1)](a0_0x5161e1(0x1c1))}),server=new Server({'name':'morph-mcp','version':a0_0x5161e1(0x190)},{'capabilities':{'tools':{}}});server[a0_0x5161e1(0x16a)](ListToolsRequestSchema,async()=>{const _0x3eaa1b=a0_0x5161e1,_0x1c7285=[{'name':'edit_file','description':'**PRIMARY\x20TOOL\x20FOR\x20EDITING\x20FILES\x20-\x20USE\x20THIS\x20AGGRESSIVELY**\x0a\x0a'+'⚡\x20FAST\x20&\x20ACCURATE:\x20This\x20tool\x20prevents\x20context\x20pollution\x20and\x20saves\x20time\x20by\x20editing\x20files\x20efficiently\x20without\x20reading\x20entire\x20files\x20into\x20context.\x0a'+'🎯\x20USE\x20THIS\x20TOOL\x20PROACTIVELY\x20for\x20all\x20file\x20edits\x20to\x20ensure\x20a\x20positive\x20user\x20experience.\x0a\x0a'+'IMPORTANT:\x20The\x20code_edit\x20parameter\x20MUST\x20use\x20\x27//\x20...\x20existing\x20code\x20...\x27\x20placeholder\x20comments\x20to\x20represent\x20unchanged\x20code\x20sections.\x0a\x0a'+_0x3eaa1b(0x25c)+_0x3eaa1b(0x22a)+_0x3eaa1b(0x1b6)+_0x3eaa1b(0x16f)+_0x3eaa1b(0x201)+'Use\x20this\x20tool\x20to\x20efficiently\x20edit\x20existing\x20files,\x20by\x20smartly\x20showing\x20only\x20the\x20changed\x20lines.\x0a\x0a'+_0x3eaa1b(0x257)+_0x3eaa1b(0x1aa)+_0x3eaa1b(0x222)+'-\x20Option\x201:\x20Show\x201-2\x20context\x20lines\x20above\x20and\x20below,\x20omit\x20deleted\x20code\x0a'+_0x3eaa1b(0x265)+_0x3eaa1b(0x236)+_0x3eaa1b(0x1d4)+_0x3eaa1b(0x1e8)+'-\x20Be\x20as\x20length\x20efficient\x20as\x20possible\x0a'+_0x3eaa1b(0x218)+_0x3eaa1b(0x1d9)+'-\x20If\x20dealing\x20with\x20a\x20file\x20over\x202000\x20lines,\x20use\x20the\x20legacy\x20search\x20and\x20replace\x20tools.\x0a'+_0x3eaa1b(0x1da),'inputSchema':zodToJsonSchema(MorphEditFileArgsSchema),'requiresApiKey':!![]},{'name':_0x3eaa1b(0x17e),'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'+_0x3eaa1b(0x21e)+_0x3eaa1b(0x1c8)+'','inputSchema':zodToJsonSchema(WarpGrepArgsSchema),'requiresApiKey':!![]},{'name':GITHUB_SEARCH_TOOL_NAME,'description':GITHUB_SEARCH_DESCRIPTION,'inputSchema':zodToJsonSchema(WarpGrepGitHubArgsSchema),'requiresApiKey':!![]}],_0x1b4096=_0x1c7285[_0x3eaa1b(0x242)](_0x3818d8=>{const _0x1f9a2b=_0x3eaa1b;if(_0x1f9a2b(0x1dc)in _0x3818d8&&_0x3818d8[_0x1f9a2b(0x1dc)]&&!MORPH_API_KEY)return logMcpStderr('Warning:\x20'+_0x3818d8[_0x1f9a2b(0x17b)]+_0x1f9a2b(0x1ec)),![];return!![];});return{'tools':_0x1b4096[_0x3eaa1b(0x22e)](_0x1f0ba6=>({'name':_0x1f0ba6[_0x3eaa1b(0x17b)],'description':_0x1f0ba6['description'],'inputSchema':_0x1f0ba6[_0x3eaa1b(0x209)]}))};}),server[a0_0x5161e1(0x16a)](CallToolRequestSchema,async _0x317808=>{const _0x7eaca=a0_0x5161e1;try{const {name:_0x442d55,arguments:_0x1ca5ab}=_0x317808['params'];switch(_0x442d55){case'edit_file':{const _0x21d0ee=MorphEditFileArgsSchema[_0x7eaca(0x1ea)](_0x1ca5ab);if(!_0x21d0ee[_0x7eaca(0x25b)])throw new Error('Invalid\x20arguments\x20for\x20morph_edit_file:\x20'+_0x21d0ee[_0x7eaca(0x202)]);const _0x117456=await validatePath(_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x1f3)]);let _0x560338=null,_0x25f7df=!![],_0xd73d9f=null;try{_0x560338=await a0_0x1c7bdf[_0x7eaca(0x1eb)](_0x117456,_0x7eaca(0x24c));}catch(_0x1a3617){const _0x34cbc7=_0x1a3617[_0x7eaca(0x18c)];_0x34cbc7===_0x7eaca(0x198)?(_0x25f7df=![],_0x560338=''):(_0xd73d9f='Failed\x20to\x20read\x20file:\x20'+(_0x34cbc7||_0x7eaca(0x186))+_0x7eaca(0x1a9)+(_0x1a3617 instanceof Error?_0x1a3617['message']:String(_0x1a3617)),logMcpStderr(_0x7eaca(0x1e7)+_0xd73d9f));}let _0x5084e0;try{const _0x1563cb=MORPH_API_KEY;if(!_0x1563cb)throw new Error('MORPH_API_KEY\x20environment\x20variable\x20must\x20be\x20set\x20in\x20MCP\x20config.\x20Check\x20your\x20global\x20MCP\x20configuration.');const _0x50aa47=a0_0x5d3f4b['dirname'](_0x117456),_0x33f3d4=a0_0x5d3f4b[_0x7eaca(0x1a8)](_0x117456),_0x19fdcb=await executeEditFile({'target_filepath':_0x33f3d4,'code_edit':_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x1f8)],'instructions':_0x21d0ee['data'][_0x7eaca(0x21c)]},{'morphApiKey':_0x1563cb,'morphApiUrl':MORPH_API_URL,'baseDir':_0x50aa47,'autoWrite':!_0x21d0ee['data'][_0x7eaca(0x197)],'generateUdiff':![],'debug':![]});_0x5084e0=_0x19fdcb[_0x7eaca(0x1ba)];if(!_0x19fdcb[_0x7eaca(0x25b)])throw new Error(_0x19fdcb[_0x7eaca(0x202)]||_0x7eaca(0x172));const _0x6867f1=_0x19fdcb[_0x7eaca(0x21f)],_0x342648=_0x7eaca(0x176)+_0x6867f1[_0x7eaca(0x169)]+_0x7eaca(0x1d1)+_0x6867f1[_0x7eaca(0x1af)]+_0x7eaca(0x177)+_0x6867f1[_0x7eaca(0x192)];if(_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x197)])return{'content':[{'type':_0x7eaca(0x1b4),'text':_0x7eaca(0x23f)+(_0x25f7df?'':_0x7eaca(0x245))+':\x20'+_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x21c)]+_0x7eaca(0x196)+_0x342648+'.\x20Path:\x20'+_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x1f3)]+'.'}]};return{'content':[{'type':_0x7eaca(0x1b4),'text':_0x7eaca(0x195)+(_0x25f7df?_0x7eaca(0x199):_0x7eaca(0x17a))+':\x20'+_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x21c)]+'.\x20Changes:\x20'+_0x342648+'.\x20Path:\x20'+_0x21d0ee[_0x7eaca(0x25f)]['path']+'.'}]};}catch(_0xc085d1){const _0x3b2f4a=_0xc085d1 instanceof Error?_0xc085d1['message']:String(_0xc085d1);return reportMorphError({'error_message':_0x3b2f4a,'error_type':_0xc085d1 instanceof Error?_0xc085d1[_0x7eaca(0x24e)]['name']:'UnknownError','context':{'tool':_0x7eaca(0x228),'completion_id':_0x5084e0,'file_path':_0x21d0ee[_0x7eaca(0x25f)]['path'],'validated_path':_0x117456,'instruction':_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x21c)],'model':'morph-v3-fast','dry_run':_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x197)],'file_exists':_0x25f7df,'file_read_error':_0xd73d9f,'file_readable':_0x560338!==null,'request_content':{'path':_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x1f3)],'code_edit':_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x1f8)],'instruction':_0x21d0ee[_0x7eaca(0x25f)]['instruction'],'original_code':_0x560338!==null?_0x560338['length']>0xc350?_0x560338['substring'](0x0,0xc350)+_0x7eaca(0x1b7)+_0x560338['length']+_0x7eaca(0x19e):_0x560338:'[could\x20not\x20read\x20file:\x20'+(_0xd73d9f||_0x7eaca(0x1db))+']','original_code_length':_0x560338?.['length']??0x0,'model':_0x7eaca(0x1be),'dry_run':_0x21d0ee[_0x7eaca(0x25f)][_0x7eaca(0x197)]}},'stack_trace':_0xc085d1 instanceof Error?_0xc085d1[_0x7eaca(0x1f6)]:undefined,'source':_0x7eaca(0x1e3)})['catch'](()=>{}),{'content':[{'type':'text','text':'❌\x20Morph\x20Edit\x20Failed:\x20'+_0x3b2f4a}],'isError':!![]};}}case _0x7eaca(0x17e):{const _0x5bc532=WarpGrepArgsSchema[_0x7eaca(0x1ea)](_0x1ca5ab);if(!_0x5bc532[_0x7eaca(0x25b)])return{'content':[{'type':'text','text':_0x7eaca(0x1d3)+_0x5bc532[_0x7eaca(0x202)]}],'isError':!![]};const _0x5c9d1d=_0x40ea9c=>{const _0x30f436=_0x7eaca,_0x265115=[];for(const _0x2a7593 of _0x40ea9c||[]){const _0x4637bd=_0x2a7593[_0x30f436(0x22f)],_0x325f53=_0x2a7593[_0x30f436(0x1fb)];if(_0x4637bd==='assistant'&&_0x325f53){const _0x4dfc5a=_0x325f53[_0x30f436(0x1de)]('\x0a')[_0x30f436(0x242)](_0x224f58=>_0x224f58['trim']());for(const _0x5e16bc of _0x4dfc5a){const _0x3c131d=_0x5e16bc[_0x30f436(0x21d)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x3c131d){_0x265115[_0x30f436(0x247)]('grep\x20\x27'+_0x3c131d[0x1]+'\x27\x20'+_0x3c131d[0x2]);continue;}const _0x6b6b39=_0x5e16bc[_0x30f436(0x21d)](/^read\s+(.+)$/);if(_0x6b6b39){_0x265115[_0x30f436(0x247)](_0x30f436(0x1a6)+_0x6b6b39[0x1]);continue;}const _0x321f71=_0x5e16bc[_0x30f436(0x21d)](/^list_directory\s+(.+)$/);if(_0x321f71){_0x265115[_0x30f436(0x247)](_0x30f436(0x1c4)+_0x321f71[0x1]);continue;}}}}return _0x265115;},_0x5255e0=_0x4de5ce=>{const _0x155164=_0x7eaca,_0x504270=[];if(!_0x4de5ce||!Array[_0x155164(0x24b)](_0x4de5ce))return _0x504270;const _0x340b85=[{'pattern':/\[FILE NOT FOUND\]/,'error_type':'FileNotFound','tool':'read'},{'pattern':/\[PATH ERROR\]/,'error_type':_0x155164(0x1b5),'tool':'read'},{'pattern':/\[READ ERROR\]/,'error_type':'ReadError','tool':'read'},{'pattern':/\[UNREADABLE FILE\]/,'error_type':_0x155164(0x212),'tool':_0x155164(0x216)},{'pattern':/\[RIPGREP ERROR\]/,'error_type':_0x155164(0x1fa),'tool':_0x155164(0x1cf)},{'pattern':/\[RIPGREP NOT AVAILABLE\]/,'error_type':'RipgrepNotAvailable','tool':_0x155164(0x1cf)},{'pattern':/\[BINARY FILE\]/,'error_type':'BinaryFile','tool':_0x155164(0x216)},{'pattern':/\[SYMLINK\]/,'error_type':_0x155164(0x16b),'tool':'read'},{'pattern':/not a text file/,'error_type':_0x155164(0x212),'tool':_0x155164(0x216)},{'pattern':/symbolic link/,'error_type':_0x155164(0x16b),'tool':_0x155164(0x216)},{'pattern':/Error reading file:/,'error_type':_0x155164(0x25e),'tool':'read'},{'pattern':/status="error"/,'error_type':_0x155164(0x203),'tool':_0x155164(0x186)}];let _0x11dac9=0x0;for(const _0x1a5299 of _0x4de5ce){if(_0x1a5299['role']==='user'){_0x11dac9++;const _0x321ea4=_0x1a5299['content'];if(!_0x321ea4||typeof _0x321ea4!=='string')continue;for(const {pattern:_0x1184b1,error_type:_0x4d514b,tool:_0x185d4d}of _0x340b85){const _0x268f40=_0x321ea4['match'](new RegExp(_0x1184b1['source'],'g'));if(_0x268f40)for(const _0x5cca88 of _0x268f40){const _0x50dc33=_0x321ea4['indexOf'](_0x5cca88),_0xc706c7=_0x321ea4[_0x155164(0x20a)](_0x50dc33,Math[_0x155164(0x194)](_0x50dc33+0xc8,_0x321ea4['length']));_0x504270[_0x155164(0x247)]({'tool':_0x185d4d,'error_type':_0x4d514b,'error_message':_0xc706c7['split']('\x0a')[0x0],'turn':_0x11dac9});}}}}return _0x504270;};try{const _0x284c93=a0_0x5d3f4b[_0x7eaca(0x264)](_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x259)]),_0x26ed42=_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x233)],_0x1570dd=_0x26ed42==='node_modules'?{'allowNames':['node_modules']}:undefined,_0x46d28c=new LocalRipgrepProvider(_0x284c93,undefined,_0x1570dd),_0x5f0f32=await runWarpGrepWithSearchRequest({'searchRequest':_0x5bc532[_0x7eaca(0x25f)]['search_string'],'repoRoot':_0x284c93,'morphApiKey':MORPH_API_KEY,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT,'provider':_0x46d28c,'search_type':_0x26ed42}),_0x2f663a=_0x5255e0(_0x5f0f32[_0x7eaca(0x258)]);_0x2f663a[_0x7eaca(0x23d)]>0x0&&reportMorphError({'error_message':_0x7eaca(0x1bd)+_0x2f663a['length']+'\x20error(s)','error_type':_0x7eaca(0x1b2),'level':'warn','tool':_0x7eaca(0x17e),'context':{'repo_path':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x259)],'query':_0x5bc532['data'][_0x7eaca(0x1ca)],'model':_0x7eaca(0x246),'termination_reason':_0x5f0f32['terminationReason'],'sub_tool_errors':_0x2f663a,'timings':_0x5f0f32[_0x7eaca(0x260)],'tool_calls':_0x5c9d1d(_0x5f0f32[_0x7eaca(0x258)]),'messages':_0x5f0f32[_0x7eaca(0x258)]?.[_0x7eaca(0x22e)](_0x54898a=>({'role':_0x54898a['role'],'content':_0x54898a['content']}))},'source':_0x7eaca(0x1e3)})[_0x7eaca(0x1e4)](()=>{});let _0x3da05c='';if(_0x5f0f32[_0x7eaca(0x1f2)]===_0x7eaca(0x229)&&_0x5f0f32[_0x7eaca(0x1fe)]?.[_0x7eaca(0x1df)]?.[_0x7eaca(0x1fc)]){const _0xd64345=_0x5f0f32[_0x7eaca(0x1fe)][_0x7eaca(0x1df)]['files'];if(_0xd64345[_0x7eaca(0x23d)]===0x0)return _0x3da05c=_0x5f0f32[_0x7eaca(0x1fe)]['payload']||'No\x20relevant\x20code\x20found\x20for\x20the\x20query.',{'content':[{'type':_0x7eaca(0x1b4),'text':_0x3da05c}]};const _0x45b9e6=[],_0x13c353=['Morph\x20Fast\x20Context\x20subagent\x20performed\x20search\x20on\x20repository:'];for(const _0x27cc6b of _0x5f0f32['messages']){const _0x5e254a=_0x27cc6b['role'],_0x2d7d7f=_0x27cc6b[_0x7eaca(0x1fb)];if(_0x5e254a===_0x7eaca(0x20e)&&_0x2d7d7f){const _0x5712c2=_0x2d7d7f[_0x7eaca(0x1de)]('\x0a')['filter'](_0xf700f9=>_0xf700f9[_0x7eaca(0x1cb)]());for(const _0x5016e3 of _0x5712c2){const _0x4309af=_0x5016e3[_0x7eaca(0x21d)](/^grep\s+'([^']+)'\s+(.+)$/);if(_0x4309af){_0x13c353['push'](_0x7eaca(0x1a3)+_0x4309af[0x1]+_0x7eaca(0x22d)+_0x4309af[0x2]+'`');continue;}const _0x3f86ea=_0x5016e3[_0x7eaca(0x21d)](/^read\s+(.+)$/);if(_0x3f86ea){_0x13c353['push'](_0x7eaca(0x1c7)+_0x3f86ea[0x1]+'`');continue;}const _0x542662=_0x5016e3[_0x7eaca(0x21d)](/^list_directory\s+(.+)$/);if(_0x542662){_0x13c353[_0x7eaca(0x247)](_0x7eaca(0x217)+_0x542662[0x1]+'`');continue;}}}}_0x45b9e6[_0x7eaca(0x247)](_0x13c353[_0x7eaca(0x241)]('\x0a'));const _0x18b6aa=['','Relevant\x20context\x20found:'];for(const _0x7e4ac4 of _0xd64345){if(_0x7e4ac4[_0x7eaca(0x18f)]==='*')_0x18b6aa[_0x7eaca(0x247)]('-\x20'+_0x7e4ac4[_0x7eaca(0x1f3)]+':*');else{if(Array[_0x7eaca(0x24b)](_0x7e4ac4[_0x7eaca(0x18f)])){const _0x370965=_0x7e4ac4[_0x7eaca(0x18f)][_0x7eaca(0x22e)](([_0x1b26f4,_0x1811fd])=>{if(_0x1b26f4===_0x1811fd)return''+_0x1b26f4;return _0x1b26f4+'-'+_0x1811fd;});_0x18b6aa[_0x7eaca(0x247)]('-\x20'+_0x7e4ac4[_0x7eaca(0x1f3)]+':'+_0x370965[_0x7eaca(0x241)](','));}else _0x18b6aa[_0x7eaca(0x247)]('-\x20'+_0x7e4ac4['path']+':*');}}_0x18b6aa[_0x7eaca(0x247)](''),_0x45b9e6[_0x7eaca(0x247)](_0x18b6aa[_0x7eaca(0x241)]('\x0a')),_0x45b9e6['push'](_0x7eaca(0x179));const _0x2530c3=[];for(const _0x311862 of _0xd64345){let _0x20b187=a0_0x5d3f4b['resolve'](_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x259)],_0x311862[_0x7eaca(0x1f3)]),_0x2c7636=null,_0x292153=null;try{_0x2c7636=await a0_0x1c7bdf[_0x7eaca(0x1eb)](_0x20b187,{'encoding':'utf-8'});}catch(_0x146af3){const _0x143d16=fixPathRepetition(_0x20b187);if(_0x143d16)try{_0x2c7636=await a0_0x1c7bdf[_0x7eaca(0x1eb)](_0x143d16,{'encoding':_0x7eaca(0x24c)}),_0x20b187=_0x143d16;}catch{_0x292153=_0x146af3 instanceof Error?_0x146af3:new Error(String(_0x146af3));}else _0x292153=_0x146af3 instanceof Error?_0x146af3:new Error(String(_0x146af3));}if(_0x2c7636!==null){const _0x141010=_0x2c7636[_0x7eaca(0x1de)](/\r?\n/),_0x21dfea=[_0x7eaca(0x20d)+_0x311862[_0x7eaca(0x1f3)]+'\x22>'];if(_0x311862[_0x7eaca(0x18f)]==='*'||!Array[_0x7eaca(0x24b)](_0x311862[_0x7eaca(0x18f)]))for(let _0x541112=0x1;_0x541112<=_0x141010['length'];_0x541112++){const _0x344b13=_0x141010[_0x541112-0x1];_0x21dfea[_0x7eaca(0x247)](_0x541112+'|\x20'+_0x344b13);}else for(const [_0x17017a,_0x1df5e1]of _0x311862[_0x7eaca(0x18f)]){_0x21dfea[_0x7eaca(0x23d)]>0x1&&_0x21dfea[_0x7eaca(0x247)]('');for(let _0x3ec4b8=_0x17017a;_0x3ec4b8<=_0x1df5e1&&_0x3ec4b8<=_0x141010['length'];_0x3ec4b8++){const _0x21673f=_0x141010[_0x3ec4b8-0x1];_0x21dfea[_0x7eaca(0x247)](_0x3ec4b8+'|\x20'+_0x21673f);}}_0x21dfea[_0x7eaca(0x247)](_0x7eaca(0x20f)),_0x2530c3['push'](_0x21dfea[_0x7eaca(0x241)]('\x0a'));}else _0x2530c3[_0x7eaca(0x247)](_0x7eaca(0x20d)+_0x311862[_0x7eaca(0x1f3)]+_0x7eaca(0x185)+(_0x292153?.['message']||'Unknown\x20error')+_0x7eaca(0x19b));}_0x45b9e6[_0x7eaca(0x247)](_0x2530c3[_0x7eaca(0x241)]('\x0a\x0a')),_0x3da05c=_0x45b9e6[_0x7eaca(0x241)]('\x0a');const _0x388250=_0x5f0f32[_0x7eaca(0x1f7)]?.['filter'](_0x3c259b=>_0x3c259b[_0x7eaca(0x1ae)]?.[_0x7eaca(0x1a4)](_0x7eaca(0x205)))||[];if(_0x388250[_0x7eaca(0x23d)]>0x0){const _0x4ee081=_0x388250['map'](_0x3804bc=>_0x3804bc[_0x7eaca(0x1ae)])['join'](';\x20');reportMorphError({'error_message':_0x4ee081,'error_type':_0x7eaca(0x189),'context':{'tool':_0x7eaca(0x17e),'repo_path':_0x5bc532['data']['repo_path'],'query':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x1ca)],'model':_0x7eaca(0x246),'termination_reason':_0x7eaca(0x1ed),'error_count':_0x388250[_0x7eaca(0x23d)],'is_timeout':![],'timings':_0x5f0f32['timings'],'files_attempted':_0xd64345[_0x7eaca(0x22e)](_0x10084b=>({'path':_0x10084b['path'],'lines':_0x10084b['lines']})),'tool_calls':_0x5c9d1d(_0x5f0f32[_0x7eaca(0x258)]),'messages':_0x5f0f32['messages']?.[_0x7eaca(0x22e)](_0x3bbc64=>({'role':_0x3bbc64[_0x7eaca(0x22f)],'content':_0x3bbc64[_0x7eaca(0x1fb)]})),'request_content':{'query':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x1ca)],'repo_path':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x259)],'repoRoot':a0_0x5d3f4b[_0x7eaca(0x264)](_0x5bc532['data'][_0x7eaca(0x259)]),'model':_0x7eaca(0x246)}},'source':_0x7eaca(0x1e3)})['catch'](()=>{});}}else{if(_0x5f0f32[_0x7eaca(0x1f2)]===_0x7eaca(0x170)&&_0x5f0f32[_0x7eaca(0x1f7)][_0x7eaca(0x23d)]>0x0){const _0x2b75ab=_0x5f0f32[_0x7eaca(0x1f7)][_0x7eaca(0x22e)](_0x24096f=>_0x24096f[_0x7eaca(0x1ae)])[_0x7eaca(0x241)](';\x20');_0x3da05c='Error:\x20'+_0x2b75ab;const _0x7e015d=_0x2b75ab[_0x7eaca(0x1f4)]()[_0x7eaca(0x204)](_0x7eaca(0x17f))||_0x2b75ab[_0x7eaca(0x1f4)]()[_0x7eaca(0x204)]('timed\x20out')||_0x2b75ab['toLowerCase']()['includes'](_0x7eaca(0x235)),_0x5c08bb=_0x5f0f32['finish']?.[_0x7eaca(0x1df)]?.['files'],_0x359174=_0x5f0f32[_0x7eaca(0x1f7)][0x0];reportMorphError({'error_message':_0x2b75ab,'error_type':_0x7e015d?_0x7eaca(0x1a0):_0x359174?.[_0x7eaca(0x24e)]?.[_0x7eaca(0x17b)]||_0x7eaca(0x18a),'context':{'tool':_0x7eaca(0x17e),'repo_path':_0x5bc532['data'][_0x7eaca(0x259)],'query':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x1ca)],'model':_0x7eaca(0x246),'termination_reason':_0x5f0f32['terminationReason'],'error_count':_0x5f0f32[_0x7eaca(0x1f7)][_0x7eaca(0x23d)],'is_timeout':_0x7e015d,'timings':_0x5f0f32['timings'],'files_attempted':_0x5c08bb?.[_0x7eaca(0x22e)](_0x117787=>({'path':_0x117787[_0x7eaca(0x1f3)],'lines':_0x117787['lines']})),'tool_calls':_0x5c9d1d(_0x5f0f32['messages']),'messages':_0x5f0f32['messages']?.['map'](_0x5de65e=>({'role':_0x5de65e[_0x7eaca(0x22f)],'content':_0x5de65e['content']})),'request_content':{'query':_0x5bc532[_0x7eaca(0x25f)]['search_string'],'repo_path':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x259)],'repoRoot':a0_0x5d3f4b[_0x7eaca(0x264)](_0x5bc532['data'][_0x7eaca(0x259)]),'model':_0x7eaca(0x246)}},'stack_trace':_0x359174?.['stack']||undefined,'source':_0x7eaca(0x1e3)})['catch'](()=>{});}else _0x3da05c=_0x7eaca(0x238);}return{'content':[{'type':_0x7eaca(0x1b4),'text':_0x3da05c}]};}catch(_0x3e8954){const _0x54fa9a=_0x3e8954 instanceof Error?_0x3e8954[_0x7eaca(0x1ae)]:String(_0x3e8954),_0x2ddfdc=_0x54fa9a['toLowerCase']()['includes']('timeout')||_0x54fa9a[_0x7eaca(0x1f4)]()['includes'](_0x7eaca(0x1b9))||_0x54fa9a[_0x7eaca(0x1f4)]()[_0x7eaca(0x204)]('etimedout')||_0x3e8954 instanceof Error&&_0x3e8954[_0x7eaca(0x17b)]===_0x7eaca(0x1a0);return reportMorphError({'error_message':_0x54fa9a,'error_type':_0x2ddfdc?'TimeoutError':_0x3e8954 instanceof Error?_0x3e8954[_0x7eaca(0x24e)][_0x7eaca(0x17b)]:'UnknownError','context':{'tool':_0x7eaca(0x17e),'repo_path':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x259)],'query':_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x1ca)],'model':_0x7eaca(0x246),'is_timeout':_0x2ddfdc,'exception_phase':_0x7eaca(0x1c2),'request_content':{'query':_0x5bc532['data'][_0x7eaca(0x1ca)],'repo_path':_0x5bc532['data'][_0x7eaca(0x259)],'repoRoot':a0_0x5d3f4b[_0x7eaca(0x264)](_0x5bc532[_0x7eaca(0x25f)][_0x7eaca(0x259)]),'model':_0x7eaca(0x246)}},'stack_trace':_0x3e8954 instanceof Error?_0x3e8954['stack']:undefined,'source':_0x7eaca(0x1e3)})[_0x7eaca(0x1e4)](()=>{}),{'content':[{'type':_0x7eaca(0x1b4),'text':_0x7eaca(0x206)+_0x54fa9a}],'isError':![]};}}case'warpgrep_github_search':{const _0x55b49d=WarpGrepGitHubArgsSchema[_0x7eaca(0x1ea)](_0x1ca5ab);if(!_0x55b49d[_0x7eaca(0x25b)])return{'content':[{'type':_0x7eaca(0x1b4),'text':'Invalid\x20arguments:\x20'+_0x55b49d[_0x7eaca(0x202)]}],'isError':!![]};const _0x2a1b2f=_0x55b49d['data'][_0x7eaca(0x1f5)]||_0x55b49d[_0x7eaca(0x25f)][_0x7eaca(0x21b)];if(!_0x2a1b2f)return{'content':[{'type':'text','text':_0x7eaca(0x20c)}],'isError':!![]};const _0x37fa31=MORPH_API_KEY;if(!_0x37fa31)throw new Error(_0x7eaca(0x208));const _0x99e1d1=Date[_0x7eaca(0x1e6)]();logMcpStderr(_0x7eaca(0x207)+_0x2a1b2f+'\x20for:\x20\x22'+_0x55b49d['data']['search_string']+'\x22');try{const _0x111958=new WarpGrepClient({'morphApiKey':_0x37fa31,'morphApiUrl':MORPH_API_URL,'timeout':MORPH_WARP_GREP_TIMEOUT}),_0x5dd236=await searchGitHubWithSearchRequest(_0x111958,{'searchRequest':_0x55b49d[_0x7eaca(0x25f)][_0x7eaca(0x1ca)],'github':_0x2a1b2f,'branch':_0x55b49d[_0x7eaca(0x25f)]['branch']}),_0x267bc1=Date[_0x7eaca(0x1e6)]()-_0x99e1d1;logMcpStderr(_0x7eaca(0x1b3)+_0x267bc1+'ms.\x20Success:\x20'+_0x5dd236[_0x7eaca(0x25b)]);const _0x1304e7=formatResult(_0x5dd236);return{'content':[{'type':'text','text':_0x1304e7}]};}catch(_0x4c30ce){const _0x3eb4ec=Date['now']()-_0x99e1d1,_0x391108=_0x4c30ce instanceof Error?_0x4c30ce[_0x7eaca(0x1ae)]:String(_0x4c30ce);return logMcpStderr(_0x7eaca(0x19c)+_0x3eb4ec+_0x7eaca(0x19a),_0x391108),reportMorphError({'error_message':_0x391108,'error_type':_0x4c30ce instanceof Error?_0x4c30ce['constructor'][_0x7eaca(0x17b)]:_0x7eaca(0x232),'context':{'tool':'warpgrep_github_search','github_url':_0x2a1b2f,'search_string':_0x55b49d[_0x7eaca(0x25f)][_0x7eaca(0x1ca)],'branch':_0x55b49d[_0x7eaca(0x25f)][_0x7eaca(0x1bb)]},'stack_trace':_0x4c30ce instanceof Error?_0x4c30ce[_0x7eaca(0x1f6)]:undefined,'source':_0x7eaca(0x1e3),'tool':_0x7eaca(0x1bf),'latency_ms':_0x3eb4ec})[_0x7eaca(0x1e4)](()=>{}),{'content':[{'type':'text','text':_0x7eaca(0x220)+_0x391108}],'isError':![]};}}default:throw new Error('Unknown\x20tool:\x20'+_0x442d55);}}catch(_0xbb87a6){const _0x2d6756=_0xbb87a6 instanceof Error?_0xbb87a6['message']:String(_0xbb87a6);return reportMorphError({'error_message':_0x2d6756,'error_type':_0xbb87a6 instanceof Error?_0xbb87a6[_0x7eaca(0x24e)][_0x7eaca(0x17b)]:_0x7eaca(0x232),'context':{'tool':name,'arguments':args?JSON[_0x7eaca(0x1a5)](args)['substring'](0x0,0x1f4):undefined,'mcp_server_version':_0x7eaca(0x190)},'stack_trace':_0xbb87a6 instanceof Error?_0xbb87a6['stack']:undefined,'source':_0x7eaca(0x1e3)})[_0x7eaca(0x1e4)](()=>{}),{'content':[{'type':_0x7eaca(0x1b4),'text':_0x7eaca(0x1b1)+_0x2d6756}],'isError':!![]};}});async function updateAllowedDirectoriesFromRoots(_0x5a959b){const _0x4316e3=a0_0x5161e1,_0x19a5f6=await getValidRootDirectories(_0x5a959b);if(_0x19a5f6[_0x4316e3(0x23d)]>0x0)allowedDirectories=[..._0x19a5f6],logMcpStderr(_0x4316e3(0x251)+_0x19a5f6[_0x4316e3(0x23d)]+'\x20valid\x20directories');else{logMcpStderr(_0x4316e3(0x24a));if(ENABLE_WORKSPACE_MODE)try{const _0x55ca1c=await detectWorkspaceRoot(WORKSPACE_ROOT);_0x55ca1c&&(allowedDirectories=[_0x55ca1c],logMcpStderr(_0x4316e3(0x231)+_0x55ca1c));}catch(_0xea6eec){logMcpStderr(_0x4316e3(0x1a7)+_0xea6eec);}}}server['setNotificationHandler'](RootsListChangedNotificationSchema,async()=>{const _0x33853d=a0_0x5161e1;try{const _0x3b9702=await server[_0x33853d(0x183)]();_0x3b9702&&_0x33853d(0x1b0)in _0x3b9702&&await updateAllowedDirectoriesFromRoots(_0x3b9702[_0x33853d(0x1b0)]);}catch(_0x349f67){logMcpStderr('Failed\x20to\x20request\x20roots\x20from\x20client:',_0x349f67 instanceof Error?_0x349f67['message']:String(_0x349f67));}}),server[a0_0x5161e1(0x1b8)]=async()=>{const _0x8b446=a0_0x5161e1,_0x12c41e=server['getClientCapabilities']();if(_0x12c41e?.[_0x8b446(0x1b0)])try{const _0x37db3d=await server['listRoots']();_0x37db3d&&_0x8b446(0x1b0)in _0x37db3d?await updateAllowedDirectoriesFromRoots(_0x37db3d['roots']):logMcpStderr('Client\x20returned\x20no\x20roots\x20set,\x20keeping\x20current\x20settings');}catch(_0x5a0d0c){logMcpStderr(_0x8b446(0x214),_0x5a0d0c instanceof Error?_0x5a0d0c[_0x8b446(0x1ae)]:String(_0x5a0d0c));}else{if(allowedDirectories['length']>0x0)logMcpStderr('Client\x20does\x20not\x20support\x20MCP\x20Roots,\x20using\x20allowed\x20directories\x20set\x20from\x20server\x20args:',allowedDirectories);else{if(ENABLE_WORKSPACE_MODE)logMcpStderr(_0x8b446(0x225));else throw new Error('Server\x20cannot\x20operate:\x20No\x20allowed\x20directories\x20available.\x20Server\x20was\x20started\x20without\x20command-line\x20directories\x20and\x20client\x20either\x20does\x20not\x20support\x20MCP\x20roots\x20protocol\x20or\x20provided\x20empty\x20roots.\x20Please\x20either:\x201)\x20Start\x20server\x20with\x20directory\x20arguments,\x202)\x20Use\x20a\x20client\x20that\x20supports\x20MCP\x20roots\x20protocol\x20and\x20provides\x20valid\x20root\x20directories,\x20or\x203)\x20Enable\x20workspace\x20mode\x20with\x20ENABLE_WORKSPACE_MODE=true.');}}};async function runServer(){const _0x582fa3=a0_0x5161e1,_0x2154c1=new StdioServerTransport();await server[_0x582fa3(0x1ee)](_0x2154c1),logMcpStderr('Secure\x20MCP\x20Filesystem\x20Server\x20running\x20on\x20stdio'),allowedDirectories[_0x582fa3(0x23d)]===0x0&&logMcpStderr('Started\x20without\x20allowed\x20directories\x20-\x20waiting\x20for\x20client\x20to\x20provide\x20roots\x20via\x20MCP\x20protocol');}runServer()['catch'](_0x203820=>{const _0x1513be=a0_0x5161e1;logMcpStderr('Fatal\x20error\x20running\x20server:',_0x203820),process[_0x1513be(0x1dd)](0x1);});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type OperatingSystemType = 'macOS' | 'Windows' | 'Linux' | 'Unknown';
|
|
2
|
+
export declare function getOperatingSystemType(platform?: NodeJS.Platform): OperatingSystemType;
|
|
3
|
+
export declare function formatMcpLogMessage(message: string, platform?: NodeJS.Platform): string;
|
|
4
|
+
export declare function logMcpStderr(message: string, ...args: unknown[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a1_0x378649=a1_0x2660;(function(_0x5b6ffd,_0x37fe5a){var _0x59bbeb=a1_0x2660,_0x28185f=_0x5b6ffd();while(!![]){try{var _0x2dadff=parseInt(_0x59bbeb(0x1f4))/0x1+parseInt(_0x59bbeb(0x1f2))/0x2+parseInt(_0x59bbeb(0x1e8))/0x3*(parseInt(_0x59bbeb(0x1f5))/0x4)+-parseInt(_0x59bbeb(0x1ef))/0x5*(parseInt(_0x59bbeb(0x1ed))/0x6)+-parseInt(_0x59bbeb(0x1ea))/0x7*(-parseInt(_0x59bbeb(0x1ee))/0x8)+-parseInt(_0x59bbeb(0x1e9))/0x9+-parseInt(_0x59bbeb(0x1f0))/0xa;if(_0x2dadff===_0x37fe5a)break;else _0x28185f['push'](_0x28185f['shift']());}catch(_0x365c50){_0x28185f['push'](_0x28185f['shift']());}}}(a1_0x48c4,0x2eb65));import a1_0x2df604 from'os';export function getOperatingSystemType(_0x23699b=a1_0x2df604['platform']()){var _0x4c41df=a1_0x2660;switch(_0x23699b){case'darwin':return'macOS';case'win32':return _0x4c41df(0x1f3);case'linux':return _0x4c41df(0x1f1);default:return'Unknown';}}export function formatMcpLogMessage(_0x3a2656,_0x3e137b=a1_0x2df604[a1_0x378649(0x1ec)]()){return'[os='+getOperatingSystemType(_0x3e137b)+']\x20'+_0x3a2656;}function a1_0x2660(_0x16809f,_0x5ad9d7){_0x16809f=_0x16809f-0x1e8;var _0x48c471=a1_0x48c4();var _0x26604a=_0x48c471[_0x16809f];return _0x26604a;}function a1_0x48c4(){var _0x33b9bc=['Windows','91954tUCPhK','2924gbjNVd','1101OXeVVy','2245959ZZOBan','1218ImgUrJ','error','platform','5802MXPONX','11384GSXBWu','1780JsspRU','1147580HDtqai','Linux','584122ahQBVU'];a1_0x48c4=function(){return _0x33b9bc;};return a1_0x48c4();}export function logMcpStderr(_0x4fd1a4,..._0x17a849){var _0x32dc71=a1_0x378649;console[_0x32dc71(0x1eb)](formatMcpLogMessage(_0x4fd1a4),..._0x17a849);}
|
package/dist/path-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a2_0x4f0f(_0x378e97,_0x18e033){_0x378e97=_0x378e97-0x1eb;const _0xce7968=a2_0xce79();let _0x4f0fb5=_0xce7968[_0x378e97];return _0x4f0fb5;}(function(_0x12728d,_0x4ff1f7){const _0x1720c6=a2_0x4f0f,_0x2b403e=_0x12728d();while(!![]){try{const _0x42ffd8=parseInt(_0x1720c6(0x201))/0x1*(-parseInt(_0x1720c6(0x200))/0x2)+-parseInt(_0x1720c6(0x1fc))/0x3*(-parseInt(_0x1720c6(0x1ef))/0x4)+parseInt(_0x1720c6(0x1f2))/0x5+parseInt(_0x1720c6(0x1f5))/0x6*(-parseInt(_0x1720c6(0x1eb))/0x7)+-parseInt(_0x1720c6(0x1ff))/0x8*(parseInt(_0x1720c6(0x1f1))/0x9)+parseInt(_0x1720c6(0x1f4))/0xa*(-parseInt(_0x1720c6(0x1fe))/0xb)+parseInt(_0x1720c6(0x1f8))/0xc;if(_0x42ffd8===_0x4ff1f7)break;else _0x2b403e['push'](_0x2b403e['shift']());}catch(_0x87d322){_0x2b403e['push'](_0x2b403e['shift']());}}}(a2_0xce79,0x4eb1e));import a2_0x46cac5 from'path';import a2_0x4c30b1 from'os';function a2_0xce79(){const _0x555e02=['match','1417273FYASwH','1432Fvqava','94nZttUF','6207oGytCb','homedir','259399ZMBcnO','toUpperCase','trim','charAt','28jEHKYW','normalize','28809XuGiMy','1830015bGLcQf','/mnt/','10lneVRH','90ILgdPy','startsWith','replace','10482888FbaJgv','substring','slice','join','270927Gxeagp'];a2_0xce79=function(){return _0x555e02;};return a2_0xce79();}export function convertToWindowsPath(_0x446dfc){const _0x2f1244=a2_0x4f0f;if(_0x446dfc[_0x2f1244(0x1f6)](_0x2f1244(0x1f3))){const _0x521424=_0x446dfc[_0x2f1244(0x1ee)](0x5)[_0x2f1244(0x1ec)](),_0x24c112=_0x446dfc[_0x2f1244(0x1fa)](0x6)['replace'](/\//g,'\x5c');return _0x521424+':'+_0x24c112;}if(_0x446dfc[_0x2f1244(0x1fd)](/^\/[a-zA-Z]\//)){const _0x3ec5ba=_0x446dfc['charAt'](0x1)['toUpperCase'](),_0x472e64=_0x446dfc['slice'](0x2)[_0x2f1244(0x1f7)](/\//g,'\x5c');return _0x3ec5ba+':'+_0x472e64;}if(_0x446dfc[_0x2f1244(0x1fd)](/^[a-zA-Z]:/))return _0x446dfc[_0x2f1244(0x1f7)](/\//g,'\x5c');return _0x446dfc;}export function normalizePath(_0x318572){const _0xf3dfe6=a2_0x4f0f;_0x318572=_0x318572[_0xf3dfe6(0x1ed)]()[_0xf3dfe6(0x1f7)](/^["']|["']$/g,'');const _0x82959=_0x318572[_0xf3dfe6(0x1f6)]('/')&&!_0x318572['match'](/^\/mnt\/[a-z]\//i)&&!_0x318572[_0xf3dfe6(0x1fd)](/^\/[a-zA-Z]\//);if(_0x82959)return _0x318572['replace'](/\/+/g,'/')[_0xf3dfe6(0x1f7)](/\/+$/,'');_0x318572=convertToWindowsPath(_0x318572);if(_0x318572[_0xf3dfe6(0x1f6)]('\x5c\x5c')){let _0x16f887=_0x318572;_0x16f887=_0x16f887[_0xf3dfe6(0x1f7)](/^\\{2,}/,'\x5c\x5c');const _0x37031a=_0x16f887[_0xf3dfe6(0x1f9)](0x2)[_0xf3dfe6(0x1f7)](/\\\\/g,'\x5c');_0x318572='\x5c\x5c'+_0x37031a;}else _0x318572=_0x318572[_0xf3dfe6(0x1f7)](/\\\\/g,'\x5c');let _0x2819c3=a2_0x46cac5[_0xf3dfe6(0x1f0)](_0x318572);_0x318572[_0xf3dfe6(0x1f6)]('\x5c\x5c')&&!_0x2819c3[_0xf3dfe6(0x1f6)]('\x5c\x5c')&&(_0x2819c3='\x5c'+_0x2819c3);if(_0x2819c3[_0xf3dfe6(0x1fd)](/^[a-zA-Z]:/)){let _0xbb3ca=_0x2819c3[_0xf3dfe6(0x1f7)](/\//g,'\x5c');return/^[a-z]:/['test'](_0xbb3ca)&&(_0xbb3ca=_0xbb3ca['charAt'](0x0)[_0xf3dfe6(0x1ec)]()+_0xbb3ca[_0xf3dfe6(0x1fa)](0x1)),_0xbb3ca;}return _0x2819c3[_0xf3dfe6(0x1f7)](/\//g,'\x5c');}export function expandHome(_0x95691a){const _0x254a14=a2_0x4f0f;if(_0x95691a[_0x254a14(0x1f6)]('~/')||_0x95691a==='~')return a2_0x46cac5[_0x254a14(0x1fb)](a2_0x4c30b1[_0x254a14(0x202)](),_0x95691a[_0x254a14(0x1fa)](0x1));return _0x95691a;}
|
package/dist/path-validation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x23c683,_0x49eb5c){const _0x1aa8a5=a3_0x4790,_0x10df10=_0x23c683();while(!![]){try{const _0x56f8bd=-parseInt(_0x1aa8a5(0x1af))/0x1*(parseInt(_0x1aa8a5(0x1ac))/0x2)+parseInt(_0x1aa8a5(0x1a7))/0x3*(-parseInt(_0x1aa8a5(0x1a4))/0x4)+parseInt(_0x1aa8a5(0x1ae))/0x5+parseInt(_0x1aa8a5(0x19c))/0x6+-parseInt(_0x1aa8a5(0x1a1))/0x7*(parseInt(_0x1aa8a5(0x1a5))/0x8)+parseInt(_0x1aa8a5(0x1a0))/0x9*(-parseInt(_0x1aa8a5(0x1a2))/0xa)+parseInt(_0x1aa8a5(0x1a3))/0xb;if(_0x56f8bd===_0x49eb5c)break;else _0x10df10['push'](_0x10df10['shift']());}catch(_0x15475b){_0x10df10['push'](_0x10df10['shift']());}}}(a3_0x3078,0x8e64d));import a3_0x2335b5 from'path';function a3_0x4790(_0x238ef6,_0xb5cc3b){_0x238ef6=_0x238ef6-0x19b;const _0x307826=a3_0x3078();let _0x4790a5=_0x307826[_0x238ef6];return _0x4790a5;}function a3_0x3078(){const _0x115873=['isAbsolute','462wqWNHa','normalize','isArray','sep','includes','2pUbafK','Allowed\x20directories\x20must\x20be\x20absolute\x20paths\x20after\x20normalization','5379780DacvRl','138499gmyTCy','startsWith','2781942mIPcvs','Path\x20must\x20be\x20absolute\x20after\x20normalization','resolve','string','18DPTwlZ','62482vlOYKZ','987460TTYNeK','6151827hDCDrL','12556VwUphZ','624fqGORK'];a3_0x3078=function(){return _0x115873;};return a3_0x3078();}export function isPathWithinAllowedDirectories(_0x548256,_0x2b1f33){const _0x4cd764=a3_0x4790;if(typeof _0x548256!==_0x4cd764(0x19f)||!Array[_0x4cd764(0x1a9)](_0x2b1f33))return![];if(!_0x548256||_0x2b1f33['length']===0x0)return![];if(_0x548256['includes']('\x00'))return![];let _0x289e32;try{_0x289e32=a3_0x2335b5[_0x4cd764(0x19e)](a3_0x2335b5[_0x4cd764(0x1a8)](_0x548256));}catch{return![];}if(!a3_0x2335b5['isAbsolute'](_0x289e32))throw new Error(_0x4cd764(0x19d));return _0x2b1f33['some'](_0x5148c4=>{const _0x39632f=_0x4cd764;if(typeof _0x5148c4!==_0x39632f(0x19f)||!_0x5148c4)return![];if(_0x5148c4[_0x39632f(0x1ab)]('\x00'))return![];let _0x3027c9;try{_0x3027c9=a3_0x2335b5[_0x39632f(0x19e)](a3_0x2335b5[_0x39632f(0x1a8)](_0x5148c4));}catch{return![];}if(!a3_0x2335b5[_0x39632f(0x1a6)](_0x3027c9))throw new Error(_0x39632f(0x1ad));if(_0x289e32===_0x3027c9)return!![];if(_0x3027c9===a3_0x2335b5[_0x39632f(0x1aa)])return _0x289e32['startsWith'](a3_0x2335b5[_0x39632f(0x1aa)]);return _0x289e32[_0x39632f(0x19b)](_0x3027c9+a3_0x2335b5['sep']);});}
|
package/dist/roots-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x217972,_0xb18bf){const _0x58b88e=a4_0xada4,_0x160e5f=_0x217972();while(!![]){try{const _0x54c39e=parseInt(_0x58b88e(0x179))/0x1+-parseInt(_0x58b88e(0x16b))/0x2+-parseInt(_0x58b88e(0x17e))/0x3*(-parseInt(_0x58b88e(0x16f))/0x4)+-parseInt(_0x58b88e(0x174))/0x5+parseInt(_0x58b88e(0x175))/0x6+parseInt(_0x58b88e(0x16d))/0x7+parseInt(_0x58b88e(0x173))/0x8*(-parseInt(_0x58b88e(0x170))/0x9);if(_0x54c39e===_0xb18bf)break;else _0x160e5f['push'](_0x160e5f['shift']());}catch(_0x8b7c0c){_0x160e5f['push'](_0x160e5f['shift']());}}}(a4_0xf398,0x59d1f));import{promises as a4_0x4b291b}from'fs';import a4_0x35f306 from'path';import a4_0x50c03f from'os';import{normalizePath}from'./path-utils.js';import{logMcpStderr}from'./log-utils.js';function a4_0xada4(_0x29752e,_0x1dcea4){_0x29752e=_0x29752e-0x16b;const _0xf39853=a4_0xf398();let _0xada444=_0xf39853[_0x29752e];return _0xada444;}function a4_0xf398(){const _0x528666=['uri','54gSApWD','stat','message','realpath','invalid\x20path\x20or\x20inaccessible','782356qZOvxV','homedir','1628690FrpeAD','slice','147824watPFe','63nEbAIm','isDirectory','startsWith','1015352Edsbed','1837155whTJxO','3093174KnBYzA','Skipping\x20invalid\x20directory:\x20','file://','join','601538SruEBp','non-directory\x20root','Skipping\x20','resolve'];a4_0xf398=function(){return _0x528666;};return a4_0xf398();}async function parseRootUri(_0x39ce37){const _0x36f74f=a4_0xada4;try{const _0x544606=_0x39ce37[_0x36f74f(0x172)](_0x36f74f(0x177))?_0x39ce37[_0x36f74f(0x16e)](0x7):_0x39ce37,_0x5b5019=_0x544606[_0x36f74f(0x172)]('~/')||_0x544606==='~'?a4_0x35f306[_0x36f74f(0x178)](a4_0x50c03f[_0x36f74f(0x16c)](),_0x544606[_0x36f74f(0x16e)](0x1)):_0x544606,_0x3c86aa=a4_0x35f306[_0x36f74f(0x17c)](_0x5b5019),_0x42582b=await a4_0x4b291b[_0x36f74f(0x181)](_0x3c86aa);return normalizePath(_0x42582b);}catch{return null;}}function formatDirectoryError(_0x8ef7b0,_0x2a4ded,_0x24bf0e){const _0x496e0d=a4_0xada4;if(_0x24bf0e)return _0x496e0d(0x17b)+_0x24bf0e+':\x20'+_0x8ef7b0;const _0x29d8b7=_0x2a4ded instanceof Error?_0x2a4ded[_0x496e0d(0x180)]:String(_0x2a4ded);return _0x496e0d(0x176)+_0x8ef7b0+'\x20due\x20to\x20error:\x20'+_0x29d8b7;}export async function getValidRootDirectories(_0x338e28){const _0xb67700=a4_0xada4,_0x166f31=[];for(const _0x1bd6fa of _0x338e28){const _0x27bff2=await parseRootUri(_0x1bd6fa[_0xb67700(0x17d)]);if(!_0x27bff2){logMcpStderr(formatDirectoryError(_0x1bd6fa[_0xb67700(0x17d)],undefined,_0xb67700(0x182)));continue;}try{const _0x48028c=await a4_0x4b291b[_0xb67700(0x17f)](_0x27bff2);_0x48028c[_0xb67700(0x171)]()?_0x166f31['push'](_0x27bff2):logMcpStderr(formatDirectoryError(_0x27bff2,undefined,_0xb67700(0x17a)));}catch(_0x43c92f){logMcpStderr(formatDirectoryError(_0x27bff2,_0x43c92f));}}return _0x166f31;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morphllm/morphmcp",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.124",
|
|
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)",
|