octocode-mcp 14.1.2 → 14.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 (84) hide show
  1. package/dist/bitbucket/responseGuards.d.ts +14 -0
  2. package/dist/errors/pathUtils.d.ts +1 -1
  3. package/dist/github/codeSearch.d.ts +1 -1
  4. package/dist/github/errors.d.ts +1 -1
  5. package/dist/github/fileContent.d.ts +1 -1
  6. package/dist/github/fileContentProcess.d.ts +1 -1
  7. package/dist/github/fileContentRaw.d.ts +1 -1
  8. package/dist/github/githubAPI.d.ts +1 -0
  9. package/dist/github/prByNumber.d.ts +1 -1
  10. package/dist/github/prContentFetcher.d.ts +2 -2
  11. package/dist/github/prTransformation.d.ts +3 -3
  12. package/dist/github/pullRequestSearch.d.ts +1 -1
  13. package/dist/github/queryBuilders.d.ts +1 -1
  14. package/dist/github/repoSearch.d.ts +1 -1
  15. package/dist/github/repoStructureRecursive.d.ts +1 -1
  16. package/dist/gitlab/responseGuards.d.ts +20 -0
  17. package/dist/index.js +191 -192
  18. package/dist/lsp/cancellableRequest.d.ts +31 -0
  19. package/dist/lsp/client.d.ts +14 -0
  20. package/dist/lsp/initConstants.d.ts +29 -0
  21. package/dist/lsp/initParams.d.ts +17 -0
  22. package/dist/lsp/lspClientPool.d.ts +54 -0
  23. package/dist/lsp/lspDocumentManager.d.ts +1 -1
  24. package/dist/lsp/lspErrorCodes.d.ts +30 -0
  25. package/dist/lsp/lspOperations.d.ts +1 -1
  26. package/dist/lsp/manager.d.ts +19 -21
  27. package/dist/lsp/schemas.d.ts +1 -0
  28. package/dist/lsp/types.d.ts +6 -1
  29. package/dist/lsp/uri.d.ts +28 -0
  30. package/dist/providers/github/GitHubProvider.d.ts +0 -5
  31. package/dist/providers/github/utils.d.ts +10 -0
  32. package/dist/providers/types.d.ts +2 -0
  33. package/dist/public/tools.d.ts +1 -1
  34. package/dist/public.js +179 -180
  35. package/dist/scheme/localSchemaOverlay.d.ts +395 -0
  36. package/dist/scheme/lspSchemaOverlay.d.ts +155 -0
  37. package/dist/scheme/remoteSchemaOverlay.d.ts +187 -0
  38. package/dist/scheme/verbosity.d.ts +34 -0
  39. package/dist/session.d.ts +3 -1
  40. package/dist/tools/github_search_pull_requests/types.d.ts +5 -0
  41. package/dist/tools/github_view_repo_structure/types.d.ts +3 -0
  42. package/dist/tools/local_fetch_content/execution.d.ts +1 -1
  43. package/dist/tools/local_fetch_content/fetchContent.d.ts +14 -1
  44. package/dist/tools/local_fetch_content/register.d.ts +0 -1
  45. package/dist/tools/local_find_files/execution.d.ts +1 -1
  46. package/dist/tools/local_find_files/findFiles.d.ts +16 -1
  47. package/dist/tools/local_find_files/register.d.ts +0 -1
  48. package/dist/tools/local_ripgrep/execution.d.ts +1 -1
  49. package/dist/tools/local_ripgrep/hints.d.ts +0 -4
  50. package/dist/tools/local_ripgrep/patternValidation.d.ts +32 -0
  51. package/dist/tools/local_ripgrep/register.d.ts +0 -4
  52. package/dist/tools/local_ripgrep/ripgrepExecutor.d.ts +1 -10
  53. package/dist/tools/local_ripgrep/ripgrepParser.d.ts +0 -4
  54. package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +19 -3
  55. package/dist/tools/local_ripgrep/searchContentRipgrep.d.ts +0 -3
  56. package/dist/tools/local_view_structure/execution.d.ts +1 -1
  57. package/dist/tools/local_view_structure/local_view_structure.d.ts +12 -1
  58. package/dist/tools/local_view_structure/structureFilters.d.ts +1 -2
  59. package/dist/tools/local_view_structure/structureResponse.d.ts +24 -0
  60. package/dist/tools/lsp_call_hierarchy/callHierarchy.d.ts +18 -3
  61. package/dist/tools/lsp_call_hierarchy/callHierarchyLsp.d.ts +3 -3
  62. package/dist/tools/lsp_call_hierarchy/callHierarchyPatterns.d.ts +0 -5
  63. package/dist/tools/lsp_find_references/lspReferencesProcess.d.ts +6 -0
  64. package/dist/tools/lsp_find_references/lsp_find_references.d.ts +17 -2
  65. package/dist/tools/lsp_goto_definition/execution.d.ts +19 -1
  66. package/dist/tools/lsp_restart/execution.d.ts +8 -0
  67. package/dist/tools/utils.d.ts +3 -1
  68. package/dist/types/metadata.d.ts +2 -1
  69. package/dist/types/toolTypes.d.ts +1 -1
  70. package/dist/utils/core/bestEffort.d.ts +6 -0
  71. package/dist/utils/core/constants.d.ts +7 -0
  72. package/dist/utils/exec/commandAvailability.d.ts +11 -13
  73. package/dist/utils/exec/ripgrepBinary.d.ts +24 -0
  74. package/dist/utils/http/fetch.d.ts +9 -0
  75. package/dist/utils/package/common.d.ts +1 -0
  76. package/dist/utils/package/types.d.ts +1 -0
  77. package/dist/utils/parsers/ripgrep.d.ts +0 -5
  78. package/dist/utils/response/charSavings.d.ts +3 -0
  79. package/dist/utils/response/error.d.ts +2 -0
  80. package/dist/utils/secureServer.d.ts +48 -10
  81. package/dist/utils/securityBridge.d.ts +3 -3
  82. package/package.json +5 -4
  83. package/dist/commands/GrepCommandBuilder.d.ts +0 -69
  84. package/dist/utils/file/types.d.ts +0 -5
