@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,14 @@
1
+ import { OctokitWithThrottling } from './client.js';
2
+ /**
3
+ * Resolve an owner/repo to its canonical name, following GitHub repository
4
+ * renames/redirects (the Search API does NOT follow renames, so a search
5
+ * scoped to a stale name silently returns zero results — a false absence).
6
+ * `repos.get` transparently redirects to the new location, so its `full_name`
7
+ * is authoritative. Returns the original pair on any failure (network, 404,
8
+ * private) so callers degrade gracefully rather than blocking the search.
9
+ */
10
+ export declare function resolveCanonicalOwnerRepo(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string): Promise<{
11
+ owner: string;
12
+ repo: string;
13
+ renamed: boolean;
14
+ }>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Re-anchor GitHub text-match positions after the fragment has been
3
+ * transformed (sanitized/minified). GitHub's indices point into the RAW
4
+ * fragment; the fragment we return to the agent is not that string, so raw
5
+ * indices would point at the wrong text. Each position is re-located by
6
+ * searching for its matched TEXT in the transformed fragment (forward scan
7
+ * keeps repeated occurrences distinct and ordered). A match the transform
8
+ * removed (e.g. a comment the minifier stripped) is dropped rather than
9
+ * emitted with a stale offset — a missing anchor is honest, a wrong one lies.
10
+ */
11
+ export declare function recomputeMatchPositions(rawFragment: string, rawPositions: ReadonlyArray<readonly [number, number]>, transformedFragment: string): Array<[number, number]>;
@@ -4,5 +4,6 @@ import type { GitHubCodeSearchQuerySchema } from '@octocodeai/octocode-core/sche
4
4
  type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
5
5
  import type { WithOptionalMeta } from '../types/execution.js';
6
6
  import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
