@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.
- package/README.md +266 -123
- package/dist/direct.d.ts +1 -1
- package/dist/direct.js +51 -36
- package/dist/github/canonicalRepo.d.ts +14 -0
- package/dist/github/codeSearch/matchPositions.d.ts +11 -0
- package/dist/github/codeSearch.d.ts +2 -1
- package/dist/github/compare.d.ts +51 -0
- package/dist/github/dateWindow.d.ts +4 -0
- package/dist/github/discussions.d.ts +45 -0
- package/dist/github/githubAPI.d.ts +7 -13
- package/dist/github/history/commitFiles.d.ts +39 -0
- package/dist/github/history.d.ts +1 -0
- package/dist/github/issues/types.d.ts +8 -8
- package/dist/github/prTransformation.d.ts +24 -25
- package/dist/github/queryBuilders/base.d.ts +0 -1
- package/dist/github/queryBuilders/issues.d.ts +0 -6
- package/dist/github/releases.d.ts +9 -1
- package/dist/github/responseHeaders.d.ts +6 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +55 -40
- package/dist/providers/github/githubPullRequests.d.ts +9 -0
- package/dist/providers/github/paginationMetadata.d.ts +6 -5
- package/dist/providers/providerQueries.d.ts +11 -6
- package/dist/providers/providerResults.d.ts +9 -1
- package/dist/schema.d.ts +0 -1
- package/dist/schema.js +1 -2
- package/dist/scheme/pagination.d.ts +5 -13
- package/dist/scheme/responseEnvelope.d.ts +28 -22
- package/dist/security/bridge.d.ts +3 -2
- package/dist/shared/config/index.d.ts +0 -1
- package/dist/shared/config/index.js +1 -1
- package/dist/shared/languageSelectors/classify.d.ts +2 -2
- package/dist/shared/languageSelectors/data.d.ts +4 -4
- package/dist/shared/languageSelectors.d.ts +1 -1
- package/dist/shared/paths.d.ts +1 -4
- package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +10 -11
- package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +5 -0
- package/dist/tools/directToolCatalog.meta.d.ts +1 -0
- package/dist/tools/github_clone_repo/contentSize.d.ts +9 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +28 -80
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +4 -3
- package/dist/tools/github_fetch_content/scheme.d.ts +92 -140
- package/dist/tools/github_fetch_content/types.d.ts +2 -1
- package/dist/tools/github_search_code/scheme.d.ts +39 -87
- package/dist/tools/github_search_discussions/execution.d.ts +15 -0
- package/dist/tools/github_search_discussions/scheme.d.ts +16 -0
- package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +3 -18
- package/dist/tools/github_search_pull_requests/scheme.d.ts +97 -119
- package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +8 -0
- package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +219 -0
- package/dist/tools/github_search_pull_requests/types.d.ts +28 -29
- package/dist/tools/github_search_repos/execution.d.ts +0 -2
- package/dist/tools/github_search_repos/scheme.d.ts +36 -64
- package/dist/tools/github_view_repo_structure/scheme.d.ts +37 -66
- package/dist/tools/local_dead_code/deadCodeScan.d.ts +26 -0
- package/dist/tools/local_dead_code/entrypoints.d.ts +16 -0
- package/dist/tools/local_dead_code/execution.d.ts +4 -0
- package/dist/tools/local_dead_code/graphBuilder.d.ts +43 -0
- package/dist/tools/local_dead_code/importResolver.d.ts +6 -0
- package/dist/tools/local_dead_code/local_dead_code.d.ts +5 -0
- package/dist/tools/local_dead_code/reachability.d.ts +21 -0
- package/dist/tools/local_dead_code/retention.d.ts +22 -0
- package/dist/tools/local_dead_code/scheme.d.ts +51 -0
- package/dist/tools/local_dead_code/types.d.ts +56 -0
- package/dist/tools/local_fetch_content/execution.d.ts +0 -1
- package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +6 -0
- package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +9 -1
- package/dist/tools/local_fetch_content/fetchContent.d.ts +0 -1
- package/dist/tools/local_fetch_content/scheme.d.ts +28 -90
- package/dist/tools/local_find_files/execution.d.ts +0 -1
- package/dist/tools/local_find_files/findFiles.d.ts +0 -3
- package/dist/tools/local_find_files/findFilesNext.d.ts +26 -0
- package/dist/tools/local_find_files/pathPatternBraces.d.ts +20 -0
- package/dist/tools/local_find_files/scheme.d.ts +19 -81
- package/dist/tools/local_ripgrep/captureBudget.d.ts +25 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +1 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +1 -1
- package/dist/tools/local_ripgrep/scheme.d.ts +89 -190
- package/dist/tools/local_view_structure/execution.d.ts +0 -1
- package/dist/tools/local_view_structure/local_view_structure.d.ts +0 -1
- package/dist/tools/local_view_structure/scheme.d.ts +34 -87
- package/dist/tools/local_view_structure/structureFilters.d.ts +2 -4
- package/dist/tools/local_view_structure/structureResponse.d.ts +1 -0
- package/dist/tools/local_view_structure/viewStructureNext.d.ts +25 -0
- package/dist/tools/lsp/semantic_content/index.d.ts +2 -1
- package/dist/tools/lsp/semantic_content/scheme.d.ts +167 -642
- package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +8 -2
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +2 -1
- package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +17 -1
- package/dist/tools/lsp/semantic_content/semanticNext.d.ts +2 -0
- package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +1 -1
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +14 -2
- package/dist/tools/lsp/shared/semanticTypes.d.ts +14 -1
- package/dist/tools/package_search/execution.d.ts +9 -6
- package/dist/tools/package_search/queryHelpers.d.ts +8 -0
- package/dist/tools/package_search/scheme.d.ts +30 -86
- package/dist/tools/providerMappers/codeSearch.d.ts +0 -1
- package/dist/tools/providerMappers/pullRequests.d.ts +0 -13
- package/dist/tools/providerMappers/repoSearch.d.ts +1 -5
- package/dist/tools/providerMappers/repoStructure.d.ts +4 -0
- package/dist/tools/toolCatalogFactory.d.ts +25 -0
- package/dist/tools/toolConfig.d.ts +9 -24
- package/dist/tools/toolNames.d.ts +2 -2
- package/dist/tools/toolSchemaImports.d.ts +3 -1
- package/dist/types/execution.d.ts +1 -0
- package/dist/types/toolOutput.d.ts +38 -0
- package/dist/utils/contextUtils.d.ts +6 -0
- package/dist/utils/core/types.d.ts +4 -0
- package/dist/utils/file/configFiles.d.ts +70 -0
- package/dist/utils/jsSymbolNames.d.ts +6 -0
- package/package.json +4 -8
- package/dist/oql/adapters/compile.d.ts +0 -25
- package/dist/oql/adapters/github/execute.d.ts +0 -16
- package/dist/oql/adapters/github/provider-diagnostics.d.ts +0 -14
- package/dist/oql/adapters/github/shared.d.ts +0 -75
- package/dist/oql/adapters/github.d.ts +0 -14
- package/dist/oql/adapters/graphProof.d.ts +0 -6
- package/dist/oql/adapters/graphView/filters.d.ts +0 -25
- package/dist/oql/adapters/graphView/nativeEdges.d.ts +0 -5
- package/dist/oql/adapters/graphView.d.ts +0 -29
- package/dist/oql/adapters/local/code.d.ts +0 -3
- package/dist/oql/adapters/local/codeBoolean.d.ts +0 -3
- package/dist/oql/adapters/local/fileRowOps.d.ts +0 -11
- package/dist/oql/adapters/local/files.d.ts +0 -3
- package/dist/oql/adapters/local/filesBoolean.d.ts +0 -10
- package/dist/oql/adapters/local/filesContentLeaf.d.ts +0 -12
- package/dist/oql/adapters/local/filesUniverse.d.ts +0 -6
- package/dist/oql/adapters/local/findToolType.d.ts +0 -10
- package/dist/oql/adapters/local/predicates.d.ts +0 -18
- package/dist/oql/adapters/local/scope.d.ts +0 -14
- package/dist/oql/adapters/local/searchToolType.d.ts +0 -7
- package/dist/oql/adapters/local/structureContent.d.ts +0 -6
- package/dist/oql/adapters/local/types.d.ts +0 -34
- package/dist/oql/adapters/local.d.ts +0 -4
- package/dist/oql/adapters/materialize.d.ts +0 -11
- package/dist/oql/adapters/pagination.d.ts +0 -21
- package/dist/oql/adapters/researchTargets/diff.d.ts +0 -16
- package/dist/oql/adapters/researchTargets/graph.d.ts +0 -3
- package/dist/oql/adapters/researchTargets/history.d.ts +0 -20
- package/dist/oql/adapters/researchTargets/pagination.d.ts +0 -54
- package/dist/oql/adapters/researchTargets/repositories.d.ts +0 -4
- package/dist/oql/adapters/researchTargets/research.d.ts +0 -3
- package/dist/oql/adapters/researchTargets/rows.d.ts +0 -16
- package/dist/oql/adapters/researchTargets/semantics.d.ts +0 -3
- package/dist/oql/adapters/researchTargets/shared.d.ts +0 -11
- package/dist/oql/adapters/researchTargets.d.ts +0 -8
- package/dist/oql/adapters/resultMap.d.ts +0 -27
- package/dist/oql/adapters/ruleYaml.d.ts +0 -11
- package/dist/oql/adapters/runner.d.ts +0 -21
- package/dist/oql/capabilities.d.ts +0 -31
- package/dist/oql/defaults.d.ts +0 -26
- package/dist/oql/diagnostics.d.ts +0 -25
- package/dist/oql/diffLanes.d.ts +0 -29
- package/dist/oql/envelope.d.ts +0 -21
- package/dist/oql/features.d.ts +0 -7
- package/dist/oql/index.d.ts +0 -27
- package/dist/oql/index.js +0 -47
- package/dist/oql/normalize/batch.d.ts +0 -2
- package/dist/oql/normalize/materialize.d.ts +0 -2
- package/dist/oql/normalize/params.d.ts +0 -2
- package/dist/oql/normalize/query.d.ts +0 -2
- package/dist/oql/normalize/scope.d.ts +0 -2
- package/dist/oql/normalize/shared.d.ts +0 -7
- package/dist/oql/normalize/source.d.ts +0 -2
- package/dist/oql/normalize/where.d.ts +0 -2
- package/dist/oql/normalize.d.ts +0 -20
- package/dist/oql/planner/planDiagnostics.d.ts +0 -13
- package/dist/oql/planner/predicateRouting.d.ts +0 -35
- package/dist/oql/planner.d.ts +0 -7
- package/dist/oql/predicateUtils.d.ts +0 -3
- package/dist/oql/research/analyze/manifest-scan.d.ts +0 -4
- package/dist/oql/research/analyze/source-graph.d.ts +0 -7
- package/dist/oql/research/analyze/symbol-scoring.d.ts +0 -4
- package/dist/oql/research/analyze/types.d.ts +0 -163
- package/dist/oql/research/analyze/utils.d.ts +0 -16
- package/dist/oql/research/analyze.d.ts +0 -3
- package/dist/oql/research/packets/builders.d.ts +0 -4
- package/dist/oql/research/packets/types.d.ts +0 -91
- package/dist/oql/research/packets.d.ts +0 -21
- package/dist/oql/run/batch.d.ts +0 -3
- package/dist/oql/run/continuations/records.d.ts +0 -19
- package/dist/oql/run/continuations/registry.d.ts +0 -22
- package/dist/oql/run/continuations/semantics.d.ts +0 -3
- package/dist/oql/run/continuations/types.d.ts +0 -12
- package/dist/oql/run/dryRun.d.ts +0 -11
- package/dist/oql/run/paths.d.ts +0 -15
- package/dist/oql/run/proofGrades.d.ts +0 -8
- package/dist/oql/run/select.d.ts +0 -10
- package/dist/oql/run/single.d.ts +0 -22
- package/dist/oql/run.d.ts +0 -5
- package/dist/oql/schema/predicates.d.ts +0 -12
- package/dist/oql/schema.d.ts +0 -1049
- package/dist/oql/schemeText.d.ts +0 -152
- package/dist/oql/shorthand/predicates.d.ts +0 -15
- package/dist/oql/shorthand/query-controls.d.ts +0 -18
- package/dist/oql/shorthand/target-params.d.ts +0 -9
- package/dist/oql/shorthand/types.d.ts +0 -159
- package/dist/oql/shorthand/utils.d.ts +0 -7
- package/dist/oql/shorthand.d.ts +0 -8
- package/dist/oql/targetParams.d.ts +0 -7
- package/dist/oql/transformers/contract.d.ts +0 -19
- package/dist/oql/transformers/github/code.d.ts +0 -9
- package/dist/oql/transformers/github/common.d.ts +0 -14
- package/dist/oql/transformers/language.d.ts +0 -1
- package/dist/oql/transformers/registry.d.ts +0 -16
- package/dist/oql/transformers/types.d.ts +0 -11
- package/dist/oql/types/diagnostics.d.ts +0 -22
- package/dist/oql/types/envelope.d.ts +0 -78
- package/dist/oql/types/guards.d.ts +0 -9
- package/dist/oql/types/planner.d.ts +0 -46
- package/dist/oql/types/predicates.d.ts +0 -93
- package/dist/oql/types/query.d.ts +0 -143
- package/dist/oql/types/recordData.d.ts +0 -127
- package/dist/oql/types/recordRows.d.ts +0 -48
- package/dist/oql/types/results.d.ts +0 -118
- package/dist/oql/types/targets.d.ts +0 -22
- package/dist/oql/types.d.ts +0 -27
- package/dist/tools/oql_search/execution.d.ts +0 -7
- 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,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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
187
|
-
|
|
187
|
+
createdAt: string;
|
|
188
|
+
updatedAt: string;
|
|
188
189
|
commentType?: 'discussion' | 'review_inline';
|
|
189
190
|
path?: string;
|
|
190
191
|
line?: number;
|
|
191
|
-
|
|
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
|
+
};
|
package/dist/github/history.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export type IssueCommentRow = {
|
|
|
3
3
|
id: string;
|
|
4
4
|
user: string;
|
|
5
5
|
body: string;
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
43
|
+
totalCount?: number;
|
|
45
44
|
effectiveQuery?: string;
|
|
46
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
sanitizationWarnings: string[];
|
|
48
|
+
commentDetailsPaginated?: boolean;
|
|
49
|
+
commentDetails: {
|
|
50
|
+
bodyPagination?: TextPaginationInfo;
|
|
51
51
|
body: string;
|
|
52
52
|
id: string;
|
|
53
53
|
user: string;
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
createdAt: string;
|
|
55
|
+
updatedAt: string;
|
|
56
56
|
commentType?: "discussion" | "review_inline";
|
|
57
57
|
path?: string;
|
|
58
58
|
line?: number;
|
|
59
|
-
|
|
59
|
+
inReplyToId?: number | null;
|
|
60
60
|
}[];
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
commentDetailsShown: number;
|
|
62
|
+
commentDetailsTotal: number;
|
|
63
|
+
commitDetails: import("./githubAPI.js").CommitInfo[];
|
|
64
64
|
reviews: import("./githubAPI.js").PRReviewInfo[];
|
|
65
|
-
|
|
65
|
+
fileChanges: {
|
|
66
66
|
filename: string;
|
|
67
|
-
status: "modified" | "
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
changedFiles: number;
|
|
76
|
+
commentDetailsBreakdown: {
|
|
77
|
+
inlineReview: number;
|
|
78
78
|
discussion: number;
|
|
79
79
|
};
|
|
80
80
|
comments: number;
|
|
81
|
-
|
|
81
|
+
bodyPagination?: TextPaginationInfo;
|
|
82
82
|
body: string;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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): {
|
|
@@ -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
|
-
|
|
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';
|