@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,16 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { OqlQuery } from '../../types.js';
3
+ /**
4
+ * GitHub `files` lane: list files via path-level code search. Positive
5
+ * text/regex predicates list files *containing* a term (approximate); path-like
6
+ * field equality (`basename`/`extension`/`path` "=") lists files by provider
7
+ * path qualifier (the same route as OQL target:"files" path discovery). Predicates the
8
+ * provider cannot enumerate by (other field ops, structural/PCRE2, negation,
9
+ * boolean) are routed to materialization by the planner and should not reach
10
+ * here; if one does, report `requiresMaterialization` rather than silently
11
+ * returning nothing.
12
+ */
13
+ export declare function githubFiles(query: OqlQuery): Promise<AdapterResult>;
14
+ export declare function githubCode(query: OqlQuery): Promise<AdapterResult>;
15
+ export declare function githubContent(query: OqlQuery): Promise<AdapterResult>;
16
+ export declare function githubStructure(query: OqlQuery): Promise<AdapterResult>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * GitHub provider adapter — status/error classification. Turns a raw
3
+ * `CallToolResult` from a GitHub tool runner into OQL diagnostics: provider
4
+ * failures (rate limit / auth / invalid query), zero-match status, and the
5
+ * "empty result is not proof" guard for provider reads/searches.
6
+ */
7
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
8
+ import type { OqlDiagnostic } from '../../types.js';
9
+ /**
10
+ * Status + gated empty-provider diagnostics. A provider failure (rate limit,
11
+ * auth, invalid query) already explains the empty result — emitting
12
+ * providerUnindexed on top would misread a 403/429 as "repo not indexed".
13
+ */
14
+ export declare function providerDiagnostics(result: CallToolResult, rowCount: number, backend: string): OqlDiagnostic[];
@@ -0,0 +1,75 @@
1
+ /**
2
+ * GitHub provider adapter — shared types and pure helpers used by the
3
+ * per-lane execute functions (code/files/content/structure). Kept separate
4
+ * from provider-error/status classification (see ./provider-diagnostics.ts).
5
+ */
6
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
+ import type { GitHubFileContentData } from '@octocodeai/octocode-core/types';
8
+ import type { ToolPaginationPayload } from '../pagination.js';
9
+ import type { OqlQuery, OqlTreeResultRow, QuerySource } from '../../types.js';
10
+ export type GitHubContentPagination = {
11
+ currentPage?: number;
12
+ totalPages?: number;
13
+ hasMore?: boolean;
14
+ charOffset?: number;
15
+ charLength?: number;
16
+ totalChars?: number;
17
+ };
18
+ export type GitHubContentRow = GitHubFileContentData & {
19
+ pagination?: GitHubContentPagination;
20
+ };
21
+ export declare function splitRepo(source: QuerySource | undefined): {
22
+ owner?: string;
23
+ repo?: string;
24
+ };
25
+ /** Pull the single query's `data` payload from a bulk CallToolResult. */
26
+ export declare function extractData<T>(result: CallToolResult): T | undefined;
27
+ export declare function extractStatus(result: CallToolResult): string | undefined;
28
+ export interface GithubStructureEntry {
29
+ dir?: string;
30
+ files?: readonly string[];
31
+ folders?: readonly string[];
32
+ }
33
+ export interface GithubCodeSearchMatch {
34
+ value?: string;
35
+ matchIndices?: Array<{
36
+ start: number;
37
+ end: number;
38
+ lineOffset?: number;
39
+ }>;
40
+ }
41
+ export interface GithubCodeSearchFile {
42
+ owner?: string;
43
+ repo?: string;
44
+ queryId?: string;
45
+ path: string;
46
+ matches?: readonly GithubCodeSearchMatch[];
47
+ }
48
+ export interface GithubCodeSearchPayload {
49
+ files?: readonly (GithubCodeSearchFile | string)[];
50
+ pagination?: ToolPaginationPayload;
51
+ }
52
+ export declare function cleanRepoPath(part: string | undefined): string;
53
+ export declare function joinRepoPath(...parts: Array<string | undefined>): string;
54
+ export declare function normalizeStructure(structure: readonly GithubStructureEntry[] | Record<string, {
55
+ files?: readonly string[];
56
+ folders?: readonly string[];
57
+ }> | undefined): GithubStructureEntry[];
58
+ export declare function structureDepth(pathValue: string): number;
59
+ export declare function normalizeExtension(value: string): string;
60
+ export declare function fileExtension(pathValue: string): string;
61
+ export declare function escapeRegex(value: string): string;
62
+ export declare function treePatternMatches(pathValue: string, pattern: string): boolean;
63
+ export declare function filterGithubTreeRows(rows: readonly OqlTreeResultRow[], query: OqlQuery): OqlTreeResultRow[];
64
+ export declare function githubCodeFilePath(file: GithubCodeSearchFile | string): string;
65
+ export declare function githubCodeFileMetadata(file: GithubCodeSearchFile | string): Record<string, unknown> | undefined;
66
+ export declare function githubCodeFileMatches(file: GithubCodeSearchFile | string): readonly GithubCodeSearchMatch[];
67
+ /** GitHub source, guaranteed by dispatch. */
68
+ export type GithubSource = Extract<QuerySource, {
69
+ kind: 'github';
70
+ }>;
71
+ export declare function ghFrom(query: OqlQuery): GithubSource;
72
+ export declare function normalizeContentRange(range: NonNullable<NonNullable<OqlQuery['fetch']>['content']>['range']): {
73
+ startLine?: number;
74
+ endLine?: number;
75
+ };
@@ -1,3 +1,14 @@
1
+ /**
2
+ * GitHub provider adapter: compile a canonical OQL query into the existing
3
+ * GitHub tool runners and map their results. Provider-only lanes (text search,
4
+ * content read, tree). Local-only predicates over GitHub are handled by the
5
+ * materialization adapter, not here.
6
+ *
7
+ * This file is a thin barrel/orchestrator — the per-lane implementations live
8
+ * under ./github/ (execute.ts for the code/files/content/structure lanes,
9
+ * provider-diagnostics.ts for status/error classification, shared.ts for
10
+ * common helpers and types).
11
+ */
1
12
  import type { AdapterResult } from './local.js';
