@octocodeai/octocode-tools-core 17.0.2 → 18.0.1

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 (218) hide show
  1. package/README.md +48 -38
  2. package/dist/direct.js +52 -35
  3. package/dist/github/canonicalRepo.d.ts +14 -0
  4. package/dist/github/codeSearch/matchPositions.d.ts +11 -0
  5. package/dist/github/codeSearch.d.ts +2 -1
  6. package/dist/github/compare.d.ts +42 -0
  7. package/dist/github/dateWindow.d.ts +4 -0
  8. package/dist/github/discussions.d.ts +45 -0
  9. package/dist/github/githubAPI.d.ts +7 -13
  10. package/dist/github/history/commitFiles.d.ts +39 -0
  11. package/dist/github/history.d.ts +1 -0
  12. package/dist/github/issues/types.d.ts +8 -8
  13. package/dist/github/prTransformation.d.ts +24 -25
  14. package/dist/github/queryBuilders/base.d.ts +0 -1
  15. package/dist/github/queryBuilders/issues.d.ts +0 -6
  16. package/dist/github/releases.d.ts +9 -1
  17. package/dist/github/responseHeaders.d.ts +6 -0
  18. package/dist/index.d.ts +7 -6
  19. package/dist/index.js +56 -39
  20. package/dist/providers/github/githubPullRequests.d.ts +9 -0
  21. package/dist/providers/github/paginationMetadata.d.ts +6 -5
  22. package/dist/providers/providerQueries.d.ts +11 -6
  23. package/dist/providers/providerResults.d.ts +9 -1
  24. package/dist/schema.d.ts +0 -1
  25. package/dist/schema.js +1 -2
  26. package/dist/scheme/pagination.d.ts +5 -13
  27. package/dist/scheme/responseEnvelope.d.ts +28 -22
  28. package/dist/security/bridge.d.ts +3 -2
  29. package/dist/shared/config/index.d.ts +0 -1
  30. package/dist/shared/config/index.js +1 -1
  31. package/dist/shared/languageSelectors/classify.d.ts +2 -2
  32. package/dist/shared/languageSelectors/data.d.ts +4 -4
  33. package/dist/shared/languageSelectors.d.ts +1 -1
  34. package/dist/shared/paths.d.ts +1 -4
  35. package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +10 -11
  36. package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +12 -0
  37. package/dist/tools/directToolCatalog.meta.d.ts +1 -0
  38. package/dist/tools/github_clone_repo/contentSize.d.ts +9 -0
  39. package/dist/tools/github_clone_repo/scheme.d.ts +26 -96
  40. package/dist/tools/github_fetch_content/finalizer/types.d.ts +2 -3
  41. package/dist/tools/github_fetch_content/scheme.d.ts +92 -140
  42. package/dist/tools/github_fetch_content/types.d.ts +2 -1
  43. package/dist/tools/github_search_code/scheme.d.ts +39 -87
  44. package/dist/tools/github_search_discussions/execution.d.ts +15 -0
  45. package/dist/tools/github_search_discussions/scheme.d.ts +16 -0
  46. package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +2 -16
  47. package/dist/tools/github_search_pull_requests/scheme.d.ts +97 -119
  48. package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +8 -0
  49. package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +216 -0
  50. package/dist/tools/github_search_pull_requests/types.d.ts +28 -29
  51. package/dist/tools/github_search_repos/execution.d.ts +0 -2
  52. package/dist/tools/github_search_repos/scheme.d.ts +36 -64
  53. package/dist/tools/github_view_repo_structure/scheme.d.ts +37 -66
  54. package/dist/tools/local_dead_code/deadCodeScan.d.ts +26 -0
  55. package/dist/tools/local_dead_code/entrypoints.d.ts +16 -0
  56. package/dist/tools/local_dead_code/execution.d.ts +4 -0
  57. package/dist/tools/local_dead_code/graphBuilder.d.ts +43 -0
  58. package/dist/tools/local_dead_code/importResolver.d.ts +6 -0
  59. package/dist/tools/local_dead_code/local_dead_code.d.ts +5 -0
  60. package/dist/tools/local_dead_code/reachability.d.ts +21 -0
  61. package/dist/tools/local_dead_code/retention.d.ts +22 -0
  62. package/dist/tools/local_dead_code/scheme.d.ts +51 -0
  63. package/dist/tools/local_dead_code/types.d.ts +56 -0
  64. package/dist/tools/local_fetch_content/execution.d.ts +0 -1
  65. package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +6 -0
  66. package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +9 -1
  67. package/dist/tools/local_fetch_content/fetchContent.d.ts +0 -1
  68. package/dist/tools/local_fetch_content/scheme.d.ts +28 -90
  69. package/dist/tools/local_find_files/execution.d.ts +0 -1
  70. package/dist/tools/local_find_files/findFiles.d.ts +0 -3
  71. package/dist/tools/local_find_files/findFilesNext.d.ts +26 -0
  72. package/dist/tools/local_find_files/pathPatternBraces.d.ts +20 -0
  73. package/dist/tools/local_find_files/scheme.d.ts +19 -81
  74. package/dist/tools/local_ripgrep/captureBudget.d.ts +25 -0
  75. package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +1 -0
  76. package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -0
  77. package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +1 -1
  78. package/dist/tools/local_ripgrep/scheme.d.ts +89 -190
  79. package/dist/tools/local_view_structure/execution.d.ts +0 -1
  80. package/dist/tools/local_view_structure/local_view_structure.d.ts +0 -1
  81. package/dist/tools/local_view_structure/scheme.d.ts +34 -87
  82. package/dist/tools/local_view_structure/structureFilters.d.ts +2 -4
  83. package/dist/tools/local_view_structure/structureResponse.d.ts +1 -0
  84. package/dist/tools/local_view_structure/viewStructureNext.d.ts +25 -0
  85. package/dist/tools/lsp/semantic_content/index.d.ts +2 -1
  86. package/dist/tools/lsp/semantic_content/scheme.d.ts +167 -642
  87. package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +8 -2
  88. package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +2 -1
  89. package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +17 -1
  90. package/dist/tools/lsp/semantic_content/semanticNext.d.ts +2 -0
  91. package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +1 -1
  92. package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +14 -2
  93. package/dist/tools/lsp/shared/semanticTypes.d.ts +14 -1
  94. package/dist/tools/package_search/execution.d.ts +9 -6
  95. package/dist/tools/package_search/queryHelpers.d.ts +8 -0
  96. package/dist/tools/package_search/scheme.d.ts +30 -86
  97. package/dist/tools/providerMappers/codeSearch.d.ts +0 -1
  98. package/dist/tools/providerMappers/pullRequests.d.ts +0 -13
  99. package/dist/tools/providerMappers/repoSearch.d.ts +1 -5
  100. package/dist/tools/providerMappers/repoStructure.d.ts +4 -0
  101. package/dist/tools/toolCatalogFactory.d.ts +25 -0
  102. package/dist/tools/toolConfig.d.ts +9 -24
  103. package/dist/tools/toolNames.d.ts +2 -2
  104. package/dist/tools/toolSchemaImports.d.ts +3 -1
  105. package/dist/types/execution.d.ts +1 -0
  106. package/dist/types/toolOutput.d.ts +38 -0
  107. package/dist/utils/contextUtils.d.ts +6 -0
  108. package/dist/utils/core/types.d.ts +4 -0
  109. package/dist/utils/jsSymbolNames.d.ts +6 -0
  110. package/package.json +4 -8
  111. package/dist/oql/adapters/compile.d.ts +0 -25
  112. package/dist/oql/adapters/github/execute.d.ts +0 -16
  113. package/dist/oql/adapters/github/provider-diagnostics.d.ts +0 -14
  114. package/dist/oql/adapters/github/shared.d.ts +0 -75
  115. package/dist/oql/adapters/github.d.ts +0 -14
  116. package/dist/oql/adapters/graphProof.d.ts +0 -6
  117. package/dist/oql/adapters/graphView/filters.d.ts +0 -25
  118. package/dist/oql/adapters/graphView/nativeEdges.d.ts +0 -5
  119. package/dist/oql/adapters/graphView.d.ts +0 -29
  120. package/dist/oql/adapters/local/code.d.ts +0 -3
  121. package/dist/oql/adapters/local/codeBoolean.d.ts +0 -3
  122. package/dist/oql/adapters/local/fileRowOps.d.ts +0 -11
  123. package/dist/oql/adapters/local/files.d.ts +0 -3
  124. package/dist/oql/adapters/local/filesBoolean.d.ts +0 -10
  125. package/dist/oql/adapters/local/filesContentLeaf.d.ts +0 -12
  126. package/dist/oql/adapters/local/filesUniverse.d.ts +0 -6
  127. package/dist/oql/adapters/local/findToolType.d.ts +0 -10
  128. package/dist/oql/adapters/local/predicates.d.ts +0 -18
  129. package/dist/oql/adapters/local/scope.d.ts +0 -14
  130. package/dist/oql/adapters/local/searchToolType.d.ts +0 -7
  131. package/dist/oql/adapters/local/structureContent.d.ts +0 -6
  132. package/dist/oql/adapters/local/types.d.ts +0 -34
  133. package/dist/oql/adapters/local.d.ts +0 -4
  134. package/dist/oql/adapters/materialize.d.ts +0 -11
  135. package/dist/oql/adapters/pagination.d.ts +0 -21
  136. package/dist/oql/adapters/researchTargets/diff.d.ts +0 -16
  137. package/dist/oql/adapters/researchTargets/graph.d.ts +0 -3
  138. package/dist/oql/adapters/researchTargets/history.d.ts +0 -20
  139. package/dist/oql/adapters/researchTargets/pagination.d.ts +0 -54
  140. package/dist/oql/adapters/researchTargets/repositories.d.ts +0 -4
  141. package/dist/oql/adapters/researchTargets/research.d.ts +0 -3
  142. package/dist/oql/adapters/researchTargets/rows.d.ts +0 -16
  143. package/dist/oql/adapters/researchTargets/semantics.d.ts +0 -3
  144. package/dist/oql/adapters/researchTargets/shared.d.ts +0 -11
  145. package/dist/oql/adapters/researchTargets.d.ts +0 -8
  146. package/dist/oql/adapters/resultMap.d.ts +0 -27
  147. package/dist/oql/adapters/ruleYaml.d.ts +0 -11
  148. package/dist/oql/adapters/runner.d.ts +0 -21
  149. package/dist/oql/capabilities.d.ts +0 -31
  150. package/dist/oql/defaults.d.ts +0 -26
  151. package/dist/oql/diagnostics.d.ts +0 -25
  152. package/dist/oql/diffLanes.d.ts +0 -29
  153. package/dist/oql/envelope.d.ts +0 -21
  154. package/dist/oql/features.d.ts +0 -7
  155. package/dist/oql/index.d.ts +0 -27
  156. package/dist/oql/index.js +0 -47
  157. package/dist/oql/normalize/batch.d.ts +0 -2
  158. package/dist/oql/normalize/materialize.d.ts +0 -2
  159. package/dist/oql/normalize/params.d.ts +0 -2
  160. package/dist/oql/normalize/query.d.ts +0 -2
  161. package/dist/oql/normalize/scope.d.ts +0 -2
  162. package/dist/oql/normalize/shared.d.ts +0 -7
  163. package/dist/oql/normalize/source.d.ts +0 -2
  164. package/dist/oql/normalize/where.d.ts +0 -2
  165. package/dist/oql/normalize.d.ts +0 -20
  166. package/dist/oql/planner/planDiagnostics.d.ts +0 -13
  167. package/dist/oql/planner/predicateRouting.d.ts +0 -35
  168. package/dist/oql/planner.d.ts +0 -7
  169. package/dist/oql/predicateUtils.d.ts +0 -3
  170. package/dist/oql/research/analyze/manifest-scan.d.ts +0 -4
  171. package/dist/oql/research/analyze/source-graph.d.ts +0 -7
  172. package/dist/oql/research/analyze/symbol-scoring.d.ts +0 -4
  173. package/dist/oql/research/analyze/types.d.ts +0 -163
  174. package/dist/oql/research/analyze/utils.d.ts +0 -16
  175. package/dist/oql/research/analyze.d.ts +0 -3
  176. package/dist/oql/research/packets/builders.d.ts +0 -4
  177. package/dist/oql/research/packets/types.d.ts +0 -91
  178. package/dist/oql/research/packets.d.ts +0 -21
  179. package/dist/oql/run/batch.d.ts +0 -3
  180. package/dist/oql/run/continuations/records.d.ts +0 -19
  181. package/dist/oql/run/continuations/registry.d.ts +0 -22
  182. package/dist/oql/run/continuations/semantics.d.ts +0 -3
  183. package/dist/oql/run/continuations/types.d.ts +0 -12
  184. package/dist/oql/run/dryRun.d.ts +0 -11
  185. package/dist/oql/run/paths.d.ts +0 -15
  186. package/dist/oql/run/proofGrades.d.ts +0 -8
  187. package/dist/oql/run/select.d.ts +0 -10
  188. package/dist/oql/run/single.d.ts +0 -22
  189. package/dist/oql/run.d.ts +0 -5
  190. package/dist/oql/schema/predicates.d.ts +0 -12
  191. package/dist/oql/schema.d.ts +0 -1049
  192. package/dist/oql/schemeText.d.ts +0 -152
  193. package/dist/oql/shorthand/predicates.d.ts +0 -15
  194. package/dist/oql/shorthand/query-controls.d.ts +0 -18
  195. package/dist/oql/shorthand/target-params.d.ts +0 -9
  196. package/dist/oql/shorthand/types.d.ts +0 -159
  197. package/dist/oql/shorthand/utils.d.ts +0 -7
  198. package/dist/oql/shorthand.d.ts +0 -8
  199. package/dist/oql/targetParams.d.ts +0 -7
  200. package/dist/oql/transformers/contract.d.ts +0 -19
  201. package/dist/oql/transformers/github/code.d.ts +0 -9
  202. package/dist/oql/transformers/github/common.d.ts +0 -14
  203. package/dist/oql/transformers/language.d.ts +0 -1
  204. package/dist/oql/transformers/registry.d.ts +0 -16
  205. package/dist/oql/transformers/types.d.ts +0 -11
  206. package/dist/oql/types/diagnostics.d.ts +0 -22
  207. package/dist/oql/types/envelope.d.ts +0 -78
  208. package/dist/oql/types/guards.d.ts +0 -9
  209. package/dist/oql/types/planner.d.ts +0 -46
  210. package/dist/oql/types/predicates.d.ts +0 -93
  211. package/dist/oql/types/query.d.ts +0 -143
  212. package/dist/oql/types/recordData.d.ts +0 -127
  213. package/dist/oql/types/recordRows.d.ts +0 -48
  214. package/dist/oql/types/results.d.ts +0 -118
  215. package/dist/oql/types/targets.d.ts +0 -22
  216. package/dist/oql/types.d.ts +0 -27
  217. package/dist/tools/oql_search/execution.d.ts +0 -7
  218. package/dist/tools/toolMetadata/descriptionOverrides.d.ts +0 -4
