@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
@@ -0,0 +1,30 @@
1
+ import type { RepoSearchResult as ProviderRepoSearchResult } from '../../providers/types.js';
2
+ import type { z } from 'zod';
3
+ import type { GitHubReposSearchSingleQuerySchema } from '@octocodeai/octocode-core/schemas';
4
+ import type { GitHubRepositoryOutput } from '@octocodeai/octocode-core/extra-types';
5
+ import type { WithOptionalMeta } from '../../types/execution.js';
6
+ type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
7
+ export declare function mapRepoSearchToolQuery(query: WithOptionalMeta<GitHubReposSearchSingleQuery>): {
8
+ keywords: string[];
9
+ topics: string[];
10
+ owner: string;
11
+ stars: string;
12
+ size: string;
13
+ created: string;
14
+ updated: string;
15
+ language: string;
16
+ archived: boolean | undefined;
17
+ visibility: "public" | "private" | undefined;
18
+ forks: string | undefined;
19
+ license: string | undefined;
20
+ goodFirstIssues: string | undefined;
21
+ match: ("description" | "name" | "readme")[];
22
+ sort: "stars" | "forks" | "updated" | "created" | "best-match" | undefined;
23
+ limit: number | undefined;
24
+ page: number;
25
+ mainResearchGoal: string;
26
+ researchGoal: string;
27
+ reasoning: string;
28
+ };
29
+ export declare function mapRepoSearchProviderRepositories(repositories: ProviderRepoSearchResult['repositories']): GitHubRepositoryOutput[];
30
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { RepoStructureResult as ProviderRepoStructureResult } from '../../providers/types.js';
2
+ import type { z } from 'zod';
3
+ import type { GitHubViewRepoStructureQuerySchema } from '@octocodeai/octocode-core/schemas';
4
+ import type { WithOptionalMeta } from '../../types/execution.js';
5
+ type GitHubViewRepoStructureQuery = z.infer<typeof GitHubViewRepoStructureQuerySchema>;
6
+ type PartialRepoStructureQuery = WithOptionalMeta<GitHubViewRepoStructureQuery>;
7
+ export declare function mapRepoStructureToolQuery(query: PartialRepoStructureQuery, resolvedBranch: string): {
8
+ projectId: string;
9
+ ref: string;
10
+ path: string;
11
+ depth: number;
12
+ itemsPerPage: number;
13
+ page: number;
14
+ includeSizes: boolean;
15
+ mainResearchGoal: string;
16
+ researchGoal: string;
17
+ reasoning: string;
18
+ };
19
+ export declare function mapRepoStructureProviderResult(data: ProviderRepoStructureResult, _query: PartialRepoStructureQuery, filteredStructure: ProviderRepoStructureResult['structure'], resolvedBranch: string): Record<string, unknown>;
20
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Small helpers shared across the providerMappers/* domain files.
3
+ * Kept internal to the providerMappers module (not part of its public
4
+ * barrel contract) — imported directly by sibling files in this directory.
5
+ */
6
+ export declare function toProviderProjectId(owner?: string, repo?: string): string | undefined;
7
+ export declare function splitRepositoryPath(repositoryPath: string): {
8
+ owner: string;
9
+ repo: string;
10
+ };
11
+ export declare function countMetadata(pagination: {
12
+ reportedTotalMatches?: number;
13
+ reachableTotalMatches?: number;
14
+ totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
15
+ totalMatchesCapped?: boolean;
16
+ uniqueFileCount?: number;
17
+ } | undefined): {
18
+ uniqueFileCount?: number;
19
+ totalMatchesCapped?: boolean;
20
+ totalMatchesKind?: "exact" | "reported" | "lowerBound";
21
+ reachableTotalMatches?: number;
22
+ reportedTotalMatches?: number;
23
+ };
@@ -1,296 +1,11 @@
1
- import type { CodeSearchResult, FileContentResult as ProviderFileContentResult, PullRequestSearchResult as ProviderPullRequestSearchResult, RepoSearchResult as ProviderRepoSearchResult, RepoStructureResult as ProviderRepoStructureResult } from '../providers/types.js';
2
- import type { z } from 'zod';
3
- import type { GitHubCodeSearchQuerySchema, GitHubReposSearchSingleQuerySchema, GitHubViewRepoStructureQuerySchema } from '@octocodeai/octocode-core/schemas';
4
- import type { GitHubPullRequestSearchQueryLocalSchema } from './github_search_pull_requests/scheme.js';
5
- import type { GitHubRepositoryOutput } from '@octocodeai/octocode-core/extra-types';
6
- import type { WithOptionalMeta } from '../types/execution.js';
7
- import { FileContentQueryLocalSchema } from './github_fetch_content/scheme.js';
8
- type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
9
- type LocalFileContentQuery = z.infer<typeof FileContentQueryLocalSchema> & {
10
- minify: import('../scheme/fields.js').MinifyMode;
11
- };
12
1
  /**
13
- * Char-boundary truncation mirroring the Rust engine's `truncate_unicode`:
14
- * keeps at most `maxChars` Unicode scalars and appends `...` when it cuts.
15
- * Never slices UTF-8 mid-codepoint or mid-token the single data-layer bound
16
- * for GitHub code-search match fragments (the render layer must not re-trim).
2
+ * Barrel re-exporting the provider<->tool mapping helpers, split by domain
3
+ * under ./providerMappers/*. Kept as a thin re-export so existing imports
4
+ * from '../providerMappers.js' (and `export *` from src/index.ts) continue
5
+ * to resolve without any consumer changes.
17
6
  */