2
13
  import type { OqlQuery } from '../types.js';
3
14
  export declare function executeGithub(query: OqlQuery): Promise<AdapterResult>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Graph-view filter logic: parsing `GraphFilters` from raw query params,
3
+ * matching packets/subjects/relations against them, and the node/fact/edge
4
+ * accumulator helpers shared by the graph builder and the native-edge
5
+ * overlay (nativeEdges.ts).
6
+ */
7
+ import type { EvidenceEdge, EvidenceFact, EvidenceSubject, MissingProof, ResearchEvidencePacket } from '../../research/packets.js';
8
+ export type GraphDirection = 'incoming' | 'outgoing' | 'both';
9
+ export interface GraphFilters {
10
+ subject?: string;
11
+ subjectKind?: string;
12
+ relations?: ReadonlySet<string>;
13
+ verdicts?: ReadonlySet<string>;
14
+ direction: GraphDirection;
15
+ includePackets: boolean;
16
+ includeFacts: boolean;
17
+ includeEdges: boolean;
18
+ }
19
+ export declare function graphFilters(p: Record<string, unknown>): GraphFilters;
20
+ export declare function relationAllowed(relation: string | undefined, filters: GraphFilters): boolean;
21
+ export declare function packetMatchesGraphFilters(packet: ResearchEvidencePacket, filters: GraphFilters): boolean;
22
+ export declare function addNode(nodes: Map<string, EvidenceSubject>, subject: EvidenceSubject): void;
23
+ export declare function addFact(facts: Map<string, EvidenceFact>, fact: EvidenceFact, filters: GraphFilters): void;
24
+ export declare function addEdge(nodes: Map<string, EvidenceSubject>, edges: Map<string, EvidenceEdge>, edge: EvidenceEdge, filters: GraphFilters): void;
25
+ export declare function missingProofKey(proof: MissingProof): string;
@@ -0,0 +1,5 @@
1
+ import type { analyzeResearchFlow } from '../../research/analyze.js';
2
+ import type { EvidenceEdge, EvidenceSubject } from '../../research/packets.js';
3
+ import { type GraphFilters } from './filters.js';
4
+ export declare function nativeGraphSummary(facts: Awaited<ReturnType<typeof analyzeResearchFlow>>['graphFacts']): Record<string, number>;
5
+ export declare function addNativeGraphEdges(root: string, graphFacts: Awaited<ReturnType<typeof analyzeResearchFlow>>['graphFacts'], visibleNodeIds: ReadonlySet<string>, nodes: Map<string, EvidenceSubject>, edges: Map<string, EvidenceEdge>, filters: GraphFilters): void;
@@ -1,28 +1,29 @@
1
+ /**
2
+ * Graph-view construction for the `research`/`graph` targets: packet paging,
3
+ * graph filters, node/edge/fact tree building, and native AST edge overlay.
4
+ *
5
+ * Pure over research packets + native graph facts — no tool invocation here
6
+ * (LSP proof escalation lives in graphProof.ts; the execute* adapters stay in
7
+ * researchTargets.ts).
8
+ *
9
+ * Filter parsing/matching lives in graphView/filters.ts; the native AST edge
10
+ * overlay lives in graphView/nativeEdges.ts. This file re-exports the public
11
+ * surface and owns the orchestration (`buildGraphView`) that combines them.
12
+ */
1
13
  import type { analyzeResearchFlow } from '../research/analyze.js';