@@ -9,6 +9,12 @@ export interface ExtractionState {
9
9
  start: number;
10
10
  end: number;
11
11
  }>;
12
+ /**
13
+ * Exact matched-line numbers (as opposed to `matchRanges`, which are
14
+ * ±contextLines windows around them) — previously only readable by parsing
15
+ * the "Found ... on line N" prose in `warnings`.
16
+ */
17
+ matchedLines?: number[];
12
18
  warnings?: string[];
13
19
  earlyResult?: LocalGetFileContentToolResult;
14
20
  }
@@ -15,7 +15,15 @@ export declare function getFileStatsOrError(query: FetchContentQuery, absolutePa
15
15
  fileStats?: FileStats;
16
16
  errorResult?: LocalGetFileContentToolResult;
17
17
  }>;
18
- export declare function shouldFailForLargeFile(query: FetchContentQuery, fileSizeKB: number): boolean;
18
+ /**
19
+ * The effective minify mode a read will use, resolved the same way
20
+ * `fetchContent` resolves it: an explicit `minify` always wins; otherwise
21
+ * `fullContent`/a line range defaults to `'none'` (verbatim), and every other
22
+ * read defaults to `'standard'`. Exposed so the large-file gate can be
23
+ * computed from the *actual* read mode instead of duplicating this ternary.
24
+ */
25
+ export declare function resolveMinifyMode(query: FetchContentQuery): 'none' | 'standard' | 'symbols';
26
+ export declare function shouldFailForLargeFile(query: FetchContentQuery, fileSizeKB: number, minifyMode: 'none' | 'standard' | 'symbols'): boolean;
19
27
  export declare function createLargeFileErrorResult(query: FetchContentQuery, absolutePath: string, fileSizeKB: number): LocalGetFileContentToolResult;