18
- export declare function truncateSnippetChars(value: string, maxChars?: number): string;
19
- type GitHubPullRequestSearchQuery = z.infer<typeof GitHubPullRequestSearchQueryLocalSchema>;
20
- type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
21
- type GitHubViewRepoStructureQuery = z.infer<typeof GitHubViewRepoStructureQuerySchema>;
22
- type PRDefaultKeys = 'order' | 'limit' | 'page';
23
- type PartialPRQuery = WithOptionalMeta<Omit<GitHubPullRequestSearchQuery, PRDefaultKeys> & Partial<Pick<GitHubPullRequestSearchQuery, PRDefaultKeys>>>;
24
- type PartialRepoStructureQuery = WithOptionalMeta<GitHubViewRepoStructureQuery>;
25
- export declare function buildPaginationHints(pagination: {
26
- currentPage: number;
27
- totalPages: number;
28
- hasMore: boolean;
29
- entriesPerPage?: number;
30
- perPage?: number;
31
- totalMatches?: number;
32
- reportedTotalMatches?: number;
33
- reachableTotalMatches?: number;
34
- totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
35
- totalMatchesCapped?: boolean;
36
- }, label: string): string[];
37
- export declare function mapCodeSearchToolQuery(query: WithOptionalMeta<GitHubCodeSearchQuery>): {
38
- keywords: string[];
39
- projectId: string;
40
- owner: string;
41
- path: string;
42
- filename: string;
43
- extension: string;
44
- language: string | undefined;
45
- match: "file" | "path";
46
- limit: number | undefined;
47
- page: number;
48
- mainResearchGoal: string;
49
- researchGoal: string;
50
- reasoning: string;
51
- };
52
- export interface CodeSearchGroupedMatch {
53
- path: string;
54
- value?: string;
55
- pathOnly?: boolean;
56
- matchIndices?: Array<{
57
- start: number;
58
- end: number;
59
- lineOffset: number;
60
- }>;
61
- url?: string;
62
- }
63
- export interface CodeSearchGroupedResult {
64
- id: string;
65
- queryId?: string;
66
- owner: string;
67
- repo: string;
68
- matches: CodeSearchGroupedMatch[];
69
- }
70
- export interface CodeSearchPagination {
71
- currentPage: number;
72
- totalPages: number;
73
- perPage: number;
74
- totalMatches: number;
75
- reportedTotalMatches?: number;
76
- reachableTotalMatches?: number;
77
- totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
78
- totalMatchesCapped?: boolean;
79
- hasMore: boolean;
80
- nextPage?: number;
81
- uniqueFileCount?: number;
82
- }
83
- export interface CodeSearchFlatResult {
84
- results: CodeSearchGroupedResult[];
85
- pagination?: CodeSearchPagination;
86
- nonExistentScope?: boolean;
87
- incompleteResults?: boolean;
88
- }
89
- export declare function mapCodeSearchProviderResult(data: CodeSearchResult, query: WithOptionalMeta<GitHubCodeSearchQuery>): CodeSearchFlatResult;
90
- export declare function mapRepoSearchToolQuery(query: WithOptionalMeta<GitHubReposSearchSingleQuery>): {
91
- keywords: string[];
92
- topics: string[];
93
- owner: string;
94
- stars: string;
95
- size: string;
96
- created: string;
97
- updated: string;
98
- language: string;
99
- archived: boolean | undefined;
100
- visibility: "public" | "private" | undefined;
101
- forks: string | undefined;
102
- license: string | undefined;
103
- goodFirstIssues: string | undefined;
104
- match: ("description" | "name" | "readme")[];
105
- sort: "stars" | "forks" | "updated" | "created" | "best-match" | undefined;
106
- limit: number | undefined;
107
- page: number;
108
- mainResearchGoal: string;
109
- researchGoal: string;
110
- reasoning: string;
111
- };
112
- export declare function mapRepoSearchProviderRepositories(repositories: ProviderRepoSearchResult['repositories']): GitHubRepositoryOutput[];
113
- export declare function mapPullRequestToolQuery(query: PartialPRQuery): {
114
- projectId: string;
115
- owner: string;
116
- query: string;
117
- number: number;
118
- state: "open" | "closed" | "merged" | "all" | undefined;
119
- author: string;
120
- assignee: string;
121
- commenter: string;
122
- involves: string;
123
- mentions: string;
124
- reviewRequested: string;
125
- reviewedBy: string;
126
- labels: string[];
127
- noLabel: boolean;
128
- noMilestone: boolean;
129
- noProject: boolean;
130
- noAssignee: boolean;
131
- baseBranch: string;
132
- headBranch: string;
133
- created: string;
134
- updated: string;
135
- closed: string;
136
- mergedAt: string;
137
- comments: string;
138
- reactions: string;
139
- interactions: string;
140
- draft: boolean;
141
- match: ("title" | "comments" | "body")[];
142
- milestone: string;
143
- language: string;
144
- checks: "success" | "failure" | "pending";
145
- review: "none" | "approved" | "changes_requested" | "required";
146
- locked: boolean;
147
- visibility: "public" | "private";
148
- teamMentions: string;
149
- project: string;
150
- archived: boolean | undefined;
151
- content: unknown;
152
- reviewMode: "full" | "summary";
153
- filePage: number;
154
- commentPage: number;
155
- commitPage: number;
156
- itemsPerPage: number;
157
- sort: "created" | "updated" | "best-match" | "comments" | "reactions" | undefined;
158
- order: "asc" | "desc" | undefined;
159
- limit: number;
160
- page: number;
161
- charOffset: number;
162
- charLength: number;
163
- mainResearchGoal: string;
164
- researchGoal: string;
165
- reasoning: string;
166
- };
167
- export declare function mapPullRequestProviderResultData(data: ProviderPullRequestSearchResult, options?: {
168
- includeFileChanges?: boolean;
169
- }): {
170
- pullRequests: {
171
- sanitizationWarnings?: string[];
172
- fileChanges?: {
173
- path: string;
174
- status: string;
175
- additions: number;
176
- deletions: number;
177
- patch?: string;
178
- }[];
179
- reviewSummary: {
180
- totalComments: number;
181
- inlineComments: number;
182
- discussionComments: number;
183
- commenters: string[];
184
- latestCommentAt?: string;
185
- themes: string[];
186
- };
187
- commits: {
188
- sha: string;
189
- message: string;
190
- author: string;
191
- date: string;
192
- }[];
193
- reviews: {
194
- id: string;
195
- user: string;
196
- state: string;
197
- body: string;
198
- submittedAt?: string;
199
- commitId?: string;
200
- }[];
201
- comments: {
202
- bodyPagination: {
203
- charOffset: number;
204
- charLength: number;
205
- totalChars: number;
206
- hasMore: boolean;
207
- nextCharOffset?: number;
208
- };
209
- id: string;
210
- author: string;
211
- body: string;
212
- createdAt: string;
213
- updatedAt: string;
214
- commentType?: "discussion" | "review_inline";
215
- path?: string;
216
- line?: number;
217
- in_reply_to_id?: number;
218
- }[];
219
- url: string;
220
- state: "open" | "closed" | "merged";
221
- draft: boolean;
222
- author: string;
223
- assignees: string[];
224
- labels: string[];
225
- sourceBranch: string;
226
- targetBranch: string;
227
- sourceSha: string;
228
- targetSha: string;
229
- createdAt: string;
230
- updatedAt: string;
231
- closedAt: string;
232
- mergedAt: string;
233
- commentsCount: number;
234
- changedFilesCount: number;
235
- additions: number;
236
- deletions: number;
237
- bodyPagination: {
238
- charOffset: number;
239
- charLength: number;
240
- totalChars: number;
241
- hasMore: boolean;
242
- nextCharOffset?: number;
243
- };
244
- number: number;
245
- title: string;
246
- body: string;
247
- }[];
248
- resultData: Record<string, unknown>;
249
- pagination: {
250
- nextPage?: number;
251
- hasMore: boolean;
252
- uniqueFileCount?: number;
253
- totalMatchesCapped?: boolean;
254
- totalMatchesKind?: "exact" | "reported" | "lowerBound";
255
- reachableTotalMatches?: number;
256
- reportedTotalMatches?: number;
257
- totalMatches?: number;
258
- currentPage: number;
259
- totalPages: number;
260
- perPage: number;
261
- };
262
- };
263
- export declare function mapFileContentToolQuery(query: LocalFileContentQuery): {
264
- projectId: string;
265
- path: string;
266
- ref: string;
267
- startLine: number;
268
- endLine: number;
269
- matchString: string;
270
- contextLines: number;
271
- fullContent: boolean;
272
- forceRefresh: boolean;
273
- charOffset: number;
274
- charLength: number;
275
- minify: "none" | "standard" | "symbols";
276
- matchStringIsRegex: boolean;
277
- matchStringCaseSensitive: boolean;
278
- mainResearchGoal: string;
279
- researchGoal: string;
280
- reasoning: string;
281
- };
282
- export declare function mapFileContentProviderResult(data: ProviderFileContentResult, query: WithOptionalMeta<LocalFileContentQuery>): Record<string, unknown>;
283
- export declare function mapRepoStructureToolQuery(query: PartialRepoStructureQuery, resolvedBranch: string): {
284
- projectId: string;
285
- ref: string;
286
- path: string;
287
- depth: number;
288
- itemsPerPage: number;
289
- page: number;
290
- includeSizes: boolean;
291
- mainResearchGoal: string;
292
- researchGoal: string;
293
- reasoning: string;
294
- };
295
- export declare function mapRepoStructureProviderResult(data: ProviderRepoStructureResult, _query: PartialRepoStructureQuery, filteredStructure: ProviderRepoStructureResult['structure'], resolvedBranch: string): Record<string, unknown>;
296
- export {};
7
+ export * from './providerMappers/codeSearch.js';
8
+ export * from './providerMappers/repoSearch.js';
9
+ export * from './providerMappers/pullRequests.js';
10
+ export * from './providerMappers/fileContent.js';
11
+ export * from './providerMappers/repoStructure.js';
@@ -19,7 +19,6 @@ export interface ToolConfig {
19
19
  isDefault: boolean;
20
20
  isLocal: boolean;
21
21
  isClone?: boolean;
22
- isBinary?: boolean;
23
22
  type: 'search' | 'content' | 'history' | 'debug';
24
23
  skipMetadataCheck?: boolean;
25
24
  direct: ToolDirectExecutionConfig;
@@ -37,6 +36,5 @@ export declare const LOCAL_VIEW_STRUCTURE: ToolConfig;
37
36
  export declare const LOCAL_FIND_FILES: ToolConfig;
38
37
  export declare const LOCAL_FETCH_CONTENT: ToolConfig;
39
38
  export declare const LSP_GET_SEMANTIC_CONTENT: ToolConfig;
40
- export declare const LOCAL_BINARY_INSPECT: ToolConfig;
41
39
  export declare const OQL_SEARCH: ToolConfig;
42
40
  export declare const ALL_TOOLS: ToolConfig[];
@@ -0,0 +1,4 @@
1
+ import type { CompleteMetadata } from '@octocodeai/octocode-core/types';
2
+ export declare function getPatchedToolMetadata(source?: CompleteMetadata): CompleteMetadata;
3
+ /** Test helper — clear memoization between cases. */
4
+ export declare function _resetDescriptionOverrideCache(): void;
@@ -0,0 +1,13 @@
1
+ export { CloneRepoQueryLocalSchema, BulkCloneRepoLocalSchema, } from './github_clone_repo/scheme.js';
2
+ export { FileContentQueryLocalSchema, FileContentBulkQueryLocalSchema, } from './github_fetch_content/scheme.js';
3
+ export { GitHubCodeSearchQueryLocalSchema, GitHubCodeSearchBulkQueryLocalSchema, } from './github_search_code/scheme.js';
4
+ export { GitHubPullRequestSearchQueryLocalSchema, GitHubPullRequestSearchBulkQueryLocalSchema, } from './github_search_pull_requests/scheme.js';
5
+ export { GitHubReposSearchSingleQueryLocalSchema, GitHubReposSearchBulkQueryLocalSchema, } from './github_search_repos/scheme.js';
6
+ export { GitHubViewRepoStructureQueryLocalSchema, GitHubViewRepoStructureBulkQueryLocalSchema, } from './github_view_repo_structure/scheme.js';
7
+ export { NpmSearchQueryLocalSchema, NpmSearchBulkQueryLocalSchema, } from './package_search/scheme.js';
8
+ export { LocalFetchContentQuerySchema, LocalFetchContentBulkQuerySchema, } from './local_fetch_content/scheme.js';
9
+ export { LocalFindFilesQuerySchema, LocalFindFilesBulkQuerySchema, } from './local_find_files/scheme.js';
10
+ export { LocalRipgrepQuerySchema, LocalRipgrepBulkQuerySchema, } from './local_ripgrep/scheme.js';
11
+ export { LocalViewStructureQuerySchema, LocalViewStructureBulkQuerySchema, } from './local_view_structure/scheme.js';
12
+ export { BulkLspGetSemanticsQuerySchema, LspGetSemanticsQueryDisplaySchema, } from './lsp/semantic_content/scheme.js';
13
+ export { OqlDisplayQuerySchema as OqlSearchQuerySchema, OqlSearchInputSchema, } from '../oql/schema.js';
@@ -1,5 +1,5 @@
1
1
  import type * as NativeContextUtils from '@octocodeai/octocode-engine';
2
- export type { BinaryInspectInfo, BinaryStrings, ExtractMatchingLinesOptions, ExtractMatchingLinesResult, FilterPatchOptions, FileSystemEntry, FileSystemQueryOptions, FileSystemQueryResult, GraphFactCapability, GraphFactCall, GraphFactDeclaration, GraphFactEdge, GraphFactExport, GraphFactImport, GraphFacts, MinifyResult, JsonInput, RipgrepParseOptions, RipgrepParseResult, RipgrepSearchOptions, SliceContentOptions, SliceContentResult, StructuralMatch, YamlConversionConfig, } from '@octocodeai/octocode-engine';
2
+ export type { ExtractMatchingLinesOptions, ExtractMatchingLinesResult, FilterPatchOptions, FileSystemEntry, FileSystemQueryOptions, FileSystemQueryResult, GraphFactCapability, GraphFactCall, GraphFactDeclaration, GraphFactEdge, GraphFactExport, GraphFactImport, GraphFacts, LineDiffOp, MinifyResult, JsonInput, RipgrepParseOptions, RipgrepParseResult, RipgrepSearchOptions, SliceContentOptions, SliceContentResult, StructuralMatch, YamlConversionConfig, } from '@octocodeai/octocode-engine';
3
3
  type NativeContextUtilsModule = typeof NativeContextUtils;
4
4
  type NativeLoader = () => NativeContextUtilsModule;
5
5
  export declare class ContextUtilsLoadError extends Error {
@@ -47,29 +47,18 @@ export declare const contextUtils: {
47
47
  * Native graph-fact capability matrix as a JSON `GraphFactCapability[]`.
48
48
  */
49
49
  getGraphFactCapabilities(): string;
50
- structuralSearch(content: string, filePath: string, pattern?: string | null, rule?: string | null): NativeContextUtils.StructuralMatch[];
51
- structuralSearchFiles(options: NativeContextUtils.StructuralSearchFilesOptions): NativeContextUtils.StructuralSearchFilesResult;
50
+ structuralSearch(content: string, filePath: string, pattern?: string | null, rule?: string | null): Promise<NativeContextUtils.StructuralMatch[]>;
51
+ structuralSearchFiles(options: NativeContextUtils.StructuralSearchFilesOptions): Promise<NativeContextUtils.StructuralSearchFilesResult>;
52
52
  getSupportedStructuralExtensions(): string[];
53
- /**
54
- * Native binary inspection (format lane). Parses an executable / object /
55
- * archive and returns identity + symbols/imports/exports/sections/deps.
56
- * Degrades to magic-byte identity on malformed input; only unreadable or
57
- * oversized files throw.
58
- */
59
- inspectBinaryNative(path: string): NativeContextUtils.BinaryInspectInfo;
60
- /**
61
- * Native strings extraction — printable ASCII + UTF-16 (LE/BE) runs of at
62
- * least `minLength`, longest-first, optionally hex offset-prefixed.
63
- */
64
- extractBinaryStringsNative(path: string, minLength: number, includeOffsets: boolean, scanOffset?: number): NativeContextUtils.BinaryStrings;
65
53
  validateRipgrepPattern(pattern: string, fixedString?: boolean | null, perlRegex?: boolean | null): NativeContextUtils.RipgrepPatternValidationResult;
66
- getSemanticBoundaryOffsets(content: string, filePath: string): number[];
54
+ getSemanticBoundaryOffsets(content: string, filePath: string): Promise<number[]>;
67
55
  jsonToYamlString(jsonObject: NativeContextUtils.JsonInput, config?: NativeContextUtils.YamlConversionConfig | null): string;
68
56
  parseRipgrepJson(stdout: string, options?: NativeContextUtils.RipgrepParseOptions | null): NativeContextUtils.RipgrepParseResult;
69
57
  searchRipgrep(options: NativeContextUtils.RipgrepSearchOptions): Promise<NativeContextUtils.RipgrepParseResult>;
70
58
  queryFileSystem(options: NativeContextUtils.FileSystemQueryOptions): NativeContextUtils.FileSystemQueryResult;
71
59
  extractMatchingLines(content: string, pattern: string, options?: NativeContextUtils.ExtractMatchingLinesOptions | null): NativeContextUtils.ExtractMatchingLinesResult;
72
60
  filterPatch(patch: string, options?: NativeContextUtils.FilterPatchOptions | null): string;
61
+ computeLineDiff(oldText: string, newText: string): NativeContextUtils.LineDiffOp[];
73
62
  charToByteOffset(content: string, charIndex: number): number;
74
63
  byteToCharOffset(content: string, byteOffset: number): number;
75
64
  byteSliceContent(content: string, byteStart: number, byteEnd: number): string;
@@ -19,30 +19,8 @@ export interface ExecOptions {
19
19
  */
20
20
  tolerateOutputLimit?: boolean;
21
21
  }
22
- export interface PaginationInfo {
23
- currentPage: number;
24
- totalPages: number;
25
- hasMore: boolean;
26
- nextPage?: number;
27
- nextMatchPage?: number;
28
- charOffset?: number;
29
- charLength?: number;
30
- totalChars?: number;
31
- chunkMode?: 'semantic' | 'char-limit';
32
- nextBlockChar?: number;
33
- perPage?: number;
34
- itemsPerPage?: number;
35
- filesPerPage?: number;
36
- totalFiles?: number;
37
- entriesPerPage?: number;
38
- totalEntries?: number;
39
- matchesPerPage?: number;
40
- totalMatches?: number;
41
- reportedTotalMatches?: number;
42
- reachableTotalMatches?: number;
43
- totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
44
- totalMatchesCapped?: boolean;
45
- }
22
+ /** Canonical pagination type — single source in types/toolResults.ts. */
23
+ export type { PaginationInfo } from '../../types/toolResults.js';
46
24
  export interface SearchStats {
47
25
  totalOccurrences?: number;
48
26
  totalStructuralMatches?: number;
@@ -0,0 +1,5 @@
1
+ export declare const SENSITIVE_ENV_VARS: readonly ["NODE_OPTIONS", "GITHUB_TOKEN", "GH_TOKEN", "OCTOCODE_TOKEN", "GITHUB_PERSONAL_ACCESS_TOKEN", "NPM_TOKEN", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"];
2
+ export declare const CORE_ALLOWED_ENV_VARS: readonly ["PATH", "TMPDIR", "TMP", "TEMP", "SYSTEMROOT", "WINDIR", "COMSPEC", "PATHEXT"];
3
+ export declare const TOOLING_ALLOWED_ENV_VARS: readonly ["PATH", "TMPDIR", "TMP", "TEMP", "SYSTEMROOT", "WINDIR", "COMSPEC", "PATHEXT", "HOME", "USERPROFILE", "APPDATA", "LOCALAPPDATA"];
4
+ export declare const PROXY_ENV_VARS: readonly ["HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy"];
5
+ export declare function buildChildProcessEnv(envOverrides?: Record<string, string | undefined>, allowEnvVars?: readonly string[]): typeof process.env;
@@ -0,0 +1,29 @@
1
+ interface SpawnWithTimeoutOptions {
2
+ timeout?: number;
3
+ cwd?: string;
4
+ env?: Record<string, string | undefined>;
5
+ allowEnvVars?: readonly string[];
6
+ maxOutputSize?: number;
7
+ }
8
+ interface SpawnResult {
9
+ stdout: string;
10
+ stderr: string;
11
+ exitCode: number | null;
12
+ success: boolean;
13
+ error?: Error;
14
+ timedOut?: boolean;
15
+ outputLimitExceeded?: boolean;
16
+ }
17
+ export declare function spawnWithTimeout(command: string, args: string[], options?: SpawnWithTimeoutOptions): Promise<SpawnResult>;
18
+ export declare function spawnCheckSuccess(command: string, args: string[], timeoutMs?: number, options?: {
19
+ allowEnvVars?: readonly string[];
20
+ }): Promise<boolean>;
21
+ export declare function spawnCollectStdout(command: string, args: string[], timeoutMs?: number, options?: {
22
+ allowEnvVars?: readonly string[];
23
+ maxOutputSize?: number;
24
+ }): Promise<string | null>;
25
+ export declare function validateArgs(args: string[], maxLength?: number): {
26
+ valid: boolean;
27
+ error?: string;
28
+ };
29
+ export {};
@@ -1,34 +1,2 @@
1
- interface SpawnWithTimeoutOptions {
2
- timeout?: number;
3
- cwd?: string;
4
- env?: Record<string, string | undefined>;
5
- allowEnvVars?: readonly string[];
6
- maxOutputSize?: number;
7
- }
8
- export declare const SENSITIVE_ENV_VARS: readonly ["NODE_OPTIONS", "GITHUB_TOKEN", "GH_TOKEN", "OCTOCODE_TOKEN", "GITHUB_PERSONAL_ACCESS_TOKEN", "NPM_TOKEN", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"];
9
- export declare const CORE_ALLOWED_ENV_VARS: readonly ["PATH", "TMPDIR", "TMP", "TEMP", "SYSTEMROOT", "WINDIR", "COMSPEC", "PATHEXT"];
10
- export declare const TOOLING_ALLOWED_ENV_VARS: readonly ["PATH", "TMPDIR", "TMP", "TEMP", "SYSTEMROOT", "WINDIR", "COMSPEC", "PATHEXT", "HOME", "USERPROFILE", "APPDATA", "LOCALAPPDATA"];
11
- export declare const PROXY_ENV_VARS: readonly ["HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy"];
12
- export declare function buildChildProcessEnv(envOverrides?: Record<string, string | undefined>, allowEnvVars?: readonly string[]): typeof process.env;
13
- interface SpawnResult {
14
- stdout: string;
15
- stderr: string;
16
- exitCode: number | null;
17
- success: boolean;
18
- error?: Error;
19
- timedOut?: boolean;
20
- outputLimitExceeded?: boolean;
21
- }
22
- export declare function spawnWithTimeout(command: string, args: string[], options?: SpawnWithTimeoutOptions): Promise<SpawnResult>;
23
- export declare function spawnCheckSuccess(command: string, args: string[], timeoutMs?: number, options?: {
24
- allowEnvVars?: readonly string[];
25
- }): Promise<boolean>;
26
- export declare function spawnCollectStdout(command: string, args: string[], timeoutMs?: number, options?: {
27
- allowEnvVars?: readonly string[];
28
- maxOutputSize?: number;
29
- }): Promise<string | null>;
30
- export declare function validateArgs(args: string[], maxLength?: number): {
31
- valid: boolean;
32
- error?: string;
33
- };
34
- export {};
1
+ export * from './spawn/env.js';
2
+ export * from './spawn/wrappers.js';
@@ -12,6 +12,18 @@ type ToolPathValidationResult = {
12
12
  sanitizedPath: string;
13
13
  errorResult?: undefined;
14
14
  };
15
+ /**
16
+ * Apply `.octocoderc` `local.allowedPaths` to the shared PathValidator so the
17
+ * file-config allowlist behaves identically to the `ALLOWED_PATHS` env var
18
+ * (which the PathValidator reads directly at construction). Without this, a
19
+ * user setting `allowedPaths` in `.octocoderc` gets a silent no-op — the field
20
+ * is validated by the config layer but never reaches the validator.
21
+ *
22
+ * `addAllowedRoot` de-duplicates and expands `~`, so this is idempotent and
23
+ * cheap to call per request (the common case is an empty array — a no-op).
24
+ * Exported for testing.
25
+ */
26
+ export declare function applyConfiguredAllowedRoots(allowedPaths?: readonly string[]): void;
15
27
  export declare function validateToolPath(query: PartialBaseQueryLocal & {
16
28
  path?: string;
17
29
  }, toolName: string): ToolPathValidationResult;
@@ -0,0 +1,21 @@
1
+ import NodeCache from 'node-cache';
2
+ /**
3
+ * Soft ETag store: survives primary TTL so a miss can send If-None-Match and
4
+ * recover a 304 without paying a full body download (GitHub authorized 304s
5
+ * do not burn primary rate-limit quota).
6
+ */
7
+ export declare const etagSoftCache: NodeCache;
8
+ export type ConditionalFetchResult<T> = {
9
+ value: T;
10
+ etag?: string;
11
+ /** True when the upstream responded 304 Not Modified. */
12
+ notModified?: boolean;
13
+ };
14
+ export declare function withDataCacheConditional<T>(cacheKey: string, operation: (opts: {
15
+ ifNoneMatch?: string;
16
+ }) => Promise<ConditionalFetchResult<T>>, options?: {
17
+ ttl?: number;
18
+ skipCache?: boolean;
19
+ forceRefresh?: boolean;
20
+ shouldCache?: (value: T) => boolean;
21
+ }): Promise<T>;
@@ -0,0 +1,6 @@
1
+ export declare function withDataCache<T>(cacheKey: string, operation: () => Promise<T>, options?: {
2
+ ttl?: number;
3
+ skipCache?: boolean;
4
+ forceRefresh?: boolean;
5
+ shouldCache?: (value: T) => boolean;
6
+ }): Promise<T>;
@@ -0,0 +1 @@
1
+ export declare function generateCacheKey(prefix: string, params: unknown, sessionId?: string): string;
@@ -0,0 +1,9 @@
1
+ import type { CacheStats } from '../../core/types.js';
2
+ export declare function clearAllCache(): void;
3
+ export declare function clearLocalToolCache(): number;
4
+ export declare function clearLSPToolCache(): number;
5
+ export declare function clearRemoteAPICache(): number;
6
+ export declare function getCacheStats(): CacheStats & {
7
+ hitRate: number;
8
+ cacheSize: number;
9
+ };
@@ -0,0 +1,28 @@
1
+ import NodeCache from 'node-cache';
2
+ import type { CacheStats } from '../../core/types.js';
3
+ export declare const PENDING_REQUEST_MAX_AGE_MS: number;
4
+ export declare const cache: NodeCache;
5
+ export declare const cacheStats: CacheStats;
6
+ export declare const CACHE_TTL_CONFIG: {
7
+ readonly 'gh-api-code': 3600;
8
+ readonly 'gh-api-repos': 7200;
9
+ readonly 'gh-api-prs': 1800;
10
+ readonly 'gh-api-issues': 1800;
11
+ readonly 'gh-api-history': 1800;
12
+ readonly 'gh-api-releases': 3600;
13
+ readonly 'gh-api-file-content': 300;
14
+ readonly 'gh-repo-structure-api': 7200;
15
+ readonly 'github-user': 900;
16
+ readonly 'npm-search': 14400;
17
+ readonly default: 86400;
18
+ };
19
+ export interface PendingRequest {
20
+ promise: Promise<unknown>;
21
+ startedAt: number;
22
+ }
23
+ export declare const pendingRequests: Map<string, PendingRequest>;
24
+ export declare function extractCachePrefix(cacheKey: string): string | undefined;
25
+ export declare function recordGitHubCacheHit(cacheKey: string): void;
26
+ export declare function cleanupStalePendingRequests(): void;
27
+ export declare function getTTLForPrefix(prefix: string): number;
28
+ export declare function safeCacheSet(key: string, value: unknown, ttl: number): boolean;