@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.
Files changed (193) hide show
  1. package/dist/commands/BaseCommandBuilder.d.ts +14 -0
  2. package/dist/commands/FindCommandBuilder.d.ts +23 -0
  3. package/dist/commands/LsCommandBuilder.d.ts +15 -0
  4. package/dist/commands/RipgrepCommandBuilder.d.ts +27 -0
  5. package/dist/config.d.ts +16 -0
  6. package/dist/direct.d.ts +3 -0
  7. package/dist/direct.js +53 -0
  8. package/dist/errors/ToolError.d.ts +21 -0
  9. package/dist/errors/domainErrors.d.ts +310 -0
  10. package/dist/errors/errorFactories.d.ts +12 -0
  11. package/dist/errors/localToolErrors.d.ts +29 -0
  12. package/dist/errors/pathUtils.d.ts +1 -0
  13. package/dist/github/client.d.ts +12 -0
  14. package/dist/github/codeSearch.d.ts +8 -0
  15. package/dist/github/directoryFetch.d.ts +5 -0
  16. package/dist/github/errorConstants.d.ts +81 -0
  17. package/dist/github/errors.d.ts +3 -0
  18. package/dist/github/fileContent.d.ts +4 -0
  19. package/dist/github/fileContentProcess.d.ts +11 -0
  20. package/dist/github/fileContentRaw.d.ts +12 -0
  21. package/dist/github/githubAPI.d.ts +237 -0
  22. package/dist/github/history.d.ts +16 -0
  23. package/dist/github/prByNumber.d.ts +5 -0
  24. package/dist/github/prContentFetcher.d.ts +5 -0
  25. package/dist/github/prTransformation.d.ts +109 -0
  26. package/dist/github/pullRequestSearch.d.ts +4 -0
  27. package/dist/github/queryBuilders.d.ts +12 -0
  28. package/dist/github/repoSearch.d.ts +25 -0
  29. package/dist/github/repoStructure.d.ts +7 -0
  30. package/dist/github/repoStructurePagination.d.ts +6 -0
  31. package/dist/github/repoStructureRecursive.d.ts +3 -0
  32. package/dist/github/responseHeaders.d.ts +1 -0
  33. package/dist/hints/dynamic.d.ts +6 -0
  34. package/dist/hints/index.d.ts +2 -0
  35. package/dist/hints/types.d.ts +1 -0
  36. package/dist/index.d.ts +187 -0
  37. package/dist/index.js +64 -0
  38. package/dist/providers/capabilities.d.ts +2 -0
  39. package/dist/providers/factory.d.ts +9 -0
  40. package/dist/providers/github/GitHubProvider.d.ts +14 -0
  41. package/dist/providers/github/githubContent.d.ts +9 -0
  42. package/dist/providers/github/githubPullRequests.d.ts +12 -0
  43. package/dist/providers/github/githubSearch.d.ts +12 -0
  44. package/dist/providers/github/githubStructure.d.ts +9 -0
  45. package/dist/providers/github/utils.d.ts +10 -0
  46. package/dist/providers/providerQueries.d.ts +111 -0
  47. package/dist/providers/providerResults.d.ts +175 -0
  48. package/dist/providers/types.d.ts +48 -0
  49. package/dist/responses.d.ts +47 -0
  50. package/dist/scheme/coreSchemas.d.ts +10 -0
  51. package/dist/scheme/fields.d.ts +13 -0
  52. package/dist/scheme/responseEnvelope.d.ts +16 -0
  53. package/dist/security/bridge.d.ts +10 -0
  54. package/dist/serverConfig.d.ts +23 -0
  55. package/dist/session.d.ts +25 -0
  56. package/dist/tools/directToolCatalog.d.ts +56 -0
  57. package/dist/tools/executionGuard.d.ts +14 -0
  58. package/dist/tools/github_clone_repo/cache.d.ts +21 -0
  59. package/dist/tools/github_clone_repo/cloneRepo.d.ts +6 -0
  60. package/dist/tools/github_clone_repo/execution.d.ts +8 -0
  61. package/dist/tools/github_clone_repo/hints.d.ts +2 -0
  62. package/dist/tools/github_clone_repo/scheme.d.ts +50 -0
  63. package/dist/tools/github_clone_repo/types.d.ts +19 -0
  64. package/dist/tools/github_fetch_content/execution.d.ts +7 -0
  65. package/dist/tools/github_fetch_content/finalizer.d.ts +10 -0
  66. package/dist/tools/github_fetch_content/hints.d.ts +2 -0
  67. package/dist/tools/github_fetch_content/scheme.d.ts +120 -0
  68. package/dist/tools/github_fetch_content/types.d.ts +66 -0
  69. package/dist/tools/github_search_code/execution.d.ts +8 -0
  70. package/dist/tools/github_search_code/finalizer.d.ts +6 -0
  71. package/dist/tools/github_search_code/hints.d.ts +2 -0
  72. package/dist/tools/github_search_code/scheme.d.ts +88 -0
  73. package/dist/tools/github_search_pull_requests/contentRequest.d.ts +52 -0
  74. package/dist/tools/github_search_pull_requests/contentResponse.d.ts +18 -0
  75. package/dist/tools/github_search_pull_requests/execution.d.ts +17 -0
  76. package/dist/tools/github_search_pull_requests/hints.d.ts +2 -0
  77. package/dist/tools/github_search_pull_requests/scheme.d.ts +224 -0
  78. package/dist/tools/github_search_pull_requests/types.d.ts +120 -0
  79. package/dist/tools/github_search_repos/execution.d.ts +17 -0
  80. package/dist/tools/github_search_repos/hints.d.ts +2 -0
  81. package/dist/tools/github_search_repos/scheme.d.ts +96 -0
  82. package/dist/tools/github_view_repo_structure/constants.d.ts +4 -0
  83. package/dist/tools/github_view_repo_structure/execution.d.ts +20 -0
  84. package/dist/tools/github_view_repo_structure/hints.d.ts +2 -0
  85. package/dist/tools/github_view_repo_structure/scheme.d.ts +81 -0
  86. package/dist/tools/github_view_repo_structure/types.d.ts +39 -0
  87. package/dist/tools/local_binary_inspect/archiveOps.d.ts +22 -0
  88. package/dist/tools/local_binary_inspect/binaryInspector.d.ts +49 -0
  89. package/dist/tools/local_binary_inspect/binaryOps.d.ts +18 -0
  90. package/dist/tools/local_binary_inspect/decompressOps.d.ts +16 -0
  91. package/dist/tools/local_binary_inspect/execution.d.ts +4 -0
  92. package/dist/tools/local_binary_inspect/scheme.d.ts +44 -0
  93. package/dist/tools/local_fetch_content/contentExtractor.d.ts +9 -0
  94. package/dist/tools/local_fetch_content/execution.d.ts +5 -0
  95. package/dist/tools/local_fetch_content/fetchContent.d.ts +4 -0
  96. package/dist/tools/local_fetch_content/hints.d.ts +2 -0
  97. package/dist/tools/local_fetch_content/scheme.d.ts +31 -0
  98. package/dist/tools/local_find_files/execution.d.ts +5 -0
  99. package/dist/tools/local_find_files/findFiles.d.ts +11 -0
  100. package/dist/tools/local_find_files/hints.d.ts +2 -0
  101. package/dist/tools/local_find_files/scheme.d.ts +9 -0
  102. package/dist/tools/local_ripgrep/execution.d.ts +5 -0
  103. package/dist/tools/local_ripgrep/grepFallbackExecutor.d.ts +3 -0
  104. package/dist/tools/local_ripgrep/hints.d.ts +2 -0
  105. package/dist/tools/local_ripgrep/patternValidation.d.ts +12 -0
  106. package/dist/tools/local_ripgrep/ripgrepExecutor.d.ts +3 -0
  107. package/dist/tools/local_ripgrep/ripgrepParser.d.ts +9 -0
  108. package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +9 -0
  109. package/dist/tools/local_ripgrep/scheme.d.ts +55 -0
  110. package/dist/tools/local_ripgrep/searchContentRipgrep.d.ts +5 -0
  111. package/dist/tools/local_ripgrep/structuralSearch.d.ts +9 -0
  112. package/dist/tools/local_view_structure/execution.d.ts +5 -0
  113. package/dist/tools/local_view_structure/hints.d.ts +2 -0
  114. package/dist/tools/local_view_structure/local_view_structure.d.ts +7 -0
  115. package/dist/tools/local_view_structure/scheme.d.ts +33 -0
  116. package/dist/tools/local_view_structure/structureFilters.d.ts +33 -0
  117. package/dist/tools/local_view_structure/structureParser.d.ts +3 -0
  118. package/dist/tools/local_view_structure/structureResponse.d.ts +32 -0
  119. package/dist/tools/local_view_structure/structureWalker.d.ts +24 -0
  120. package/dist/tools/lsp/semantic_content/execution.d.ts +4 -0
  121. package/dist/tools/lsp/semantic_content/hints.d.ts +4 -0
  122. package/dist/tools/lsp/semantic_content/index.d.ts +2 -0
  123. package/dist/tools/lsp/semantic_content/scheme.d.ts +509 -0
  124. package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +11 -0
  125. package/dist/tools/lsp/shared/resolveSymbolAnchor.d.ts +20 -0
  126. package/dist/tools/lsp/shared/semanticTypes.d.ts +134 -0
  127. package/dist/tools/package_search/execution.d.ts +7 -0
  128. package/dist/tools/package_search/hints.d.ts +2 -0
  129. package/dist/tools/package_search/scheme.d.ts +51 -0
  130. package/dist/tools/providerExecution.d.ts +51 -0
  131. package/dist/tools/providerMappers.d.ts +277 -0
  132. package/dist/tools/toolConfig.d.ts +41 -0
  133. package/dist/tools/toolMetadata/baseSchema.d.ts +2 -0
  134. package/dist/tools/toolMetadata/descriptions.d.ts +1 -0
  135. package/dist/tools/toolMetadata/gateway.d.ts +7 -0
  136. package/dist/tools/toolMetadata/metadataPresence.d.ts +1 -0
  137. package/dist/tools/toolMetadata/names.d.ts +2 -0
  138. package/dist/tools/toolMetadata/proxies.d.ts +10 -0
  139. package/dist/tools/toolMetadata/state.d.ts +5 -0
  140. package/dist/tools/toolMetadata/types.d.ts +2 -0
  141. package/dist/tools/toolNames.d.ts +2 -0
  142. package/dist/tools/utils.d.ts +27 -0
  143. package/dist/types/bulk.d.ts +41 -0
  144. package/dist/types/execution.d.ts +11 -0
  145. package/dist/types/metadata.d.ts +69 -0
  146. package/dist/types/promise.d.ts +12 -0
  147. package/dist/types/responseTypes.d.ts +57 -0
  148. package/dist/types/server.d.ts +15 -0
  149. package/dist/types/session.d.ts +29 -0
  150. package/dist/types/toolResults.d.ts +62 -0
  151. package/dist/utils/contextUtils.d.ts +31 -0
  152. package/dist/utils/core/bestEffort.d.ts +2 -0
  153. package/dist/utils/core/compare.d.ts +1 -0
  154. package/dist/utils/core/constants.d.ts +47 -0
  155. package/dist/utils/core/promise.d.ts +2 -0
  156. package/dist/utils/core/safeRegex.d.ts +5 -0
  157. package/dist/utils/core/types.d.ts +50 -0
  158. package/dist/utils/environment/environmentDetection.d.ts +5 -0
  159. package/dist/utils/exec/commandAvailability.d.ts +19 -0
  160. package/dist/utils/exec/npm.d.ts +16 -0
  161. package/dist/utils/exec/ripgrepBinary.d.ts +3 -0
  162. package/dist/utils/exec/safe.d.ts +2 -0
  163. package/dist/utils/exec/spawn.d.ts +34 -0
  164. package/dist/utils/file/byteOffset.d.ts +12 -0
  165. package/dist/utils/file/filters.d.ts +11 -0
  166. package/dist/utils/file/size.d.ts +2 -0
  167. package/dist/utils/file/toolHelpers.d.ts +28 -0
  168. package/dist/utils/http/cache.d.ts +16 -0
  169. package/dist/utils/http/circuitBreaker.d.ts +17 -0
  170. package/dist/utils/http/fetch.d.ts +13 -0
  171. package/dist/utils/package/common.d.ts +5 -0
  172. package/dist/utils/package/npm.d.ts +8 -0
  173. package/dist/utils/package/schemas.d.ts +60 -0
  174. package/dist/utils/package/types.d.ts +55 -0
  175. package/dist/utils/pagination/boundary.d.ts +11 -0
  176. package/dist/utils/pagination/charLimit.d.ts +3 -0
  177. package/dist/utils/pagination/core.d.ts +15 -0
  178. package/dist/utils/pagination/hints.d.ts +3 -0
  179. package/dist/utils/pagination/outputSizeLimit.d.ts +16 -0
  180. package/dist/utils/pagination/types.d.ts +43 -0
  181. package/dist/utils/parsers/diff.d.ts +2 -0
  182. package/dist/utils/parsers/ripgrep.d.ts +11 -0
  183. package/dist/utils/parsers/schemas.d.ts +72 -0
  184. package/dist/utils/response/bulk.d.ts +5 -0
  185. package/dist/utils/response/callToolResult.d.ts +3 -0
  186. package/dist/utils/response/charSavings.d.ts +3 -0
  187. package/dist/utils/response/error.d.ts +20 -0
  188. package/dist/utils/response/groupedFinalizer.d.ts +37 -0
  189. package/dist/utils/response/pathRelativize.d.ts +9 -0
  190. package/dist/utils/response/structuredPagination.d.ts +9 -0
  191. package/dist/zod.d.ts +1 -0
  192. package/dist/zod.js +8 -0
  193. package/package.json +66 -0
