@octocodeai/octocode-tools-core 18.3.0 → 19.1.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 (242) hide show
  1. package/README.md +19 -19
  2. package/dist/chunks/direct/chunk-3AA4F3QO.js +10 -0
  3. package/dist/chunks/direct/chunk-43RVQWTG.js +8 -0
  4. package/dist/chunks/direct/chunk-7DYE654A.js +8 -0
  5. package/dist/chunks/direct/chunk-A4WMBDEC.js +8 -0
  6. package/dist/chunks/direct/chunk-AWZG43MA.js +8 -0
  7. package/dist/chunks/direct/chunk-BICVXQ5F.js +8 -0
  8. package/dist/chunks/direct/chunk-BMM5H6QF.js +11 -0
  9. package/dist/chunks/direct/chunk-C6HFNIDL.js +8 -0
  10. package/dist/chunks/direct/chunk-CBCZVCTZ.js +8 -0
  11. package/dist/chunks/direct/chunk-CBIKUVP6.js +11 -0
  12. package/dist/chunks/direct/chunk-CKB2ME2J.js +8 -0
  13. package/dist/chunks/direct/chunk-DBI23PBG.js +9 -0
  14. package/dist/chunks/direct/chunk-DBSQWRFS.js +9 -0
  15. package/dist/chunks/direct/chunk-DKGYPFGX.js +8 -0
  16. package/dist/chunks/direct/chunk-EOLHXX5I.js +8 -0
  17. package/dist/chunks/direct/chunk-IFPXDKUV.js +8 -0
  18. package/dist/chunks/direct/chunk-J3WYA3IJ.js +8 -0
  19. package/dist/chunks/direct/chunk-MCMOWPYL.js +8 -0
  20. package/dist/chunks/direct/chunk-MPTAIBY7.js +8 -0
  21. package/dist/chunks/direct/chunk-NQRDACK3.js +8 -0
  22. package/dist/chunks/direct/chunk-O5ETB2W5.js +8 -0
  23. package/dist/chunks/direct/chunk-OA6NU4KO.js +8 -0
  24. package/dist/chunks/direct/chunk-QKDE2HIF.js +10 -0
  25. package/dist/chunks/direct/chunk-RRSY2ZPX.js +13 -0
  26. package/dist/chunks/direct/chunk-UKQLRZEW.js +8 -0
  27. package/dist/chunks/direct/chunk-USZL65FN.js +8 -0
  28. package/dist/chunks/direct/chunk-WH6GL3J2.js +8 -0
  29. package/dist/chunks/direct/chunk-Y5OCKUQX.js +9 -0
  30. package/dist/chunks/direct/chunk-ZO44CZN5.js +8 -0
  31. package/dist/chunks/direct/chunk-ZSXRT7JL.js +12 -0
  32. package/dist/chunks/direct/chunk-ZUNPQVMO.js +8 -0
  33. package/dist/chunks/direct/execution-3T4B776P.js +9 -0
  34. package/dist/chunks/direct/execution-5BJNS7D7.js +8 -0
  35. package/dist/chunks/direct/execution-5O6QHKBR.js +8 -0
  36. package/dist/chunks/direct/execution-A4NK3BQO.js +8 -0
  37. package/dist/chunks/direct/execution-K4UOPXRQ.js +9 -0
  38. package/dist/chunks/direct/execution-SWWZOOA7.js +13 -0
  39. package/dist/chunks/direct/execution-X4MUJL4L.js +8 -0
  40. package/dist/chunks/direct/execution-XA6PXPRB.js +8 -0
  41. package/dist/chunks/direct/historyExecutions-6F3AA5PY.js +14 -0
  42. package/dist/direct.d.ts +6 -1
  43. package/dist/direct.js +2 -46
  44. package/dist/github/canonicalRepo.d.ts +2 -1
  45. package/dist/github/client.d.ts +3 -8
  46. package/dist/github/codeSearch/compactFragment.d.ts +7 -0
  47. package/dist/github/codeSearch.d.ts +2 -3
  48. package/dist/github/commit.d.ts +8 -0
  49. package/dist/github/commitDetail.d.ts +20 -0
  50. package/dist/github/commitSearch.d.ts +17 -0
  51. package/dist/github/compare.d.ts +15 -0
  52. package/dist/github/directoryFetch/cacheMetadata.d.ts +25 -0
  53. package/dist/github/directoryFetch/helpers.d.ts +1 -3
  54. package/dist/github/directoryFetch/snapshot.d.ts +10 -0
  55. package/dist/github/fileContentProcess.d.ts +0 -1
  56. package/dist/github/fileContentRaw/cache.d.ts +9 -0
  57. package/dist/github/fileContentRaw/fetch.d.ts +1 -1
  58. package/dist/github/githubAPI.d.ts +19 -2
  59. package/dist/github/history/commitFiles.d.ts +12 -0
  60. package/dist/github/issues/fetchers.d.ts +1 -1
  61. package/dist/github/issues/types.d.ts +3 -1
  62. package/dist/github/prContentFetcher/collectionPaging.d.ts +27 -0
  63. package/dist/github/prContentFetcher/comments.d.ts +7 -5
  64. package/dist/github/prContentFetcher/commits.d.ts +13 -14
  65. package/dist/github/prContentFetcher/flags.d.ts +0 -1
  66. package/dist/github/prContentFetcher/transform.d.ts +1 -1
  67. package/dist/github/prTransformation.d.ts +3 -1
  68. package/dist/github/queryBuilders/codeAndRepo.d.ts +2 -1
  69. package/dist/github/repoSearch.d.ts +2 -1
  70. package/dist/github/repoStructure/fetchOrchestration.d.ts +1 -1
  71. package/dist/github/repoStructurePagination.d.ts +1 -1
  72. package/dist/github/repoStructureTree.d.ts +4 -2
  73. package/dist/graph/advancedOperations.d.ts +2 -2
  74. package/dist/graph/buildFileGraph.d.ts +8 -13
  75. package/dist/graph/coverage.d.ts +6 -0
  76. package/dist/graph/diagnosticSnapshot.d.ts +10 -0
  77. package/dist/graph/fileImportLinker.d.ts +28 -0
  78. package/dist/graph/importResolver.d.ts +1 -1
  79. package/dist/graph/languageImportResolver.d.ts +5 -0
  80. package/dist/graph/metadataImports.d.ts +7 -0
  81. package/dist/graph/packageExportTargets.d.ts +11 -0
  82. package/dist/graph/rustCargoMetadata.d.ts +31 -0
  83. package/dist/graph/rustCargoProcess.d.ts +16 -0
  84. package/dist/graph/rustModules.d.ts +7 -0
  85. package/dist/graph/rustWorkspace.d.ts +5 -0
  86. package/dist/graph/types.d.ts +94 -3
  87. package/dist/graph/workspacePackageResolver.d.ts +7 -2
  88. package/dist/index.d.ts +46 -19
  89. package/dist/index.js +36 -45
  90. package/dist/providers/github/GitHubProvider.d.ts +3 -1
  91. package/dist/providers/github/githubContent.d.ts +3 -2
  92. package/dist/providers/github/githubPullRequests.d.ts +3 -2
  93. package/dist/providers/github/githubSearch.d.ts +6 -3
  94. package/dist/providers/github/githubStructure.d.ts +3 -2
  95. package/dist/providers/providerQueries.d.ts +4 -0
  96. package/dist/providers/providerResults.d.ts +29 -1
  97. package/dist/providers/types.d.ts +0 -2
  98. package/dist/schema.d.ts +9 -3
  99. package/dist/schema.js +4 -12
  100. package/dist/scheme/fields.d.ts +8 -8
  101. package/dist/scheme/pagination.d.ts +1 -0
  102. package/dist/serverConfig.d.ts +1 -1
  103. package/dist/shared/session/index.d.ts +1 -1
  104. package/dist/shared/session/index.js +1 -1
  105. package/dist/shared/session/storage.d.ts +0 -1
  106. package/dist/toolContract/descriptions.d.ts +6 -6
  107. package/dist/toolContract/input/resources/tools/ghSearch.d.ts +21 -20
  108. package/dist/toolContract/input/resources/tools/githubHistorySchema.d.ts +14 -6
  109. package/dist/toolContract/input/resources/tools/githubRepositoriesOperation.d.ts +3 -3
  110. package/dist/toolContract/input/resources/tools/githubTreeOperation.d.ts +4 -2
  111. package/dist/toolContract/input/resources/tools/historyCommitInput.d.ts +9 -0
  112. package/dist/toolContract/input/resources/tools/historyIssueInput.d.ts +4 -4
  113. package/dist/toolContract/input/resources/tools/historyPullRequestInput.d.ts +13 -5
  114. package/dist/toolContract/input/resources/tools/localAnalyzeGraph.d.ts +74 -32
  115. package/dist/toolContract/input/resources/tools/localFilesOperation.d.ts +1 -1
  116. package/dist/toolContract/input/resources/tools/localSearch.d.ts +43 -43
  117. package/dist/toolContract/input/resources/tools/localTextOperation.d.ts +1 -1
  118. package/dist/toolContract/input/resources/tools/localTreeOperation.d.ts +2 -2
  119. package/dist/toolContract/input/resources/tools/lspGetSemantics.d.ts +11 -2
  120. package/dist/toolContract/input/resources/tools/npmSearch.d.ts +2 -1
  121. package/dist/toolContract/metadata.d.ts +1 -1
  122. package/dist/toolContract/runtime.d.ts +1 -1
  123. package/dist/toolContract/types.d.ts +0 -1
  124. package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +2 -4
  125. package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +2 -5
  126. package/dist/tools/directToolCatalog.exec.d.ts +10 -7
  127. package/dist/tools/github_clone_repo/cache.d.ts +0 -2
  128. package/dist/tools/github_clone_repo/cacheArtifacts.d.ts +3 -1
  129. package/dist/tools/github_clone_repo/cachePaths.d.ts +3 -2
  130. package/dist/tools/github_clone_repo/gitCheckout.d.ts +5 -0
  131. package/dist/tools/github_clone_repo/scheme.d.ts +3 -3
  132. package/dist/tools/github_clone_repo/types.d.ts +6 -1
  133. package/dist/tools/github_fetch_content/finalizer/types.d.ts +10 -2
  134. package/dist/tools/github_fetch_content/scheme.d.ts +3 -4
  135. package/dist/tools/github_fetch_content/types.d.ts +4 -3
  136. package/dist/tools/github_search/scheme.d.ts +24 -23
  137. package/dist/tools/github_search_code/execution.d.ts +1 -1
  138. package/dist/tools/github_search_code/finalizer/groups.d.ts +1 -1
  139. package/dist/tools/github_search_code/finalizer/ranking.d.ts +1 -1
  140. package/dist/tools/github_search_code/scheme.d.ts +3 -3
  141. package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +4 -1
  142. package/dist/tools/github_search_pull_requests/contentResponse/contentView.d.ts +3 -0
  143. package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +30 -2
  144. package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +1 -7
  145. package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +14 -2
  146. package/dist/tools/github_search_pull_requests/historyContinuations.d.ts +1 -1
  147. package/dist/tools/github_search_pull_requests/historyDiffContinuations.d.ts +2 -0
  148. package/dist/tools/github_search_pull_requests/historySchemes.d.ts +23 -22
  149. package/dist/tools/github_search_pull_requests/scheme.d.ts +17 -9
  150. package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +35 -26
  151. package/dist/tools/github_search_pull_requests/types.d.ts +5 -0
  152. package/dist/tools/github_search_repos/execution/pagination.d.ts +0 -17
  153. package/dist/tools/github_search_repos/execution/queryVariants.d.ts +1 -23
  154. package/dist/tools/github_search_repos/execution.d.ts +0 -1
  155. package/dist/tools/github_search_repos/scheme.d.ts +6 -6
  156. package/dist/tools/github_view_repo_structure/execution.d.ts +1 -1
  157. package/dist/tools/github_view_repo_structure/scheme.d.ts +6 -5
  158. package/dist/tools/local_analyze_graph/analysisTypes.d.ts +16 -3
  159. package/dist/tools/local_analyze_graph/analyzeGraph.d.ts +1 -1
  160. package/dist/tools/local_analyze_graph/completeness.d.ts +3 -0
  161. package/dist/tools/local_analyze_graph/deadCodeScan.d.ts +9 -5
  162. package/dist/tools/local_analyze_graph/rootInference.d.ts +2 -0
  163. package/dist/tools/local_analyze_graph/scheme.d.ts +13 -25
  164. package/dist/tools/local_fetch_content/fetchContent/pagination.d.ts +7 -0
  165. package/dist/tools/local_fetch_content/scheme.d.ts +3 -3
  166. package/dist/tools/local_find_files/findFiles.d.ts +1 -1
  167. package/dist/tools/local_find_files/scheme.d.ts +4 -4
  168. package/dist/tools/local_ripgrep/execution.d.ts +0 -1
  169. package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +1 -2
  170. package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +2 -2
  171. package/dist/tools/local_ripgrep/rankingProfile/rankingScoring.d.ts +1 -3
  172. package/dist/tools/local_ripgrep/ripgrepResultBuilder/buildResult.d.ts +0 -4
  173. package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +1 -0
  174. package/dist/tools/local_ripgrep/scheme.d.ts +13 -5
  175. package/dist/tools/local_ripgrep/structuralCompleteness.d.ts +9 -0
  176. package/dist/tools/local_search/execution.d.ts +0 -1
  177. package/dist/tools/local_search/scheme.d.ts +46 -46
  178. package/dist/tools/local_view_structure/scheme.d.ts +5 -5
  179. package/dist/tools/lsp/semantic_content/scheme.d.ts +29 -7
  180. package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +2 -9
  181. package/dist/tools/lsp/semantic_content/semanticEnvelopes/callEnvelopes.d.ts +2 -2
  182. package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +2 -1
  183. package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +2 -3
  184. package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +0 -1
  185. package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +1 -0
  186. package/dist/tools/lsp/semantic_content/semanticSnapshot.d.ts +16 -0
  187. package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +2 -1
  188. package/dist/tools/lsp/shared/semanticTypes.d.ts +19 -10
  189. package/dist/tools/package_search/execution.d.ts +3 -4
  190. package/dist/tools/package_search/pagination.d.ts +1 -0
  191. package/dist/tools/package_search/scheme.d.ts +5 -4
  192. package/dist/tools/providerMappers/codeSearch.d.ts +2 -9
  193. package/dist/tools/providerMappers/fileContent.d.ts +1 -1
  194. package/dist/tools/providerMappers/pullRequests.d.ts +24 -4
  195. package/dist/tools/providerMappers/repoSearch.d.ts +4 -4
  196. package/dist/tools/providerMappers/repoStructure.d.ts +4 -3
  197. package/dist/tools/toolAvailability.d.ts +19 -0
  198. package/dist/tools/toolConfig.d.ts +1 -3
  199. package/dist/types/toolResults.d.ts +1 -0
  200. package/dist/utils/contextUtils.d.ts +1 -1
  201. package/dist/utils/core/types.d.ts +0 -2
  202. package/dist/utils/exec/npm.d.ts +2 -0
  203. package/dist/utils/file/byteOffset.d.ts +1 -1
  204. package/dist/utils/package/common.d.ts +0 -3
  205. package/dist/utils/package/npm/npmDeprecation.d.ts +1 -2
  206. package/dist/utils/package/npm/npmDetailsFetchers.d.ts +3 -15
  207. package/dist/utils/package/npm/npmMappers.d.ts +0 -4
  208. package/dist/utils/package/npm/npmRegistry.d.ts +9 -1
  209. package/dist/utils/package/npm/npmSearchStrategies.d.ts +2 -5
  210. package/dist/utils/package/types.d.ts +3 -0
  211. package/dist/utils/pagination/types.d.ts +1 -0
  212. package/dist/utils/response/callToolResult.d.ts +3 -1
  213. package/package.json +19 -15
  214. package/dist/errors/pathUtils.d.ts +0 -1
  215. package/dist/github/directoryFetch.d.ts +0 -3
  216. package/dist/github/fileContentRaw.d.ts +0 -2
  217. package/dist/github/issues.d.ts +0 -3
  218. package/dist/github/prContentFetcher.d.ts +0 -2
  219. package/dist/github/queryBuilders.d.ts +0 -4
  220. package/dist/github/repoStructure.d.ts +0 -1
  221. package/dist/shared/index.d.ts +0 -6
  222. package/dist/shared/languageSelectors.d.ts +0 -3
  223. package/dist/toolContract/schemas.d.ts +0 -31
  224. package/dist/tools/directToolCatalog.d.ts +0 -15
  225. package/dist/tools/directToolCatalog.meta.d.ts +0 -28
  226. package/dist/tools/github_search_code/finalizer.d.ts +0 -2
  227. package/dist/tools/github_search_repos/execution/ranking.d.ts +0 -4
  228. package/dist/tools/local_ripgrep/rankingProfile.d.ts +0 -35
  229. package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +0 -2
  230. package/dist/tools/lsp/semantic_content/index.d.ts +0 -3
  231. package/dist/tools/lsp/semantic_content/semanticEnvelopes.d.ts +0 -3
  232. package/dist/tools/lsp/semantic_content/semanticFileOps.d.ts +0 -8
  233. package/dist/tools/providerMappers.d.ts +0 -11
  234. package/dist/tools/toolMetadata/baseSchema.d.ts +0 -1
  235. package/dist/tools/toolMetadata/descriptions.d.ts +0 -1
  236. package/dist/tools/toolMetadata/proxies.d.ts +0 -4
  237. package/dist/tools/toolSchemaImports.d.ts +0 -16
  238. package/dist/utils/exec/spawn.d.ts +0 -2
  239. package/dist/utils/file/filters.d.ts +0 -2
  240. package/dist/utils/http/cache.d.ts +0 -5
  241. package/dist/utils/package/npm.d.ts +0 -2
  242. package/dist/utils/response/bulk.d.ts +0 -2