20
28
  export declare function createBinaryFileErrorResult(query: FetchContentQuery, absolutePath: string): LocalGetFileContentToolResult;
21
29
  export declare function isLikelyBinaryFile(filePath: string): Promise<boolean>;
@@ -3,4 +3,3 @@ import type { FetchContentQuery } from './scheme.js';
3
3
  import { type ContentView } from './fetchContent/pagination.js';
4
4
  export type { ContentView };
5
5
  export declare function fetchContent(query: FetchContentQuery): Promise<LocalGetFileContentToolResult>;
6
- export declare function finalizeFetchContentResult(result: LocalGetFileContentToolResult, _query: FetchContentQuery, _totalLines: number): LocalGetFileContentToolResult;
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { type MinifyMode } from '../../scheme/fields.js';
3
+ import type { CharPagination, ItemPagination, ToolContinuation } from '../../scheme/pagination.js';
4
+ import type { BulkToolOutput } from '../../types/toolOutput.js';
3
5
  export declare const LocalFetchContentQuerySchema: z.ZodObject<{
4
6
  path: z.ZodString;
5
7
  fullContent: z.ZodOptional<z.ZodBoolean>;
@@ -29,93 +31,29 @@ export declare const LocalFetchContentBulkQuerySchema: z.ZodObject<{
29
31
  responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
30
32
  queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
31
33
  }, z.core.$strip>;
32
- export declare const LocalGetFileContentOutputSchema: z.ZodObject<{
33
- results: z.ZodArray<z.ZodObject<{
34
- id: z.ZodString;
35
- status: z.ZodOptional<z.ZodEnum<{
36
- empty: "empty";
37
- error: "error";
38
- }>>;
39
- data: z.ZodObject<{
40
- path: z.ZodOptional<z.ZodString>;
41
- content: z.ZodOptional<z.ZodString>;
42
- contentView: z.ZodOptional<z.ZodEnum<{
43
- none: "none";
44
- standard: "standard";
45
- symbols: "symbols";
46
- }>>;
47
- totalLines: z.ZodOptional<z.ZodNumber>;
48
- sourceChars: z.ZodOptional<z.ZodNumber>;
49
- sourceBytes: z.ZodOptional<z.ZodNumber>;
50
- startLine: z.ZodOptional<z.ZodNumber>;
51
- endLine: z.ZodOptional<z.ZodNumber>;
52
- isPartial: z.ZodOptional<z.ZodBoolean>;
53
- matchRanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
54
- start: z.ZodNumber;
55
- end: z.ZodNumber;
56
- }, z.core.$strip>>>;
57
- pagination: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
58
- charOffset: z.ZodNumber;
59
- charLength: z.ZodNumber;
60
- totalChars: z.ZodNumber;
61
- hasMore: z.ZodBoolean;
62
- nextCharOffset: z.ZodOptional<z.ZodNumber>;
63
- currentPage: z.ZodOptional<z.ZodNumber>;
64
- totalPages: z.ZodOptional<z.ZodNumber>;
65
- chunkMode: z.ZodOptional<z.ZodEnum<{
66
- semantic: "semantic";
67
- "char-limit": "char-limit";
68
- }>>;
69
- nextBlockChar: z.ZodOptional<z.ZodNumber>;
70
- }, z.core.$strip>, z.ZodObject<{
71
- currentPage: z.ZodNumber;
72
- totalPages: z.ZodNumber;
73
- hasMore: z.ZodBoolean;
74
- nextPage: z.ZodOptional<z.ZodNumber>;
75
- pageSize: z.ZodOptional<z.ZodNumber>;
76
- totalItems: z.ZodOptional<z.ZodNumber>;
77
- perPage: z.ZodOptional<z.ZodNumber>;
78
- totalFound: z.ZodOptional<z.ZodNumber>;
79
- returned: z.ZodOptional<z.ZodNumber>;
80
- totalMatches: z.ZodOptional<z.ZodNumber>;
81
- reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
82
- reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
83
- totalMatchesKind: z.ZodOptional<z.ZodEnum<{
84
- exact: "exact";
85
- reported: "reported";
86
- lowerBound: "lowerBound";
87
- }>>;
88
- totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
89
- totalResults: z.ZodOptional<z.ZodNumber>;
90
- itemsPerPage: z.ZodOptional<z.ZodNumber>;
91
- }, z.core.$strip>]>>;
92
- next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
93
- tool: z.ZodString;
94
- query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
95
- why: z.ZodOptional<z.ZodString>;
96
- confidence: z.ZodOptional<z.ZodEnum<{
97
- exact: "exact";
98
- heuristic: "heuristic";
99
- }>>;
100
- }, z.core.$strip>>>;
101
- modified: z.ZodOptional<z.ZodString>;
102
- lastModified: z.ZodOptional<z.ZodString>;
103
- lastModifiedBy: z.ZodOptional<z.ZodString>;
104
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
- matchNotFound: z.ZodOptional<z.ZodBoolean>;
106
- searchedFor: z.ZodOptional<z.ZodString>;
107
- }, z.core.$strip>;
108
- }, z.core.$strip>>;
109
- base: z.ZodOptional<z.ZodString>;
110
- shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
111
- responsePagination: z.ZodOptional<z.ZodObject<{
112
- currentPage: z.ZodNumber;
113
- totalPages: z.ZodNumber;
114
- hasMore: z.ZodBoolean;
115
- charOffset: z.ZodNumber;
116
- charLength: z.ZodNumber;
117
- totalChars: z.ZodNumber;
118
- nextCharOffset: z.ZodOptional<z.ZodNumber>;
119
- }, z.core.$strip>>;
120
- }, z.core.$strip>;
121
- export type LocalGetFileContentOutput = z.infer<typeof LocalGetFileContentOutputSchema>;
34
+ export interface FileContentMatchRange {
35
+ start: number;
36
+ end: number;
37
+ }
38
+ export interface LocalGetFileContentData {
39
+ path?: string;
40
+ content?: string;
41
+ contentView?: 'none' | 'standard' | 'symbols';
42
+ totalLines?: number;
43
+ sourceChars?: number;
44
+ sourceBytes?: number;
45
+ returnedChars?: number;
46
+ startLine?: number;
47
+ endLine?: number;
48
+ isPartial?: boolean;
49
+ matchRanges?: FileContentMatchRange[];
50
+ pagination?: (CharPagination & {
51
+ nextBlockChar?: number;
52
+ }) | ItemPagination;
53
+ next?: Record<string, ToolContinuation>;
54
+ modified?: string;
55
+ warnings?: string[];
56
+ matchNotFound?: boolean;
57
+ searchedFor?: string;
58
+ }
59
+ export type LocalGetFileContentOutput = BulkToolOutput<LocalGetFileContentData>;
@@ -1,5 +1,4 @@
1
1
  import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