2
- import type { ResearchEvidencePacket, ResearchGraphSummary } from '../research/packets.js';
14
+ import { type ResearchEvidencePacket, type ResearchGraphSummary } from '../research/packets.js';
3
15
  import type { OqlGraphData, OqlQuery, Pagination } from '../types.js';
16
+ import { type GraphFilters } from './graphView/filters.js';
17
+ export type { GraphDirection, GraphFilters } from './graphView/filters.js';
18
+ export { graphFilters, packetMatchesGraphFilters, } from './graphView/filters.js';
19
+ export { nativeGraphSummary } from './graphView/nativeEdges.js';
4
20
  export declare function packetPage(query: OqlQuery, totalItems: number): {
5
21
  packetsStart: number;
6
22
  packetsEnd: number;
7
23
  pagination: Pagination;
8
24
  };
9
- type GraphDirection = 'incoming' | 'outgoing' | 'both';
10
- export interface GraphFilters {
11
- subject?: string;
12
- subjectKind?: string;
13
- relations?: ReadonlySet<string>;
14
- verdicts?: ReadonlySet<string>;
15
- direction: GraphDirection;
16
- includePackets: boolean;
17
- includeFacts: boolean;
18
- includeEdges: boolean;
19
- }
20
- export declare function graphFilters(p: Record<string, unknown>): GraphFilters;
21
- export declare function packetMatchesGraphFilters(packet: ResearchEvidencePacket, filters: GraphFilters): boolean;
22
25
  export declare function buildGraphView(query: OqlQuery, packets: ResearchEvidencePacket[], graphSummary: ResearchGraphSummary, filters: GraphFilters, nativeGraphFacts: Awaited<ReturnType<typeof analyzeResearchFlow>>['graphFacts'], root: string): {
23
26
  data: OqlGraphData;
24
27
  pagination: Pagination;
25
28
  };
26
- export declare function nativeGraphSummary(facts: Awaited<ReturnType<typeof analyzeResearchFlow>>['graphFacts']): Record<string, number>;
27
29
  export declare function summarizePacketGraph(packets: readonly ResearchEvidencePacket[]): ResearchGraphSummary;
