octocode-mcp 7.0.12-alpha.2 → 7.0.12-alpha.4

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.
@@ -0,0 +1,353 @@
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,2 +1,2 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare function registerAllTools(server: McpServer): Promise<void>;
2
+ export declare function registerAllTools(server: McpServer, _content: import('./tools/toolMetadata.js').CompleteMetadata): Promise<void>;
@@ -1,3 +1,4 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CompleteMetadata } from '../tools/toolMetadata.js';
2
3
  export declare const PROMPT_NAME = "kudos";
3
- export declare function registerKudosPrompt(server: McpServer): void;
4
+ export declare function registerKudosPrompt(server: McpServer, content: CompleteMetadata): void;
@@ -1,6 +1,7 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CompleteMetadata } from '../tools/toolMetadata.js';
2
3
  /**
3
4
  * Register all prompts with the MCP server
4
5
  * Each prompt is defined in its own file under the prompts directory
5
6
  */
6
- export declare function registerPrompts(server: McpServer): void;
7
+ export declare function registerPrompts(server: McpServer, content: CompleteMetadata): void;
@@ -1,3 +1,4 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CompleteMetadata } from '../tools/toolMetadata.js';
2
3
  export declare const PROMPT_NAME = "research";
3
- export declare function registerResearchPrompt(server: McpServer): void;
4
+ export declare function registerResearchPrompt(server: McpServer, content: CompleteMetadata): void;
@@ -1,3 +1,4 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CompleteMetadata } from '../tools/toolMetadata.js';
2
3
  export declare const PROMPT_NAME = "use";
3
- export declare function registerUsePrompt(server: McpServer): void;
4
+ export declare function registerUsePrompt(server: McpServer, content: CompleteMetadata): void;
@@ -7,7 +7,7 @@ declare class SessionManager {
7
7
  logInit(): Promise<void>;
8
8
  logToolCall(toolName: string, repos: string[], mainResearchGoal?: string, researchGoal?: string, reasoning?: string): Promise<void>;
9
9
  logPromptCall(promptName: string): Promise<void>;
10
- logError(error: string): Promise<void>;
10
+ logError(toolName: string, errorCode: string): Promise<void>;
11
11
  logRateLimit(data: RateLimitData): Promise<void>;
12
12
  private sendLog;
13
13
  }
@@ -16,7 +16,7 @@ export declare function getSessionManager(): SessionManager | null;
16
16
  export declare function logSessionInit(): Promise<void>;
17
17
  export declare function logToolCall(toolName: string, repos: string[], mainResearchGoal?: string, researchGoal?: string, reasoning?: string): Promise<void>;
18
18
  export declare function logPromptCall(promptName: string): Promise<void>;
19
- export declare function logSessionError(error: string): Promise<void>;
19
+ export declare function logSessionError(toolName: string, errorCode: string): Promise<void>;
20
20
  export declare function logRateLimit(data: RateLimitData): Promise<void>;
21
21
  export declare function resetSessionManager(): void;
22
22
  export {};
@@ -9,6 +9,28 @@ export interface ToolMetadata {
9
9
  }