2
  import { type FindFilesQuery } from './scheme.js';
3
3
  import type { ToolExecutionArgs } from '../../types/execution.js';
4
- export { finalizeFindFilesResult } from './findFiles.js';
5
4
  export declare function executeFindFiles(args: ToolExecutionArgs<FindFilesQuery>): Promise<CallToolResult>;
@@ -5,7 +5,4 @@ type UpstreamFindFilesQuery = z.infer<typeof FindFilesQuerySchema>;
5
5
  import type { WithOptionalMeta } from '../../types/execution.js';
6
6
  type FindFilesQuery = WithOptionalMeta<UpstreamFindFilesQuery>;
7
7
  export declare function findFiles(query: FindFilesQuery): Promise<LocalFindFilesToolResult>;
8
- export declare function finalizeFindFilesResult(result: LocalFindFilesToolResult, _query: FindFilesQuery, _totals: {
9
- totalFiles: number;
10
- }): LocalFindFilesToolResult;
11
8
  export {};
@@ -0,0 +1,26 @@
1
+ import type { LocalFindFilesEntry } from '@octocodeai/octocode-core/types';
2
+ type FindFilesNextCall = {
3
+ tool: 'localGetFileContent' | 'localViewStructure';
4
+ query: Record<string, unknown>;
5
+ why: string;
6
+ confidence?: 'exact' | 'high' | 'medium' | 'low';
7
+ };
8
+ export type FindFilesNextMap = {
9
+ fetch?: FindFilesNextCall;
10
+ viewStructure?: FindFilesNextCall;
11
+ };
12
+ /**
13
+ * Build per-result continuation hints for a localFindFiles response: point the
14
+ * agent at exact content for the first matched file, or into the first matched
15
+ * directory when the page is all directories. `nextPage` (pagination) is added
16
+ * separately by the caller.
17
+ *
18
+ * The queries carry the entry's absolute path, which the response
19
+ * path-relativizer deliberately leaves untouched inside `next` (see
20
+ * SKIP_TRAVERSAL_KEYS in utils/response/pathRelativize.ts), so the hint stays
21
+ * directly callable with no manual path conversion. Meta-free by construction:
22
+ * queries are built from the entry path alone, never spread from the caller
23
+ * query, so no auto-filled id/researchGoal/reasoning can leak in.
24
+ */
25
+ export declare function buildFindFilesNextMap(files: readonly LocalFindFilesEntry[]): FindFilesNextMap | undefined;
26
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { FileSystemQueryResult } from '../../utils/contextUtils.js';
2
+ /**
3
+ * Expand shell-style brace alternation (`{a,b,c}`) in a glob pattern into the
4
+ * cartesian product of concrete patterns. The native glob compiler (a
5
+ * hand-rolled glob-to-regex translator, see `octocode-engine`'s `fs_query.rs`)
6
+ * has no brace support — a pattern like `packages/{react,react-reconciler}/**`
7
+ * previously compiled to a regex that silently matched nothing, with no error.
8
+ * Returns the input unchanged as a single-element array when it has no brace
9
+ * groups, so patterns without braces see no behavior change.
10
+ */
11
+ export declare function expandBracePattern(pattern: string): string[];
12
+ /**
13
+ * Merge multiple native `queryFileSystem` results (one per expanded brace
14
+ * alternative) into a single result shape, deduping entries that matched more
15
+ * than one alternative. `totalDiscovered`/`skipped`/`permissionDenied` are
16
+ * summed per-walk (not deduped) — each expanded pattern walks the tree
17
+ * independently, so this is an upper bound on true unique discovery, not an
18
+ * exact count; `wasCapped` is true if any alternative hit its cap.
19
+ */
20
+ export declare function mergeFileSystemQueryResults(results: readonly FileSystemQueryResult[]): FileSystemQueryResult;
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { FindFilesQuerySchema as CoreFindFilesQuerySchema } from '@octocodeai/octocode-core/schemas';
3
+ import type { LocalItemPagination, ToolContinuation } from '../../scheme/pagination.js';
4
+ import type { BulkToolOutput } from '../../types/toolOutput.js';
3
5
  export type FindFilesQuery = Omit<z.infer<typeof CoreFindFilesQuerySchema>, 'regexType'>;
