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.
Files changed (137) hide show
  1. package/README.md +14 -135
  2. package/dist/index.js +29 -7
  3. package/package.json +34 -15
  4. package/dist/src/errorCodes.d.ts +0 -353
  5. package/dist/src/github/client.d.ts +0 -4
  6. package/dist/src/github/codeSearch.d.ts +0 -4
  7. package/dist/src/github/errorConstants.d.ts +0 -173
  8. package/dist/src/github/errors.d.ts +0 -4
  9. package/dist/src/github/fileOperations.d.ts +0 -6
  10. package/dist/src/github/githubAPI.d.ts +0 -164
  11. package/dist/src/github/index.d.ts +0 -10
  12. package/dist/src/github/pullRequestSearch.d.ts +0 -7
  13. package/dist/src/github/queryBuilders.d.ts +0 -7
  14. package/dist/src/github/repoSearch.d.ts +0 -6
  15. package/dist/src/index.d.ts +0 -2
  16. package/dist/src/prompts/prompts.d.ts +0 -7
  17. package/dist/src/responses.d.ts +0 -8
  18. package/dist/src/scheme/baseSchema.d.ts +0 -21
  19. package/dist/src/scheme/github_fetch_content.d.ts +0 -203
  20. package/dist/src/scheme/github_search_code.d.ts +0 -131
  21. package/dist/src/scheme/github_search_pull_requests.d.ts +0 -390
  22. package/dist/src/scheme/github_search_repos.d.ts +0 -79
  23. package/dist/src/scheme/github_view_repo_structure.d.ts +0 -148
  24. package/dist/src/scheme/package_search.d.ts +0 -196
  25. package/dist/src/security/contentSanitizer.d.ts +0 -6
  26. package/dist/src/security/mask.d.ts +0 -1
  27. package/dist/src/security/regexes.d.ts +0 -2
  28. package/dist/src/security/withSecurityValidation.d.ts +0 -86
  29. package/dist/src/serverConfig.d.ts +0 -12
  30. package/dist/src/session.d.ts +0 -22
  31. package/dist/src/tools/github_fetch_content.d.ts +0 -3
  32. package/dist/src/tools/github_search_code.d.ts +0 -3
  33. package/dist/src/tools/github_search_pull_requests.d.ts +0 -3
  34. package/dist/src/tools/github_search_repos.d.ts +0 -3
  35. package/dist/src/tools/github_view_repo_structure.d.ts +0 -3
  36. package/dist/src/tools/package_search.d.ts +0 -3
  37. package/dist/src/tools/toolConfig.d.ts +0 -16
  38. package/dist/src/tools/toolMetadata.d.ts +0 -207
  39. package/dist/src/tools/toolsManager.d.ts +0 -6
  40. package/dist/src/tools/utils.d.ts +0 -23
  41. package/dist/src/types.d.ts +0 -537
  42. package/dist/src/utils/bulkOperations.d.ts +0 -3
  43. package/dist/src/utils/cache.d.ts +0 -22
  44. package/dist/src/utils/diffParser.d.ts +0 -1
  45. package/dist/src/utils/exec.d.ts +0 -25
  46. package/dist/src/utils/fetchWithRetries.d.ts +0 -52
  47. package/dist/src/utils/fileFilters.d.ts +0 -19
  48. package/dist/src/utils/githubRepoFallback.d.ts +0 -17
  49. package/dist/src/utils/logger.d.ts +0 -40
  50. package/dist/src/utils/npmPackage.d.ts +0 -3
  51. package/dist/src/utils/package.d.ts +0 -50
  52. package/dist/src/utils/promiseUtils.d.ts +0 -2
  53. package/dist/src/utils/pythonPackage.d.ts +0 -2
  54. package/dist/tests/errorCodes.test.d.ts +0 -1
  55. package/dist/tests/fixtures/mcp-fixtures.d.ts +0 -24
  56. package/dist/tests/fixtures/mcp-fixtures.test.d.ts +0 -1
  57. package/dist/tests/github/client.test.d.ts +0 -1
  58. package/dist/tests/github/codeSearch.filtering.test.d.ts +0 -1
  59. package/dist/tests/github/codeSearch.security.test.d.ts +0 -1
  60. package/dist/tests/github/errors.test.d.ts +0 -1
  61. package/dist/tests/github/fileOperations.processContent.test.d.ts +0 -1
  62. package/dist/tests/github/fileOperations.recursive.test.d.ts +0 -1
  63. package/dist/tests/github/githubAPI.test.d.ts +0 -1
  64. package/dist/tests/github/index.test.d.ts +0 -1
  65. package/dist/tests/github/pullRequestSearch.coverage.test.d.ts +0 -1
  66. package/dist/tests/github/pullRequestSearch.test.d.ts +0 -1
  67. package/dist/tests/github/queryBuilders.test.d.ts +0 -1
  68. package/dist/tests/github/repoSearch.test.d.ts +0 -1
  69. package/dist/tests/index.logic.test.d.ts +0 -1
  70. package/dist/tests/index.shutdown.test.d.ts +0 -1
  71. package/dist/tests/index.startup.test.d.ts +0 -1
  72. package/dist/tests/index.test.d.ts +0 -1
  73. package/dist/tests/investigate_pr_response.test.d.ts +0 -1
  74. package/dist/tests/prompts/prompts.test.d.ts +0 -1
  75. package/dist/tests/scheme/github_fetch_content.test.d.ts +0 -1
  76. package/dist/tests/security/contentSanitizer.test.d.ts +0 -1
  77. package/dist/tests/security/mask.branches.test.d.ts +0 -1
  78. package/dist/tests/security/mask.test.d.ts +0 -1
  79. package/dist/tests/security/withSecurityValidation.basic.test.d.ts +0 -1
  80. package/dist/tests/security/withSecurityValidation.extractRepoOwner.test.d.ts +0 -1
  81. package/dist/tests/security/withSecurityValidation.extractResearchFields.test.d.ts +0 -1
  82. package/dist/tests/security/withSecurityValidation.logging.test.d.ts +0 -1
  83. package/dist/tests/serverConfig.test.d.ts +0 -1
  84. package/dist/tests/session.edgecases.test.d.ts +0 -1
  85. package/dist/tests/session.logging_control.test.d.ts +0 -1
  86. package/dist/tests/session.test.d.ts +0 -1
  87. package/dist/tests/setup.d.ts +0 -1
  88. package/dist/tests/tools/callback.test.d.ts +0 -1
  89. package/dist/tests/tools/github_fetch_content.test.d.ts +0 -1
  90. package/dist/tests/tools/github_search_code.filtering.test.d.ts +0 -1
  91. package/dist/tests/tools/github_search_code.match_modes.test.d.ts +0 -22
  92. package/dist/tests/tools/github_search_code.test.d.ts +0 -1
  93. package/dist/tests/tools/github_search_code.tool.test.d.ts +0 -1
  94. package/dist/tests/tools/github_search_pull_requests.test.d.ts +0 -1
  95. package/dist/tests/tools/github_search_repos.tool.test.d.ts +0 -1
  96. package/dist/tests/tools/github_search_repos_integration.test.d.ts +0 -1
  97. package/dist/tests/tools/github_search_repos_query_splitting.test.d.ts +0 -1
  98. package/dist/tests/tools/github_view_repo_structure.test.d.ts +0 -1
  99. package/dist/tests/tools/github_view_repo_structure_filters.test.d.ts +0 -1
  100. package/dist/tests/tools/hints.test.d.ts +0 -1
  101. package/dist/tests/tools/package_search.test.d.ts +0 -1
  102. package/dist/tests/tools/response_structure.test.d.ts +0 -12
  103. package/dist/tests/tools/toolConfig.branches.test.d.ts +0 -1
  104. package/dist/tests/tools/toolConfig.test.d.ts +0 -1
  105. package/dist/tests/tools/toolMetadata.branches.test.d.ts +0 -1
  106. package/dist/tests/tools/toolMetadata.edge.test.d.ts +0 -1
  107. package/dist/tests/tools/toolMetadata.final.test.d.ts +0 -1
  108. package/dist/tests/tools/toolMetadata.test.d.ts +0 -1
  109. package/dist/tests/tools/toolsManager.metadata.test.d.ts +0 -1
  110. package/dist/tests/tools/toolsManager.test.d.ts +0 -1
  111. package/dist/tests/tools/tools_logging_integration.test.d.ts +0 -1
  112. package/dist/tests/tools/userContext_authInfo_propagation.test.d.ts +0 -10
  113. package/dist/tests/tools/utils.test.d.ts +0 -5
  114. package/dist/tests/types/github-openapi.test.d.ts +0 -1
  115. package/dist/tests/utils/betaFeatures.test.d.ts +0 -1
  116. package/dist/tests/utils/bulkOperations.instructions.test.d.ts +0 -1
  117. package/dist/tests/utils/bulkOperations.test.d.ts +0 -1
  118. package/dist/tests/utils/cache.collision.test.d.ts +0 -1
  119. package/dist/tests/utils/cache.dataCache.test.d.ts +0 -1
  120. package/dist/tests/utils/diffParser.test.d.ts +0 -1
  121. package/dist/tests/utils/exec.test.d.ts +0 -1
  122. package/dist/tests/utils/fetchWithRetries.additional.test.d.ts +0 -1
  123. package/dist/tests/utils/fetchWithRetries.test.d.ts +0 -1
  124. package/dist/tests/utils/fileFilters.test.d.ts +0 -1
  125. package/dist/tests/utils/github/fileOperations.test.d.ts +0 -1
  126. package/dist/tests/utils/githubAPI.test.d.ts +0 -1
  127. package/dist/tests/utils/githubRepoFallback.test.d.ts +0 -1
  128. package/dist/tests/utils/logger.test.d.ts +0 -1
  129. package/dist/tests/utils/npmPackage.test.d.ts +0 -1
  130. package/dist/tests/utils/promiseUtils.concurrency.test.d.ts +0 -1
  131. package/dist/tests/utils/promiseUtils.edgecases.test.d.ts +0 -1
  132. package/dist/tests/utils/promiseUtils.test.d.ts +0 -1
  133. package/dist/tests/utils/pythonPackage.test.d.ts +0 -1
  134. package/dist/tests/utils/responses.empty_arrays.test.d.ts +0 -4
  135. package/dist/tests/utils/responses.test.d.ts +0 -1
  136. package/dist/tests/utils/sessionCacheTests.test.d.ts +0 -1
  137. package/dist/tests/utils/testHelpers.d.ts +0 -16
