@octocodeai/octocode-tools-core 16.6.3 → 17.0.2

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 (252) hide show
  1. package/README.md +22 -50
  2. package/dist/direct.js +33 -38
  3. package/dist/github/botFilter.d.ts +1 -0
  4. package/dist/github/client.d.ts +6 -0
  5. package/dist/github/directoryFetch/fetchDirectoryContents.d.ts +3 -0
  6. package/dist/github/directoryFetch/fetchFileContentToDisk.d.ts +3 -0
  7. package/dist/github/directoryFetch/helpers.d.ts +35 -0
  8. package/dist/github/directoryFetch.d.ts +3 -6
  9. package/dist/github/fileContentPagination.d.ts +9 -0
  10. package/dist/github/fileContentProcess.d.ts +1 -8
  11. package/dist/github/fileContentRaw/fetch.d.ts +20 -0
  12. package/dist/github/fileContentRaw/pathSuggestions.d.ts +3 -0
  13. package/dist/github/fileContentRaw.d.ts +2 -12
  14. package/dist/github/githubAPI.d.ts +4 -1
  15. package/dist/github/history.d.ts +6 -2
  16. package/dist/github/issues/fetchers.d.ts +7 -0
  17. package/dist/github/issues/helpers.d.ts +32 -0
  18. package/dist/github/issues/orchestrator.d.ts +4 -0
  19. package/dist/github/issues/types.d.ts +72 -0
  20. package/dist/github/issues.d.ts +3 -0
  21. package/dist/github/prContentFetcher/comments.d.ts +11 -0
  22. package/dist/github/prContentFetcher/commits.d.ts +27 -0
  23. package/dist/github/prContentFetcher/flags.d.ts +21 -0
  24. package/dist/github/prContentFetcher/transform.d.ts +5 -0
  25. package/dist/github/prContentFetcher.d.ts +2 -5
  26. package/dist/github/pullRequestSearch/restSearch.d.ts +6 -0
  27. package/dist/github/pullRequestSearch.d.ts +1 -1
  28. package/dist/github/queryBuilders/base.d.ts +25 -0
  29. package/dist/github/queryBuilders/codeAndRepo.d.ts +20 -0
  30. package/dist/github/queryBuilders/issues.d.ts +42 -0
  31. package/dist/github/queryBuilders/pullRequests.d.ts +13 -0
  32. package/dist/github/queryBuilders.d.ts +4 -12
  33. package/dist/github/releases.d.ts +37 -0
  34. package/dist/github/repoStructure/contentResolution.d.ts +12 -0
  35. package/dist/github/repoStructure/fetchOrchestration.d.ts +7 -0
  36. package/dist/github/repoStructure/resultBuilder.d.ts +22 -0
  37. package/dist/github/repoStructure.d.ts +1 -7
  38. package/dist/github/repoStructureTree.d.ts +38 -0
  39. package/dist/github/responseHeaders.d.ts +2 -0
  40. package/dist/github/searchKeyword.d.ts +2 -0
  41. package/dist/index.d.ts +1 -4
  42. package/dist/index.js +35 -40
  43. package/dist/oql/adapters/github/execute.d.ts +16 -0
  44. package/dist/oql/adapters/github/provider-diagnostics.d.ts +14 -0
  45. package/dist/oql/adapters/github/shared.d.ts +75 -0
  46. package/dist/oql/adapters/github.d.ts +11 -0
  47. package/dist/oql/adapters/graphView/filters.d.ts +25 -0
  48. package/dist/oql/adapters/graphView/nativeEdges.d.ts +5 -0
  49. package/dist/oql/adapters/graphView.d.ts +17 -16
  50. package/dist/oql/adapters/local/code.d.ts +3 -0
  51. package/dist/oql/adapters/local/codeBoolean.d.ts +3 -0
  52. package/dist/oql/adapters/local/fileRowOps.d.ts +11 -0
  53. package/dist/oql/adapters/local/files.d.ts +3 -0
  54. package/dist/oql/adapters/local/filesBoolean.d.ts +10 -0
  55. package/dist/oql/adapters/local/filesContentLeaf.d.ts +12 -0
  56. package/dist/oql/adapters/local/filesUniverse.d.ts +6 -0
  57. package/dist/oql/adapters/local/findToolType.d.ts +10 -0
  58. package/dist/oql/adapters/local/predicates.d.ts +18 -0
  59. package/dist/oql/adapters/local/scope.d.ts +14 -0
  60. package/dist/oql/adapters/local/searchToolType.d.ts +7 -0
  61. package/dist/oql/adapters/local/structureContent.d.ts +6 -0
  62. package/dist/oql/adapters/local/types.d.ts +34 -0
  63. package/dist/oql/adapters/local.d.ts +3 -7
  64. package/dist/oql/adapters/researchTargets/diff.d.ts +16 -0
  65. package/dist/oql/adapters/researchTargets/graph.d.ts +3 -0
  66. package/dist/oql/adapters/researchTargets/history.d.ts +20 -0
  67. package/dist/oql/adapters/researchTargets/pagination.d.ts +54 -0
  68. package/dist/oql/adapters/researchTargets/repositories.d.ts +4 -0
  69. package/dist/oql/adapters/researchTargets/research.d.ts +3 -0
  70. package/dist/oql/adapters/researchTargets/rows.d.ts +16 -0
  71. package/dist/oql/adapters/researchTargets/semantics.d.ts +3 -0
  72. package/dist/oql/adapters/researchTargets/shared.d.ts +11 -0
  73. package/dist/oql/adapters/researchTargets.d.ts +4 -46
  74. package/dist/oql/defaults.d.ts +1 -1
  75. package/dist/oql/index.js +34 -39
  76. package/dist/oql/normalize/batch.d.ts +2 -0
  77. package/dist/oql/normalize/materialize.d.ts +2 -0
  78. package/dist/oql/normalize/params.d.ts +2 -0
  79. package/dist/oql/normalize/query.d.ts +2 -0
  80. package/dist/oql/normalize/scope.d.ts +2 -0
  81. package/dist/oql/normalize/shared.d.ts +7 -0
  82. package/dist/oql/normalize/source.d.ts +2 -0
  83. package/dist/oql/normalize/where.d.ts +2 -0
  84. package/dist/oql/normalize.d.ts +19 -4
  85. package/dist/oql/planner/planDiagnostics.d.ts +13 -0
  86. package/dist/oql/planner/predicateRouting.d.ts +35 -0
  87. package/dist/oql/predicateUtils.d.ts +3 -0
  88. package/dist/oql/research/analyze/manifest-scan.d.ts +4 -0
  89. package/dist/oql/research/analyze/source-graph.d.ts +7 -0
  90. package/dist/oql/research/analyze/symbol-scoring.d.ts +4 -0
  91. package/dist/oql/research/analyze/types.d.ts +163 -0
  92. package/dist/oql/research/analyze/utils.d.ts +16 -0
  93. package/dist/oql/research/analyze.d.ts +2 -133
  94. package/dist/oql/research/packets/builders.d.ts +4 -0
  95. package/dist/oql/research/packets/types.d.ts +91 -0
  96. package/dist/oql/research/packets.d.ts +21 -80
  97. package/dist/oql/run/batch.d.ts +3 -0
  98. package/dist/oql/run/continuations/records.d.ts +19 -0
  99. package/dist/oql/run/continuations/registry.d.ts +22 -0
  100. package/dist/oql/run/continuations/semantics.d.ts +3 -0
  101. package/dist/oql/run/continuations/types.d.ts +12 -0
  102. package/dist/oql/run/dryRun.d.ts +11 -0
  103. package/dist/oql/run/paths.d.ts +15 -0
  104. package/dist/oql/run/proofGrades.d.ts +8 -0
  105. package/dist/oql/run/select.d.ts +10 -0
  106. package/dist/oql/run/single.d.ts +22 -0
  107. package/dist/oql/run.d.ts +4 -31
  108. package/dist/oql/schema/predicates.d.ts +12 -0
  109. package/dist/oql/schema.d.ts +50 -35
  110. package/dist/oql/schemeText.d.ts +10 -13
  111. package/dist/oql/shorthand/predicates.d.ts +15 -0
  112. package/dist/oql/shorthand/query-controls.d.ts +18 -0
  113. package/dist/oql/shorthand/target-params.d.ts +9 -0
  114. package/dist/oql/shorthand/types.d.ts +159 -0
  115. package/dist/oql/shorthand/utils.d.ts +7 -0
  116. package/dist/oql/shorthand.d.ts +2 -171
  117. package/dist/oql/targetParams.d.ts +0 -13
  118. package/dist/oql/transformers/github/code.d.ts +1 -9
  119. package/dist/oql/types/diagnostics.d.ts +22 -0
  120. package/dist/oql/types/envelope.d.ts +78 -0
  121. package/dist/oql/types/guards.d.ts +9 -0
  122. package/dist/oql/types/planner.d.ts +46 -0
  123. package/dist/oql/types/predicates.d.ts +93 -0
  124. package/dist/oql/types/query.d.ts +143 -0
  125. package/dist/oql/types/recordData.d.ts +127 -0
  126. package/dist/oql/types/recordRows.d.ts +48 -0
  127. package/dist/oql/types/results.d.ts +118 -0
  128. package/dist/oql/types/targets.d.ts +22 -0
  129. package/dist/oql/types.d.ts +17 -640
  130. package/dist/providers/github/paginationMetadata.d.ts +12 -0
  131. package/dist/providers/providerResults.d.ts +0 -1
  132. package/dist/schema.js +2 -2
  133. package/dist/scheme/pagination.d.ts +65 -0
  134. package/dist/shared/config/index.js +1 -1
  135. package/dist/shared/credentials/index.js +2 -2
  136. package/dist/shared/credentials/testing.js +1 -1
  137. package/dist/shared/languageSelectors/classify.d.ts +15 -0
  138. package/dist/shared/languageSelectors/data.d.ts +12 -0
  139. package/dist/shared/languageSelectors.d.ts +3 -23
  140. package/dist/shared/paths.d.ts +0 -4
  141. package/dist/shared/paths.js +1 -1
  142. package/dist/shared/session/index.js +1 -1
  143. package/dist/shared/session/statsDefaults.d.ts +1 -2
  144. package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +68 -0
  145. package/dist/tools/directToolCatalog/toolCommandPatternQueries.d.ts +4 -0
  146. package/dist/tools/directToolCatalog/toolCommandPatterns.d.ts +4 -0
  147. package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +12 -0
  148. package/dist/tools/directToolCatalog/toolSchemaIntrospection.d.ts +19 -0
  149. package/dist/tools/directToolCatalog.meta.d.ts +10 -67
  150. package/dist/tools/github_clone_repo/cache.d.ts +1 -5
  151. package/dist/tools/github_clone_repo/cachePaths.d.ts +5 -0
  152. package/dist/tools/github_fetch_content/finalizer/entryParsers.d.ts +9 -0
  153. package/dist/tools/github_fetch_content/finalizer/types.d.ts +101 -0
  154. package/dist/tools/github_fetch_content/finalizer.d.ts +1 -7
  155. package/dist/tools/github_fetch_content/scheme.d.ts +42 -9
  156. package/dist/tools/github_fetch_content/types.d.ts +1 -2
  157. package/dist/tools/github_search_code/execution.d.ts +9 -0
  158. package/dist/tools/github_search_code/finalizer/build.d.ts +4 -0
  159. package/dist/tools/github_search_code/finalizer/groups.d.ts +23 -0
  160. package/dist/tools/github_search_code/finalizer/ranking.d.ts +12 -0
  161. package/dist/tools/github_search_code/finalizer.d.ts +2 -6
  162. package/dist/tools/github_search_code/scheme.d.ts +29 -2
  163. package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +68 -0
  164. package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +52 -0
  165. package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +17 -0
  166. package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +63 -0
  167. package/dist/tools/github_search_pull_requests/contentResponse.d.ts +1 -15
  168. package/dist/tools/github_search_pull_requests/execution/commitsMode.d.ts +4 -0
  169. package/dist/tools/github_search_pull_requests/execution/issuesMode.d.ts +4 -0
  170. package/dist/tools/github_search_pull_requests/execution/pullRequestsMode.d.ts +4 -0
  171. package/dist/tools/github_search_pull_requests/execution/releasesMode.d.ts +4 -0
  172. package/dist/tools/github_search_pull_requests/execution/types.d.ts +6 -0
  173. package/dist/tools/github_search_pull_requests/execution.d.ts +1 -4
  174. package/dist/tools/github_search_pull_requests/scheme.d.ts +11 -1
  175. package/dist/tools/github_search_repos/execution/pagination.d.ts +39 -0
  176. package/dist/tools/github_search_repos/execution/queryVariants.d.ts +38 -0
  177. package/dist/tools/github_search_repos/execution/ranking.d.ts +4 -0
  178. package/dist/tools/github_search_repos/execution.d.ts +3 -71
  179. package/dist/tools/github_search_repos/scheme.d.ts +8 -0
  180. package/dist/tools/github_view_repo_structure/types.d.ts +2 -0
  181. package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +15 -0
  182. package/dist/tools/local_fetch_content/fetchContent/pagination.d.ts +38 -0
  183. package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +26 -0
  184. package/dist/tools/local_fetch_content/fetchContent.d.ts +2 -0
  185. package/dist/tools/local_fetch_content/scheme.d.ts +25 -1
  186. package/dist/tools/local_find_files/scheme.d.ts +32 -0
  187. package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +70 -0
  188. package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +47 -0
  189. package/dist/tools/local_ripgrep/rankingProfile/rankingScoring.d.ts +41 -0
  190. package/dist/tools/local_ripgrep/rankingProfile.d.ts +16 -95
  191. package/dist/tools/local_ripgrep/ripgrepResultBuilder/buildResult.d.ts +10 -0
  192. package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +46 -0
  193. package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +2 -18
  194. package/dist/tools/local_ripgrep/scheme.d.ts +95 -0
  195. package/dist/tools/local_view_structure/scheme.d.ts +31 -0
  196. package/dist/tools/lsp/semantic_content/scheme.d.ts +61 -0
  197. package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +7 -0
  198. package/dist/tools/lsp/semantic_content/semanticEnvelopes/callEnvelopes.d.ts +5 -0
  199. package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +20 -0
  200. package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +13 -0
  201. package/dist/tools/lsp/semantic_content/semanticEnvelopes.d.ts +3 -0
  202. package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +24 -0
  203. package/dist/tools/lsp/semantic_content/semanticFileOps/documentSymbols.d.ts +27 -0
  204. package/dist/tools/lsp/semantic_content/semanticFileOps/workspaceSymbolsAndDiagnostics.d.ts +20 -0
  205. package/dist/tools/lsp/semantic_content/semanticFileOps.d.ts +8 -0
  206. package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +53 -0
  207. package/dist/tools/lsp/shared/semanticTypes.d.ts +6 -0
  208. package/dist/tools/package_search/execution.d.ts +8 -0
  209. package/dist/tools/package_search/scheme.d.ts +43 -2
  210. package/dist/tools/providerMappers/codeSearch.d.ts +66 -0
  211. package/dist/tools/providerMappers/fileContent.d.ts +28 -0
  212. package/dist/tools/providerMappers/pullRequests.d.ts +158 -0
  213. package/dist/tools/providerMappers/repoSearch.d.ts +30 -0
  214. package/dist/tools/providerMappers/repoStructure.d.ts +20 -0
  215. package/dist/tools/providerMappers/shared.d.ts +23 -0
  216. package/dist/tools/providerMappers.d.ts +9 -294
  217. package/dist/tools/toolConfig.d.ts +0 -2
  218. package/dist/tools/toolMetadata/descriptionOverrides.d.ts +4 -0
  219. package/dist/tools/toolSchemaImports.d.ts +13 -0
  220. package/dist/utils/contextUtils.d.ts +5 -16
  221. package/dist/utils/core/types.d.ts +2 -24
  222. package/dist/utils/exec/spawn/env.d.ts +5 -0
  223. package/dist/utils/exec/spawn/wrappers.d.ts +29 -0
  224. package/dist/utils/exec/spawn.d.ts +2 -34
  225. package/dist/utils/file/toolHelpers.d.ts +12 -0
  226. package/dist/utils/http/cache/conditional.d.ts +21 -0
  227. package/dist/utils/http/cache/dataCache.d.ts +6 -0
  228. package/dist/utils/http/cache/key.d.ts +1 -0
  229. package/dist/utils/http/cache/management.d.ts +9 -0
  230. package/dist/utils/http/cache/store.d.ts +28 -0
  231. package/dist/utils/http/cache.d.ts +4 -16
  232. package/dist/utils/markdownOutline.d.ts +0 -2
  233. package/dist/utils/package/npm/npmDeprecation.d.ts +5 -0
  234. package/dist/utils/package/npm/npmDetailsFetchers.d.ts +15 -0
  235. package/dist/utils/package/npm/npmMappers.d.ts +12 -0
  236. package/dist/utils/package/npm/npmRegistry.d.ts +79 -0
  237. package/dist/utils/package/npm/npmSearchStrategies.d.ts +6 -0
  238. package/dist/utils/package/npm.d.ts +2 -8
  239. package/dist/utils/pagination/boundary.d.ts +5 -5
  240. package/dist/utils/response/bulk/pagination.d.ts +6 -0
  241. package/dist/utils/response/bulk/queries.d.ts +19 -0
  242. package/dist/utils/response/bulk/response.d.ts +4 -0
  243. package/dist/utils/response/bulk.d.ts +2 -6
  244. package/package.json +42 -35
  245. package/dist/tools/local_binary_inspect/archiveOps.d.ts +0 -24
  246. package/dist/tools/local_binary_inspect/binaryInspector.d.ts +0 -86
  247. package/dist/tools/local_binary_inspect/binaryOps.d.ts +0 -27
  248. package/dist/tools/local_binary_inspect/decompressOps.d.ts +0 -16
  249. package/dist/tools/local_binary_inspect/execution.d.ts +0 -4
  250. package/dist/tools/local_binary_inspect/scheme.d.ts +0 -144
  251. package/dist/tools/local_ripgrep/lspBoost.d.ts +0 -54
  252. package/dist/utils/parsers/ripgrep.d.ts +0 -11
