@ama-mcp/github 13.3.0-prerelease.13 → 13.3.0-prerelease.17
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 +3 -0
- package/package.json +8 -8
- package/src/find-repositories-using-library/index.d.ts +5 -12
- package/src/find-repositories-using-library/index.d.ts.map +1 -1
- package/src/find-repositories-using-library/index.js +48 -86
- package/src/find-repositories-using-library/index.js.map +1 -1
- package/src/release-notes/index.d.ts +5 -8
- package/src/release-notes/index.d.ts.map +1 -1
- package/src/release-notes/index.js +3 -2
- package/src/release-notes/index.js.map +1 -1
- package/src/supported-releases/index.d.ts +4 -3
- package/src/supported-releases/index.d.ts.map +1 -1
- package/src/supported-releases/index.js +3 -2
- package/src/supported-releases/index.js.map +1 -1
- package/src/utils.d.ts +8 -0
- package/src/utils.d.ts.map +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-mcp/github",
|
|
3
|
-
"version": "13.3.0-prerelease.
|
|
3
|
+
"version": "13.3.0-prerelease.17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"description": "This module provides a set of MCP tools to retrieve information from GitHub",
|
|
7
|
+
"description": "Experimental package — This module provides a set of MCP tools to retrieve information from GitHub",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"mcp",
|
|
10
10
|
"github",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"compile": "tsc -b ./tsconfig.build.json && yarn cpy package.json dist && patch-package-json-main"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@ama-mcp/core": "^13.3.0-prerelease.
|
|
33
|
+
"@ama-mcp/core": "^13.3.0-prerelease.17",
|
|
34
34
|
"@modelcontextprotocol/sdk": "~1.19.0",
|
|
35
35
|
"@octokit/rest": "^22.0.0",
|
|
36
36
|
"zod": "~3.25.76"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"tslib": "^2.6.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@ama-mcp/core": "^13.3.0-prerelease.
|
|
42
|
+
"@ama-mcp/core": "^13.3.0-prerelease.17",
|
|
43
43
|
"@angular/common": "~20.3.0",
|
|
44
44
|
"@angular/compiler": "~20.3.0",
|
|
45
45
|
"@angular/compiler-cli": "~20.3.0",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"@nx/eslint-plugin": "~21.6.0",
|
|
53
53
|
"@nx/jest": "~21.6.0",
|
|
54
54
|
"@nx/js": "~21.6.0",
|
|
55
|
-
"@o3r/build-helpers": "^13.3.0-prerelease.
|
|
56
|
-
"@o3r/eslint-config": "^13.3.0-prerelease.
|
|
57
|
-
"@o3r/eslint-plugin": "^13.3.0-prerelease.
|
|
58
|
-
"@o3r/test-helpers": "^13.3.0-prerelease.
|
|
55
|
+
"@o3r/build-helpers": "^13.3.0-prerelease.17",
|
|
56
|
+
"@o3r/eslint-config": "^13.3.0-prerelease.17",
|
|
57
|
+
"@o3r/eslint-plugin": "^13.3.0-prerelease.17",
|
|
58
|
+
"@o3r/test-helpers": "^13.3.0-prerelease.17",
|
|
59
59
|
"@octokit/rest": "~22.0.0",
|
|
60
60
|
"@stylistic/eslint-plugin": "~5.4.0",
|
|
61
61
|
"@types/jest": "~29.5.2",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CacheToolOptions, type ToolDefinition } from '@ama-mcp/core';
|
|
2
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import type { GithubToolOptions } from '../utils';
|
|
4
4
|
/**
|
|
5
5
|
* Options for the tool get_repositories_using_library
|
|
6
|
+
* @experimental
|
|
6
7
|
*/
|
|
7
|
-
export interface GetRepositoriesUsingLibraryOptions extends GithubToolOptions, ToolDefinition {
|
|
8
|
+
export interface GetRepositoriesUsingLibraryOptions extends CacheToolOptions, GithubToolOptions, ToolDefinition {
|
|
8
9
|
/**
|
|
9
10
|
* Scopes to look for when searching for repositories
|
|
10
11
|
* (e.g. for @ama-mcp/github, the scope is ama-mcp)
|
|
@@ -17,24 +18,16 @@ export interface GetRepositoriesUsingLibraryOptions extends GithubToolOptions, T
|
|
|
17
18
|
* @example 'Otter'
|
|
18
19
|
*/
|
|
19
20
|
libraryName: string;
|
|
20
|
-
/**
|
|
21
|
-
* Path to cache the results
|
|
22
|
-
*/
|
|
23
|
-
cachePath?: string;
|
|
24
21
|
/**
|
|
25
22
|
* Whether to use the cached results if available
|
|
26
23
|
*/
|
|
27
24
|
disableCache?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Maximum age in days of the cache for a repository to be considered valid
|
|
30
|
-
*/
|
|
31
|
-
cacheMaxAge?: number;
|
|
32
25
|
}
|
|
33
26
|
/**
|
|
34
27
|
* Register the tool to get repositories using a configured library.
|
|
35
28
|
* @param server
|
|
36
29
|
* @param options
|
|
37
|
-
* @
|
|
30
|
+
* @experimental
|
|
38
31
|
*/
|
|
39
|
-
export declare function registerGetRepositoriesUsingLibraryTool(server: McpServer, options: GetRepositoriesUsingLibraryOptions
|
|
32
|
+
export declare function registerGetRepositoriesUsingLibraryTool(server: McpServer, options: GetRepositoriesUsingLibraryOptions): void;
|
|
40
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/find-repositories-using-library/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/find-repositories-using-library/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,gBAAgB,EAGrB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AAOjD,OAAO,KAAK,EACV,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,kCAAmC,SAAQ,gBAAgB,EAAE,iBAAiB,EAAE,cAAc;IAC7G;;;;;OAKG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AA+HD;;;;;GAKG;AACH,wBAAgB,uCAAuC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kCAAkC,QAqErH"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerGetRepositoriesUsingLibraryTool = registerGetRepositoriesUsingLibraryTool;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const promises_1 = require("node:fs/promises");
|
|
6
4
|
const node_path_1 = require("node:path");
|
|
7
5
|
const core_1 = require("@ama-mcp/core");
|
|
8
6
|
const rest_1 = require("@octokit/rest");
|
|
@@ -18,13 +16,13 @@ async function listRepos(octokit, options, logger) {
|
|
|
18
16
|
// eslint-disable-next-line @typescript-eslint/naming-convention -- Naming convention from GitHub API
|
|
19
17
|
.map(({ repository: { name, full_name, fork, archived, default_branch } }) => ({ name, full_name, fork, archived, default_branch }))
|
|
20
18
|
.filter((repo) => !repo.archived && !repo.fork);
|
|
21
|
-
logger
|
|
19
|
+
logger.info?.(`Found ${repos.length} repositories with references to @${scope} in package.json`);
|
|
22
20
|
return repos;
|
|
23
21
|
}))).filter((result) => result.status === 'fulfilled')
|
|
24
22
|
.flatMap((result) => result.value);
|
|
25
23
|
// Deduplicate repositories in case of multiple scopes matching the same repository
|
|
26
24
|
const repositories = Array.from(new Map(search.map((repo) => [repo.full_name, repo])).values());
|
|
27
|
-
logger
|
|
25
|
+
logger.info?.(`Found ${repositories.length} repositories with references to ${options.libraryName}`);
|
|
28
26
|
return repositories;
|
|
29
27
|
}
|
|
30
28
|
function findPackageJsonFiles(octokit) {
|
|
@@ -63,54 +61,25 @@ function dependsOnLibrary(octokit, options) {
|
|
|
63
61
|
].some((dep) => scopeRegex.test(dep));
|
|
64
62
|
};
|
|
65
63
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const now = Date.now();
|
|
70
|
-
const maxAge = convertDaysToMs(options.cacheMaxAge || DEFAULT_AMA_MCP_CACHE_MAX_AGE);
|
|
71
|
-
Object.entries(cachedRepos).forEach(([repo, { when }]) => {
|
|
72
|
-
const whenDate = new Date(when);
|
|
73
|
-
if (Number.isNaN(whenDate.getTime()) || (now - whenDate.getTime()) > maxAge) {
|
|
74
|
-
logger.info?.(`Cache for repository ${repo} is outdated or invalid, removing it`);
|
|
75
|
-
delete cachedRepos[repo];
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
async function findRepositoriesUsingLibrary(octokit, reposUsingLibrary, options, logger = core_1.logger) {
|
|
80
|
-
const { cachePath = (0, node_path_1.resolve)('.cache', '@ama-mcp', `repos-using-${options.libraryName.toLowerCase().replaceAll(/\s+/g, '-')}.json`), disableCache = false } = options;
|
|
81
|
-
let cachedRepos = {};
|
|
82
|
-
if (disableCache) {
|
|
83
|
-
logger?.info?.('Ignoring cached repositories as caching is disabled');
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
try {
|
|
87
|
-
cachedRepos = JSON.parse(await (0, promises_1.readFile)(cachePath, { encoding: 'utf8' }));
|
|
88
|
-
validateCache(cachedRepos, options, logger);
|
|
89
|
-
reposUsingLibrary.push(...Object.entries(cachedRepos).filter(([, usesLibrary]) => usesLibrary).map(([repo]) => repo));
|
|
90
|
-
logger?.info?.(`Loaded ${Object.keys(cachedRepos).length} cached repositories, ${reposUsingLibrary.length} of them using ${options.libraryName} dependencies.`);
|
|
91
|
-
}
|
|
92
|
-
catch (e) {
|
|
93
|
-
logger?.info?.(`No cache file found, starting fresh search for repositories using ${options.libraryName} dependencies.`, e);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const repositories = (await listRepos(octokit, options)).filter((r) => !cachedRepos[r.full_name]?.dependsOn);
|
|
64
|
+
async function findRepositoriesUsingLibrary(cacheManager, octokit, options, logger) {
|
|
65
|
+
await cacheManager.initialize();
|
|
66
|
+
const repositories = (await listRepos(octokit, options, logger)).filter((r) => !cacheManager.get(r.full_name)?.dependsOn);
|
|
97
67
|
const findPackageJsonFilesInRepo = findPackageJsonFiles(octokit);
|
|
98
68
|
const dependsOnLibraryInRepo = dependsOnLibrary(octokit, options);
|
|
99
69
|
await Promise.allSettled(repositories.map(async (repository) => {
|
|
100
|
-
logger
|
|
70
|
+
logger.debug?.(`Checking repository ${repository.full_name}...`);
|
|
101
71
|
const packageJsonFiles = [];
|
|
102
72
|
try {
|
|
103
73
|
packageJsonFiles.push(...await findPackageJsonFilesInRepo(repository));
|
|
104
74
|
}
|
|
105
75
|
catch (e) {
|
|
106
|
-
logger
|
|
76
|
+
logger.warn?.(`Failed to list package.json files in repository ${repository.full_name}`, e);
|
|
107
77
|
}
|
|
108
78
|
if (packageJsonFiles.length === 0) {
|
|
109
79
|
logger?.info?.(`No package.json files found in repository ${repository.full_name}`);
|
|
110
|
-
|
|
111
|
-
dependsOn: false
|
|
112
|
-
|
|
113
|
-
};
|
|
80
|
+
await cacheManager.set(repository.full_name, {
|
|
81
|
+
dependsOn: false
|
|
82
|
+
});
|
|
114
83
|
return;
|
|
115
84
|
}
|
|
116
85
|
try {
|
|
@@ -120,15 +89,13 @@ async function findRepositoriesUsingLibrary(octokit, reposUsingLibrary, options,
|
|
|
120
89
|
depFound = await dependsOnLibraryInRepo(repository, packageJsonFile.path);
|
|
121
90
|
}
|
|
122
91
|
catch (e) {
|
|
123
|
-
logger
|
|
92
|
+
logger.error?.(`Failed to check package.json file at ${packageJsonFile.path} in repository ${repository.full_name}`, e);
|
|
124
93
|
}
|
|
125
94
|
if (depFound) {
|
|
126
|
-
reposUsingLibrary.push(repository.full_name);
|
|
127
95
|
logger?.info?.(`Repository ${repository.full_name} uses ${options.libraryName} dependencies`);
|
|
128
|
-
|
|
129
|
-
dependsOn: true
|
|
130
|
-
|
|
131
|
-
};
|
|
96
|
+
await cacheManager.set(repository.full_name, {
|
|
97
|
+
dependsOn: true
|
|
98
|
+
});
|
|
132
99
|
}
|
|
133
100
|
else {
|
|
134
101
|
throw new Error(`No ${options.libraryName} dependencies found in this package.json`);
|
|
@@ -136,44 +103,33 @@ async function findRepositoriesUsingLibrary(octokit, reposUsingLibrary, options,
|
|
|
136
103
|
}));
|
|
137
104
|
}
|
|
138
105
|
catch { }
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}));
|
|
144
|
-
logger?.info?.(`Found ${reposUsingLibrary.length} repositories using ${options.libraryName} dependencies`);
|
|
145
|
-
if (disableCache) {
|
|
146
|
-
logger?.info?.('Not updating cache as caching is disabled');
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
const cacheFolderPath = (0, node_path_1.dirname)(cachePath);
|
|
150
|
-
if (!(0, node_fs_1.existsSync)((0, node_path_1.dirname)(cacheFolderPath))) {
|
|
151
|
-
await (0, promises_1.mkdir)(cacheFolderPath, { recursive: true });
|
|
106
|
+
if (!cacheManager.get(repository.full_name)) {
|
|
107
|
+
await cacheManager.set(repository.full_name, {
|
|
108
|
+
dependsOn: false
|
|
109
|
+
});
|
|
152
110
|
}
|
|
153
|
-
|
|
154
|
-
await (0, promises_1.writeFile)(cachePath, JSON.stringify(cachedRepos));
|
|
155
|
-
}
|
|
156
|
-
catch (e) {
|
|
157
|
-
logger?.error?.('Failed to update cache', e);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
111
|
+
}));
|
|
160
112
|
}
|
|
161
113
|
/**
|
|
162
114
|
* Register the tool to get repositories using a configured library.
|
|
163
115
|
* @param server
|
|
164
116
|
* @param options
|
|
165
|
-
* @
|
|
117
|
+
* @experimental
|
|
166
118
|
*/
|
|
167
|
-
function registerGetRepositoriesUsingLibraryTool(server, options
|
|
119
|
+
function registerGetRepositoriesUsingLibraryTool(server, options) {
|
|
168
120
|
const { githubToken, libraryName, toolName = `get_repositories_using_${options.libraryName.toLowerCase().replaceAll(/\s+/g, '_')}`, toolTitle = `Get repositories using ${options.libraryName} dependencies`, toolDescription = `List all repositories that use ${options.libraryName} dependencies (${options.scopes.map((scope) => `@${scope}`).join(' or ')}) in their package.json files.` } = options;
|
|
121
|
+
const logger = options.logger ?? new core_1.MCPLogger(toolName, options.logLevel);
|
|
169
122
|
if (!githubToken) {
|
|
170
|
-
logger
|
|
123
|
+
logger.error?.(`Missing githubToken for ${toolName}`);
|
|
171
124
|
return;
|
|
172
125
|
}
|
|
173
126
|
const octokit = new rest_1.Octokit({ auth: githubToken });
|
|
127
|
+
const cacheManager = new core_1.CacheManager({
|
|
128
|
+
cacheFilePath: (0, node_path_1.resolve)('.cache', '@ama-mcp', `repos-using-${options.libraryName.toLowerCase().replaceAll(/\s+/g, '-')}.json`),
|
|
129
|
+
...options
|
|
130
|
+
});
|
|
174
131
|
let isLookingForRepos = true;
|
|
175
|
-
|
|
176
|
-
findRepositoriesUsingLibrary(octokit, reposUsingLibrary, options).catch((e) => {
|
|
132
|
+
findRepositoriesUsingLibrary(cacheManager, octokit, options, logger).catch((e) => {
|
|
177
133
|
logger?.error?.(`Error finding repositories using ${libraryName}:`, e);
|
|
178
134
|
});
|
|
179
135
|
isLookingForRepos = false;
|
|
@@ -187,20 +143,26 @@ function registerGetRepositoriesUsingLibraryTool(server, options, logger) {
|
|
|
187
143
|
outputSchema: {
|
|
188
144
|
repositories: zod_1.z.array(zod_1.z.string()).describe(`List of repositories depending on ${libraryName}`)
|
|
189
145
|
}
|
|
190
|
-
}, () =>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
:
|
|
146
|
+
}, () => {
|
|
147
|
+
const reposUsingLibrary = cacheManager
|
|
148
|
+
.getEntries()
|
|
149
|
+
.filter(([, entry]) => entry.dependsOn)
|
|
150
|
+
.map(([repo]) => repo);
|
|
151
|
+
return {
|
|
152
|
+
content: [
|
|
153
|
+
{
|
|
154
|
+
type: 'text',
|
|
155
|
+
text: (isLookingForRepos ? 'I did not finish to look for repositories. For the moment:\n' : '')
|
|
156
|
+
+ reposUsingLibrary.length
|
|
157
|
+
? `The following repositories use ${libraryName} dependencies:\n`
|
|
158
|
+
+ reposUsingLibrary.sort().map((repo) => `- ${repo}`).join('\n')
|
|
159
|
+
: `No repositories found using ${libraryName} dependencies.`
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
structuredContent: {
|
|
163
|
+
repositories: reposUsingLibrary
|
|
199
164
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
repositories: reposUsingLibrary
|
|
203
|
-
}
|
|
204
|
-
}));
|
|
165
|
+
};
|
|
166
|
+
});
|
|
205
167
|
}
|
|
206
168
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/find-repositories-using-library/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/find-repositories-using-library/index.ts"],"names":[],"mappings":";;AAiLA,0FAqEC;AAtPD,yCAEmB;AACnB,wCAMuB;AAIvB,wCAEuB;AACvB,6BAEa;AAoCb,KAAK,UAAU,SAAS,CAAC,OAAgB,EAAE,OAA2C,EAAE,MAAc;IACpG,mDAAmD;IACnD,oFAAoF;IACpF,+CAA+C;IAC/C,kFAAkF;IAClF,MAAM,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM;SACpD,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACnB,MAAM,KAAK,GAAG,CAAC,MAAM,OA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AkC,WAAW,kBAAkB;8BAC/D,iBAAiB,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;wBAChE,CAAC,CAAC,+BAA+B,WAAW,gBAAgB;iBAC/D;aACF;YACD,iBAAiB,EAAE;gBACjB,YAAY,EAAE,iBAAiB;aAChC;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ResourceToolOptions, ToolDefinition } from '@ama-mcp/core';
|
|
2
2
|
import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import type { GitHubRepositoryToolOptions } from '../utils';
|
|
4
4
|
/**
|
|
5
5
|
* Options for the tool to get release notes
|
|
6
|
+
* @experimental
|
|
6
7
|
*/
|
|
7
|
-
export interface ReleaseNotesToolOptions extends GitHubRepositoryToolOptions, ToolDefinition {
|
|
8
|
+
export interface ReleaseNotesToolOptions extends Partial<ResourceToolOptions>, GitHubRepositoryToolOptions, ToolDefinition {
|
|
8
9
|
/**
|
|
9
10
|
* Optional library name
|
|
10
11
|
*/
|
|
11
12
|
libraryName?: string;
|
|
12
|
-
/**
|
|
13
|
-
* URI prefix for the resources
|
|
14
|
-
*/
|
|
15
|
-
uriPrefix?: string;
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Register the release notes tool and resources.
|
|
19
16
|
* @param server
|
|
20
17
|
* @param options
|
|
21
|
-
* @
|
|
18
|
+
* @experimental
|
|
22
19
|
*/
|
|
23
|
-
export declare function registerReleaseNotes(server: McpServer, options: ReleaseNotesToolOptions
|
|
20
|
+
export declare function registerReleaseNotes(server: McpServer, options: ReleaseNotesToolOptions): Promise<void>;
|
|
24
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/release-notes/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/release-notes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,yCAAyC,CAAC;AAQjD,OAAO,KAAK,EACV,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,OAAO,CAAC,mBAAmB,CAAC,EAAE,2BAA2B,EAAE,cAAc;IACxH;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAgGD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,uBAAuB,iBAgB7F"}
|
|
@@ -75,10 +75,11 @@ function registerReleaseNotesTool(server, releaseNotes, options) {
|
|
|
75
75
|
* Register the release notes tool and resources.
|
|
76
76
|
* @param server
|
|
77
77
|
* @param options
|
|
78
|
-
* @
|
|
78
|
+
* @experimental
|
|
79
79
|
*/
|
|
80
|
-
async function registerReleaseNotes(server, options
|
|
80
|
+
async function registerReleaseNotes(server, options) {
|
|
81
81
|
const { githubToken, libraryName = `${options.owner}/${options.repo}` } = options;
|
|
82
|
+
const logger = options.logger ?? new core_1.MCPLogger(`release-notes-${libraryName}`, options.logLevel);
|
|
82
83
|
if (!githubToken) {
|
|
83
84
|
logger.error?.(`Missing githubToken for release notes tool and resources for ${libraryName}`);
|
|
84
85
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/release-notes/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/release-notes/index.ts"],"names":[],"mappings":";;AAoIA,oDAgBC;A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AE;wBACD,IAAI,EAAE,eAAe;wBACrB,IAAI,EAAE,gBAAgB,WAAW,CAAC,QAAQ,EAAE;wBAC5C,GAAG;qBACJ,CAAC,CAAC;YACL,CAAC,CAAC;SACL,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CAAC,MAAiB,EAAE,OAAgC;IAC5F,MAAM,EACJ,WAAW,EACX,WAAW,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,EAAE,EACjD,GAAG,OAAO,CAAC;IACZ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,gBAAS,CAAC,iBAAiB,WAAW,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,CAAC,KAAK,EAAE,CAAC,gEAAgE,WAAW,EAAE,CAAC,CAAC;QAC9F,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,cAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,YAAY,CAAC,IAAI,sBAAsB,WAAW,EAAE,EAAE,YAAY,CAAC,CAAC;IAC3F,6BAA6B,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC7D,wBAAwB,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ToolDefinition } from '@ama-mcp/core';
|
|
2
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import type { GitHubRepositoryToolOptions } from '../utils';
|
|
4
4
|
/**
|
|
5
5
|
* Options for the tool to get supported releases
|
|
6
|
+
* @experimental
|
|
6
7
|
*/
|
|
7
8
|
export interface SupportedReleasesOptions extends ToolDefinition, GitHubRepositoryToolOptions {
|
|
8
9
|
/**
|
|
@@ -14,7 +15,7 @@ export interface SupportedReleasesOptions extends ToolDefinition, GitHubReposito
|
|
|
14
15
|
* Register the supported releases tool.
|
|
15
16
|
* @param server
|
|
16
17
|
* @param options
|
|
17
|
-
* @
|
|
18
|
+
* @experimental
|
|
18
19
|
*/
|
|
19
|
-
export declare function registerSupportedReleasesTool(server: McpServer, options: SupportedReleasesOptions
|
|
20
|
+
export declare function registerSupportedReleasesTool(server: McpServer, options: SupportedReleasesOptions): Promise<void>;
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supported-releases/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/supported-releases/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAIvB,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AAOjD,OAAO,KAAK,EACV,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,cAAc,EAAE,2BAA2B;IAC3F;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAYD;;;;;GAKG;AACH,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCvH"}
|
|
@@ -16,10 +16,11 @@ async function getSupportedReleases(octokit, options, logger) {
|
|
|
16
16
|
* Register the supported releases tool.
|
|
17
17
|
* @param server
|
|
18
18
|
* @param options
|
|
19
|
-
* @
|
|
19
|
+
* @experimental
|
|
20
20
|
*/
|
|
21
|
-
async function registerSupportedReleasesTool(server, options
|
|
21
|
+
async function registerSupportedReleasesTool(server, options) {
|
|
22
22
|
const { githubToken, libraryName = `${options.owner}/${options.repo}`, toolName = `get_supported_releases_${libraryName.toLowerCase().replaceAll(/\s+/g, '_')}`, toolDescription = `Get the list of supported releases for ${libraryName}`, toolTitle = `Get Supported Releases for ${libraryName}` } = options;
|
|
23
|
+
const logger = options.logger ?? new core_1.MCPLogger(toolName, options.logLevel);
|
|
23
24
|
if (!githubToken) {
|
|
24
25
|
logger.error?.(`Missing githubToken for ${toolName}`);
|
|
25
26
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/supported-releases/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/supported-releases/index.ts"],"names":[],"mappings":";;AA+CA,sEAwCC;AAnFD,wCAEuB;AAIvB,wCAEuB;AACvB,6BAEa;AAgBb,KAAK,UAAU,oBAAoB,CAAC,OAAgB,EAAE,OAAiC,EAAE,MAAc;IACrG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAChC,MAAM,iBAAiB,GAAG,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;SAC5F,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAC3D,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;IAExD,MAAM,CAAC,IAAI,EAAE,CAAC,wBAAwB,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EA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AW,WAAW,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;iBAChH;aACF;YACD,iBAAiB,EAAE;gBACjB,QAAQ,EAAE,iBAAiB;aAC5B;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/src/utils.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub tool options
|
|
3
|
+
* @experimental
|
|
4
|
+
*/
|
|
1
5
|
export interface GithubToolOptions {
|
|
2
6
|
/**
|
|
3
7
|
* GitHub authentication token
|
|
4
8
|
*/
|
|
5
9
|
githubToken: string;
|
|
6
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* GitHub repository tool options
|
|
13
|
+
* @experimental
|
|
14
|
+
*/
|
|
7
15
|
export interface GitHubRepositoryToolOptions extends GithubToolOptions {
|
|
8
16
|
/**
|
|
9
17
|
* GitHub repository owner
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd"}
|