@@ -0,0 +1,21 @@
1
+ import type { CloneCacheMeta, CacheSource } from './types.js';
2
+ export declare function getReposBaseDir(octocodeDir: string): string;
3
+ export declare function getCloneDir(octocodeDir: string, owner: string, repo: string, branch: string, sparsePath?: string): string;
4
+ export declare function readCacheMeta(cloneDir: string): CloneCacheMeta | null;
5
+ export declare function writeCacheMeta(cloneDir: string, meta: CloneCacheMeta): void;
6
+ export declare function isCacheValid(meta: CloneCacheMeta): boolean;
7
+ export declare function isCacheHit(cloneDir: string): {
8
+ hit: true;
9
+ meta: CloneCacheMeta;
10
+ } | {
11
+ hit: false;
12
+ };
13
+ export declare function getCacheTTL(): number;
14
+ export declare function getMaxCacheSizeBytes(): number;
15
+ export declare function getMaxCloneCount(): number;
16
+ export declare function createCacheMeta(owner: string, repo: string, branch: string, source: CacheSource, sparsePath?: string, sizeBytes?: number): CloneCacheMeta;
17
+ export declare function ensureCloneParentDir(cloneDir: string): void;
18
+ export declare function removeCloneDir(cloneDir: string): void;
19
+ export declare function evictExpiredClones(octocodeDir: string): number;
20
+ export declare function startCacheGC(octocodeDir: string): void;
21
+ export declare function stopCacheGC(): void;
@@ -0,0 +1,6 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
+ import type { WithOptionalMeta } from '../../types/execution.js';
3
+ import type { CloneRepoQueryLocalSchema } from './scheme.js';
4
+ import type { z } from 'zod';
5
+ import type { CloneRepoResult } from './types.js';
6
+ export declare function cloneRepo(query: WithOptionalMeta<z.infer<typeof CloneRepoQueryLocalSchema>>, authInfo?: AuthInfo, token?: string): Promise<CloneRepoResult>;
@@ -0,0 +1,8 @@
1
+ import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { ToolExecutionArgs, WithOptionalMeta } from '../../types/execution.js';
3
+ type PartialCloneRepoQuery = WithOptionalMeta<CloneRepoQuery>;
4
+ import type { CloneRepoQueryLocalSchema } from './scheme.js';
5
+ import type { z } from 'zod';
6
+ type CloneRepoQuery = z.infer<typeof CloneRepoQueryLocalSchema>;
7
+ export declare function executeCloneRepo(args: ToolExecutionArgs<PartialCloneRepoQuery>): Promise<CallToolResult>;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ToolHintGenerators } from '../../types/metadata.js';
2
+ export declare const hints: ToolHintGenerators;
@@ -0,0 +1,50 @@
1
+ export declare const CloneRepoQueryLocalSchema: import("zod").ZodObject<{
2
+ owner: import("zod").ZodString;
3
+ repo: import("zod").ZodString;
4
+ branch: import("zod").ZodOptional<import("zod").ZodString>;
5
+ sparsePath: import("zod").ZodOptional<import("zod").ZodString>;
6
+ forceRefresh: import("zod").ZodOptional<import("zod").ZodBoolean>;
7
+ id: import("zod").ZodOptional<import("zod").ZodString>;
8
+ mainResearchGoal: import("zod").ZodOptional<import("zod").ZodString>;
9
+ researchGoal: import("zod").ZodOptional<import("zod").ZodString>;
10
+ reasoning: import("zod").ZodOptional<import("zod").ZodString>;
11
+ }, import("zod/v4/core").$strip>;
12
+ export declare const BulkCloneRepoLocalSchema: import("zod").ZodObject<{
13
+ responseCharOffset: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodTransform<unknown, unknown>, import("zod").ZodNumber>>;
14
+ responseCharLength: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodTransform<unknown, unknown>, import("zod").ZodNumber>>;
15
+ queries: import("zod").ZodArray<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>;
16
+ }, import("zod/v4/core").$strip>;
17
+ export declare const GitHubCloneRepoOutputLocalSchema: import("zod").ZodObject<{
18
+ status: import("zod").ZodOptional<import("zod").ZodEnum<{
19
+ empty: import("@octocodeai/octocode-core/types").ToolStatus.Empty;
20
+ error: import("@octocodeai/octocode-core/types").ToolStatus.Error;
21
+ }>>;
22
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
23
+ localPath: import("zod").ZodString;
24
+ branch: import("zod").ZodString;
25
+ cached: import("zod").ZodBoolean;
26
+ sparsePath: import("zod").ZodOptional<import("zod").ZodString>;
27
+ cloneTimeMs: import("zod").ZodOptional<import("zod").ZodNumber>;
28
+ totalSize: import("zod").ZodOptional<import("zod").ZodNumber>;
29
+ fileCount: import("zod").ZodOptional<import("zod").ZodNumber>;
30
+ }, import("zod/v4/core").$strip>>;
31
+ localPath: import("zod").ZodOptional<import("zod").ZodString>;
32
+ branch: import("zod").ZodOptional<import("zod").ZodString>;
33
+ cached: import("zod").ZodOptional<import("zod").ZodBoolean>;
34
+ warnings: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
35
+ kind: import("zod").ZodString;
36
+ }, import("zod/v4/core").$loose>]>>>;
37
+ error: import("zod").ZodOptional<import("zod").ZodString>;
38
+ readonly hints: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
39
+ readonly base: import("zod").ZodOptional<import("zod").ZodString>;
40
+ readonly shared: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>>;
41
+ readonly responsePagination: import("zod").ZodOptional<import("zod").ZodObject<{
42
+ currentPage: import("zod").ZodNumber;
43
+ totalPages: import("zod").ZodNumber;
44
+ hasMore: import("zod").ZodBoolean;
45
+ charOffset: import("zod").ZodNumber;
46
+ charLength: import("zod").ZodNumber;
47
+ totalChars: import("zod").ZodNumber;
48
+ nextCharOffset: import("zod").ZodOptional<import("zod").ZodNumber>;
49
+ }, import("zod/v4/core").$strip>>;
50
+ }, import("zod/v4/core").$loose>;
@@ -0,0 +1,19 @@
1
+ export type CacheSource = 'clone' | 'directoryFetch';
2
+ export interface CloneCacheMeta {
3
+ clonedAt: string;
4
+ expiresAt: string;
5
+ owner: string;
6
+ repo: string;
7
+ branch: string;
8
+ sparsePath?: string;
9
+ source: CacheSource;
10
+ sizeBytes?: number;
11
+ }
12
+ export interface CloneRepoResult {
13
+ localPath: string;
14
+ cached: boolean;
15
+ owner: string;
16
+ repo: string;
17
+ branch: string;
18
+ sparsePath?: string;
19
+ }
@@ -0,0 +1,7 @@
1
+ import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { z } from 'zod';
3
+ import type { ToolExecutionArgs } from '../../types/execution.js';
4
+ import { FileContentQueryLocalSchema } from './scheme.js';
5
+ type FileContentInputQuery = z.input<typeof FileContentQueryLocalSchema>;
6
+ export declare function fetchMultipleGitHubFileContents(args: ToolExecutionArgs<FileContentInputQuery>): Promise<CallToolResult>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { z } from 'zod';
2
+ import type { FileContentQuerySchema } from '@octocodeai/octocode-core/schemas';
3
+ type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
4
+ import type { BulkFinalizer } from '../../types/bulk.js';
5
+ import { type QueryWithPagination } from '../../utils/response/groupedFinalizer.js';
6
+ import type { GitHubFetchContentOutputLocal } from './scheme.js';
7
+ import type { WithOptionalMeta } from '../../types/execution.js';
8
+ type PartialFileContentQuery = WithOptionalMeta<FileContentQuery> & QueryWithPagination;
9
+ export declare function buildGithubFetchContentFinalizer<TQuery extends PartialFileContentQuery>(): BulkFinalizer<TQuery, GitHubFetchContentOutputLocal>;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ToolHintGenerators } from '../../types/metadata.js';
2
+ export declare const hints: ToolHintGenerators;
@@ -0,0 +1,120 @@
1
+ import { z } from 'zod';
2
+ export declare const FileContentQueryBaseLocalSchema: z.ZodObject<Readonly<{
3
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
4
+ }>, z.core.$strip>;
5
+ export declare const FileContentQueryLocalSchema: z.ZodObject<{
6
+ owner: z.ZodString;
7
+ repo: z.ZodString;
8
+ branch: z.ZodOptional<z.ZodString>;
9
+ path: z.ZodString;
10
+ startLine: z.ZodOptional<z.ZodNumber>;
11
+ endLine: z.ZodOptional<z.ZodNumber>;
12
+ fullContent: z.ZodOptional<z.ZodBoolean>;
13
+ matchString: z.ZodOptional<z.ZodString>;
14
+ matchStringIsRegex: z.ZodOptional<z.ZodBoolean>;
15
+ matchStringCaseSensitive: z.ZodOptional<z.ZodBoolean>;
16
+ forceRefresh: z.ZodOptional<z.ZodBoolean>;
17
+ type: z.ZodDefault<z.ZodEnum<{
18
+ file: "file";
19
+ directory: "directory";
20
+ }>>;
21
+ contextLines: z.ZodDefault<z.ZodNumber>;
22
+ charOffset: z.ZodOptional<z.ZodNumber>;
23
+ charLength: z.ZodOptional<z.ZodNumber>;
24
+ minify: z.ZodDefault<z.ZodEnum<{
25
+ none: "none";
26
+ standard: "standard";
27
+ symbols: "symbols";
28
+ }>>;
29
+ id: z.ZodOptional<z.ZodString>;
30
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
31
+ researchGoal: z.ZodOptional<z.ZodString>;
32
+ reasoning: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>;
34
+ export declare const FileContentBulkQueryLocalSchema: z.ZodObject<{
35
+ responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
36
+ responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
37
+ queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
38
+ }, z.core.$strip>;
39
+ export declare const GitHubFetchContentOutputLocalSchema: z.ZodObject<{
40
+ base: z.ZodOptional<z.ZodString>;
41
+ shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
42
+ responsePagination: z.ZodOptional<z.ZodObject<{
43
+ currentPage: z.ZodNumber;
44
+ totalPages: z.ZodNumber;
45
+ hasMore: z.ZodBoolean;
46
+ charOffset: z.ZodNumber;
47
+ charLength: z.ZodNumber;
48
+ totalChars: z.ZodNumber;
49
+ nextCharOffset: z.ZodOptional<z.ZodNumber>;
50
+ }, z.core.$strip>>;
51
+ results: z.ZodArray<z.ZodObject<{
52
+ id: z.ZodString;
53
+ owner: z.ZodString;
54
+ repo: z.ZodString;
55
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
56
+ path: z.ZodString;
57
+ content: z.ZodString;
58
+ contentView: z.ZodOptional<z.ZodEnum<{
59
+ none: "none";
60
+ standard: "standard";
61
+ symbols: "symbols";
62
+ }>>;
63
+ isSkeleton: z.ZodOptional<z.ZodBoolean>;
64
+ totalLines: z.ZodOptional<z.ZodNumber>;
65
+ sourceChars: z.ZodOptional<z.ZodNumber>;
66
+ sourceBytes: z.ZodOptional<z.ZodNumber>;
67
+ resolvedBranch: z.ZodOptional<z.ZodString>;
68
+ pagination: z.ZodOptional<z.ZodObject<{
69
+ currentPage: z.ZodNumber;
70
+ totalPages: z.ZodNumber;
71
+ hasMore: z.ZodBoolean;
72
+ charOffset: z.ZodOptional<z.ZodNumber>;
73
+ charLength: z.ZodOptional<z.ZodNumber>;
74
+ totalChars: z.ZodOptional<z.ZodNumber>;
75
+ nextCharOffset: z.ZodOptional<z.ZodNumber>;
76
+ filesPerPage: z.ZodOptional<z.ZodNumber>;
77
+ totalFiles: z.ZodOptional<z.ZodNumber>;
78
+ entriesPerPage: z.ZodOptional<z.ZodNumber>;
79
+ totalEntries: z.ZodOptional<z.ZodNumber>;
80
+ matchesPerPage: z.ZodOptional<z.ZodNumber>;
81
+ totalMatches: z.ZodOptional<z.ZodNumber>;
82
+ }, z.core.$strip>>;
83
+ isPartial: z.ZodOptional<z.ZodBoolean>;
84
+ startLine: z.ZodOptional<z.ZodNumber>;
85
+ endLine: z.ZodOptional<z.ZodNumber>;
86
+ matchRanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
87
+ start: z.ZodNumber;
88
+ end: z.ZodNumber;
89
+ }, z.core.$strip>>>;
90
+ lastModified: z.ZodOptional<z.ZodString>;
91
+ lastModifiedBy: z.ZodOptional<z.ZodString>;
92
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
93
+ matchNotFound: z.ZodOptional<z.ZodBoolean>;
94
+ searchedFor: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>>>;
96
+ directories: z.ZodOptional<z.ZodArray<z.ZodObject<{
97
+ path: z.ZodString;
98
+ localPath: z.ZodString;
99
+ fileCount: z.ZodNumber;
100
+ totalSize: z.ZodNumber;
101
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
102
+ path: z.ZodString;
103
+ size: z.ZodNumber;
104
+ type: z.ZodString;
105
+ }, z.core.$strip>>>;
106
+ cached: z.ZodOptional<z.ZodBoolean>;
107
+ resolvedBranch: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strip>>>;
109
+ }, z.core.$strip>>;
110
+ hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
111
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
112
+ id: z.ZodString;
113
+ owner: z.ZodOptional<z.ZodString>;
114
+ repo: z.ZodOptional<z.ZodString>;
115
+ path: z.ZodOptional<z.ZodString>;
116
+ error: z.ZodString;
117
+ hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
+ }, z.core.$strip>>>;
119
+ }, z.core.$strip>;
120
+ export type GitHubFetchContentOutputLocal = z.infer<typeof GitHubFetchContentOutputLocalSchema>;
@@ -0,0 +1,66 @@
1
+ import type { z } from 'zod';
2
+ import type { FileContentQuerySchema } from '@octocodeai/octocode-core/schemas';
3
+ import type { MinifyMode } from '../../scheme/fields.js';
4
+ type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
5
+ import type { PaginationInfo } from '../../utils/core/types.js';
6
+ export type FileContentExecutionQuery = FileContentQuery & {
7
+ noTimestamp?: boolean;
8
+ minify: MinifyMode;
9
+ contextLines?: number;
10
+ matchStringIsRegex?: boolean;
11
+ matchStringCaseSensitive?: boolean;
12
+ charOffset?: number;
13
+ charLength?: number;
14
+ };
15
+ export interface GitHubFileContentApiData {
16
+ owner?: string;
17
+ repo?: string;
18
+ path?: string;
19
+ content?: string;
20
+ contentView?: 'none' | 'standard' | 'symbols';
21
+ isSkeleton?: boolean;
22
+ branch?: string;
23
+ resolvedBranch?: string;
24
+ startLine?: number;
25
+ endLine?: number;
26
+ isPartial?: boolean;
27
+ totalLines?: number;
28
+ sourceChars?: number;
29
+ sourceBytes?: number;
30
+ matchRanges?: Array<{
31
+ start: number;
32
+ end: number;
33
+ }>;
34
+ matchLocations?: string[];
35
+ warnings?: string[];
36
+ lastModified?: string;
37
+ lastModifiedBy?: string;
38
+ pagination?: PaginationInfo;
39
+ cached?: boolean;
40
+ matchNotFound?: boolean;
41
+ searchedFor?: string;
42
+ signaturesExtracted?: boolean;
43
+ }
44
+ interface GitHubFileContentApiResultBase {
45
+ error?: string;
46
+ hints?: string[];
47
+ }
48
+ export interface GitHubFileContentApiResult extends GitHubFileContentApiResultBase, GitHubFileContentApiData {
49
+ }
50
+ export interface DirectoryFetchResult {
51
+ localPath: string;
52
+ files: Array<{
53
+ path: string;
54
+ size: number;
55
+ type: string;
56
+ }>;
57
+ fileCount: number;
58
+ totalSize: number;
59
+ cached: boolean;
60
+ expiresAt: string;
61
+ owner: string;
62
+ repo: string;
63
+ branch: string;
64
+ directoryPath: string;
65
+ }
66
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type CallToolResult } from '@modelcontextprotocol/sdk/types.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 { ToolExecutionArgs, WithOptionalMeta } from '../../types/execution.js';
6
+ type PartialCodeSearchQuery = WithOptionalMeta<GitHubCodeSearchQuery>;
7
+ export declare function searchMultipleGitHubCode(args: ToolExecutionArgs<PartialCodeSearchQuery>): Promise<CallToolResult>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { BulkFinalizer } from '../../types/bulk.js';
2
+ import { type QueryWithPagination } from '../../utils/response/groupedFinalizer.js';
3
+ import type { GitHubCodeSearchOutputLocal } from './scheme.js';
4
+ import { type CodeSearchGroupedResult } from '../providerMappers.js';
5
+ export declare function applyExactMatchRanking(groups: readonly CodeSearchGroupedResult[], keywords: readonly string[]): CodeSearchGroupedResult[];
6
+ export declare function buildGhSearchCodeFinalizer<TQuery extends QueryWithPagination>(): BulkFinalizer<TQuery, GitHubCodeSearchOutputLocal>;
@@ -0,0 +1,2 @@
1
+ import type { ToolHintGenerators } from '../../types/metadata.js';
2
+ export declare const hints: ToolHintGenerators;
@@ -0,0 +1,88 @@
1
+ import { z } from 'zod';
2
+ export declare const GitHubCodeSearchQueryLocalSchema: z.ZodObject<{
3
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
4
+ owner: z.ZodOptional<z.ZodString>;
5
+ repo: z.ZodOptional<z.ZodString>;
6
+ extension: z.ZodOptional<z.ZodString>;
7
+ filename: z.ZodOptional<z.ZodString>;
8
+ path: z.ZodOptional<z.ZodString>;
9
+ language: z.ZodOptional<z.ZodString>;
10
+ match: z.ZodDefault<z.ZodEnum<{
11
+ file: "file";
12
+ path: "path";
13
+ }>>;
14
+ limit: z.ZodDefault<z.ZodNumber>;
15
+ page: z.ZodDefault<z.ZodNumber>;
16
+ concise: z.ZodOptional<z.ZodBoolean>;
17
+ id: z.ZodOptional<z.ZodString>;
18
+ mainResearchGoal: z.ZodOptional<z.ZodString>;
19
+ researchGoal: z.ZodOptional<z.ZodString>;
20
+ reasoning: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ export declare const GitHubCodeSearchBulkQueryLocalSchema: z.ZodObject<{
23
+ responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
24
+ responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
25
+ queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
26
+ }, z.core.$strip>;
27
+ export declare const GitHubCodeSearchOutputLocalSchema: z.ZodObject<{
28
+ base: z.ZodOptional<z.ZodString>;
29
+ shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
30
+ responsePagination: z.ZodOptional<z.ZodObject<{
31
+ currentPage: z.ZodNumber;
32
+ totalPages: z.ZodNumber;
33
+ hasMore: z.ZodBoolean;
34
+ charOffset: z.ZodNumber;
35
+ charLength: z.ZodNumber;
36
+ totalChars: z.ZodNumber;
37
+ nextCharOffset: z.ZodOptional<z.ZodNumber>;
38
+ }, z.core.$strip>>;
39
+ results: z.ZodArray<z.ZodObject<{
40
+ id: z.ZodString;
41
+ data: z.ZodObject<{
42
+ files: z.ZodArray<z.ZodObject<{
43
+ id: z.ZodString;
44
+ owner: z.ZodString;
45
+ repo: z.ZodString;
46
+ path: z.ZodString;
47
+ queryId: z.ZodOptional<z.ZodString>;
48
+ matches: z.ZodArray<z.ZodObject<{
49
+ value: z.ZodOptional<z.ZodString>;
50
+ pathOnly: z.ZodOptional<z.ZodBoolean>;
51
+ matchIndices: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
+ start: z.ZodNumber;
53
+ end: z.ZodNumber;
54
+ }, z.core.$strip>>>;
55
+ url: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>>;
58
+ pagination: z.ZodOptional<z.ZodObject<{
59
+ currentPage: z.ZodNumber;
60
+ totalPages: z.ZodNumber;
61
+ perPage: z.ZodNumber;
62
+ totalMatches: z.ZodNumber;
63
+ reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
64
+ reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
65
+ totalMatchesKind: z.ZodOptional<z.ZodEnum<{
66
+ exact: "exact";
67
+ reported: "reported";
68
+ lowerBound: "lowerBound";
69
+ }>>;
70
+ totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
71
+ hasMore: z.ZodBoolean;
72
+ uniqueFileCount: z.ZodOptional<z.ZodNumber>;
73
+ }, z.core.$strip>>;
74
+ }, z.core.$strip>;
75
+ }, z.core.$strip>>;
76
+ hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
+ emptyQueries: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
+ id: z.ZodString;
79
+ hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
80
+ nonExistentScope: z.ZodOptional<z.ZodLiteral<true>>;
81
+ }, z.core.$strip>>>;
82
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
83
+ id: z.ZodString;
84
+ error: z.ZodString;
85
+ hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ }, z.core.$strip>>>;
87
+ }, z.core.$strip>;
88
+ export type GitHubCodeSearchOutputLocal = z.infer<typeof GitHubCodeSearchOutputLocalSchema>;
@@ -0,0 +1,52 @@
1
+ export type PartialContentRange = {
2
+ file: string;
3
+ additions?: number[];
4
+ deletions?: number[];
5
+ };
6
+ export type PrContentSelector = {
7
+ body?: boolean;
8
+ changedFiles?: boolean;
9
+ patches?: {
10
+ mode?: 'none' | 'selected' | 'all';
11
+ files?: string[];
12
+ ranges?: PartialContentRange[];
13
+ };
14
+ comments?: {
15
+ discussion?: boolean;
16
+ reviewInline?: boolean;
17
+ includeBots?: boolean;
18
+ file?: string;
19
+ };
20
+ reviews?: boolean;
21
+ commits?: {
22
+ list?: boolean;
23
+ includeFiles?: boolean;
24
+ };
25
+ };
26
+ export type PullRequestContentQuery = {
27
+ content?: PrContentSelector;
28
+ reviewMode?: 'full';
29
+ };
30
+ export type NormalizedPrContentRequest = {
31
+ body: boolean;
32
+ changedFiles: boolean;
33
+ patches: {
34
+ mode: 'none' | 'selected' | 'all';
35
+ files?: string[];
36
+ ranges?: PartialContentRange[];
37
+ };
38
+ comments: false | {
39
+ discussion: boolean;
40
+ reviewInline: boolean;
41
+ includeBots: boolean;
42
+ file?: string;
43
+ };
44
+ reviews: boolean;
45
+ commits: false | {
46
+ list: boolean;
47
+ includeFiles: boolean;
48
+ };
49
+ reviewMode?: 'full';
50
+ };
51
+ export declare function normalizePullRequestContentRequest(query: PullRequestContentQuery): NormalizedPrContentRequest;
52
+ export declare function hasExpensiveContentRequest(request: NormalizedPrContentRequest): boolean;
@@ -0,0 +1,18 @@
1
+ import type { NormalizedPrContentRequest } from './contentRequest.js';
2
+ type QueryLike = {
3
+ owner?: string;
4
+ repo?: string;
5
+ prNumber?: number;
6
+ page?: number;
7
+ filePage?: number;
8
+ commentPage?: number;
9
+ commitPage?: number;
10
+ itemsPerPage?: number;
11
+ charOffset?: number;
12
+ commentBodyOffset?: number;
13
+ charLength?: number;
14
+ matchString?: string;
15
+ };
16
+ export declare function shapePullRequestForContent(pr: Record<string, unknown>, query: QueryLike, request: NormalizedPrContentRequest, shouldMinify?: boolean, showContentMap?: boolean): Record<string, unknown>;
17
+ export declare function buildContentHints(pullRequests: Array<Record<string, unknown>>, request: NormalizedPrContentRequest): string[];
18
+ export {};
@@ -0,0 +1,17 @@
1
+ import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { z } from 'zod';
3
+ import { GitHubPullRequestSearchQueryLocalSchema } from './scheme.js';
4
+ type GitHubPullRequestSearchQuery = z.infer<typeof GitHubPullRequestSearchQueryLocalSchema>;
5
+ import type { ToolExecutionArgs, WithOptionalMeta } from '../../types/execution.js';
6
+ type GitHubPullRequestSearchInput = z.input<typeof GitHubPullRequestSearchQueryLocalSchema>;
7
+ type PartialPRQuery = WithOptionalMeta<GitHubPullRequestSearchQuery>;
8
+ export declare function searchMultipleGitHubPullRequests(args: ToolExecutionArgs<GitHubPullRequestSearchInput>): Promise<CallToolResult>;
9
+ export declare function buildPRSearchOutput(input: {
10
+ data: Record<string, unknown>;
11
+ pullRequests: Array<Record<string, unknown>>;
12
+ extraHints: string[];
13
+ }, _query: PartialPRQuery): {
14
+ data: Record<string, unknown>;
15
+ extraHints: string[];
16
+ };
17
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ToolHintGenerators } from '../../types/metadata.js';
2
+ export declare const hints: ToolHintGenerators;