7
+ import { recomputeMatchPositions } from './codeSearch/matchPositions.js';
8
+ export { recomputeMatchPositions };
7
9
  export declare function searchGitHubCodeAPI(params: WithOptionalMeta<GitHubCodeSearchQuery>, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<OptimizedCodeSearchResult>>;
8
- export {};
@@ -0,0 +1,51 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
+ import type { GitHubAPIResponse, HistoryCommitFile } from './githubAPI.js';
3
+ export type CompareResult = {
4
+ type: 'compare';
5
+ owner: string;
6
+ repo: string;
7
+ base: string;
8
+ head: string;
9
+ /** ahead | behind | diverged | identical */
10
+ status: string;
11
+ aheadBy: number;
12
+ behindBy: number;
13
+ totalCommits: number;
14
+ commits: Array<{
15
+ sha: string;
16
+ messageHeadline: string;
17
+ author: string;
18
+ date: string;
19
+ }>;
20
+ /** File count when includeDiff is off (lean default). */
21
+ changedFiles?: number;
22
+ /** Per-file diffs when includeDiff is on (windowed + paginated). */
23
+ files?: HistoryCommitFile[];
24
+ /** File-list pagination when includeDiff is on. */
25
+ filesPagination?: {
26
+ currentPage: number;
27
+ totalPages: number;
28
+ itemsPerPage: number;
29
+ totalFiles: number;
30
+ hasMore: boolean;
31
+ nextFilePage?: number;
32
+ };
33
+ };
34
+ /**
35
+ * Compare mode of ghSearchCommits: diff two refs (base...head) via GitHub's
36
+ * compare endpoint. Returns ahead/behind counts, the commits between them, and
37
+ * a lean changed-file count (or full diffs when includeDiff is set).
38
+ */
39
+ export declare function compareRefs(params: {
40
+ owner: string;
41
+ repo: string;
42
+ base: string;
43
+ head: string;
44
+ includeDiff?: boolean;
45
+ /** Restrict the diff to a single file path (searchable scope). */
46
+ path?: string;
47
+ filePage?: number;
48
+ itemsPerPage?: number;
49
+ charOffset?: number;
50
+ charLength?: number;
51
+ }, authInfo?: AuthInfo): Promise<GitHubAPIResponse<CompareResult>>;
@@ -0,0 +1,4 @@
1
+ export declare function resolveDateWindow(value: string): {
2
+ value?: string;
3
+ warning?: string;
4
+ };
@@ -0,0 +1,45 @@
1
+ import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
+ import type { GitHubAPIResponse } from './githubAPI.js';
3
+ type DiscussionRow = {
4
+ number: number;
5
+ title: string;
6
+ url: string;
7
+ author?: string;
8
+ category?: string;
9
+ createdAt?: string;
10
+ updatedAt?: string;
11
+ /** True when a comment has been accepted as the answer (Q&A categories). */
12
+ answered?: true;
13
+ upvotes?: number;
14
+ comments?: number;
15
+ };
16
+ export type DiscussionsResult = {
17
+ type: 'discussions';
18
+ owner: string;
19
+ repo: string;
20
+ totalCount: number;
21
+ discussions: DiscussionRow[];
22
+ pagination: {
23
+ perPage: number;
24
+ hasMore: boolean;
25
+ /** Opaque cursor to pass back as `after` for the next page. */
26
+ nextCursor?: string;
27
+ };
28
+ /**
29
+ * Whether the repository has Discussions enabled at all. Omitted (not
30
+ * `false`) when the repo-level probe itself failed/was inconclusive — a
31
+ * `totalCount:0` response is otherwise ambiguous between "disabled" and
32
+ * "enabled, nothing posted yet", which this field disambiguates without a
33
+ * second call.
34
+ */
35
+ hasDiscussionsEnabled?: boolean;
36
+ };
37
+ type FetchDiscussionsParams = {
38
+ owner: string;
39
+ repo: string;
40
+ keywords?: string[];
41
+ perPage: number;
42
+ after?: string;
43
+ };
44
+ export declare function fetchDiscussions(params: FetchDiscussionsParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<DiscussionsResult>>;
45
+ export {};
@@ -15,8 +15,8 @@ export interface PRReviewInfo {
15
15
  user: string;
16
16
  state: string;
17
17
  body: string;
18
- submitted_at?: string;
19
- commit_id?: string;
18
+ submittedAt?: string;
19
+ commitId?: string;
20
20
  }
21
21
  export interface CommitFileInfo {
22
22
  filename: string;
@@ -57,7 +57,6 @@ export interface HistoryCommit {
57
57
  /** Present when the message body was cut at 500 chars — the '…' is a real cut. */
58
58
  messageTruncated?: true;
59
59
  messageHeadline: string;
60
- url: string;
61
60
  author: {
62
61
  name: string;
63
62
  email: string;
@@ -103,6 +102,8 @@ export interface HistoryResult {
103
102
  hasMore: boolean;
104
103
  nextPage?: number;
105
104
  };
105
+ /** Date-window / diff-fallback explanations (e.g. committer-date note). */
106
+ warnings?: string[];
106
107
  }
107
108
  export type GetContentParameters = RestEndpointMethodTypes['repos']['getContent']['parameters'];
108
109
  export type SearchCodeParameters = RestEndpointMethodTypes['search']['code']['parameters'];
@@ -183,12 +184,12 @@ export interface PRCommentItem {
183
184
  id: string;
184
185
  user: string;
185
186
  body: string;
186
- created_at: string;
187
- updated_at: string;
187
+ createdAt: string;
188
+ updatedAt: string;
188
189
  commentType?: 'discussion' | 'review_inline';
189
190
  path?: string;
190
191
  line?: number;
191
- in_reply_to_id?: number | null;
192
+ inReplyToId?: number | null;
192
193
  }
193
194
  export type GitHubPullRequestItem = Pick<IssueSearchResultItem, 'number' | 'title' | 'body' | 'state' | 'created_at' | 'updated_at' | 'closed_at' | 'url' | 'draft'> & {
194
195
  author: string;
@@ -223,7 +224,6 @@ export interface GitHubPullRequestsSearchParams {
223
224
  assignee?: string;
224
225
  mentions?: string;
225
226
  commenter?: string;
226
- involves?: string;
227
227
  'reviewed-by'?: string;
228
228
  'review-requested'?: string;
229
229
  head?: string;
@@ -234,7 +234,6 @@ export interface GitHubPullRequestsSearchParams {
234
234
  closed?: string;
235
235
  comments?: number | string;
236
236
  reactions?: number | string;
237
- interactions?: number | string;
238
237
  label?: string | string[];
239
238
  milestone?: string;
240
239
  language?: string;
@@ -242,12 +241,7 @@ export interface GitHubPullRequestsSearchParams {
242
241
  review?: 'none' | 'required' | 'approved' | 'changes_requested';
243
242
  locked?: boolean;
244
243
  visibility?: 'public' | 'private';
245
- 'team-mentions'?: string;
246
244
  project?: string;
247
- 'no-assignee'?: boolean;
248
- 'no-label'?: boolean;
249
- 'no-milestone'?: boolean;
250
- 'no-project'?: boolean;
251
245
  match?: ('title' | 'body' | 'comments')[];
252
246
  archived?: boolean;
253
247
  sort?: 'created' | 'updated' | 'best-match' | 'comments' | 'reactions';
@@ -0,0 +1,39 @@
1
+ import type { HistoryCommitFile } from '../githubAPI.js';
2
+ export declare function windowPatch(patch: string | undefined, charOffset: number | undefined, charLength: number | undefined): {
3
+ patch: string;
4
+ patchPagination?: {
5
+ charOffset: number;
6
+ charLength: number;
7
+ totalChars: number;
8
+ hasMore: boolean;
9
+ nextCharOffset?: number;
10
+ };
11
+ } | undefined;
12
+ /**
13
+ * Shape a commit's raw changed-file rows into the windowed, paginated
14
+ * `files` + `filesPagination` payload. Shared by repo/dir mode and the
15
+ * file-mode directory fallback so both emit identical structure.
16
+ */
17
+ export declare function shapeCommitDirFiles(rawFiles: ReadonlyArray<{
18
+ filename: string;
19
+ status?: string;
20
+ additions?: number;
21
+ deletions?: number;
22
+ patch?: string;
23
+ previous_filename?: string;
24
+ }>, params: {
25
+ filePage?: number;
26
+ itemsPerPage?: number;
27
+ charOffset?: number;
28
+ charLength?: number;
29
+ }): {
30
+ files: HistoryCommitFile[];
31
+ filesPagination: {
32
+ currentPage: number;
33
+ totalPages: number;
34
+ itemsPerPage: number;
35
+ totalFiles: number;
36
+ hasMore: boolean;
37
+ nextFilePage?: number;
38
+ };
39
+ };
@@ -11,6 +11,7 @@ type FetchHistoryParams = {
11
11
  since?: string;
12
12
  until?: string;
13
13
  author?: string;
14
+ committer?: string;
14
15
  page: number;
15
16
  perPage: number;
16
17
  filePage?: number;
@@ -3,8 +3,8 @@ export type IssueCommentRow = {
3
3
  id: string;
4
4
  user: string;
5
5
  body: string;
6
- created_at: string;
7
- updated_at: string;
6
+ createdAt: string;
7
+ updatedAt: string;
8
8
  commentType: 'discussion';
9
9
  };
10
10
  export type IssueRow = {
@@ -13,10 +13,9 @@ export type IssueRow = {
13
13
  state: string;
14
14
  author: string;
15
15
  labels: string[];
16
- created_at: string;
17
- updated_at: string;
18
- closed_at?: string;
19
- url: string;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ closedAt?: string;
20
19
  body?: string;
21
20
  comments?: IssueCommentRow[];
22
21
  contentPagination?: {
@@ -41,9 +40,10 @@ export type IssuesResult = {
41
40
  owner: string;
42
41
  repo: string;
43
42
  issues: IssueRow[] | string[];
44
- total_count?: number;
43
+ totalCount?: number;
45
44
  effectiveQuery?: string;
46
- incomplete_results?: boolean;
45
+ warnings?: string[];
46
+ incompleteResults?: boolean;
47
47
  pagination?: {
48
48
  currentPage: number;
49
49
  perPage: number;
@@ -44,27 +44,27 @@ interface TextPaginationInfo {
44
44
  nextCharOffset?: number;
45
45
  }
46
46
  export declare function formatPRForResponse(pr: GitHubPullRequestItem, options?: PRResponseFormatOptions): {
47
- _sanitization_warnings: string[];
48
- comment_details_paginated?: boolean;
49
- comment_details: {
50
- body_pagination?: TextPaginationInfo;
47
+ sanitizationWarnings: string[];
48
+ commentDetailsPaginated?: boolean;
49
+ commentDetails: {
50
+ bodyPagination?: TextPaginationInfo;
51
51
  body: string;
52
52
  id: string;
53
53
  user: string;
54
- created_at: string;
55
- updated_at: string;
54
+ createdAt: string;
55
+ updatedAt: string;
56
56
  commentType?: "discussion" | "review_inline";
57
57
  path?: string;
58
58
  line?: number;
59
- in_reply_to_id?: number | null;
59
+ inReplyToId?: number | null;
60
60
  }[];
61
- comment_details_shown: number;
62
- comment_details_total: number;
63
- commit_details: import("./githubAPI.js").CommitInfo[];
61
+ commentDetailsShown: number;
62
+ commentDetailsTotal: number;
63
+ commitDetails: import("./githubAPI.js").CommitInfo[];
64
64
  reviews: import("./githubAPI.js").PRReviewInfo[];
65
- file_changes: {
65
+ fileChanges: {
66
66
  filename: string;
67
- status: "modified" | "unchanged" | "added" | "removed" | "renamed" | "copied" | "changed";
67
+ status: "modified" | "added" | "removed" | "renamed" | "copied" | "changed" | "unchanged";
68
68
  additions: number;
69
69
  deletions: number;
70
70
  patch: string;
@@ -72,18 +72,18 @@ export declare function formatPRForResponse(pr: GitHubPullRequestItem, options?:
72
72
  commits: number;
73
73
  additions: number;
74
74
  deletions: number;
75
- changed_files: number;
76
- comment_details_breakdown: {
77
- inline_review: number;
75
+ changedFiles: number;
76
+ commentDetailsBreakdown: {
77
+ inlineReview: number;
78
78
  discussion: number;
79
79
  };
80
80
  comments: number;
81
- body_pagination?: TextPaginationInfo;
81
+ bodyPagination?: TextPaginationInfo;
82
82
  body: string;
83
- base_sha?: string;
84
- base_ref: string;
85
- head_sha?: string;
86
- head_ref: string;
83
+ baseSha?: string;
84
+ baseRef: string;
85
+ headSha?: string;
86
+ headRef: string;
87
87
  labels?: {
88
88
  id: number;
89
89
  name: string;
@@ -91,14 +91,13 @@ export declare function formatPRForResponse(pr: GitHubPullRequestItem, options?:
91
91
  }[];
92
92
  number: number;
93
93
  title: string;
94
- url: string;
95
94
  state: "open" | "closed";
96
95
  draft: boolean;
97
96
  merged: boolean;
98
- created_at: string;
99
- updated_at: string;
100
- closed_at: string;
101
- merged_at: string;
97
+ createdAt: string;
98
+ updatedAt: string;
99
+ closedAt: string;
100
+ mergedAt: string;
102
101
  author: string;
103
102
  };
104
103
  export declare function normalizeOwnerRepo(params: GitHubPullRequestsSearchParams): {
@@ -15,7 +15,6 @@ export declare abstract class BaseQueryBuilder {
15
15
  addEngagementFilters(params: {
16
16
  comments?: number | string;
17
17
  reactions?: number | string;
18
- interactions?: number | string;
19
18
  }): this;
20
19
  addOrganizationFilters(params: {
21
20
  label?: string | string[];
@@ -9,21 +9,15 @@ export type IssueSearchParams = {
9
9
  assignee?: string;
10
10
  mentions?: string;
11
11
  commenter?: string;
12
- involves?: string;
13
12
  created?: string;
14
13
  updated?: string;
15
14
  closed?: string;
16
15
  comments?: number | string;
17
16
  reactions?: number | string;
18
- interactions?: number | string;
19
17
  label?: string | string[];
20
18
  milestone?: string;
21
19
  locked?: boolean;
22
20
  visibility?: 'public' | 'private';
23
- 'no-assignee'?: boolean;
24
- 'no-label'?: boolean;
25
- 'no-milestone'?: boolean;
26
- 'no-project'?: boolean;
27
21
  match?: ('title' | 'body' | 'comments')[];
28
22
  archived?: boolean;
29
23
  sort?: 'created' | 'updated' | 'best-match' | 'comments' | 'reactions';
@@ -1,5 +1,11 @@
1
1
  import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
2
2
  import type { GitHubAPIResponse } from './githubAPI.js';
3
+ type ReleaseAsset = {
4
+ name: string;
5
+ size: number;
6
+ downloadCount: number;
7
+ url: string;
8
+ };
3
9
  type ReleaseRow = {
4
10
  tagName: string;
5
11
  name?: string;
@@ -8,7 +14,8 @@ type ReleaseRow = {
8
14
  draft?: true;
9
15
  /** Marks the release GitHub reports as "latest" (stable, non-prerelease). */
10
16
  latest?: true;
11
- url?: string;
17
+ /** Downloadable assets (opt-in via includeAssets). */
18
+ assets?: ReleaseAsset[];
12
19
  };
13
20
  export type ReleasesResult = {
14
21
  type: 'releases';
@@ -32,6 +39,7 @@ type FetchReleasesParams = {
32
39
  repo: string;
33
40
  page: number;
34
41
  perPage: number;
42
+ includeAssets?: boolean;
35
43
  };
36
44
  export declare function fetchReleases(params: FetchReleasesParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<ReleasesResult>>;
37
45
  export {};
@@ -1,3 +1,9 @@
1
1
  export declare function normalizeResponseHeaders(headers: unknown): Record<string, string>;
2
+ /**
3
+ * A one-line rate-limit warning when the quota on THIS response is low — read
4
+ * from the `x-ratelimit-*` headers GitHub already returns, so it costs no extra
5
+ * API call. Returns undefined when quota is healthy or the headers are absent.
6
+ */
7
+ export declare function rateLimitWarning(headers: unknown): string | undefined;
2
8
  /** Prefer strong ETag; fall back to weak / case variants GitHub may emit. */
3
9
  export declare function extractEtag(headers: unknown): string | undefined;
package/dist/index.d.ts CHANGED
@@ -55,7 +55,11 @@ export * from './tools/github_search_pull_requests/contentRequest.js';
55
55
  export * from './tools/github_search_pull_requests/contentResponse.js';
56
56
  export * from './tools/github_search_pull_requests/execution.js';
57
57
  export * from './tools/github_search_pull_requests/scheme.js';
58
+ export * from './tools/github_search_pull_requests/splitSchemes.js';
59
+ export * from './tools/github_search_pull_requests/splitExecutions.js';
58
60
  export * from './tools/github_search_pull_requests/types.js';
61
+ export * from './tools/github_search_discussions/scheme.js';
62
+ export * from './tools/github_search_discussions/execution.js';
59
63
  export * from './tools/github_search_repos/execution.js';
60
64
  export * from './tools/github_search_repos/scheme.js';
61
65
  export * from './tools/github_view_repo_structure/constants.js';
@@ -69,6 +73,9 @@ export * from './tools/local_fetch_content/scheme.js';
69
73
  export * from './tools/local_find_files/execution.js';
70
74
  export * from './tools/local_find_files/findFiles.js';
71
75
  export * from './tools/local_find_files/scheme.js';
76
+ export * from './tools/local_dead_code/execution.js';
77
+ export * from './tools/local_dead_code/local_dead_code.js';
78
+ export * from './tools/local_dead_code/scheme.js';
72
79
  export * from './tools/local_ripgrep/execution.js';
73
80
  export * from './tools/local_ripgrep/patternValidation.js';
74
81
  export * from './tools/local_ripgrep/ripgrepExecutor.js';
@@ -79,7 +86,6 @@ export * from './tools/local_view_structure/execution.js';
79
86
  export * from './tools/local_view_structure/local_view_structure.js';
80
87
  export * from './tools/local_view_structure/scheme.js';
81
88
  export * from './tools/local_view_structure/structureFilters.js';
82
- export * from './tools/oql_search/execution.js';
83
89
  export * from './tools/lsp/semantic_content/execution.js';
84
90
  export * from './tools/lsp/semantic_content/index.js';
85
91
  export * from './tools/lsp/semantic_content/scheme.js';
@@ -102,8 +108,6 @@ export * from './tools/toolMetadata/types.js';
102
108
  export * from './tools/directToolCatalog.js';
103
109
  export * from './tools/toolNames.js';
104
110
  export * from './tools/utils.js';
105
- export { OqlSearchInputSchema } from './oql/schema.js';
106
- export type { OqlSearchInput } from './oql/types.js';
107
111
  export * from './types/bulk.js';
108
112
  export * from './types/execution.js';
109
113
  export * from './types/promise.js';
@@ -159,12 +163,9 @@ export { maskSensitiveData } from '@octocodeai/octocode-engine/mask';
159
163
  export { configureSecurity } from '@octocodeai/octocode-engine/withSecurityValidation';
160
164
  export type { OAuthToken, StoredCredentials, StoreResult, DeleteResult, CredentialsStore, TokenSource, GetCredentialsOptions, ResolvedToken, TokenWithRefreshResult, ResolvedTokenWithRefresh, RefreshResult, FullTokenResolution, GhCliTokenGetter, } from './shared/credentials/index.js';
161
165
  export { storeCredentials, getCredentials, getCredentialsSync, deleteCredentials, updateToken, invalidateCredentialsCache, getToken, getTokenSync, resolveToken, getTokenWithRefresh, resolveTokenWithRefresh, refreshAuthToken, resolveTokenFull, resetTokenResolution, listStoredHosts, listStoredHostsSync, hasCredentials, hasCredentialsSync, isTokenExpired, isRefreshTokenExpired, getCredentialsFilePath, readCredentialsStore, encrypt, decrypt, ensureOctocodeDir, OCTOCODE_DIR, CREDENTIALS_FILE, KEY_FILE, getGhCliToken, } from './shared/credentials/index.js';
162
- export { ENV_TOKEN_VARS, type EnvTokenVar, getTokenFromEnv, getEnvTokenSource, hasEnvToken, resolveEnvToken, } from '@octocodeai/config';
163
166
  export { isWindows, isMac, isLinux, HOME, getAppDataPath, getLocalAppDataPath, getPlatformName, getArchitecture, } from './shared/platform/index.js';
164
167
  export type { ToolCharSavingsStats, GitHubCacheHitStats, StatsCounterMap, SessionTotalUsageStats, SessionStats, PersistedSession, PersistedStats, SessionUpdateResult, SessionOptions, } from './shared/session/index.js';
165
168
  export { SESSION_FILE, STATS_FILE, getSessionId, getOrCreateSession, updateSessionStats, resetSessionStats, flushSession, flushSessionSync, deleteSession, incrementToolCalls, incrementErrors, incrementRateLimits, incrementRateLimitByProvider, incrementGitHubCacheHits, incrementGitHubCacheRateLimits, incrementPackageRegistryFailures, incrementToolCharSavings, _resetSessionState, } from './shared/session/index.js';
166
- export type { OctocodeConfig, ResolvedConfig, ValidationResult, LoadConfigResult, GitHubConfigOptions, LocalConfigOptions, ToolsConfigOptions, NetworkConfigOptions, LspConfigOptions, OutputConfigOptions, OutputPaginationConfigOptions, RequiredGitHubConfig, RequiredLocalConfig, RequiredToolsConfig, RequiredNetworkConfig, RequiredLspConfig, RequiredOutputConfig, RequiredOutputPaginationConfig, RuntimeSurface, } from '@octocodeai/config';
167
- export { CONFIG_SCHEMA_VERSION, CONFIG_FILE_NAME, DEFAULT_CONFIG, DEFAULT_GITHUB_CONFIG, DEFAULT_LOCAL_CONFIG, DEFAULT_TOOLS_CONFIG, DEFAULT_NETWORK_CONFIG, DEFAULT_LSP_CONFIG, DEFAULT_OUTPUT_CONFIG, MIN_TIMEOUT, MAX_TIMEOUT, MIN_RETRIES, MAX_RETRIES, MIN_OUTPUT_DEFAULT_CHAR_LENGTH, MAX_OUTPUT_DEFAULT_CHAR_LENGTH, getConfigFilePath, loadConfig, loadConfigSync, configExists, validateConfig, getConfig, getConfigSync, reloadConfig, resolveConfig, resolveConfigSync, invalidateConfigCache, getConfigValue, _resetConfigCache, _getCacheState, setRuntimeSurface, getRuntimeSurface, } from '@octocodeai/config';
168
169
  export { OctocodeConfigSchema } from './shared/config/schemas.js';
169
170
  export { OCTOCODE_HOME, getDefaultOctocodeHome, getOctocodeDir, paths, ensureHome, ensureTmp, ensureClone, ensureRepos, ensureTree, } from './shared/paths.js';
170
171
  export { getDirectorySizeBytes, formatBytes } from './shared/fs-utils.js';