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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "octocode-mcp",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for advanced GitHub repository analysis and code discovery. Provides AI assistants with powerful tools to search, analyze, and understand codebases across GitHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -41,21 +41,35 @@
|
|
|
41
41
|
"@octokit/plugin-rest-endpoint-methods": "^17.0.0",
|
|
42
42
|
"@octokit/plugin-throttling": "^11.0.3",
|
|
43
43
|
"axios": "^1.13.2",
|
|
44
|
+
"clean-css": "^5.3.0",
|
|
44
45
|
"dotenv": "^17.2.3",
|
|
45
46
|
"express": "^5.1.0",
|
|
47
|
+
"html-minifier-terser": "^7.2.0",
|
|
48
|
+
"js-yaml": "^4.1.0",
|
|
46
49
|
"node-cache": "^5.1.2",
|
|
47
|
-
"octocode-utils": "^6.0.0",
|
|
48
50
|
"octokit": "^5.0.5",
|
|
51
|
+
"terser": "^5.19.0",
|
|
49
52
|
"uuid": "^13.0.0",
|
|
50
|
-
"zod": "^3.
|
|
53
|
+
"zod": "^3.24.0"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
56
|
+
"@microsoft/tiktokenizer": "^1.0.10",
|
|
57
|
+
"@types/clean-css": "^4.2.11",
|
|
53
58
|
"@types/express": "^5",
|
|
59
|
+
"@types/html-minifier-terser": "^7.0.2",
|
|
60
|
+
"@types/js-yaml": "^4.0.9",
|
|
61
|
+
"@types/node": "^22.15.29",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
63
|
+
"@typescript-eslint/parser": "^8.32.0",
|
|
64
|
+
"@vitest/coverage-v8": "^4.0.13",
|
|
65
|
+
"@vitest/ui": "^4.0.13",
|
|
54
66
|
"eslint": "^8.57.0",
|
|
67
|
+
"eslint-config-prettier": "^10.1.5",
|
|
68
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
55
69
|
"prettier": "^3.5.3",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"typescript": "^5.9.
|
|
70
|
+
"tslib": "^2.8.1",
|
|
71
|
+
"tsup": "^8.4.0",
|
|
72
|
+
"typescript": "^5.9.3",
|
|
59
73
|
"vitest": "^4.0.13"
|
|
60
74
|
},
|
|
61
75
|
"engines": {
|
|
@@ -63,13 +77,11 @@
|
|
|
63
77
|
},
|
|
64
78
|
"exports": {
|
|
65
79
|
".": {
|
|
66
|
-
"types": "./dist/src/index.d.ts",
|
|
67
80
|
"import": "./dist/index.js"
|
|
68
81
|
}
|
|
69
82
|
},
|
|
70
83
|
"files": [
|
|
71
84
|
"dist/index.js",
|
|
72
|
-
"dist/**/*.d.ts",
|
|
73
85
|
"manifest.json",
|
|
74
86
|
"server.json",
|
|
75
87
|
"LICENSE"
|
|
@@ -82,9 +94,17 @@
|
|
|
82
94
|
},
|
|
83
95
|
"mcpName": "io.github.bgauryy/octocode-mcp",
|
|
84
96
|
"scripts": {
|
|
85
|
-
"build": "yarn lint && yarn clean &&
|
|
86
|
-
"build:
|
|
87
|
-
"build:
|
|
97
|
+
"build": "yarn lint && yarn clean && tsup",
|
|
98
|
+
"build:bin": "bun build ./src/index.ts --compile --minify --sourcemap --outfile dist/octocode-mcp",
|
|
99
|
+
"build:bin:all": "bun run build:bin:linux-x64 && bun run build:bin:linux-arm64 && bun run build:bin:linux-x64-musl && bun run build:bin:darwin-arm64 && bun run build:bin:darwin-x64 && bun run build:bin:windows-x64",
|
|
100
|
+
"build:bin:darwin-arm64": "bun build ./src/index.ts --compile --minify --sourcemap --target=bun-darwin-arm64 --outfile dist/octocode-mcp-darwin-arm64",
|
|
101
|
+
"build:bin:darwin-x64": "bun build ./src/index.ts --compile --minify --sourcemap --target=bun-darwin-x64 --outfile dist/octocode-mcp-darwin-x64",
|
|
102
|
+
"build:bin:linux-arm64": "bun build ./src/index.ts --compile --minify --sourcemap --target=bun-linux-arm64 --outfile dist/octocode-mcp-linux-arm64",
|
|
103
|
+
"build:bin:linux-x64": "bun build ./src/index.ts --compile --minify --sourcemap --target=bun-linux-x64 --outfile dist/octocode-mcp-linux-x64",
|
|
104
|
+
"build:bin:linux-x64-musl": "bun build ./src/index.ts --compile --minify --sourcemap --target=bun-linux-x64-musl --outfile dist/octocode-mcp-linux-x64-musl",
|
|
105
|
+
"build:bin:windows-x64": "bun build ./src/index.ts --compile --minify --sourcemap --target=bun-windows-x64 --outfile dist/octocode-mcp-windows-x64.exe",
|
|
106
|
+
"build:dev": "yarn clean && tsup",
|
|
107
|
+
"build:watch": "tsup --watch",
|
|
88
108
|
"clean": "rm -rf dist/",
|
|
89
109
|
"debug": "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
90
110
|
"dxt:pack": "yarn build && dxt pack . octocode-mcp.dxt",
|
|
@@ -95,13 +115,12 @@
|
|
|
95
115
|
"lint": "eslint src/**/*.ts tests/**/*.ts",
|
|
96
116
|
"lint:fix": "eslint src/**/*.ts tests/**/*.ts --fix",
|
|
97
117
|
"prepack": "yarn build",
|
|
98
|
-
"prepublishOnly": "yarn lint && yarn test &&
|
|
118
|
+
"prepublishOnly": "yarn lint && yarn test && tsup",
|
|
99
119
|
"test": "vitest run --coverage",
|
|
100
120
|
"test:coverage": "vitest run --coverage",
|
|
101
121
|
"test:quiet": "vitest run --reporter=dot --silent",
|
|
102
122
|
"test:ui": "vitest --ui",
|
|
103
123
|
"test:watch": "vitest --watch"
|
|
104
124
|
},
|
|
105
|
-
"type": "module"
|
|
106
|
-
|
|
107
|
-
}
|
|
125
|
+
"type": "module"
|
|
126
|
+
}
|
package/dist/src/errorCodes.d.ts
DELETED
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
export declare const CONFIG_ERRORS: {
|
|
2
|
-
readonly NOT_INITIALIZED: {
|
|
3
|
-
readonly code: "CONFIG_NOT_INITIALIZED";
|
|
4
|
-
readonly message: "Configuration not initialized. Call initialize() and await its completion before calling getServerConfig().";
|
|
5
|
-
};
|
|
6
|
-
readonly NO_GITHUB_TOKEN: {
|
|
7
|
-
readonly code: "CONFIG_NO_GITHUB_TOKEN";
|
|
8
|
-
readonly message: "No GitHub token found. Please authenticate with GitHub CLI (gh auth login) or set GITHUB_TOKEN/GH_TOKEN environment variable";
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare const VALIDATION_ERRORS: {
|
|
12
|
-
readonly PROMISES_NOT_ARRAY: {
|
|
13
|
-
readonly code: "VALIDATION_PROMISES_NOT_ARRAY";
|
|
14
|
-
readonly message: "promises must be an array";
|
|
15
|
-
};
|
|
16
|
-
readonly TIMEOUT_NOT_POSITIVE: {
|
|
17
|
-
readonly code: "VALIDATION_TIMEOUT_NOT_POSITIVE";
|
|
18
|
-
readonly message: "timeout must be positive";
|
|
19
|
-
};
|
|
20
|
-
readonly CONCURRENCY_NOT_POSITIVE: {
|
|
21
|
-
readonly code: "VALIDATION_CONCURRENCY_NOT_POSITIVE";
|
|
22
|
-
readonly message: "concurrency must be positive";
|
|
23
|
-
};
|
|
24
|
-
readonly INVALID_PARAMETERS: {
|
|
25
|
-
readonly code: "VALIDATION_INVALID_PARAMETERS";
|
|
26
|
-
readonly message: "Invalid parameters: must be an object";
|
|
27
|
-
};
|
|
28
|
-
readonly INVALID_PARAMETER_KEY: {
|
|
29
|
-
readonly code: "VALIDATION_INVALID_PARAMETER_KEY";
|
|
30
|
-
readonly message: (key: string) => string;
|
|
31
|
-
};
|
|
32
|
-
readonly INVALID_NESTED_OBJECT: {
|
|
33
|
-
readonly code: "VALIDATION_INVALID_NESTED_OBJECT";
|
|
34
|
-
readonly message: (key: string, warnings: string) => string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export declare const FETCH_ERRORS: {
|
|
38
|
-
readonly FETCH_NOT_AVAILABLE: {
|
|
39
|
-
readonly code: "FETCH_NOT_AVAILABLE";
|
|
40
|
-
readonly message: "Global fetch is not available in this environment.";
|
|
41
|
-
};
|
|
42
|
-
readonly FETCH_FAILED_AFTER_RETRIES: {
|
|
43
|
-
readonly code: "FETCH_FAILED_AFTER_RETRIES";
|
|
44
|
-
readonly message: (attempts: number, errorMessage: string) => string;
|
|
45
|
-
};
|
|
46
|
-
readonly FETCH_HTTP_ERROR: {
|
|
47
|
-
readonly code: "FETCH_HTTP_ERROR";
|
|
48
|
-
readonly message: (status: number, statusText: string) => string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export declare const TOOL_METADATA_ERRORS: {
|
|
52
|
-
readonly INVALID_FORMAT: {
|
|
53
|
-
readonly code: "TOOL_METADATA_INVALID_FORMAT";
|
|
54
|
-
readonly message: "Invalid tool metadata format from remote source.";
|
|
55
|
-
};
|
|
56
|
-
readonly INVALID_API_RESPONSE: {
|
|
57
|
-
readonly code: "TOOL_METADATA_INVALID_API_RESPONSE";
|
|
58
|
-
readonly message: "Invalid API response structure";
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export declare const FILE_OPERATION_ERRORS: {
|
|
62
|
-
readonly PATH_IS_DIRECTORY: {
|
|
63
|
-
readonly code: "FILE_PATH_IS_DIRECTORY";
|
|
64
|
-
readonly message: (toolName: string) => string;
|
|
65
|
-
};
|
|
66
|
-
readonly FILE_TOO_LARGE: {
|
|
67
|
-
readonly code: "FILE_TOO_LARGE";
|
|
68
|
-
readonly message: (fileSizeKB: number, maxSizeKB: number, toolName: string) => string;
|
|
69
|
-
};
|
|
70
|
-
readonly FILE_EMPTY: {
|
|
71
|
-
readonly code: "FILE_EMPTY";
|
|
72
|
-
readonly message: "File is empty - no content to display";
|
|
73
|
-
};
|
|
74
|
-
readonly BINARY_FILE: {
|
|
75
|
-
readonly code: "FILE_BINARY";
|
|
76
|
-
readonly message: "Binary file detected. Cannot display as text - download directly from GitHub";
|
|
77
|
-
};
|
|
78
|
-
readonly DECODE_FAILED: {
|
|
79
|
-
readonly code: "FILE_DECODE_FAILED";
|
|
80
|
-
readonly message: "Failed to decode file. Encoding may not be supported (expected UTF-8)";
|
|
81
|
-
};
|
|
82
|
-
readonly UNSUPPORTED_TYPE: {
|
|
83
|
-
readonly code: "FILE_UNSUPPORTED_TYPE";
|
|
84
|
-
readonly message: (type: string) => string;
|
|
85
|
-
};
|
|
86
|
-
readonly MATCH_STRING_NOT_FOUND: {
|
|
87
|
-
readonly code: "FILE_MATCH_STRING_NOT_FOUND";
|
|
88
|
-
readonly message: (matchString: string) => string;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
export declare const REPOSITORY_ERRORS: {
|
|
92
|
-
readonly NOT_FOUND: {
|
|
93
|
-
readonly code: "REPO_NOT_FOUND";
|
|
94
|
-
readonly message: (owner: string, repo: string, error: string) => string;
|
|
95
|
-
};
|
|
96
|
-
readonly PATH_NOT_FOUND: {
|
|
97
|
-
readonly code: "REPO_PATH_NOT_FOUND";
|
|
98
|
-
readonly message: (path: string, owner: string, repo: string, branch: string) => string;
|
|
99
|
-
};
|
|
100
|
-
readonly PATH_NOT_FOUND_ANY_BRANCH: {
|
|
101
|
-
readonly code: "REPO_PATH_NOT_FOUND_ANY_BRANCH";
|
|
102
|
-
readonly message: (path: string, owner: string, repo: string) => string;
|
|
103
|
-
};
|
|
104
|
-
readonly ACCESS_FAILED: {
|
|
105
|
-
readonly code: "REPO_ACCESS_FAILED";
|
|
106
|
-
readonly message: (owner: string, repo: string, error: string) => string;
|
|
107
|
-
};
|
|
108
|
-
readonly BRANCH_NOT_FOUND: {
|
|
109
|
-
readonly code: "REPO_BRANCH_NOT_FOUND";
|
|
110
|
-
readonly message: (branch: string) => string;
|
|
111
|
-
};
|
|
112
|
-
readonly STRUCTURE_EXPLORATION_FAILED: {
|
|
113
|
-
readonly code: "REPO_STRUCTURE_EXPLORATION_FAILED";
|
|
114
|
-
readonly message: "Failed to explore repository structure";
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
export declare const SEARCH_ERRORS: {
|
|
118
|
-
readonly QUERY_EMPTY: {
|
|
119
|
-
readonly code: "SEARCH_QUERY_EMPTY";
|
|
120
|
-
readonly message: "Search query cannot be empty";
|
|
121
|
-
};
|
|
122
|
-
readonly NO_VALID_PARAMETERS: {
|
|
123
|
-
readonly code: "SEARCH_NO_VALID_PARAMETERS";
|
|
124
|
-
readonly message: "No valid search parameters provided";
|
|
125
|
-
};
|
|
126
|
-
readonly PR_REQUIRED_PARAMS: {
|
|
127
|
-
readonly code: "SEARCH_PR_REQUIRED_PARAMS";
|
|
128
|
-
readonly message: "Owner, repo, and prNumber are required parameters";
|
|
129
|
-
};
|
|
130
|
-
readonly PR_SINGLE_VALUES: {
|
|
131
|
-
readonly code: "SEARCH_PR_SINGLE_VALUES";
|
|
132
|
-
readonly message: "Owner and repo must be single values";
|
|
133
|
-
};
|
|
134
|
-
readonly API_REQUEST_FAILED: {
|
|
135
|
-
readonly code: "SEARCH_API_REQUEST_FAILED";
|
|
136
|
-
readonly message: (error: string) => string;
|
|
137
|
-
};
|
|
138
|
-
readonly PULL_REQUEST_SEARCH_FAILED: {
|
|
139
|
-
readonly code: "SEARCH_PR_SEARCH_FAILED";
|
|
140
|
-
readonly message: (error: string) => string;
|
|
141
|
-
};
|
|
142
|
-
readonly PULL_REQUEST_LIST_FAILED: {
|
|
143
|
-
readonly code: "SEARCH_PR_LIST_FAILED";
|
|
144
|
-
readonly message: (error: string) => string;
|
|
145
|
-
};
|
|
146
|
-
readonly PULL_REQUEST_FETCH_FAILED: {
|
|
147
|
-
readonly code: "SEARCH_PR_FETCH_FAILED";
|
|
148
|
-
readonly message: (prNumber: number, error: string) => string;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
export declare const STARTUP_ERRORS: {
|
|
152
|
-
readonly NO_TOOLS_REGISTERED: {
|
|
153
|
-
readonly code: "STARTUP_NO_TOOLS_REGISTERED";
|
|
154
|
-
readonly message: "No tools were successfully registered";
|
|
155
|
-
};
|
|
156
|
-
readonly UNCAUGHT_EXCEPTION: {
|
|
157
|
-
readonly code: "STARTUP_UNCAUGHT_EXCEPTION";
|
|
158
|
-
readonly message: (error: string) => string;
|
|
159
|
-
};
|
|
160
|
-
readonly UNHANDLED_REJECTION: {
|
|
161
|
-
readonly code: "STARTUP_UNHANDLED_REJECTION";
|
|
162
|
-
readonly message: (reason: string) => string;
|
|
163
|
-
};
|
|
164
|
-
readonly STARTUP_FAILED: {
|
|
165
|
-
readonly code: "STARTUP_FAILED";
|
|
166
|
-
readonly message: (error: string) => string;
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
export declare const PROMISE_ERRORS: {
|
|
170
|
-
readonly TIMEOUT: {
|
|
171
|
-
readonly code: "PROMISE_TIMEOUT";
|
|
172
|
-
readonly message: (index: number, timeout: number) => string;
|
|
173
|
-
};
|
|
174
|
-
readonly NOT_A_FUNCTION: {
|
|
175
|
-
readonly code: "PROMISE_NOT_A_FUNCTION";
|
|
176
|
-
readonly message: (index: number) => string;
|
|
177
|
-
};
|
|
178
|
-
readonly FUNCTION_UNDEFINED: {
|
|
179
|
-
readonly code: "PROMISE_FUNCTION_UNDEFINED";
|
|
180
|
-
readonly message: "Promise function is undefined";
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
export declare const ALL_ERROR_CODES: {
|
|
184
|
-
readonly TIMEOUT: {
|
|
185
|
-
readonly code: "PROMISE_TIMEOUT";
|
|
186
|
-
readonly message: (index: number, timeout: number) => string;
|
|
187
|
-
};
|
|
188
|
-
readonly NOT_A_FUNCTION: {
|
|
189
|
-
readonly code: "PROMISE_NOT_A_FUNCTION";
|
|
190
|
-
readonly message: (index: number) => string;
|
|
191
|
-
};
|
|
192
|
-
readonly FUNCTION_UNDEFINED: {
|
|
193
|
-
readonly code: "PROMISE_FUNCTION_UNDEFINED";
|
|
194
|
-
readonly message: "Promise function is undefined";
|
|
195
|
-
};
|
|
196
|
-
readonly NO_TOOLS_REGISTERED: {
|
|
197
|
-
readonly code: "STARTUP_NO_TOOLS_REGISTERED";
|
|
198
|
-
readonly message: "No tools were successfully registered";
|
|
199
|
-
};
|
|
200
|
-
readonly UNCAUGHT_EXCEPTION: {
|
|
201
|
-
readonly code: "STARTUP_UNCAUGHT_EXCEPTION";
|
|
202
|
-
readonly message: (error: string) => string;
|
|
203
|
-
};
|
|
204
|
-
readonly UNHANDLED_REJECTION: {
|
|
205
|
-
readonly code: "STARTUP_UNHANDLED_REJECTION";
|
|
206
|
-
readonly message: (reason: string) => string;
|
|
207
|
-
};
|
|
208
|
-
readonly STARTUP_FAILED: {
|
|
209
|
-
readonly code: "STARTUP_FAILED";
|
|
210
|
-
readonly message: (error: string) => string;
|
|
211
|
-
};
|
|
212
|
-
readonly QUERY_EMPTY: {
|
|
213
|
-
readonly code: "SEARCH_QUERY_EMPTY";
|
|
214
|
-
readonly message: "Search query cannot be empty";
|
|
215
|
-
};
|
|
216
|
-
readonly NO_VALID_PARAMETERS: {
|
|
217
|
-
readonly code: "SEARCH_NO_VALID_PARAMETERS";
|
|
218
|
-
readonly message: "No valid search parameters provided";
|
|
219
|
-
};
|
|
220
|
-
readonly PR_REQUIRED_PARAMS: {
|
|
221
|
-
readonly code: "SEARCH_PR_REQUIRED_PARAMS";
|
|
222
|
-
readonly message: "Owner, repo, and prNumber are required parameters";
|
|
223
|
-
};
|
|
224
|
-
readonly PR_SINGLE_VALUES: {
|
|
225
|
-
readonly code: "SEARCH_PR_SINGLE_VALUES";
|
|
226
|
-
readonly message: "Owner and repo must be single values";
|
|
227
|
-
};
|
|
228
|
-
readonly API_REQUEST_FAILED: {
|
|
229
|
-
readonly code: "SEARCH_API_REQUEST_FAILED";
|
|
230
|
-
readonly message: (error: string) => string;
|
|
231
|
-
};
|
|
232
|
-
readonly PULL_REQUEST_SEARCH_FAILED: {
|
|
233
|
-
readonly code: "SEARCH_PR_SEARCH_FAILED";
|
|
234
|
-
readonly message: (error: string) => string;
|
|
235
|
-
};
|
|
236
|
-
readonly PULL_REQUEST_LIST_FAILED: {
|
|
237
|
-
readonly code: "SEARCH_PR_LIST_FAILED";
|
|
238
|
-
readonly message: (error: string) => string;
|
|
239
|
-
};
|
|
240
|
-
readonly PULL_REQUEST_FETCH_FAILED: {
|
|
241
|
-
readonly code: "SEARCH_PR_FETCH_FAILED";
|
|
242
|
-
readonly message: (prNumber: number, error: string) => string;
|
|
243
|
-
};
|
|
244
|
-
readonly NOT_FOUND: {
|
|
245
|
-
readonly code: "REPO_NOT_FOUND";
|
|
246
|
-
readonly message: (owner: string, repo: string, error: string) => string;
|
|
247
|
-
};
|
|
248
|
-
readonly PATH_NOT_FOUND: {
|
|
249
|
-
readonly code: "REPO_PATH_NOT_FOUND";
|
|
250
|
-
readonly message: (path: string, owner: string, repo: string, branch: string) => string;
|
|
251
|
-
};
|
|
252
|
-
readonly PATH_NOT_FOUND_ANY_BRANCH: {
|
|
253
|
-
readonly code: "REPO_PATH_NOT_FOUND_ANY_BRANCH";
|
|
254
|
-
readonly message: (path: string, owner: string, repo: string) => string;
|
|
255
|
-
};
|
|
256
|
-
readonly ACCESS_FAILED: {
|
|
257
|
-
readonly code: "REPO_ACCESS_FAILED";
|
|
258
|
-
readonly message: (owner: string, repo: string, error: string) => string;
|
|
259
|
-
};
|
|
260
|
-
readonly BRANCH_NOT_FOUND: {
|
|
261
|
-
readonly code: "REPO_BRANCH_NOT_FOUND";
|
|
262
|
-
readonly message: (branch: string) => string;
|
|
263
|
-
};
|
|
264
|
-
readonly STRUCTURE_EXPLORATION_FAILED: {
|
|
265
|
-
readonly code: "REPO_STRUCTURE_EXPLORATION_FAILED";
|
|
266
|
-
readonly message: "Failed to explore repository structure";
|
|
267
|
-
};
|
|
268
|
-
readonly PATH_IS_DIRECTORY: {
|
|
269
|
-
readonly code: "FILE_PATH_IS_DIRECTORY";
|
|
270
|
-
readonly message: (toolName: string) => string;
|
|
271
|
-
};
|
|
272
|
-
readonly FILE_TOO_LARGE: {
|
|
273
|
-
readonly code: "FILE_TOO_LARGE";
|
|
274
|
-
readonly message: (fileSizeKB: number, maxSizeKB: number, toolName: string) => string;
|
|
275
|
-
};
|
|
276
|
-
readonly FILE_EMPTY: {
|
|
277
|
-
readonly code: "FILE_EMPTY";
|
|
278
|
-
readonly message: "File is empty - no content to display";
|
|
279
|
-
};
|
|
280
|
-
readonly BINARY_FILE: {
|
|
281
|
-
readonly code: "FILE_BINARY";
|
|
282
|
-
readonly message: "Binary file detected. Cannot display as text - download directly from GitHub";
|
|
283
|
-
};
|
|
284
|
-
readonly DECODE_FAILED: {
|
|
285
|
-
readonly code: "FILE_DECODE_FAILED";
|
|
286
|
-
readonly message: "Failed to decode file. Encoding may not be supported (expected UTF-8)";
|
|
287
|
-
};
|
|
288
|
-
readonly UNSUPPORTED_TYPE: {
|
|
289
|
-
readonly code: "FILE_UNSUPPORTED_TYPE";
|
|
290
|
-
readonly message: (type: string) => string;
|
|
291
|
-
};
|
|
292
|
-
readonly MATCH_STRING_NOT_FOUND: {
|
|
293
|
-
readonly code: "FILE_MATCH_STRING_NOT_FOUND";
|
|
294
|
-
readonly message: (matchString: string) => string;
|
|
295
|
-
};
|
|
296
|
-
readonly INVALID_FORMAT: {
|
|
297
|
-
readonly code: "TOOL_METADATA_INVALID_FORMAT";
|
|
298
|
-
readonly message: "Invalid tool metadata format from remote source.";
|
|
299
|
-
};
|
|
300
|
-
readonly INVALID_API_RESPONSE: {
|
|
301
|
-
readonly code: "TOOL_METADATA_INVALID_API_RESPONSE";
|
|
302
|
-
readonly message: "Invalid API response structure";
|
|
303
|
-
};
|
|
304
|
-
readonly FETCH_NOT_AVAILABLE: {
|
|
305
|
-
readonly code: "FETCH_NOT_AVAILABLE";
|
|
306
|
-
readonly message: "Global fetch is not available in this environment.";
|
|
307
|
-
};
|
|
308
|
-
readonly FETCH_FAILED_AFTER_RETRIES: {
|
|
309
|
-
readonly code: "FETCH_FAILED_AFTER_RETRIES";
|
|
310
|
-
readonly message: (attempts: number, errorMessage: string) => string;
|
|
311
|
-
};
|
|
312
|
-
readonly FETCH_HTTP_ERROR: {
|
|
313
|
-
readonly code: "FETCH_HTTP_ERROR";
|
|
314
|
-
readonly message: (status: number, statusText: string) => string;
|
|
315
|
-
};
|
|
316
|
-
readonly PROMISES_NOT_ARRAY: {
|
|
317
|
-
readonly code: "VALIDATION_PROMISES_NOT_ARRAY";
|
|
318
|
-
readonly message: "promises must be an array";
|
|
319
|
-
};
|
|
320
|
-
readonly TIMEOUT_NOT_POSITIVE: {
|
|
321
|
-
readonly code: "VALIDATION_TIMEOUT_NOT_POSITIVE";
|
|
322
|
-
readonly message: "timeout must be positive";
|
|
323
|
-
};
|
|
324
|
-
readonly CONCURRENCY_NOT_POSITIVE: {
|
|
325
|
-
readonly code: "VALIDATION_CONCURRENCY_NOT_POSITIVE";
|
|
326
|
-
readonly message: "concurrency must be positive";
|
|
327
|
-
};
|
|
328
|
-
readonly INVALID_PARAMETERS: {
|
|
329
|
-
readonly code: "VALIDATION_INVALID_PARAMETERS";
|
|
330
|
-
readonly message: "Invalid parameters: must be an object";
|
|
331
|
-
};
|
|
332
|
-
readonly INVALID_PARAMETER_KEY: {
|
|
333
|
-
readonly code: "VALIDATION_INVALID_PARAMETER_KEY";
|
|
334
|
-
readonly message: (key: string) => string;
|
|
335
|
-
};
|
|
336
|
-
readonly INVALID_NESTED_OBJECT: {
|
|
337
|
-
readonly code: "VALIDATION_INVALID_NESTED_OBJECT";
|
|
338
|
-
readonly message: (key: string, warnings: string) => string;
|
|
339
|
-
};
|
|
340
|
-
readonly NOT_INITIALIZED: {
|
|
341
|
-
readonly code: "CONFIG_NOT_INITIALIZED";
|
|
342
|
-
readonly message: "Configuration not initialized. Call initialize() and await its completion before calling getServerConfig().";
|
|
343
|
-
};
|
|
344
|
-
readonly NO_GITHUB_TOKEN: {
|
|
345
|
-
readonly code: "CONFIG_NO_GITHUB_TOKEN";
|
|
346
|
-
readonly message: "No GitHub token found. Please authenticate with GitHub CLI (gh auth login) or set GITHUB_TOKEN/GH_TOKEN environment variable";
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
export type ErrorCategory = 'CONFIG' | 'VALIDATION' | 'FETCH' | 'TOOL_METADATA' | 'FILE_OPERATION' | 'REPOSITORY' | 'SEARCH' | 'STARTUP' | 'PROMISE';
|
|
350
|
-
export type ErrorCode = (typeof ALL_ERROR_CODES)[keyof typeof ALL_ERROR_CODES]['code'];
|
|
351
|
-
export declare function getErrorsByCategory(category: ErrorCategory): Record<string, unknown>;
|
|
352
|
-
export declare function getAllErrorCodes(): string[];
|
|
353
|
-
export declare function isValidErrorCode(code: string): boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
2
|
-
export declare const OctokitWithThrottling: any;
|
|
3
|
-
export declare function getOctokit(authInfo?: AuthInfo): Promise<InstanceType<typeof OctokitWithThrottling>>;
|
|
4
|
-
export declare function clearCachedToken(): void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { GitHubAPIResponse, OptimizedCodeSearchResult } from './githubAPI';
|
|
2
|
-
import { GitHubCodeSearchQuery } from '../types';
|
|
3
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
4
|
-
export declare function searchGitHubCodeAPI(params: GitHubCodeSearchQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<OptimizedCodeSearchResult>>;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub API Error Constants
|
|
3
|
-
* Centralized error definitions with keys, messages, and explanations
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Error codes for internal tracking and testing
|
|
7
|
-
*/
|
|
8
|
-
export declare const ERROR_CODES: {
|
|
9
|
-
readonly AUTH_REQUIRED: "AUTH_REQUIRED";
|
|
10
|
-
readonly RATE_LIMIT_PRIMARY: "RATE_LIMIT_PRIMARY";
|
|
11
|
-
readonly RATE_LIMIT_SECONDARY: "RATE_LIMIT_SECONDARY";
|
|
12
|
-
readonly FORBIDDEN_PERMISSIONS: "FORBIDDEN_PERMISSIONS";
|
|
13
|
-
readonly NOT_FOUND: "NOT_FOUND";
|
|
14
|
-
readonly INVALID_REQUEST: "INVALID_REQUEST";
|
|
15
|
-
readonly SERVER_UNAVAILABLE: "SERVER_UNAVAILABLE";
|
|
16
|
-
readonly NETWORK_CONNECTION_FAILED: "NETWORK_CONNECTION_FAILED";
|
|
17
|
-
readonly REQUEST_TIMEOUT: "REQUEST_TIMEOUT";
|
|
18
|
-
readonly UNKNOWN: "UNKNOWN";
|
|
19
|
-
};
|
|
20
|
-
export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
|
|
21
|
-
/**
|
|
22
|
-
* Error message templates with explanations
|
|
23
|
-
*/
|
|
24
|
-
export declare const ERROR_MESSAGES: {
|
|
25
|
-
/**
|
|
26
|
-
* 401 - Authentication Required
|
|
27
|
-
* When: No token provided or token is invalid
|
|
28
|
-
* Cause: Missing/invalid GITHUB_TOKEN or GH_TOKEN
|
|
29
|
-
* Fix: Set valid GitHub personal access token
|
|
30
|
-
*/
|
|
31
|
-
readonly AUTH_REQUIRED: {
|
|
32
|
-
readonly message: "GitHub authentication required";
|
|
33
|
-
readonly suggestion: "TELL THE USER: Refresh your GitHub token! Run 'gh auth login' OR 'gh auth refresh' OR set a new GITHUB_TOKEN/GH_TOKEN environment variable";
|
|
34
|
-
readonly explanation: "API request requires authentication. GitHub APIs have different rate limits for authenticated (5000/hour) vs unauthenticated (60/hour) requests.";
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* 403 - Primary Rate Limit Exceeded
|
|
38
|
-
* When: Used all API quota for current hour (REST or GraphQL)
|
|
39
|
-
* Cause: Too many requests within rate limit window
|
|
40
|
-
* Fix: Wait until rate limit resets, or use authenticated requests for higher limits
|
|
41
|
-
* Docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
|
|
42
|
-
*/
|
|
43
|
-
readonly RATE_LIMIT_PRIMARY: {
|
|
44
|
-
readonly message: "GitHub API rate limit exceeded";
|
|
45
|
-
readonly messageWithTime: (resetTime: Date, seconds: number) => string;
|
|
46
|
-
readonly messageWithoutTime: "GitHub API rate limit exceeded. Reset time unavailable - check GitHub status or try again later";
|
|
47
|
-
readonly suggestion: "Set GITHUB_TOKEN for higher rate limits (5000/hour vs 60/hour)";
|
|
48
|
-
readonly explanation: "Primary rate limit tracks total API calls per hour. Authenticated users get 5000 requests/hour, unauthenticated get 60 requests/hour.";
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* 403 - Secondary Rate Limit (Abuse Detection)
|
|
52
|
-
* When: Making requests too quickly (abuse detection)
|
|
53
|
-
* Cause: High frequency of requests triggering anti-abuse mechanisms
|
|
54
|
-
* Fix: Slow down request rate, add delays between requests
|
|
55
|
-
* Docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits
|
|
56
|
-
*/
|
|
57
|
-
readonly RATE_LIMIT_SECONDARY: {
|
|
58
|
-
readonly message: (retryAfter: number) => string;
|
|
59
|
-
readonly suggestion: "Reduce request frequency to avoid abuse detection";
|
|
60
|
-
readonly explanation: "Secondary rate limits prevent API abuse by limiting request frequency. Triggered by making too many requests too quickly, regardless of remaining quota.";
|
|
61
|
-
readonly fallbackRetryAfter: 60;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* 403 - Forbidden (Insufficient Permissions)
|
|
65
|
-
* When: Token lacks required scopes for the operation
|
|
66
|
-
* Cause: GitHub token missing necessary OAuth scopes
|
|
67
|
-
* Fix: Refresh token with required scopes using gh CLI
|
|
68
|
-
*/
|
|
69
|
-
readonly FORBIDDEN_PERMISSIONS: {
|
|
70
|
-
readonly message: "Access forbidden - insufficient permissions";
|
|
71
|
-
readonly suggestion: "Check repository permissions or authentication";
|
|
72
|
-
readonly suggestionWithScopes: (missing: string[]) => string;
|
|
73
|
-
readonly fallbackSuggestion: "Token may not have sufficient permissions for this operation";
|
|
74
|
-
readonly explanation: "GitHub tokens require specific OAuth scopes for different operations. Common scopes: repo (full repository access), read:org (organization access), gist (gist access).";
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* 404 - Not Found
|
|
78
|
-
* When: Repository, file, or resource does not exist or is inaccessible
|
|
79
|
-
* Cause: Wrong path, deleted resource, or private repo without access
|
|
80
|
-
* Fix: Verify resource exists, check spelling, ensure token has access to private repos
|
|
81
|
-
*/
|
|
82
|
-
readonly NOT_FOUND: {
|
|
83
|
-
readonly message: "Repository, resource, or path not found";
|
|
84
|
-
readonly explanation: "Resource not found or not accessible. Could be: incorrect path, deleted resource, private repository without access, wrong branch name.";
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* 422 - Unprocessable Entity (Validation Error)
|
|
88
|
-
* When: Request parameters are invalid or malformed
|
|
89
|
-
* Cause: Invalid search query syntax, invalid parameter values
|
|
90
|
-
* Fix: Check API documentation for correct parameter format
|
|
91
|
-
* Docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#client-errors
|
|
92
|
-
*/
|
|
93
|
-
readonly INVALID_REQUEST: {
|
|
94
|
-
readonly message: "Invalid search query or request parameters";
|
|
95
|
-
readonly suggestion: "Check search syntax and parameter values";
|
|
96
|
-
readonly explanation: "Request was well-formed but contains invalid parameters. Common causes: invalid search syntax, parameters out of range, invalid filter combinations.";
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* 502/503/504 - Server Errors
|
|
100
|
-
* When: GitHub API is temporarily unavailable
|
|
101
|
-
* Cause: GitHub server issues, maintenance, or overload
|
|
102
|
-
* Fix: Retry after a short delay, check GitHub status page
|
|
103
|
-
*/
|
|
104
|
-
readonly SERVER_UNAVAILABLE: {
|
|
105
|
-
readonly message: "GitHub API temporarily unavailable";
|
|
106
|
-
readonly suggestion: "Retry the request after a short delay";
|
|
107
|
-
readonly explanation: "GitHub servers are temporarily unavailable. Usually resolves quickly. Check https://www.githubstatus.com for service status.";
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Network Error - Connection Failed
|
|
111
|
-
* When: Cannot reach GitHub API servers
|
|
112
|
-
* Cause: No internet connection, DNS failure, firewall blocking
|
|
113
|
-
* Fix: Check internet connection, verify DNS resolution, check firewall settings
|
|
114
|
-
*/
|
|
115
|
-
readonly NETWORK_CONNECTION_FAILED: {
|
|
116
|
-
readonly message: "Network connection failed";
|
|
117
|
-
readonly suggestion: "Check internet connection and GitHub API status";
|
|
118
|
-
readonly explanation: "Cannot establish connection to GitHub API. Check internet connectivity, DNS settings, and firewall/proxy configuration.";
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Network Error - Request Timeout
|
|
122
|
-
* When: Request takes too long to complete
|
|
123
|
-
* Cause: Slow network, large response, GitHub server delay
|
|
124
|
-
* Fix: Retry request, check network speed, consider pagination for large requests
|
|
125
|
-
*/
|
|
126
|
-
readonly REQUEST_TIMEOUT: {
|
|
127
|
-
readonly message: "Request timeout";
|
|
128
|
-
readonly suggestion: "Retry the request or check network connectivity";
|
|
129
|
-
readonly explanation: "Request exceeded timeout limit. Could be slow network, large response size, or GitHub server delay.";
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Unknown Error
|
|
133
|
-
* When: Unrecognized error occurred
|
|
134
|
-
* Cause: Unexpected error not matching known patterns
|
|
135
|
-
* Fix: Check error message for details, report if persistent
|
|
136
|
-
*/
|
|
137
|
-
readonly UNKNOWN: {
|
|
138
|
-
readonly message: "Unknown error occurred";
|
|
139
|
-
readonly explanation: "An unexpected error occurred that does not match known error patterns.";
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* HTTP status code to error code mapping
|
|
144
|
-
*/
|
|
145
|
-
export declare const STATUS_TO_ERROR_CODE: Record<number, ErrorCode>;
|
|
146
|
-
/**
|
|
147
|
-
* Network error patterns
|
|
148
|
-
*/
|
|
149
|
-
export declare const NETWORK_ERROR_PATTERNS: {
|
|
150
|
-
readonly CONNECTION_FAILED: readonly ["ENOTFOUND", "ECONNREFUSED"];
|
|
151
|
-
readonly TIMEOUT: readonly ["timeout"];
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Rate limit detection patterns
|
|
155
|
-
*/
|
|
156
|
-
export declare const RATE_LIMIT_PATTERNS: {
|
|
157
|
-
readonly SECONDARY: RegExp;
|
|
158
|
-
readonly GRAPHQL_TYPE: "RATE_LIMITED";
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* Rate limit configuration
|
|
162
|
-
*/
|
|
163
|
-
export declare const RATE_LIMIT_CONFIG: {
|
|
164
|
-
/**
|
|
165
|
-
* Add 1 second buffer to rate limit reset time per GitHub best practices
|
|
166
|
-
* Docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#exceeding-the-rate-limit
|
|
167
|
-
*/
|
|
168
|
-
readonly RESET_BUFFER_SECONDS: 1;
|
|
169
|
-
/**
|
|
170
|
-
* Default secondary rate limit retry delay when no retry-after header present
|
|
171
|
-
*/
|
|
172
|
-
readonly SECONDARY_FALLBACK_SECONDS: 60;
|
|
173
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { GitHubAPIResponse } from './githubAPI';
|
|
2
|
-
import type { FileContentQuery, ContentResult, GitHubViewRepoStructureQuery } from '../types';
|
|
3
|
-
import type { GitHubRepositoryStructureResult, GitHubRepositoryStructureError } from '../scheme/github_view_repo_structure';
|
|
4
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
5
|
-
export declare function fetchGitHubFileContentAPI(params: FileContentQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<ContentResult>>;
|
|
6
|
-
export declare function viewGitHubRepositoryStructureAPI(params: GitHubViewRepoStructureQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubRepositoryStructureResult | GitHubRepositoryStructureError>;
|