next 15.6.0-canary.50 → 15.6.0-canary.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/adapter/build-complete.d.ts +12 -1
- package/dist/build/adapter/build-complete.js +80 -21
- package/dist/build/adapter/build-complete.js.map +1 -1
- package/dist/build/index.js +31 -27
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/type-check.js +15 -8
- package/dist/build/type-check.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/index.js +1 -15
- package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/compiled/sass-loader/cjs.js +1 -1
- package/dist/esm/build/adapter/build-complete.js +80 -21
- package/dist/esm/build/adapter/build-complete.js.map +1 -1
- package/dist/esm/build/index.js +31 -27
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/type-check.js +15 -8
- package/dist/esm/build/type-check.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/index.js +1 -15
- package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/recursive-delete.js +1 -1
- package/dist/esm/lib/recursive-delete.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +8 -2
- package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +10 -4
- package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/mcp/get-mcp-middleware.js +2 -2
- package/dist/esm/server/mcp/get-mcp-middleware.js.map +1 -1
- package/dist/esm/server/mcp/get-or-create-mcp-server.js +7 -7
- package/dist/esm/server/mcp/get-or-create-mcp-server.js.map +1 -1
- package/dist/esm/server/mcp/tools/{get-project-path.js → get-project-metadata.js} +9 -5
- package/dist/esm/server/mcp/tools/get-project-metadata.js.map +1 -0
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/lib/recursive-delete.d.ts +1 -1
- package/dist/lib/recursive-delete.js +1 -1
- package/dist/lib/recursive-delete.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +8 -2
- package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +10 -4
- package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/mcp/get-mcp-middleware.d.ts +2 -2
- package/dist/server/mcp/get-mcp-middleware.js +2 -2
- package/dist/server/mcp/get-mcp-middleware.js.map +1 -1
- package/dist/server/mcp/get-or-create-mcp-server.d.ts +8 -1
- package/dist/server/mcp/get-or-create-mcp-server.js +7 -7
- package/dist/server/mcp/get-or-create-mcp-server.js.map +1 -1
- package/dist/server/mcp/tools/get-project-metadata.d.ts +2 -0
- package/dist/server/mcp/tools/{get-project-path.js → get-project-metadata.js} +11 -7
- package/dist/server/mcp/tools/get-project-metadata.js.map +1 -0
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +16 -16
- package/dist/esm/server/mcp/tools/get-project-path.js.map +0 -1
- package/dist/server/mcp/tools/get-project-path.d.ts +0 -2
- package/dist/server/mcp/tools/get-project-path.js.map +0 -1
|
@@ -9,13 +9,13 @@ Object.defineProperty(exports, "getOrCreateMcpServer", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _mcp = require("next/dist/compiled/@modelcontextprotocol/sdk/server/mcp");
|
|
12
|
-
const
|
|
12
|
+
const _getprojectmetadata = require("./tools/get-project-metadata");
|
|
13
13
|
const _geterrors = require("./tools/get-errors");
|
|
14
14
|
const _getpagemetadata = require("./tools/get-page-metadata");
|
|
15
15
|
const _getlogs = require("./tools/get-logs");
|
|
16
16
|
const _getserveractionbyid = require("./tools/get-server-action-by-id");
|
|
17
17
|
let mcpServer;
|
|
18
|
-
const getOrCreateMcpServer = (
|
|
18
|
+
const getOrCreateMcpServer = (options)=>{
|
|
19
19
|
if (mcpServer) {
|
|
20
20
|
return mcpServer;
|
|
21
21
|
}
|
|
@@ -23,11 +23,11 @@ const getOrCreateMcpServer = (projectPath, distDir, sendHmrMessage, getActiveCon
|
|
|
23
23
|
name: 'Next.js MCP Server',
|
|
24
24
|
version: '0.1.0'
|
|
25
25
|
});
|
|
26
|
-
(0,
|
|
27
|
-
(0, _geterrors.registerGetErrorsTool)(mcpServer, sendHmrMessage, getActiveConnectionCount);
|
|
28
|
-
(0, _getpagemetadata.registerGetPageMetadataTool)(mcpServer, sendHmrMessage, getActiveConnectionCount);
|
|
29
|
-
(0, _getlogs.registerGetLogsTool)(mcpServer, distDir);
|
|
30
|
-
(0, _getserveractionbyid.registerGetActionByIdTool)(mcpServer, distDir);
|
|
26
|
+
(0, _getprojectmetadata.registerGetProjectMetadataTool)(mcpServer, options.projectPath, options.getDevServerUrl);
|
|
27
|
+
(0, _geterrors.registerGetErrorsTool)(mcpServer, options.sendHmrMessage, options.getActiveConnectionCount);
|
|
28
|
+
(0, _getpagemetadata.registerGetPageMetadataTool)(mcpServer, options.sendHmrMessage, options.getActiveConnectionCount);
|
|
29
|
+
(0, _getlogs.registerGetLogsTool)(mcpServer, options.distDir);
|
|
30
|
+
(0, _getserveractionbyid.registerGetActionByIdTool)(mcpServer, options.distDir);
|
|
31
31
|
return mcpServer;
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/mcp/get-or-create-mcp-server.ts"],"sourcesContent":["import { McpServer } from 'next/dist/compiled/@modelcontextprotocol/sdk/server/mcp'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/server/mcp/get-or-create-mcp-server.ts"],"sourcesContent":["import { McpServer } from 'next/dist/compiled/@modelcontextprotocol/sdk/server/mcp'\nimport { registerGetProjectMetadataTool } from './tools/get-project-metadata'\nimport { registerGetErrorsTool } from './tools/get-errors'\nimport { registerGetPageMetadataTool } from './tools/get-page-metadata'\nimport { registerGetLogsTool } from './tools/get-logs'\nimport { registerGetActionByIdTool } from './tools/get-server-action-by-id'\nimport type { HmrMessageSentToBrowser } from '../dev/hot-reloader-types'\n\nexport interface McpServerOptions {\n projectPath: string\n distDir: string\n sendHmrMessage: (message: HmrMessageSentToBrowser) => void\n getActiveConnectionCount: () => number\n getDevServerUrl: () => string | undefined\n}\n\nlet mcpServer: McpServer | undefined\n\nexport const getOrCreateMcpServer = (options: McpServerOptions) => {\n if (mcpServer) {\n return mcpServer\n }\n\n mcpServer = new McpServer({\n name: 'Next.js MCP Server',\n version: '0.1.0',\n })\n\n registerGetProjectMetadataTool(\n mcpServer,\n options.projectPath,\n options.getDevServerUrl\n )\n registerGetErrorsTool(\n mcpServer,\n options.sendHmrMessage,\n options.getActiveConnectionCount\n )\n registerGetPageMetadataTool(\n mcpServer,\n options.sendHmrMessage,\n options.getActiveConnectionCount\n )\n registerGetLogsTool(mcpServer, options.distDir)\n registerGetActionByIdTool(mcpServer, options.distDir)\n\n return mcpServer\n}\n"],"names":["getOrCreateMcpServer","mcpServer","options","McpServer","name","version","registerGetProjectMetadataTool","projectPath","getDevServerUrl","registerGetErrorsTool","sendHmrMessage","getActiveConnectionCount","registerGetPageMetadataTool","registerGetLogsTool","distDir","registerGetActionByIdTool"],"mappings":";;;;+BAkBaA;;;eAAAA;;;qBAlBa;oCACqB;2BACT;iCACM;yBACR;qCACM;AAW1C,IAAIC;AAEG,MAAMD,uBAAuB,CAACE;IACnC,IAAID,WAAW;QACb,OAAOA;IACT;IAEAA,YAAY,IAAIE,cAAS,CAAC;QACxBC,MAAM;QACNC,SAAS;IACX;IAEAC,IAAAA,kDAA8B,EAC5BL,WACAC,QAAQK,WAAW,EACnBL,QAAQM,eAAe;IAEzBC,IAAAA,gCAAqB,EACnBR,WACAC,QAAQQ,cAAc,EACtBR,QAAQS,wBAAwB;IAElCC,IAAAA,4CAA2B,EACzBX,WACAC,QAAQQ,cAAc,EACtBR,QAAQS,wBAAwB;IAElCE,IAAAA,4BAAmB,EAACZ,WAAWC,QAAQY,OAAO;IAC9CC,IAAAA,8CAAyB,EAACd,WAAWC,QAAQY,OAAO;IAEpD,OAAOb;AACT","ignoreList":[0]}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "registerGetProjectMetadataTool", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return registerGetProjectMetadataTool;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
function
|
|
12
|
-
server.registerTool('
|
|
13
|
-
description: 'Returns the
|
|
11
|
+
function registerGetProjectMetadataTool(server, projectPath, getDevServerUrl) {
|
|
12
|
+
server.registerTool('get_project_metadata', {
|
|
13
|
+
description: 'Returns the the metadata of this Next.js project, including project path, dev server URL, etc.',
|
|
14
14
|
inputSchema: {}
|
|
15
15
|
}, async (_request)=>{
|
|
16
16
|
try {
|
|
@@ -24,11 +24,15 @@ function registerGetProjectPathTool(server, projectPath) {
|
|
|
24
24
|
]
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
+
const devServerUrl = getDevServerUrl();
|
|
27
28
|
return {
|
|
28
29
|
content: [
|
|
29
30
|
{
|
|
30
31
|
type: 'text',
|
|
31
|
-
text:
|
|
32
|
+
text: JSON.stringify({
|
|
33
|
+
projectPath,
|
|
34
|
+
devServerUrl
|
|
35
|
+
})
|
|
32
36
|
}
|
|
33
37
|
]
|
|
34
38
|
};
|
|
@@ -45,4 +49,4 @@ function registerGetProjectPathTool(server, projectPath) {
|
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
//# sourceMappingURL=get-project-
|
|
52
|
+
//# sourceMappingURL=get-project-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/server/mcp/tools/get-project-metadata.ts"],"sourcesContent":["import type { McpServer } from 'next/dist/compiled/@modelcontextprotocol/sdk/server/mcp'\n\nexport function registerGetProjectMetadataTool(\n server: McpServer,\n projectPath: string,\n getDevServerUrl: () => string | undefined\n) {\n server.registerTool(\n 'get_project_metadata',\n {\n description:\n 'Returns the the metadata of this Next.js project, including project path, dev server URL, etc.',\n inputSchema: {},\n },\n async (_request) => {\n try {\n if (!projectPath) {\n return {\n content: [\n {\n type: 'text',\n text: 'Unable to determine the absolute path of the Next.js project.',\n },\n ],\n }\n }\n\n const devServerUrl = getDevServerUrl()\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify({\n projectPath,\n devServerUrl,\n }),\n },\n ],\n }\n } catch (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n }\n }\n }\n )\n}\n"],"names":["registerGetProjectMetadataTool","server","projectPath","getDevServerUrl","registerTool","description","inputSchema","_request","content","type","text","devServerUrl","JSON","stringify","error","Error","message","String"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,+BACdC,MAAiB,EACjBC,WAAmB,EACnBC,eAAyC;IAEzCF,OAAOG,YAAY,CACjB,wBACA;QACEC,aACE;QACFC,aAAa,CAAC;IAChB,GACA,OAAOC;QACL,IAAI;YACF,IAAI,CAACL,aAAa;gBAChB,OAAO;oBACLM,SAAS;wBACP;4BACEC,MAAM;4BACNC,MAAM;wBACR;qBACD;gBACH;YACF;YAEA,MAAMC,eAAeR;YAErB,OAAO;gBACLK,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAME,KAAKC,SAAS,CAAC;4BACnBX;4BACAS;wBACF;oBACF;iBACD;YACH;QACF,EAAE,OAAOG,OAAO;YACd,OAAO;gBACLN,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAM,CAAC,OAAO,EAAEI,iBAAiBC,QAAQD,MAAME,OAAO,GAAGC,OAAOH,QAAQ;oBAC1E;iBACD;YACH;QACF;IACF;AAEJ","ignoreList":[0]}
|
|
@@ -21,7 +21,7 @@ _export(exports, {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
function isStableBuild() {
|
|
24
|
-
return !"15.6.0-canary.
|
|
24
|
+
return !"15.6.0-canary.52"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
25
25
|
}
|
|
26
26
|
class CanaryOnlyError extends Error {
|
|
27
27
|
constructor(arg){
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
|
|
|
11
11
|
const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
|
|
12
12
|
function eventCliSessionStopped(event) {
|
|
13
13
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
14
|
-
if (typeof "15.6.0-canary.
|
|
14
|
+
if (typeof "15.6.0-canary.52" !== 'string') {
|
|
15
15
|
return [];
|
|
16
16
|
}
|
|
17
17
|
const payload = {
|
|
18
|
-
nextVersion: "15.6.0-canary.
|
|
18
|
+
nextVersion: "15.6.0-canary.52",
|
|
19
19
|
nodeVersion: process.version,
|
|
20
20
|
cliCommand: event.cliCommand,
|
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
|
@@ -12,12 +12,12 @@ const EVENT_VERSION = 'NEXT_CLI_SESSION_STARTED';
|
|
|
12
12
|
function eventCliSession(nextConfig, event) {
|
|
13
13
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_reactCompiler, _nextConfig_reactCompiler1;
|
|
14
14
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
15
|
-
if (typeof "15.6.0-canary.
|
|
15
|
+
if (typeof "15.6.0-canary.52" !== 'string') {
|
|
16
16
|
return [];
|
|
17
17
|
}
|
|
18
18
|
const { images, i18n } = nextConfig || {};
|
|
19
19
|
const payload = {
|
|
20
|
-
nextVersion: "15.6.0-canary.
|
|
20
|
+
nextVersion: "15.6.0-canary.52",
|
|
21
21
|
nodeVersion: process.version,
|
|
22
22
|
cliCommand: event.cliCommand,
|
|
23
23
|
isSrcDir: event.isSrcDir,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next",
|
|
3
|
-
"version": "15.6.0-canary.
|
|
3
|
+
"version": "15.6.0-canary.52",
|
|
4
4
|
"description": "The React Framework",
|
|
5
5
|
"main": "./dist/server/next.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
]
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@next/env": "15.6.0-canary.
|
|
103
|
+
"@next/env": "15.6.0-canary.52",
|
|
104
104
|
"@swc/helpers": "0.5.15",
|
|
105
105
|
"caniuse-lite": "^1.0.30001579",
|
|
106
106
|
"postcss": "8.4.31",
|
|
@@ -130,14 +130,14 @@
|
|
|
130
130
|
},
|
|
131
131
|
"optionalDependencies": {
|
|
132
132
|
"sharp": "^0.34.4",
|
|
133
|
-
"@next/swc-darwin-arm64": "15.6.0-canary.
|
|
134
|
-
"@next/swc-darwin-x64": "15.6.0-canary.
|
|
135
|
-
"@next/swc-linux-arm64-gnu": "15.6.0-canary.
|
|
136
|
-
"@next/swc-linux-arm64-musl": "15.6.0-canary.
|
|
137
|
-
"@next/swc-linux-x64-gnu": "15.6.0-canary.
|
|
138
|
-
"@next/swc-linux-x64-musl": "15.6.0-canary.
|
|
139
|
-
"@next/swc-win32-arm64-msvc": "15.6.0-canary.
|
|
140
|
-
"@next/swc-win32-x64-msvc": "15.6.0-canary.
|
|
133
|
+
"@next/swc-darwin-arm64": "15.6.0-canary.52",
|
|
134
|
+
"@next/swc-darwin-x64": "15.6.0-canary.52",
|
|
135
|
+
"@next/swc-linux-arm64-gnu": "15.6.0-canary.52",
|
|
136
|
+
"@next/swc-linux-arm64-musl": "15.6.0-canary.52",
|
|
137
|
+
"@next/swc-linux-x64-gnu": "15.6.0-canary.52",
|
|
138
|
+
"@next/swc-linux-x64-musl": "15.6.0-canary.52",
|
|
139
|
+
"@next/swc-win32-arm64-msvc": "15.6.0-canary.52",
|
|
140
|
+
"@next/swc-win32-x64-msvc": "15.6.0-canary.52"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@babel/code-frame": "7.26.2",
|
|
@@ -172,11 +172,11 @@
|
|
|
172
172
|
"@modelcontextprotocol/sdk": "1.18.1",
|
|
173
173
|
"@mswjs/interceptors": "0.23.0",
|
|
174
174
|
"@napi-rs/triples": "1.2.0",
|
|
175
|
-
"@next/font": "15.6.0-canary.
|
|
176
|
-
"@next/polyfill-module": "15.6.0-canary.
|
|
177
|
-
"@next/polyfill-nomodule": "15.6.0-canary.
|
|
178
|
-
"@next/react-refresh-utils": "15.6.0-canary.
|
|
179
|
-
"@next/swc": "15.6.0-canary.
|
|
175
|
+
"@next/font": "15.6.0-canary.52",
|
|
176
|
+
"@next/polyfill-module": "15.6.0-canary.52",
|
|
177
|
+
"@next/polyfill-nomodule": "15.6.0-canary.52",
|
|
178
|
+
"@next/react-refresh-utils": "15.6.0-canary.52",
|
|
179
|
+
"@next/swc": "15.6.0-canary.52",
|
|
180
180
|
"@opentelemetry/api": "1.6.0",
|
|
181
181
|
"@playwright/test": "1.51.1",
|
|
182
182
|
"@rspack/core": "1.5.0",
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
"recast": "0.23.11",
|
|
319
319
|
"regenerator-runtime": "0.13.4",
|
|
320
320
|
"safe-stable-stringify": "2.5.0",
|
|
321
|
-
"sass-loader": "
|
|
321
|
+
"sass-loader": "16.0.5",
|
|
322
322
|
"schema-utils2": "npm:schema-utils@2.7.1",
|
|
323
323
|
"schema-utils3": "npm:schema-utils@3.0.0",
|
|
324
324
|
"semver": "7.3.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/server/mcp/tools/get-project-path.ts"],"sourcesContent":["import type { McpServer } from 'next/dist/compiled/@modelcontextprotocol/sdk/server/mcp'\n\nexport function registerGetProjectPathTool(\n server: McpServer,\n projectPath: string\n) {\n server.registerTool(\n 'get_project_path',\n {\n description:\n 'Returns the absolute path of the root directory for this Next.js project.',\n inputSchema: {},\n },\n async (_request) => {\n try {\n if (!projectPath) {\n return {\n content: [\n {\n type: 'text',\n text: 'Unable to determine the absolute path of the Next.js project.',\n },\n ],\n }\n }\n\n return {\n content: [\n {\n type: 'text',\n text: projectPath,\n },\n ],\n }\n } catch (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n }\n }\n }\n )\n}\n"],"names":["registerGetProjectPathTool","server","projectPath","registerTool","description","inputSchema","_request","content","type","text","error","Error","message","String"],"mappings":"AAEA,OAAO,SAASA,2BACdC,MAAiB,EACjBC,WAAmB;IAEnBD,OAAOE,YAAY,CACjB,oBACA;QACEC,aACE;QACFC,aAAa,CAAC;IAChB,GACA,OAAOC;QACL,IAAI;YACF,IAAI,CAACJ,aAAa;gBAChB,OAAO;oBACLK,SAAS;wBACP;4BACEC,MAAM;4BACNC,MAAM;wBACR;qBACD;gBACH;YACF;YAEA,OAAO;gBACLF,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAMP;oBACR;iBACD;YACH;QACF,EAAE,OAAOQ,OAAO;YACd,OAAO;gBACLH,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAM,CAAC,OAAO,EAAEC,iBAAiBC,QAAQD,MAAME,OAAO,GAAGC,OAAOH,QAAQ;oBAC1E;iBACD;YACH;QACF;IACF;AAEJ","ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/server/mcp/tools/get-project-path.ts"],"sourcesContent":["import type { McpServer } from 'next/dist/compiled/@modelcontextprotocol/sdk/server/mcp'\n\nexport function registerGetProjectPathTool(\n server: McpServer,\n projectPath: string\n) {\n server.registerTool(\n 'get_project_path',\n {\n description:\n 'Returns the absolute path of the root directory for this Next.js project.',\n inputSchema: {},\n },\n async (_request) => {\n try {\n if (!projectPath) {\n return {\n content: [\n {\n type: 'text',\n text: 'Unable to determine the absolute path of the Next.js project.',\n },\n ],\n }\n }\n\n return {\n content: [\n {\n type: 'text',\n text: projectPath,\n },\n ],\n }\n } catch (error) {\n return {\n content: [\n {\n type: 'text',\n text: `Error: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n }\n }\n }\n )\n}\n"],"names":["registerGetProjectPathTool","server","projectPath","registerTool","description","inputSchema","_request","content","type","text","error","Error","message","String"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,2BACdC,MAAiB,EACjBC,WAAmB;IAEnBD,OAAOE,YAAY,CACjB,oBACA;QACEC,aACE;QACFC,aAAa,CAAC;IAChB,GACA,OAAOC;QACL,IAAI;YACF,IAAI,CAACJ,aAAa;gBAChB,OAAO;oBACLK,SAAS;wBACP;4BACEC,MAAM;4BACNC,MAAM;wBACR;qBACD;gBACH;YACF;YAEA,OAAO;gBACLF,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAMP;oBACR;iBACD;YACH;QACF,EAAE,OAAOQ,OAAO;YACd,OAAO;gBACLH,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAM,CAAC,OAAO,EAAEC,iBAAiBC,QAAQD,MAAME,OAAO,GAAGC,OAAOH,QAAQ;oBAC1E;iBACD;YACH;QACF;IACF;AAEJ","ignoreList":[0]}
|