@octocodeai/octocode-tools-core 16.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/dist/commands/BaseCommandBuilder.d.ts +14 -0
- package/dist/commands/FindCommandBuilder.d.ts +23 -0
- package/dist/commands/LsCommandBuilder.d.ts +15 -0
- package/dist/commands/RipgrepCommandBuilder.d.ts +27 -0
- package/dist/config.d.ts +16 -0
- package/dist/direct.d.ts +3 -0
- package/dist/direct.js +53 -0
- package/dist/errors/ToolError.d.ts +21 -0
- package/dist/errors/domainErrors.d.ts +310 -0
- package/dist/errors/errorFactories.d.ts +12 -0
- package/dist/errors/localToolErrors.d.ts +29 -0
- package/dist/errors/pathUtils.d.ts +1 -0
- package/dist/github/client.d.ts +12 -0
- package/dist/github/codeSearch.d.ts +8 -0
- package/dist/github/directoryFetch.d.ts +5 -0
- package/dist/github/errorConstants.d.ts +81 -0
- package/dist/github/errors.d.ts +3 -0
- package/dist/github/fileContent.d.ts +4 -0
- package/dist/github/fileContentProcess.d.ts +11 -0
- package/dist/github/fileContentRaw.d.ts +12 -0
- package/dist/github/githubAPI.d.ts +237 -0
- package/dist/github/history.d.ts +16 -0
- package/dist/github/prByNumber.d.ts +5 -0
- package/dist/github/prContentFetcher.d.ts +5 -0
- package/dist/github/prTransformation.d.ts +109 -0
- package/dist/github/pullRequestSearch.d.ts +4 -0
- package/dist/github/queryBuilders.d.ts +12 -0
- package/dist/github/repoSearch.d.ts +25 -0
- package/dist/github/repoStructure.d.ts +7 -0
- package/dist/github/repoStructurePagination.d.ts +6 -0
- package/dist/github/repoStructureRecursive.d.ts +3 -0
- package/dist/github/responseHeaders.d.ts +1 -0
- package/dist/hints/dynamic.d.ts +6 -0
- package/dist/hints/index.d.ts +2 -0
- package/dist/hints/types.d.ts +1 -0
- package/dist/index.d.ts +187 -0
- package/dist/index.js +64 -0
- package/dist/providers/capabilities.d.ts +2 -0
- package/dist/providers/factory.d.ts +9 -0
- package/dist/providers/github/GitHubProvider.d.ts +14 -0
- package/dist/providers/github/githubContent.d.ts +9 -0
- package/dist/providers/github/githubPullRequests.d.ts +12 -0
- package/dist/providers/github/githubSearch.d.ts +12 -0
- package/dist/providers/github/githubStructure.d.ts +9 -0
- package/dist/providers/github/utils.d.ts +10 -0
- package/dist/providers/providerQueries.d.ts +111 -0
- package/dist/providers/providerResults.d.ts +175 -0
- package/dist/providers/types.d.ts +48 -0
- package/dist/responses.d.ts +47 -0
- package/dist/scheme/coreSchemas.d.ts +10 -0
- package/dist/scheme/fields.d.ts +13 -0
- package/dist/scheme/responseEnvelope.d.ts +16 -0
- package/dist/security/bridge.d.ts +10 -0
- package/dist/serverConfig.d.ts +23 -0
- package/dist/session.d.ts +25 -0
- package/dist/tools/directToolCatalog.d.ts +56 -0
- package/dist/tools/executionGuard.d.ts +14 -0
- package/dist/tools/github_clone_repo/cache.d.ts +21 -0
- package/dist/tools/github_clone_repo/cloneRepo.d.ts +6 -0
- package/dist/tools/github_clone_repo/execution.d.ts +8 -0
- package/dist/tools/github_clone_repo/hints.d.ts +2 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +50 -0
- package/dist/tools/github_clone_repo/types.d.ts +19 -0
- package/dist/tools/github_fetch_content/execution.d.ts +7 -0
- package/dist/tools/github_fetch_content/finalizer.d.ts +10 -0
- package/dist/tools/github_fetch_content/hints.d.ts +2 -0
- package/dist/tools/github_fetch_content/scheme.d.ts +120 -0
- package/dist/tools/github_fetch_content/types.d.ts +66 -0
- package/dist/tools/github_search_code/execution.d.ts +8 -0
- package/dist/tools/github_search_code/finalizer.d.ts +6 -0
- package/dist/tools/github_search_code/hints.d.ts +2 -0
- package/dist/tools/github_search_code/scheme.d.ts +88 -0
- package/dist/tools/github_search_pull_requests/contentRequest.d.ts +52 -0
- package/dist/tools/github_search_pull_requests/contentResponse.d.ts +18 -0
- package/dist/tools/github_search_pull_requests/execution.d.ts +17 -0
- package/dist/tools/github_search_pull_requests/hints.d.ts +2 -0
- package/dist/tools/github_search_pull_requests/scheme.d.ts +224 -0
- package/dist/tools/github_search_pull_requests/types.d.ts +120 -0
- package/dist/tools/github_search_repos/execution.d.ts +17 -0
- package/dist/tools/github_search_repos/hints.d.ts +2 -0
- package/dist/tools/github_search_repos/scheme.d.ts +96 -0
- package/dist/tools/github_view_repo_structure/constants.d.ts +4 -0
- package/dist/tools/github_view_repo_structure/execution.d.ts +20 -0
- package/dist/tools/github_view_repo_structure/hints.d.ts +2 -0
- package/dist/tools/github_view_repo_structure/scheme.d.ts +81 -0
- package/dist/tools/github_view_repo_structure/types.d.ts +39 -0
- package/dist/tools/local_binary_inspect/archiveOps.d.ts +22 -0
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +49 -0
- package/dist/tools/local_binary_inspect/binaryOps.d.ts +18 -0
- package/dist/tools/local_binary_inspect/decompressOps.d.ts +16 -0
- package/dist/tools/local_binary_inspect/execution.d.ts +4 -0
- package/dist/tools/local_binary_inspect/scheme.d.ts +44 -0
- package/dist/tools/local_fetch_content/contentExtractor.d.ts +9 -0
- package/dist/tools/local_fetch_content/execution.d.ts +5 -0
- package/dist/tools/local_fetch_content/fetchContent.d.ts +4 -0
- package/dist/tools/local_fetch_content/hints.d.ts +2 -0
- package/dist/tools/local_fetch_content/scheme.d.ts +31 -0
- package/dist/tools/local_find_files/execution.d.ts +5 -0
- package/dist/tools/local_find_files/findFiles.d.ts +11 -0
- package/dist/tools/local_find_files/hints.d.ts +2 -0
- package/dist/tools/local_find_files/scheme.d.ts +9 -0
- package/dist/tools/local_ripgrep/execution.d.ts +5 -0
- package/dist/tools/local_ripgrep/grepFallbackExecutor.d.ts +3 -0
- package/dist/tools/local_ripgrep/hints.d.ts +2 -0
- package/dist/tools/local_ripgrep/patternValidation.d.ts +12 -0
- package/dist/tools/local_ripgrep/ripgrepExecutor.d.ts +3 -0
- package/dist/tools/local_ripgrep/ripgrepParser.d.ts +9 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +9 -0
- package/dist/tools/local_ripgrep/scheme.d.ts +55 -0
- package/dist/tools/local_ripgrep/searchContentRipgrep.d.ts +5 -0
- package/dist/tools/local_ripgrep/structuralSearch.d.ts +9 -0
- package/dist/tools/local_view_structure/execution.d.ts +5 -0
- package/dist/tools/local_view_structure/hints.d.ts +2 -0
- package/dist/tools/local_view_structure/local_view_structure.d.ts +7 -0
- package/dist/tools/local_view_structure/scheme.d.ts +33 -0
- package/dist/tools/local_view_structure/structureFilters.d.ts +33 -0
- package/dist/tools/local_view_structure/structureParser.d.ts +3 -0
- package/dist/tools/local_view_structure/structureResponse.d.ts +32 -0
- package/dist/tools/local_view_structure/structureWalker.d.ts +24 -0
- package/dist/tools/lsp/semantic_content/execution.d.ts +4 -0
- package/dist/tools/lsp/semantic_content/hints.d.ts +4 -0
- package/dist/tools/lsp/semantic_content/index.d.ts +2 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +509 -0
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +11 -0
- package/dist/tools/lsp/shared/resolveSymbolAnchor.d.ts +20 -0
- package/dist/tools/lsp/shared/semanticTypes.d.ts +134 -0
- package/dist/tools/package_search/execution.d.ts +7 -0
- package/dist/tools/package_search/hints.d.ts +2 -0
- package/dist/tools/package_search/scheme.d.ts +51 -0
- package/dist/tools/providerExecution.d.ts +51 -0
- package/dist/tools/providerMappers.d.ts +277 -0
- package/dist/tools/toolConfig.d.ts +41 -0
- package/dist/tools/toolMetadata/baseSchema.d.ts +2 -0
- package/dist/tools/toolMetadata/descriptions.d.ts +1 -0
- package/dist/tools/toolMetadata/gateway.d.ts +7 -0
- package/dist/tools/toolMetadata/metadataPresence.d.ts +1 -0
- package/dist/tools/toolMetadata/names.d.ts +2 -0
- package/dist/tools/toolMetadata/proxies.d.ts +10 -0
- package/dist/tools/toolMetadata/state.d.ts +5 -0
- package/dist/tools/toolMetadata/types.d.ts +2 -0
- package/dist/tools/toolNames.d.ts +2 -0
- package/dist/tools/utils.d.ts +27 -0
- package/dist/types/bulk.d.ts +41 -0
- package/dist/types/execution.d.ts +11 -0
- package/dist/types/metadata.d.ts +69 -0
- package/dist/types/promise.d.ts +12 -0
- package/dist/types/responseTypes.d.ts +57 -0
- package/dist/types/server.d.ts +15 -0
- package/dist/types/session.d.ts +29 -0
- package/dist/types/toolResults.d.ts +62 -0
- package/dist/utils/contextUtils.d.ts +31 -0
- package/dist/utils/core/bestEffort.d.ts +2 -0
- package/dist/utils/core/compare.d.ts +1 -0
- package/dist/utils/core/constants.d.ts +47 -0
- package/dist/utils/core/promise.d.ts +2 -0
- package/dist/utils/core/safeRegex.d.ts +5 -0
- package/dist/utils/core/types.d.ts +50 -0
- package/dist/utils/environment/environmentDetection.d.ts +5 -0
- package/dist/utils/exec/commandAvailability.d.ts +19 -0
- package/dist/utils/exec/npm.d.ts +16 -0
- package/dist/utils/exec/ripgrepBinary.d.ts +3 -0
- package/dist/utils/exec/safe.d.ts +2 -0
- package/dist/utils/exec/spawn.d.ts +34 -0
- package/dist/utils/file/byteOffset.d.ts +12 -0
- package/dist/utils/file/filters.d.ts +11 -0
- package/dist/utils/file/size.d.ts +2 -0
- package/dist/utils/file/toolHelpers.d.ts +28 -0
- package/dist/utils/http/cache.d.ts +16 -0
- package/dist/utils/http/circuitBreaker.d.ts +17 -0
- package/dist/utils/http/fetch.d.ts +13 -0
- package/dist/utils/package/common.d.ts +5 -0
- package/dist/utils/package/npm.d.ts +8 -0
- package/dist/utils/package/schemas.d.ts +60 -0
- package/dist/utils/package/types.d.ts +55 -0
- package/dist/utils/pagination/boundary.d.ts +11 -0
- package/dist/utils/pagination/charLimit.d.ts +3 -0
- package/dist/utils/pagination/core.d.ts +15 -0
- package/dist/utils/pagination/hints.d.ts +3 -0
- package/dist/utils/pagination/outputSizeLimit.d.ts +16 -0
- package/dist/utils/pagination/types.d.ts +43 -0
- package/dist/utils/parsers/diff.d.ts +2 -0
- package/dist/utils/parsers/ripgrep.d.ts +11 -0
- package/dist/utils/parsers/schemas.d.ts +72 -0
- package/dist/utils/response/bulk.d.ts +5 -0
- package/dist/utils/response/callToolResult.d.ts +3 -0
- package/dist/utils/response/charSavings.d.ts +3 -0
- package/dist/utils/response/error.d.ts +20 -0
- package/dist/utils/response/groupedFinalizer.d.ts +37 -0
- package/dist/utils/response/pathRelativize.d.ts +9 -0
- package/dist/utils/response/structuredPagination.d.ts +9 -0
- package/dist/zod.d.ts +1 -0
- package/dist/zod.js +8 -0
- package/package.json +66 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LocalToolErrorCategory, type LocalToolErrorCode } from './localToolErrors.js';
|
|
2
|
+
export declare class ToolError extends Error {
|
|
3
|
+
readonly errorCode: LocalToolErrorCode;
|
|
4
|
+
readonly category: LocalToolErrorCategory;
|
|
5
|
+
readonly recoverability: 'recoverable' | 'unrecoverable' | 'user-action-required';
|
|
6
|
+
readonly context?: Record<string, unknown>;
|
|
7
|
+
constructor(errorCode: LocalToolErrorCode, message?: string, context?: Record<string, unknown>, cause?: Error);
|
|
8
|
+
isRecoverable(): boolean;
|
|
9
|
+
requiresUserAction(): boolean;
|
|
10
|
+
toJSON(): {
|
|
11
|
+
name: string;
|
|
12
|
+
errorCode: LocalToolErrorCode;
|
|
13
|
+
category: LocalToolErrorCategory;
|
|
14
|
+
message: string;
|
|
15
|
+
recoverability: "recoverable" | "unrecoverable" | "user-action-required";
|
|
16
|
+
context: Record<string, unknown>;
|
|
17
|
+
stack: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function isToolError(error: unknown): error is ToolError;
|
|
21
|
+
export declare function toToolError(error: unknown, defaultErrorCode?: LocalToolErrorCode, context?: Record<string, unknown>): ToolError;
|
|
@@ -0,0 +1,310 @@
|
|
|
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
|
+
};
|
|
7
|
+
export declare const VALIDATION_ERRORS: {
|
|
8
|
+
readonly PROMISES_NOT_ARRAY: {
|
|
9
|
+
readonly code: "VALIDATION_PROMISES_NOT_ARRAY";
|
|
10
|
+
readonly message: "promises must be an array";
|
|
11
|
+
};
|
|
12
|
+
readonly TIMEOUT_NOT_POSITIVE: {
|
|
13
|
+
readonly code: "VALIDATION_TIMEOUT_NOT_POSITIVE";
|
|
14
|
+
readonly message: "timeout must be positive";
|
|
15
|
+
};
|
|
16
|
+
readonly CONCURRENCY_NOT_POSITIVE: {
|
|
17
|
+
readonly code: "VALIDATION_CONCURRENCY_NOT_POSITIVE";
|
|
18
|
+
readonly message: "concurrency must be positive";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const FETCH_ERRORS: {
|
|
22
|
+
readonly FETCH_NOT_AVAILABLE: {
|
|
23
|
+
readonly code: "FETCH_NOT_AVAILABLE";
|
|
24
|
+
readonly message: "Global fetch is not available in this environment.";
|
|
25
|
+
};
|
|
26
|
+
readonly FETCH_FAILED_AFTER_RETRIES: {
|
|
27
|
+
readonly code: "FETCH_FAILED_AFTER_RETRIES";
|
|
28
|
+
readonly message: (attempts: number, errorMessage: string) => string;
|
|
29
|
+
};
|
|
30
|
+
readonly FETCH_HTTP_ERROR: {
|
|
31
|
+
readonly code: "FETCH_HTTP_ERROR";
|
|
32
|
+
readonly message: (status: number, statusText: string) => string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const TOOL_METADATA_ERRORS: {
|
|
36
|
+
readonly INVALID_FORMAT: {
|
|
37
|
+
readonly code: "TOOL_METADATA_INVALID_FORMAT";
|
|
38
|
+
readonly message: "Invalid tool metadata format from remote source.";
|
|
39
|
+
};
|
|
40
|
+
readonly INVALID_API_RESPONSE: {
|
|
41
|
+
readonly code: "TOOL_METADATA_INVALID_API_RESPONSE";
|
|
42
|
+
readonly message: "Invalid API response structure";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const FILE_OPERATION_ERRORS: {
|
|
46
|
+
readonly PATH_IS_DIRECTORY: {
|
|
47
|
+
readonly code: "FILE_PATH_IS_DIRECTORY";
|
|
48
|
+
readonly message: (toolName: string) => string;
|
|
49
|
+
};
|
|
50
|
+
readonly FILE_TOO_LARGE: {
|
|
51
|
+
readonly code: "FILE_TOO_LARGE";
|
|
52
|
+
readonly message: (fileSizeKB: number, maxSizeKB: number, toolName: string) => string;
|
|
53
|
+
};
|
|
54
|
+
readonly FILE_EMPTY: {
|
|
55
|
+
readonly code: "FILE_EMPTY";
|
|
56
|
+
readonly message: "File is empty - no content to display";
|
|
57
|
+
};
|
|
58
|
+
readonly BINARY_FILE: {
|
|
59
|
+
readonly code: "FILE_BINARY";
|
|
60
|
+
readonly message: "Binary file detected. Cannot display as text - download directly from GitHub";
|
|
61
|
+
};
|
|
62
|
+
readonly DECODE_FAILED: {
|
|
63
|
+
readonly code: "FILE_DECODE_FAILED";
|
|
64
|
+
readonly message: "Failed to decode file. Encoding may not be supported (expected UTF-8)";
|
|
65
|
+
};
|
|
66
|
+
readonly UNSUPPORTED_TYPE: {
|
|
67
|
+
readonly code: "FILE_UNSUPPORTED_TYPE";
|
|
68
|
+
readonly message: (type: string) => string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export declare const REPOSITORY_ERRORS: {
|
|
72
|
+
readonly NOT_FOUND: {
|
|
73
|
+
readonly code: "REPO_NOT_FOUND";
|
|
74
|
+
readonly message: (owner: string, repo: string, error: string) => string;
|
|
75
|
+
};
|
|
76
|
+
readonly PATH_NOT_FOUND: {
|
|
77
|
+
readonly code: "REPO_PATH_NOT_FOUND";
|
|
78
|
+
readonly message: (path: string, owner: string, repo: string, branch: string) => string;
|
|
79
|
+
};
|
|
80
|
+
readonly PATH_NOT_FOUND_ANY_BRANCH: {
|
|
81
|
+
readonly code: "REPO_PATH_NOT_FOUND_ANY_BRANCH";
|
|
82
|
+
readonly message: (path: string, owner: string, repo: string) => string;
|
|
83
|
+
};
|
|
84
|
+
readonly ACCESS_FAILED: {
|
|
85
|
+
readonly code: "REPO_ACCESS_FAILED";
|
|
86
|
+
readonly message: (owner: string, repo: string, error: string) => string;
|
|
87
|
+
};
|
|
88
|
+
readonly STRUCTURE_EXPLORATION_FAILED: {
|
|
89
|
+
readonly code: "REPO_STRUCTURE_EXPLORATION_FAILED";
|
|
90
|
+
readonly message: "Failed to explore repository structure";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export declare const SEARCH_ERRORS: {
|
|
94
|
+
readonly QUERY_EMPTY: {
|
|
95
|
+
readonly code: "SEARCH_QUERY_EMPTY";
|
|
96
|
+
readonly message: "Search query cannot be empty";
|
|
97
|
+
};
|
|
98
|
+
readonly NO_VALID_PARAMETERS: {
|
|
99
|
+
readonly code: "SEARCH_NO_VALID_PARAMETERS";
|
|
100
|
+
readonly message: "No valid search parameters provided";
|
|
101
|
+
};
|
|
102
|
+
readonly PR_REQUIRED_PARAMS: {
|
|
103
|
+
readonly code: "SEARCH_PR_REQUIRED_PARAMS";
|
|
104
|
+
readonly message: "Owner, repo, and prNumber are required parameters";
|
|
105
|
+
};
|
|
106
|
+
readonly PR_SINGLE_VALUES: {
|
|
107
|
+
readonly code: "SEARCH_PR_SINGLE_VALUES";
|
|
108
|
+
readonly message: "Owner and repo must be single values";
|
|
109
|
+
};
|
|
110
|
+
readonly PULL_REQUEST_SEARCH_FAILED: {
|
|
111
|
+
readonly code: "SEARCH_PR_SEARCH_FAILED";
|
|
112
|
+
readonly message: (error: string) => string;
|
|
113
|
+
};
|
|
114
|
+
readonly PULL_REQUEST_LIST_FAILED: {
|
|
115
|
+
readonly code: "SEARCH_PR_LIST_FAILED";
|
|
116
|
+
readonly message: (error: string) => string;
|
|
117
|
+
};
|
|
118
|
+
readonly PULL_REQUEST_FETCH_FAILED: {
|
|
119
|
+
readonly code: "SEARCH_PR_FETCH_FAILED";
|
|
120
|
+
readonly message: (prNumber: number, error: string) => string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export declare const STARTUP_ERRORS: {
|
|
124
|
+
readonly NO_TOOLS_REGISTERED: {
|
|
125
|
+
readonly code: "STARTUP_NO_TOOLS_REGISTERED";
|
|
126
|
+
readonly message: "No tools were successfully registered";
|
|
127
|
+
};
|
|
128
|
+
readonly UNCAUGHT_EXCEPTION: {
|
|
129
|
+
readonly code: "STARTUP_UNCAUGHT_EXCEPTION";
|
|
130
|
+
readonly message: (error: string) => string;
|
|
131
|
+
};
|
|
132
|
+
readonly UNHANDLED_REJECTION: {
|
|
133
|
+
readonly code: "STARTUP_UNHANDLED_REJECTION";
|
|
134
|
+
readonly message: (reason: string) => string;
|
|
135
|
+
};
|
|
136
|
+
readonly STARTUP_FAILED: {
|
|
137
|
+
readonly code: "STARTUP_FAILED";
|
|
138
|
+
readonly message: (error: string) => string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
export declare const PROMISE_ERRORS: {
|
|
142
|
+
readonly TIMEOUT: {
|
|
143
|
+
readonly code: "PROMISE_TIMEOUT";
|
|
144
|
+
readonly message: (index: number, timeout: number) => string;
|
|
145
|
+
};
|
|
146
|
+
readonly NOT_A_FUNCTION: {
|
|
147
|
+
readonly code: "PROMISE_NOT_A_FUNCTION";
|
|
148
|
+
readonly message: (index: number) => string;
|
|
149
|
+
};
|
|
150
|
+
readonly FUNCTION_UNDEFINED: {
|
|
151
|
+
readonly code: "PROMISE_FUNCTION_UNDEFINED";
|
|
152
|
+
readonly message: "Promise function is undefined";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export declare const TOOL_ERRORS: {
|
|
156
|
+
readonly EXECUTION_FAILED: {
|
|
157
|
+
readonly code: "TOOL_EXECUTION_FAILED";
|
|
158
|
+
readonly message: (toolName: string, error: string) => string;
|
|
159
|
+
};
|
|
160
|
+
readonly SECURITY_VALIDATION_FAILED: {
|
|
161
|
+
readonly code: "TOOL_SECURITY_VALIDATION_FAILED";
|
|
162
|
+
readonly message: (toolName: string, error: string) => string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
export declare const ALL_ERROR_CODES: {
|
|
166
|
+
readonly EXECUTION_FAILED: {
|
|
167
|
+
readonly code: "TOOL_EXECUTION_FAILED";
|
|
168
|
+
readonly message: (toolName: string, error: string) => string;
|
|
169
|
+
};
|
|
170
|
+
readonly SECURITY_VALIDATION_FAILED: {
|
|
171
|
+
readonly code: "TOOL_SECURITY_VALIDATION_FAILED";
|
|
172
|
+
readonly message: (toolName: string, error: string) => string;
|
|
173
|
+
};
|
|
174
|
+
readonly TIMEOUT: {
|
|
175
|
+
readonly code: "PROMISE_TIMEOUT";
|
|
176
|
+
readonly message: (index: number, timeout: number) => string;
|
|
177
|
+
};
|
|
178
|
+
readonly NOT_A_FUNCTION: {
|
|
179
|
+
readonly code: "PROMISE_NOT_A_FUNCTION";
|
|
180
|
+
readonly message: (index: number) => string;
|
|
181
|
+
};
|
|
182
|
+
readonly FUNCTION_UNDEFINED: {
|
|
183
|
+
readonly code: "PROMISE_FUNCTION_UNDEFINED";
|
|
184
|
+
readonly message: "Promise function is undefined";
|
|
185
|
+
};
|
|
186
|
+
readonly NO_TOOLS_REGISTERED: {
|
|
187
|
+
readonly code: "STARTUP_NO_TOOLS_REGISTERED";
|
|
188
|
+
readonly message: "No tools were successfully registered";
|
|
189
|
+
};
|
|
190
|
+
readonly UNCAUGHT_EXCEPTION: {
|
|
191
|
+
readonly code: "STARTUP_UNCAUGHT_EXCEPTION";
|
|
192
|
+
readonly message: (error: string) => string;
|
|
193
|
+
};
|
|
194
|
+
readonly UNHANDLED_REJECTION: {
|
|
195
|
+
readonly code: "STARTUP_UNHANDLED_REJECTION";
|
|
196
|
+
readonly message: (reason: string) => string;
|
|
197
|
+
};
|
|
198
|
+
readonly STARTUP_FAILED: {
|
|
199
|
+
readonly code: "STARTUP_FAILED";
|
|
200
|
+
readonly message: (error: string) => string;
|
|
201
|
+
};
|
|
202
|
+
readonly QUERY_EMPTY: {
|
|
203
|
+
readonly code: "SEARCH_QUERY_EMPTY";
|
|
204
|
+
readonly message: "Search query cannot be empty";
|
|
205
|
+
};
|
|
206
|
+
readonly NO_VALID_PARAMETERS: {
|
|
207
|
+
readonly code: "SEARCH_NO_VALID_PARAMETERS";
|
|
208
|
+
readonly message: "No valid search parameters provided";
|
|
209
|
+
};
|
|
210
|
+
readonly PR_REQUIRED_PARAMS: {
|
|
211
|
+
readonly code: "SEARCH_PR_REQUIRED_PARAMS";
|
|
212
|
+
readonly message: "Owner, repo, and prNumber are required parameters";
|
|
213
|
+
};
|
|
214
|
+
readonly PR_SINGLE_VALUES: {
|
|
215
|
+
readonly code: "SEARCH_PR_SINGLE_VALUES";
|
|
216
|
+
readonly message: "Owner and repo must be single values";
|
|
217
|
+
};
|
|
218
|
+
readonly PULL_REQUEST_SEARCH_FAILED: {
|
|
219
|
+
readonly code: "SEARCH_PR_SEARCH_FAILED";
|
|
220
|
+
readonly message: (error: string) => string;
|
|
221
|
+
};
|
|
222
|
+
readonly PULL_REQUEST_LIST_FAILED: {
|
|
223
|
+
readonly code: "SEARCH_PR_LIST_FAILED";
|
|
224
|
+
readonly message: (error: string) => string;
|
|
225
|
+
};
|
|
226
|
+
readonly PULL_REQUEST_FETCH_FAILED: {
|
|
227
|
+
readonly code: "SEARCH_PR_FETCH_FAILED";
|
|
228
|
+
readonly message: (prNumber: number, error: string) => string;
|
|
229
|
+
};
|
|
230
|
+
readonly NOT_FOUND: {
|
|
231
|
+
readonly code: "REPO_NOT_FOUND";
|
|
232
|
+
readonly message: (owner: string, repo: string, error: string) => string;
|
|
233
|
+
};
|
|
234
|
+
readonly PATH_NOT_FOUND: {
|
|
235
|
+
readonly code: "REPO_PATH_NOT_FOUND";
|
|
236
|
+
readonly message: (path: string, owner: string, repo: string, branch: string) => string;
|
|
237
|
+
};
|
|
238
|
+
readonly PATH_NOT_FOUND_ANY_BRANCH: {
|
|
239
|
+
readonly code: "REPO_PATH_NOT_FOUND_ANY_BRANCH";
|
|
240
|
+
readonly message: (path: string, owner: string, repo: string) => string;
|
|
241
|
+
};
|
|
242
|
+
readonly ACCESS_FAILED: {
|
|
243
|
+
readonly code: "REPO_ACCESS_FAILED";
|
|
244
|
+
readonly message: (owner: string, repo: string, error: string) => string;
|
|
245
|
+
};
|
|
246
|
+
readonly STRUCTURE_EXPLORATION_FAILED: {
|
|
247
|
+
readonly code: "REPO_STRUCTURE_EXPLORATION_FAILED";
|
|
248
|
+
readonly message: "Failed to explore repository structure";
|
|
249
|
+
};
|
|
250
|
+
readonly PATH_IS_DIRECTORY: {
|
|
251
|
+
readonly code: "FILE_PATH_IS_DIRECTORY";
|
|
252
|
+
readonly message: (toolName: string) => string;
|
|
253
|
+
};
|
|
254
|
+
readonly FILE_TOO_LARGE: {
|
|
255
|
+
readonly code: "FILE_TOO_LARGE";
|
|
256
|
+
readonly message: (fileSizeKB: number, maxSizeKB: number, toolName: string) => string;
|
|
257
|
+
};
|
|
258
|
+
readonly FILE_EMPTY: {
|
|
259
|
+
readonly code: "FILE_EMPTY";
|
|
260
|
+
readonly message: "File is empty - no content to display";
|
|
261
|
+
};
|
|
262
|
+
readonly BINARY_FILE: {
|
|
263
|
+
readonly code: "FILE_BINARY";
|
|
264
|
+
readonly message: "Binary file detected. Cannot display as text - download directly from GitHub";
|
|
265
|
+
};
|
|
266
|
+
readonly DECODE_FAILED: {
|
|
267
|
+
readonly code: "FILE_DECODE_FAILED";
|
|
268
|
+
readonly message: "Failed to decode file. Encoding may not be supported (expected UTF-8)";
|
|
269
|
+
};
|
|
270
|
+
readonly UNSUPPORTED_TYPE: {
|
|
271
|
+
readonly code: "FILE_UNSUPPORTED_TYPE";
|
|
272
|
+
readonly message: (type: string) => string;
|
|
273
|
+
};
|
|
274
|
+
readonly INVALID_FORMAT: {
|
|
275
|
+
readonly code: "TOOL_METADATA_INVALID_FORMAT";
|
|
276
|
+
readonly message: "Invalid tool metadata format from remote source.";
|
|
277
|
+
};
|
|
278
|
+
readonly INVALID_API_RESPONSE: {
|
|
279
|
+
readonly code: "TOOL_METADATA_INVALID_API_RESPONSE";
|
|
280
|
+
readonly message: "Invalid API response structure";
|
|
281
|
+
};
|
|
282
|
+
readonly FETCH_NOT_AVAILABLE: {
|
|
283
|
+
readonly code: "FETCH_NOT_AVAILABLE";
|
|
284
|
+
readonly message: "Global fetch is not available in this environment.";
|
|
285
|
+
};
|
|
286
|
+
readonly FETCH_FAILED_AFTER_RETRIES: {
|
|
287
|
+
readonly code: "FETCH_FAILED_AFTER_RETRIES";
|
|
288
|
+
readonly message: (attempts: number, errorMessage: string) => string;
|
|
289
|
+
};
|
|
290
|
+
readonly FETCH_HTTP_ERROR: {
|
|
291
|
+
readonly code: "FETCH_HTTP_ERROR";
|
|
292
|
+
readonly message: (status: number, statusText: string) => string;
|
|
293
|
+
};
|
|
294
|
+
readonly PROMISES_NOT_ARRAY: {
|
|
295
|
+
readonly code: "VALIDATION_PROMISES_NOT_ARRAY";
|
|
296
|
+
readonly message: "promises must be an array";
|
|
297
|
+
};
|
|
298
|
+
readonly TIMEOUT_NOT_POSITIVE: {
|
|
299
|
+
readonly code: "VALIDATION_TIMEOUT_NOT_POSITIVE";
|
|
300
|
+
readonly message: "timeout must be positive";
|
|
301
|
+
};
|
|
302
|
+
readonly CONCURRENCY_NOT_POSITIVE: {
|
|
303
|
+
readonly code: "VALIDATION_CONCURRENCY_NOT_POSITIVE";
|
|
304
|
+
readonly message: "concurrency must be positive";
|
|
305
|
+
};
|
|
306
|
+
readonly NOT_INITIALIZED: {
|
|
307
|
+
readonly code: "CONFIG_NOT_INITIALIZED";
|
|
308
|
+
readonly message: "Configuration not initialized. Call initialize() and await its completion before calling getServerConfig().";
|
|
309
|
+
};
|
|
310
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ToolError } from './ToolError.js';
|
|
2
|
+
export declare const ToolErrors: {
|
|
3
|
+
pathValidationFailed: (filePath: string, reason?: string, workspaceRoot?: string) => ToolError;
|
|
4
|
+
fileAccessFailed: (filePath: string, cause?: Error, workspaceRoot?: string) => ToolError;
|
|
5
|
+
fileReadFailed: (filePath: string, cause?: Error, workspaceRoot?: string) => ToolError;
|
|
6
|
+
fileTooLarge: (filePath: string, sizeKB: number, limitKB: number) => ToolError;
|
|
7
|
+
binaryFileUnsupported: (filePath: string) => ToolError;
|
|
8
|
+
outputTooLarge: (size: number, limit: number) => ToolError;
|
|
9
|
+
commandNotAvailable: (command: string, installHint?: string) => ToolError;
|
|
10
|
+
commandExecutionFailed: (command: string, cause?: Error, stderr?: string) => ToolError;
|
|
11
|
+
toolExecutionFailed: (toolName: string, cause?: Error) => ToolError;
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const LOCAL_TOOL_ERROR_CODES: {
|
|
2
|
+
readonly PATH_VALIDATION_FAILED: "pathValidationFailed";
|
|
3
|
+
readonly FILE_ACCESS_FAILED: "fileAccessFailed";
|
|
4
|
+
readonly FILE_READ_FAILED: "fileReadFailed";
|
|
5
|
+
readonly FILE_TOO_LARGE: "fileTooLarge";
|
|
6
|
+
readonly BINARY_FILE_UNSUPPORTED: "binaryFileUnsupported";
|
|
7
|
+
readonly NO_MATCHES: "noMatches";
|
|
8
|
+
readonly OUTPUT_TOO_LARGE: "outputTooLarge";
|
|
9
|
+
readonly COMMAND_NOT_AVAILABLE: "commandNotAvailable";
|
|
10
|
+
readonly COMMAND_EXECUTION_FAILED: "commandExecutionFailed";
|
|
11
|
+
readonly COMMAND_TIMEOUT: "commandTimeout";
|
|
12
|
+
readonly TOOL_EXECUTION_FAILED: "toolExecutionFailed";
|
|
13
|
+
};
|
|
14
|
+
export type LocalToolErrorCode = (typeof LOCAL_TOOL_ERROR_CODES)[keyof typeof LOCAL_TOOL_ERROR_CODES];
|
|
15
|
+
export declare enum LocalToolErrorCategory {
|
|
16
|
+
FILE_SYSTEM = "FILE_SYSTEM",
|
|
17
|
+
VALIDATION = "VALIDATION",
|
|
18
|
+
SEARCH = "SEARCH",
|
|
19
|
+
PAGINATION = "PAGINATION",
|
|
20
|
+
EXECUTION = "EXECUTION"
|
|
21
|
+
}
|
|
22
|
+
interface LocalToolErrorMetadata {
|
|
23
|
+
code: LocalToolErrorCode;
|
|
24
|
+
category: LocalToolErrorCategory;
|
|
25
|
+
description: string;
|
|
26
|
+
recoverability: 'recoverable' | 'unrecoverable' | 'user-action-required';
|
|
27
|
+
}
|
|
28
|
+
export declare const LOCAL_TOOL_ERROR_REGISTRY: Record<LocalToolErrorCode, LocalToolErrorMetadata>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { redactPath } from 'octocode-security/pathUtils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
export declare const OctokitWithThrottling: typeof import("@octokit/core").Octokit & import("@octokit/core/types").Constructor<{
|
|
3
|
+
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
|
|
4
|
+
} & import("@octokit/plugin-paginate-graphql").paginateGraphQLInterface & import("@octokit/plugin-rest-endpoint-methods").Api & {
|
|
5
|
+
retry: {
|
|
6
|
+
retryRequest: (error: import("octokit").RequestError, retries: number, retryAfter: number) => import("octokit").RequestError;
|
|
7
|
+
};
|
|
8
|
+
}> & import("@octokit/core/types").Constructor<{}>;
|
|
9
|
+
export declare function getOctokit(authInfo?: AuthInfo): Promise<InstanceType<typeof OctokitWithThrottling>>;
|
|
10
|
+
export declare const MAX_BRANCH_CACHE_SIZE = 200;
|
|
11
|
+
export declare function resolveDefaultBranch(owner: string, repo: string, authInfo?: AuthInfo): Promise<string>;
|
|
12
|
+
export declare function clearOctokitInstances(): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GitHubAPIResponse, OptimizedCodeSearchResult } from './githubAPI.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { GitHubCodeSearchQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
|
|
5
|
+
import type { WithOptionalMeta } from '../types/execution.js';
|
|
6
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
7
|
+
export declare function searchGitHubCodeAPI(params: WithOptionalMeta<GitHubCodeSearchQuery>, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<OptimizedCodeSearchResult>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
import type { DirectoryFetchResult } from '../tools/github_fetch_content/types.js';
|
|
3
|
+
export declare const MAX_DIRECTORY_FILES = 50;
|
|
4
|
+
export declare const MAX_TOTAL_SIZE: number;
|
|
5
|
+
export declare function fetchDirectoryContents(owner: string, repo: string, path: string, branch: string, authInfo?: AuthInfo, forceRefresh?: boolean): Promise<DirectoryFetchResult>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const ERROR_CODES: {
|
|
2
|
+
readonly AUTH_REQUIRED: "AUTH_REQUIRED";
|
|
3
|
+
readonly RATE_LIMIT_PRIMARY: "RATE_LIMIT_PRIMARY";
|
|
4
|
+
readonly RATE_LIMIT_SECONDARY: "RATE_LIMIT_SECONDARY";
|
|
5
|
+
readonly FORBIDDEN_PERMISSIONS: "FORBIDDEN_PERMISSIONS";
|
|
6
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
7
|
+
readonly INVALID_REQUEST: "INVALID_REQUEST";
|
|
8
|
+
readonly SERVER_UNAVAILABLE: "SERVER_UNAVAILABLE";
|
|
9
|
+
readonly NETWORK_CONNECTION_FAILED: "NETWORK_CONNECTION_FAILED";
|
|
10
|
+
readonly REQUEST_TIMEOUT: "REQUEST_TIMEOUT";
|
|
11
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
12
|
+
};
|
|
13
|
+
export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
|
|
14
|
+
export declare const ERROR_MESSAGES: {
|
|
15
|
+
readonly AUTH_REQUIRED: {
|
|
16
|
+
readonly message: "GitHub authentication required";
|
|
17
|
+
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";
|
|
18
|
+
readonly explanation: "API request requires authentication. GitHub APIs have different rate limits for authenticated (5000/hour) vs unauthenticated (60/hour) requests.";
|
|
19
|
+
};
|
|
20
|
+
readonly RATE_LIMIT_PRIMARY: {
|
|
21
|
+
readonly message: "GitHub API rate limit exceeded";
|
|
22
|
+
readonly messageWithTime: (resetTime: Date, seconds: number) => string;
|
|
23
|
+
readonly messageWithoutTime: "GitHub API rate limit exceeded. Reset time unavailable - check GitHub status or try again later";
|
|
24
|
+
readonly suggestion: "Set GITHUB_TOKEN for higher rate limits (5000/hour vs 60/hour)";
|
|
25
|
+
readonly explanation: "Primary rate limit tracks total API calls per hour. Authenticated users get 5000 requests/hour, unauthenticated get 60 requests/hour.";
|
|
26
|
+
};
|
|
27
|
+
readonly RATE_LIMIT_SECONDARY: {
|
|
28
|
+
readonly message: (retryAfter: number) => string;
|
|
29
|
+
readonly suggestion: "Reduce request frequency to avoid abuse detection";
|
|
30
|
+
readonly explanation: "Secondary rate limits prevent API abuse by limiting request frequency. Triggered by making too many requests too quickly, regardless of remaining quota.";
|
|
31
|
+
readonly fallbackRetryAfter: 60;
|
|
32
|
+
};
|
|
33
|
+
readonly FORBIDDEN_PERMISSIONS: {
|
|
34
|
+
readonly message: "Access forbidden - insufficient permissions";
|
|
35
|
+
readonly suggestion: "Check repository permissions or authentication";
|
|
36
|
+
readonly suggestionWithScopes: (missing: string[]) => string;
|
|
37
|
+
readonly fallbackSuggestion: "Token may not have sufficient permissions for this operation";
|
|
38
|
+
readonly explanation: "GitHub tokens require specific OAuth scopes for different operations. Common scopes: repo (full repository access), read:org (organization access), gist (gist access).";
|
|
39
|
+
};
|
|
40
|
+
readonly NOT_FOUND: {
|
|
41
|
+
readonly message: "Repository, resource, or path not found";
|
|
42
|
+
readonly explanation: "Resource not found or not accessible. Could be: incorrect path, deleted resource, private repository without access, wrong branch name.";
|
|
43
|
+
};
|
|
44
|
+
readonly INVALID_REQUEST: {
|
|
45
|
+
readonly message: "Invalid search query or request parameters";
|
|
46
|
+
readonly suggestion: "Check search syntax and parameter values";
|
|
47
|
+
readonly explanation: "Request was well-formed but contains invalid parameters. Common causes: invalid search syntax, parameters out of range, invalid filter combinations.";
|
|
48
|
+
};
|
|
49
|
+
readonly SERVER_UNAVAILABLE: {
|
|
50
|
+
readonly message: "GitHub API temporarily unavailable";
|
|
51
|
+
readonly suggestion: "Retry the request after a short delay";
|
|
52
|
+
readonly explanation: "GitHub servers are temporarily unavailable. Usually resolves quickly. Check https://www.githubstatus.com for service status.";
|
|
53
|
+
};
|
|
54
|
+
readonly NETWORK_CONNECTION_FAILED: {
|
|
55
|
+
readonly message: "Network connection failed";
|
|
56
|
+
readonly suggestion: "Check internet connection and GitHub API status";
|
|
57
|
+
readonly explanation: "Cannot establish connection to GitHub API. Check internet connectivity, DNS settings, and firewall/proxy configuration.";
|
|
58
|
+
};
|
|
59
|
+
readonly REQUEST_TIMEOUT: {
|
|
60
|
+
readonly message: "Request timeout";
|
|
61
|
+
readonly suggestion: "Retry the request or check network connectivity";
|
|
62
|
+
readonly explanation: "Request exceeded timeout limit. Could be slow network, large response size, or GitHub server delay.";
|
|
63
|
+
};
|
|
64
|
+
readonly UNKNOWN: {
|
|
65
|
+
readonly message: "Unknown error occurred";
|
|
66
|
+
readonly explanation: "An unexpected error occurred that does not match known error patterns.";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare const STATUS_TO_ERROR_CODE: Record<number, ErrorCode>;
|
|
70
|
+
export declare const NETWORK_ERROR_PATTERNS: {
|
|
71
|
+
readonly CONNECTION_FAILED: readonly ["ENOTFOUND", "ECONNREFUSED"];
|
|
72
|
+
readonly TIMEOUT: readonly ["timeout"];
|
|
73
|
+
};
|
|
74
|
+
export declare const RATE_LIMIT_PATTERNS: {
|
|
75
|
+
readonly SECONDARY: RegExp;
|
|
76
|
+
readonly GRAPHQL_TYPE: "RATE_LIMITED";
|
|
77
|
+
};
|
|
78
|
+
export declare const RATE_LIMIT_CONFIG: {
|
|
79
|
+
readonly RESET_BUFFER_SECONDS: 1;
|
|
80
|
+
readonly SECONDARY_FALLBACK_SECONDS: 60;
|
|
81
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GitHubAPIResponse } from './githubAPI.js';
|
|
2
|
+
import type { FileContentExecutionQuery, GitHubFileContentApiResult } from '../tools/github_fetch_content/types.js';
|
|
3
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
4
|
+
export declare function fetchGitHubFileContentAPI(params: FileContentExecutionQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<GitHubFileContentApiResult>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GitHubFileContentApiResult } from '../tools/github_fetch_content/types.js';
|
|
2
|
+
import { OctokitWithThrottling } from './client.js';
|
|
3
|
+
import type { MinifyMode } from '../scheme/fields.js';
|
|
4
|
+
interface FileTimestampInfo {
|
|
5
|
+
lastModified: string;
|
|
6
|
+
lastModifiedBy: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function applyContentPagination(data: GitHubFileContentApiResult, charOffset: number, charLength?: number): GitHubFileContentApiResult;
|
|
9
|
+
export declare function fetchFileTimestamp(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, path: string, branch?: string): Promise<FileTimestampInfo | null>;
|
|
10
|
+
export declare function processFileContentAPI(decodedContent: string, owner: string, repo: string, branch: string, filePath: string, fullContent: boolean, startLine?: number, endLine?: number, contextLines?: number, matchString?: string, matchStringIsRegex?: boolean, matchStringCaseSensitive?: boolean, minify?: MinifyMode): Promise<GitHubFileContentApiResult>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GitHubAPIResponse } from './githubAPI.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { FileContentQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
|
|
5
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
6
|
+
export interface RawContentResult {
|
|
7
|
+
rawContent: string;
|
|
8
|
+
branch?: string;
|
|
9
|
+
resolvedRef: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function fetchRawGitHubFileContent(params: FileContentQuery, authInfo?: AuthInfo): Promise<GitHubAPIResponse<RawContentResult>>;
|
|
12
|
+
export {};
|