@@ -39,7 +39,7 @@ export declare const GitHubCodeSearchOutputLocalSchema: z.ZodObject<{
39
39
  results: z.ZodArray<z.ZodObject<{
40
40
  id: z.ZodString;
41
41
  data: z.ZodObject<{
42
- files: z.ZodArray<z.ZodObject<{
42
+ files: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
43
43
  owner: z.ZodString;
44
44
  repo: z.ZodString;
45
45
  path: z.ZodString;
@@ -54,7 +54,7 @@ export declare const GitHubCodeSearchOutputLocalSchema: z.ZodObject<{
54
54
  }, z.core.$strip>>>;
55
55
  url: z.ZodOptional<z.ZodString>;
56
56
  }, z.core.$strip>>;
57
- }, z.core.$strip>>;
57
+ }, z.core.$strip>]>>;
58
58
  pagination: z.ZodOptional<z.ZodObject<{
59
59
  currentPage: z.ZodNumber;
60
60
  totalPages: z.ZodNumber;
@@ -62,6 +62,14 @@ export declare const GitHubCodeSearchOutputLocalSchema: z.ZodObject<{
62
62
  nextPage: z.ZodOptional<z.ZodNumber>;
63
63
  pageSize: z.ZodOptional<z.ZodNumber>;
64
64
  totalItems: z.ZodOptional<z.ZodNumber>;
65
+ perPage: z.ZodOptional<z.ZodNumber>;
66
+ totalFound: z.ZodOptional<z.ZodNumber>;
67
+ returned: z.ZodOptional<z.ZodNumber>;
68
+ totalMatches: z.ZodOptional<z.ZodNumber>;
69
+ reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
70
+ reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
71
+ totalResults: z.ZodOptional<z.ZodNumber>;
72
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
65
73
  totalMatchesKind: z.ZodOptional<z.ZodEnum<{
66
74
  exact: "exact";
67
75
  reported: "reported";
@@ -78,6 +86,25 @@ export declare const GitHubCodeSearchOutputLocalSchema: z.ZodObject<{
78
86
  incompleteResults: z.ZodOptional<z.ZodLiteral<true>>;
79
87
  }, z.core.$strip>>>;
80
88
  warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ level: z.ZodEnum<{
91
+ error: "error";
92
+ info: "info";
93
+ warning: "warning";
94
+ }>;
95
+ message: z.ZodString;
96
+ field: z.ZodOptional<z.ZodString>;
97
+ code: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strip>>>;
99
+ next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
100
+ tool: z.ZodString;
101
+ query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
102
+ why: z.ZodOptional<z.ZodString>;
103
+ confidence: z.ZodOptional<z.ZodEnum<{
104
+ exact: "exact";
105
+ heuristic: "heuristic";
106
+ }>>;
107
+ }, z.core.$strip>>>;
81
108
  errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
82
109
  id: z.ZodString;
83
110
  error: z.ZodString;
@@ -0,0 +1,68 @@
1
+ import type { NormalizedPrContentRequest } from '../contentRequest.js';
2
+ import { type QueryLike } from './pagination.js';
3
+ export declare function shapeComments(pr: Record<string, unknown>, query: QueryLike, request: NormalizedPrContentRequest): {
4
+ comments?: undefined;
5
+ commentPagination?: undefined;
6
+ } | {
7
+ comments: ({
8
+ createdAt: unknown;
9
+ updatedAt: unknown;
10
+ body: string;
11
+ bodyPagination: {
12
+ nextCharOffset?: number;
13
+ charOffset: number;
14
+ charLength: number;
15
+ totalChars: number;
16
+ hasMore: boolean;
17
+ };
18
+ in_reply_to_id?: unknown;
19
+ id: unknown;
20
+ author: unknown;
21
+ commentType: unknown;
22
+ path: unknown;
23
+ line: unknown;
24
+ } | {
25
+ createdAt: unknown;
26
+ updatedAt: unknown;
27
+ bodyPreview: string;
28
+ in_reply_to_id?: unknown;
29
+ id: unknown;
30
+ author: unknown;
31
+ commentType: unknown;
32
+ path: unknown;
33
+ line: unknown;
34
+ })[];
35
+ commentPagination: import("./pagination.js").Pagination;
36
+ };
37
+ export declare function shapeReviews(pr: Record<string, unknown>, query: QueryLike, request: NormalizedPrContentRequest): {
38
+ reviews?: undefined;
39
+ } | {
40
+ reviews: {
41
+ submittedAt: unknown;
42
+ commitId: unknown;
43
+ body?: string;
44
+ bodyPagination?: {
45
+ nextCharOffset?: number;
46
+ charOffset: number;
47
+ charLength: number;
48
+ totalChars: number;
49
+ hasMore: boolean;
50
+ };
51
+ id: unknown;
52
+ user: unknown;
53
+ state: unknown;
54
+ }[];
55
+ };
56
+ export declare function shapeCommits(pr: Record<string, unknown>, query: QueryLike, request: NormalizedPrContentRequest): {
57
+ commits?: undefined;
58
+ commitPagination?: undefined;
59
+ } | {
60
+ commits: {
61
+ files?: any[];
62
+ sha: unknown;
63
+ message: unknown;
64
+ author: unknown;
65
+ date: unknown;
66
+ }[];
67
+ commitPagination: import("./pagination.js").Pagination;
68
+ };
@@ -0,0 +1,52 @@
1
+ import type { NormalizedPrContentRequest } from '../contentRequest.js';
2
+ import { type QueryLike } from './pagination.js';
3
+ export declare function filePathOf(change: Record<string, unknown>): string;
4
+ export declare function shapeFileChange(change: Record<string, unknown>, includePatch: boolean): {
5
+ patch?: string;
6
+ path: string;
7
+ status: string;
8
+ additions: number;
9
+ deletions: number;
10
+ };
11
+ export declare function stripPatchComments(patch: string): string;
12
+ export declare function shapeFileSurfaces(pr: Record<string, unknown>, query: QueryLike, request: NormalizedPrContentRequest, shouldMinify?: boolean): {
13
+ changedFiles: ({
14
+ patch?: string;
15
+ path: string;
16
+ status: string;
17
+ additions: number;
18
+ deletions: number;
19
+ } | {
20
+ patchPagination?: {
21
+ nextCharOffset?: number;
22
+ charOffset: number;
23
+ charLength: number;
24
+ totalChars: number;
25
+ hasMore: boolean;
26
+ };
27
+ patch: string;
28
+ diff: import("../../../index.js").DiffPreview;
29
+ path: string;
30
+ status: string;
31
+ additions: number;
32
+ deletions: number;
33
+ })[];
34
+ filePagination: import("./pagination.js").Pagination;
35
+ filePathsPreview?: undefined;
36
+ filePathsPagination?: undefined;
37
+ } | {
38
+ changedFiles?: undefined;
39
+ filePagination?: undefined;
40
+ filePathsPreview?: undefined;
41
+ filePathsPagination?: undefined;
42
+ } | {
43
+ filePathsPreview: string[];
44
+ filePathsPagination: {
45
+ nextFilePage?: number;
46
+ totalFiles: number;
47
+ filesPerPage: number;
48
+ hasMore: boolean;
49
+ };
50
+ changedFiles?: undefined;
51
+ filePagination?: undefined;
52
+ };
@@ -0,0 +1,17 @@
1
+ import type { NormalizedPrContentRequest } from '../contentRequest.js';
2
+ import { type QueryLike } from './pagination.js';
3
+ export declare function nextCalls(query: QueryLike, prNumber: number, request: NormalizedPrContentRequest, firstChangedFilePath?: string): {
4
+ fullReview?: Record<string, unknown>;
5
+ getCommits?: Record<string, unknown>;
6
+ getReviews?: Record<string, unknown>;
7
+ getComments?: Record<string, unknown>;
8
+ getSelectedPatches?: Record<string, unknown>;
9
+ getAllPatches?: Record<string, unknown>;
10
+ getChangedFiles?: Record<string, unknown>;
11
+ getBody?: Record<string, unknown>;
12
+ target: {
13
+ owner: string;
14
+ repo: string;
15
+ prNumber: number;
16
+ };
17
+ };
@@ -0,0 +1,63 @@
1
+ export type QueryLike = {
2
+ owner?: string;
3
+ repo?: string;
4
+ prNumber?: number;
5
+ page?: number;
6
+ filePage?: number;
7
+ commentPage?: number;
8
+ commitPage?: number;
9
+ itemsPerPage?: number;
10
+ charOffset?: number;
11
+ commentBodyOffset?: number;
12
+ charLength?: number;
13
+ matchString?: string;
14
+ };
15
+ export declare function matchStringNeedle(query: QueryLike): string | undefined;
16
+ export declare function containsNeedle(value: unknown, needle: string): boolean;
17
+ export type Pagination = {
18
+ currentPage: number;
19
+ totalPages: number;
20
+ itemsPerPage: number;
21
+ totalItems: number;
22
+ hasMore: boolean;
23
+ nextPage?: number;
24
+ };
25
+ export type TextPagination = {
26
+ charOffset: number;
27
+ charLength: number;
28
+ totalChars: number;
29
+ hasMore: boolean;
30
+ nextCharOffset?: number;
31
+ };
32
+ export type ContentPaginationEntry = Record<string, unknown> & {
33
+ hasMore: boolean;
34
+ nextQuery?: Record<string, unknown>;
35
+ };
36
+ export type ContentPagination = Partial<Record<'body' | 'changedFiles' | 'comments' | 'commentBody' | 'commits' | 'patches' | 'filePaths', ContentPaginationEntry>>;
37
+ export declare function paginateItems<T>(items: T[], page?: number, itemsPerPage?: number): {
38
+ items: T[];
39
+ pagination: Pagination;
40
+ };
41
+ export declare function paginateText(value: string | undefined, charOffset?: number, charLength?: number): {
42
+ content: string;
43
+ pagination: {
44
+ nextCharOffset?: number;
45
+ charOffset: number;
46
+ charLength: number;
47
+ totalChars: number;
48
+ hasMore: boolean;
49
+ };
50
+ };
51
+ export declare function compactBody(value: unknown, max?: number): string | undefined;
52
+ export declare function baseQuery(query: QueryLike, prNumber: number): {
53
+ owner: string;
54
+ repo: string;
55
+ prNumber: number;
56
+ };
57
+ export declare function compactQuery(value: Record<string, unknown>): Record<string, unknown>;
58
+ export declare function continuationQuery(query: QueryLike, prNumber: number, patch: Record<string, unknown>): Record<string, unknown>;
59
+ export declare function textContinuationQuery(query: QueryLike, prNumber: number, content: Record<string, unknown>, pagination: TextPagination, extra?: Record<string, unknown>): Record<string, unknown> | undefined;
60
+ export declare function pageContinuationQuery(query: QueryLike, prNumber: number, content: Record<string, unknown>, pageKey: 'filePage' | 'commentPage' | 'commitPage', pagination: Pagination): Record<string, unknown> | undefined;
61
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
62
+ export declare function readPagination(value: unknown): Pagination | undefined;
63
+ export declare function readTextPagination(value: unknown): TextPagination | undefined;
@@ -1,17 +1,3 @@
1
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
- };
2
+ import { type QueryLike } from './contentResponse/pagination.js';
16
3
  export declare function shapePullRequestForContent(pr: Record<string, unknown>, query: QueryLike, request: NormalizedPrContentRequest, shouldMinify?: boolean, showContentMap?: boolean): Record<string, unknown>;
17
- export {};
@@ -0,0 +1,4 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
+ import type { ProcessedBulkResult } from '../../../types/toolResults.js';
3
+ import type { GitHubPullRequestSearchInput, GitHubPullRequestSearchQuery } from './types.js';
4
+ export declare function handleCommitsMode(query: GitHubPullRequestSearchInput, parsedData: GitHubPullRequestSearchQuery | undefined, authInfo: AuthInfo | undefined): Promise<ProcessedBulkResult>;
@@ -0,0 +1,4 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
+ import type { ProcessedBulkResult } from '../../../types/toolResults.js';
3
+ import type { GitHubPullRequestSearchInput, GitHubPullRequestSearchQuery } from './types.js';
4
+ export declare function handleIssuesMode(query: GitHubPullRequestSearchInput, parsedData: GitHubPullRequestSearchQuery | undefined, authInfo: AuthInfo | undefined): Promise<ProcessedBulkResult>;
@@ -0,0 +1,4 @@
1
+ import { createLazyProviderContext } from '../../providerExecution.js';
2
+ import type { ProcessedBulkResult } from '../../../types/toolResults.js';
3
+ import type { GitHubPullRequestSearchInput, GitHubPullRequestSearchQuery } from './types.js';
4
+ export declare function handlePullRequestsMode(query: GitHubPullRequestSearchInput, parsedData: GitHubPullRequestSearchQuery | undefined, getProviderContext: ReturnType<typeof createLazyProviderContext>): Promise<ProcessedBulkResult>;
@@ -0,0 +1,4 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
+ import type { ProcessedBulkResult } from '../../../types/toolResults.js';
3
+ import type { GitHubPullRequestSearchInput, GitHubPullRequestSearchQuery } from './types.js';
4
+ export declare function handleReleasesMode(query: GitHubPullRequestSearchInput, parsedData: GitHubPullRequestSearchQuery | undefined, authInfo: AuthInfo | undefined): Promise<ProcessedBulkResult>;
@@ -0,0 +1,6 @@
1
+ import type { z } from 'zod';
2
+ import { GitHubPullRequestSearchQueryLocalSchema } from '../scheme.js';
3
+ import type { WithOptionalMeta } from '../../../types/execution.js';
4
+ export type GitHubPullRequestSearchQuery = z.infer<typeof GitHubPullRequestSearchQueryLocalSchema>;
5
+ export type GitHubPullRequestSearchInput = z.input<typeof GitHubPullRequestSearchQueryLocalSchema>;
6
+ export type PartialPRQuery = WithOptionalMeta<GitHubPullRequestSearchQuery>;
@@ -1,7 +1,4 @@
1
1
  import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
- import type { z } from 'zod';
3
- import { GitHubPullRequestSearchQueryLocalSchema } from './scheme.js';
4
2
  import type { ToolExecutionArgs } from '../../types/execution.js';
5
- type GitHubPullRequestSearchInput = z.input<typeof GitHubPullRequestSearchQueryLocalSchema>;
3
+ import type { GitHubPullRequestSearchInput } from './execution/types.js';
6
4
  export declare function searchMultipleGitHubPullRequests(args: ToolExecutionArgs<GitHubPullRequestSearchInput>): Promise<CallToolResult>;
7
- export {};
@@ -221,7 +221,17 @@ export declare const GitHubSearchPullRequestsOutputLocalSchema: z.ZodObject<{
221
221
  id: z.ZodOptional<z.ZodString>;
222
222
  status: z.ZodOptional<z.ZodString>;
223
223
  data: z.ZodOptional<z.ZodObject<{
224
- pull_requests: z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$loose>>>;
224
+ pull_requests: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{}, z.core.$loose>]>>>;
225
+ issues: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{}, z.core.$loose>]>>>;
226
+ next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
227
+ tool: z.ZodString;
228
+ query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
229
+ why: z.ZodOptional<z.ZodString>;
230
+ confidence: z.ZodOptional<z.ZodEnum<{
231
+ exact: "exact";
232
+ heuristic: "heuristic";
233
+ }>>;
234
+ }, z.core.$strip>>>;
225
235
  }, z.core.$loose>>;
