@octocodeai/octocode-tools-core 17.0.2 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.md +266 -123
  2. package/dist/direct.d.ts +1 -1
  3. package/dist/direct.js +51 -36
  4. package/dist/github/canonicalRepo.d.ts +14 -0
  5. package/dist/github/codeSearch/matchPositions.d.ts +11 -0
  6. package/dist/github/codeSearch.d.ts +2 -1
  7. package/dist/github/compare.d.ts +51 -0
  8. package/dist/github/dateWindow.d.ts +4 -0
  9. package/dist/github/discussions.d.ts +45 -0
  10. package/dist/github/githubAPI.d.ts +7 -13
  11. package/dist/github/history/commitFiles.d.ts +39 -0
  12. package/dist/github/history.d.ts +1 -0
  13. package/dist/github/issues/types.d.ts +8 -8
  14. package/dist/github/prTransformation.d.ts +24 -25
  15. package/dist/github/queryBuilders/base.d.ts +0 -1
  16. package/dist/github/queryBuilders/issues.d.ts +0 -6
  17. package/dist/github/releases.d.ts +9 -1
  18. package/dist/github/responseHeaders.d.ts +6 -0
  19. package/dist/index.d.ts +7 -6
  20. package/dist/index.js +55 -40
  21. package/dist/providers/github/githubPullRequests.d.ts +9 -0
  22. package/dist/providers/github/paginationMetadata.d.ts +6 -5
  23. package/dist/providers/providerQueries.d.ts +11 -6
  24. package/dist/providers/providerResults.d.ts +9 -1
  25. package/dist/schema.d.ts +0 -1
  26. package/dist/schema.js +1 -2
  27. package/dist/scheme/pagination.d.ts +5 -13
  28. package/dist/scheme/responseEnvelope.d.ts +28 -22
  29. package/dist/security/bridge.d.ts +3 -2
  30. package/dist/shared/config/index.d.ts +0 -1
  31. package/dist/shared/config/index.js +1 -1
  32. package/dist/shared/languageSelectors/classify.d.ts +2 -2
  33. package/dist/shared/languageSelectors/data.d.ts +4 -4
  34. package/dist/shared/languageSelectors.d.ts +1 -1
  35. package/dist/shared/paths.d.ts +1 -4
  36. package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +10 -11
  37. package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +5 -0
  38. package/dist/tools/directToolCatalog.meta.d.ts +1 -0
  39. package/dist/tools/github_clone_repo/contentSize.d.ts +9 -0
  40. package/dist/tools/github_clone_repo/scheme.d.ts +28 -80
  41. package/dist/tools/github_fetch_content/finalizer/types.d.ts +4 -3
  42. package/dist/tools/github_fetch_content/scheme.d.ts +92 -140
  43. package/dist/tools/github_fetch_content/types.d.ts +2 -1
  44. package/dist/tools/github_search_code/scheme.d.ts +39 -87
  45. package/dist/tools/github_search_discussions/execution.d.ts +15 -0
  46. package/dist/tools/github_search_discussions/scheme.d.ts +16 -0
  47. package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +3 -18
  48. package/dist/tools/github_search_pull_requests/scheme.d.ts +97 -119
  49. package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +8 -0
  50. package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +219 -0
  51. package/dist/tools/github_search_pull_requests/types.d.ts +28 -29
  52. package/dist/tools/github_search_repos/execution.d.ts +0 -2
  53. package/dist/tools/github_search_repos/scheme.d.ts +36 -64
  54. package/dist/tools/github_view_repo_structure/scheme.d.ts +37 -66
  55. package/dist/tools/local_dead_code/deadCodeScan.d.ts +26 -0
  56. package/dist/tools/local_dead_code/entrypoints.d.ts +16 -0
  57. package/dist/tools/local_dead_code/execution.d.ts +4 -0
  58. package/dist/tools/local_dead_code/graphBuilder.d.ts +43 -0
  59. package/dist/tools/local_dead_code/importResolver.d.ts +6 -0
  60. package/dist/tools/local_dead_code/local_dead_code.d.ts +5 -0
  61. package/dist/tools/local_dead_code/reachability.d.ts +21 -0
  62. package/dist/tools/local_dead_code/retention.d.ts +22 -0
  63. package/dist/tools/local_dead_code/scheme.d.ts +51 -0
  64. package/dist/tools/local_dead_code/types.d.ts +56 -0
  65. package/dist/tools/local_fetch_content/execution.d.ts +0 -1
  66. package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +6 -0
  67. package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +9 -1
  68. package/dist/tools/local_fetch_content/fetchContent.d.ts +0 -1
  69. package/dist/tools/local_fetch_content/scheme.d.ts +28 -90
  70. package/dist/tools/local_find_files/execution.d.ts +0 -1
  71. package/dist/tools/local_find_files/findFiles.d.ts +0 -3
  72. package/dist/tools/local_find_files/findFilesNext.d.ts +26 -0
  73. package/dist/tools/local_find_files/pathPatternBraces.d.ts +20 -0
  74. package/dist/tools/local_find_files/scheme.d.ts +19 -81
  75. package/dist/tools/local_ripgrep/captureBudget.d.ts +25 -0
  76. package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +1 -0
  77. package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -0
  78. package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +1 -1
  79. package/dist/tools/local_ripgrep/scheme.d.ts +89 -190
  80. package/dist/tools/local_view_structure/execution.d.ts +0 -1
  81. package/dist/tools/local_view_structure/local_view_structure.d.ts +0 -1
  82. package/dist/tools/local_view_structure/scheme.d.ts +34 -87
  83. package/dist/tools/local_view_structure/structureFilters.d.ts +2 -4
  84. package/dist/tools/local_view_structure/structureResponse.d.ts +1 -0
  85. package/dist/tools/local_view_structure/viewStructureNext.d.ts +25 -0
  86. package/dist/tools/lsp/semantic_content/index.d.ts +2 -1
  87. package/dist/tools/lsp/semantic_content/scheme.d.ts +167 -642
  88. package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +8 -2
  89. package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +2 -1
  90. package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +17 -1
  91. package/dist/tools/lsp/semantic_content/semanticNext.d.ts +2 -0
  92. package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +1 -1
  93. package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +14 -2
  94. package/dist/tools/lsp/shared/semanticTypes.d.ts +14 -1
  95. package/dist/tools/package_search/execution.d.ts +9 -6
  96. package/dist/tools/package_search/queryHelpers.d.ts +8 -0
  97. package/dist/tools/package_search/scheme.d.ts +30 -86
  98. package/dist/tools/providerMappers/codeSearch.d.ts +0 -1
  99. package/dist/tools/providerMappers/pullRequests.d.ts +0 -13
  100. package/dist/tools/providerMappers/repoSearch.d.ts +1 -5
  101. package/dist/tools/providerMappers/repoStructure.d.ts +4 -0
  102. package/dist/tools/toolCatalogFactory.d.ts +25 -0
  103. package/dist/tools/toolConfig.d.ts +9 -24
  104. package/dist/tools/toolNames.d.ts +2 -2
  105. package/dist/tools/toolSchemaImports.d.ts +3 -1
  106. package/dist/types/execution.d.ts +1 -0
  107. package/dist/types/toolOutput.d.ts +38 -0
  108. package/dist/utils/contextUtils.d.ts +6 -0
  109. package/dist/utils/core/types.d.ts +4 -0
  110. package/dist/utils/file/configFiles.d.ts +70 -0
  111. package/dist/utils/jsSymbolNames.d.ts +6 -0
  112. package/package.json +4 -8
  113. package/dist/oql/adapters/compile.d.ts +0 -25
  114. package/dist/oql/adapters/github/execute.d.ts +0 -16
  115. package/dist/oql/adapters/github/provider-diagnostics.d.ts +0 -14
  116. package/dist/oql/adapters/github/shared.d.ts +0 -75
  117. package/dist/oql/adapters/github.d.ts +0 -14
  118. package/dist/oql/adapters/graphProof.d.ts +0 -6
  119. package/dist/oql/adapters/graphView/filters.d.ts +0 -25
  120. package/dist/oql/adapters/graphView/nativeEdges.d.ts +0 -5
  121. package/dist/oql/adapters/graphView.d.ts +0 -29
  122. package/dist/oql/adapters/local/code.d.ts +0 -3
  123. package/dist/oql/adapters/local/codeBoolean.d.ts +0 -3
  124. package/dist/oql/adapters/local/fileRowOps.d.ts +0 -11
  125. package/dist/oql/adapters/local/files.d.ts +0 -3
  126. package/dist/oql/adapters/local/filesBoolean.d.ts +0 -10
  127. package/dist/oql/adapters/local/filesContentLeaf.d.ts +0 -12
  128. package/dist/oql/adapters/local/filesUniverse.d.ts +0 -6
  129. package/dist/oql/adapters/local/findToolType.d.ts +0 -10
  130. package/dist/oql/adapters/local/predicates.d.ts +0 -18
  131. package/dist/oql/adapters/local/scope.d.ts +0 -14
  132. package/dist/oql/adapters/local/searchToolType.d.ts +0 -7
  133. package/dist/oql/adapters/local/structureContent.d.ts +0 -6
  134. package/dist/oql/adapters/local/types.d.ts +0 -34
  135. package/dist/oql/adapters/local.d.ts +0 -4
  136. package/dist/oql/adapters/materialize.d.ts +0 -11
  137. package/dist/oql/adapters/pagination.d.ts +0 -21
  138. package/dist/oql/adapters/researchTargets/diff.d.ts +0 -16
  139. package/dist/oql/adapters/researchTargets/graph.d.ts +0 -3
  140. package/dist/oql/adapters/researchTargets/history.d.ts +0 -20
  141. package/dist/oql/adapters/researchTargets/pagination.d.ts +0 -54
  142. package/dist/oql/adapters/researchTargets/repositories.d.ts +0 -4
  143. package/dist/oql/adapters/researchTargets/research.d.ts +0 -3
  144. package/dist/oql/adapters/researchTargets/rows.d.ts +0 -16
  145. package/dist/oql/adapters/researchTargets/semantics.d.ts +0 -3
  146. package/dist/oql/adapters/researchTargets/shared.d.ts +0 -11
  147. package/dist/oql/adapters/researchTargets.d.ts +0 -8
  148. package/dist/oql/adapters/resultMap.d.ts +0 -27
  149. package/dist/oql/adapters/ruleYaml.d.ts +0 -11
  150. package/dist/oql/adapters/runner.d.ts +0 -21
  151. package/dist/oql/capabilities.d.ts +0 -31
  152. package/dist/oql/defaults.d.ts +0 -26
  153. package/dist/oql/diagnostics.d.ts +0 -25
  154. package/dist/oql/diffLanes.d.ts +0 -29
  155. package/dist/oql/envelope.d.ts +0 -21
  156. package/dist/oql/features.d.ts +0 -7
  157. package/dist/oql/index.d.ts +0 -27
  158. package/dist/oql/index.js +0 -47
  159. package/dist/oql/normalize/batch.d.ts +0 -2
  160. package/dist/oql/normalize/materialize.d.ts +0 -2
  161. package/dist/oql/normalize/params.d.ts +0 -2
  162. package/dist/oql/normalize/query.d.ts +0 -2
  163. package/dist/oql/normalize/scope.d.ts +0 -2
  164. package/dist/oql/normalize/shared.d.ts +0 -7
  165. package/dist/oql/normalize/source.d.ts +0 -2
  166. package/dist/oql/normalize/where.d.ts +0 -2
  167. package/dist/oql/normalize.d.ts +0 -20
  168. package/dist/oql/planner/planDiagnostics.d.ts +0 -13
  169. package/dist/oql/planner/predicateRouting.d.ts +0 -35
  170. package/dist/oql/planner.d.ts +0 -7
  171. package/dist/oql/predicateUtils.d.ts +0 -3
  172. package/dist/oql/research/analyze/manifest-scan.d.ts +0 -4
  173. package/dist/oql/research/analyze/source-graph.d.ts +0 -7
  174. package/dist/oql/research/analyze/symbol-scoring.d.ts +0 -4
  175. package/dist/oql/research/analyze/types.d.ts +0 -163
  176. package/dist/oql/research/analyze/utils.d.ts +0 -16
  177. package/dist/oql/research/analyze.d.ts +0 -3
  178. package/dist/oql/research/packets/builders.d.ts +0 -4
  179. package/dist/oql/research/packets/types.d.ts +0 -91
  180. package/dist/oql/research/packets.d.ts +0 -21
  181. package/dist/oql/run/batch.d.ts +0 -3
  182. package/dist/oql/run/continuations/records.d.ts +0 -19
  183. package/dist/oql/run/continuations/registry.d.ts +0 -22
  184. package/dist/oql/run/continuations/semantics.d.ts +0 -3
  185. package/dist/oql/run/continuations/types.d.ts +0 -12
  186. package/dist/oql/run/dryRun.d.ts +0 -11
  187. package/dist/oql/run/paths.d.ts +0 -15
  188. package/dist/oql/run/proofGrades.d.ts +0 -8
  189. package/dist/oql/run/select.d.ts +0 -10
  190. package/dist/oql/run/single.d.ts +0 -22
  191. package/dist/oql/run.d.ts +0 -5
  192. package/dist/oql/schema/predicates.d.ts +0 -12
  193. package/dist/oql/schema.d.ts +0 -1049
  194. package/dist/oql/schemeText.d.ts +0 -152
  195. package/dist/oql/shorthand/predicates.d.ts +0 -15
  196. package/dist/oql/shorthand/query-controls.d.ts +0 -18
  197. package/dist/oql/shorthand/target-params.d.ts +0 -9
  198. package/dist/oql/shorthand/types.d.ts +0 -159
  199. package/dist/oql/shorthand/utils.d.ts +0 -7
  200. package/dist/oql/shorthand.d.ts +0 -8
  201. package/dist/oql/targetParams.d.ts +0 -7
  202. package/dist/oql/transformers/contract.d.ts +0 -19
  203. package/dist/oql/transformers/github/code.d.ts +0 -9
  204. package/dist/oql/transformers/github/common.d.ts +0 -14
  205. package/dist/oql/transformers/language.d.ts +0 -1
  206. package/dist/oql/transformers/registry.d.ts +0 -16
  207. package/dist/oql/transformers/types.d.ts +0 -11
  208. package/dist/oql/types/diagnostics.d.ts +0 -22
  209. package/dist/oql/types/envelope.d.ts +0 -78
  210. package/dist/oql/types/guards.d.ts +0 -9
  211. package/dist/oql/types/planner.d.ts +0 -46
  212. package/dist/oql/types/predicates.d.ts +0 -93
  213. package/dist/oql/types/query.d.ts +0 -143
  214. package/dist/oql/types/recordData.d.ts +0 -127
  215. package/dist/oql/types/recordRows.d.ts +0 -48
  216. package/dist/oql/types/results.d.ts +0 -118
  217. package/dist/oql/types/targets.d.ts +0 -22
  218. package/dist/oql/types.d.ts +0 -27
  219. package/dist/tools/oql_search/execution.d.ts +0 -7
  220. package/dist/tools/toolMetadata/descriptionOverrides.d.ts +0 -4
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Common configuration / manifest file detection + coarse file-type
3
+ * classification.
4
+ *
5
+ * `isConfigFile` combines three matching strategies:
6
+ * 1. Exact basename match (e.g. `package.json`, `Cargo.toml`).
7
+ * 2. Basename regex match for variadic names (e.g. `.eslintrc.*`, `*.csproj`).
8
+ * 3. Config-ish extension match for structured formats (e.g. `.toml`, `.ini`).
9
+ *
10
+ * `classifyFileType` layers lock/doc/code detection on top so fetch tools can
11
+ * tell an agent whether a path is a `code`, `config`, `lock`, `doc`, or
12
+ * `other` file — a cheap signal that changes how the returned bytes should be
13
+ * read.
14
+ *
15
+ * Config vs lock — rule of thumb: a CONFIG/manifest file declares *how* a
16
+ * package/service/code is meant to work and *which* dependencies it wants
17
+ * (`package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `tsconfig.json`).
18
+ * A LOCK file is a generated snapshot pinning the *resolved* dependency tree
19
+ * (`yarn.lock`, `package-lock.json`, `Cargo.lock`, `go.sum`) — not authored,
20
+ * rarely worth reading in full, and never the source of truth for intent.
21
+ *
22
+ * Scope is deliberately limited to config/manifest/lock files of the top
23
+ * popular languages and platforms — not every conceivable dotfile.
24
+ */
25
+ /** Exact config file basenames, grouped by ecosystem for readability. */
26
+ export declare const CONFIG_FILENAMES: readonly string[];
27
+ /**
28
+ * Dependency lock files — generated snapshots that pin a resolved dependency
29
+ * tree. Distinct from config/manifests: they are not authored by hand and
30
+ * rarely need to be read in full. Grouped by ecosystem.
31
+ */
32
+ export declare const LOCK_FILENAMES: readonly string[];
33
+ /** Regex patterns for variadic / templated config filenames. */
34
+ export declare const CONFIG_FILENAME_PATTERNS: readonly RegExp[];
35
+ /** Extensions that indicate a structured config format. */
36
+ export declare const CONFIG_EXTENSIONS: readonly string[];
37
+ /**
38
+ * Coarse file-type buckets returned to fetch callers. Deliberately has no
39
+ * `other`/`unknown` member: when a path can't be confidently placed in one of
40
+ * these buckets, `classifyFileType` returns `undefined` and callers omit the
41
+ * field entirely rather than emit a low-confidence guess.
42
+ */
43
+ export type FileType = 'code' | 'config' | 'lock' | 'doc';
44
+ /**
45
+ * Returns true when the given path points to a common config / manifest file.
46
+ *
47
+ * @param filePath A file path or bare filename.
48
+ */
49
+ export declare function isConfigFile(filePath: string): boolean;
50
+ /**
51
+ * Returns true when the path is a dependency lock file (a pinned, generated
52
+ * resolution snapshot) rather than an authored config/manifest.
53
+ *
54
+ * @param filePath A file path or bare filename.
55
+ */
56
+ export declare function isLockFile(filePath: string): boolean;
57
+ /**
58
+ * Classify a path into a coarse bucket so agents can decide how to read it.
59
+ *
60
+ * Precedence (most specific first): lock → config → doc → code. Lock wins
61
+ * first (a lockfile is never config/source). Config then wins over code/doc
62
+ * because manifests like `vite.config.js` or `pyproject.toml` carry a
63
+ * `.js`/`.toml` extension yet are configuration, not source.
64
+ *
65
+ * Returns `undefined` when the path matches none of the buckets — callers
66
+ * MUST omit the field in that case rather than emit an uncertain guess.
67
+ *
68
+ * @param filePath A file path or bare filename.
69
+ */
70
+ export declare function classifyFileType(filePath: string): FileType | undefined;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * True when `name` is a usable JS identifier for a top-level declaration —
3
+ * i.e. a real symbol name, not a reserved keyword the extractor mis-emitted.
4
+ * Empty/undefined names are rejected too.
5
+ */
6
+ export declare function isValidJsSymbolName(name: string | undefined | null): boolean;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@octocodeai/octocode-tools-core",
3
3
  "description": "Core tool implementations for Octocode: GitHub, local filesystem, LSP, and package search tools.",
4
- "version": "17.0.2",
4
+ "version": "18.1.0",
5
5
  "author": "Guy Bary <bgauryy@octocodeai.com>",
6
6
  "bugs": "https://github.com/bgauryy/octocode/issues",
7
7
  "dependencies": {
8
8
  "@modelcontextprotocol/sdk": "^1.29.0",
9
- "@octocodeai/config": "^17.0.2",
10
- "@octocodeai/octocode-core": "^16.6.3",
11
- "@octocodeai/octocode-engine": "^17.0.2",
9
+ "@octocodeai/config": "18.0.1",
10
+ "@octocodeai/octocode-core": "18.2.0",
11
+ "@octocodeai/octocode-engine": "18.1.1",
12
12
  "@octokit/oauth-methods": "^6.0.2",
13
13
  "@octokit/plugin-throttling": "^11.0.3",
14
14
  "@octokit/request": "^10.0.10",
@@ -43,10 +43,6 @@
43
43
  "types": "./dist/schema.d.ts",
44
44
  "import": "./dist/schema.js"
45
45
  },
46
- "./oql": {
47
- "types": "./dist/oql/index.d.ts",
48
- "import": "./dist/oql/index.js"
49
- },
50
46
  "./zod": {
51
47
  "types": "./dist/zod.d.ts",
52
48
  "import": "./dist/zod.js"
@@ -1,25 +0,0 @@
1
- import type { DiagnosticCode, Predicate } from '../types.js';
2
- export interface CompiledMatch {
3
- keywords?: string;
4
- fixedString?: boolean;
5
- perlRegex?: boolean;
6
- caseInsensitive?: boolean;
7
- caseSensitive?: boolean;
8
- wholeWord?: boolean;
9
- multiline?: boolean;
10
- multilineDotall?: boolean;
11
- mode?: 'structural';
12
- pattern?: string;
13
- rule?: unknown;
14
- langType?: string;
15
- }
16
- export interface CompileResult {
17
- match?: CompiledMatch;
18
- negate?: boolean;
19
- unsupported?: {
20
- code: DiagnosticCode;
21
- message: string;
22
- predicateId?: string;
23
- };
24
- }
25
- export declare function compileWhere(where: Predicate): CompileResult;
@@ -1,16 +0,0 @@
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>;
@@ -1,14 +0,0 @@
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[];
@@ -1,75 +0,0 @@
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,14 +0,0 @@
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
- */
12
- import type { AdapterResult } from './local.js';
13
- import type { OqlQuery } from '../types.js';
14
- export declare function executeGithub(query: OqlQuery): Promise<AdapterResult>;
@@ -1,6 +0,0 @@
1
- import type { ResearchEvidencePacket } from '../research/packets.js';
2
- import type { OqlDiagnostic, OqlQuery } from '../types.js';
3
- import { type GraphFilters } from './graphView.js';
4
- export declare function shouldRunLspProof(mode: 'plan' | 'analyze' | 'prove', p: Record<string, unknown>): boolean;
5
- export declare function graphProofLimit(query: OqlQuery, p: Record<string, unknown>): number;
6
- export declare function escalateGraphPacketsWithLsp(root: string, query: OqlQuery, packets: ResearchEvidencePacket[], filters: GraphFilters, limit: number): Promise<OqlDiagnostic[]>;
@@ -1,25 +0,0 @@
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;
@@ -1,5 +0,0 @@
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,29 +0,0 @@
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
- */
13
- import type { analyzeResearchFlow } from '../research/analyze.js';
14
- import { type ResearchEvidencePacket, type ResearchGraphSummary } from '../research/packets.js';
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';
20
- export declare function packetPage(query: OqlQuery, totalItems: number): {
21
- packetsStart: number;
22
- packetsEnd: number;
23
- pagination: Pagination;
24
- };
25
- export declare function buildGraphView(query: OqlQuery, packets: ResearchEvidencePacket[], graphSummary: ResearchGraphSummary, filters: GraphFilters, nativeGraphFacts: Awaited<ReturnType<typeof analyzeResearchFlow>>['graphFacts'], root: string): {
26
- data: OqlGraphData;
27
- pagination: Pagination;
28
- };
29
- export declare function summarizePacketGraph(packets: readonly ResearchEvidencePacket[]): ResearchGraphSummary;
@@ -1,3 +0,0 @@
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>;
@@ -1,3 +0,0 @@
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>;
@@ -1,11 +0,0 @@
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>;
@@ -1,3 +0,0 @@
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>;
@@ -1,10 +0,0 @@
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>>;
@@ -1,12 +0,0 @@
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>;
@@ -1,6 +0,0 @@
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>;
@@ -1,10 +0,0 @@
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
- };
@@ -1,18 +0,0 @@
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;
@@ -1,14 +0,0 @@
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>;
@@ -1,7 +0,0 @@
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];
@@ -1,6 +0,0 @@
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;
@@ -1,34 +0,0 @@
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,4 +0,0 @@
1
- import type { OqlQuery } from '../types.js';
2
- import type { AdapterResult } from './local/types.js';
3
- export type { AdapterResult };
4
- export declare function executeLocal(query: OqlQuery): Promise<AdapterResult>;
@@ -1,11 +0,0 @@
1
- import { type AdapterResult } from './local.js';
2
- import type { OqlQuery } from '../types.js';
3
- export declare function executeMaterialize(query: OqlQuery): Promise<AdapterResult>;
4
- /**
5
- * `target:"materialize"` — addressable materialization. Clone/cache a bounded
6
- * corpus once and return a stable local checkpoint row (localPath, repoRoot,
7
- * source, ref, cache, complete) that downstream queries can root at via the
8
- * `next.search` / `next.structure` / `next.fetch` continuations (attached in
9
- * run.ts). This makes materialization a first-class step, not a search side-effect.
10
- */
11
- export declare function executeMaterializeCheckpoint(query: OqlQuery): Promise<AdapterResult>;
@@ -1,21 +0,0 @@
1
- import type { Pagination } from '../types.js';
2
- export interface ToolPaginationPayload {
3
- currentPage?: number;
4
- totalPages?: number;
5
- nextPage?: number;
6
- hasMore?: boolean;
7
- itemsPerPage?: number;
8
- entriesPerPage?: number;
9
- filesPerPage?: number;
10
- perPage?: number;
11
- totalItems?: number;
12
- totalEntries?: number;
13
- totalFiles?: number;
14
- totalMatches?: number;
15
- reportedTotalMatches?: number;
16
- reachableTotalMatches?: number;
17
- totalMatchesKind?: string;
18
- totalMatchesCapped?: boolean;
19
- uniqueFileCount?: number;
20
- }
21
- export declare function toOqlPagination(pagination: ToolPaginationPayload | undefined, fallbackHasMore?: boolean): Pagination | undefined;
@@ -1,16 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import type { AdapterResult } from '../local.js';
2
- import type { OqlQuery } from '../../types.js';
3
- export declare function executeGraph(query: OqlQuery): Promise<AdapterResult>;
@@ -1,20 +0,0 @@
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;
@@ -1,54 +0,0 @@
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;