@@ -0,0 +1,14 @@
1
+ import type { BitbucketCodeSearchItem, BitbucketDiffstatEntry, BitbucketPaginatedResponse, BitbucketPullRequest, BitbucketRepository, BitbucketTreeEntry } from './types.js';
2
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
3
+ export declare function parseBitbucketCodeSearchPage(value: unknown): {
4
+ values: BitbucketCodeSearchItem[];
5
+ size: number;
6
+ next?: string;
7
+ page: number;
8
+ } | null;
9
+ export declare function parseBitbucketPaginatedResponse<T>(value: unknown, itemGuard: (item: unknown) => item is T): BitbucketPaginatedResponse<T> | null;
10
+ export declare function isBitbucketRepository(value: unknown): value is BitbucketRepository;
11
+ export declare function isBitbucketPullRequest(value: unknown): value is BitbucketPullRequest;
12
+ export declare function isBitbucketTreeEntry(value: unknown): value is BitbucketTreeEntry;
13
+ export declare function isBitbucketDiffstatEntry(value: unknown): value is BitbucketDiffstatEntry;
14
+ export declare function parseBitbucketDefaultBranch(value: unknown): string | null;
@@ -1 +1 @@
1
- export { redactPath } from '@octocode/security/pathUtils';
1
+ export { redactPath } from 'octocode-security-utils/pathUtils';
@@ -1,4 +1,4 @@
1
- import type { GitHubAPIResponse, OptimizedCodeSearchResult } from './githubAPI';
1
+ import type { GitHubAPIResponse, OptimizedCodeSearchResult } from './githubAPI.js';
2
2
  import type { GitHubCodeSearchQuery } from '@octocodeai/octocode-core';