28
- export {};
@@ -0,0 +1,3 @@
1
+ import type { OqlQuery, QuerySource } from '../../types.js';
2
+ import type { AdapterResult } from './types.js';
3
+ export declare function executeCode(query: OqlQuery, source: QuerySource, searchPath: string): Promise<AdapterResult>;
@@ -0,0 +1,3 @@
1
+ import type { OqlQuery, Predicate, QuerySource } from '../../types.js';
2
+ import type { AdapterResult } from './types.js';
3
+ export declare function executeCodeBoolean(query: OqlQuery, source: QuerySource, searchPath: string, where: Predicate): Promise<AdapterResult>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generic `FileRowMap` / string-set combinators used by the files-target
3
+ * boolean set algebra (union/intersection/merge). Pure data-shape helpers —
4
+ * no backend calls — shared by the field-leaf and content-leaf lookups.
5
+ */
6
+ import type { OqlFileResultRow } from '../../types.js';
7
+ import type { FileRowMap } from './types.js';
8
+ export declare function mergeFileRows(left: OqlFileResultRow | undefined, right: OqlFileResultRow): OqlFileResultRow;
9
+ export declare function rowsByPath(rows: OqlFileResultRow[]): FileRowMap;
10
+ export declare function intersectFileRows(a: FileRowMap, b: FileRowMap): FileRowMap;
11
+ export declare function intersectStringSets(a: Set<string>, b: Set<string>): Set<string>;
@@ -0,0 +1,3 @@
1
+ import type { OqlQuery, QuerySource } from '../../types.js';
2
+ import type { AdapterResult } from './types.js';
3
+ export declare function executeFiles(query: OqlQuery, source: QuerySource, searchPath: string): Promise<AdapterResult>;
@@ -0,0 +1,10 @@
1
+ import type { OqlDiagnostic, OqlProvenance, OqlQuery, Predicate, QuerySource } from '../../types.js';
2
+ import type { AdapterResult } from './types.js';
3
+ /**
4
+ * Evaluate a boolean `where` over the FILES target with file-level set algebra.
5
+ */
6
+ export declare function executeFilesBoolean(query: OqlQuery, source: QuerySource, searchPath: string, where: Predicate): Promise<AdapterResult>;
7
+ /** All files in scope — the candidate universe for negation. */
8
+ export declare function universeFiles(query: OqlQuery, searchPath: string, prov: OqlProvenance[]): Promise<Set<string>>;
9
+ /** File-set for a single (non-boolean) predicate. */
10
+ export declare function leafFiles(query: OqlQuery, leaf: Predicate, searchPath: string, prov: OqlProvenance[], diags: OqlDiagnostic[]): Promise<Set<string>>;
@@ -0,0 +1,12 @@
1
+ import type { OqlDiagnostic, OqlProvenance, OqlQuery, Predicate, QuerySource } from '../../types.js';
2
+ import type { AdapterResult, FileRowMap } from './types.js';
3
+ /** File-set for a single content-leaf (text/regex/structural) predicate. */
4
+ export declare function leafContentFileRows(query: OqlQuery, leaf: Predicate, source: QuerySource, searchPath: string, prov: OqlProvenance[], diags: OqlDiagnostic[]): Promise<FileRowMap>;
5
+ export declare function executeFilesWithoutMatch(query: OqlQuery, source: QuerySource, searchPath: string, where: Predicate & {
6
+ kind: 'not';
7
+ predicate: Predicate;
8
+ }): Promise<AdapterResult>;
9
+ export declare function executeCodeFilesWithoutMatch(query: OqlQuery, source: QuerySource, searchPath: string, where: Predicate & {
10
+ kind: 'not';
11
+ predicate: Predicate;
12
+ }): Promise<AdapterResult>;
@@ -0,0 +1,6 @@
1
+ import type { OqlDiagnostic, OqlProvenance, OqlQuery, Predicate, QuerySource } from '../../types.js';
2
+ import type { FileRowMap } from './types.js';
3
+ /** All files in scope — the candidate universe for negation. */
4
+ export declare function universeFileRows(query: OqlQuery, source: QuerySource, searchPath: string, prov: OqlProvenance[]): Promise<FileRowMap>;
5
+ /** File-set for a single field-predicate leaf (attribute lookup). */
6
+ export declare function leafFieldFileRows(query: OqlQuery, leaf: Predicate, source: QuerySource, searchPath: string, prov: OqlProvenance[], diags: OqlDiagnostic[]): Promise<FileRowMap>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `LocalFindToolQuery` on its own, so this is the only sibling module that
3
+ * needs a runtime import of the file-finder runner purely to derive its
4
+ * input type via `Parameters<typeof …>`.
5
+ */
6
+ import { findFiles } from '../../../tools/local_find_files/findFiles.js';
7
+ export type LocalFindToolQuery = Parameters<typeof findFiles>[0] & {
8
+ page?: number;
9
+ itemsPerPage?: number;
10
+ };
@@ -0,0 +1,18 @@
1
+ import type { OqlDiagnostic, Predicate, OqlProvenance, QuerySource } from '../../types.js';
2
+ import type { LocalFindToolQuery } from './findToolType.js';
3
+ /** A boolean `where` that needs multi-call evaluation (not a single leaf). */
4
+ export declare function needsBooleanEval(p: Predicate): boolean;
5
+ export declare function isRipgrepContentLeaf(p: Predicate): boolean;
6
+ export declare function isNegatedRipgrepContentLeaf(p: Predicate | undefined): p is Predicate & {
7
+ kind: 'not';
8
+ predicate: Predicate;
9
+ };
10
+ export declare function isBooleanPredicate(p: Predicate): boolean;
11
+ export declare function isContentPredicate(p: Predicate): boolean;
12
+ export declare function applyFieldPredicate(where: Predicate, toolQuery: Partial<LocalFindToolQuery>, diags: OqlDiagnostic[]): void;
13
+ export declare function resultDiagnostics(result: {
14
+ status?: string;
15
+ error?: string;
16
+ warnings?: string[];
17
+ }, backend: string): OqlDiagnostic[];
18
+ export declare function provenance(backend: string, source: QuerySource, where: Predicate | undefined): OqlProvenance;
@@ -0,0 +1,14 @@
1
+ import type { OqlQuery, QueryScope } from '../../types.js';
2
+ import type { LocalFindToolQuery } from './findToolType.js';
3
+ import type { LocalSearchToolQuery } from './searchToolType.js';
4
+ export declare const LOCAL_SCOPE_FILTER_CANDIDATE_LIMIT = 10000;
5
+ export declare function scopeToCommon(scope: QueryScope | undefined): Partial<LocalSearchToolQuery>;
6
+ export declare function looksLikeRegex(value: string): boolean;
7
+ export declare function mergeStringArrays(left: unknown, right: readonly string[]): string[];
8
+ export declare function applyLocalSearchLanguage(toolQuery: Partial<LocalSearchToolQuery>, scope: QueryScope | undefined, explicitLangType: string | undefined): void;
9
+ export declare function findFilesNeedsScopePostFilter(scope: QueryScope | undefined): boolean;
10
+ export declare function applyFindFilesScope(toolQuery: Partial<LocalFindToolQuery>, scope: QueryScope | undefined): void;
11
+ export declare function applyFindFilesPagination(toolQuery: Partial<LocalFindToolQuery>, query: OqlQuery): void;
12
+ export declare function applyUnpagedFindFilesWindow(toolQuery: Partial<LocalFindToolQuery>): void;
13
+ export declare function applyFindFilesSort(toolQuery: Partial<LocalFindToolQuery>, query: OqlQuery): void;
14
+ export declare function searchControls(query: OqlQuery): Partial<LocalSearchToolQuery>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `LocalSearchToolQuery` on its own, so this is the only sibling module that
3
+ * needs a runtime import of the ripgrep-backed content-search runner purely
4
+ * to derive its input type via `Parameters<typeof …>`.
5
+ */
6
+ import { searchContentRipgrep } from '../../../tools/local_ripgrep/searchContentRipgrep.js';
7
+ export type LocalSearchToolQuery = Parameters<typeof searchContentRipgrep>[0];
@@ -0,0 +1,6 @@
1
+ import type { LocalFindFilesToolResult } from '@octocodeai/octocode-core/extra-types';
2
+ import type { OqlQuery, QuerySource } from '../../types.js';
3
+ import type { AdapterResult } from './types.js';
4
+ export declare function executeStructure(query: OqlQuery, source: QuerySource, searchPath: string): Promise<AdapterResult>;
5
+ export declare function executeContent(query: OqlQuery, source: QuerySource, searchPath: string): Promise<AdapterResult>;
6
+ export declare function filterFindFilesResultByScope(result: LocalFindFilesToolResult, query: OqlQuery, searchPath: string): LocalFindFilesToolResult;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shared types for the local execution adapter split: the public
3
+ * `AdapterResult` shape, tool-query type aliases derived from each local
4
+ * runner's real input contract, and small internal helper types used across
5
+ * the sibling modules in this directory.
6
+ *
7
+ * `LocalSearchToolQuery` and `LocalFindToolQuery` live in their own
8
+ * single-purpose sibling files (searchToolType.ts / findToolType.ts) rather
9
+ * than here, so that no module other than those two needs a runtime import
10
+ * of both backing runners at once.
11
+ */
12
+ import { viewStructure } from '../../../tools/local_view_structure/local_view_structure.js';
13
+ import { fetchContent } from '../../../tools/local_fetch_content/fetchContent.js';
14
+ import type { MappedResult } from '../resultMap.js';
15
+ import type { OqlCodeResultRow, OqlDiagnostic, OqlFileResultRow, OqlProvenance } from '../../types.js';
16
+ export interface AdapterResult extends MappedResult {
17
+ shared?: Record<string, unknown>;
18
+ diagnostics: OqlDiagnostic[];
19
+ provenance: OqlProvenance[];
20
+ }
21
+ export type LocalStructureToolQuery = Parameters<typeof viewStructure>[0] & {
22
+ page?: number;
23
+ itemsPerPage?: number;
24
+ };
25
+ export type LocalFetchToolQuery = Parameters<typeof fetchContent>[0];
26
+ export type FileRowMap = Map<string, OqlFileResultRow>;
27
+ /** A boolean-code-eval partial result: satisfying files + positive rows. */
28
+ export interface CodeEval {
29
+ /** Files satisfying this sub-predicate (the candidate universe slice). */
30
+ files: Set<string>;
31
+ /** Positive match occurrences (empty for negation/field constraints). */
32
+ rows: OqlCodeResultRow[];
33
+ }
34
+ export declare function normalizeGlobPath(value: string): string;
@@ -1,8 +1,4 @@
1
- import { type MappedResult } from './resultMap.js';
2
- import type { OqlDiagnostic, OqlProvenance, OqlQuery } from '../types.js';
3
- export interface AdapterResult extends MappedResult {
4
- shared?: Record<string, unknown>;
5
- diagnostics: OqlDiagnostic[];
6
- provenance: OqlProvenance[];
7
- }
1
+ import type { OqlQuery } from '../types.js';
2
+ import type { AdapterResult } from './local/types.js';
3
+ export type { AdapterResult };
8
4
  export declare function executeLocal(query: OqlQuery): Promise<AdapterResult>;
