@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
@@ -1,20 +1,20 @@
1
1
  export declare const OQL_SCHEMA_DOC: {
2
2
  readonly schema: "oql";
3
- readonly description: "octocode search — typed read-only queries over code, files, symbols, repos, packages, history, artifacts, diffs, and graph evidence. Think source + answer type + filters + read/output options; use --explain for routing; follow next.* for pages, exact reads, materialization, or proof.";
3
+ readonly description: "octocode search — typed read-only queries over code, files, symbols, repos, packages, history, diffs, and graph evidence. Think source + answer type + filters + read/output options; use --explain for routing; follow next.* for pages, exact reads, materialization, or proof.";
4
4
  readonly activeTargets: readonly import("./types.js").OqlActiveTarget[];
5
5
  readonly reservedTargets: readonly import("./types.js").OqlReservedTarget[];
6
6
  readonly sourceGuide: {
7
- readonly local: "from:{kind:\"local\",path:\"./src\"}; shorthand: search \"term\" ./src, search ./src --tree, search file.ts --op documentSymbols. Best for local code/content/files/tree/LSP/artifacts/diff.";
7
+ readonly local: "from:{kind:\"local\",path:\"./src\"}; shorthand: search \"term\" ./src, search ./src --tree, search file.ts --op documentSymbols. Best for local code/content/files/tree/LSP/diff.";
8
8
  readonly github: "from:{kind:\"github\",repo:\"owner/repo\",ref?}; shorthand: search \"term\" owner/repo, search owner/repo --tree, search owner/repo#123 --target pullRequests. GitHub code is indexed/default-branch scoped; materialize for AST/LSP/local proof.";
9
9
  readonly npm: "from:{kind:\"npm\"} with target:\"packages\"; shorthand: search zod --target packages. Use to resolve package metadata and source repo, then continue with GitHub or local/materialized proof.";
10
10
  readonly materialized: "from:{kind:\"materialized\",localPath:\"/abs/path\"} after target:\"materialize\", clone, or cache fetch. Use when a remote repo/subtree must behave like local code.";
11
11
  };
12
12
  readonly plainLanguage: {
13
13
  readonly source: "`from` = where to look: local path, GitHub repo, npm, or a materialized checkout.";
14
- readonly answerType: "`target` = what kind of answer you want: code matches, file content, tree, files, symbols, repos, packages, PRs, commits, artifacts, diffs, research packets, graph proof, or materialization.";
14
+ readonly answerType: "`target` = what kind of answer you want: code matches, file content, tree, files, symbols, repos, packages, PRs, commits, diffs, research packets, graph proof, or materialization.";
15
15
  readonly filters: "`where` = match/filter conditions for code and file discovery only: text, regex, AST shape, file fields, and boolean combinations.";
16
16
  readonly readOptions: "`fetch` = what to read once you know the file/tree: exact content, compact content, symbol outline, ranges, match slices, or tree depth.";
17
- readonly targetOptions: "`params` = options that belong to one answer type, such as LSP operation, PR number, package name, artifact mode, research intent, or graph proof.";
17
+ readonly targetOptions: "`params` = options that belong to one answer type, such as LSP operation, PR number, package name, research intent, or graph proof.";
18
18
  readonly output: "`view`, `select`, and `controls` = response shape, projected fields, search tuning, and cost limits.";
19
19
  readonly paging: "`page` + `itemsPerPage` page the target's primary result domain. For code search that may be matched files; per-file match paging uses `controls.search.matchPage` / `--match-page`.";
20
20
  };
@@ -29,11 +29,10 @@ export declare const OQL_SCHEMA_DOC: {
29
29
  readonly 'PR list or deep-read': "target:pullRequests (owner/repo#N)";
30
30
  readonly 'commit history': "target:commits (--since/--until)";
31
31
  readonly 'a diff': "target:diff ({prNumber} for a PR patch, {baseRef,headRef,path} for two refs)";
32
- readonly 'inspect a binary/archive': "target:artifacts (--inspect/--list/--strings/--extract)";
33
32
  readonly 'dead-code / reachability sweep': "target:research, then upgrade with target:graph proof:\"lsp\"";
34
33
  readonly 'make a remote repo behave like local (AST/LSP/negation)': "target:materialize (or clone / cache fetch)";
35
34
  };
36
- readonly agentBestPractices: readonly ["Start with cheap orientation: --tree, --search path, --view discovery, or --content-view symbols.", "Then narrow and read exact evidence: --match-string, --start-line/--end-line, --char-offset/--char-length, or --content-view exact.", "Use snippets as discovery only; make decisions from exact content, PR/commit metadata, or LSP/graph proof.", "For semantics, run documentSymbols first to get line anchors, then references/callers/hover with symbolName + lineHint.", "For GitHub zero rows / providerUnindexed, do NOT claim absence — follow evidenceSemantics.providerUnindexed (verify path with structure, then materialize a bounded path).", "Read evidence.answerReady, evidence.complete, diagnostics, pagination, and next.* before concluding."];
35
+ readonly agentBestPractices: readonly ["Start with cheap orientation: --tree, --search path, --view discovery, or --content-view symbols.", "Then narrow and read exact evidence: --match-string, --start-line/--end-line, --char-offset/--char-length, or --content-view none.", "Use snippets as discovery only; make decisions from exact content, PR/commit metadata, or LSP/graph proof.", "For semantics, run documentSymbols first to get line anchors, then references/callers/hover with symbolName + lineHint.", "For GitHub zero rows / providerUnindexed, do NOT claim absence — follow evidenceSemantics.providerUnindexed (verify path with structure, then materialize a bounded path).", "Read evidence.answerReady, evidence.complete, diagnostics, pagination, and next.* before concluding."];
37
36
  readonly quickStart: {
38
37
  readonly 'text search (local)': "search \"functionName\" ./src";
39
38
  readonly 'text search (GitHub)': "search \"functionName\" vercel/next.js";
@@ -42,9 +41,8 @@ export declare const OQL_SCHEMA_DOC: {
42
41
  readonly 'commit history (GitHub)': "search vercel/next.js/packages/next/src --target commits --since 2024-01-01T00:00:00Z";
43
42
  readonly 'browse a tree (local dir or owner/repo)': "search ./src --tree | search vercel/next.js --tree";
44
43
  readonly 'read a file (local or owner/repo/path)': "search ./src/index.ts | search vercel/next.js/packages/next/src/server/config.ts";
45
- readonly 'read a remote file (exact)': "search vercel/next.js/README.md --content-view exact";
44
+ readonly 'read a remote file (exact)': "search vercel/next.js/README.md --content-view none";
46
45
  readonly 'semantics (local/materialized)': "search ./src/index.ts --op documentSymbols | search ./src/index.ts --op references --symbol runCLI --line 42";
47
- readonly 'artifact inspect/list': "search app.tgz --target artifacts --list | search dist/server.node --target artifacts --inspect";
48
46
  readonly 'PR diff (GitHub)': "search vercel/next.js#123 --target diff | search vercel/next.js --target diff --pr 123";
49
47
  readonly 'two-ref / two-file diff': "search src/a.ts src/b.ts --target diff | search owner/repo --target diff --base-ref <sha> --head-ref <sha> --path <file>";
50
48
  readonly 'structural AST (local \u2014 needs full node shape)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" ./src --lang ts";
@@ -81,16 +79,16 @@ export declare const OQL_SCHEMA_DOC: {
81
79
  readonly target: string;
82
80
  readonly from: "{ kind:\"local\", path } | { kind:\"github\", repo?, owner?, ref? } | { kind:\"materialized\", localPath, source? } | { kind:\"npm\" } — local row.path is relative to from.path; the pre-filled next.fetch carries the resolved ABSOLUTE path, so follow it directly rather than re-joining paths yourself";
83
81
  readonly scope: "{ path?, language?, include?, exclude?, excludeDir?, hidden?, noIgnore?, minDepth?, maxDepth? } — minDepth/maxDepth bound directory recursion depth (0-64)";
84
- readonly where: "filters for code/files only: text | regex | structural | field | all | any | not. To read a matched file slice, use fetch.content.match. For PR/commit/artifact text narrowing, use that target params hint.";
82
+ readonly where: "filters for code/files only: text | regex | structural | field | all | any | not. To read a matched file slice, use fetch.content.match. For PR/commit text narrowing, use that target params hint.";
85
83
  readonly materialize: "{ mode:\"never\"|\"auto\"|\"required\", strategy?:\"file\"|\"tree\"|\"subtree\"|\"repo\", allowFullRepo?, forceRefresh? }";
86
- readonly fetch: "{ content?: { contentView:\"exact\"|\"compact\"|\"symbols\", fullContent?, match?:{text|regex,case?}, range?:{startLine?,endLine?,contextLines?}, charOffset?, charLength? }, tree?:{ maxDepth?, pattern?, includeSizes?, extensions?, filesOnly?, directoriesOnly?, sortBy?:\"name\"|\"size\"|\"time\"|\"extension\", reverse? } } — read options for known files/trees; fetch.content.fullContent:true returns the WHOLE file in one shot (lossless, no char-window paging); to read the region around a string, anchor with fetch.content.match (NOT a top-level where, which is code/files only)";
84
+ readonly fetch: "{ content?: { contentView:\"none\"|\"standard\"|\"symbols\", fullContent?, match?:{text|regex,case?}, range?:{startLine?,endLine?,contextLines?}, charOffset?, charLength? }, tree?:{ maxDepth?, pattern?, includeSizes?, extensions?, filesOnly?, directoriesOnly?, sortBy?:\"name\"|\"size\"|\"time\"|\"extension\", reverse? } } — read options for known files/trees; fetch.content.fullContent:true returns the WHOLE file in one shot (lossless, no char-window paging); to read the region around a string, anchor with fetch.content.match (NOT a top-level where, which is code/files only)";
87
85
  readonly params: "target options (validated by OQL for common fields and by the backing tool exhaustively) — see params hints below";
88
86
  readonly select: "string[] projection of result/continuation fields";
89
87
  readonly view: "discovery | paginated | detailed";
90
88
  readonly controls: "{ search?: { countLinesPerFile?, countMatchesPerFile?, onlyMatching?, unique?, countUnique?, contextLines?, invertMatch?, matchWindow?, matchContentLength?, maxMatchesPerFile?, matchPage?, sort?:\"relevance\"|\"matchCount\"|\"path\"|\"modified\"|\"accessed\"|\"created\"|\"size\"|\"name\", sortReverse?, rankingProfile?, debugRanking? }, budget?: { maxFiles?, maxCandidates?, maxBytes?, maxMaterializedBytes?, maxPlanNodes?, maxBooleanExpansion?, timeoutMs? } } — output/cost controls; sort values \"size\"/\"name\" apply to target:\"files\" only (lowered to localFindFiles sortBy), the rest are code-search sorts";
91
89
  readonly limit: "number — total result cap where supported. Prefer itemsPerPage for paged research/graph/file-history continuations.";
92
90
  readonly page: "number — top-level page number for OQL windowing/continuations";
93
- readonly itemsPerPage: "number — page size for the target primary result domain. For code search this may be matched files, not individual matches; per-file match paging uses controls.search.matchPage. Per-target params expose backing-tool sub-pages only (filePage/commentPage/commitPage, entryPageNumber, scanOffset, etc.).";
91
+ readonly itemsPerPage: "number — page size for the target primary result domain. For code search this may be matched files, not individual matches; per-file match paging uses controls.search.matchPage. Per-target params expose backing-tool sub-pages only (filePage/commentPage/commitPage, etc.).";
94
92
  readonly explain: "boolean";
95
93
  };
96
94
  readonly params: {
@@ -99,7 +97,6 @@ export declare const OQL_SCHEMA_DOC: {
99
97
  readonly packages: "{ packageName?: string | keywords?: string[], mode?:\"lean\"|\"full\", page? } — backing tool npmSearch";
100
98
  readonly pullRequests: "{ state?:\"open\"|\"closed\"|\"merged\", author?, label?, keywordsToSearch?, prNumber?, reviewMode?, filePage?, commentPage?, commitPage?, limit?, page?, matchString?, matchScope?:\"body\"|\"title\"|\"comments\"|\"reviews\"|\"all\", content? } — backing tool ghHistoryResearch; matchString filters fetched PR title/body/comments/reviews per matchScope (default body), not a search-index query — no match → zeroMatches";
101
99
  readonly commits: "{ path?, branch?, since?, until?, includeDiff?, limit?, page?, filePage?, itemsPerPage?, matchString? } — backing tool ghHistoryResearch type:\"commits\"; matchString filters commit messages; repo/directory diffs page changed files per commit with filePage/itemsPerPage";
102
- readonly artifacts: "{ mode:\"inspect\"|\"list\"|\"extract\"|\"decompress\"|\"strings\"|\"unpack\", minLength?, entryPageNumber?, scanOffset?, charOffset?, charLength?, matchString? } — localBinaryInspect. matchString filters text-producing modes (extract/decompress/strings) over the current fetched payload. For large strings dumps, follow next.search on data.localPath for lossless ripgrep paging; next.artifactContent (charOffset) = next inline text window; next.artifactStrings (scanOffset) = next binary scan window. extract/unpack/decompress → tree at data.localPath (next.structure/next.files).";
103
100
  readonly diff: "{ prNumber, files? } (PR patch via ghHistoryResearch) | { baseRef, headRef, path } (direct two-ref file diff via ghGetFileContent + local line diff); neither shape -> invalidQuery repair";
104
101
  readonly research: "{ goal?, intent?:\"general\"|\"reachability\"|\"dependencies\"|\"symbols\", facets?:(\"symbols\"|\"files\"|\"dependencies\"|\"relations\")[], mode?:\"plan\"|\"analyze\"|\"prove\", maxFiles? } — TWO-PHASE: page:1+itemsPerPage:1 → data.summary (full-scope counts) and may include a bounded first packet page; page:2+ → data.packets[] continuation pages (candidates w/ retainedBy edges + per-packet next.*). Always evidence:\"candidate\"/answerReady:false (normal). Follow the row's pre-filled next.graph (proof:\"lsp\", proofLimit-bounded) to upgrade a page to LSP-proven proofStatus.";
105
102
  readonly graph: "{ goal?, intent?:\"general\"|\"reachability\"|\"dependencies\"|\"symbols\", facets?:(…)[], mode?:\"plan\"|\"analyze\"|\"prove\", maxFiles?, subject?, subjectKind?, relation?, verdict?, direction?:\"incoming\"|\"outgoing\"|\"both\", proof?:\"none\"|\"lsp\", proofLimit?, includePackets?, includeFacts?, includeEdges? } — UPGRADE PATH: run a research row's pre-filled next.graph directly. proof:\"lsp\" sets per-row proofStatus: \"confirmed-by-lsp\" (refs=0 in bounded workspace; still inspect entrypoints/exports before deletion), \"conflicting-evidence\" (refs>0 → retained, check retainedBy), \"needs-framework-graph\" (maybe an entrypoint). answerReady:false is normal — follow next.* for more pages/proof.";
@@ -132,7 +129,7 @@ export declare const OQL_SCHEMA_DOC: {
132
129
  textCase: "smart";
133
130
  regexDialectLocal: "rust";
134
131
  regexCase: "smart";
135
- contentView: "compact";
132
+ contentView: "standard";
136
133
  contentCharLength: number;
137
134
  matchContentLength: number;
138
135
  maxPlanNodes: number;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `where` predicate lowering for `octocode search`.
3
+ *
4
+ * Turns the flat shorthand flags (--pattern/--rule/--regex/text, plus the
5
+ * file-discovery field flags like --extension/--filename/--size-greater)
6
+ * into the canonical `Predicate` tree. Predicate precedence within a search
7
+ * term is pattern > rule > regex > text.
8
+ */
9
+ import type { Predicate } from '../types.js';
10
+ import type { SearchShorthand } from './types.js';
11
+ export declare function buildPredicate(parts: SearchShorthand): {
12
+ where?: Predicate;
13
+ } | {
14
+ error: string;
15
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `controls`/`fetch`/`materialize`/`view` lowering for `octocode search`.
3
+ *
4
+ * These are the non-predicate parts of an OQL query: search-result shaping
5
+ * (counting, dedup, context, ranking), content/tree fetch instructions, the
6
+ * materialize policy, and the discovery/paginated/detailed view mode.
7
+ */
8
+ import type { OqlInputQuery, QueryControls, QueryView } from '../types.js';
9
+ import type { SearchShorthand } from './types.js';
10
+ export declare function queryControls(parts: SearchShorthand): QueryControls | undefined;
11
+ export declare function fetchInstructions(parts: SearchShorthand): OqlInputQuery['fetch'] | undefined;
12
+ export declare function materializePolicy(parts: SearchShorthand): OqlInputQuery['materialize'] | undefined;
13
+ export declare function resolveView(value: string | undefined): {
14
+ view?: QueryView;
15
+ } | {
16
+ error: string;
17
+ };
18
+ export declare function hasContentFetch(parts: SearchShorthand): boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `params` lowering for `octocode search` — target-specific parameter bags.
3
+ *
4
+ * Every active target (semantics, repositories, packages, pullRequests,
5
+ * commits, diff, research/graph) accepts its own flat `params`
6
+ * shape; this maps the shared shorthand flags onto each target's fields.
7
+ */
8
+ import type { SearchShorthand } from './types.js';
9
+ export declare function targetParams(parts: SearchShorthand): Record<string, unknown>;
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Public shorthand input types for `octocode search`.
3
+ *
4
+ * `SearchShorthand` is the flat, CLI-flag-shaped bag of parts the shorthand
5
+ * lowering pipeline (see ../shorthand.ts) consumes; `ShorthandResult` is what
6
+ * it produces (either a lowered OQL input or a typed error).
7
+ */
8
+ import type { OqlInputBatch, OqlInputQuery } from '../types.js';
9
+ /** Corpus already classified by the caller (local path vs GitHub ref). */
10
+ export type ShorthandCorpus = {
11
+ kind: 'local';
12
+ path: string;
13
+ } | {
14
+ kind: 'github';
15
+ repo: string;
16
+ path?: string;
17
+ ref?: string;
18
+ } | {
19
+ kind: 'npm';
20
+ };
21
+ export interface SearchShorthand {
22
+ target?: string;
23
+ view?: string;
24
+ contentView?: string;
25
+ search?: string;
26
+ /** literal text term (used when no pattern/rule/regex flag is set) */
27
+ text?: string;
28
+ /** regex pattern (rust dialect unless pcre2) */
29
+ regex?: string;
30
+ pcre2?: boolean;
31
+ /** structural AST pattern (requires lang) */
32
+ pattern?: string;
33
+ /** structural rule, already parsed from JSON (requires lang) */
34
+ rule?: unknown;
35
+ lang?: string;
36
+ corpus: ShorthandCorpus;
37
+ materialize?: 'never' | 'auto' | 'required';
38
+ branch?: string;
39
+ forceRefresh?: boolean;
40
+ limit?: number;
41
+ page?: number;
42
+ itemsPerPage?: number;
43
+ include?: string[];
44
+ exclude?: string[];
45
+ excludeDir?: string[];
46
+ extension?: string;
47
+ filename?: string;
48
+ pathPattern?: string;
49
+ hidden?: boolean;
50
+ noIgnore?: boolean;
51
+ minDepth?: number;
52
+ maxDepth?: number;
53
+ empty?: boolean;
54
+ modifiedWithin?: string;
55
+ modifiedBefore?: string;
56
+ accessedWithin?: string;
57
+ sizeGreater?: string;
58
+ sizeLess?: string;
59
+ permissions?: string;
60
+ executable?: boolean;
61
+ readable?: boolean;
62
+ writable?: boolean;
63
+ details?: boolean;
64
+ showModified?: boolean;
65
+ caseInsensitive?: boolean;
66
+ caseSensitive?: boolean;
67
+ wholeWord?: boolean;
68
+ fixedString?: boolean;
69
+ multiline?: boolean;
70
+ multilineDotall?: boolean;
71
+ filesOnly?: boolean;
72
+ directoriesOnly?: boolean;
73
+ filesWithoutMatch?: boolean;
74
+ entryType?: 'file' | 'directory';
75
+ countLinesPerFile?: boolean;
76
+ countMatchesPerFile?: boolean;
77
+ onlyMatching?: boolean;
78
+ unique?: boolean;
79
+ countUnique?: boolean;
80
+ contextLines?: number;
81
+ invertMatch?: boolean;
82
+ matchWindow?: number;
83
+ matchContentLength?: number;
84
+ maxMatchesPerFile?: number;
85
+ matchPage?: number;
86
+ maxFiles?: number;
87
+ sort?: string;
88
+ sortReverse?: boolean;
89
+ rankingProfile?: string;
90
+ debugRanking?: boolean;
91
+ matchString?: string;
92
+ matchRegex?: boolean;
93
+ matchCaseSensitive?: boolean;
94
+ startLine?: number;
95
+ endLine?: number;
96
+ charOffset?: number;
97
+ charLength?: number;
98
+ fullContent?: boolean;
99
+ tree?: boolean;
100
+ includeSizes?: boolean;
101
+ op?: string;
102
+ symbol?: string;
103
+ symbolKind?: string;
104
+ uri?: string;
105
+ line?: number;
106
+ order?: number;
107
+ orderDirection?: string;
108
+ depth?: number;
109
+ workspaceRoot?: string;
110
+ format?: string;
111
+ owner?: string;
112
+ topic?: string[];
113
+ stars?: string;
114
+ forks?: string;
115
+ goodFirstIssues?: string;
116
+ license?: string;
117
+ created?: string;
118
+ updated?: string;
119
+ closed?: string;
120
+ mergedAt?: string;
121
+ size?: string;
122
+ match?: string[];
123
+ archived?: boolean;
124
+ visibility?: string;
125
+ concise?: boolean;
126
+ state?: string;
127
+ author?: string;
128
+ label?: string;
129
+ prNumber?: number;
130
+ base?: string;
131
+ head?: string;
132
+ draft?: boolean;
133
+ commentsContent?: boolean;
134
+ commitsContent?: boolean;
135
+ deep?: boolean;
136
+ patchFile?: string;
137
+ reviewMode?: string;
138
+ filePage?: number;
139
+ commentPage?: number;
140
+ commitPage?: number;
141
+ since?: string;
142
+ until?: string;
143
+ patches?: boolean;
144
+ baseRef?: string;
145
+ headRef?: string;
146
+ diffPath?: string;
147
+ intent?: string;
148
+ facets?: string[];
149
+ proof?: string;
150
+ proofLimit?: number;
151
+ includePackets?: boolean;
152
+ includeFacts?: boolean;
153
+ includeEdges?: boolean;
154
+ }
155
+ export type ShorthandResult = {
156
+ input: OqlInputQuery | OqlInputBatch;
157
+ } | {
158
+ error: string;
159
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Small stateless helpers shared across the shorthand lowering builders.
3
+ */
4
+ /** Drop `undefined` values so callers don't emit sparse-but-present keys. */
5
+ export declare function clean(input: Record<string, unknown>): Record<string, unknown>;
6
+ export declare function listFromComma(value: string): string[];
7
+ export declare function isTreeSort(value: string | undefined): value is 'name' | 'size' | 'time' | 'extension';
@@ -1,174 +1,5 @@
1
- /**
2
- * Shorthand lowering for `octocode search`.
3
- *
4
- * The CLI reads argv and resolves a target string to a corpus (local path vs
5
- * GitHub ref — the only step that needs the filesystem). Everything else —
6
- * which predicate the flags select, dialect, lang requirements, and assembling
7
- * the sugar object the normalizer accepts — lives here so it is owned once in
8
- * tools-core (not re-implemented in the interface) and is unit-testable without
9
- * argv or a terminal.
10
- */
11
- import { type OqlInputBatch, type OqlInputQuery } from './types.js';
12
- /** Corpus already classified by the caller (local path vs GitHub ref). */
13
- export type ShorthandCorpus = {
14
- kind: 'local';
15
- path: string;
16
- } | {
17
- kind: 'github';
18
- repo: string;
19
- path?: string;
20
- ref?: string;
21
- } | {
22
- kind: 'npm';
23
- };
24
- export interface SearchShorthand {
25
- target?: string;
26
- view?: string;
27
- contentView?: string;
28
- search?: string;
29
- /** literal text term (used when no pattern/rule/regex flag is set) */
30
- text?: string;
31
- /** regex pattern (rust dialect unless pcre2) */
32
- regex?: string;
33
- pcre2?: boolean;
34
- /** structural AST pattern (requires lang) */
35
- pattern?: string;
36
- /** structural rule, already parsed from JSON (requires lang) */
37
- rule?: unknown;
38
- lang?: string;
39
- corpus: ShorthandCorpus;
40
- materialize?: 'never' | 'auto' | 'required';
41
- branch?: string;
42
- forceRefresh?: boolean;
43
- limit?: number;
44
- page?: number;
45
- itemsPerPage?: number;
46
- include?: string[];
47
- exclude?: string[];
48
- excludeDir?: string[];
49
- extension?: string;
50
- filename?: string;
51
- pathPattern?: string;
52
- hidden?: boolean;
53
- noIgnore?: boolean;
54
- minDepth?: number;
55
- maxDepth?: number;
56
- empty?: boolean;
57
- modifiedWithin?: string;
58
- modifiedBefore?: string;
59
- accessedWithin?: string;
60
- sizeGreater?: string;
61
- sizeLess?: string;
62
- permissions?: string;
63
- executable?: boolean;
64
- readable?: boolean;
65
- writable?: boolean;
66
- details?: boolean;
67
- showModified?: boolean;
68
- caseInsensitive?: boolean;
69
- caseSensitive?: boolean;
70
- wholeWord?: boolean;
71
- fixedString?: boolean;
72
- multiline?: boolean;
73
- multilineDotall?: boolean;
74
- filesOnly?: boolean;
75
- directoriesOnly?: boolean;
76
- filesWithoutMatch?: boolean;
77
- entryType?: 'file' | 'directory';
78
- countLinesPerFile?: boolean;
79
- countMatchesPerFile?: boolean;
80
- onlyMatching?: boolean;
81
- unique?: boolean;
82
- countUnique?: boolean;
83
- contextLines?: number;
84
- invertMatch?: boolean;
85
- matchWindow?: number;
86
- matchContentLength?: number;
87
- maxMatchesPerFile?: number;
88
- matchPage?: number;
89
- maxFiles?: number;
90
- sort?: string;
91
- sortReverse?: boolean;
92
- rankingProfile?: string;
93
- debugRanking?: boolean;
94
- matchString?: string;
95
- matchRegex?: boolean;
96
- matchCaseSensitive?: boolean;
97
- startLine?: number;
98
- endLine?: number;
99
- charOffset?: number;
100
- charLength?: number;
101
- fullContent?: boolean;
102
- tree?: boolean;
103
- includeSizes?: boolean;
104
- op?: string;
105
- symbol?: string;
106
- symbolKind?: string;
107
- uri?: string;
108
- line?: number;
109
- order?: number;
110
- orderDirection?: string;
111
- depth?: number;
112
- workspaceRoot?: string;
113
- format?: string;
114
- owner?: string;
115
- topic?: string[];
116
- stars?: string;
117
- forks?: string;
118
- goodFirstIssues?: string;
119
- license?: string;
120
- created?: string;
121
- updated?: string;
122
- closed?: string;
123
- mergedAt?: string;
124
- size?: string;
125
- match?: string[];
126
- archived?: boolean;
127
- visibility?: string;
128
- concise?: boolean;
129
- state?: string;
130
- author?: string;
131
- label?: string;
132
- prNumber?: number;
133
- base?: string;
134
- head?: string;
135
- draft?: boolean;
136
- commentsContent?: boolean;
137
- commitsContent?: boolean;
138
- deep?: boolean;
139
- patchFile?: string;
140
- reviewMode?: string;
141
- filePage?: number;
142
- commentPage?: number;
143
- commitPage?: number;
144
- since?: string;
145
- until?: string;
146
- patches?: boolean;
147
- baseRef?: string;
148
- headRef?: string;
149
- diffPath?: string;
150
- artifactMode?: string;
151
- detailed?: boolean;
152
- verbose?: boolean;
153
- maxEntries?: number;
154
- minLength?: number;
155
- entryPageNumber?: number;
156
- scanOffset?: number;
157
- includeOffsets?: boolean;
158
- archiveFile?: string;
159
- intent?: string;
160
- facets?: string[];
161
- proof?: string;
162
- proofLimit?: number;
163
- includePackets?: boolean;
164
- includeFacts?: boolean;
165
- includeEdges?: boolean;
166
- }
167
- export type ShorthandResult = {
168
- input: OqlInputQuery | OqlInputBatch;
169
- } | {
170
- error: string;
171
- };
1
+ import type { SearchShorthand, ShorthandCorpus, ShorthandResult } from './shorthand/types.js';
2
+ export type { SearchShorthand, ShorthandCorpus, ShorthandResult };
172
3
  /**
173
4
  * Lower shorthand parts into the OQL sugar object. Predicate precedence:
174
5
  * pattern > rule > regex > text. Returns a typed error for invalid combos
@@ -1,17 +1,4 @@
1
- /**
2
- * Typed target-specific `params` schemas.
3
- *
4
- * Research targets (semantics/repositories/packages/pullRequests/commits/
5
- * artifacts/diff/research/graph) carry a `params` bag that the backing tool validates
6
- * exhaustively. These schemas type the documented common fields so a type
7
- * mistake (e.g. `prNumber:"abc"`) is caught at the OQL layer with a clear
8
- * `invalidQuery` instead of failing opaquely at the tool, while `.passthrough()`
9
- * keeps the backing tool the source of truth for the rest.
10
- */
11
- import { z } from 'zod';
12
1
  import type { OqlActiveTarget } from './types.js';
13
- /** Per-target params schema; targets without a `params` bag are absent. */
14
- export declare const TARGET_PARAM_SCHEMAS: Partial<Record<OqlActiveTarget, z.ZodTypeAny>>;
15
2
  /**
16
3
  * Validate a target's `params` bag against its typed schema. Returns `null` when
17
4
  * valid (or no schema applies), or a Zod-style error message string the caller
@@ -1,4 +1,4 @@
1
- import type { OqlQuery, Predicate } from '../../types.js';
1
+ import type { OqlQuery } from '../../types.js';
2
2
  import type { TransformResult } from '../types.js';
3
3
  export type GithubCodeSearchToolQuery = Record<string, unknown>;
4
4
  export type GithubCodeSearchTransformOptions = {
@@ -6,12 +6,4 @@ export type GithubCodeSearchTransformOptions = {
6
6
  unsupportedMessage?: string;
7
7
  unsupportedBackend?: string;
8
8
  };
9
- /**
10
- * Path-like field predicates (`basename`/`extension`/`path` with op `=`) map
11
- * directly onto GitHub code-search path qualifiers — the same provider route
12
- * OQL target:"files" uses. Returns the ghSearchCode param
13
- * fragment, or `null` if the predicate is not a provider-expressible path-field
14
- * equality (those still require materialization, per the planner files lane).
15
- */
16
- export declare function githubPathFieldParams(where: Predicate): GithubCodeSearchToolQuery | null;
17
9
  export declare function toGithubCodeSearchToolQuery(query: OqlQuery, options?: GithubCodeSearchTransformOptions): TransformResult<GithubCodeSearchToolQuery>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * OQL diagnostics — the coded, severity-ranked notices the planner/runner
3
+ * attach to a result envelope (unsupported predicates, truncation, auth,
4
+ * etc.), each optionally carrying a repair suggestion or continuation.
5
+ */
6
+ import type { OqlSearchInput } from './query.js';
7
+ import type { OqlContinuation } from './envelope.js';
8
+ export type DiagnosticCode = 'invalidQuery' | 'ambiguousSugar' | 'unknownField' | 'unsupportedTarget' | 'unsupportedPredicate' | 'unsupportedBoolean' | 'unsupportedScope' | 'negativeUniverseRequired' | 'residualNotExact' | 'fieldTypeMismatch' | 'requiresMaterialization' | 'vendorNoEquivalent' | 'lossyTransform' | 'unsupportedVendorPredicate' | 'responseShapeMismatch' | 'materializationNotAllowed' | 'materializationFailed' | 'providerUnindexed' | 'providerSemanticsApproximate' | 'partialResult' | 'contentTruncated' | 'matchTruncated' | 'planTruncated' | 'budgetExhausted' | 'parserFailed' | 'partialParse' | 'signatureUnsupported' | 'lspUnavailable' | 'staleCache' | 'sanitized' | 'rateLimited' | 'authRequired' | 'zeroMatches' | 'symbolNotFound';
9
+ export interface OqlDiagnostic {
10
+ code: DiagnosticCode;
11
+ severity: 'info' | 'warning' | 'error';
12
+ queryPath?: string;
13
+ predicateId?: string;
14
+ backend?: string;
15
+ message: string;
16
+ blocksAnswer: boolean;
17
+ repair?: {
18
+ message: string;
19
+ suggestedQuery?: OqlSearchInput;
20
+ };
21
+ continuation?: OqlContinuation;
22
+ }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * OQL result envelope — pagination, provenance, continuations, and the
3
+ * top-level `OqlResultEnvelope`/`OqlBatchResultEnvelope` shapes `runOqlSearch`
4
+ * returns.
5
+ */
6
+ import type { QuerySource } from './predicates.js';
7
+ import type { OqlCanonicalInput } from './query.js';
8
+ import type { OqlDiagnostic } from './diagnostics.js';
9
+ import type { OqlExplainPlan } from './planner.js';
10
+ import type { OqlProofGradedResultRow } from './recordRows.js';
11
+ export interface Pagination {
12
+ currentPage?: number;
13
+ totalPages?: number;
14
+ nextPage?: number;
15
+ itemsPerPage?: number;
16
+ totalItems?: number;
17
+ reportedTotalItems?: number;
18
+ reachableTotalItems?: number;
19
+ totalItemsKind?: string;
20
+ itemUnit?: string;
21
+ rowCount?: number;
22
+ reportedRowCount?: number;
23
+ totalItemsCapped?: boolean;
24
+ uniqueFileCount?: number;
25
+ hasMore: boolean;
26
+ next?: OqlContinuation;
27
+ }
28
+ export interface OqlProvenance {
29
+ backend: string;
30
+ source?: QuerySource;
31
+ predicateIds?: string[];
32
+ pushed?: string[];
33
+ residual?: string[];
34
+ routed?: string[];
35
+ materializedPath?: string;
36
+ cache?: 'hit' | 'miss' | 'refresh' | 'stale';
37
+ }
38
+ export interface OqlContinuation {
39
+ query: OqlCanonicalInput;
40
+ baseQueryId?: string;
41
+ queryIndex?: number;
42
+ why?: string;
43
+ confidence?: 'exact' | 'heuristic';
44
+ }
45
+ export interface OqlContinuationHint {
46
+ why: string;
47
+ confidence: 'exact' | 'heuristic';
48
+ }
49
+ export type EvidenceKind = 'proof' | 'partial' | 'candidate' | 'unsupported';
50
+ export interface OqlResultEnvelope {
51
+ queryId?: string;
52
+ queryIndex?: number;
53
+ results: OqlProofGradedResultRow[];
54
+ shared?: Record<string, unknown>;
55
+ pagination?: Pagination;
56
+ next?: Record<string, OqlContinuation>;
57
+ nextHints?: Record<string, OqlContinuationHint>;
58
+ diagnostics: OqlDiagnostic[];
59
+ provenance: OqlProvenance[];
60
+ evidence: {
61
+ answerReady: boolean;
62
+ complete: boolean;
63
+ kind: EvidenceKind;
64
+ };
65
+ plan?: OqlExplainPlan;
66
+ }
67
+ export interface OqlBatchResultEnvelope {
68
+ batchId?: string;
69
+ mode: 'independent' | 'merge';
70
+ children: Array<{
71
+ queryId: string;
72
+ queryIndex: number;
73
+ envelope: OqlResultEnvelope;
74
+ }>;
75
+ merged?: OqlResultEnvelope;
76
+ diagnostics: OqlDiagnostic[];
77
+ }
78
+ export type OqlRunResult = OqlResultEnvelope | OqlBatchResultEnvelope;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * OQL type guards — runtime discriminators for the input/output union types
3
+ * (single query vs batch, single envelope vs batch envelope).
4
+ */
5
+ import type { OqlBatch, OqlCanonicalInput, OqlInputBatch, OqlSearchInput } from './query.js';
6
+ import type { OqlBatchResultEnvelope, OqlRunResult } from './envelope.js';
7
+ export declare function isBatchInput(input: OqlSearchInput): input is OqlInputBatch;
8
+ export declare function isCanonicalBatch(input: OqlCanonicalInput): input is OqlBatch;
9
+ export declare function isBatchEnvelope(result: OqlRunResult): result is OqlBatchResultEnvelope;