3
3
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
4
4
  export declare function searchGitHubCodeAPI(params: GitHubCodeSearchQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<OptimizedCodeSearchResult>>;
@@ -1,2 +1,2 @@
1
- import type { GitHubAPIError } from './githubAPI';
1
+ import type { GitHubAPIError } from './githubAPI.js';
2
2
  export declare function handleGitHubAPIError(error: unknown): GitHubAPIError;
@@ -5,7 +5,7 @@
5
5
  * - fileContentRaw.ts: raw API fetching, branch fallback, base64 decode
6
6
  * - fileContentProcess.ts: line extraction, match search, sanitization, minification
7
7
  */
8
- import type { GitHubAPIResponse } from './githubAPI';
8
+ import type { GitHubAPIResponse } from './githubAPI.js';
9
9
  import type { FileContentExecutionQuery, GitHubFileContentApiResult } from '../tools/github_fetch_content/types.js';
10
10
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
11
11
  export declare function fetchGitHubFileContentAPI(params: FileContentExecutionQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<GitHubFileContentApiResult>>;
@@ -3,7 +3,7 @@
3
3
  * Extracted from fileContent.ts to isolate post-cache processing.
4
4
  */
5
5
  import type { GitHubFileContentApiResult } from '../tools/github_fetch_content/types.js';
6
- import { OctokitWithThrottling } from './client';
6
+ import { OctokitWithThrottling } from './client.js';
7
7
  interface FileTimestampInfo {
8
8
  lastModified: string;
9
9
  lastModifiedBy: string;
@@ -1,4 +1,4 @@
1
- import type { GitHubAPIResponse } from './githubAPI';
1
+ import type { GitHubAPIResponse } from './githubAPI.js';
2
2
  import type { FileContentQuery } from '@octocodeai/octocode-core';
3
3
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
4
4
  export interface RawContentResult {
@@ -65,6 +65,7 @@ export interface GitHubAPISuccess<T> {
65
65
  data: T;
66
66
  status: number;
67
67
  headers?: Record<string, string>;
68
+ rawResponseChars?: number;
68
69
  }
69
70
  export type GitHubAPIResponse<T> = GitHubAPISuccess<T> | GitHubAPIError;
70
71
  /**
@@ -2,7 +2,7 @@
2
2
  * Fetch a single pull request by number — public API + internal implementation.
3
3
  * Extracted from pullRequestSearch.ts.
4
4
  */
5
- import { GitHubPullRequestsSearchParams } from './githubAPI';
5
+ import type { GitHubPullRequestsSearchParams } from './githubAPI.js';
6
6
  import type { GitHubPullRequestSearchApiResult } from '../tools/github_search_pull_requests/types.js';
7
7
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
8
8
  export declare function fetchGitHubPullRequestByNumberAPI(params: GitHubPullRequestsSearchParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubPullRequestSearchApiResult>;
@@ -2,8 +2,8 @@
2
2
  * PR content fetching — comments, commits, file changes, and item transformation.
3
3
  * Extracted from pullRequestSearch.ts.
4
4
  */
5
- import { GitHubPullRequestsSearchParams, GitHubPullRequestItem, IssueSearchResultItem, PullRequestSimple, PullRequestItem } from './githubAPI';
6
- import { OctokitWithThrottling } from './client';
5
+ import { GitHubPullRequestsSearchParams, GitHubPullRequestItem, IssueSearchResultItem, PullRequestSimple, PullRequestItem } from './githubAPI.js';
6
+ import { OctokitWithThrottling } from './client.js';
7
7
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
8
8
  export declare function transformPullRequestItemFromSearch(item: IssueSearchResultItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>): Promise<GitHubPullRequestItem>;
9
9
  export declare function transformPullRequestItemFromREST(item: PullRequestSimple | PullRequestItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>, authInfo?: AuthInfo): Promise<GitHubPullRequestItem>;
@@ -2,7 +2,7 @@
2
2
  * PR transformation and formatting — converts raw GitHub API data to unified output format.
3
3
  * Extracted from pullRequestSearch.ts.
4
4
  */
5
- import { GitHubPullRequestsSearchParams, GitHubPullRequestItem, DiffEntry, CommitFileInfo } from './githubAPI';
5
+ import { GitHubPullRequestsSearchParams, GitHubPullRequestItem, DiffEntry, CommitFileInfo } from './githubAPI.js';
6
6
  /**
7
7
  * Common interface for raw PR data from either Search API or REST API.
8
8
  * This enables a unified transformation function that handles both sources.
@@ -62,8 +62,8 @@ export declare function truncatePRBody(body: string | null | undefined, prNumber
62
62
  */
63
63
  export declare function formatPRForResponse(pr: GitHubPullRequestItem): {
64
64
  _sanitization_warnings: string[];
65
- comment_details: import("./githubAPI").PRCommentItem[];
66
- commit_details: import("./githubAPI").CommitInfo[];
65
+ comment_details: import("./githubAPI.js").PRCommentItem[];
66
+ commit_details: import("./githubAPI.js").CommitInfo[];
67
67
  file_changes: {
68
68
  filename: string;
69
69
  status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
@@ -6,7 +6,7 @@
6
6
  * - prContentFetcher.ts: comments, commits, file changes, item transforms
7
7
  * - prByNumber.ts: fetch single PR by number
8
8
  */
9
- import { GitHubPullRequestsSearchParams } from './githubAPI';
9
+ import type { GitHubPullRequestsSearchParams } from './githubAPI.js';
10
10
  import type { GitHubPullRequestSearchApiResult } from '../tools/github_search_pull_requests/types.js';
11
11
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
12
12
  export declare function searchGitHubPullRequestsAPI(params: GitHubPullRequestsSearchParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubPullRequestSearchApiResult>;
@@ -1,5 +1,5 @@
1
1
  import type { GitHubCodeSearchQuery, GitHubReposSearchQuery } from '@octocodeai/octocode-core';
2
- import { GitHubPullRequestsSearchParams } from './githubAPI';
2
+ import { GitHubPullRequestsSearchParams } from './githubAPI.js';
3
3
  export declare function getOwnerQualifier(owner: string): string;
4
4
  export declare function buildCodeSearchQuery(params: GitHubCodeSearchQuery): string;
5
5
  export declare function buildRepoSearchQuery(params: GitHubReposSearchQuery): string;
@@ -1,4 +1,4 @@
1
- import type { GitHubAPIResponse } from './githubAPI';
1
+ import type { GitHubAPIResponse } from './githubAPI.js';
2
2
  import type { GitHubReposSearchQuery, GitHubRepositoryOutput } from '@octocodeai/octocode-core';
3
3
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
4
4
  /** Pagination info for repository search results */
@@ -3,7 +3,7 @@
3
3
  * Extracted from repoStructure.ts.
4
4
  */
5
5
  import type { GitHubApiFileItem } from '../tools/github_view_repo_structure/types.js';
6
- import { OctokitWithThrottling } from './client';
6
+ import { OctokitWithThrottling } from './client.js';
7
7
  /**
8
8
  * Recursively fetch directory contents using API
9
9
  */
@@ -0,0 +1,20 @@
1
+ import type { GitLabCodeSearchItem, GitLabFileContent, GitLabMergeRequest, GitLabMRNote, GitLabProject, GitLabTreeItem } from './types.js';
2
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
3
+ export declare function parseGitLabArray<T>(value: unknown, itemGuard: (item: unknown) => item is T): T[] | null;
4
+ export declare function isGitLabCodeSearchItem(value: unknown): value is GitLabCodeSearchItem;
5
+ export declare function isGitLabProject(value: unknown): value is GitLabProject;
6
+ export declare function parseGitLabFileContent(value: unknown, fallbackRef: string): GitLabFileContent | null;
7
+ export declare function parseGitLabDefaultBranch(value: unknown): string | null;
8
+ export declare function isGitLabMergeRequest(value: unknown): value is GitLabMergeRequest;
9
+ export declare function isGitLabMRNote(value: unknown): value is GitLabMRNote;
10
+ export declare function isGitLabTreeItem(value: unknown): value is GitLabTreeItem;
11
+ export declare function hasGitLabSearchApi(value: unknown): value is {
12
+ Search: {
13
+ all: (...args: unknown[]) => Promise<unknown>;
14
+ };
15
+ };
16
+ export declare function hasGitLabAllDiffs(value: unknown): value is {
17
+ allDiffs: (projectId: number | string, mrIid: number, options?: {
18
+ perPage?: number;
19
+ }) => Promise<unknown>;
20
+ };