octocode-mcp 9.0.0-alpha.2 → 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 -16
- 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
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
declare const NpmPackageQuerySchema: z.ZodObject<{
|
|
3
|
-
mainResearchGoal: z.ZodString;
|
|
4
|
-
researchGoal: z.ZodString;
|
|
5
|
-
reasoning: z.ZodString;
|
|
6
|
-
} & {
|
|
7
|
-
name: z.ZodString;
|
|
8
|
-
searchLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
9
|
-
npmFetchMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
name: string;
|
|
12
|
-
mainResearchGoal: string;
|
|
13
|
-
researchGoal: string;
|
|
14
|
-
reasoning: string;
|
|
15
|
-
searchLimit: number;
|
|
16
|
-
npmFetchMetadata: boolean;
|
|
17
|
-
}, {
|
|
18
|
-
name: string;
|
|
19
|
-
mainResearchGoal: string;
|
|
20
|
-
researchGoal: string;
|
|
21
|
-
reasoning: string;
|
|
22
|
-
searchLimit?: number | undefined;
|
|
23
|
-
npmFetchMetadata?: boolean | undefined;
|
|
24
|
-
}>;
|
|
25
|
-
declare const PythonPackageQuerySchema: z.ZodObject<{
|
|
26
|
-
mainResearchGoal: z.ZodString;
|
|
27
|
-
researchGoal: z.ZodString;
|
|
28
|
-
reasoning: z.ZodString;
|
|
29
|
-
} & {
|
|
30
|
-
name: z.ZodString;
|
|
31
|
-
searchLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
32
|
-
pythonFetchMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
name: string;
|
|
35
|
-
mainResearchGoal: string;
|
|
36
|
-
researchGoal: string;
|
|
37
|
-
reasoning: string;
|
|
38
|
-
searchLimit: number;
|
|
39
|
-
pythonFetchMetadata: boolean;
|
|
40
|
-
}, {
|
|
41
|
-
name: string;
|
|
42
|
-
mainResearchGoal: string;
|
|
43
|
-
researchGoal: string;
|
|
44
|
-
reasoning: string;
|
|
45
|
-
searchLimit?: number | undefined;
|
|
46
|
-
pythonFetchMetadata?: boolean | undefined;
|
|
47
|
-
}>;
|
|
48
|
-
export declare const PackageSearchQuerySchema: z.ZodDiscriminatedUnion<"ecosystem", [z.ZodObject<{
|
|
49
|
-
mainResearchGoal: z.ZodString;
|
|
50
|
-
researchGoal: z.ZodString;
|
|
51
|
-
reasoning: z.ZodString;
|
|
52
|
-
} & {
|
|
53
|
-
name: z.ZodString;
|
|
54
|
-
searchLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
55
|
-
npmFetchMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
56
|
-
} & {
|
|
57
|
-
ecosystem: z.ZodLiteral<"npm">;
|
|
58
|
-
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
name: string;
|
|
60
|
-
mainResearchGoal: string;
|
|
61
|
-
researchGoal: string;
|
|
62
|
-
reasoning: string;
|
|
63
|
-
searchLimit: number;
|
|
64
|
-
npmFetchMetadata: boolean;
|
|
65
|
-
ecosystem: "npm";
|
|
66
|
-
}, {
|
|
67
|
-
name: string;
|
|
68
|
-
mainResearchGoal: string;
|
|
69
|
-
researchGoal: string;
|
|
70
|
-
reasoning: string;
|
|
71
|
-
ecosystem: "npm";
|
|
72
|
-
searchLimit?: number | undefined;
|
|
73
|
-
npmFetchMetadata?: boolean | undefined;
|
|
74
|
-
}>, z.ZodObject<{
|
|
75
|
-
mainResearchGoal: z.ZodString;
|
|
76
|
-
researchGoal: z.ZodString;
|
|
77
|
-
reasoning: z.ZodString;
|
|
78
|
-
} & {
|
|
79
|
-
name: z.ZodString;
|
|
80
|
-
searchLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
81
|
-
pythonFetchMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
82
|
-
} & {
|
|
83
|
-
ecosystem: z.ZodLiteral<"python">;
|
|
84
|
-
}, "strip", z.ZodTypeAny, {
|
|
85
|
-
name: string;
|
|
86
|
-
mainResearchGoal: string;
|
|
87
|
-
researchGoal: string;
|
|
88
|
-
reasoning: string;
|
|
89
|
-
searchLimit: number;
|
|
90
|
-
pythonFetchMetadata: boolean;
|
|
91
|
-
ecosystem: "python";
|
|
92
|
-
}, {
|
|
93
|
-
name: string;
|
|
94
|
-
mainResearchGoal: string;
|
|
95
|
-
researchGoal: string;
|
|
96
|
-
reasoning: string;
|
|
97
|
-
ecosystem: "python";
|
|
98
|
-
searchLimit?: number | undefined;
|
|
99
|
-
pythonFetchMetadata?: boolean | undefined;
|
|
100
|
-
}>]>;
|
|
101
|
-
export declare const PackageSearchBulkQuerySchema: z.ZodObject<{
|
|
102
|
-
queries: z.ZodArray<z.ZodDiscriminatedUnion<"ecosystem", [z.ZodObject<{
|
|
103
|
-
mainResearchGoal: z.ZodString;
|
|
104
|
-
researchGoal: z.ZodString;
|
|
105
|
-
reasoning: z.ZodString;
|
|
106
|
-
} & {
|
|
107
|
-
name: z.ZodString;
|
|
108
|
-
searchLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
109
|
-
npmFetchMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
110
|
-
} & {
|
|
111
|
-
ecosystem: z.ZodLiteral<"npm">;
|
|
112
|
-
}, "strip", z.ZodTypeAny, {
|
|
113
|
-
name: string;
|
|
114
|
-
mainResearchGoal: string;
|
|
115
|
-
researchGoal: string;
|
|
116
|
-
reasoning: string;
|
|
117
|
-
searchLimit: number;
|
|
118
|
-
npmFetchMetadata: boolean;
|
|
119
|
-
ecosystem: "npm";
|
|
120
|
-
}, {
|
|
121
|
-
name: string;
|
|
122
|
-
mainResearchGoal: string;
|
|
123
|
-
researchGoal: string;
|
|
124
|
-
reasoning: string;
|
|
125
|
-
ecosystem: "npm";
|
|
126
|
-
searchLimit?: number | undefined;
|
|
127
|
-
npmFetchMetadata?: boolean | undefined;
|
|
128
|
-
}>, z.ZodObject<{
|
|
129
|
-
mainResearchGoal: z.ZodString;
|
|
130
|
-
researchGoal: z.ZodString;
|
|
131
|
-
reasoning: z.ZodString;
|
|
132
|
-
} & {
|
|
133
|
-
name: z.ZodString;
|
|
134
|
-
searchLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
135
|
-
pythonFetchMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
136
|
-
} & {
|
|
137
|
-
ecosystem: z.ZodLiteral<"python">;
|
|
138
|
-
}, "strip", z.ZodTypeAny, {
|
|
139
|
-
name: string;
|
|
140
|
-
mainResearchGoal: string;
|
|
141
|
-
researchGoal: string;
|
|
142
|
-
reasoning: string;
|
|
143
|
-
searchLimit: number;
|
|
144
|
-
pythonFetchMetadata: boolean;
|
|
145
|
-
ecosystem: "python";
|
|
146
|
-
}, {
|
|
147
|
-
name: string;
|
|
148
|
-
mainResearchGoal: string;
|
|
149
|
-
researchGoal: string;
|
|
150
|
-
reasoning: string;
|
|
151
|
-
ecosystem: "python";
|
|
152
|
-
searchLimit?: number | undefined;
|
|
153
|
-
pythonFetchMetadata?: boolean | undefined;
|
|
154
|
-
}>]>, "many">;
|
|
155
|
-
}, "strip", z.ZodTypeAny, {
|
|
156
|
-
queries: ({
|
|
157
|
-
name: string;
|
|
158
|
-
mainResearchGoal: string;
|
|
159
|
-
researchGoal: string;
|
|
160
|
-
reasoning: string;
|
|
161
|
-
searchLimit: number;
|
|
162
|
-
npmFetchMetadata: boolean;
|
|
163
|
-
ecosystem: "npm";
|
|
164
|
-
} | {
|
|
165
|
-
name: string;
|
|
166
|
-
mainResearchGoal: string;
|
|
167
|
-
researchGoal: string;
|
|
168
|
-
reasoning: string;
|
|
169
|
-
searchLimit: number;
|
|
170
|
-
pythonFetchMetadata: boolean;
|
|
171
|
-
ecosystem: "python";
|
|
172
|
-
})[];
|
|
173
|
-
}, {
|
|
174
|
-
queries: ({
|
|
175
|
-
name: string;
|
|
176
|
-
mainResearchGoal: string;
|
|
177
|
-
researchGoal: string;
|
|
178
|
-
reasoning: string;
|
|
179
|
-
ecosystem: "npm";
|
|
180
|
-
searchLimit?: number | undefined;
|
|
181
|
-
npmFetchMetadata?: boolean | undefined;
|
|
182
|
-
} | {
|
|
183
|
-
name: string;
|
|
184
|
-
mainResearchGoal: string;
|
|
185
|
-
researchGoal: string;
|
|
186
|
-
reasoning: string;
|
|
187
|
-
ecosystem: "python";
|
|
188
|
-
searchLimit?: number | undefined;
|
|
189
|
-
pythonFetchMetadata?: boolean | undefined;
|
|
190
|
-
})[];
|
|
191
|
-
}>;
|
|
192
|
-
export type NpmPackageQuery = z.infer<typeof NpmPackageQuerySchema>;
|
|
193
|
-
export type PythonPackageQuery = z.infer<typeof PythonPackageQuerySchema>;
|
|
194
|
-
export type PackageSearchQuery = z.infer<typeof PackageSearchQuerySchema>;
|
|
195
|
-
export type PackageSearchBulkParams = z.infer<typeof PackageSearchBulkQuerySchema>;
|
|
196
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { SanitizationResult, ValidationResult } from '../types.js';
|
|
2
|
-
export declare class ContentSanitizer {
|
|
3
|
-
static sanitizeContent(content: string): SanitizationResult;
|
|
4
|
-
private static detectSecrets;
|
|
5
|
-
static validateInputParameters(params: Record<string, unknown>): ValidationResult;
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function maskSensitiveData(text: string): string;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { CallToolResult } from '@modelcontextprotocol/sdk/types';
|
|
2
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
3
|
-
export declare function withSecurityValidation<T extends Record<string, unknown>>(toolName: string, toolHandler: (sanitizedArgs: T, authInfo?: AuthInfo, sessionId?: string) => Promise<CallToolResult>): (args: unknown, { authInfo, sessionId }: {
|
|
4
|
-
authInfo?: AuthInfo;
|
|
5
|
-
sessionId?: string;
|
|
6
|
-
}) => Promise<CallToolResult>;
|
|
7
|
-
export declare function withBasicSecurityValidation<T extends Record<string, unknown>>(toolHandler: (sanitizedArgs: T) => Promise<CallToolResult>): (args: unknown) => Promise<CallToolResult>;
|
|
8
|
-
/**
|
|
9
|
-
* Extracts research fields from a single query object.
|
|
10
|
-
* Used for logging individual queries in bulk operations.
|
|
11
|
-
*/
|
|
12
|
-
export declare function extractResearchFieldsFromSingleQuery(query: Record<string, unknown>): {
|
|
13
|
-
mainResearchGoal?: string;
|
|
14
|
-
researchGoal?: string;
|
|
15
|
-
reasoning?: string;
|
|
16
|
-
};
|
|
17
|
-
export declare function extractResearchFields(params: Record<string, unknown>): {
|
|
18
|
-
mainResearchGoal?: string;
|
|
19
|
-
researchGoal?: string;
|
|
20
|
-
reasoning?: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Extracts repository identifiers from a single query object.
|
|
24
|
-
* Used for logging individual queries in bulk operations.
|
|
25
|
-
*
|
|
26
|
-
* Supports multiple parameter formats:
|
|
27
|
-
* - Combined repository field: `repository: "owner/repo"`
|
|
28
|
-
* - Separate owner/repo fields: `owner: "owner", repo: "repo"`
|
|
29
|
-
* - Owner only: `owner: "owner"` (for tools like github_search_repos)
|
|
30
|
-
*
|
|
31
|
-
* @param query - A single query object containing repository information
|
|
32
|
-
* @returns Array of repository identifiers (typically one, but can be multiple for some tools)
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* extractRepoOwnerFromSingleQuery({ repository: "facebook/react" })
|
|
36
|
-
* // Returns: ["facebook/react"]
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* extractRepoOwnerFromSingleQuery({ owner: "microsoft", repo: "vscode" })
|
|
40
|
-
* // Returns: ["microsoft/vscode"]
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* extractRepoOwnerFromSingleQuery({ owner: "vercel" })
|
|
44
|
-
* // Returns: ["vercel"]
|
|
45
|
-
*/
|
|
46
|
-
export declare function extractRepoOwnerFromSingleQuery(query: Record<string, unknown>): string[];
|
|
47
|
-
/**
|
|
48
|
-
* Extracts repository identifiers from tool parameters for logging purposes.
|
|
49
|
-
*
|
|
50
|
-
* Supports multiple parameter formats:
|
|
51
|
-
* - Combined repository field: `repository: "owner/repo"`
|
|
52
|
-
* - Separate owner/repo fields: `owner: "owner", repo: "repo"`
|
|
53
|
-
* - Owner only: `owner: "owner"` (for tools like github_search_repos)
|
|
54
|
-
*
|
|
55
|
-
* Works with both bulk operations (queries array) and single operations (direct params).
|
|
56
|
-
*
|
|
57
|
-
* @param params - The tool parameters containing repository information
|
|
58
|
-
* @returns Array of unique repository identifiers (e.g., ["owner/repo", "owner2/repo2", "owner3"])
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* // Combined repository format
|
|
62
|
-
* extractRepoOwnerFromParams({ queries: [{ repository: "facebook/react" }] })
|
|
63
|
-
* // Returns: ["facebook/react"]
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* // Separate owner/repo format
|
|
67
|
-
* extractRepoOwnerFromParams({ queries: [{ owner: "microsoft", repo: "vscode" }] })
|
|
68
|
-
* // Returns: ["microsoft/vscode"]
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* // Owner only format (for repository search)
|
|
72
|
-
* extractRepoOwnerFromParams({ queries: [{ owner: "vercel" }] })
|
|
73
|
-
* // Returns: ["vercel"]
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* // Multiple queries with mixed formats
|
|
77
|
-
* extractRepoOwnerFromParams({
|
|
78
|
-
* queries: [
|
|
79
|
-
* { repository: "facebook/react" },
|
|
80
|
-
* { owner: "microsoft", repo: "vscode" },
|
|
81
|
-
* { owner: "vercel" }
|
|
82
|
-
* ]
|
|
83
|
-
* })
|
|
84
|
-
* // Returns: ["facebook/react", "microsoft/vscode", "vercel"]
|
|
85
|
-
*/
|
|
86
|
-
export declare function extractRepoOwnerFromParams(params: Record<string, unknown>): string[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ServerConfig } from './types.js';
|
|
2
|
-
declare function parseStringArray(value?: string): string[] | undefined;
|
|
3
|
-
export declare function initialize(): Promise<void>;
|
|
4
|
-
export declare function cleanup(): void;
|
|
5
|
-
export declare function getServerConfig(): ServerConfig;
|
|
6
|
-
export declare function getGitHubToken(): Promise<string | null>;
|
|
7
|
-
export declare function getToken(): Promise<string>;
|
|
8
|
-
export declare function isBetaEnabled(): boolean;
|
|
9
|
-
export declare function isSamplingEnabled(): boolean;
|
|
10
|
-
export declare function isLoggingEnabled(): boolean;
|
|
11
|
-
export declare function clearCachedToken(): void;
|
|
12
|
-
export { parseStringArray };
|
package/dist/src/session.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { RateLimitData } from './types.js';
|
|
2
|
-
declare class SessionManager {
|
|
3
|
-
private sessionId;
|
|
4
|
-
private readonly logEndpoint;
|
|
5
|
-
constructor();
|
|
6
|
-
getSessionId(): string;
|
|
7
|
-
logInit(): Promise<void>;
|
|
8
|
-
logToolCall(toolName: string, repos: string[], mainResearchGoal?: string, researchGoal?: string, reasoning?: string): Promise<void>;
|
|
9
|
-
logPromptCall(promptName: string): Promise<void>;
|
|
10
|
-
logError(toolName: string, errorCode: string): Promise<void>;
|
|
11
|
-
logRateLimit(data: RateLimitData): Promise<void>;
|
|
12
|
-
private sendLog;
|
|
13
|
-
}
|
|
14
|
-
export declare function initializeSession(): SessionManager;
|
|
15
|
-
export declare function getSessionManager(): SessionManager | null;
|
|
16
|
-
export declare function logSessionInit(): Promise<void>;
|
|
17
|
-
export declare function logToolCall(toolName: string, repos: string[], mainResearchGoal?: string, researchGoal?: string, reasoning?: string): Promise<void>;
|
|
18
|
-
export declare function logPromptCall(promptName: string): Promise<void>;
|
|
19
|
-
export declare function logSessionError(toolName: string, errorCode: string): Promise<void>;
|
|
20
|
-
export declare function logRateLimit(data: RateLimitData): Promise<void>;
|
|
21
|
-
export declare function resetSessionManager(): void;
|
|
22
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export declare function registerFetchGitHubFileContentTool(server: McpServer, callback?: ToolInvocationCallback): import("@modelcontextprotocol/sdk/server/mcp.js").RegisteredTool;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export declare function registerGitHubSearchCodeTool(server: McpServer, callback?: ToolInvocationCallback): import("@modelcontextprotocol/sdk/server/mcp.js").RegisteredTool;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export declare function registerSearchGitHubPullRequestsTool(server: McpServer, callback?: ToolInvocationCallback): import("@modelcontextprotocol/sdk/server/mcp.js").RegisteredTool;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export declare function registerSearchGitHubReposTool(server: McpServer, callback?: ToolInvocationCallback): import("@modelcontextprotocol/sdk/server/mcp.js").RegisteredTool;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export declare function registerViewGitHubRepoStructureTool(server: McpServer, callback?: ToolInvocationCallback): import("@modelcontextprotocol/sdk/server/mcp.js").RegisteredTool;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export declare function registerPackageSearchTool(server: McpServer, callback?: ToolInvocationCallback): Promise<RegisteredTool | null>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export interface ToolConfig {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
isDefault: boolean;
|
|
7
|
-
type: 'search' | 'content' | 'history' | 'debug';
|
|
8
|
-
fn: (server: McpServer, callback?: ToolInvocationCallback) => RegisteredTool | Promise<RegisteredTool | null>;
|
|
9
|
-
}
|
|
10
|
-
export declare const GITHUB_SEARCH_CODE: ToolConfig;
|
|
11
|
-
export declare const GITHUB_FETCH_CONTENT: ToolConfig;
|
|
12
|
-
export declare const GITHUB_VIEW_REPO_STRUCTURE: ToolConfig;
|
|
13
|
-
export declare const GITHUB_SEARCH_REPOSITORIES: ToolConfig;
|
|
14
|
-
export declare const GITHUB_SEARCH_PULL_REQUESTS: ToolConfig;
|
|
15
|
-
export declare const PACKAGE_SEARCH: ToolConfig;
|
|
16
|
-
export declare const DEFAULT_TOOLS: ToolConfig[];
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
export interface PromptArgument {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
required?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface PromptMetadata {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
content: string;
|
|
10
|
-
args?: PromptArgument[];
|
|
11
|
-
}
|
|
12
|
-
export interface ToolMetadata {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
schema: Record<string, string>;
|
|
16
|
-
hints: {
|
|
17
|
-
hasResults: readonly string[];
|
|
18
|
-
empty: readonly string[];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export interface CompleteMetadata {
|
|
22
|
-
instructions: string;
|
|
23
|
-
prompts: Record<string, PromptMetadata>;
|
|
24
|
-
toolNames: {
|
|
25
|
-
GITHUB_FETCH_CONTENT: 'githubGetFileContent';
|
|
26
|
-
GITHUB_SEARCH_CODE: 'githubSearchCode';
|
|
27
|
-
GITHUB_SEARCH_PULL_REQUESTS: 'githubSearchPullRequests';
|
|
28
|
-
GITHUB_SEARCH_REPOSITORIES: 'githubSearchRepositories';
|
|
29
|
-
GITHUB_VIEW_REPO_STRUCTURE: 'githubViewRepoStructure';
|
|
30
|
-
PACKAGE_SEARCH: 'packageSearch';
|
|
31
|
-
};
|
|
32
|
-
baseSchema: {
|
|
33
|
-
mainResearchGoal: string;
|
|
34
|
-
researchGoal: string;
|
|
35
|
-
reasoning: string;
|
|
36
|
-
bulkQuery: (toolName: string) => string;
|
|
37
|
-
};
|
|
38
|
-
tools: Record<string, ToolMetadata>;
|
|
39
|
-
baseHints: {
|
|
40
|
-
hasResults: readonly string[];
|
|
41
|
-
empty: readonly string[];
|
|
42
|
-
};
|
|
43
|
-
genericErrorHints: readonly string[];
|
|
44
|
-
}
|
|
45
|
-
type ToolNamesValue = CompleteMetadata['toolNames'][keyof CompleteMetadata['toolNames']];
|
|
46
|
-
export type ToolName = ToolNamesValue;
|
|
47
|
-
export declare function initializeToolMetadata(): Promise<void>;
|
|
48
|
-
export declare function loadToolContent(): Promise<CompleteMetadata>;
|
|
49
|
-
export declare const TOOL_NAMES: CompleteMetadata["toolNames"];
|
|
50
|
-
export declare const BASE_SCHEMA: CompleteMetadata["baseSchema"];
|
|
51
|
-
export declare const GENERIC_ERROR_HINTS: readonly string[];
|
|
52
|
-
export declare function isToolAvailableSync(toolName: string): boolean;
|
|
53
|
-
export declare function getToolHintsSync(toolName: string, resultType: 'hasResults' | 'empty'): readonly string[];
|
|
54
|
-
export declare function getGenericErrorHintsSync(): readonly string[];
|
|
55
|
-
export declare function getDynamicHints(toolName: string, hintType: 'topicsHasResults' | 'topicsEmpty' | 'keywordsEmpty'): readonly string[];
|
|
56
|
-
export declare const DESCRIPTIONS: Record<string, string>;
|
|
57
|
-
export declare const TOOL_HINTS: Record<string, {
|
|
58
|
-
hasResults: readonly string[];
|
|
59
|
-
empty: readonly string[];
|
|
60
|
-
}> & {
|
|
61
|
-
base: {
|
|
62
|
-
hasResults: readonly string[];
|
|
63
|
-
empty: readonly string[];
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export declare const GITHUB_FETCH_CONTENT: {
|
|
67
|
-
scope: {
|
|
68
|
-
owner: string;
|
|
69
|
-
repo: string;
|
|
70
|
-
branch: string;
|
|
71
|
-
path: string;
|
|
72
|
-
};
|
|
73
|
-
processing: {
|
|
74
|
-
minified: string;
|
|
75
|
-
sanitize: string;
|
|
76
|
-
addTimestamp: string;
|
|
77
|
-
};
|
|
78
|
-
range: {
|
|
79
|
-
startLine: string;
|
|
80
|
-
endLine: string;
|
|
81
|
-
fullContent: string;
|
|
82
|
-
matchString: string;
|
|
83
|
-
matchStringContextLines: string;
|
|
84
|
-
};
|
|
85
|
-
validation: {
|
|
86
|
-
parameterConflict: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export declare const GITHUB_SEARCH_CODE: {
|
|
90
|
-
search: {
|
|
91
|
-
keywordsToSearch: string;
|
|
92
|
-
};
|
|
93
|
-
scope: {
|
|
94
|
-
owner: string;
|
|
95
|
-
repo: string;
|
|
96
|
-
};
|
|
97
|
-
filters: {
|
|
98
|
-
extension: string;
|
|
99
|
-
stars: string;
|
|
100
|
-
filename: string;
|
|
101
|
-
path: string;
|
|
102
|
-
match: string;
|
|
103
|
-
};
|
|
104
|
-
resultLimit: {
|
|
105
|
-
limit: string;
|
|
106
|
-
};
|
|
107
|
-
processing: {
|
|
108
|
-
minify: string;
|
|
109
|
-
sanitize: string;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
export declare const GITHUB_SEARCH_REPOS: {
|
|
113
|
-
search: {
|
|
114
|
-
keywordsToSearch: string;
|
|
115
|
-
topicsToSearch: string;
|
|
116
|
-
};
|
|
117
|
-
scope: {
|
|
118
|
-
owner: string;
|
|
119
|
-
repo: string;
|
|
120
|
-
};
|
|
121
|
-
filters: {
|
|
122
|
-
stars: string;
|
|
123
|
-
size: string;
|
|
124
|
-
created: string;
|
|
125
|
-
updated: string;
|
|
126
|
-
match: string;
|
|
127
|
-
};
|
|
128
|
-
sorting: {
|
|
129
|
-
sort: string;
|
|
130
|
-
};
|
|
131
|
-
resultLimit: {
|
|
132
|
-
limit: string;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
export declare const GITHUB_SEARCH_PULL_REQUESTS: {
|
|
136
|
-
search: {
|
|
137
|
-
query: string;
|
|
138
|
-
};
|
|
139
|
-
scope: {
|
|
140
|
-
prNumber: string;
|
|
141
|
-
owner: string;
|
|
142
|
-
repo: string;
|
|
143
|
-
};
|
|
144
|
-
filters: {
|
|
145
|
-
match: string;
|
|
146
|
-
created: string;
|
|
147
|
-
updated: string;
|
|
148
|
-
state: string;
|
|
149
|
-
assignee: string;
|
|
150
|
-
author: string;
|
|
151
|
-
commenter: string;
|
|
152
|
-
involves: string;
|
|
153
|
-
mentions: string;
|
|
154
|
-
"review-requested": string;
|
|
155
|
-
"reviewed-by": string;
|
|
156
|
-
label: string;
|
|
157
|
-
"no-label": string;
|
|
158
|
-
"no-milestone": string;
|
|
159
|
-
"no-project": string;
|
|
160
|
-
"no-assignee": string;
|
|
161
|
-
head: string;
|
|
162
|
-
base: string;
|
|
163
|
-
closed: string;
|
|
164
|
-
"merged-at": string;
|
|
165
|
-
comments: string;
|
|
166
|
-
reactions: string;
|
|
167
|
-
interactions: string;
|
|
168
|
-
merged: string;
|
|
169
|
-
draft: string;
|
|
170
|
-
};
|
|
171
|
-
sorting: {
|
|
172
|
-
sort: string;
|
|
173
|
-
order: string;
|
|
174
|
-
};
|
|
175
|
-
resultLimit: {
|
|
176
|
-
limit: string;
|
|
177
|
-
};
|
|
178
|
-
outputShaping: {
|
|
179
|
-
withComments: string;
|
|
180
|
-
withCommits: string;
|
|
181
|
-
type: string;
|
|
182
|
-
partialContentMetadata: string;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
export declare const GITHUB_VIEW_REPO_STRUCTURE: {
|
|
186
|
-
scope: {
|
|
187
|
-
owner: string;
|
|
188
|
-
repo: string;
|
|
189
|
-
branch: string;
|
|
190
|
-
path: string;
|
|
191
|
-
};
|
|
192
|
-
range: {
|
|
193
|
-
depth: string;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
export declare const PACKAGE_SEARCH: {
|
|
197
|
-
search: {
|
|
198
|
-
ecosystem: string;
|
|
199
|
-
name: string;
|
|
200
|
-
};
|
|
201
|
-
options: {
|
|
202
|
-
searchLimit: string;
|
|
203
|
-
npmFetchMetadata: string;
|
|
204
|
-
pythonFetchMetadata: string;
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { ToolInvocationCallback } from '../types.js';
|
|
3
|
-
export declare function registerTools(server: McpServer, callback?: ToolInvocationCallback): {
|
|
4
|
-
successCount: number;
|
|
5
|
-
failedTools: string[];
|
|
6
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { GitHubAPIError } from '../github/githubAPI';
|
|
2
|
-
import type { ToolErrorResult, ToolSuccessResult } from '../types.js';
|
|
3
|
-
import { TOOL_NAMES } from './toolMetadata.js';
|
|
4
|
-
export declare function createErrorResult(query: {
|
|
5
|
-
mainResearchGoal?: string;
|
|
6
|
-
researchGoal?: string;
|
|
7
|
-
reasoning?: string;
|
|
8
|
-
}, error: string | GitHubAPIError, apiError?: GitHubAPIError): ToolErrorResult;
|
|
9
|
-
export declare function createSuccessResult<T>(query: {
|
|
10
|
-
mainResearchGoal?: string;
|
|
11
|
-
researchGoal?: string;
|
|
12
|
-
reasoning?: string;
|
|
13
|
-
}, data: T, hasContent: boolean, _toolName: keyof typeof TOOL_NAMES, customHints?: string[]): ToolSuccessResult<T extends Record<string, unknown> ? T : never> & T;
|
|
14
|
-
export declare function handleApiError(apiResult: unknown, query: {
|
|
15
|
-
mainResearchGoal?: string;
|
|
16
|
-
researchGoal?: string;
|
|
17
|
-
reasoning?: string;
|
|
18
|
-
}): ToolErrorResult | null;
|
|
19
|
-
export declare function handleCatchError(error: unknown, query: {
|
|
20
|
-
mainResearchGoal?: string;
|
|
21
|
-
researchGoal?: string;
|
|
22
|
-
reasoning?: string;
|
|
23
|
-
}, contextMessage?: string): ToolErrorResult;
|