@o3r/mcp 13.3.0-prerelease.5 → 13.3.0-prerelease.6
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/package.json +5 -5
- package/src/best-practices/index.d.ts +8 -0
- package/src/best-practices/index.d.ts.map +1 -0
- package/src/best-practices/index.js +52 -0
- package/src/best-practices/index.js.map +1 -0
- package/src/mcp-server.d.ts.map +1 -1
- package/src/mcp-server.js +11 -6
- package/src/mcp-server.js.map +1 -1
- package/src/release-notes/index.d.ts +7 -0
- package/src/release-notes/index.d.ts.map +1 -0
- package/src/release-notes/index.js +84 -0
- package/src/release-notes/index.js.map +1 -0
- package/src/tools/find-repositories-using-otter.d.ts.map +1 -1
- package/src/tools/find-repositories-using-otter.js +12 -10
- package/src/tools/find-repositories-using-otter.js.map +1 -1
- package/src/tools/supported-releases.d.ts +7 -0
- package/src/tools/supported-releases.d.ts.map +1 -0
- package/src/tools/supported-releases.js +46 -0
- package/src/tools/supported-releases.js.map +1 -0
- package/src/utils/otter.d.ts +17 -0
- package/src/utils/otter.d.ts.map +1 -0
- package/src/utils/otter.js +25 -0
- package/src/utils/otter.js.map +1 -0
- package/src/utils/resource-registry.d.ts +7 -0
- package/src/utils/resource-registry.d.ts.map +1 -0
- package/src/utils/resource-registry.js +10 -0
- package/src/utils/resource-registry.js.map +1 -0
- package/src/instructions/best-practices.d.ts +0 -8
- package/src/instructions/best-practices.d.ts.map +0 -1
- package/src/instructions/best-practices.js +0 -24
- package/src/instructions/best-practices.js.map +0 -1
- package/src/tools/best-practices.d.ts +0 -8
- package/src/tools/best-practices.d.ts.map +0 -1
- package/src/tools/best-practices.js +0 -27
- package/src/tools/best-practices.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/mcp",
|
|
3
|
-
"version": "13.3.0-prerelease.
|
|
3
|
+
"version": "13.3.0-prerelease.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@nx/eslint-plugin": "~21.6.0",
|
|
40
40
|
"@nx/jest": "~21.6.0",
|
|
41
41
|
"@nx/js": "~21.6.0",
|
|
42
|
-
"@o3r/build-helpers": "^13.3.0-prerelease.
|
|
43
|
-
"@o3r/eslint-config": "^13.3.0-prerelease.
|
|
44
|
-
"@o3r/eslint-plugin": "^13.3.0-prerelease.
|
|
45
|
-
"@o3r/test-helpers": "^13.3.0-prerelease.
|
|
42
|
+
"@o3r/build-helpers": "^13.3.0-prerelease.6",
|
|
43
|
+
"@o3r/eslint-config": "^13.3.0-prerelease.6",
|
|
44
|
+
"@o3r/eslint-plugin": "^13.3.0-prerelease.6",
|
|
45
|
+
"@o3r/test-helpers": "^13.3.0-prerelease.6",
|
|
46
46
|
"@stylistic/eslint-plugin": "~5.4.0",
|
|
47
47
|
"@types/jest": "~29.5.2",
|
|
48
48
|
"@types/node": "~22.18.0",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
/**
|
|
3
|
+
* Register the best practices tool and resources.
|
|
4
|
+
* @param server
|
|
5
|
+
* @param resourcesPath
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerBestPracticesToolAndResources(server: McpServer, resourcesPath: string): Promise<[PromiseSettledResult<void>, PromiseSettledResult<void>]>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/best-practices/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AA6DjD;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qEAM7F"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerBestPracticesToolAndResources = registerBestPracticesToolAndResources;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const otter_1 = require("../utils/otter");
|
|
7
|
+
const resource_registry_1 = require("../utils/resource-registry");
|
|
8
|
+
const uri = `${otter_1.uriPrefix}best-practices`;
|
|
9
|
+
async function registerBestPracticesResources(server, bestPracticesResourcesPath) {
|
|
10
|
+
const content = await (0, promises_1.readFile)((0, node_path_1.join)(bestPracticesResourcesPath, 'output.md'), { encoding: 'utf8' });
|
|
11
|
+
resource_registry_1.resourceRegistry.set(uri, content);
|
|
12
|
+
server.registerResource('Best Practices Guide', uri, {
|
|
13
|
+
title: 'Otter Best Practices and Code Generation Guide',
|
|
14
|
+
description: await (0, promises_1.readFile)((0, node_path_1.join)(bestPracticesResourcesPath, 'description.md'), { encoding: 'utf8' }),
|
|
15
|
+
mimeType: 'text/markdown'
|
|
16
|
+
}, () => ({ contents: [{ uri, text: content }] }));
|
|
17
|
+
}
|
|
18
|
+
async function registerBestPracticesTool(server, bestPracticesResourcesPath) {
|
|
19
|
+
server.registerTool('get_best_practices', {
|
|
20
|
+
title: 'Get Otter Coding Best Practices Guide',
|
|
21
|
+
description: await (0, promises_1.readFile)((0, node_path_1.join)(bestPracticesResourcesPath, 'description.md'), { encoding: 'utf8' }),
|
|
22
|
+
annotations: {
|
|
23
|
+
readOnlyHint: true,
|
|
24
|
+
openWorldHint: false
|
|
25
|
+
}
|
|
26
|
+
}, () => ({
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: 'text',
|
|
30
|
+
text: resource_registry_1.resourceRegistry.get(uri) || 'Not found'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'resource_link',
|
|
34
|
+
name: 'Best practices',
|
|
35
|
+
uri
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Register the best practices tool and resources.
|
|
42
|
+
* @param server
|
|
43
|
+
* @param resourcesPath
|
|
44
|
+
*/
|
|
45
|
+
function registerBestPracticesToolAndResources(server, resourcesPath) {
|
|
46
|
+
const bestPracticesResourcesPath = (0, node_path_1.join)(resourcesPath, 'best-practices');
|
|
47
|
+
return Promise.allSettled([
|
|
48
|
+
registerBestPracticesResources(server, bestPracticesResourcesPath),
|
|
49
|
+
registerBestPracticesTool(server, bestPracticesResourcesPath)
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/best-practices/index.ts"],"names":[],"mappings":";;AA0EA,sFAMC;AAhFD,+CAE0B;AAC1B,yCAEmB;AAInB,0CAEwB;AACxB,kEAEoC;AAEpC,MAAM,GAAG,GAAG,GAAG,iBAAS,gBAAgB,CAAC;AAEzC,KAAK,UAAU,8BAA8B,CAAC,MAAiB,EAAE,0BAAkC;IACjG,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAQ,EAC5B,IAAA,gBAAI,EAAC,0BAA0B,EAAE,WAAW,CAAC,EAC7C,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB,CAAC;IACF,oCAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,CAAC,gBAAgB,CACrB,sBAAsB,EACtB,GAAG,EACH;QACE,KAAK,EAAE,gDAAgD;QACvD,WAAW,EAAE,MAAM,IAAA,mBAAQ,EACzB,IAAA,gBAAI,EAAC,0BAA0B,EAAE,gBAAgB,CAAC,EAClD,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB;QACD,QAAQ,EAAE,eAAe;KAC1B,EACD,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAC/C,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,yBAAyB,CAAC,MAAiB,EAAE,0BAAkC;IAC5F,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,MAAM,IAAA,mBAAQ,EACzB,IAAA,gBAAI,EAAC,0BAA0B,EAAE,gBAAgB,CAAC,EAClD,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,GAAG,EAAE,CAAC,CAAC;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,oCAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,WAAW;aAC/C;YACD;gBACE,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,gBAAgB;gBACtB,GAAG;aACJ;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,qCAAqC,CAAC,MAAiB,EAAE,aAAqB;IAC5F,MAAM,0BAA0B,GAAG,IAAA,gBAAI,EAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IACzE,OAAO,OAAO,CAAC,UAAU,CAAC;QACxB,8BAA8B,CAAC,MAAM,EAAE,0BAA0B,CAAC;QAClE,yBAAyB,CAAC,MAAM,EAAE,0BAA0B,CAAC;KAC9D,CAAC,CAAC;AACL,CAAC"}
|
package/src/mcp-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,SAAS,EACV,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,SAAS,EACV,MAAM,yCAAyC,CAAC;AAiBjD;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC,CAqB1D"}
|
package/src/mcp-server.js
CHANGED
|
@@ -4,10 +4,11 @@ exports.createMcpServer = createMcpServer;
|
|
|
4
4
|
const promises_1 = require("node:fs/promises");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
6
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
7
|
-
const best_practices_1 = require("./
|
|
8
|
-
const
|
|
7
|
+
const best_practices_1 = require("./best-practices");
|
|
8
|
+
const release_notes_1 = require("./release-notes");
|
|
9
9
|
const create_monorepo_with_app_1 = require("./tools/create-monorepo-with-app");
|
|
10
10
|
const find_repositories_using_otter_1 = require("./tools/find-repositories-using-otter");
|
|
11
|
+
const supported_releases_1 = require("./tools/supported-releases");
|
|
11
12
|
/**
|
|
12
13
|
* Create an MCP server instance.
|
|
13
14
|
*/
|
|
@@ -22,10 +23,14 @@ async function createMcpServer() {
|
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
25
|
const resourcesPath = (0, node_path_1.join)(__dirname, '..', 'resources');
|
|
25
|
-
await
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
await Promise.allSettled([
|
|
27
|
+
(0, release_notes_1.registerReleaseNotes)(server),
|
|
28
|
+
(0, best_practices_1.registerBestPracticesToolAndResources)(server, resourcesPath),
|
|
29
|
+
(0, create_monorepo_with_app_1.registerCreateMonorepoWithAppTool)(server, resourcesPath),
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/await-thenable -- Awaiting a non-promise value
|
|
31
|
+
(0, find_repositories_using_otter_1.registerGetRepositoriesUsingOtterTool)(server),
|
|
32
|
+
(0, supported_releases_1.registerSupportedReleaseTool)(server)
|
|
33
|
+
]);
|
|
29
34
|
return server;
|
|
30
35
|
}
|
|
31
36
|
//# sourceMappingURL=mcp-server.js.map
|
package/src/mcp-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":";;AA4BA,0CAqBC;AAjDD,+CAE0B;AAC1B,yCAEmB;AACnB,oEAEiD;AACjD,qDAE0B;AAC1B,mDAEyB;AACzB,+EAE0C;AAC1C,yFAE+C;AAC/C,mEAEoC;AAEpC;;GAEG;AACI,KAAK,UAAU,eAAe;IACnC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,IAAA,mBAAQ,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAsC,CAAC;IACzI,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI;QACJ,OAAO;QACP,YAAY,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;SACV;KACF,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IAEzD,MAAM,OAAO,CAAC,UAAU,CAAC;QACvB,IAAA,oCAAoB,EAAC,MAAM,CAAC;QAC5B,IAAA,sDAAqB,EAAC,MAAM,EAAE,aAAa,CAAC;QAC5C,IAAA,4DAAiC,EAAC,MAAM,EAAE,aAAa,CAAC;QACxD,6FAA6F;QAC7F,IAAA,qEAAqC,EAAC,MAAM,CAAC;QAC7C,IAAA,iDAA4B,EAAC,MAAM,CAAC;KACrC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp';
|
|
2
|
+
/**
|
|
3
|
+
* Register the release notes tool and resources.
|
|
4
|
+
* @param server
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerReleaseNotes(server: McpServer): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/release-notes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,sCAAsC,CAAC;AA+F9C;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,SAAS,iBAW3D"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerReleaseNotes = registerReleaseNotes;
|
|
4
|
+
const mcp_1 = require("@modelcontextprotocol/sdk/server/mcp");
|
|
5
|
+
const rest_1 = require("@octokit/rest");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const logger_1 = require("../utils/logger");
|
|
8
|
+
const otter_1 = require("../utils/otter");
|
|
9
|
+
const resource_registry_1 = require("../utils/resource-registry");
|
|
10
|
+
const getUri = (tagName) => `${otter_1.uriPrefix}release-notes/${tagName}`;
|
|
11
|
+
const formatContent = (releaseNote) => `# ${releaseNote.tag_name}\n\n${releaseNote.body}`;
|
|
12
|
+
async function getReleaseNotes(octokit) {
|
|
13
|
+
const minorsReleaseNotes = (await octokit.paginate(octokit.repos.listReleases, { owner: otter_1.owner, repo: otter_1.repo }))
|
|
14
|
+
.filter((release) => /^v\d+\.\d+\.0$/.test(release.tag_name));
|
|
15
|
+
const releaseNotes = new Map(minorsReleaseNotes.map((releaseNote) => [releaseNote.tag_name, releaseNote]));
|
|
16
|
+
releaseNotes.forEach((value) => resource_registry_1.resourceRegistry.set(getUri(value.tag_name), formatContent(value)));
|
|
17
|
+
return releaseNotes;
|
|
18
|
+
}
|
|
19
|
+
function registerReleaseNotesResources(server, releaseNotes) {
|
|
20
|
+
server.registerResource(`Otter release notes`, new mcp_1.ResourceTemplate(getUri('{tagName}'), {
|
|
21
|
+
list: undefined,
|
|
22
|
+
complete: {
|
|
23
|
+
tagName: (value) => {
|
|
24
|
+
const tagNames = Array.from(releaseNotes.keys());
|
|
25
|
+
return tagNames.filter((tagName) => tagName.startsWith(value));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}), {
|
|
29
|
+
description: `${otter_1.owner}/${otter_1.repo}'s release notes`,
|
|
30
|
+
mimeType: 'text/markdown'
|
|
31
|
+
}, (uri, { tagName }) => ({
|
|
32
|
+
contents: [({
|
|
33
|
+
uri: uri.href,
|
|
34
|
+
text: formatContent(releaseNotes.get(tagName)),
|
|
35
|
+
mimeType: 'text/markdown'
|
|
36
|
+
})]
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
function registerReleaseNotesTool(server, releaseNotes) {
|
|
40
|
+
server.registerTool('get_release_notes', {
|
|
41
|
+
title: 'Get Otter release notes',
|
|
42
|
+
description: 'Get the release notes for the latest Otter releases',
|
|
43
|
+
annotations: {
|
|
44
|
+
readOnlyHint: true,
|
|
45
|
+
openWorldHint: false
|
|
46
|
+
},
|
|
47
|
+
inputSchema: {
|
|
48
|
+
version: zod_1.z.string().optional()
|
|
49
|
+
.describe('The version of the release notes to get, if not provided all release notes will be returned. Format to use is vX.Y.0, e.g. v13.1.0')
|
|
50
|
+
}
|
|
51
|
+
}, ({ version }) => {
|
|
52
|
+
const targetedReleaseNote = version && releaseNotes.get(version);
|
|
53
|
+
return {
|
|
54
|
+
content: (targetedReleaseNote ? [targetedReleaseNote] : Array.from(releaseNotes.values()))
|
|
55
|
+
.flatMap((releaseNote) => {
|
|
56
|
+
const uri = getUri(releaseNote.tag_name);
|
|
57
|
+
return [{
|
|
58
|
+
type: 'text',
|
|
59
|
+
text: resource_registry_1.resourceRegistry.get(uri) || 'Not found'
|
|
60
|
+
}, {
|
|
61
|
+
type: 'resource_link',
|
|
62
|
+
name: `Release note ${releaseNote.tag_name}`,
|
|
63
|
+
uri
|
|
64
|
+
}];
|
|
65
|
+
})
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Register the release notes tool and resources.
|
|
71
|
+
* @param server
|
|
72
|
+
*/
|
|
73
|
+
async function registerReleaseNotes(server) {
|
|
74
|
+
if (!process.env.O3R_MCP_GITHUB_TOKEN) {
|
|
75
|
+
logger_1.logger.error('Missing O3R_MCP_GITHUB_TOKEN environment variable for get_release_notes tool');
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const octokit = new rest_1.Octokit({ auth: process.env.O3R_MCP_GITHUB_TOKEN });
|
|
79
|
+
const releaseNotes = await getReleaseNotes(octokit);
|
|
80
|
+
logger_1.logger.info(`Found ${releaseNotes.size} release notes`, releaseNotes);
|
|
81
|
+
registerReleaseNotesResources(server, releaseNotes);
|
|
82
|
+
registerReleaseNotesTool(server, releaseNotes);
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/release-notes/index.ts"],"names":[],"mappings":";;AAsGA,oDAWC;AAjHD,8DAG8C;AAC9C,wCAGuB;AACvB,6BAEa;AACb,4CAEyB;AACzB,0CAIwB;AACxB,kEAEoC;AAEpC,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,iBAAS,iBAAiB,OAAO,EAAE,CAAC;AAC3E,MAAM,aAAa,GAAG,CAAC,WAAoF,EAAE,EAAE,CAAC,KAAK,WAAW,CAAC,QAAQ,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC;AAEnK,KAAK,UAAU,eAAe,CAAC,OAAgB;IAC7C,MAAM,kBAAkB,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,EA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1D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;QACtC,eAAM,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAC;QAC7F,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,cAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACxE,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;IACpD,eAAM,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,IAAI,gBAAgB,EAAE,YAAY,CAAC,CAAC;IACtE,6BAA6B,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACpD,wBAAwB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-repositories-using-otter.d.ts","sourceRoot":"","sources":["../../../src/tools/find-repositories-using-otter.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"find-repositories-using-otter.d.ts","sourceRoot":"","sources":["../../../src/tools/find-repositories-using-otter.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AAkLjD;;;GAGG;AACH,wBAAgB,qCAAqC,CAAC,MAAM,EAAE,SAAS,QA4CtE"}
|
|
@@ -5,19 +5,15 @@ const node_fs_1 = require("node:fs");
|
|
|
5
5
|
const promises_1 = require("node:fs/promises");
|
|
6
6
|
const node_path_1 = require("node:path");
|
|
7
7
|
const rest_1 = require("@octokit/rest");
|
|
8
|
+
const zod_1 = require("zod");
|
|
8
9
|
const logger_1 = require("../utils/logger");
|
|
9
|
-
const
|
|
10
|
-
'o3r',
|
|
11
|
-
'ama-styling',
|
|
12
|
-
'ama-mfe',
|
|
13
|
-
'ama-sdk'
|
|
14
|
-
];
|
|
10
|
+
const otter_1 = require("../utils/otter");
|
|
15
11
|
async function listRepos(octokit) {
|
|
16
12
|
// We use several requests and not only one with OR
|
|
17
13
|
// because GitHub search API has some limitations in the query length and complexity
|
|
18
14
|
// Note: We can do only 10 searches per minute,
|
|
19
15
|
// so we should found another solution if we have more than 10 scopes to look for.
|
|
20
|
-
const search = (await Promise.all(OTTER_SCOPES
|
|
16
|
+
const search = (await Promise.all(otter_1.OTTER_SCOPES
|
|
21
17
|
.map(async (scope) => {
|
|
22
18
|
const repos = (await octokit.paginate(octokit.search.code, { q: `@${scope}/ filename:package.json`, per_page: 100 }));
|
|
23
19
|
// eslint-disable-next-line @typescript-eslint/naming-convention -- Naming convention from GitHub API
|
|
@@ -46,7 +42,7 @@ function findPackageJsonFiles(octokit) {
|
|
|
46
42
|
return tree.filter((t) => t.type === 'blob' && t.path.endsWith('package.json'));
|
|
47
43
|
};
|
|
48
44
|
}
|
|
49
|
-
const O3R_SCOPE_REGEX = new RegExp(`^@(?:${OTTER_SCOPES.join('|')})/`, 'gm');
|
|
45
|
+
const O3R_SCOPE_REGEX = new RegExp(`^@(?:${otter_1.OTTER_SCOPES.join('|')})/`, 'gm');
|
|
50
46
|
function dependsOnOtter(octokit) {
|
|
51
47
|
return async (repository, packageJsonPath) => {
|
|
52
48
|
const [owner, repo] = repository.full_name.split('/');
|
|
@@ -179,10 +175,13 @@ function registerGetRepositoriesUsingOtterTool(server) {
|
|
|
179
175
|
isLookingForRepos = false;
|
|
180
176
|
server.registerTool('get_repositories_using_otter', {
|
|
181
177
|
title: 'Get repositories using Otter dependencies',
|
|
182
|
-
description: `List all repositories that use Otter dependencies (${OTTER_SCOPES.map((scope) => `@${scope}`).join(' or ')}) in their package.json files.`,
|
|
178
|
+
description: `List all repositories that use Otter dependencies (${otter_1.OTTER_SCOPES.map((scope) => `@${scope}`).join(' or ')}) in their package.json files.`,
|
|
183
179
|
annotations: {
|
|
184
180
|
readOnlyHint: true,
|
|
185
181
|
openWorldHint: false
|
|
182
|
+
},
|
|
183
|
+
outputSchema: {
|
|
184
|
+
repositories: zod_1.z.array(zod_1.z.string()).describe('List of repositories using Otter dependencies')
|
|
186
185
|
}
|
|
187
186
|
}, () => ({
|
|
188
187
|
content: [
|
|
@@ -194,7 +193,10 @@ function registerGetRepositoriesUsingOtterTool(server) {
|
|
|
194
193
|
+ reposUsingOtter.sort().map((repo) => `- ${repo}`).join('\n')
|
|
195
194
|
: `No repositories were found to use Otter dependencies.`
|
|
196
195
|
}
|
|
197
|
-
]
|
|
196
|
+
],
|
|
197
|
+
structuredContent: {
|
|
198
|
+
repositories: reposUsingOtter
|
|
199
|
+
}
|
|
198
200
|
}));
|
|
199
201
|
}
|
|
200
202
|
//# sourceMappingURL=find-repositories-using-otter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-repositories-using-otter.js","sourceRoot":"","sources":["../../../src/tools/find-repositories-using-otter.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"find-repositories-using-otter.js","sourceRoot":"","sources":["../../../src/tools/find-repositories-using-otter.ts"],"names":[],"mappings":";;AAmMA,sFA4CC;AA/OD,qCAEiB;AACjB,+CAI0B;AAC1B,yCAEmB;AAInB,wCAEuB;AACvB,6BAEa;AACb,4CAEyB;AACzB,0CAEwB;AAExB,KAAK,UAAU,SAAS,CAAC,OAAgB;IACvC,mDAAmD;IACnD,oFAAoF;IACpF,+CAA+C;IAC/C,kFAAkF;IAClF,MAAM,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,oBAAY;SAC3C,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACnB,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,KAAK,yBAAyB,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QACtH,qGAAqG;QACrG,MA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ACxB,CAAC,CAAC,sDAAsD;0BACtD,eAAe,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;oBAC9D,CAAC,CAAC,uDAAuD;aAC5D;SACF;QACD,iBAAiB,EAAE;YACjB,YAAY,EAAE,eAAe;SAC9B;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
/**
|
|
3
|
+
* Register the create monorepo with app tool.
|
|
4
|
+
* @param server
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerSupportedReleaseTool(server: McpServer): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=supported-releases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported-releases.d.ts","sourceRoot":"","sources":["../../../src/tools/supported-releases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AAwBjD;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCnF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerSupportedReleaseTool = registerSupportedReleaseTool;
|
|
4
|
+
const rest_1 = require("@octokit/rest");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const logger_1 = require("../utils/logger");
|
|
7
|
+
const otter_1 = require("../utils/otter");
|
|
8
|
+
async function getSupportedReleases(octokit) {
|
|
9
|
+
const supportedReleases = (await octokit.paginate(octokit.repos.listBranches, { owner: otter_1.owner, repo: otter_1.repo }))
|
|
10
|
+
.filter((branch) => /^release\/\d+\.\d+$/.test(branch.name))
|
|
11
|
+
.map((branch) => branch.name.replace('release/', ''));
|
|
12
|
+
logger_1.logger.info(`Supported releases:\n${supportedReleases.map((r) => ` - ${r}`).join('\n')}`);
|
|
13
|
+
return supportedReleases;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Register the create monorepo with app tool.
|
|
17
|
+
* @param server
|
|
18
|
+
*/
|
|
19
|
+
async function registerSupportedReleaseTool(server) {
|
|
20
|
+
if (!process.env.O3R_MCP_GITHUB_TOKEN) {
|
|
21
|
+
logger_1.logger.error('Missing O3R_MCP_GITHUB_TOKEN environment variable for get_supported_releases tool');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const octokit = new rest_1.Octokit({ auth: process.env.O3R_MCP_GITHUB_TOKEN });
|
|
25
|
+
const supportedReleases = await getSupportedReleases(octokit);
|
|
26
|
+
server.registerTool('get_supported_releases', {
|
|
27
|
+
title: 'Get Otter Supported Releases',
|
|
28
|
+
description: 'Get the list of Otter supported releases',
|
|
29
|
+
outputSchema: {
|
|
30
|
+
releases: zod_1.z.array(zod_1.z.string()).describe('List of supported releases')
|
|
31
|
+
}
|
|
32
|
+
}, () => {
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: 'text',
|
|
37
|
+
text: `The supported releases for Otter are: \n${supportedReleases.map((r) => ` - ${r}`).join('\n')}`
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
structuredContent: {
|
|
41
|
+
releases: supportedReleases
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=supported-releases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported-releases.js","sourceRoot":"","sources":["../../../src/tools/supported-releases.ts"],"names":[],"mappings":";;AA8BA,oEAgCC;AA3DD,wCAEuB;AACvB,6BAEa;AACb,4CAEyB;AACzB,0CAGwB;AAExB,KAAK,UAAU,oBAAoB,CA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AAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,2CAA2C,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;iBACvG;aACF;YACD,iBAAiB,EAAE;gBACjB,QAAQ,EAAE,iBAAiB;aAC5B;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Otter repository organization
|
|
3
|
+
*/
|
|
4
|
+
export declare const owner = "AmadeusITGroup";
|
|
5
|
+
/**
|
|
6
|
+
* Otter repository name
|
|
7
|
+
*/
|
|
8
|
+
export declare const repo = "otter";
|
|
9
|
+
/**
|
|
10
|
+
* Otter related scopes
|
|
11
|
+
*/
|
|
12
|
+
export declare const OTTER_SCOPES: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Otter URI prefix
|
|
15
|
+
*/
|
|
16
|
+
export declare const uriPrefix = "o3r://";
|
|
17
|
+
//# sourceMappingURL=otter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otter.d.ts","sourceRoot":"","sources":["../../../src/utils/otter.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,KAAK,mBAAmB,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,IAAI,UAAU,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,YAAY,UAKxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uriPrefix = exports.OTTER_SCOPES = exports.repo = exports.owner = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Otter repository organization
|
|
6
|
+
*/
|
|
7
|
+
exports.owner = 'AmadeusITGroup';
|
|
8
|
+
/**
|
|
9
|
+
* Otter repository name
|
|
10
|
+
*/
|
|
11
|
+
exports.repo = 'otter';
|
|
12
|
+
/**
|
|
13
|
+
* Otter related scopes
|
|
14
|
+
*/
|
|
15
|
+
exports.OTTER_SCOPES = [
|
|
16
|
+
'o3r',
|
|
17
|
+
'ama-styling',
|
|
18
|
+
'ama-mfe',
|
|
19
|
+
'ama-sdk'
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Otter URI prefix
|
|
23
|
+
*/
|
|
24
|
+
exports.uriPrefix = 'o3r://';
|
|
25
|
+
//# sourceMappingURL=otter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otter.js","sourceRoot":"","sources":["../../../src/utils/otter.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,KAAK,GAAG,gBAAgB,CAAC;AAEtC;;GAEG;AACU,QAAA,IAAI,GAAG,OAAO,CAAC;AAE5B;;GAEG;AACU,QAAA,YAAY,GAAG;IAC1B,KAAK;IACL,aAAa;IACb,SAAS;IACT,SAAS;CACV,CAAC;AAEF;;GAEG;AACU,QAAA,SAAS,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-registry.d.ts","sourceRoot":"","sources":["../../../src/utils/resource-registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,qBAA4B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resourceRegistry = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A registry to store resources in memory and retrieve them by their URI.
|
|
6
|
+
* key: resource URI
|
|
7
|
+
* value: resource content
|
|
8
|
+
*/
|
|
9
|
+
exports.resourceRegistry = new Map();
|
|
10
|
+
//# sourceMappingURL=resource-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-registry.js","sourceRoot":"","sources":["../../../src/utils/resource-registry.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
/**
|
|
3
|
-
* Register resources for best practices
|
|
4
|
-
* @param server
|
|
5
|
-
* @param resourcesPath
|
|
6
|
-
*/
|
|
7
|
-
export declare function registerBestPracticesResources(server: McpServer, resourcesPath: string): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=best-practices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"best-practices.d.ts","sourceRoot":"","sources":["../../../src/instructions/best-practices.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AAEjD;;;;GAIG;AACH,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB5G"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerBestPracticesResources = registerBestPracticesResources;
|
|
4
|
-
const promises_1 = require("node:fs/promises");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
/**
|
|
7
|
-
* Register resources for best practices
|
|
8
|
-
* @param server
|
|
9
|
-
* @param resourcesPath
|
|
10
|
-
*/
|
|
11
|
-
async function registerBestPracticesResources(server, resourcesPath) {
|
|
12
|
-
const bestPracticesResourcesPath = (0, node_path_1.join)(resourcesPath, 'best-practices');
|
|
13
|
-
const name = 'instructions';
|
|
14
|
-
const uri = `${name}://best-practices`;
|
|
15
|
-
server.registerResource(name, uri, {
|
|
16
|
-
title: 'Otter Best Practices and Code Generation Guide',
|
|
17
|
-
description: await (0, promises_1.readFile)((0, node_path_1.join)(bestPracticesResourcesPath, 'description.md'), { encoding: 'utf8' }),
|
|
18
|
-
mimeType: 'text/markdown'
|
|
19
|
-
}, async () => {
|
|
20
|
-
const text = await (0, promises_1.readFile)((0, node_path_1.join)(bestPracticesResourcesPath, 'output.md'), { encoding: 'utf8' });
|
|
21
|
-
return { contents: [{ uri, text }] };
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=best-practices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"best-practices.js","sourceRoot":"","sources":["../../../src/instructions/best-practices.ts"],"names":[],"mappings":";;AAeA,wEAwBC;AAvCD,+CAE0B;AAC1B,yCAEmB;AAKnB;;;;GAIG;AACI,KAAK,UAAU,8BAA8B,CAAC,MAAiB,EAAE,aAAqB;IAC3F,MAAM,0BAA0B,GAAG,IAAA,gBAAI,EAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IACzE,MAAM,IAAI,GAAG,cAAc,CAAC;IAC5B,MAAM,GAAG,GAAG,GAAG,IAAI,mBAAmB,CAAC;IACvC,MAAM,CAAC,gBAAgB,CACrB,IAAI,EACJ,GAAG,EACH;QACE,KAAK,EAAE,gDAAgD;QACvD,WAAW,EAAE,MAAM,IAAA,mBAAQ,EACzB,IAAA,gBAAI,EAAC,0BAA0B,EAAE,gBAAgB,CAAC,EAClD,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB;QACD,QAAQ,EAAE,eAAe;KAC1B,EACD,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EACzB,IAAA,gBAAI,EAAC,0BAA0B,EAAE,WAAW,CAAC,EAC7C,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB,CAAC;QAEF,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACvC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
/**
|
|
3
|
-
* Register the best practices tool.
|
|
4
|
-
* @param server
|
|
5
|
-
* @param resourcesPath
|
|
6
|
-
*/
|
|
7
|
-
export declare function registerBestPracticesTool(server: McpServer, resourcesPath: string): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=best-practices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"best-practices.d.ts","sourceRoot":"","sources":["../../../src/tools/best-practices.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AAEjD;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BvG"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerBestPracticesTool = registerBestPracticesTool;
|
|
4
|
-
const promises_1 = require("node:fs/promises");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
6
|
-
/**
|
|
7
|
-
* Register the best practices tool.
|
|
8
|
-
* @param server
|
|
9
|
-
* @param resourcesPath
|
|
10
|
-
*/
|
|
11
|
-
async function registerBestPracticesTool(server, resourcesPath) {
|
|
12
|
-
const bestPracticesResourcesPath = (0, node_path_1.join)(resourcesPath, 'best-practices');
|
|
13
|
-
server.registerTool('get_best_practices', {
|
|
14
|
-
title: 'Get Otter Coding Best Practices Guide',
|
|
15
|
-
description: await (0, promises_1.readFile)((0, node_path_1.join)(bestPracticesResourcesPath, 'description.md'), { encoding: 'utf8' }),
|
|
16
|
-
annotations: {
|
|
17
|
-
readOnlyHint: true,
|
|
18
|
-
openWorldHint: false
|
|
19
|
-
}
|
|
20
|
-
}, async () => {
|
|
21
|
-
const bestPractices = await (0, promises_1.readFile)((0, node_path_1.join)(bestPracticesResourcesPath, 'output.md'), { encoding: 'utf8' });
|
|
22
|
-
const developer = await (0, promises_1.readFile)((0, node_path_1.join)(resourcesPath, 'developer.md'), { encoding: 'utf8' });
|
|
23
|
-
const text = [developer, bestPractices].join('\n\n');
|
|
24
|
-
return { content: [{ type: 'text', text }] };
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=best-practices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"best-practices.js","sourceRoot":"","sources":["../../../src/tools/best-practices.ts"],"names":[],"mappings":";;AAeA,8DA+BC;AA9CD,+CAE0B;AAC1B,yCAEmB;AAKnB;;;;GAIG;AACI,KAAK,UAAU,yBAAyB,CAAC,MAAiB,EAAE,aAAqB;IACtF,MAAM,0BAA0B,GAAG,IAAA,gBAAI,EAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IAEzE,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,MAAM,IAAA,mBAAQ,EACzB,IAAA,gBAAI,EAAC,0BAA0B,EAAE,gBAAgB,CAAC,EAClD,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,IAAI,EAAE;QACT,MAAM,aAAa,GAAG,MAAM,IAAA,mBAAQ,EAClC,IAAA,gBAAI,EAAC,0BAA0B,EAAE,WAAW,CAAC,EAC7C,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB,CAAC;QACF,MAAM,SAAS,GAAG,MAAM,IAAA,mBAAQ,EAC9B,IAAA,gBAAI,EAAC,aAAa,EAAE,cAAc,CAAC,EACnC,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB,CAAC;QAEF,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC/C,CAAC,CACF,CAAC;AACJ,CAAC"}
|