10
10
  export interface CompleteMetadata {
11
11
  instructions: string;
12
+ prompts: {
13
+ research: {
14
+ name: string;
15
+ description: string;
16
+ content: string;
17
+ };
18
+ kudos: {
19
+ name: string;
20
+ description: string;
21
+ content: string;
22
+ };
23
+ use: {
24
+ name: string;
25
+ description: string;
26
+ content: string;
27
+ };
28
+ [key: string]: {
29
+ name: string;
30
+ description: string;
31
+ content: string;
32
+ };
33
+ };
12
34
  toolNames: {
13
35
  GITHUB_FETCH_CONTENT: 'githubGetFileContent';
14
36
  GITHUB_SEARCH_CODE: 'githubSearchCode';
@@ -29,21 +51,13 @@ export interface CompleteMetadata {
29
51
  };
30
52
  genericErrorHints: readonly string[];
31
53
  }
32
- export declare const INSTRUCTIONS: string;
33
- export declare const TOOL_NAMES: {
34
- GITHUB_FETCH_CONTENT: "githubGetFileContent";
35
- GITHUB_SEARCH_CODE: "githubSearchCode";
36
- GITHUB_SEARCH_PULL_REQUESTS: "githubSearchPullRequests";
37
- GITHUB_SEARCH_REPOSITORIES: "githubSearchRepositories";
38
- GITHUB_VIEW_REPO_STRUCTURE: "githubViewRepoStructure";
39
- };
54
+ export declare function initializeToolMetadata(): Promise<void>;
55
+ export declare function loadToolContent(): Promise<CompleteMetadata>;
56
+ export declare function getInstructionsSync(): string;
57
+ export declare function getPromptsSync(): CompleteMetadata['prompts'];
58
+ export declare const TOOL_NAMES: CompleteMetadata["toolNames"];
40
59
  export type ToolName = (typeof TOOL_NAMES)[keyof typeof TOOL_NAMES];
41
- export declare const BASE_SCHEMA: {
42
- mainResearchGoal: string;
43
- researchGoal: string;
44
- reasoning: string;
45
- bulkQuery: (toolName: string) => string;
46
- };
60
+ export declare const BASE_SCHEMA: CompleteMetadata["baseSchema"];
47
61
  export declare const GENERIC_ERROR_HINTS: readonly string[];
48
62
  export declare function getCompleteMetadata(): Promise<CompleteMetadata>;
49
63
  export declare function getToolsMetadata(): Promise<Record<string, ToolMetadata>>;
@@ -358,13 +358,6 @@ export interface CacheStats {
358
358
  totalKeys: number;
359
359
  lastReset: Date;
360
360
  }
361
- /** Options for command execution */
362
- export type ExecOptions = {
363
- timeout?: number;
364
- cwd?: string;
365
- env?: Record<string, string>;
366
- cache?: boolean;
367
- };
368
361
  /** Result of a promise with error isolation */
369
362
  export interface PromiseResult<T> {
370
363
  success: boolean;
@@ -1,8 +1,3 @@
1
1
  import { CallToolResult } from '@modelcontextprotocol/sdk/types';
2
- import type { ExecOptions } from '../types.js';
3
- declare const ALLOWED_NPM_COMMANDS: readonly ["view", "search", "ping", "config", "whoami"];
4
- export type NpmCommand = (typeof ALLOWED_NPM_COMMANDS)[number];
5
2
  export declare function parseExecResult(stdout: string, stderr: string, error?: Error | null, exitCode?: number): CallToolResult;
6
- export declare function executeNpmCommand(command: NpmCommand, args: string[], options?: ExecOptions): Promise<CallToolResult>;
7
3
  export declare function getGithubCLIToken(): Promise<string | null>;
8
- export {};
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Fetch with retry mechanism and exponential backoff
3
+ */
4
+ export interface FetchWithRetriesOptions {
5
+ /**
6
+ * Maximum number of retry attempts (excluding the initial request)
7
+ * @default 3
8
+ */
9
+ maxRetries?: number;
10
+ /**
11
+ * Initial delay in milliseconds for exponential backoff
12
+ * @default 1000 (1 second)
13
+ */
14
+ initialDelayMs?: number;
15
+ /**
16
+ * Custom headers to include in the request
17
+ */
18
+ headers?: Record<string, string>;
19
+ /**
20
+ * HTTP method
21
+ * @default 'GET'
22
+ */
23
+ method?: string;
24
+ }
25
+ /**
26
+ * Fetches a URL with automatic retries and exponential backoff.
27
+ *
28
+ * Retry behavior:
29
+ * - Retries on network errors, server errors (5xx), and rate limits (429)
30
+ * - Respects 'Retry-After' header for 429 responses
31
+ * - Does NOT retry on client errors (4xx) except rate limits
32
+ * - Uses exponential backoff: 1s, 2s, 4s (default) if no Retry-After header
33
+ *
34
+ * @param url - The URL to fetch
35
+ * @param options - Configuration options for retries and request
36
+ * @returns The JSON response (or null for 204 No Content)
37
+ * @throws Error if all retry attempts fail
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const data = await fetchWithRetries('https://api.example.com/data', {
42
+ * maxRetries: 3,
43
+ * headers: { 'User-Agent': 'MyApp/1.0' }
44
+ * });
45
+ * ```
46
+ */
47
+ export declare function fetchWithRetries(url: string, options?: FetchWithRetriesOptions): Promise<unknown>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octocode-mcp",
3
- "version": "7.0.12-alpha.2",
3
+ "version": "7.0.12-alpha.4",
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",
@@ -34,6 +34,12 @@
34
34
  "bugs": "https://github.com/bgauryy/octocode-mcp/issues",
35
35
  "license": "MIT",
36
36
  "mcpName": "io.github.bgauryy/octocode-mcp",
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/src/index.d.ts",
40
+ "import": "./dist/index.js"
41
+ }
42
+ },
37
43
  "bin": {
38
44
  "octocode-mcp": "dist/index.js",
39
45
  "octocode-mcp-beta": "dist/index.js"