226
236
  }, z.core.$loose>>>;
227
237
  }, z.core.$loose>;
@@ -0,0 +1,39 @@
1
+ import type { RepoSearchVariantExecution, RepoSearchVariantLabel, SuccessfulRepoSearchVariant } from './queryVariants.js';
2
+ export declare function buildResultPagination(pagination: {
3
+ currentPage: number;
4
+ totalPages: number;
5
+ hasMore: boolean;
6
+ entriesPerPage?: number;
7
+ totalMatches?: number;
8
+ reportedTotalMatches?: number;
9
+ reachableTotalMatches?: number;
10
+ totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
11
+ totalMatchesCapped?: boolean;
12
+ }): {
13
+ nextPage?: number;
14
+ hasMore: boolean;
15
+ totalMatchesCapped?: boolean;
16
+ totalMatchesKind?: "exact" | "reported" | "lowerBound";
17
+ reachableTotalMatches?: number;
18
+ reportedTotalMatches?: number;
19
+ totalMatches?: number;
20
+ currentPage: number;
21
+ totalPages: number;
22
+ perPage: number;
23
+ };
24
+ export type EffectivePagination = {
25
+ currentPage: number;
26
+ totalPages: number;
27
+ hasMore: boolean;
28
+ entriesPerPage?: number;
29
+ totalMatches?: number;
30
+ reportedTotalMatches?: number;
31
+ reachableTotalMatches?: number;
32
+ totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
33
+ totalMatchesCapped?: boolean;
34
+ };
35
+ export declare function buildPartialFailureWarnings(failedVariants: readonly {
36
+ label: RepoSearchVariantLabel;
37
+ }[]): string[] | undefined;
38
+ export declare function buildMergedPagination(variants: SuccessfulRepoSearchVariant[], dedupedCount: number): EffectivePagination | undefined;
39
+ export declare function sumVariantRawResponseChars(variants: RepoSearchVariantExecution[]): number;
@@ -0,0 +1,38 @@
1
+ import type { z } from 'zod';
2
+ import type { GitHubReposSearchSingleQuerySchema } from '@octocodeai/octocode-core/schemas';
3
+ import type { RepoSearchResult as ProviderRepoSearchResult } from '../../../providers/types.js';
4
+ import type { ProviderOperationResult } from '../../providerExecution.js';
5
+ import type { WithOptionalMeta } from '../../../types/execution.js';
6
+ type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
7
+ export type RepositorySearchExtraFields = {
8
+ archived?: boolean;
9
+ visibility?: 'public' | 'private';
10
+ forks?: string;
11
+ license?: string;
12
+ goodFirstIssues?: string;
13
+ };
14
+ export type PartialReposSearchQuery = WithOptionalMeta<GitHubReposSearchSingleQuery> & RepositorySearchExtraFields;
15
+ export type RepoSearchVariantLabel = 'combined' | 'topics' | 'keywords';
16
+ export interface RepoSearchVariant {
17
+ label: RepoSearchVariantLabel;
18
+ query: PartialReposSearchQuery;
19
+ }
20
+ export interface RepoSearchVariantExecution {
21
+ label: RepoSearchVariantLabel;
22
+ query: PartialReposSearchQuery;
23
+ response: ProviderOperationResult<RepoSearchVariant, ProviderRepoSearchResult>['response'];
24
+ }
25
+ export type SuccessfulRepoSearchVariant = RepoSearchVariantExecution & {
26
+ response: Extract<ProviderOperationResult<RepoSearchVariant, ProviderRepoSearchResult>, {
27
+ response: {
28
+ data: ProviderRepoSearchResult;
29
+ };
30
+ }>['response'] & {
31
+ data: ProviderRepoSearchResult;
32
+ };
33
+ };
34
+ export declare function hasValidTopics(query: PartialReposSearchQuery): boolean;
35
+ export declare function hasValidKeywords(query: PartialReposSearchQuery): boolean;
36
+ export declare function hasValidRepositorySearchParams(query: PartialReposSearchQuery): boolean;
37
+ export declare function createSearchVariants(query: PartialReposSearchQuery): RepoSearchVariant[];
38
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { GitHubRepositoryOutput } from '@octocodeai/octocode-core/extra-types';
2
+ import type { PartialReposSearchQuery } from './queryVariants.js';
3
+ export declare function deduplicateRepositories(repositories: GitHubRepositoryOutput[]): GitHubRepositoryOutput[];
4
+ export declare function rankRepositoriesByRelevance(repositories: readonly GitHubRepositoryOutput[], query: PartialReposSearchQuery): GitHubRepositoryOutput[];
@@ -1,75 +1,7 @@
1
1
  import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