@@ -1,3 +1,4 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/server';
1
2
  import { OctokitWithThrottling } from './client.js';
2
3
  /**
3
4
  * Resolve an owner/repo to its canonical name, following GitHub repository
@@ -7,7 +8,7 @@ import { OctokitWithThrottling } from './client.js';
7
8
  * is authoritative. Returns the original pair on any failure (network, 404,
8
9
  * private) so callers degrade gracefully rather than blocking the search.
9
10
  */
10
- export declare function resolveCanonicalOwnerRepo(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string): Promise<{
11
+ export declare function resolveCanonicalOwnerRepo(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, authInfo?: AuthInfo): Promise<{
11
12
  owner: string;
12
13
  repo: string;
13
14
  renamed: boolean;
@@ -1,17 +1,12 @@
1
+ import { Octokit } from 'octokit';
1
2
  import type { AuthInfo } from '@modelcontextprotocol/server';
2
3
  export declare function hashGitHubToken(token: string): string;
3
4
  /**
4
5
  * Auth segment for GitHub API cache keys. Distinct tokens (and Enterprise
5
- * hosts) must not share cache entries. Never puts the raw token in the key.
6
+ * endpoints) must not share cache entries. Never puts the raw token in the key.
6
7
  */
7
8
  export declare function resolveCacheAuthFingerprint(authInfo?: AuthInfo): Promise<string>;
8
- export declare const OctokitWithThrottling: typeof import("@octokit/core").Octokit & import("@octokit/core/types").Constructor<{
9
- paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
10
- } & import("@octokit/plugin-paginate-graphql").paginateGraphQLInterface & import("@octokit/plugin-rest-endpoint-methods").Api & {
11
- retry: {
12
- retryRequest: (error: import("octokit").RequestError, retries: number, retryAfter: number) => import("octokit").RequestError;
13
- };
14
- }> & import("@octokit/core/types").Constructor<{}>;
9
+ export declare const OctokitWithThrottling: typeof Octokit;
15
10
  export declare function getOctokit(authInfo?: AuthInfo): Promise<InstanceType<typeof OctokitWithThrottling>>;
16
11
  export declare const MAX_BRANCH_CACHE_SIZE = 200;
17
12
  export declare function resolveDefaultBranch(owner: string, repo: string, authInfo?: AuthInfo): Promise<string>;
@@ -0,0 +1,7 @@
1
+ /** Compact discovery context only when every match surviving redaction remains. */
2
+ export declare function compactMatchedFragment(raw: string, sanitized: string, rawPositions: [number, number][], path: string): Promise<{
3
+ context: string;
4
+ positions: [number, number][];
5
+ minificationType?: string;
6
+ failed?: boolean;
7
+ }>;
@@ -1,9 +1,8 @@
1
1
  import type { GitHubAPIResponse, OptimizedCodeSearchResult } from './githubAPI.js';
2
2
  import type { z } from 'zod';
3
- import type { GitHubCodeSearchQuerySchema } from '../toolContract/schemas.js';
3
+ import type { GitHubCodeSearchQuerySchema } from '../toolContract/input/resources/tools/githubCodeOperation.js';
4
4
  type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
5
5
  import type { WithOptionalMeta } from '../types/execution.js';
6
6
  import { AuthInfo } from '@modelcontextprotocol/server';
7
- import { recomputeMatchPositions } from './codeSearch/matchPositions.js';
8
- export { recomputeMatchPositions };
9
7
  export declare function searchGitHubCodeAPI(params: WithOptionalMeta<GitHubCodeSearchQuery>, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<OptimizedCodeSearchResult>>;
8
+ export {};
@@ -24,6 +24,13 @@ export interface ExactCommitResult {
24
24
  additions?: number;
25
25
  deletions?: number;
26
26
  changedFiles: number;
27
+ isPartial?: boolean;
28
+ terminalLimit?: boolean;
29
+ partialReasons?: string[];
30
+ providerLimit?: {
31
+ reason: string;
32
+ maxFiles: number;
33
+ };
27
34
  files?: HistoryCommitFile[];
28
35
  filesPagination?: {
29
36
  currentPage: number;
@@ -42,6 +49,7 @@ export declare function fetchCommit(params: {
42
49
  includeDiff?: boolean;
43
50
  path?: string;
44
51
  filePage?: number;
52
+ fileBatch?: number;
45
53
  itemsPerPage?: number;
46
54
  charOffset?: number;
47
55
  charLength?: number;
@@ -0,0 +1,20 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/server';
2
+ import { getOctokit } from './client.js';
3
+ export declare const COMMIT_FILE_LIMIT = 3000;
4
+ type CommitData = Awaited<ReturnType<Awaited<ReturnType<typeof getOctokit>>['rest']['repos']['getCommit']>>['data'];
5
+ /** Fetch one auth-scoped provider batch; callers expose independent file and batch continuations. */
6
+ export declare function fetchCommitDetail(params: {
7
+ owner: string;
8
+ repo: string;
9
+ ref: string;
10
+ fileBatch?: number;
11
+ }, authInfo?: AuthInfo): Promise<{
12
+ data: CommitData;
13
+ collectionState: {
14
+ page: number;
15
+ hasMore: boolean;
16
+ };
17
+ terminalLimit: boolean;
18
+ rawResponseChars: number;
19
+ }>;
20
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/server';
2
+ import type { GitHubAPIResponse } from './githubAPI.js';
3
+ interface CommitSearchParams {
4
+ owner: string;
5
+ repo: string;
6
+ keywords: string[];
7
+ author?: string;
8
+ committer?: string;
9
+ since?: string;
10
+ until?: string;
11
+ page: number;
12
+ perPage: number;
13
+ }
14
+ export declare function searchCommits(params: CommitSearchParams, authInfo?: AuthInfo): Promise<GitHubAPIResponse<Record<string, unknown> & {
15
+ commits: Array<Record<string, unknown>>;
16
+ }>>;
17
+ export {};
@@ -11,6 +11,20 @@ export type CompareResult = {
11
11
  aheadBy: number;
12
12
  behindBy: number;
13
13
  totalCommits: number;
14
+ pagination?: {
15
+ currentPage: number;
16
+ perPage: number;
17
+ hasMore: boolean;
18
+ nextPage?: number;
19
+ };
20
+ isPartial?: boolean;
21
+ terminalLimit?: boolean;
22
+ partialReasons?: string[];
23
+ providerLimit?: {
24
+ reason: string;
25
+ maxFiles?: number;
26
+ maxPage?: number;
27
+ };
14
28
  commits: Array<{
15
29
  sha: string;
16
30
  messageHeadline: string;
@@ -42,6 +56,7 @@ export declare function compareRefs(params: {
42
56
  base: string;
43
57
  head: string;
44
58
  includeDiff?: boolean;
59
+ page?: number;
45
60
  /** Restrict the diff to a single file path (searchable scope). */
46
61
  path?: string;
47
62
  filePage?: number;
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export declare const DIRECTORY_META_FILE = ".octocode-directory-meta.json";
3
+ declare const directoryCacheSchema: z.ZodObject<{
4
+ commitSha: z.ZodString;
5
+ complete: z.ZodBoolean;
6
+ directoryEntryCount: z.ZodNumber;
7
+ eligibleFileCount: z.ZodNumber;
8
+ skipped: z.ZodObject<{
9
+ nonFile: z.ZodNumber;
10
+ oversized: z.ZodNumber;
11
+ binary: z.ZodNumber;
12
+ fileLimit: z.ZodNumber;
13
+ fetchFailed: z.ZodNumber;
14
+ totalSizeLimit: z.ZodNumber;
15
+ pathTraversal: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ files: z.ZodArray<z.ZodObject<{
18
+ path: z.ZodString;
19
+ size: z.ZodNumber;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strip>;
22
+ type DirectoryCacheMetadata = z.infer<typeof directoryCacheSchema>;
23
+ export declare function readDirectoryCacheMetadata(dirPath: string, commitSha: string): DirectoryCacheMetadata | undefined;
24
+ export declare function writeDirectoryCacheMetadata(dirPath: string, metadata: DirectoryCacheMetadata): void;
25
+ export {};
@@ -4,7 +4,6 @@ export declare const MAX_DIRECTORY_FILES = 50;
4
4
  export declare const MAX_TOTAL_SIZE: number;
5
5
  export declare const MAX_FILE_SIZE: number;
6
6
  export declare const CONCURRENCY = 5;
7
- export declare const FETCH_TIMEOUT_MS = 10000;
8
7
  export declare const BINARY_EXTENSIONS: Set<string>;
9
8
  export interface DirectoryEntry {
10
9
  name: string;
@@ -22,11 +21,10 @@ export declare const DIRECTORY_FETCH_LIMITS: {
22
21
  export declare function emptyDirectorySkipCounts(): DirectorySkipCounts;
23
22
  export declare function directoryFetchComplete(skipped: DirectorySkipCounts): boolean;
24
23
  export declare function directoryFetchWarnings(complete: boolean, verified: boolean): string[] | undefined;
25
- export declare function fetchFilesInBatches(entries: DirectoryEntry[], concurrency: number, token?: string): Promise<Array<{
24
+ export declare function fetchFilesInBatches(entries: DirectoryEntry[], concurrency: number, fetchContent: (entry: DirectoryEntry) => Promise<string>): Promise<Array<{
26
25
  entry: DirectoryEntry;
27
26
  content: string;
28
27
  }>>;
29
- export declare function fetchDownloadUrl(url: string, token?: string): Promise<string>;
30
28
  export declare function scanDirectoryStats(dirPath: string, repoRoot: string): {
31
29
  files: GitHubDirectoryFileEntry[];
32
30
  fileCount: number;
@@ -0,0 +1,10 @@
1
+ import type { CloneCacheMeta } from '../../tools/github_clone_repo/types.js';
2
+ /** Serializes overlapping file/directory updates across CLI and MCP processes. */
3
+ export declare function withTreeLock<T>(home: string, cacheRoot: string, run: () => Promise<T>): Promise<T>;
4
+ export declare function ensureSnapshotDirectory(root: string, relativePath: string): string;
5
+ export declare function currentTreeSnapshot(cacheRoot: string): string | undefined;
6
+ /** Publish a fully written immutable generation by atomically replacing its metadata pointer.
7
+ * Existing callers retain their generation; a failed update cannot remove their files.
8
+ * Call under withTreeLock. Whole-cache TTL/capacity eviction owns old generations.
9
+ */
10
+ export declare function publishTreeSnapshot(home: string, cacheRoot: string, previousRoot: string | undefined, meta: CloneCacheMeta, write: (root: string) => void): string;
@@ -1,4 +1,3 @@
1
1
  import type { GitHubFileContentApiResult } from '../tools/github_fetch_content/types.js';
2
2
  import type { MinifyMode } from '../scheme/fields.js';
3
- export { applyContentPagination, fetchFileTimestamp, } from './fileContentPagination.js';
4
3
  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>;
@@ -0,0 +1,9 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/server';
2
+ import type { FileContentExecutionQuery } from '../../tools/github_fetch_content/types.js';
3
+ import type { GitHubAPIResponse } from '../githubAPI.js';
4
+ import { type RawContentResult } from './fetch.js';
5
+ /** Share one authenticated, ref-scoped raw response between reads and materialization. */
6
+ export declare function fetchCachedRawGitHubFileContent(params: FileContentExecutionQuery, authInfo?: AuthInfo, sessionId?: string): Promise<{
7
+ rawResult: GitHubAPIResponse<RawContentResult>;
8
+ auth: string;
9
+ }>;
@@ -1,6 +1,6 @@
1
1
  import type { GitHubAPIResponse } from '../githubAPI.js';
2
2
  import type { z } from 'zod';
3
- import type { FileContentQuerySchema } from '../../toolContract/schemas.js';
3
+ import type { FileContentQuerySchema } from '../../toolContract/input/resources/tools/ghGetFileContent.js';
4
4
  type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
5
5
  import { AuthInfo } from '@modelcontextprotocol/server';
6
6
  export interface RawContentResult {
@@ -1,3 +1,4 @@
1
+ import type { CollectionPages, CollectionStates } from './prContentFetcher/collectionPaging.js';
1
2
  import type { components } from '@octokit/openapi-types';
2
3
  import type { RestEndpointMethodTypes } from '@octokit/plugin-rest-endpoint-methods';
3
4
  import type { DiffPreview } from '../utils/parsers/diff.js';
@@ -7,8 +8,8 @@ export type CodeSearchResultItem = components['schemas']['code-search-result-ite
7
8
  export type RepoSearchResultItem = components['schemas']['repo-search-result-item'];
8
9
  export type IssueSearchResultItem = components['schemas']['issue-search-result-item'];
9
10
  export type DiffEntry = components['schemas']['diff-entry'];
10
- export type PullRequestItem = components['schemas']['pull-request'];
11
- export type PullRequestSimple = components['schemas']['pull-request-simple'];
11
+ export type PullRequestItem = RestEndpointMethodTypes['pulls']['get']['response']['data'];
12
+ export type PullRequestSimple = RestEndpointMethodTypes['pulls']['list']['response']['data'][number];
12
13
  export type IssueComment = components['schemas']['issue-comment'];
13
14
  export interface PRReviewInfo {
14
15
  id: string;
@@ -32,6 +33,7 @@ export interface CommitInfo {
32
33
  author: string;
33
34
  date: string;
34
35
  files: CommitFileInfo[];
36
+ filesCollectionState?: import('./prContentFetcher/collectionPaging.js').CollectionState;
35
37
  }
36
38
  export interface HistoryCommitFile {
37
39
  filename: string;
@@ -39,6 +41,11 @@ export interface HistoryCommitFile {
39
41
  additions: number;
40
42
  deletions: number;
41
43
  patch?: string;
44
+ isPartial?: true;
45
+ terminalLimit?: true;
46
+ patchUnavailable?: {
47
+ reason: 'providerOmittedPatch';
48
+ };
42
49
  patchPagination?: {
43
50
  charOffset: number;
44
51
  charLength: number;
@@ -191,6 +198,12 @@ export interface PRCommentItem {
191
198
  line?: number;
192
199
  inReplyToId?: number | null;
193
200
  }
201
+ export interface PRProviderLimit {
202
+ reason: 'providerResultCap';
203
+ surface: 'commits' | 'changedFiles' | 'commitFiles';
204
+ maxResults: number;
205
+ sha?: string;
206
+ }
194
207
  export type GitHubPullRequestItem = Pick<IssueSearchResultItem, 'number' | 'title' | 'body' | 'state' | 'created_at' | 'updated_at' | 'closed_at' | 'url' | 'draft'> & {
195
208
  author: string;
196
209
  labels: string[];
@@ -210,6 +223,8 @@ export type GitHubPullRequestItem = Pick<IssueSearchResultItem, 'number' | 'titl
210
223
  };
211
224
  commits?: CommitInfo[];
212
225
  reviews?: PRReviewInfo[];
226
+ collectionStates?: CollectionStates;
227
+ providerLimits?: PRProviderLimit[];
213
228
  _sanitization_warnings?: string[];
214
229
  };
215
230
  export interface GitHubPullRequestsSearchParams {
@@ -257,6 +272,8 @@ export interface GitHubPullRequestsSearchParams {
257
272
  filePage?: number;
258
273
  commentPage?: number;
259
274
  commitPage?: number;
275
+ reviewPage?: number;
276
+ collectionPages?: CollectionPages;
260
277
  itemsPerPage?: number;
261
278
  }
262
279
  export declare function isGitHubAPIError(obj: unknown): obj is GitHubAPIError;
@@ -1,4 +1,16 @@
1
1
  import type { HistoryCommitFile } from '../githubAPI.js';
2
+ /** A missing provider patch does not establish whether a file is binary or too large. */
3
+ export declare function patchAvailability(patch: unknown): {
4
+ isPartial?: undefined;
5
+ terminalLimit?: undefined;
6
+ patchUnavailable?: undefined;
7
+ } | {
8
+ isPartial: true;
9
+ terminalLimit: true;
10
+ patchUnavailable: {
11
+ reason: "providerOmittedPatch";
12
+ };
13
+ };
2
14
  export declare function windowPatch(patch: string | undefined, charOffset: number | undefined, charLength: number | undefined): {
3
15
  patch: string;
4
16
  patchPagination?: {
@@ -1,6 +1,6 @@
1
1
  import type { AuthInfo } from '@modelcontextprotocol/server';
2
2
  import type { GitHubAPIResponse } from '../githubAPI.js';
3
- import { type IssueSearchParams } from '../queryBuilders.js';
3
+ import { type IssueSearchParams } from '../queryBuilders/issues.js';
4
4
  import type { FetchIssuesParams, IssuesResult } from './types.js';
5
5
  export declare function fetchIssueByNumber(params: FetchIssuesParams, authInfo?: AuthInfo): Promise<GitHubAPIResponse<IssuesResult>>;
6
6
  export declare function searchIssues(searchParams: IssueSearchParams, params: FetchIssuesParams, authInfo?: AuthInfo): Promise<GitHubAPIResponse<IssuesResult>>;
@@ -1,8 +1,9 @@
1
- import type { IssueSearchParams } from '../queryBuilders.js';
1
+ import type { IssueSearchParams } from '../queryBuilders/issues.js';
2
2
  export type IssueCommentRow = {
3
3
  id: string;
4
4
  user: string;
5
5
  body: string;
6
+ bodyPagination?: NonNullable<IssueRow['contentPagination']>['body'];
6
7
  createdAt: string;
7
8
  updatedAt: string;
8
9
  commentType: 'discussion';
@@ -19,6 +20,7 @@ export type IssueRow = {
19
20
  body?: string;
20
21
  comments?: IssueCommentRow[];
21
22
  contentPagination?: {
23
+ commentBody?: NonNullable<IssueRow['contentPagination']>['body'];
22
24
  body?: {
23
25
  charOffset: number;
24
26
  charLength: number;
@@ -0,0 +1,27 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/server';
2
+ export type CollectionSurface = 'changedFiles' | 'discussion' | 'inline' | 'reviews' | 'commits';
3
+ export type CollectionPages = Partial<Record<CollectionSurface, number>>;
4
+ export type CollectionState = {
5
+ page: number;
6
+ hasMore: boolean;
7
+ };
8
+ export type CollectionStates = Partial<Record<CollectionSurface, CollectionState>>;
9
+ export type CollectionArray<T> = T[] & {
10
+ collectionState?: CollectionState;
11
+ };
12
+ /** One cached provider page per requested surface. Zero marks an exhausted source. */
13
+ export declare function fetchCollectionPage<T>(identity: {
14
+ owner: string;
15
+ repo: string;
16
+ prNumber: number;
17
+ surface: CollectionSurface;
18
+ }, page: number, fetchPage: (page: number) => Promise<{
19
+ data: T[];
20
+ headers?: {
21
+ link?: string;
22
+ };
23
+ }>, authInfo?: AuthInfo): Promise<{
24
+ items: T[];
25
+ rawResponseChars: number;
26
+ collectionState: CollectionState;
27
+ }>;
@@ -1,11 +1,13 @@
1
1
  import { PRCommentItem, PRReviewInfo } from '../githubAPI.js';
2
2
  import { OctokitWithThrottling } from '../client.js';
3
- export declare function fetchPRComments(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number, includeBots?: boolean): Promise<{
4
- comments: PRCommentItem[];
3
+ import type { AuthInfo } from '@modelcontextprotocol/server';
4
+ import { type CollectionArray } from './collectionPaging.js';
5
+ export declare function fetchPRComments(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number, includeBots?: boolean, authInfo?: AuthInfo, collectionPage?: number): Promise<{
6
+ comments: CollectionArray<PRCommentItem>;
5
7
  note?: string;
6
8
  }>;
7
- export declare function fetchPRReviews(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number): Promise<PRReviewInfo[]>;
8
- export declare function fetchPRInlineComments(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number, includeBots?: boolean): Promise<{
9
- comments: PRCommentItem[];
9
+ export declare function fetchPRReviews(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number, authInfo?: AuthInfo, collectionPage?: number): Promise<CollectionArray<PRReviewInfo>>;
10
+ export declare function fetchPRInlineComments(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number, includeBots?: boolean, authInfo?: AuthInfo, collectionPage?: number): Promise<{
11
+ comments: CollectionArray<PRCommentItem>;
10
12
  note?: string;
11
13
  }>;
@@ -1,27 +1,26 @@
1
- import { GitHubPullRequestsSearchParams, CommitInfo, DiffEntry, CommitFileInfo } from '../githubAPI.js';
1
+ import { GitHubPullRequestsSearchParams, CommitInfo, DiffEntry, CommitFileInfo, PRProviderLimit } from '../githubAPI.js';
2
2
  import { AuthInfo } from '@modelcontextprotocol/server';
3
- export declare function fetchAllPaginated<T>(fetchPage: (page: number) => Promise<{
4
- data: T[];
5
- }>): Promise<{
6
- items: T[];
7
- rawResponseChars: number;
8
- }>;
9
- export declare function fetchPRFileChangesAPI(owner: string, repo: string, prNumber: number, authInfo?: AuthInfo): Promise<{
3
+ import { type CollectionState } from './collectionPaging.js';
4
+ type WithProviderLimits<T> = T & {
5
+ providerLimits?: PRProviderLimit[];
6
+ collectionState?: CollectionState;
7
+ };
8
+ export declare function fetchPRFileChangesAPI(owner: string, repo: string, prNumber: number, authInfo?: AuthInfo, collectionPage?: number): Promise<WithProviderLimits<{
10
9
  total_count: number;
11
10
  files: DiffEntry[];
12
- } | null>;
11
+ }> | null>;
13
12
  interface CommitListItem {
14
13
  sha: string;
15
14
  commit: {
16
15
  message: string;
17
16
  author: {
18
- name: string;
19
- date: string;
17
+ name?: string;
18
+ date?: string;
20
19
  } | null;
21
20
  };
22
21
  }
23
- export declare function fetchPRCommitsAPI(owner: string, repo: string, prNumber: number, authInfo?: AuthInfo): Promise<CommitListItem[] | null>;
24
- export declare function fetchCommitFilesAPI(owner: string, repo: string, sha: string, authInfo?: AuthInfo): Promise<CommitFileInfo[] | null>;
22
+ export declare function fetchPRCommitsAPI(owner: string, repo: string, prNumber: number, authInfo?: AuthInfo, collectionPage?: number): Promise<WithProviderLimits<CommitListItem[]> | null>;
23
+ export declare function fetchCommitFilesAPI(owner: string, repo: string, sha: string, authInfo?: AuthInfo): Promise<WithProviderLimits<CommitFileInfo[]> | null>;
25
24
  export declare function mapPool<T, R>(items: T[], concurrency: number, mapper: (item: T, index: number) => Promise<R>): Promise<R[]>;
26
- export declare function fetchPRCommitsWithFiles(owner: string, repo: string, prNumber: number, params: GitHubPullRequestsSearchParams, authInfo?: AuthInfo): Promise<CommitInfo[] | null>;
25
+ export declare function fetchPRCommitsWithFiles(owner: string, repo: string, prNumber: number, params: GitHubPullRequestsSearchParams, authInfo?: AuthInfo): Promise<WithProviderLimits<CommitInfo[]> | null>;
27
26
  export {};
@@ -18,4 +18,3 @@ export declare function shouldFetchReviews(params: GitHubPullRequestsSearchParam
18
18
  */
19
19
  export declare function shouldEnrichPullRequestFromSearch(params: GitHubPullRequestsSearchParams): boolean;
20
20
  export declare function shouldIncludeBotComments(params: GitHubPullRequestsSearchParams): boolean;
21
- export declare function stripMachineBlobs(body: string): string;
@@ -1,5 +1,5 @@
1
1
  import { GitHubPullRequestsSearchParams, GitHubPullRequestItem, IssueSearchResultItem, PullRequestSimple, PullRequestItem } from '../githubAPI.js';
2
2
  import { OctokitWithThrottling } from '../client.js';
3
3
  import { AuthInfo } from '@modelcontextprotocol/server';
4
- export declare function transformPullRequestItemFromSearch(item: IssueSearchResultItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>): Promise<GitHubPullRequestItem>;
4
+ export declare function transformPullRequestItemFromSearch(item: IssueSearchResultItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>, authInfo?: AuthInfo): Promise<GitHubPullRequestItem>;
5
5
  export declare function transformPullRequestItemFromREST(item: PullRequestSimple | PullRequestItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>, authInfo?: AuthInfo): Promise<GitHubPullRequestItem>;
@@ -89,7 +89,6 @@ export declare function formatPRForResponse(pr: GitHubPullRequestItem, options?:
89
89
  name: string;
90
90
  color: string;
91
91
  }[];
92
- number: number;
93
92
  title: string;
94
93
  state: "open" | "closed";
95
94
  draft: boolean;
@@ -99,6 +98,9 @@ export declare function formatPRForResponse(pr: GitHubPullRequestItem, options?:
99
98
  closedAt: string;
100
99
  mergedAt: string;
101
100
  author: string;
101
+ providerLimits?: import("./githubAPI.js").PRProviderLimit[];
102
+ collectionStates?: Partial<Record<import("./prContentFetcher/collectionPaging.js").CollectionSurface, import("./prContentFetcher/collectionPaging.js").CollectionState>>;
103
+ number: number;
102
104
  };
103
105
  export declare function normalizeOwnerRepo(params: GitHubPullRequestsSearchParams): {
104
106
  owner: string | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { z } from 'zod';
2
- import type { GitHubCodeSearchQuerySchema, GitHubReposSearchSingleQuerySchema } from '../../toolContract/schemas.js';
2
+ import type { GitHubCodeSearchQuerySchema } from '../../toolContract/input/resources/tools/githubCodeOperation.js';
3
+ import type { GitHubReposSearchSingleQuerySchema } from '../../toolContract/input/resources/tools/githubRepositoriesOperation.js';
3
4
  type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
4
5
  type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
5
6
  import type { WithOptionalMeta } from '../../types/execution.js';
@@ -1,6 +1,6 @@
1
1
  import type { GitHubAPIResponse } from './githubAPI.js';
2
2
  import type { z } from 'zod';
3
- import type { GitHubReposSearchSingleQuerySchema } from '../toolContract/schemas.js';
3
+ import type { GitHubReposSearchSingleQuerySchema } from '../toolContract/input/resources/tools/githubRepositoriesOperation.js';
4
4
  import type { GitHubRepositoryOutput } from '@octocodeai/octocode-core/extra-types';
5
5
  type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
6
6
  import type { WithOptionalMeta } from '../types/execution.js';
@@ -18,6 +18,7 @@ interface RepoSearchPagination {
18
18
  }
19
19
  interface RepoSearchAPIData {
20
20
  repositories: GitHubRepositoryOutput[];
21
+ incompleteResults?: boolean;
21
22
  pagination?: RepoSearchPagination;
22
23
  nonExistentScope?: boolean;
23
24
  }
@@ -1,6 +1,6 @@
1
1
  import type { z } from 'zod';
2
2
  import { AuthInfo } from '@modelcontextprotocol/server';
3
- import type { GitHubViewRepoStructureQuerySchema } from '../../toolContract/schemas.js';
3
+ import type { GitHubViewRepoStructureQuerySchema } from '../../toolContract/input/resources/tools/githubTreeOperation.js';
4
4
  type GitHubViewRepoStructureQuery = z.infer<typeof GitHubViewRepoStructureQuerySchema>;
5
5
  import type { GitHubRepositoryStructureResult, GitHubRepositoryStructureError } from '../../tools/github_view_repo_structure/types.js';
6
6
  export declare function viewGitHubRepositoryStructureAPI(params: GitHubViewRepoStructureQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubRepositoryStructureResult | GitHubRepositoryStructureError>;
@@ -1,5 +1,5 @@
1
1
  import type { z } from 'zod';
2
- import type { GitHubViewRepoStructureQuerySchema } from '../toolContract/schemas.js';
2
+ import type { GitHubViewRepoStructureQuerySchema } from '../toolContract/input/resources/tools/githubTreeOperation.js';
3
3
  type GitHubViewRepoStructureQuery = z.infer<typeof GitHubViewRepoStructureQuerySchema>;
4
4
  import type { GitHubRepositoryStructureResult } from '../tools/github_view_repo_structure/types.js';
5
5
  export declare function applyStructurePagination(cachedResult: GitHubRepositoryStructureResult, params: GitHubViewRepoStructureQuery): GitHubRepositoryStructureResult;
@@ -25,8 +25,10 @@ export declare function filterGitTreeEntries(tree: GitTreeEntry[], options: {
25
25
  }): GitHubApiFileItem[];
26
26
  export declare function isGitStructureTreesEnabled(env?: NodeJS.ProcessEnv): boolean;
27
27
  /**
28
- * Fetch a repo tree via `git.getTree({ recursive: 'true' })` and filter to the
29
- * requested path/depth. Resolves branch tree SHA in two REST calls total.
28
+ * Resolve the requested directory's immutable tree SHA, then fetch its tree.
29
+ * Root queries use branch metadata; scoped queries find the directory in its
30
+ * parent's Contents listing. Both paths use two REST calls, without downloading
31
+ * unrelated recursive subtrees for a scoped query.
30
32
  */
31
33
  export declare function fetchStructureViaGitTree(octokit: Octokit, params: {
32
34
  owner: string;
@@ -1,6 +1,6 @@
1
1
  import type { FileGraphEdgeKind, FileNode } from './types.js';
2
- /** Remove edges that exist only for erased type imports. */
3
- export declare function withoutTypeOnlyEdges(graph: ReadonlyMap<string, FileNode>): Map<string, FileNode>;
2
+ /** Runtime import candidates; Rust names/modules and C preprocessing are topology only. */
3
+ export declare function runtimeImportGraph(graph: ReadonlyMap<string, FileNode>): Map<string, FileNode>;
4
4
  export interface CondensedGraph {
5
5
  components: string[][];
6
6
  componentOf: Map<string, number>;
@@ -1,8 +1,9 @@
1
- import type { FileFacts, FileNode } from './types.js';
1
+ import type { FileFacts, FileNode, GraphCoverage } from './types.js';
2
2
  export declare const DEFAULT_DEAD_CODE_EXCLUDE_DIRS: string[];
3
3
  /** Keep generated/vendor defaults while allowing callers to add repo-specific exclusions. */
4
4
  export declare function resolveGraphExcludeDirs(custom: readonly string[] | undefined): string[];
5
5
  export interface WalkResult {
6
+ coverage?: GraphCoverage;
6
7
  facts: Map<string, FileFacts>;
7
8
  fileGraph: Map<string, FileNode>;
8
9
  filesScanned: number;
@@ -16,23 +17,17 @@ export interface WalkResult {
16
17
  */
17
18
  starReexportTargets: Set<string>;
18
19
  /**
19
- * Files that are the target of a string-literal dynamic `import('./x')`
20
- * somewhere in the scan. A dynamic import resolves the whole module
21
- * namespace, not a specific named binding, so — unlike a static
22
- * `import { x } from './y'` — there is no reliable way to attribute which
23
- * of the target's exports are actually used. Treated the same as
24
- * `starReexportTargets`: reachable, and not individually retention-checked,
25
- * rather than risk a false-positive "unreferenced export" on a name that's
26
- * genuinely read off the dynamically-imported namespace object.
20
+ * Targets consumed as whole namespaces (dynamic/CommonJS loads, namespace
21
+ * imports, and C headers). Retain their public surface because syntax facts
22
+ * cannot attribute the particular exported bindings consumed downstream.
27
23
  */
28
- dynamicImportTargets: Set<string>;
24
+ namespaceImportTargets: Set<string>;
29
25
  /**
30
26
  * Reverse star-re-export edges: target file → the files that
31
27
  * `export * from` it. Needed for retention: a NAMED re-export whose barrel
32
28
  * is itself star-re-exported (barrel → `export *` → entrypoint) is public
33
29
  * API — `isBindingLive` must be able to hop the star edge, which carries no
34
- * per-name entry in the named `reexportIndex`. Unfiltered (all scanned
35
- * files); the scan filters to reachable re-exporters before use.
30
+ * per-name `reexportIndex` entry. Filtered to reachable re-exporters at use.
36
31
  */
37
32
  starReexporters: Map<string, string[]>;
38
33
  }
@@ -41,4 +36,4 @@ export interface WalkResult {
41
36
  * worker-pool operation, then resolve import specifiers into a file-level graph.
42
37
  * Cross-file policy stays here; filesystem I/O and parsing stay in Rust.
43
38
  */
44
- export declare function buildFileGraph(rootAbsolutePath: string, excludeDir: string[], maxFiles: number): Promise<WalkResult>;
39
+ export declare function buildFileGraph(rootAbsolutePath: string, excludeDir: string[], maxFiles: number, rustWorkspace?: 'syntax' | 'cargo'): Promise<WalkResult>;
@@ -0,0 +1,6 @@
1
+ import type { GraphCoverage, RawGraphFacts } from './types.js';
2
+ type Diagnostic = GraphCoverage['diagnostics'][number];
3
+ export declare function recordUnlinkedCommonJsCalls(coverage: GraphCoverage, file: string, calls: RawGraphFacts['calls']): void;
4
+ /** One diagnostic per source occurrence, independent of binding or scan order. */
5
+ export declare function canonicalGraphDiagnostics(diagnostics: readonly Diagnostic[]): Diagnostic[];
6
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { GraphCoverage } from './types.js';
2
+ type Diagnostic = GraphCoverage['diagnostics'][number];
3
+ interface PreparedDiagnostics {
4
+ diagnostics: Diagnostic[];
5
+ resultId: string;
6
+ diagnosticCounts: Readonly<Record<string, number>>;
7
+ }
8
+ /** An immutable diagnostic inventory belonging to one completed graph scan. */
9
+ export declare function prepareGraphDiagnostics(items: readonly Diagnostic[]): PreparedDiagnostics;
10
+ export {};