octocode-mcp 9.0.0 → 9.2.0
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 +14 -135
- package/dist/index.js +29 -7
- package/package.json +34 -15
- package/dist/src/errorCodes.d.ts +0 -353
- package/dist/src/github/client.d.ts +0 -4
- package/dist/src/github/codeSearch.d.ts +0 -4
- package/dist/src/github/errorConstants.d.ts +0 -173
- package/dist/src/github/errors.d.ts +0 -4
- package/dist/src/github/fileOperations.d.ts +0 -6
- package/dist/src/github/githubAPI.d.ts +0 -164
- package/dist/src/github/index.d.ts +0 -10
- package/dist/src/github/pullRequestSearch.d.ts +0 -7
- package/dist/src/github/queryBuilders.d.ts +0 -7
- package/dist/src/github/repoSearch.d.ts +0 -6
- package/dist/src/index.d.ts +0 -2
- package/dist/src/prompts/prompts.d.ts +0 -7
- package/dist/src/responses.d.ts +0 -8
- package/dist/src/scheme/baseSchema.d.ts +0 -21
- package/dist/src/scheme/github_fetch_content.d.ts +0 -203
- package/dist/src/scheme/github_search_code.d.ts +0 -131
- package/dist/src/scheme/github_search_pull_requests.d.ts +0 -390
- package/dist/src/scheme/github_search_repos.d.ts +0 -79
- package/dist/src/scheme/github_view_repo_structure.d.ts +0 -148
- package/dist/src/scheme/package_search.d.ts +0 -196
- package/dist/src/security/contentSanitizer.d.ts +0 -6
- package/dist/src/security/mask.d.ts +0 -1
- package/dist/src/security/regexes.d.ts +0 -2
- package/dist/src/security/withSecurityValidation.d.ts +0 -86
- package/dist/src/serverConfig.d.ts +0 -12
- package/dist/src/session.d.ts +0 -22
- package/dist/src/tools/github_fetch_content.d.ts +0 -3
- package/dist/src/tools/github_search_code.d.ts +0 -3
- package/dist/src/tools/github_search_pull_requests.d.ts +0 -3
- package/dist/src/tools/github_search_repos.d.ts +0 -3
- package/dist/src/tools/github_view_repo_structure.d.ts +0 -3
- package/dist/src/tools/package_search.d.ts +0 -3
- package/dist/src/tools/toolConfig.d.ts +0 -16
- package/dist/src/tools/toolMetadata.d.ts +0 -207
- package/dist/src/tools/toolsManager.d.ts +0 -6
- package/dist/src/tools/utils.d.ts +0 -23
- package/dist/src/types.d.ts +0 -537
- package/dist/src/utils/bulkOperations.d.ts +0 -3
- package/dist/src/utils/cache.d.ts +0 -22
- package/dist/src/utils/diffParser.d.ts +0 -1
- package/dist/src/utils/exec.d.ts +0 -25
- package/dist/src/utils/fetchWithRetries.d.ts +0 -52
- package/dist/src/utils/fileFilters.d.ts +0 -19
- package/dist/src/utils/githubRepoFallback.d.ts +0 -17
- package/dist/src/utils/logger.d.ts +0 -40
- package/dist/src/utils/npmPackage.d.ts +0 -3
- package/dist/src/utils/package.d.ts +0 -50
- package/dist/src/utils/promiseUtils.d.ts +0 -2
- package/dist/src/utils/pythonPackage.d.ts +0 -2
- package/dist/tests/errorCodes.test.d.ts +0 -1
- package/dist/tests/fixtures/mcp-fixtures.d.ts +0 -24
- package/dist/tests/fixtures/mcp-fixtures.test.d.ts +0 -1
- package/dist/tests/github/client.test.d.ts +0 -1
- package/dist/tests/github/codeSearch.filtering.test.d.ts +0 -1
- package/dist/tests/github/codeSearch.security.test.d.ts +0 -1
- package/dist/tests/github/errors.test.d.ts +0 -1
- package/dist/tests/github/fileOperations.processContent.test.d.ts +0 -1
- package/dist/tests/github/fileOperations.recursive.test.d.ts +0 -1
- package/dist/tests/github/githubAPI.test.d.ts +0 -1
- package/dist/tests/github/index.test.d.ts +0 -1
- package/dist/tests/github/pullRequestSearch.coverage.test.d.ts +0 -1
- package/dist/tests/github/pullRequestSearch.test.d.ts +0 -1
- package/dist/tests/github/queryBuilders.test.d.ts +0 -1
- package/dist/tests/github/repoSearch.test.d.ts +0 -1
- package/dist/tests/index.logic.test.d.ts +0 -1
- package/dist/tests/index.shutdown.test.d.ts +0 -1
- package/dist/tests/index.startup.test.d.ts +0 -1
- package/dist/tests/index.test.d.ts +0 -1
- package/dist/tests/investigate_pr_response.test.d.ts +0 -1
- package/dist/tests/prompts/prompts.test.d.ts +0 -1
- package/dist/tests/scheme/github_fetch_content.test.d.ts +0 -1
- package/dist/tests/security/contentSanitizer.test.d.ts +0 -1
- package/dist/tests/security/mask.branches.test.d.ts +0 -1
- package/dist/tests/security/mask.test.d.ts +0 -1
- package/dist/tests/security/withSecurityValidation.basic.test.d.ts +0 -1
- package/dist/tests/security/withSecurityValidation.extractRepoOwner.test.d.ts +0 -1
- package/dist/tests/security/withSecurityValidation.extractResearchFields.test.d.ts +0 -1
- package/dist/tests/security/withSecurityValidation.logging.test.d.ts +0 -1
- package/dist/tests/serverConfig.test.d.ts +0 -1
- package/dist/tests/session.edgecases.test.d.ts +0 -1
- package/dist/tests/session.logging_control.test.d.ts +0 -1
- package/dist/tests/session.test.d.ts +0 -1
- package/dist/tests/setup.d.ts +0 -1
- package/dist/tests/tools/callback.test.d.ts +0 -1
- package/dist/tests/tools/github_fetch_content.test.d.ts +0 -1
- package/dist/tests/tools/github_search_code.filtering.test.d.ts +0 -1
- package/dist/tests/tools/github_search_code.match_modes.test.d.ts +0 -22
- package/dist/tests/tools/github_search_code.test.d.ts +0 -1
- package/dist/tests/tools/github_search_code.tool.test.d.ts +0 -1
- package/dist/tests/tools/github_search_pull_requests.test.d.ts +0 -1
- package/dist/tests/tools/github_search_repos.tool.test.d.ts +0 -1
- package/dist/tests/tools/github_search_repos_integration.test.d.ts +0 -1
- package/dist/tests/tools/github_search_repos_query_splitting.test.d.ts +0 -1
- package/dist/tests/tools/github_view_repo_structure.test.d.ts +0 -1
- package/dist/tests/tools/github_view_repo_structure_filters.test.d.ts +0 -1
- package/dist/tests/tools/hints.test.d.ts +0 -1
- package/dist/tests/tools/package_search.test.d.ts +0 -1
- package/dist/tests/tools/response_structure.test.d.ts +0 -12
- package/dist/tests/tools/toolConfig.branches.test.d.ts +0 -1
- package/dist/tests/tools/toolConfig.test.d.ts +0 -1
- package/dist/tests/tools/toolMetadata.branches.test.d.ts +0 -1
- package/dist/tests/tools/toolMetadata.edge.test.d.ts +0 -1
- package/dist/tests/tools/toolMetadata.final.test.d.ts +0 -1
- package/dist/tests/tools/toolMetadata.test.d.ts +0 -1
- package/dist/tests/tools/toolsManager.metadata.test.d.ts +0 -1
- package/dist/tests/tools/toolsManager.test.d.ts +0 -1
- package/dist/tests/tools/tools_logging_integration.test.d.ts +0 -1
- package/dist/tests/tools/userContext_authInfo_propagation.test.d.ts +0 -10
- package/dist/tests/tools/utils.test.d.ts +0 -5
- package/dist/tests/types/github-openapi.test.d.ts +0 -1
- package/dist/tests/utils/betaFeatures.test.d.ts +0 -1
- package/dist/tests/utils/bulkOperations.instructions.test.d.ts +0 -1
- package/dist/tests/utils/bulkOperations.test.d.ts +0 -1
- package/dist/tests/utils/cache.collision.test.d.ts +0 -1
- package/dist/tests/utils/cache.dataCache.test.d.ts +0 -1
- package/dist/tests/utils/diffParser.test.d.ts +0 -1
- package/dist/tests/utils/exec.test.d.ts +0 -1
- package/dist/tests/utils/fetchWithRetries.additional.test.d.ts +0 -1
- package/dist/tests/utils/fetchWithRetries.test.d.ts +0 -1
- package/dist/tests/utils/fileFilters.test.d.ts +0 -1
- package/dist/tests/utils/github/fileOperations.test.d.ts +0 -1
- package/dist/tests/utils/githubAPI.test.d.ts +0 -1
- package/dist/tests/utils/githubRepoFallback.test.d.ts +0 -1
- package/dist/tests/utils/logger.test.d.ts +0 -1
- package/dist/tests/utils/npmPackage.test.d.ts +0 -1
- package/dist/tests/utils/promiseUtils.concurrency.test.d.ts +0 -1
- package/dist/tests/utils/promiseUtils.edgecases.test.d.ts +0 -1
- package/dist/tests/utils/promiseUtils.test.d.ts +0 -1
- package/dist/tests/utils/pythonPackage.test.d.ts +0 -1
- package/dist/tests/utils/responses.empty_arrays.test.d.ts +0 -4
- package/dist/tests/utils/responses.test.d.ts +0 -1
- package/dist/tests/utils/sessionCacheTests.test.d.ts +0 -1
- package/dist/tests/utils/testHelpers.d.ts +0 -16
package/dist/src/types.d.ts
DELETED
|
@@ -1,537 +0,0 @@
|
|
|
1
|
-
import type { GitHubAPIError } from './github/githubAPI.js';
|
|
2
|
-
export type QueryStatus = 'hasResults' | 'empty' | 'error';
|
|
3
|
-
export interface BaseToolResult<TQuery = object> {
|
|
4
|
-
mainResearchGoal?: string;
|
|
5
|
-
researchGoal?: string;
|
|
6
|
-
reasoning?: string;
|
|
7
|
-
error?: string;
|
|
8
|
-
hints?: string[];
|
|
9
|
-
query?: TQuery;
|
|
10
|
-
}
|
|
11
|
-
export interface ToolResult {
|
|
12
|
-
status: QueryStatus;
|
|
13
|
-
mainResearchGoal?: string;
|
|
14
|
-
researchGoal?: string;
|
|
15
|
-
reasoning?: string;
|
|
16
|
-
hints?: string[];
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
export interface ToolErrorResult extends ToolResult {
|
|
20
|
-
status: 'error';
|
|
21
|
-
error: string | GitHubAPIError;
|
|
22
|
-
}
|
|
23
|
-
export interface ToolSuccessResult<T = Record<string, unknown>> extends ToolResult {
|
|
24
|
-
status: 'hasResults' | 'empty';
|
|
25
|
-
data?: T;
|
|
26
|
-
}
|
|
27
|
-
export interface HintContext {
|
|
28
|
-
resultType: 'hasResults' | 'empty' | 'failed';
|
|
29
|
-
apiError?: GitHubAPIError;
|
|
30
|
-
}
|
|
31
|
-
export interface OrganizedHints {
|
|
32
|
-
hasResults?: string[];
|
|
33
|
-
empty?: string[];
|
|
34
|
-
failed?: string[];
|
|
35
|
-
}
|
|
36
|
-
export interface GitHubUserInfo {
|
|
37
|
-
login: string;
|
|
38
|
-
id: number;
|
|
39
|
-
name: string | null;
|
|
40
|
-
email: string | null;
|
|
41
|
-
company: string | null;
|
|
42
|
-
type: 'User' | 'Organization';
|
|
43
|
-
plan?: {
|
|
44
|
-
name: string;
|
|
45
|
-
space: number;
|
|
46
|
-
private_repos: number;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export interface GitHubRateLimitInfo {
|
|
50
|
-
core: {
|
|
51
|
-
limit: number;
|
|
52
|
-
used: number;
|
|
53
|
-
remaining: number;
|
|
54
|
-
reset: number;
|
|
55
|
-
};
|
|
56
|
-
search: {
|
|
57
|
-
limit: number;
|
|
58
|
-
used: number;
|
|
59
|
-
remaining: number;
|
|
60
|
-
reset: number;
|
|
61
|
-
};
|
|
62
|
-
graphql: {
|
|
63
|
-
limit: number;
|
|
64
|
-
used: number;
|
|
65
|
-
remaining: number;
|
|
66
|
-
reset: number;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export interface GitHubCodeSearchQuery {
|
|
70
|
-
keywordsToSearch: string[];
|
|
71
|
-
owner?: string;
|
|
72
|
-
repo?: string;
|
|
73
|
-
extension?: string;
|
|
74
|
-
stars?: string;
|
|
75
|
-
filename?: string;
|
|
76
|
-
path?: string;
|
|
77
|
-
match?: 'file' | 'path';
|
|
78
|
-
limit?: number;
|
|
79
|
-
minify?: boolean;
|
|
80
|
-
sanitize?: boolean;
|
|
81
|
-
mainResearchGoal?: string;
|
|
82
|
-
researchGoal?: string;
|
|
83
|
-
reasoning?: string;
|
|
84
|
-
}
|
|
85
|
-
/** Individual file in code search results */
|
|
86
|
-
export interface SearchFile {
|
|
87
|
-
path: string;
|
|
88
|
-
text_matches: string[];
|
|
89
|
-
}
|
|
90
|
-
/** Code search result with matched files */
|
|
91
|
-
export interface SearchResult extends BaseToolResult<GitHubCodeSearchQuery> {
|
|
92
|
-
owner?: string;
|
|
93
|
-
repo?: string;
|
|
94
|
-
files: SearchFile[];
|
|
95
|
-
}
|
|
96
|
-
/** Query parameters for fetching file content */
|
|
97
|
-
export interface FileContentQuery {
|
|
98
|
-
owner: string;
|
|
99
|
-
repo: string;
|
|
100
|
-
path: string;
|
|
101
|
-
branch?: string;
|
|
102
|
-
fullContent?: boolean;
|
|
103
|
-
startLine?: number;
|
|
104
|
-
endLine?: number;
|
|
105
|
-
matchString?: string;
|
|
106
|
-
matchStringContextLines?: number;
|
|
107
|
-
minified?: boolean;
|
|
108
|
-
sanitize?: boolean;
|
|
109
|
-
addTimestamp?: boolean;
|
|
110
|
-
mainResearchGoal?: string;
|
|
111
|
-
researchGoal?: string;
|
|
112
|
-
reasoning?: string;
|
|
113
|
-
}
|
|
114
|
-
/** LLM sampling metadata for content operations */
|
|
115
|
-
export interface SamplingInfo {
|
|
116
|
-
samplingId?: string;
|
|
117
|
-
samplingMethod?: string;
|
|
118
|
-
samplingTokens?: number;
|
|
119
|
-
samplingCost?: number;
|
|
120
|
-
[key: string]: unknown;
|
|
121
|
-
}
|
|
122
|
-
/** File content result data */
|
|
123
|
-
export interface ContentResultData {
|
|
124
|
-
owner?: string;
|
|
125
|
-
repo?: string;
|
|
126
|
-
path?: string;
|
|
127
|
-
contentLength?: number;
|
|
128
|
-
content?: string;
|
|
129
|
-
branch?: string;
|
|
130
|
-
startLine?: number;
|
|
131
|
-
endLine?: number;
|
|
132
|
-
isPartial?: boolean;
|
|
133
|
-
minified?: boolean;
|
|
134
|
-
minificationFailed?: boolean;
|
|
135
|
-
minificationType?: string;
|
|
136
|
-
originalQuery?: FileContentQuery;
|
|
137
|
-
securityWarnings?: string[];
|
|
138
|
-
sampling?: SamplingInfo;
|
|
139
|
-
lastModified?: string;
|
|
140
|
-
lastModifiedBy?: string;
|
|
141
|
-
}
|
|
142
|
-
/** Complete file content result */
|
|
143
|
-
export interface ContentResult extends BaseToolResult<FileContentQuery>, ContentResultData {
|
|
144
|
-
}
|
|
145
|
-
/** Query parameters for searching GitHub repositories */
|
|
146
|
-
export interface GitHubReposSearchQuery {
|
|
147
|
-
keywordsToSearch?: string[];
|
|
148
|
-
topicsToSearch?: string[];
|
|
149
|
-
owner?: string;
|
|
150
|
-
stars?: string;
|
|
151
|
-
size?: string;
|
|
152
|
-
created?: string;
|
|
153
|
-
updated?: string;
|
|
154
|
-
match?: Array<'name' | 'description' | 'readme'>;
|
|
155
|
-
sort?: 'forks' | 'stars' | 'updated' | 'best-match';
|
|
156
|
-
limit?: number;
|
|
157
|
-
mainResearchGoal?: string;
|
|
158
|
-
researchGoal?: string;
|
|
159
|
-
reasoning?: string;
|
|
160
|
-
}
|
|
161
|
-
/** Simplified repository metadata */
|
|
162
|
-
export interface SimplifiedRepository {
|
|
163
|
-
owner: string;
|
|
164
|
-
repo: string;
|
|
165
|
-
stars: number;
|
|
166
|
-
description: string;
|
|
167
|
-
url: string;
|
|
168
|
-
createdAt: string;
|
|
169
|
-
updatedAt: string;
|
|
170
|
-
pushedAt: string;
|
|
171
|
-
}
|
|
172
|
-
/** Repository search result */
|
|
173
|
-
export interface RepoSearchResult extends BaseToolResult<GitHubReposSearchQuery> {
|
|
174
|
-
repositories: SimplifiedRepository[];
|
|
175
|
-
}
|
|
176
|
-
/** Query parameters for viewing repository structure */
|
|
177
|
-
export interface GitHubViewRepoStructureQuery {
|
|
178
|
-
owner: string;
|
|
179
|
-
repo: string;
|
|
180
|
-
branch: string;
|
|
181
|
-
path?: string;
|
|
182
|
-
depth?: number;
|
|
183
|
-
mainResearchGoal?: string;
|
|
184
|
-
researchGoal?: string;
|
|
185
|
-
reasoning?: string;
|
|
186
|
-
}
|
|
187
|
-
/** Repository structure result data */
|
|
188
|
-
export interface RepoStructureResultData {
|
|
189
|
-
owner?: string;
|
|
190
|
-
repo?: string;
|
|
191
|
-
path?: string;
|
|
192
|
-
files?: string[];
|
|
193
|
-
folders?: string[];
|
|
194
|
-
}
|
|
195
|
-
/** Complete repository structure result */
|
|
196
|
-
export interface RepoStructureResult extends BaseToolResult<GitHubViewRepoStructureQuery>, RepoStructureResultData {
|
|
197
|
-
}
|
|
198
|
-
/** Query parameters for searching packages */
|
|
199
|
-
export interface PackageSearchQuery {
|
|
200
|
-
name: string;
|
|
201
|
-
ecosystem: 'npm' | 'python';
|
|
202
|
-
searchLimit?: number;
|
|
203
|
-
npmFetchMetadata?: boolean;
|
|
204
|
-
mainResearchGoal?: string;
|
|
205
|
-
researchGoal?: string;
|
|
206
|
-
reasoning?: string;
|
|
207
|
-
}
|
|
208
|
-
/** Individual package in search results */
|
|
209
|
-
export interface PackageInfo {
|
|
210
|
-
name: string;
|
|
211
|
-
version: string;
|
|
212
|
-
description: string | null;
|
|
213
|
-
keywords: string[];
|
|
214
|
-
repository: string | null;
|
|
215
|
-
license?: string;
|
|
216
|
-
homepage?: string;
|
|
217
|
-
author?: string;
|
|
218
|
-
}
|
|
219
|
-
/** Package search result data */
|
|
220
|
-
export interface PackageSearchResultData {
|
|
221
|
-
packages: PackageInfo[];
|
|
222
|
-
ecosystem: 'npm' | 'python';
|
|
223
|
-
totalFound: number;
|
|
224
|
-
}
|
|
225
|
-
/** Complete package search result */
|
|
226
|
-
export interface PackageSearchResult extends BaseToolResult<PackageSearchQuery>, PackageSearchResultData {
|
|
227
|
-
}
|
|
228
|
-
/** Query parameters for searching pull requests */
|
|
229
|
-
export interface GitHubPullRequestSearchQuery {
|
|
230
|
-
query?: string;
|
|
231
|
-
owner?: string;
|
|
232
|
-
repo?: string;
|
|
233
|
-
prNumber?: number;
|
|
234
|
-
state?: 'open' | 'closed';
|
|
235
|
-
assignee?: string;
|
|
236
|
-
author?: string;
|
|
237
|
-
commenter?: string;
|
|
238
|
-
involves?: string;
|
|
239
|
-
mentions?: string;
|
|
240
|
-
'review-requested'?: string;
|
|
241
|
-
'reviewed-by'?: string;
|
|
242
|
-
label?: string | string[];
|
|
243
|
-
'no-label'?: boolean;
|
|
244
|
-
'no-milestone'?: boolean;
|
|
245
|
-
'no-project'?: boolean;
|
|
246
|
-
'no-assignee'?: boolean;
|
|
247
|
-
head?: string;
|
|
248
|
-
base?: string;
|
|
249
|
-
created?: string;
|
|
250
|
-
updated?: string;
|
|
251
|
-
closed?: string;
|
|
252
|
-
'merged-at'?: string;
|
|
253
|
-
comments?: number | string;
|
|
254
|
-
reactions?: number | string;
|
|
255
|
-
interactions?: number | string;
|
|
256
|
-
merged?: boolean;
|
|
257
|
-
draft?: boolean;
|
|
258
|
-
match?: Array<'title' | 'body' | 'comments'>;
|
|
259
|
-
sort?: 'created' | 'updated' | 'best-match';
|
|
260
|
-
order?: 'asc' | 'desc';
|
|
261
|
-
limit?: number;
|
|
262
|
-
withComments?: boolean;
|
|
263
|
-
withCommits?: boolean;
|
|
264
|
-
type?: 'metadata' | 'fullContent' | 'partialContent';
|
|
265
|
-
partialContentMetadata?: {
|
|
266
|
-
file: string;
|
|
267
|
-
additions?: number[];
|
|
268
|
-
deletions?: number[];
|
|
269
|
-
}[];
|
|
270
|
-
mainResearchGoal?: string;
|
|
271
|
-
researchGoal?: string;
|
|
272
|
-
reasoning?: string;
|
|
273
|
-
}
|
|
274
|
-
/** Detailed pull request information */
|
|
275
|
-
export interface PullRequestInfo {
|
|
276
|
-
id: number;
|
|
277
|
-
number: number;
|
|
278
|
-
title: string;
|
|
279
|
-
url: string;
|
|
280
|
-
html_url: string;
|
|
281
|
-
state: 'open' | 'closed';
|
|
282
|
-
draft: boolean;
|
|
283
|
-
merged: boolean;
|
|
284
|
-
created_at: string;
|
|
285
|
-
updated_at: string;
|
|
286
|
-
closed_at?: string;
|
|
287
|
-
merged_at?: string;
|
|
288
|
-
author: {
|
|
289
|
-
login: string;
|
|
290
|
-
id: number;
|
|
291
|
-
avatar_url: string;
|
|
292
|
-
html_url: string;
|
|
293
|
-
};
|
|
294
|
-
assignees?: Array<{
|
|
295
|
-
login: string;
|
|
296
|
-
id: number;
|
|
297
|
-
avatar_url: string;
|
|
298
|
-
html_url: string;
|
|
299
|
-
}>;
|
|
300
|
-
labels?: Array<{
|
|
301
|
-
id: number;
|
|
302
|
-
name: string;
|
|
303
|
-
color: string;
|
|
304
|
-
description?: string;
|
|
305
|
-
}>;
|
|
306
|
-
milestone?: {
|
|
307
|
-
id: number;
|
|
308
|
-
title: string;
|
|
309
|
-
description?: string;
|
|
310
|
-
state: 'open' | 'closed';
|
|
311
|
-
created_at: string;
|
|
312
|
-
updated_at: string;
|
|
313
|
-
due_on?: string;
|
|
314
|
-
};
|
|
315
|
-
head: {
|
|
316
|
-
ref: string;
|
|
317
|
-
sha: string;
|
|
318
|
-
repo?: string;
|
|
319
|
-
};
|
|
320
|
-
base: {
|
|
321
|
-
ref: string;
|
|
322
|
-
sha: string;
|
|
323
|
-
repo: string;
|
|
324
|
-
};
|
|
325
|
-
body?: string;
|
|
326
|
-
comments?: number;
|
|
327
|
-
review_comments?: number;
|
|
328
|
-
commits?: number;
|
|
329
|
-
additions?: number;
|
|
330
|
-
deletions?: number;
|
|
331
|
-
changed_files?: number;
|
|
332
|
-
comment_details?: Array<{
|
|
333
|
-
id: number;
|
|
334
|
-
user: string;
|
|
335
|
-
body: string;
|
|
336
|
-
created_at: string;
|
|
337
|
-
updated_at: string;
|
|
338
|
-
}>;
|
|
339
|
-
file_changes?: Array<{
|
|
340
|
-
filename: string;
|
|
341
|
-
status: string;
|
|
342
|
-
additions: number;
|
|
343
|
-
deletions: number;
|
|
344
|
-
changes?: number;
|
|
345
|
-
patch?: string;
|
|
346
|
-
}>;
|
|
347
|
-
commit_details?: Array<{
|
|
348
|
-
sha: string;
|
|
349
|
-
message: string;
|
|
350
|
-
author: string;
|
|
351
|
-
date: string;
|
|
352
|
-
files: Array<{
|
|
353
|
-
filename: string;
|
|
354
|
-
status: string;
|
|
355
|
-
additions: number;
|
|
356
|
-
deletions: number;
|
|
357
|
-
changes?: number;
|
|
358
|
-
patch?: string;
|
|
359
|
-
}>;
|
|
360
|
-
}>;
|
|
361
|
-
}
|
|
362
|
-
/** Pull request search result data */
|
|
363
|
-
export interface PullRequestSearchResultData {
|
|
364
|
-
pull_requests?: PullRequestInfo[];
|
|
365
|
-
total_count?: number;
|
|
366
|
-
incomplete_results?: boolean;
|
|
367
|
-
}
|
|
368
|
-
/** Complete pull request search result */
|
|
369
|
-
export interface PullRequestSearchResult extends BaseToolResult<GitHubPullRequestSearchQuery>, PullRequestSearchResultData {
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Optional callback invoked when a tool is called with queries
|
|
373
|
-
* @param toolName - The name of the tool being invoked
|
|
374
|
-
* @param queries - Array of query objects passed to the tool
|
|
375
|
-
*/
|
|
376
|
-
export type ToolInvocationCallback = (toolName: string, queries: unknown[]) => Promise<void>;
|
|
377
|
-
/** Processed result from bulk query execution */
|
|
378
|
-
export interface ProcessedBulkResult<TData = Record<string, unknown>, TQuery = object> {
|
|
379
|
-
mainResearchGoal?: string;
|
|
380
|
-
researchGoal?: string;
|
|
381
|
-
reasoning?: string;
|
|
382
|
-
data?: TData;
|
|
383
|
-
error?: string | GitHubAPIError;
|
|
384
|
-
status: QueryStatus;
|
|
385
|
-
query?: TQuery;
|
|
386
|
-
hints?: string[];
|
|
387
|
-
[key: string]: unknown;
|
|
388
|
-
}
|
|
389
|
-
/** Flattened query result for bulk operations */
|
|
390
|
-
export interface FlatQueryResult {
|
|
391
|
-
status: QueryStatus;
|
|
392
|
-
data: Record<string, unknown>;
|
|
393
|
-
mainResearchGoal?: string;
|
|
394
|
-
researchGoal?: string;
|
|
395
|
-
reasoning?: string;
|
|
396
|
-
}
|
|
397
|
-
/** Error information for failed queries */
|
|
398
|
-
export interface QueryError {
|
|
399
|
-
queryIndex: number;
|
|
400
|
-
error: string;
|
|
401
|
-
}
|
|
402
|
-
/** Configuration for bulk response formatting */
|
|
403
|
-
export interface BulkResponseConfig {
|
|
404
|
-
toolName: string;
|
|
405
|
-
keysPriority?: string[];
|
|
406
|
-
}
|
|
407
|
-
/** Cache performance statistics */
|
|
408
|
-
export interface CacheStats {
|
|
409
|
-
hits: number;
|
|
410
|
-
misses: number;
|
|
411
|
-
sets: number;
|
|
412
|
-
totalKeys: number;
|
|
413
|
-
lastReset: Date;
|
|
414
|
-
}
|
|
415
|
-
/** Result of a promise with error isolation */
|
|
416
|
-
export interface PromiseResult<T> {
|
|
417
|
-
success: boolean;
|
|
418
|
-
data?: T;
|
|
419
|
-
error?: Error;
|
|
420
|
-
index: number;
|
|
421
|
-
}
|
|
422
|
-
/** Options for batch promise execution */
|
|
423
|
-
export interface PromiseExecutionOptions {
|
|
424
|
-
timeout?: number;
|
|
425
|
-
continueOnError?: boolean;
|
|
426
|
-
concurrency?: number;
|
|
427
|
-
onError?: (error: Error, index: number) => void;
|
|
428
|
-
}
|
|
429
|
-
/** Standardized tool response format (single and bulk) */
|
|
430
|
-
export interface ToolResponse {
|
|
431
|
-
data?: unknown;
|
|
432
|
-
hints?: string[];
|
|
433
|
-
instructions?: string;
|
|
434
|
-
results?: unknown[];
|
|
435
|
-
hasResultsStatusHints?: string[];
|
|
436
|
-
emptyStatusHints?: string[];
|
|
437
|
-
errorStatusHints?: string[];
|
|
438
|
-
}
|
|
439
|
-
/** LLM sampling response with token usage */
|
|
440
|
-
export interface SamplingResponse {
|
|
441
|
-
content: string;
|
|
442
|
-
stopReason?: string;
|
|
443
|
-
usage?: {
|
|
444
|
-
promptTokens: number;
|
|
445
|
-
completionTokens: number;
|
|
446
|
-
totalTokens: number;
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
/** Pattern definition for detecting sensitive data */
|
|
450
|
-
export interface SensitiveDataPattern {
|
|
451
|
-
name: string;
|
|
452
|
-
description: string;
|
|
453
|
-
regex: RegExp;
|
|
454
|
-
fileContext?: RegExp;
|
|
455
|
-
matchAccuracy?: 'high' | 'medium';
|
|
456
|
-
}
|
|
457
|
-
/** Result of content sanitization */
|
|
458
|
-
export interface SanitizationResult {
|
|
459
|
-
content: string;
|
|
460
|
-
hasSecrets: boolean;
|
|
461
|
-
secretsDetected: string[];
|
|
462
|
-
warnings: string[];
|
|
463
|
-
}
|
|
464
|
-
/** Result of parameter validation */
|
|
465
|
-
export interface ValidationResult {
|
|
466
|
-
sanitizedParams: Record<string, unknown>;
|
|
467
|
-
isValid: boolean;
|
|
468
|
-
hasSecrets: boolean;
|
|
469
|
-
warnings: string[];
|
|
470
|
-
}
|
|
471
|
-
/** User context for authenticated operations */
|
|
472
|
-
export interface UserContext {
|
|
473
|
-
userId: string;
|
|
474
|
-
userLogin: string;
|
|
475
|
-
organizationId?: string;
|
|
476
|
-
isEnterpriseMode: boolean;
|
|
477
|
-
sessionId?: string;
|
|
478
|
-
}
|
|
479
|
-
/** Server configuration and feature flags */
|
|
480
|
-
export interface ServerConfig {
|
|
481
|
-
version: string;
|
|
482
|
-
githubApiUrl: string;
|
|
483
|
-
toolsToRun?: string[];
|
|
484
|
-
enableTools?: string[];
|
|
485
|
-
disableTools?: string[];
|
|
486
|
-
enableLogging: boolean;
|
|
487
|
-
betaEnabled: boolean;
|
|
488
|
-
timeout: number;
|
|
489
|
-
maxRetries: number;
|
|
490
|
-
loggingEnabled: boolean;
|
|
491
|
-
}
|
|
492
|
-
/** Session data for tracking tool usage */
|
|
493
|
-
export interface SessionData {
|
|
494
|
-
sessionId: string;
|
|
495
|
-
intent: 'init' | 'error' | 'tool_call' | 'prompt_call' | 'rate_limit';
|
|
496
|
-
data: ToolCallData | PromptCallData | ErrorData | RateLimitData | Record<string, never>;
|
|
497
|
-
timestamp: string;
|
|
498
|
-
version: string;
|
|
499
|
-
}
|
|
500
|
-
/** Tool call tracking data */
|
|
501
|
-
export interface ToolCallData {
|
|
502
|
-
tool_name: string;
|
|
503
|
-
repos: string[];
|
|
504
|
-
mainResearchGoal?: string;
|
|
505
|
-
researchGoal?: string;
|
|
506
|
-
reasoning?: string;
|
|
507
|
-
}
|
|
508
|
-
export interface PromptCallData {
|
|
509
|
-
prompt_name: string;
|
|
510
|
-
}
|
|
511
|
-
/** Error tracking data */
|
|
512
|
-
export interface ErrorData {
|
|
513
|
-
error: string;
|
|
514
|
-
}
|
|
515
|
-
/** Rate limit tracking data */
|
|
516
|
-
export interface RateLimitData {
|
|
517
|
-
/**
|
|
518
|
-
* The kind of rate limit that occurred
|
|
519
|
-
* - primary: Hourly quota exhausted (REST/GraphQL)
|
|
520
|
-
* - secondary: Abuse detection (too frequent)
|
|
521
|
-
* - graphql: GraphQL-specific rate limiting indication
|
|
522
|
-
* - precheck_blocked: Proactive block based on current rate limits
|
|
523
|
-
*/
|
|
524
|
-
limit_type: 'primary' | 'secondary' | 'graphql' | 'precheck_blocked';
|
|
525
|
-
/** Seconds to wait before retrying (if known) */
|
|
526
|
-
retry_after_seconds?: number;
|
|
527
|
-
/** Remaining requests at the time of the event */
|
|
528
|
-
rate_limit_remaining?: number;
|
|
529
|
-
/** Epoch milliseconds for reset time (if known) */
|
|
530
|
-
rate_limit_reset_ms?: number;
|
|
531
|
-
/** Optional HTTP method involved */
|
|
532
|
-
api_method?: string;
|
|
533
|
-
/** Optional API URL that was being called */
|
|
534
|
-
api_url?: string;
|
|
535
|
-
/** Additional free-form details */
|
|
536
|
-
details?: string;
|
|
537
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { CallToolResult } from '@modelcontextprotocol/sdk/types';
|
|
2
|
-
import type { ProcessedBulkResult, BulkResponseConfig } from '../types.js';
|
|
3
|
-
export declare function executeBulkOperation<TQuery extends object, TData = Record<string, unknown>, R extends ProcessedBulkResult<TData, TQuery> = ProcessedBulkResult<TData, TQuery>>(queries: Array<TQuery>, processor: (query: TQuery, index: number) => Promise<R>, config: BulkResponseConfig): Promise<CallToolResult>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { CacheStats } from '../types.js';
|
|
2
|
-
export declare function generateCacheKey(prefix: string, params: unknown, sessionId?: string): string;
|
|
3
|
-
/**
|
|
4
|
-
* Generic typed cache wrapper for raw data (avoids JSON round-trips)
|
|
5
|
-
*/
|
|
6
|
-
export declare function withDataCache<T>(cacheKey: string, operation: () => Promise<T>, options?: {
|
|
7
|
-
ttl?: number;
|
|
8
|
-
skipCache?: boolean;
|
|
9
|
-
forceRefresh?: boolean;
|
|
10
|
-
shouldCache?: (value: T) => boolean;
|
|
11
|
-
}): Promise<T>;
|
|
12
|
-
/**
|
|
13
|
-
* Clear all cache entries and reset statistics
|
|
14
|
-
*/
|
|
15
|
-
export declare function clearAllCache(): void;
|
|
16
|
-
/**
|
|
17
|
-
* Get cache statistics
|
|
18
|
-
*/
|
|
19
|
-
export declare function getCacheStats(): CacheStats & {
|
|
20
|
-
hitRate: number;
|
|
21
|
-
cacheSize: number;
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function filterPatch(patch: string, additions?: number[], deletions?: number[]): string;
|
package/dist/src/utils/exec.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare function getGithubCLIToken(): Promise<string | null>;
|
|
2
|
-
declare const ALLOWED_NPM_COMMANDS: readonly ["view", "search", "ping", "config", "whoami"];
|
|
3
|
-
type NpmCommand = (typeof ALLOWED_NPM_COMMANDS)[number];
|
|
4
|
-
type NpmExecOptions = {
|
|
5
|
-
timeout?: number;
|
|
6
|
-
cwd?: string;
|
|
7
|
-
env?: Record<string, string>;
|
|
8
|
-
};
|
|
9
|
-
interface NpmExecResult {
|
|
10
|
-
stdout: string;
|
|
11
|
-
stderr: string;
|
|
12
|
-
error?: Error;
|
|
13
|
-
exitCode?: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Check if npm registry is available by running `npm ping`
|
|
17
|
-
* @param timeoutMs - Timeout in milliseconds (default 10000ms)
|
|
18
|
-
* @returns true if npm registry is reachable, false otherwise
|
|
19
|
-
*/
|
|
20
|
-
export declare function checkNpmAvailability(timeoutMs?: number): Promise<boolean>;
|
|
21
|
-
/**
|
|
22
|
-
* Execute NPM command with security validation using spawn (safer than exec)
|
|
23
|
-
*/
|
|
24
|
-
export declare function executeNpmCommand(command: NpmCommand, args: string[], options?: NpmExecOptions): Promise<NpmExecResult>;
|
|
25
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fetch with retry mechanism and exponential backoff
|
|
3
|
-
*/
|
|
4
|
-
export interface FetchWithRetriesOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Maximum number of retry attempts (excluding the initial request)
|
|
7
|
-
* @default 3
|
|
8
|
-
*/
|
|
9
|
-
maxRetries?: number;
|
|
10
|
-
/**
|
|
11
|
-
* Initial delay in milliseconds for exponential backoff
|
|
12
|
-
* @default 1000 (1 second)
|
|
13
|
-
*/
|
|
14
|
-
initialDelayMs?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Custom headers to include in the request
|
|
17
|
-
*/
|
|
18
|
-
headers?: Record<string, string>;
|
|
19
|
-
/**
|
|
20
|
-
* HTTP method
|
|
21
|
-
* @default 'GET'
|
|
22
|
-
*/
|
|
23
|
-
method?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Whether to include the package version as a query parameter
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
includeVersion?: boolean;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Fetches a URL with automatic retries and exponential backoff.
|
|
32
|
-
*
|
|
33
|
-
* Retry behavior:
|
|
34
|
-
* - Retries on network errors, server errors (5xx), and rate limits (429)
|
|
35
|
-
* - Respects 'Retry-After' header for 429 responses
|
|
36
|
-
* - Does NOT retry on client errors (4xx) except rate limits
|
|
37
|
-
* - Uses exponential backoff: 1s, 2s, 4s (default) if no Retry-After header
|
|
38
|
-
*
|
|
39
|
-
* @param url - The URL to fetch
|
|
40
|
-
* @param options - Configuration options for retries and request
|
|
41
|
-
* @returns The JSON response (or null for 204 No Content)
|
|
42
|
-
* @throws Error if all retry attempts fail
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```typescript
|
|
46
|
-
* const data = await fetchWithRetries('https://api.example.com/data', {
|
|
47
|
-
* maxRetries: 3,
|
|
48
|
-
* headers: { 'User-Agent': 'MyApp/1.0' }
|
|
49
|
-
* });
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
export declare function fetchWithRetries(url: string, options?: FetchWithRetriesOptions): Promise<unknown>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Folder names to ignore (exact matches)
|
|
3
|
-
*/
|
|
4
|
-
export declare const IGNORED_FOLDER_NAMES: string[];
|
|
5
|
-
export declare const IGNORED_FILE_NAMES: string[];
|
|
6
|
-
/**
|
|
7
|
-
* File extensions to ignore
|
|
8
|
-
*/
|
|
9
|
-
export declare const IGNORED_FILE_EXTENSIONS: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Check if a directory should be ignored based on folder name
|
|
12
|
-
*/
|
|
13
|
-
export declare function shouldIgnoreDir(folderName: string): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Check if a file should be ignored based on file name, extension, and path
|
|
16
|
-
* Optimized order: extension (fastest) → file name → path (most expensive)
|
|
17
|
-
* @param filePath - Full file path (e.g., ".yarn/x/y/z.js")
|
|
18
|
-
*/
|
|
19
|
-
export declare function shouldIgnoreFile(filePath: string): boolean;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { NpmPackageResult } from './package.js';
|
|
2
|
-
/**
|
|
3
|
-
* Attempts to infer the GitHub repository for an npm package
|
|
4
|
-
* when the npm registry doesn't have the repository field.
|
|
5
|
-
*
|
|
6
|
-
* Uses heuristics and known mappings - no API calls required.
|
|
7
|
-
*/
|
|
8
|
-
export declare function tryInferRepoUrl(packageName: string, existingResult: NpmPackageResult): NpmPackageResult;
|
|
9
|
-
/**
|
|
10
|
-
* Add a new known package to repo mapping at runtime.
|
|
11
|
-
* Useful for caching discovered mappings.
|
|
12
|
-
*/
|
|
13
|
-
export declare function addKnownPackageRepo(packageName: string, repoUrl: string): void;
|
|
14
|
-
/**
|
|
15
|
-
* Get the GitHub organization for a given npm scope.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getOrgForScope(scope: string): string | undefined;
|