@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.
- package/README.md +22 -50
- package/dist/direct.js +33 -38
- package/dist/github/botFilter.d.ts +1 -0
- package/dist/github/client.d.ts +6 -0
- package/dist/github/directoryFetch/fetchDirectoryContents.d.ts +3 -0
- package/dist/github/directoryFetch/fetchFileContentToDisk.d.ts +3 -0
- package/dist/github/directoryFetch/helpers.d.ts +35 -0
- package/dist/github/directoryFetch.d.ts +3 -6
- package/dist/github/fileContentPagination.d.ts +9 -0
- package/dist/github/fileContentProcess.d.ts +1 -8
- package/dist/github/fileContentRaw/fetch.d.ts +20 -0
- package/dist/github/fileContentRaw/pathSuggestions.d.ts +3 -0
- package/dist/github/fileContentRaw.d.ts +2 -12
- package/dist/github/githubAPI.d.ts +4 -1
- package/dist/github/history.d.ts +6 -2
- package/dist/github/issues/fetchers.d.ts +7 -0
- package/dist/github/issues/helpers.d.ts +32 -0
- package/dist/github/issues/orchestrator.d.ts +4 -0
- package/dist/github/issues/types.d.ts +72 -0
- package/dist/github/issues.d.ts +3 -0
- package/dist/github/prContentFetcher/comments.d.ts +11 -0
- package/dist/github/prContentFetcher/commits.d.ts +27 -0
- package/dist/github/prContentFetcher/flags.d.ts +21 -0
- package/dist/github/prContentFetcher/transform.d.ts +5 -0
- package/dist/github/prContentFetcher.d.ts +2 -5
- package/dist/github/pullRequestSearch/restSearch.d.ts +6 -0
- package/dist/github/pullRequestSearch.d.ts +1 -1
- package/dist/github/queryBuilders/base.d.ts +25 -0
- package/dist/github/queryBuilders/codeAndRepo.d.ts +20 -0
- package/dist/github/queryBuilders/issues.d.ts +42 -0
- package/dist/github/queryBuilders/pullRequests.d.ts +13 -0
- package/dist/github/queryBuilders.d.ts +4 -12
- package/dist/github/releases.d.ts +37 -0
- package/dist/github/repoStructure/contentResolution.d.ts +12 -0
- package/dist/github/repoStructure/fetchOrchestration.d.ts +7 -0
- package/dist/github/repoStructure/resultBuilder.d.ts +22 -0
- package/dist/github/repoStructure.d.ts +1 -7
- package/dist/github/repoStructureTree.d.ts +38 -0
- package/dist/github/responseHeaders.d.ts +2 -0
- package/dist/github/searchKeyword.d.ts +2 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.js +35 -40
- package/dist/oql/adapters/github/execute.d.ts +16 -0
- package/dist/oql/adapters/github/provider-diagnostics.d.ts +14 -0
- package/dist/oql/adapters/github/shared.d.ts +75 -0
- package/dist/oql/adapters/github.d.ts +11 -0
- package/dist/oql/adapters/graphView/filters.d.ts +25 -0
- package/dist/oql/adapters/graphView/nativeEdges.d.ts +5 -0
- package/dist/oql/adapters/graphView.d.ts +17 -16
- package/dist/oql/adapters/local/code.d.ts +3 -0
- package/dist/oql/adapters/local/codeBoolean.d.ts +3 -0
- package/dist/oql/adapters/local/fileRowOps.d.ts +11 -0
- package/dist/oql/adapters/local/files.d.ts +3 -0
- package/dist/oql/adapters/local/filesBoolean.d.ts +10 -0
- package/dist/oql/adapters/local/filesContentLeaf.d.ts +12 -0
- package/dist/oql/adapters/local/filesUniverse.d.ts +6 -0
- package/dist/oql/adapters/local/findToolType.d.ts +10 -0
- package/dist/oql/adapters/local/predicates.d.ts +18 -0
- package/dist/oql/adapters/local/scope.d.ts +14 -0
- package/dist/oql/adapters/local/searchToolType.d.ts +7 -0
- package/dist/oql/adapters/local/structureContent.d.ts +6 -0
- package/dist/oql/adapters/local/types.d.ts +34 -0
- package/dist/oql/adapters/local.d.ts +3 -7
- package/dist/oql/adapters/researchTargets/diff.d.ts +16 -0
- package/dist/oql/adapters/researchTargets/graph.d.ts +3 -0
- package/dist/oql/adapters/researchTargets/history.d.ts +20 -0
- package/dist/oql/adapters/researchTargets/pagination.d.ts +54 -0
- package/dist/oql/adapters/researchTargets/repositories.d.ts +4 -0
- package/dist/oql/adapters/researchTargets/research.d.ts +3 -0
- package/dist/oql/adapters/researchTargets/rows.d.ts +16 -0
- package/dist/oql/adapters/researchTargets/semantics.d.ts +3 -0
- package/dist/oql/adapters/researchTargets/shared.d.ts +11 -0
- package/dist/oql/adapters/researchTargets.d.ts +4 -46
- package/dist/oql/defaults.d.ts +1 -1
- package/dist/oql/index.js +34 -39
- package/dist/oql/normalize/batch.d.ts +2 -0
- package/dist/oql/normalize/materialize.d.ts +2 -0
- package/dist/oql/normalize/params.d.ts +2 -0
- package/dist/oql/normalize/query.d.ts +2 -0
- package/dist/oql/normalize/scope.d.ts +2 -0
- package/dist/oql/normalize/shared.d.ts +7 -0
- package/dist/oql/normalize/source.d.ts +2 -0
- package/dist/oql/normalize/where.d.ts +2 -0
- package/dist/oql/normalize.d.ts +19 -4
- package/dist/oql/planner/planDiagnostics.d.ts +13 -0
- package/dist/oql/planner/predicateRouting.d.ts +35 -0
- package/dist/oql/predicateUtils.d.ts +3 -0
- package/dist/oql/research/analyze/manifest-scan.d.ts +4 -0
- package/dist/oql/research/analyze/source-graph.d.ts +7 -0
- package/dist/oql/research/analyze/symbol-scoring.d.ts +4 -0
- package/dist/oql/research/analyze/types.d.ts +163 -0
- package/dist/oql/research/analyze/utils.d.ts +16 -0
- package/dist/oql/research/analyze.d.ts +2 -133
- package/dist/oql/research/packets/builders.d.ts +4 -0
- package/dist/oql/research/packets/types.d.ts +91 -0
- package/dist/oql/research/packets.d.ts +21 -80
- package/dist/oql/run/batch.d.ts +3 -0
- package/dist/oql/run/continuations/records.d.ts +19 -0
- package/dist/oql/run/continuations/registry.d.ts +22 -0
- package/dist/oql/run/continuations/semantics.d.ts +3 -0
- package/dist/oql/run/continuations/types.d.ts +12 -0
- package/dist/oql/run/dryRun.d.ts +11 -0
- package/dist/oql/run/paths.d.ts +15 -0
- package/dist/oql/run/proofGrades.d.ts +8 -0
- package/dist/oql/run/select.d.ts +10 -0
- package/dist/oql/run/single.d.ts +22 -0
- package/dist/oql/run.d.ts +4 -31
- package/dist/oql/schema/predicates.d.ts +12 -0
- package/dist/oql/schema.d.ts +50 -35
- package/dist/oql/schemeText.d.ts +10 -13
- package/dist/oql/shorthand/predicates.d.ts +15 -0
- package/dist/oql/shorthand/query-controls.d.ts +18 -0
- package/dist/oql/shorthand/target-params.d.ts +9 -0
- package/dist/oql/shorthand/types.d.ts +159 -0
- package/dist/oql/shorthand/utils.d.ts +7 -0
- package/dist/oql/shorthand.d.ts +2 -171
- package/dist/oql/targetParams.d.ts +0 -13
- package/dist/oql/transformers/github/code.d.ts +1 -9
- package/dist/oql/types/diagnostics.d.ts +22 -0
- package/dist/oql/types/envelope.d.ts +78 -0
- package/dist/oql/types/guards.d.ts +9 -0
- package/dist/oql/types/planner.d.ts +46 -0
- package/dist/oql/types/predicates.d.ts +93 -0
- package/dist/oql/types/query.d.ts +143 -0
- package/dist/oql/types/recordData.d.ts +127 -0
- package/dist/oql/types/recordRows.d.ts +48 -0
- package/dist/oql/types/results.d.ts +118 -0
- package/dist/oql/types/targets.d.ts +22 -0
- package/dist/oql/types.d.ts +17 -640
- package/dist/providers/github/paginationMetadata.d.ts +12 -0
- package/dist/providers/providerResults.d.ts +0 -1
- package/dist/schema.js +2 -2
- package/dist/scheme/pagination.d.ts +65 -0
- package/dist/shared/config/index.js +1 -1
- package/dist/shared/credentials/index.js +2 -2
- package/dist/shared/credentials/testing.js +1 -1
- package/dist/shared/languageSelectors/classify.d.ts +15 -0
- package/dist/shared/languageSelectors/data.d.ts +12 -0
- package/dist/shared/languageSelectors.d.ts +3 -23
- package/dist/shared/paths.d.ts +0 -4
- package/dist/shared/paths.js +1 -1
- package/dist/shared/session/index.js +1 -1
- package/dist/shared/session/statsDefaults.d.ts +1 -2
- package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +68 -0
- package/dist/tools/directToolCatalog/toolCommandPatternQueries.d.ts +4 -0
- package/dist/tools/directToolCatalog/toolCommandPatterns.d.ts +4 -0
- package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +12 -0
- package/dist/tools/directToolCatalog/toolSchemaIntrospection.d.ts +19 -0
- package/dist/tools/directToolCatalog.meta.d.ts +10 -67
- package/dist/tools/github_clone_repo/cache.d.ts +1 -5
- package/dist/tools/github_clone_repo/cachePaths.d.ts +5 -0
- package/dist/tools/github_fetch_content/finalizer/entryParsers.d.ts +9 -0
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +101 -0
- package/dist/tools/github_fetch_content/finalizer.d.ts +1 -7
- package/dist/tools/github_fetch_content/scheme.d.ts +42 -9
- package/dist/tools/github_fetch_content/types.d.ts +1 -2
- package/dist/tools/github_search_code/execution.d.ts +9 -0
- package/dist/tools/github_search_code/finalizer/build.d.ts +4 -0
- package/dist/tools/github_search_code/finalizer/groups.d.ts +23 -0
- package/dist/tools/github_search_code/finalizer/ranking.d.ts +12 -0
- package/dist/tools/github_search_code/finalizer.d.ts +2 -6
- package/dist/tools/github_search_code/scheme.d.ts +29 -2
- package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +68 -0
- package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +52 -0
- package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +17 -0
- package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +63 -0
- package/dist/tools/github_search_pull_requests/contentResponse.d.ts +1 -15
- package/dist/tools/github_search_pull_requests/execution/commitsMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/issuesMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/pullRequestsMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/releasesMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/types.d.ts +6 -0
- package/dist/tools/github_search_pull_requests/execution.d.ts +1 -4
- package/dist/tools/github_search_pull_requests/scheme.d.ts +11 -1
- package/dist/tools/github_search_repos/execution/pagination.d.ts +39 -0
- package/dist/tools/github_search_repos/execution/queryVariants.d.ts +38 -0
- package/dist/tools/github_search_repos/execution/ranking.d.ts +4 -0
- package/dist/tools/github_search_repos/execution.d.ts +3 -71
- package/dist/tools/github_search_repos/scheme.d.ts +8 -0
- package/dist/tools/github_view_repo_structure/types.d.ts +2 -0
- package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +15 -0
- package/dist/tools/local_fetch_content/fetchContent/pagination.d.ts +38 -0
- package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +26 -0
- package/dist/tools/local_fetch_content/fetchContent.d.ts +2 -0
- package/dist/tools/local_fetch_content/scheme.d.ts +25 -1
- package/dist/tools/local_find_files/scheme.d.ts +32 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +70 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +47 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingScoring.d.ts +41 -0
- package/dist/tools/local_ripgrep/rankingProfile.d.ts +16 -95
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/buildResult.d.ts +10 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +46 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +2 -18
- package/dist/tools/local_ripgrep/scheme.d.ts +95 -0
- package/dist/tools/local_view_structure/scheme.d.ts +31 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +61 -0
- package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +7 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/callEnvelopes.d.ts +5 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +20 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +13 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes.d.ts +3 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +24 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps/documentSymbols.d.ts +27 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps/workspaceSymbolsAndDiagnostics.d.ts +20 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps.d.ts +8 -0
- package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +53 -0
- package/dist/tools/lsp/shared/semanticTypes.d.ts +6 -0
- package/dist/tools/package_search/execution.d.ts +8 -0
- package/dist/tools/package_search/scheme.d.ts +43 -2
- package/dist/tools/providerMappers/codeSearch.d.ts +66 -0
- package/dist/tools/providerMappers/fileContent.d.ts +28 -0
- package/dist/tools/providerMappers/pullRequests.d.ts +158 -0
- package/dist/tools/providerMappers/repoSearch.d.ts +30 -0
- package/dist/tools/providerMappers/repoStructure.d.ts +20 -0
- package/dist/tools/providerMappers/shared.d.ts +23 -0
- package/dist/tools/providerMappers.d.ts +9 -294
- package/dist/tools/toolConfig.d.ts +0 -2
- package/dist/tools/toolMetadata/descriptionOverrides.d.ts +4 -0
- package/dist/tools/toolSchemaImports.d.ts +13 -0
- package/dist/utils/contextUtils.d.ts +5 -16
- package/dist/utils/core/types.d.ts +2 -24
- package/dist/utils/exec/spawn/env.d.ts +5 -0
- package/dist/utils/exec/spawn/wrappers.d.ts +29 -0
- package/dist/utils/exec/spawn.d.ts +2 -34
- package/dist/utils/file/toolHelpers.d.ts +12 -0
- package/dist/utils/http/cache/conditional.d.ts +21 -0
- package/dist/utils/http/cache/dataCache.d.ts +6 -0
- package/dist/utils/http/cache/key.d.ts +1 -0
- package/dist/utils/http/cache/management.d.ts +9 -0
- package/dist/utils/http/cache/store.d.ts +28 -0
- package/dist/utils/http/cache.d.ts +4 -16
- package/dist/utils/markdownOutline.d.ts +0 -2
- package/dist/utils/package/npm/npmDeprecation.d.ts +5 -0
- package/dist/utils/package/npm/npmDetailsFetchers.d.ts +15 -0
- package/dist/utils/package/npm/npmMappers.d.ts +12 -0
- package/dist/utils/package/npm/npmRegistry.d.ts +79 -0
- package/dist/utils/package/npm/npmSearchStrategies.d.ts +6 -0
- package/dist/utils/package/npm.d.ts +2 -8
- package/dist/utils/pagination/boundary.d.ts +5 -5
- package/dist/utils/response/bulk/pagination.d.ts +6 -0
- package/dist/utils/response/bulk/queries.d.ts +19 -0
- package/dist/utils/response/bulk/response.d.ts +4 -0
- package/dist/utils/response/bulk.d.ts +2 -6
- package/package.json +42 -35
- package/dist/tools/local_binary_inspect/archiveOps.d.ts +0 -24
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +0 -86
- package/dist/tools/local_binary_inspect/binaryOps.d.ts +0 -27
- package/dist/tools/local_binary_inspect/decompressOps.d.ts +0 -16
- package/dist/tools/local_binary_inspect/execution.d.ts +0 -4
- package/dist/tools/local_binary_inspect/scheme.d.ts +0 -144
- package/dist/tools/local_ripgrep/lspBoost.d.ts +0 -54
- package/dist/utils/parsers/ripgrep.d.ts +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isBotAuthor(login: string): boolean;
|
package/dist/github/client.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
export declare function hashGitHubToken(token: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Auth segment for GitHub API cache keys. Distinct tokens (and Enterprise
|
|
5
|
+
* hosts) must not share cache entries. Never puts the raw token in the key.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveCacheAuthFingerprint(authInfo?: AuthInfo): Promise<string>;
|
|
2
8
|
export declare const OctokitWithThrottling: typeof import("@octokit/core").Octokit & import("@octokit/core/types").Constructor<{
|
|
3
9
|
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
|
|
4
10
|
} & import("@octokit/plugin-paginate-graphql").paginateGraphQLInterface & import("@octokit/plugin-rest-endpoint-methods").Api & {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
import type { DirectoryFetchResult } from '../../tools/github_fetch_content/types.js';
|
|
3
|
+
export declare function fetchDirectoryContents(owner: string, repo: string, path: string, branch: string, authInfo?: AuthInfo, forceRefresh?: boolean): Promise<DirectoryFetchResult>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
import type { FileMaterializationResult } from '../../tools/github_fetch_content/types.js';
|
|
3
|
+
export declare function fetchFileContentToDisk(owner: string, repo: string, path: string, branch: string, authInfo?: AuthInfo, forceRefresh?: boolean): Promise<FileMaterializationResult>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { GitHubDirectoryFileEntry } from '@octocodeai/octocode-core/extra-types';
|
|
2
|
+
import type { DirectoryFetchResult } from '../../tools/github_fetch_content/types.js';
|
|
3
|
+
export declare const MAX_DIRECTORY_FILES = 50;
|
|
4
|
+
export declare const MAX_TOTAL_SIZE: number;
|
|
5
|
+
export declare const MAX_FILE_SIZE: number;
|
|
6
|
+
export declare const CONCURRENCY = 5;
|
|
7
|
+
export declare const FETCH_TIMEOUT_MS = 10000;
|
|
8
|
+
export declare const BINARY_EXTENSIONS: Set<string>;
|
|
9
|
+
export interface DirectoryEntry {
|
|
10
|
+
name: string;
|
|
11
|
+
path: string;
|
|
12
|
+
type: string;
|
|
13
|
+
size: number;
|
|
14
|
+
download_url: string | null;
|
|
15
|
+
}
|
|
16
|
+
export type DirectorySkipCounts = DirectoryFetchResult['skipped'];
|
|
17
|
+
export declare const DIRECTORY_FETCH_LIMITS: {
|
|
18
|
+
maxDirectoryFiles: number;
|
|
19
|
+
maxTotalSize: number;
|
|
20
|
+
maxFileSize: number;
|
|
21
|
+
};
|
|
22
|
+
export declare function emptyDirectorySkipCounts(): DirectorySkipCounts;
|
|
23
|
+
export declare function directoryFetchComplete(skipped: DirectorySkipCounts): boolean;
|
|
24
|
+
export declare function directoryFetchWarnings(complete: boolean, verified: boolean): string[] | undefined;
|
|
25
|
+
export declare function fetchFilesInBatches(entries: DirectoryEntry[], concurrency: number, token?: string): Promise<Array<{
|
|
26
|
+
entry: DirectoryEntry;
|
|
27
|
+
content: string;
|
|
28
|
+
}>>;
|
|
29
|
+
export declare function fetchDownloadUrl(url: string, token?: string): Promise<string>;
|
|
30
|
+
export declare function scanDirectoryStats(dirPath: string, repoRoot: string): {
|
|
31
|
+
files: GitHubDirectoryFileEntry[];
|
|
32
|
+
fileCount: number;
|
|
33
|
+
totalSize: number;
|
|
34
|
+
};
|
|
35
|
+
export declare function safeFileSize(path: string): number;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare const MAX_TOTAL_SIZE: number;
|
|
5
|
-
export declare function fetchDirectoryContents(owner: string, repo: string, path: string, branch: string, authInfo?: AuthInfo, forceRefresh?: boolean): Promise<DirectoryFetchResult>;
|
|
6
|
-
export declare function fetchFileContentToDisk(owner: string, repo: string, path: string, branch: string, authInfo?: AuthInfo, forceRefresh?: boolean): Promise<FileMaterializationResult>;
|
|
1
|
+
export { MAX_DIRECTORY_FILES, MAX_TOTAL_SIZE, } from './directoryFetch/helpers.js';
|
|
2
|
+
export { fetchDirectoryContents } from './directoryFetch/fetchDirectoryContents.js';
|
|
3
|
+
export { fetchFileContentToDisk } from './directoryFetch/fetchFileContentToDisk.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GitHubFileContentApiResult } from '../tools/github_fetch_content/types.js';
|
|
2
|
+
import { OctokitWithThrottling } from './client.js';
|
|
3
|
+
interface FileTimestampInfo {
|
|
4
|
+
lastModified: string;
|
|
5
|
+
lastModifiedBy: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function applyContentPagination(data: GitHubFileContentApiResult, charOffset: number, charLength?: number): Promise<GitHubFileContentApiResult>;
|
|
8
|
+
export declare function fetchFileTimestamp(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, path: string, branch?: string): Promise<FileTimestampInfo | null>;
|
|
9
|
+
export {};
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import type { GitHubFileContentApiResult } from '../tools/github_fetch_content/types.js';
|
|
2
|
-
import { OctokitWithThrottling } from './client.js';
|
|
3
2
|
import type { MinifyMode } from '../scheme/fields.js';
|
|
4
|
-
|
|
5
|
-
lastModified: string;
|
|
6
|
-
lastModifiedBy: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function applyContentPagination(data: GitHubFileContentApiResult, charOffset: number, charLength?: number): GitHubFileContentApiResult;
|
|
9
|
-
export declare function fetchFileTimestamp(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, path: string, branch?: string): Promise<FileTimestampInfo | null>;
|
|
3
|
+
export { applyContentPagination, fetchFileTimestamp, } from './fileContentPagination.js';
|
|
10
4
|
export declare function processFileContentAPI(decodedContent: string, owner: string, repo: string, branch: string, filePath: string, fullContent: boolean, startLine?: number, endLine?: number, contextLines?: number, matchString?: string, matchStringIsRegex?: boolean, matchStringCaseSensitive?: boolean, minify?: MinifyMode): Promise<GitHubFileContentApiResult>;
|
|
11
|
-
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { GitHubAPIResponse } from '../githubAPI.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { FileContentQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
|
|
5
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
6
|
+
export interface RawContentResult {
|
|
7
|
+
rawContent: string;
|
|
8
|
+
branch?: string;
|
|
9
|
+
resolvedRef: string;
|
|
10
|
+
}
|
|
11
|
+
export type RawContentFetchOptions = {
|
|
12
|
+
/** Prior ETag for conditional GET (If-None-Match). */
|
|
13
|
+
ifNoneMatch?: string;
|
|
14
|
+
};
|
|
15
|
+
export type RawContentFetchResponse = GitHubAPIResponse<RawContentResult> & {
|
|
16
|
+
etag?: string;
|
|
17
|
+
notModified?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function fetchRawGitHubFileContent(params: FileContentQuery, authInfo?: AuthInfo, opts?: RawContentFetchOptions): Promise<RawContentFetchResponse>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OctokitWithThrottling } from '../client.js';
|
|
2
|
+
export declare function buildPathSuggestionHints(requestedPath: string, suggestions: string[]): string[];
|
|
3
|
+
export declare function findPathSuggestions(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, filePath: string, branch: string): Promise<string[]>;
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { FileContentQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
-
type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
|
|
5
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
6
|
-
export interface RawContentResult {
|
|
7
|
-
rawContent: string;
|
|
8
|
-
branch?: string;
|
|
9
|
-
resolvedRef: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function fetchRawGitHubFileContent(params: FileContentQuery, authInfo?: AuthInfo): Promise<GitHubAPIResponse<RawContentResult>>;
|
|
12
|
-
export {};
|
|
1
|
+
export type { RawContentResult, RawContentFetchOptions, RawContentFetchResponse, } from './fileContentRaw/fetch.js';
|
|
2
|
+
export { fetchRawGitHubFileContent } from './fileContentRaw/fetch.js';
|
|
@@ -52,7 +52,10 @@ export interface HistoryCommitFile {
|
|
|
52
52
|
export interface HistoryCommit {
|
|
53
53
|
sha: string;
|
|
54
54
|
date: string;
|
|
55
|
-
|
|
55
|
+
/** Headline + (truncated) body; omitted when identical to messageHeadline. */
|
|
56
|
+
message?: string;
|
|
57
|
+
/** Present when the message body was cut at 500 chars — the '…' is a real cut. */
|
|
58
|
+
messageTruncated?: true;
|
|
56
59
|
messageHeadline: string;
|
|
57
60
|
url: string;
|
|
58
61
|
author: {
|
package/dist/github/history.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
2
|
import type { GitHubAPIResponse, HistoryResult } from './githubAPI.js';
|
|
3
|
-
|
|
3
|
+
/** GitHub REST pagination: a `rel="next"` Link header means more pages exist. */
|
|
4
|
+
export declare function parseHasMore(linkHeader: string | undefined): boolean;
|
|
5
|
+
type FetchHistoryParams = {
|
|
4
6
|
type: 'file' | 'repo';
|
|
5
7
|
owner: string;
|
|
6
8
|
repo: string;
|
|
@@ -16,4 +18,6 @@ export declare function fetchHistory(params: {
|
|
|
16
18
|
includeDiff: boolean;
|
|
17
19
|
charOffset?: number;
|
|
18
20
|
charLength?: number;
|
|
19
|
-
}
|
|
21
|
+
};
|
|
22
|
+
export declare function fetchHistory(params: FetchHistoryParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<HistoryResult>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
import type { GitHubAPIResponse } from '../githubAPI.js';
|
|
3
|
+
import { type IssueSearchParams } from '../queryBuilders.js';
|
|
4
|
+
import type { FetchIssuesParams, IssuesResult } from './types.js';
|
|
5
|
+
export declare function fetchIssueByNumber(params: FetchIssuesParams, authInfo?: AuthInfo): Promise<GitHubAPIResponse<IssuesResult>>;
|
|
6
|
+
export declare function searchIssues(searchParams: IssueSearchParams, params: FetchIssuesParams, authInfo?: AuthInfo): Promise<GitHubAPIResponse<IssuesResult>>;
|
|
7
|
+
export declare function listIssues(params: FetchIssuesParams, authInfo?: AuthInfo): Promise<GitHubAPIResponse<IssuesResult>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { GitHubAPIError } from '../githubAPI.js';
|
|
2
|
+
import type { FetchIssuesParams, IssueRow } from './types.js';
|
|
3
|
+
export declare function firstString(value: string | string[] | undefined): string | undefined;
|
|
4
|
+
export declare function combineQuery(params: FetchIssuesParams): string | undefined;
|
|
5
|
+
export declare function windowText(text: string, charOffset: number | undefined, charLength: number | undefined): {
|
|
6
|
+
text: string;
|
|
7
|
+
pagination?: NonNullable<IssueRow['contentPagination']>['body'];
|
|
8
|
+
};
|
|
9
|
+
export declare function hasPullRequestField(item: {
|
|
10
|
+
pull_request?: unknown;
|
|
11
|
+
}): boolean;
|
|
12
|
+
export declare function mapIssueLabels(labels: Array<string | {
|
|
13
|
+
name?: string | null;
|
|
14
|
+
}> | undefined): string[];
|
|
15
|
+
export declare function toIssueRow(item: {
|
|
16
|
+
number: number;
|
|
17
|
+
title?: string | null;
|
|
18
|
+
state?: string | null;
|
|
19
|
+
user?: {
|
|
20
|
+
login?: string | null;
|
|
21
|
+
} | null;
|
|
22
|
+
labels?: Array<string | {
|
|
23
|
+
name?: string | null;
|
|
24
|
+
}>;
|
|
25
|
+
created_at?: string | null;
|
|
26
|
+
updated_at?: string | null;
|
|
27
|
+
closed_at?: string | null;
|
|
28
|
+
html_url?: string | null;
|
|
29
|
+
body?: string | null;
|
|
30
|
+
}): IssueRow;
|
|
31
|
+
export declare function createIssueError(message: string, hints?: string[]): GitHubAPIError;
|
|
32
|
+
export declare function buildIssueSearchCacheKey(params: FetchIssuesParams, sessionId?: string, authFingerprint?: string): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
import type { GitHubAPIResponse } from '../githubAPI.js';
|
|
3
|
+
import type { FetchIssuesParams, IssuesResult } from './types.js';
|
|
4
|
+
export declare function fetchIssues(params: FetchIssuesParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<IssuesResult>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { IssueSearchParams } from '../queryBuilders.js';
|
|
2
|
+
export type IssueCommentRow = {
|
|
3
|
+
id: string;
|
|
4
|
+
user: string;
|
|
5
|
+
body: string;
|
|
6
|
+
created_at: string;
|
|
7
|
+
updated_at: string;
|
|
8
|
+
commentType: 'discussion';
|
|
9
|
+
};
|
|
10
|
+
export type IssueRow = {
|
|
11
|
+
number: number;
|
|
12
|
+
title: string;
|
|
13
|
+
state: string;
|
|
14
|
+
author: string;
|
|
15
|
+
labels: string[];
|
|
16
|
+
created_at: string;
|
|
17
|
+
updated_at: string;
|
|
18
|
+
closed_at?: string;
|
|
19
|
+
url: string;
|
|
20
|
+
body?: string;
|
|
21
|
+
comments?: IssueCommentRow[];
|
|
22
|
+
contentPagination?: {
|
|
23
|
+
body?: {
|
|
24
|
+
charOffset: number;
|
|
25
|
+
charLength: number;
|
|
26
|
+
totalChars: number;
|
|
27
|
+
hasMore: boolean;
|
|
28
|
+
nextCharOffset?: number;
|
|
29
|
+
};
|
|
30
|
+
comments?: {
|
|
31
|
+
currentPage: number;
|
|
32
|
+
itemsPerPage: number;
|
|
33
|
+
totalComments: number;
|
|
34
|
+
hasMore: boolean;
|
|
35
|
+
nextCommentPage?: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type IssuesResult = {
|
|
40
|
+
type: 'issues';
|
|
41
|
+
owner: string;
|
|
42
|
+
repo: string;
|
|
43
|
+
issues: IssueRow[] | string[];
|
|
44
|
+
total_count?: number;
|
|
45
|
+
effectiveQuery?: string;
|
|
46
|
+
incomplete_results?: boolean;
|
|
47
|
+
pagination?: {
|
|
48
|
+
currentPage: number;
|
|
49
|
+
perPage: number;
|
|
50
|
+
hasMore: boolean;
|
|
51
|
+
nextPage?: number;
|
|
52
|
+
totalMatches?: number;
|
|
53
|
+
reportedTotalMatches?: number;
|
|
54
|
+
totalMatchesKind?: 'reported';
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type FetchIssuesParams = IssueSearchParams & {
|
|
58
|
+
issueNumber?: number;
|
|
59
|
+
keywordsToSearch?: string[];
|
|
60
|
+
concise?: boolean;
|
|
61
|
+
content?: {
|
|
62
|
+
body?: boolean;
|
|
63
|
+
comments?: {
|
|
64
|
+
discussion?: boolean;
|
|
65
|
+
includeBots?: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
charOffset?: number;
|
|
69
|
+
charLength?: number;
|
|
70
|
+
commentPage?: number;
|
|
71
|
+
itemsPerPage?: number;
|
|
72
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PRCommentItem, PRReviewInfo } from '../githubAPI.js';
|
|
2
|
+
import { OctokitWithThrottling } from '../client.js';
|
|
3
|
+
export declare function fetchPRComments(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number, includeBots?: boolean): Promise<{
|
|
4
|
+
comments: PRCommentItem[];
|
|
5
|
+
note?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function fetchPRReviews(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number): Promise<PRReviewInfo[]>;
|
|
8
|
+
export declare function fetchPRInlineComments(octokit: InstanceType<typeof OctokitWithThrottling>, owner: string, repo: string, prNumber: number, includeBots?: boolean): Promise<{
|
|
9
|
+
comments: PRCommentItem[];
|
|
10
|
+
note?: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GitHubPullRequestsSearchParams, CommitInfo, DiffEntry, CommitFileInfo } from '../githubAPI.js';
|
|
2
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
3
|
+
export declare function fetchAllPaginated<T>(fetchPage: (page: number) => Promise<{
|
|
4
|
+
data: T[];
|
|
5
|
+
}>): Promise<{
|
|
6
|
+
items: T[];
|
|
7
|
+
rawResponseChars: number;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function fetchPRFileChangesAPI(owner: string, repo: string, prNumber: number, authInfo?: AuthInfo): Promise<{
|
|
10
|
+
total_count: number;
|
|
11
|
+
files: DiffEntry[];
|
|
12
|
+
} | null>;
|
|
13
|
+
interface CommitListItem {
|
|
14
|
+
sha: string;
|
|
15
|
+
commit: {
|
|
16
|
+
message: string;
|
|
17
|
+
author: {
|
|
18
|
+
name: string;
|
|
19
|
+
date: string;
|
|
20
|
+
} | null;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function fetchPRCommitsAPI(owner: string, repo: string, prNumber: number, authInfo?: AuthInfo): Promise<CommitListItem[] | null>;
|
|
24
|
+
export declare function fetchCommitFilesAPI(owner: string, repo: string, sha: string, authInfo?: AuthInfo): Promise<CommitFileInfo[] | null>;
|
|
25
|
+
export declare function mapPool<T, R>(items: T[], concurrency: number, mapper: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
26
|
+
export declare function fetchPRCommitsWithFiles(owner: string, repo: string, prNumber: number, params: GitHubPullRequestsSearchParams, authInfo?: AuthInfo): Promise<CommitInfo[] | null>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GitHubPullRequestsSearchParams } from '../githubAPI.js';
|
|
2
|
+
export declare function shouldFetchFileChanges(params: GitHubPullRequestsSearchParams): boolean;
|
|
3
|
+
export type ContentComments = {
|
|
4
|
+
discussion?: boolean;
|
|
5
|
+
reviewInline?: boolean;
|
|
6
|
+
includeBots?: boolean;
|
|
7
|
+
file?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function getCommentsConfig(params: GitHubPullRequestsSearchParams): ContentComments | null;
|
|
10
|
+
export declare function shouldFetchDiscussionComments(params: GitHubPullRequestsSearchParams): boolean;
|
|
11
|
+
export declare function shouldFetchInlineComments(params: GitHubPullRequestsSearchParams): boolean;
|
|
12
|
+
export declare function shouldFetchCommits(params: GitHubPullRequestsSearchParams): boolean;
|
|
13
|
+
export declare function shouldFetchReviews(params: GitHubPullRequestsSearchParams): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether search hits need a per-PR `pulls.get` enrichment call.
|
|
16
|
+
* Lean list searches skip it (~1 REST call per hit); detail/content/review
|
|
17
|
+
* modes still enrich.
|
|
18
|
+
*/
|
|
19
|
+
export declare function shouldEnrichPullRequestFromSearch(params: GitHubPullRequestsSearchParams): boolean;
|
|
20
|
+
export declare function shouldIncludeBotComments(params: GitHubPullRequestsSearchParams): boolean;
|
|
21
|
+
export declare function stripMachineBlobs(body: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GitHubPullRequestsSearchParams, GitHubPullRequestItem, IssueSearchResultItem, PullRequestSimple, PullRequestItem } from '../githubAPI.js';
|
|
2
|
+
import { OctokitWithThrottling } from '../client.js';
|
|
3
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
4
|
+
export declare function transformPullRequestItemFromSearch(item: IssueSearchResultItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>): Promise<GitHubPullRequestItem>;
|
|
5
|
+
export declare function transformPullRequestItemFromREST(item: PullRequestSimple | PullRequestItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>, authInfo?: AuthInfo): Promise<GitHubPullRequestItem>;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
4
|
-
export declare function transformPullRequestItemFromSearch(item: IssueSearchResultItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>): Promise<GitHubPullRequestItem>;
|
|
5
|
-
export declare function transformPullRequestItemFromREST(item: PullRequestSimple | PullRequestItem, params: GitHubPullRequestsSearchParams, octokit: InstanceType<typeof OctokitWithThrottling>, authInfo?: AuthInfo): Promise<GitHubPullRequestItem>;
|
|
1
|
+
export { shouldEnrichPullRequestFromSearch } from './prContentFetcher/flags.js';
|
|
2
|
+
export { transformPullRequestItemFromSearch, transformPullRequestItemFromREST, } from './prContentFetcher/transform.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GitHubAPIError, GitHubPullRequestsSearchParams } from '../githubAPI.js';
|
|
2
|
+
import type { GitHubPullRequestSearchApiResult } from '../../tools/github_search_pull_requests/types.js';
|
|
3
|
+
import { OctokitWithThrottling } from '../client.js';
|
|
4
|
+
export declare function createPullRequestErrorResult(apiError: GitHubAPIError, error: string, hints: string[]): GitHubPullRequestSearchApiResult;
|
|
5
|
+
export declare function createPullRequestEmptyResult(params: GitHubPullRequestsSearchParams): GitHubPullRequestSearchApiResult;
|
|
6
|
+
export declare function searchPullRequestsWithREST(octokit: InstanceType<typeof OctokitWithThrottling>, params: GitHubPullRequestsSearchParams): Promise<GitHubPullRequestSearchApiResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GitHubPullRequestsSearchParams } from './githubAPI.js';
|
|
2
2
|
import type { GitHubPullRequestSearchApiResult } from '../tools/github_search_pull_requests/types.js';
|
|
3
3
|
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
4
|
-
export declare function buildPullRequestSearchCacheKey(params: GitHubPullRequestsSearchParams, sessionId?: string): string;
|
|
4
|
+
export declare function buildPullRequestSearchCacheKey(params: GitHubPullRequestsSearchParams, sessionId?: string, authFingerprint?: string): string;
|
|
5
5
|
export declare function searchGitHubPullRequestsAPI(params: GitHubPullRequestsSearchParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubPullRequestSearchApiResult>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { GitHubPullRequestsSearchParams } from '../githubAPI.js';
|
|
2
|
+
export declare function getOwnerQualifier(owner: string): string;
|
|
3
|
+
export declare function quoteKeywordIfNeeded(keyword: string): string;
|
|
4
|
+
export declare abstract class BaseQueryBuilder {
|
|
5
|
+
protected queryParts: string[];
|
|
6
|
+
addOwnerRepo(params: {
|
|
7
|
+
owner?: string | string[] | null;
|
|
8
|
+
repo?: string | string[] | null;
|
|
9
|
+
}): this;
|
|
10
|
+
addDateFilters(params: Record<string, unknown> | GitHubPullRequestsSearchParams): this;
|
|
11
|
+
addArrayFilter(values: string | string[] | null | undefined, prefix: string, quoted?: boolean): this;
|
|
12
|
+
addBooleanFilter(value: boolean | undefined, trueQuery: string, falseQuery: string): this;
|
|
13
|
+
addSimpleFilter(value: string | number | null | undefined, key: string): this;
|
|
14
|
+
addQuotedFilter(value: string | null | undefined, key: string): this;
|
|
15
|
+
addEngagementFilters(params: {
|
|
16
|
+
comments?: number | string;
|
|
17
|
+
reactions?: number | string;
|
|
18
|
+
interactions?: number | string;
|
|
19
|
+
}): this;
|
|
20
|
+
addOrganizationFilters(params: {
|
|
21
|
+
label?: string | string[];
|
|
22
|
+
milestone?: string;
|
|
23
|
+
}): this;
|
|
24
|
+
build(): string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { GitHubCodeSearchQuerySchema, GitHubReposSearchSingleQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
3
|
+
type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
|
|
4
|
+
type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
|
|
5
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
6
|
+
import { BaseQueryBuilder } from './base.js';
|
|
7
|
+
export declare class CodeSearchQueryBuilder extends BaseQueryBuilder {
|
|
8
|
+
addQueryTerms(params: WithOptionalMeta<GitHubCodeSearchQuery>): this;
|
|
9
|
+
addSearchFilters(params: WithOptionalMeta<GitHubCodeSearchQuery>): this;
|
|
10
|
+
addMatchFilters(params: WithOptionalMeta<GitHubCodeSearchQuery>): this;
|
|
11
|
+
}
|
|
12
|
+
export declare class RepoSearchQueryBuilder extends BaseQueryBuilder {
|
|
13
|
+
addQueryTerms(params: WithOptionalMeta<GitHubReposSearchSingleQuery>): this;
|
|
14
|
+
addRepoFilters(params: WithOptionalMeta<GitHubReposSearchSingleQuery>): this;
|
|
15
|
+
addMatchFilters(params: WithOptionalMeta<GitHubReposSearchSingleQuery>): this;
|
|
16
|
+
addQualityFilters(params?: WithOptionalMeta<GitHubReposSearchSingleQuery>): this;
|
|
17
|
+
}
|
|
18
|
+
export declare function buildCodeSearchQuery(params: WithOptionalMeta<GitHubCodeSearchQuery>): string;
|
|
19
|
+
export declare function buildRepoSearchQuery(params: WithOptionalMeta<GitHubReposSearchSingleQuery>): string;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BaseQueryBuilder } from './base.js';
|
|
2
|
+
/** Issue-search params — PR-only fields (draft/review/head/base) are omitted. */
|
|
3
|
+
export type IssueSearchParams = {
|
|
4
|
+
query?: string;
|
|
5
|
+
owner?: string | string[];
|
|
6
|
+
repo?: string | string[];
|
|
7
|
+
state?: 'open' | 'closed' | 'merged';
|
|
8
|
+
author?: string;
|
|
9
|
+
assignee?: string;
|
|
10
|
+
mentions?: string;
|
|
11
|
+
commenter?: string;
|
|
12
|
+
involves?: string;
|
|
13
|
+
created?: string;
|
|
14
|
+
updated?: string;
|
|
15
|
+
closed?: string;
|
|
16
|
+
comments?: number | string;
|
|
17
|
+
reactions?: number | string;
|
|
18
|
+
interactions?: number | string;
|
|
19
|
+
label?: string | string[];
|
|
20
|
+
milestone?: string;
|
|
21
|
+
locked?: boolean;
|
|
22
|
+
visibility?: 'public' | 'private';
|
|
23
|
+
'no-assignee'?: boolean;
|
|
24
|
+
'no-label'?: boolean;
|
|
25
|
+
'no-milestone'?: boolean;
|
|
26
|
+
'no-project'?: boolean;
|
|
27
|
+
match?: ('title' | 'body' | 'comments')[];
|
|
28
|
+
archived?: boolean;
|
|
29
|
+
sort?: 'created' | 'updated' | 'best-match' | 'comments' | 'reactions';
|
|
30
|
+
order?: 'asc' | 'desc';
|
|
31
|
+
limit?: number;
|
|
32
|
+
page?: number;
|
|
33
|
+
};
|
|
34
|
+
export declare class IssueSearchQueryBuilder extends BaseQueryBuilder {
|
|
35
|
+
addBasicFilters(params: IssueSearchParams): this;
|
|
36
|
+
addStateFilters(params: IssueSearchParams): this;
|
|
37
|
+
addUserFilters(params: IssueSearchParams): this;
|
|
38
|
+
addNegativeFilters(params: IssueSearchParams): this;
|
|
39
|
+
addMiscFilters(params: IssueSearchParams): this;
|
|
40
|
+
}
|
|
41
|
+
export declare function buildIssueSearchQuery(params: IssueSearchParams): string;
|
|
42
|
+
export declare function shouldUseSearchForIssues(params: IssueSearchParams): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GitHubPullRequestsSearchParams } from '../githubAPI.js';
|
|
2
|
+
import { BaseQueryBuilder } from './base.js';
|
|
3
|
+
export declare class PullRequestSearchQueryBuilder extends BaseQueryBuilder {
|
|
4
|
+
addBasicFilters(params: GitHubPullRequestsSearchParams): this;
|
|
5
|
+
addStateFilters(params: GitHubPullRequestsSearchParams): this;
|
|
6
|
+
addUserFilters(params: GitHubPullRequestsSearchParams): this;
|
|
7
|
+
addBranchFilters(params: GitHubPullRequestsSearchParams): this;
|
|
8
|
+
addReviewFilters(params: GitHubPullRequestsSearchParams): this;
|
|
9
|
+
addNegativeFilters(params: GitHubPullRequestsSearchParams): this;
|
|
10
|
+
addMiscFilters(params: GitHubPullRequestsSearchParams): this;
|
|
11
|
+
}
|
|
12
|
+
export declare function buildPullRequestSearchQuery(params: GitHubPullRequestsSearchParams): string;
|
|
13
|
+
export declare function shouldUseSearchForPRs(params: GitHubPullRequestsSearchParams): boolean;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
import type { WithOptionalMeta } from '../types/execution.js';
|
|
6
|
-
import { GitHubPullRequestsSearchParams } from './githubAPI.js';
|
|
7
|
-
export declare function getOwnerQualifier(owner: string): string;
|
|
8
|
-
export declare function buildCodeSearchQuery(params: WithOptionalMeta<GitHubCodeSearchQuery>): string;
|
|
9
|
-
export declare function buildRepoSearchQuery(params: WithOptionalMeta<GitHubReposSearchSingleQuery>): string;
|
|
10
|
-
export declare function buildPullRequestSearchQuery(params: GitHubPullRequestsSearchParams): string;
|
|
11
|
-
export declare function shouldUseSearchForPRs(params: GitHubPullRequestsSearchParams): boolean;
|
|
12
|
-
export {};
|
|
1
|
+
export { getOwnerQualifier } from './queryBuilders/base.js';
|
|
2
|
+
export { buildCodeSearchQuery, buildRepoSearchQuery, } from './queryBuilders/codeAndRepo.js';
|
|
3
|
+
export { buildPullRequestSearchQuery, shouldUseSearchForPRs, } from './queryBuilders/pullRequests.js';
|
|
4
|
+
export { buildIssueSearchQuery, shouldUseSearchForIssues, type IssueSearchParams, } from './queryBuilders/issues.js';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
|
|
2
|
+
import type { GitHubAPIResponse } from './githubAPI.js';
|
|
3
|
+
type ReleaseRow = {
|
|
4
|
+
tagName: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
publishedAt?: string;
|
|
7
|
+
prerelease?: true;
|
|
8
|
+
draft?: true;
|
|
9
|
+
/** Marks the release GitHub reports as "latest" (stable, non-prerelease). */
|
|
10
|
+
latest?: true;
|
|
11
|
+
url?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ReleasesResult = {
|
|
14
|
+
type: 'releases';
|
|
15
|
+
owner: string;
|
|
16
|
+
repo: string;
|
|
17
|
+
releases: ReleaseRow[];
|
|
18
|
+
/** The repo's latest stable release, surfaced even when it is not on this page. */
|
|
19
|
+
latest?: {
|
|
20
|
+
tagName: string;
|
|
21
|
+
publishedAt?: string;
|
|
22
|
+
};
|
|
23
|
+
pagination: {
|
|
24
|
+
currentPage: number;
|
|
25
|
+
perPage: number;
|
|
26
|
+
hasMore: boolean;
|
|
27
|
+
nextPage?: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type FetchReleasesParams = {
|
|
31
|
+
owner: string;
|
|
32
|
+
repo: string;
|
|
33
|
+
page: number;
|
|
34
|
+
perPage: number;
|
|
35
|
+
};
|
|
36
|
+
export declare function fetchReleases(params: FetchReleasesParams, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubAPIResponse<ReleasesResult>>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Octokit } from 'octokit';
|
|
2
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
3
|
+
import type { GitHubApiFileItem, GitHubRepositoryStructureError } from '../../tools/github_view_repo_structure/types.js';
|
|
4
|
+
export interface ContentResolution {
|
|
5
|
+
data: unknown;
|
|
6
|
+
workingBranch: string;
|
|
7
|
+
repoDefaultBranch?: string;
|
|
8
|
+
etag?: string;
|
|
9
|
+
notModified?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveContentWithBranchFallback(octokit: Octokit, owner: string, repo: string, cleanPath: string, branch: string | undefined, authInfo?: AuthInfo, ifNoneMatch?: string): Promise<ContentResolution | GitHubRepositoryStructureError>;
|
|
12
|
+
export declare function mapApiItems(items: unknown[]): GitHubApiFileItem[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
3
|
+
import type { GitHubViewRepoStructureQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
type GitHubViewRepoStructureQuery = z.infer<typeof GitHubViewRepoStructureQuerySchema>;
|
|
5
|
+
import type { GitHubRepositoryStructureResult, GitHubRepositoryStructureError } from '../../tools/github_view_repo_structure/types.js';
|
|
6
|
+
export declare function viewGitHubRepositoryStructureAPI(params: GitHubViewRepoStructureQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubRepositoryStructureResult | GitHubRepositoryStructureError>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { GitHubApiFileItem, GitHubRepositoryStructureResult } from '../../tools/github_view_repo_structure/types.js';
|
|
2
|
+
export declare function buildStructureTree(items: GitHubApiFileItem[], basePath: string): Record<string, {
|
|
3
|
+
files: string[];
|
|
4
|
+
folders: string[];
|
|
5
|
+
}>;
|
|
6
|
+
export declare function buildFileSizeMap(items: GitHubApiFileItem[], basePath: string): Record<string, Record<string, number>>;
|
|
7
|
+
export declare function buildStructureResult(args: {
|
|
8
|
+
owner: string;
|
|
9
|
+
repo: string;
|
|
10
|
+
workingBranch: string;
|
|
11
|
+
repoDefaultBranch?: string;
|
|
12
|
+
cleanPath: string;
|
|
13
|
+
depth: number;
|
|
14
|
+
allItems: GitHubApiFileItem[];
|
|
15
|
+
partialTreeFailures: number;
|
|
16
|
+
incompleteTree: boolean;
|
|
17
|
+
rawResponseChars: number;
|
|
18
|
+
includeSizes: boolean;
|
|
19
|
+
itemsPerPage?: number;
|
|
20
|
+
page?: number;
|
|
21
|
+
extraHints?: string[];
|
|
22
|
+
}): GitHubRepositoryStructureResult;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { GitHubViewRepoStructureQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
3
|
-
type GitHubViewRepoStructureQuery = z.infer<typeof GitHubViewRepoStructureQuerySchema>;
|
|
4
|
-
import type { GitHubRepositoryStructureResult, GitHubRepositoryStructureError } from '../tools/github_view_repo_structure/types.js';
|
|
5
|
-
import { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types';
|
|
6
|
-
export declare function viewGitHubRepositoryStructureAPI(params: GitHubViewRepoStructureQuery, authInfo?: AuthInfo, sessionId?: string): Promise<GitHubRepositoryStructureResult | GitHubRepositoryStructureError>;
|
|
7
|
-
export {};
|
|
1
|
+
export { viewGitHubRepositoryStructureAPI } from './repoStructure/fetchOrchestration.js';
|