@@ -0,0 +1,16 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { OqlQuery } from '../../types.js';
3
+ export declare function executeDiff(query: OqlQuery): Promise<AdapterResult>;
4
+ export interface LineDiff {
5
+ additions: number;
6
+ deletions: number;
7
+ unchanged: number;
8
+ /** Unified-style patch text (`+`/`-`/` ` line prefixes). */
9
+ patch: string;
10
+ }
11
+ /**
12
+ * Minimal LCS-based line diff between two file bodies. Pure and dependency-free
13
+ * so it is unit-testable without any backend. Not a byte-perfect git patch —
14
+ * a line-granular additions/deletions view for direct two-ref comparison.
15
+ */
16
+ export declare function computeLineDiff(baseText: string, headText: string): LineDiff;
@@ -0,0 +1,3 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { OqlQuery } from '../../types.js';
3
+ export declare function executeGraph(query: OqlQuery): Promise<AdapterResult>;
@@ -0,0 +1,20 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { OqlQuery } from '../../types.js';
3
+ export declare function executeHistory(query: OqlQuery): Promise<AdapterResult>;
4
+ /**
5
+ * Keep only commit records whose message contains `needle` (case-insensitive
6
+ * substring), spotlight where it matched, and surface honest diagnostics — a
7
+ * `partialResult` when some were dropped, `zeroMatches` when none matched.
8
+ * Mirrors {@link filterPullRequestsByMatch}; commit text is the commit message.
9
+ */
10
+ export declare function filterCommitsByMatch(result: AdapterResult, needle: string): AdapterResult;
11
+ export interface PullRequestMatch {
12
+ needle: string;
13
+ scope: 'body' | 'title' | 'comments' | 'reviews' | 'all';
14
+ }
15
+ /**
16
+ * Keep only PR records whose scope text contains `matchString` (case-insensitive
17
+ * substring), spotlight where each matched, and surface honest diagnostics: a
18
+ * `partialResult` when some were dropped, `zeroMatches` when none matched.
19
+ */
20
+ export declare function filterPullRequestsByMatch(result: AdapterResult, match: PullRequestMatch): AdapterResult;
@@ -0,0 +1,54 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { analyzeResearchFlow } from '../../research/analyze.js';
3
+ import type { OqlDiagnostic, OqlQuery, OqlRecordResultRow, Pagination, QuerySource } from '../../types.js';
4
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
5
+ export declare function requestedResearchMode(mode: unknown): 'plan' | 'analyze' | 'prove';
6
+ /**
7
+ * Build the `view:"detailed"` payload as per-domain *windows* instead of whole
8
+ * arrays (P1). Each requested domain emits a sliced `data.<domain>` window plus
9
+ * a typed `data.<domain>Page` pagination object, all sharing the query's
10
+ * page/itemsPerPage. Returns the combined pagination (max totalPages, OR-ed
11
+ * hasMore) so a single `next.page` advances every detailed domain together.
12
+ */
13
+ export declare function buildDetailedDomains(query: OqlQuery, data: Awaited<ReturnType<typeof analyzeResearchFlow>>): {
14
+ fields: Record<string, unknown>;
15
+ pagination?: Pagination;
16
+ };
17
+ /** Combine the packet-page window with the detailed-domain window so the
18
+ * envelope's `hasMore` (and thus `next.page`) reflects either having more. */
19
+ export declare function combinePagination(a: Pagination | undefined, b: Pagination | undefined): Pagination | undefined;
20
+ export declare function statusDiagnostics(result: CallToolResult, backend: string): OqlDiagnostic[];
21
+ /**
22
+ * Build an AdapterResult from a backing-tool result: map records (none on
23
+ * error), carry status diagnostics, and emit `zeroMatches` on a clean empty so
24
+ * an empty result is never read as silent proof.
25
+ */
26
+ export declare function finishRecords(result: CallToolResult, recordType: OqlRecordResultRow['recordType'], backend: string, source?: QuerySource): AdapterResult;
27
+ export declare function semanticPageContinuation(pag: {
28
+ currentPage?: number;
29
+ nextPage?: number;
30
+ }, query: OqlQuery): {
31
+ query: {
32
+ params: {
33
+ page: number;
34
+ };
35
+ schema: "oql";
36
+ id?: string;
37
+ target: import("../../types.js").OqlActiveTarget;
38
+ from?: QuerySource;
39
+ scope?: import("../../types.js").QueryScope;
40
+ where?: import("../../types.js").Predicate;
41
+ materialize?: import("../../types.js").MaterializePolicy;
42
+ fetch?: import("../../types.js").FetchInstructions;
43
+ select?: import("../../types.js").SelectField[];
44
+ view?: import("../../types.js").QueryView;
45
+ controls?: import("../../types.js").QueryControls;
46
+ limit?: number;
47
+ page?: number;
48
+ itemsPerPage?: number;
49
+ explain?: boolean;
50
+ };
51
+ why: string;
52
+ confidence: "exact";
53
+ };
54
+ export declare function semanticPagination(data: Record<string, unknown> | undefined, query: OqlQuery): Pagination | undefined;
@@ -0,0 +1,4 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { OqlQuery } from '../../types.js';
3
+ export declare function executeRepositories(query: OqlQuery): Promise<AdapterResult>;
4
+ export declare function executePackages(query: OqlQuery): Promise<AdapterResult>;
@@ -0,0 +1,3 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { OqlQuery } from '../../types.js';
3
+ export declare function executeResearch(query: OqlQuery): Promise<AdapterResult>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Result/record shaping shared by every research-target adapter: turning a
3
+ * backing tool's `data` payload into generic `OqlRecordResultRow`s, deriving
4
+ * a citeable `id` per record type, and trimming parent-level metadata/shared
5
+ * repository refs that ride alongside the array payload.
6
+ */
7
+ import type { OqlRecordResultRow, QuerySource } from '../../types.js';
8
+ /** Known array-valued payload fields, in priority order. */
9
+ export declare const RECORD_ARRAY_KEYS: string[];
10
+ export declare const RECORD_PARENT_METADATA_EXCLUDE: Set<string>;
11
+ /** Expand a tool `data` payload into row items (an inner array if present). */
12
+ export declare function expandData(data: Record<string, unknown> | undefined): unknown[];
13
+ export declare function sharedRepositoryRefs(parent: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
14
+ export declare function parentMetadata(data: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
15
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
16
+ export declare function records(items: unknown[], recordType: OqlRecordResultRow['recordType'], source?: QuerySource, metadata?: Record<string, unknown>): OqlRecordResultRow[];
@@ -0,0 +1,3 @@
1
+ import type { AdapterResult } from '../local.js';
2
+ import type { OqlQuery } from '../../types.js';
3
+ export declare function executeSemantics(query: OqlQuery): Promise<AdapterResult>;
@@ -0,0 +1,11 @@
1
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { OqlQuery, QuerySource } from '../../types.js';
3
+ export declare function errorText(value: unknown, fallback: string): string;
4
+ export declare function materializedClonePath(result: CallToolResult, localPath: string | undefined): string | undefined;
5
+ export declare function isExistingDirectory(path: string): boolean;
6
+ export declare function splitRepo(source: QuerySource | undefined): {
7
+ owner?: string;
8
+ repo?: string;
9
+ };
10
+ export declare function params(query: OqlQuery): Record<string, unknown>;
11
+ export declare function withOqlPaging(query: OqlQuery, limitKey?: 'limit' | 'perPage'): Record<string, unknown>;
@@ -1,50 +1,8 @@
1
+ import { filterCommitsByMatch, filterPullRequestsByMatch, type PullRequestMatch } from './researchTargets/history.js';
2
+ import { computeLineDiff, executeDiff, type LineDiff } from './researchTargets/diff.js';
1
3
  import type { AdapterResult } from './local.js';
2
4
  import type { OqlQuery } from '../types.js';
3
- export declare function executeRepositories(query: OqlQuery): Promise<AdapterResult>;
4
- export declare function executePackages(query: OqlQuery): Promise<AdapterResult>;
5
- export declare function executeHistory(query: OqlQuery): Promise<AdapterResult>;
6
- /**
7
- * Keep only commit records whose message contains `needle` (case-insensitive
8
- * substring), spotlight where it matched, and surface honest diagnostics — a
9
- * `partialResult` when some were dropped, `zeroMatches` when none matched.
10
- * Mirrors {@link filterPullRequestsByMatch}; commit text is the commit message.
11
- */
12
- export declare function filterCommitsByMatch(result: AdapterResult, needle: string): AdapterResult;
13
- export interface PullRequestMatch {
14
- needle: string;
15
- scope: 'body' | 'title' | 'comments' | 'reviews' | 'all';
16
- }
17
- /**
18
- * Keep only PR records whose scope text contains `matchString` (case-insensitive
19
- * substring), spotlight where each matched, and surface honest diagnostics: a
20
- * `partialResult` when some were dropped, `zeroMatches` when none matched.
21
- */
22
- export declare function filterPullRequestsByMatch(result: AdapterResult, match: PullRequestMatch): AdapterResult;
23
- /**
24
- * `target:"diff"` has two typed lanes, discriminated by params shape:
25
- * - PR patch: { prNumber, files? } -> ghHistoryResearch patches
26
- * - direct file: { baseRef, headRef, path } -> two ghGetFileContent reads
27
- * + a pure local line diff
28
- * A request that fits neither returns a repair diagnostic rather than silently
29
- * falling through to a PR-patch call.
30
- */
31
- export declare function executeDiff(query: OqlQuery): Promise<AdapterResult>;
32
- export interface LineDiff {
33
- additions: number;
34
- deletions: number;
35
- unchanged: number;
36
- /** Unified-style patch text (`+`/`-`/` ` line prefixes). */
37
- patch: string;
38
- }
39
- /**
40
- * Minimal LCS-based line diff between two file bodies. Pure and dependency-free
41
- * so it is unit-testable without any backend. Not a byte-perfect git patch —
42
- * a line-granular additions/deletions view for direct two-ref comparison.
43
- */
44
- export declare function computeLineDiff(baseText: string, headText: string): LineDiff;
45
- export declare function executeArtifacts(query: OqlQuery): Promise<AdapterResult>;
46
- export declare function executeSemantics(query: OqlQuery): Promise<AdapterResult>;
47
- export declare function executeResearch(query: OqlQuery): Promise<AdapterResult>;
48
- export declare function executeGraph(query: OqlQuery): Promise<AdapterResult>;
5
+ export { filterCommitsByMatch, filterPullRequestsByMatch, executeDiff, computeLineDiff, };
6
+ export type { PullRequestMatch, LineDiff };
49
7
  /** Dispatch map: target -> adapter. */
50
8
  export declare const RESEARCH_TARGET_ADAPTERS: Record<string, (q: OqlQuery) => Promise<AdapterResult>>;
@@ -12,7 +12,7 @@ export declare const DEFAULTS: {
12
12
  textCase: "smart";
13
13
  regexDialectLocal: "rust";
14
14
  regexCase: "smart";
15
- contentView: "compact";
15
+ contentView: "standard";
16
16
  contentCharLength: number;
17
17
  matchContentLength: number;
18
18
  maxPlanNodes: number;