4
6
  export declare const LocalFindFilesQuerySchema: z.ZodType<FindFilesQuery>;
5
7
  export declare const LocalFindFilesBulkQuerySchema: z.ZodObject<{
@@ -7,84 +9,20 @@ export declare const LocalFindFilesBulkQuerySchema: z.ZodObject<{
7
9
  responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
8
10
  queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
9
11
  }, z.core.$strip>;
10
- export declare const LocalFindFilesOutputSchema: z.ZodObject<{
11
- results: z.ZodArray<z.ZodObject<{
12
- id: z.ZodString;
13
- status: z.ZodOptional<z.ZodEnum<{
14
- empty: "empty";
15
- error: "error";
16
- }>>;
17
- data: z.ZodObject<{
18
- path: z.ZodOptional<z.ZodString>;
19
- files: z.ZodOptional<z.ZodArray<z.ZodObject<{
20
- name: z.ZodOptional<z.ZodString>;
21
- path: z.ZodOptional<z.ZodString>;
22
- type: z.ZodOptional<z.ZodEnum<{
23
- file: "file";
24
- link: "link";
25
- directory: "directory";
26
- dir: "dir";
27
- symlink: "symlink";
28
- }>>;
29
- size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
30
- sizeFormatted: z.ZodOptional<z.ZodString>;
31
- modified: z.ZodOptional<z.ZodString>;
32
- accessed: z.ZodOptional<z.ZodString>;
33
- created: z.ZodOptional<z.ZodString>;
34
- permissions: z.ZodOptional<z.ZodString>;
35
- }, z.core.$strip>>>;
36
- summary: z.ZodOptional<z.ZodString>;
37
- pagination: z.ZodOptional<z.ZodObject<{
38
- currentPage: z.ZodNumber;
39
- totalPages: z.ZodNumber;
40
- hasMore: z.ZodBoolean;
41
- nextPage: z.ZodOptional<z.ZodNumber>;
42
- pageSize: z.ZodOptional<z.ZodNumber>;
43
- totalItems: z.ZodOptional<z.ZodNumber>;
44
- perPage: z.ZodOptional<z.ZodNumber>;
45
- totalFound: z.ZodOptional<z.ZodNumber>;
46
- returned: z.ZodOptional<z.ZodNumber>;
47
- reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
48
- reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
49
- totalMatchesKind: z.ZodOptional<z.ZodEnum<{
50
- exact: "exact";
51
- reported: "reported";
52
- lowerBound: "lowerBound";
53
- }>>;
54
- totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
55
- totalResults: z.ZodOptional<z.ZodNumber>;
56
- itemsPerPage: z.ZodOptional<z.ZodNumber>;
57
- filesPerPage: z.ZodOptional<z.ZodNumber>;
58
- entriesPerPage: z.ZodOptional<z.ZodNumber>;
59
- matchesPerPage: z.ZodOptional<z.ZodNumber>;
60
- totalFiles: z.ZodOptional<z.ZodNumber>;
61
- totalEntries: z.ZodOptional<z.ZodNumber>;
62
- totalMatches: z.ZodOptional<z.ZodNumber>;
63
- totalFilesFound: z.ZodOptional<z.ZodNumber>;
64
- nextMatchPage: z.ZodOptional<z.ZodNumber>;
65
- }, z.core.$strip>>;
66
- next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
67
- tool: z.ZodString;
68
- query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
69
- why: z.ZodOptional<z.ZodString>;
70
- confidence: z.ZodOptional<z.ZodEnum<{
71
- exact: "exact";
72
- heuristic: "heuristic";
73
- }>>;
74
- }, z.core.$strip>>>;
75
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
76
- }, z.core.$strip>;
77
- }, z.core.$strip>>;
78
- base: z.ZodOptional<z.ZodString>;
79
- shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
80
- responsePagination: z.ZodOptional<z.ZodObject<{
81
- currentPage: z.ZodNumber;
82
- totalPages: z.ZodNumber;
83
- hasMore: z.ZodBoolean;
84
- charOffset: z.ZodNumber;
85
- charLength: z.ZodNumber;
86
- totalChars: z.ZodNumber;
87
- nextCharOffset: z.ZodOptional<z.ZodNumber>;
88
- }, z.core.$strip>>;
89
- }, z.core.$strip>;
90
- export type LocalFindFilesOutput = z.infer<typeof LocalFindFilesOutputSchema>;
12
+ export interface LocalFindFilesEntryOutput {
13
+ name?: string;
14
+ path?: string;
15
+ type?: 'file' | 'dir' | 'directory' | 'link' | 'symlink';
16
+ size?: number | string;
17
+ sizeFormatted?: string;
18
+ modified?: string;
19
+ permissions?: string;
20
+ }
21
+ export interface LocalFindFilesData {
22
+ path?: string;
23
+ files?: LocalFindFilesEntryOutput[];
24
+ summary?: string;
25
+ pagination?: LocalItemPagination;
26
+ next?: Record<string, ToolContinuation>;
27
+ }
28
+ export type LocalFindFilesOutput = BulkToolOutput<LocalFindFilesData>;
@@ -0,0 +1,25 @@
1
+ export type MetavarRange = {
2
+ text: string;
3
+ line: number;
4
+ column: number;
5
+ endLine: number;
6
+ endColumn: number;
7
+ };
8
+ /**
9
+ * Apply the default capture budget to one match's metavar payload.
10
+ *
11
+ * `$$$` list captures (bodies, argument lists) serialize every statement
12
+ * TWICE (metavars text + metavarRanges text) — for a handful of function
13
+ * matches that is tens of KB of duplicated source an agent almost never
14
+ * needs: the ranges are the useful part (LSP anchors). Default policy:
15
+ * - `metavars`: keep single-entry captures (cheap, high-value anchors like
16
+ * `$NAME`), drop multi-entry list captures entirely.
17
+ * - `metavarRanges`: always keep (they are the anchors), but prune
18
+ * comment-only entries from list captures and truncate each entry's text
19
+ * to CAPTURE_TEXT_BUDGET chars (marked with `…`).
20
+ * `captureText:true` restores the verbatim engine payload.
21
+ */
22
+ export declare function budgetCaptures(metavars: Record<string, string[]> | undefined | null, metavarRanges: Record<string, MetavarRange[]> | undefined | null, captureText: boolean): {
23
+ metavars?: Record<string, string[]>;
24
+ metavarRanges?: Record<string, MetavarRange[]>;
25
+ };
@@ -32,6 +32,7 @@ export declare const RANK_WEIGHTS: {
32
32
  readonly extMatchesLangType: 2;
33
33
  readonly sourceDir: 1.5;
34
34
  readonly lowSignalPathPenalty: -5;
35
+ readonly testPathPenalty: -3.5;
35
36
  readonly rareQueryTokenScale: 2;
36
37
  readonly rareQueryTokenCap: 3;
37
38
  readonly matchCountScale: 1.5;
@@ -27,6 +27,7 @@ export interface RankResult {
27
27
  export declare function rankFiles(files: LocalSearchCodeFile[], sort: RankSort, ctx: RankContext, opts?: {
28
28
  debug?: boolean;
29
29
  candidateCap?: number;
30
+ sortReverse?: boolean;
30
31
  }): RankResult;
31
32
  export declare function matchesAny(patterns: readonly RegExp[], line: string): boolean;
32
33
  export declare function escapeRegex(s: string): string;
@@ -2,7 +2,7 @@ import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
2
2
  import type { RipgrepQuery } from '../scheme.js';
3
3
  import type { LocalSearchEngine } from './buildResult.js';
4
4
  type NextToolName = 'localGetFileContent' | 'lspGetSemantics' | 'localSearchCode';
5
- type NextConfidence = 'exact' | 'heuristic';
5
+ type NextConfidence = 'exact' | 'low';
6
6
  type SearchNextCall = {
7
7
  tool: NextToolName;
8
8
  query: Record<string, unknown>;