@@ -1,40 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- /**
3
- * Simple, reliable logger for Octocode MCP
4
- */
5
- export declare class OctocodeLogger {
6
- private readonly prefix;
7
- private readonly server;
8
- constructor(server: McpServer, component?: string);
9
- /**
10
- * Log info message
11
- */
12
- info(message: string, data?: Record<string, unknown>): Promise<void>;
13
- /**
14
- * Log warning message
15
- */
16
- warning(message: string, data?: Record<string, unknown>): Promise<void>;
17
- /**
18
- * Log error message
19
- */
20
- error(message: string, data?: Record<string, unknown>): Promise<void>;
21
- /**
22
- * Log debug message
23
- */
24
- debug(message: string, data?: Record<string, unknown>): Promise<void>;
25
- /**
26
- * Core logging method - simple and reliable
27
- */
28
- private log;
29
- }
30
- /**
31
- * Create a simple logger instance
32
- */
33
- export declare function createLogger(server: McpServer, component?: string): OctocodeLogger;
34
- /**
35
- * Simple logger factory
36
- */
37
- export declare class LoggerFactory {
38
- private static loggers;
39
- static getLogger(server: McpServer, component: string): OctocodeLogger;
40
- }
@@ -1,3 +0,0 @@
1
- import { PackageSearchAPIResult, PackageSearchError, DeprecationInfo } from './package.js';
2
- export declare function searchNpmPackage(packageName: string, limit: number, fetchMetadata: boolean): Promise<PackageSearchAPIResult | PackageSearchError>;
3
- export declare function checkNpmDeprecation(packageName: string): Promise<DeprecationInfo | null>;
@@ -1,50 +0,0 @@
1
- import { checkNpmDeprecation } from './npmPackage.js';
2
- export interface PackageSearchInput {
3
- ecosystem: 'npm' | 'python';
4
- name: string;
5
- searchLimit?: number;
6
- npmFetchMetadata?: boolean;
7
- pythonFetchMetadata?: boolean;
8
- mainResearchGoal?: string;
9
- researchGoal?: string;
10
- reasoning?: string;
11
- }
12
- export interface MinimalPackageResult {
13
- name: string;
14
- repository: string | null;
15
- }
16
- export interface NpmPackageResult {
17
- repoUrl: string | null;
18
- path: string;
19
- version: string;
20
- mainEntry: string | null;
21
- typeDefinitions: string | null;
22
- lastPublished?: string;
23
- }
24
- export interface PythonPackageResult {
25
- name: string;
26
- version: string;
27
- description: string | null;
28
- keywords: string[];
29
- repository: string | null;
30
- homepage?: string;
31
- author?: string;
32
- license?: string;
33
- lastPublished?: string;
34
- }
35
- export type PackageResult = MinimalPackageResult | NpmPackageResult | PythonPackageResult;
36
- export interface PackageSearchAPIResult {
37
- packages: PackageResult[];
38
- ecosystem: 'npm' | 'python';
39
- totalFound: number;
40
- }
41
- export interface PackageSearchError {
42
- error: string;
43
- hints?: string[];
44
- }
45
- export interface DeprecationInfo {
46
- deprecated: boolean;
47
- message?: string;
48
- }
49
- export declare function searchPackage(query: PackageSearchInput): Promise<PackageSearchAPIResult | PackageSearchError>;
50
- export { checkNpmDeprecation };
@@ -1,2 +0,0 @@
1
- import type { PromiseResult, PromiseExecutionOptions } from '../types.js';
2
- export declare function executeWithErrorIsolation<T>(promises: Array<() => Promise<T>>, options?: PromiseExecutionOptions): Promise<PromiseResult<T>[]>;
@@ -1,2 +0,0 @@
1
- import { PackageSearchAPIResult, PackageSearchError } from './package.js';
2
- export declare function searchPythonPackage(packageName: string, fetchMetadata: boolean): Promise<PackageSearchAPIResult | PackageSearchError>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
3
- export interface MockMcpServer {
4
- server: McpServer;
5
- callTool: (name: string, args?: Record<string, unknown>, options?: {
6
- authInfo?: {
7
- token?: string;
8
- };
9
- sessionId?: string;
10
- }) => Promise<CallToolResult>;
11
- cleanup: () => void;
12
- }
13
- /**
14
- * Create a mock MCP server for testing
15
- */
16
- export declare function createMockMcpServer(): MockMcpServer;
17
- /**
18
- * Create a mock CallToolResult for testing
19
- */
20
- export declare function createMockResult(data: unknown, isError?: boolean): CallToolResult;
21
- /**
22
- * Parse JSON from a CallToolResult
23
- */
24
- export declare function parseResultJson<T = unknown>(result: CallToolResult): T;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- /**
2
- * GitHub Search Code - match='file' vs match='path' Modes
3
- *
4
- * This test file verifies that both search modes work correctly and return
5
- * the proper structure based on the search type.
6
- *
7
- * IMPORTANT: text_matches behavior has been FIXED (as of this commit):
8
- *
9
- * For match='file' (content search):
10
- * - Searches IN file content for your keywords
11
- * - Returns: files array with path + text_matches (code snippets where keyword appears)
12
- * - Example: Searching "useState" returns files with text_matches showing actual code with useState
13
- *
14
- * For match='path' (filename/directory search):
15
- * - Searches in file/directory NAMES for your keywords
16
- * - Returns: files array with path ONLY (NO text_matches)
17
- * - Example: Searching "test" returns paths like "scripts/jest/TestFlags.js" (no content snippets)
18
- * - This makes sense: you're finding files by name, not searching their content!
19
- *
20
- * Test Results from Actual Octocode MCP Server (Verified):
21
- */
22
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- /**
2
- * Comprehensive Response Structure Tests
3
- *
4
- * Tests all tools to ensure they properly handle all combinations of:
5
- * - hasResults: queries that returned results
6
- * - empty: queries that ran but found no matches
7
- * - failed: queries that encountered errors
8
- *
9
- * Combinations tested:
10
- * 1. hasResults only
11
- */
12
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- /**
2
- * Comprehensive tests to verify sessionId and authInfo propagation
3
- * from Tools → GitHub API layer for ALL tools
4
- *
5
- * This test suite ensures that:
6
- * 1. All tools correctly receive sessionId from withSecurityValidation
7
- * 2. All tools correctly pass sessionId to GitHub APIs
8
- * 3. All GitHub APIs properly receive and use sessionId for caching
9
- */
10
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Tests for tool utility functions
3
- * Validates hint propagation, error handling, and result creation
4
- */
5
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Tests to ensure empty arrays are not included in responses
3
- */
4
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- /**
2
- * Test helpers for type guards and common test utilities
3
- */
4
- import type { ContentBlock } from '@modelcontextprotocol/sdk/types.js';
5
- /**
6
- * Type guard to check if a ContentBlock is TextContent
7
- */
8
- export declare function isTextContent(content: ContentBlock | undefined): content is {
9
- type: 'text';
10
- text: string;
11
- };
12
- /**
13
- * Extracts text from a ContentBlock array, asserting it's text content
14
- * @throws Error if content is not text type
15
- */
16
- export declare function getTextContent(content: ContentBlock[]): string;