- import type { z } from 'zod';
3
- import type { GitHubReposSearchSingleQuerySchema } from '@octocodeai/octocode-core/schemas';
4
2
  import type { GitHubRepositoryOutput } from '@octocodeai/octocode-core/extra-types';
5
- type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
6
- import type { ToolExecutionArgs, WithOptionalMeta } from '../../types/execution.js';
7
- type RepositorySearchExtraFields = {
8
- archived?: boolean;
9
- visibility?: 'public' | 'private';
10
- forks?: string;
11
- license?: string;
12
- goodFirstIssues?: string;
13
- };
14
- type PartialReposSearchQuery = WithOptionalMeta<GitHubReposSearchSingleQuery> & RepositorySearchExtraFields;
3
+ import type { ToolExecutionArgs } from '../../types/execution.js';
4
+ import { type PartialReposSearchQuery } from './execution/queryVariants.js';
5
+ export { buildMergedPagination, buildPartialFailureWarnings, buildResultPagination, } from './execution/pagination.js';
15
6
  export declare function formatRepoLine(repo: GitHubRepositoryOutput): string;
16
- import type { RepoSearchResult as ProviderRepoSearchResult } from '../../providers/types.js';
17
- import { type ProviderOperationResult } from '../providerExecution.js';
18
- type RepoSearchVariantLabel = 'combined' | 'topics' | 'keywords';
19
- interface RepoSearchVariant {
20
- label: RepoSearchVariantLabel;
21
- query: PartialReposSearchQuery;
22
- }
23
- interface RepoSearchVariantExecution {
24
- label: RepoSearchVariantLabel;
25
- query: PartialReposSearchQuery;
26
- response: ProviderOperationResult<RepoSearchVariant, ProviderRepoSearchResult>['response'];
27
- }
28
- type SuccessfulRepoSearchVariant = RepoSearchVariantExecution & {
29
- response: Extract<ProviderOperationResult<RepoSearchVariant, ProviderRepoSearchResult>, {
30
- response: {
31
- data: ProviderRepoSearchResult;
32
- };
33
- }>['response'] & {
34
- data: ProviderRepoSearchResult;
35
- };
36
- };
37
- export declare function buildResultPagination(pagination: {
38
- currentPage: number;
39
- totalPages: number;
40
- hasMore: boolean;
41
- entriesPerPage?: number;
42
- totalMatches?: number;
43
- reportedTotalMatches?: number;
44
- reachableTotalMatches?: number;
45
- totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
46
- totalMatchesCapped?: boolean;
47
- }): {
48
- nextPage?: number;
49
- hasMore: boolean;
50
- totalMatchesCapped?: boolean;
51
- totalMatchesKind?: "exact" | "reported" | "lowerBound";
52
- reachableTotalMatches?: number;
53
- reportedTotalMatches?: number;
54
- totalMatches?: number;
55
- currentPage: number;
56
- totalPages: number;
57
- perPage: number;
58
- };
59
- type EffectivePagination = {
60
- currentPage: number;
61
- totalPages: number;
62
- hasMore: boolean;
63
- entriesPerPage?: number;
64
- totalMatches?: number;
65
- reportedTotalMatches?: number;
66
- reachableTotalMatches?: number;
67
- totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
68
- totalMatchesCapped?: boolean;
69
- };
70
- export declare function buildPartialFailureWarnings(failedVariants: readonly {
71
- label: RepoSearchVariantLabel;
72
- }[]): string[] | undefined;
73
- export declare function buildMergedPagination(variants: SuccessfulRepoSearchVariant[], dedupedCount: number): EffectivePagination | undefined;
74
7
  export declare function searchMultipleGitHubRepos(args: ToolExecutionArgs<PartialReposSearchQuery>): Promise<CallToolResult>;
75
- export {};
@@ -71,6 +71,14 @@ export declare const GitHubSearchRepositoriesOutputLocalSchema: z.ZodObject<{
71
71
  nextPage: z.ZodOptional<z.ZodNumber>;
72
72
  pageSize: z.ZodOptional<z.ZodNumber>;
73
73
  totalItems: z.ZodOptional<z.ZodNumber>;
74
+ perPage: z.ZodOptional<z.ZodNumber>;
75
+ totalFound: z.ZodOptional<z.ZodNumber>;
76
+ returned: z.ZodOptional<z.ZodNumber>;
77
+ totalMatches: z.ZodOptional<z.ZodNumber>;
78
+ reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
79
+ reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
80
+ totalResults: z.ZodOptional<z.ZodNumber>;
81
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
74
82
  totalMatchesKind: z.ZodOptional<z.ZodEnum<{
75
83
  exact: "exact";
76
84
  reported: "reported";
@@ -15,6 +15,8 @@ export interface GitHubRepositoryStructureResult {
15
15
  truncated: boolean;
16
16
  filtered: boolean;
17
17
  originalCount: number;
18
+ /** True when Git Trees reported truncation — listing may be incomplete. */
19
+ incompleteTree?: boolean;
18
20
  };
19
21
  structure: Record<string, GitHubRepoStructureDirectoryEntry>;
20
22
  fileSizeMap?: Record<string, Record<string, number>>;
@@ -0,0 +1,15 @@
1
+ import type { LocalGetFileContentToolResult } from '@octocodeai/octocode-core/extra-types';
2
+ import type { FetchContentQuery } from '../scheme.js';
3
+ export interface ExtractionState {
4
+ resultContent?: string;
5
+ isPartial: boolean;
6
+ actualStartLine?: number;
7
+ actualEndLine?: number;
8
+ matchRanges?: Array<{
9
+ start: number;
10
+ end: number;
11
+ }>;
12
+ warnings?: string[];
13
+ earlyResult?: LocalGetFileContentToolResult;
14
+ }
15
+ export declare function buildExtractionState(query: FetchContentQuery, content: string, _defaultOutputCharLength: number): ExtractionState;
@@ -0,0 +1,38 @@
1
+ import { applyPagination } from '../../../utils/pagination/core.js';
2
+ import type { LocalGetFileContentToolResult } from '@octocodeai/octocode-core/extra-types';
3
+ import type { FetchContentQuery } from '../scheme.js';
4
+ import { type FileStats } from './validation.js';
5
+ import type { ExtractionState } from './extraction.js';
6
+ export type ContentView = 'none' | 'standard' | 'symbols';
7
+ export interface ContentWindow {
8
+ /** The windowed (paginated) slice of the input content. */
9
+ windowedContent: string;
10
+ pagination: ReturnType<typeof applyPagination>;
11
+ /** Requested/auto page size (undefined when no windowing applies). */
12
+ effectiveCharLength: number | undefined;
13
+ /** Explicit charOffset requested by the caller (0 when absent). */
14
+ explicitCharOffset: number;
15
+ autoPaginated: boolean;
16
+ /** Warning emitted when the content was auto-paginated (else undefined). */
17
+ autoPaginateWarning?: string;
18
+ chunkMode: 'semantic' | 'char-limit';
19
+ nextBlockChar?: number;
20
+ /** Ready continuation query for the next char page (undefined when !hasMore). */
21
+ next?: {
22
+ continueChars: {
23
+ tool: 'localGetFileContent';
24
+ query: {
25
+ path: string;
26
+ charOffset: number;
27
+ charLength: number;
28
+ minify: FetchContentQuery['minify'];
29
+ };
30
+ };
31
+ };
32
+ /** Whether pagination fields should be emitted on the result. */
33
+ showPagination: boolean;
34
+ }
35
+ export declare function paginateContentWindow(content: string, query: FetchContentQuery, defaultOutputCharLength: number): Promise<ContentWindow>;
36
+ export declare function buildSuccessResult(query: FetchContentQuery, extraction: ExtractionState, fileStats: FileStats, totalLines: number, defaultOutputCharLength: number, shouldMinify?: boolean, contentView?: ContentView): Promise<LocalGetFileContentToolResult>;
37
+ export declare function buildSymbolsSkeletonResult(query: FetchContentQuery, skeleton: string, totalLines: number, sourceChars: number, sourceBytes: number, secretWarning: string | undefined, defaultOutputCharLength: number): Promise<LocalGetFileContentToolResult>;
38
+ export declare function withContentView(result: LocalGetFileContentToolResult, contentView: ContentView): LocalGetFileContentToolResult;
@@ -0,0 +1,26 @@
1
+ import { stat } from 'fs/promises';
2
+ import type { LocalGetFileContentToolResult } from '@octocodeai/octocode-core/extra-types';
3
+ import type { FetchContentQuery } from '../scheme.js';
4
+ export type FileStats = NonNullable<Awaited<ReturnType<typeof stat>>>;
5
+ export declare function sourceSizeFields(sourceChars: number, sourceBytes: number): {
6
+ sourceChars: number;
7
+ sourceBytes: number;
8
+ } | {
9
+ sourceChars: number;
10
+ sourceBytes?: undefined;
11
+ };
12
+ export declare function withSourceSize(result: LocalGetFileContentToolResult, sourceChars: number, sourceBytes: number): LocalGetFileContentToolResult;
13
+ export declare function validateExtractionOptions(query: FetchContentQuery): LocalGetFileContentToolResult | null;
14
+ export declare function getFileStatsOrError(query: FetchContentQuery, absolutePath: string): Promise<{
15
+ fileStats?: FileStats;
16
+ errorResult?: LocalGetFileContentToolResult;
17
+ }>;
18
+ export declare function shouldFailForLargeFile(query: FetchContentQuery, fileSizeKB: number): boolean;
19
+ export declare function createLargeFileErrorResult(query: FetchContentQuery, absolutePath: string, fileSizeKB: number): LocalGetFileContentToolResult;
20
+ export declare function createBinaryFileErrorResult(query: FetchContentQuery, absolutePath: string): LocalGetFileContentToolResult;
21
+ export declare function isLikelyBinaryFile(filePath: string): Promise<boolean>;
22
+ export declare function readFileContentOrError(query: FetchContentQuery, absolutePath: string): Promise<{
23
+ content?: string;
24
+ errorResult?: LocalGetFileContentToolResult;
25
+ }>;
26
+ export declare function createNoMatchesResult(_query: FetchContentQuery, totalLines: number): LocalGetFileContentToolResult;
@@ -1,4 +1,6 @@
1
1
  import type { LocalGetFileContentToolResult } from '@octocodeai/octocode-core/extra-types';
2
2
  import type { FetchContentQuery } from './scheme.js';
3
+ import { type ContentView } from './fetchContent/pagination.js';
4
+ export type { ContentView };
3
5
  export declare function fetchContent(query: FetchContentQuery): Promise<LocalGetFileContentToolResult>;
4
6
  export declare function finalizeFetchContentResult(result: LocalGetFileContentToolResult, _query: FetchContentQuery, _totalLines: number): LocalGetFileContentToolResult;