@octocodeai/octocode-tools-core 16.6.2 → 17.0.1
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 +29 -55
- package/dist/direct.js +34 -36
- 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 -0
- 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 +6 -7
- package/dist/index.js +36 -45
- 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/graphProof.d.ts +6 -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 +29 -0
- 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/adapters/resultMap.d.ts +7 -0
- package/dist/oql/adapters/runner.d.ts +7 -0
- package/dist/oql/defaults.d.ts +1 -1
- package/dist/oql/index.js +35 -37
- 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 +74 -43
- package/dist/oql/schemeText.d.ts +21 -23
- 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/transformers/github/common.d.ts +7 -1
- 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 -630
- package/dist/providers/github/paginationMetadata.d.ts +12 -0
- package/dist/providers/providerResults.d.ts +0 -1
- package/dist/responses.d.ts +4 -35
- package/dist/schema.js +2 -2
- package/dist/scheme/pagination.d.ts +116 -0
- package/dist/scheme/responseEnvelope.d.ts +67 -1
- package/dist/shared/config/index.d.ts +1 -8
- package/dist/shared/config/index.js +1 -2
- package/dist/shared/credentials/index.d.ts +1 -1
- package/dist/shared/credentials/index.js +2 -1
- package/dist/shared/credentials/storage.d.ts +0 -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 +4 -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.exec.d.ts +5 -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_clone_repo/scheme.d.ts +0 -1
- 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 +43 -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 +31 -6
- 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 -2
- 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 -13
- package/dist/tools/github_search_repos/scheme.d.ts +7 -2
- package/dist/tools/github_view_repo_structure/scheme.d.ts +0 -1
- 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 +90 -0
- package/dist/tools/local_find_files/scheme.d.ts +81 -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 +170 -0
- package/dist/tools/local_view_structure/scheme.d.ts +83 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +56 -8
- 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/readiness.d.ts +17 -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 +45 -6
- 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/toolNames.d.ts +1 -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/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 -5
- package/dist/utils/response/groupedFinalizer.d.ts +7 -2
- package/package.json +10 -3
- package/dist/oql/adapters/v2.d.ts +0 -32
- package/dist/oql/v2params.d.ts +0 -22
- package/dist/shared/config/defaults.d.ts +0 -14
- package/dist/shared/config/loader.d.ts +0 -7
- package/dist/shared/config/resolver.d.ts +0 -2
- package/dist/shared/config/resolverCache.d.ts +0 -12
- package/dist/shared/config/resolverSections.d.ts +0 -10
- package/dist/shared/config/runtimeSurface.d.ts +0 -22
- package/dist/shared/config/types.d.ts +0 -92
- package/dist/shared/config/validator.d.ts +0 -2
- package/dist/shared/credentials/envTokens.d.ts +0 -9
- 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 -47
- package/dist/tools/local_ripgrep/lspBoost.d.ts +0 -54
- package/dist/utils/parsers/ripgrep.d.ts +0 -11
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LSPRange } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
|
+
import { type LspGetSemanticsQuery, type LspSemanticEnvelope } from '../../shared/semanticTypes.js';
|
|
3
|
+
export type CompactSymbol = {
|
|
4
|
+
name: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
line: number;
|
|
7
|
+
character: number;
|
|
8
|
+
endLine: number;
|
|
9
|
+
childCount: number;
|
|
10
|
+
containerName?: string;
|
|
11
|
+
};
|
|
12
|
+
type LspPositionLike = {
|
|
13
|
+
line: number;
|
|
14
|
+
character: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function getDocumentSymbols(query: LspGetSemanticsQuery): Promise<LspSemanticEnvelope | Record<string, unknown>>;
|
|
17
|
+
export declare function flattenDocumentSymbols(symbols: readonly unknown[]): CompactSymbol[];
|
|
18
|
+
export declare function flattenDocumentSymbol(value: unknown, output: CompactSymbol[], containerName?: string): void;
|
|
19
|
+
export declare function getSymbolRange(value: {
|
|
20
|
+
range?: unknown;
|
|
21
|
+
location?: unknown;
|
|
22
|
+
}): LSPRange | undefined;
|
|
23
|
+
export declare function isLspRange(value: unknown): value is LSPRange;
|
|
24
|
+
export declare function isPosition(value: unknown): value is LspPositionLike;
|
|
25
|
+
export declare function countTopLevelDocumentSymbols(symbols: readonly unknown[]): number;
|
|
26
|
+
export declare function countBy<T>(items: readonly T[], keyForItem: (item: T) => string): Record<string, number>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LspSemanticEnvelope, DiagnosticSemanticQuery, WorkspaceSymbolSemanticQuery } from '../../shared/semanticTypes.js';
|
|
2
|
+
import type { CompactSymbol } from './documentSymbols.js';
|
|
3
|
+
type CompactWorkspaceSymbol = CompactSymbol & {
|
|
4
|
+
uri: string;
|
|
5
|
+
};
|
|
6
|
+
type DiagnosticItem = {
|
|
7
|
+
severity?: number;
|
|
8
|
+
message: string;
|
|
9
|
+
line: number;
|
|
10
|
+
endLine: number;
|
|
11
|
+
character: number;
|
|
12
|
+
code?: string | number;
|
|
13
|
+
source?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function getWorkspaceSymbols(query: WorkspaceSymbolSemanticQuery): Promise<LspSemanticEnvelope | Record<string, unknown>>;
|
|
16
|
+
export declare function compactWorkspaceSymbols(raw: unknown[]): CompactWorkspaceSymbol[];
|
|
17
|
+
export declare function getFileDiagnostics(query: DiagnosticSemanticQuery): Promise<LspSemanticEnvelope | Record<string, unknown>>;
|
|
18
|
+
export declare function extractDiagnostics(raw: unknown): DiagnosticItem[];
|
|
19
|
+
export declare function parseDiagnostic(item: unknown): DiagnosticItem[];
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel for the semanticFileOps/ split (anchor & workspace resolution vs.
|
|
3
|
+
* documentSymbols vs. workspaceSymbols/diagnostics operations). Kept so no
|
|
4
|
+
* other file in the repo needs to change its import path.
|
|
5
|
+
*/
|
|
6
|
+
export { isNativeJsTsFile, throwLspUnavailable, toLocalPath, workspaceSymbolAnchorExtensions, workspaceSymbolAnchorIncludeGlobs, findWorkspaceSymbolAnchorByName, resolveWorkspaceSymbolAnchor, lspErrorMessage, nativeDocumentSymbols, } from './semanticFileOps/anchor.js';
|
|
7
|
+
export { type CompactSymbol, getDocumentSymbols, flattenDocumentSymbols, flattenDocumentSymbol, getSymbolRange, isLspRange, isPosition, countTopLevelDocumentSymbols, countBy, } from './semanticFileOps/documentSymbols.js';
|
|
8
|
+
export { getWorkspaceSymbols, compactWorkspaceSymbols, getFileDiagnostics, extractDiagnostics, parseDiagnostic, } from './semanticFileOps/workspaceSymbolsAndDiagnostics.js';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CallHierarchyItem, IncomingCall, LSPRange, OutgoingCall } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
|
+
import { type CompactLocation, type LspGetSemanticsQuery, type LspSemanticEnvelope } from '../shared/semanticTypes.js';
|
|
3
|
+
export type CompactCallTarget = {
|
|
4
|
+
name: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
uri: string;
|
|
7
|
+
line: number;
|
|
8
|
+
endLine: number;
|
|
9
|
+
selectionLine?: number;
|
|
10
|
+
};
|
|
11
|
+
export type CompactCall = {
|
|
12
|
+
direction: 'incoming' | 'outgoing';
|
|
13
|
+
item: CompactCallTarget;
|
|
14
|
+
ranges: Array<{
|
|
15
|
+
line: number;
|
|
16
|
+
character: number;
|
|
17
|
+
}>;
|
|
18
|
+
rangeCount: number;
|
|
19
|
+
rangeSampleCount: number;
|
|
20
|
+
contentPreview?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function attachSemanticRawEvidence<T extends object>(result: T): T;
|
|
23
|
+
export declare function formatSemanticResult(query: LspGetSemanticsQuery, result: LspSemanticEnvelope | Record<string, unknown>): LspSemanticEnvelope | Record<string, unknown>;
|
|
24
|
+
export declare function withSemanticNext(result: LspSemanticEnvelope | Record<string, unknown>): LspSemanticEnvelope | Record<string, unknown>;
|
|
25
|
+
export declare function isSemanticEnvelope(value: LspSemanticEnvelope | Record<string, unknown>): value is LspSemanticEnvelope;
|
|
26
|
+
export declare function compactSemanticEnvelope(envelope: LspSemanticEnvelope): LspSemanticEnvelope;
|
|
27
|
+
export declare function compactSemanticPayload(payload: LspSemanticEnvelope['payload']): LspSemanticEnvelope['payload'];
|
|
28
|
+
export declare function formatSymbolRow(value: unknown): string;
|
|
29
|
+
export declare function formatLocationRow(location: CompactLocation | string): string;
|
|
30
|
+
export declare function formatReferenceFileRow(value: unknown): string;
|
|
31
|
+
export declare function formatCallRow(value: unknown): string;
|
|
32
|
+
export declare function formatCallTargetRow(value: unknown): string;
|
|
33
|
+
export declare function formatRangeRow(value: unknown): string;
|
|
34
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
35
|
+
export declare function stringField(record: Record<string, unknown>, key: string, fallback?: string): string;
|
|
36
|
+
export declare function numberField(record: Record<string, unknown>, key: string, fallback?: number): number;
|
|
37
|
+
export declare function arrayField(record: Record<string, unknown>, key: string): unknown[];
|
|
38
|
+
export declare function oneLine(value: string, maxLength: number): string;
|
|
39
|
+
export declare function compactIncomingCall(call: IncomingCall & {
|
|
40
|
+
direction: 'incoming';
|
|
41
|
+
}, contextLines: number): CompactCall;
|
|
42
|
+
export declare function compactOutgoingCall(call: OutgoingCall & {
|
|
43
|
+
direction: 'outgoing';
|
|
44
|
+
}, contextLines: number): CompactCall;
|
|
45
|
+
export declare function compactCallItem(item: CallHierarchyItem): CompactCallTarget;
|
|
46
|
+
export declare function compactRanges(ranges: readonly LSPRange[]): {
|
|
47
|
+
line: number;
|
|
48
|
+
character: number;
|
|
49
|
+
}[];
|
|
50
|
+
export declare function contentPreview(item: CallHierarchyItem, contextLines: number): {
|
|
51
|
+
contentPreview?: string;
|
|
52
|
+
};
|
|
53
|
+
export declare function symbolKindName(kind: unknown): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LspReadiness } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
|
+
import type { LspSemanticEnvelope, SemanticEmptyCategory } from './semanticTypes.js';
|
|
3
|
+
/**
|
|
4
|
+
* The "server returned nothing" category of an envelope, whether the emptiness
|
|
5
|
+
* is expressed as an `empty`-kind payload (definition/hover) or a nested
|
|
6
|
+
* `empty` on an otherwise-shaped payload (references/callers). Returns
|
|
7
|
+
* `undefined` when the envelope carries real results.
|
|
8
|
+
*/
|
|
9
|
+
export declare function zeroResultEmptyCategory(envelope: LspSemanticEnvelope): SemanticEmptyCategory | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Attach a caveat when a semantic query came back empty AND the language server
|
|
12
|
+
* never confirmed it finished indexing (readiness other than `progressIdle`).
|
|
13
|
+
* Without this, an agent reads a zero as "symbol is unused" when it may just be
|
|
14
|
+
* "server not indexed yet". `readiness === undefined` means the wait was
|
|
15
|
+
* skipped (servers that answer immediately) — those are trusted, no caveat.
|
|
16
|
+
*/
|
|
17
|
+
export declare function attachReadinessWarning(envelope: LspSemanticEnvelope, readiness: LspReadiness | undefined): LspSemanticEnvelope;
|
|
@@ -161,4 +161,10 @@ export type LspSemanticEnvelope = {
|
|
|
161
161
|
pagination?: unknown;
|
|
162
162
|
warnings?: string[];
|
|
163
163
|
hints?: string[];
|
|
164
|
+
next?: Record<string, {
|
|
165
|
+
tool: string;
|
|
166
|
+
query: Record<string, unknown>;
|
|
167
|
+
why?: string;
|
|
168
|
+
confidence?: 'exact' | 'heuristic';
|
|
169
|
+
}>;
|
|
164
170
|
};
|
|
@@ -2,6 +2,7 @@ import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
|
2
2
|
import type { z } from 'zod';
|
|
3
3
|
import type { NpmPackageQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
4
|
type NpmSearchQuery = z.input<typeof NpmPackageQuerySchema>;
|
|
5
|
+
import type { PackageResult } from '../../utils/package/common.js';
|
|
5
6
|
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
6
7
|
type PackageData = {
|
|
7
8
|
name: string;
|
|
@@ -13,6 +14,12 @@ type PackageData = {
|
|
|
13
14
|
repositoryDirectory?: string;
|
|
14
15
|
repositoryId?: string;
|
|
15
16
|
next?: Record<string, unknown>;
|
|
17
|
+
warnings?: string[];
|
|
18
|
+
diagnostics?: Array<{
|
|
19
|
+
level: 'info' | 'warning' | 'error';
|
|
20
|
+
message: string;
|
|
21
|
+
code?: string;
|
|
22
|
+
}>;
|
|
16
23
|
};
|
|
17
24
|
type PackageRepositoryData = {
|
|
18
25
|
repository: string;
|
|
@@ -25,6 +32,7 @@ type CompactPackageData = {
|
|
|
25
32
|
packages: PackageData[];
|
|
26
33
|
repositories?: Record<string, PackageRepositoryData>;
|
|
27
34
|
};
|
|
35
|
+
export declare function formatPackageData(pkg: PackageResult): PackageData;
|
|
28
36
|
export declare function compactPackageRepositories(packages: PackageData[]): CompactPackageData;
|
|
29
37
|
type PackagePagination = {
|
|
30
38
|
currentPage: number;
|
|
@@ -25,28 +25,67 @@ export declare const NpmSearchOutputLocalSchema: z.ZodObject<{
|
|
|
25
25
|
repository: z.ZodOptional<z.ZodString>;
|
|
26
26
|
repositoryDirectory: z.ZodOptional<z.ZodString>;
|
|
27
27
|
repositoryId: z.ZodOptional<z.ZodString>;
|
|
28
|
-
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.
|
|
28
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
29
|
+
tool: z.ZodString;
|
|
30
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
31
|
+
why: z.ZodOptional<z.ZodString>;
|
|
32
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
exact: "exact";
|
|
34
|
+
heuristic: "heuristic";
|
|
35
|
+
}>>;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
38
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
+
level: z.ZodEnum<{
|
|
40
|
+
error: "error";
|
|
41
|
+
info: "info";
|
|
42
|
+
warning: "warning";
|
|
43
|
+
}>;
|
|
44
|
+
message: z.ZodString;
|
|
45
|
+
field: z.ZodOptional<z.ZodString>;
|
|
46
|
+
code: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
29
48
|
}, z.core.$loose>>>;
|
|
30
49
|
repositories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
31
50
|
repository: z.ZodString;
|
|
32
51
|
owner: z.ZodString;
|
|
33
52
|
repo: z.ZodString;
|
|
34
53
|
repositoryDirectory: z.ZodOptional<z.ZodString>;
|
|
35
|
-
next: z.ZodRecord<z.ZodString, z.
|
|
54
|
+
next: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
55
|
+
tool: z.ZodString;
|
|
56
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
57
|
+
why: z.ZodOptional<z.ZodString>;
|
|
58
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
exact: "exact";
|
|
60
|
+
heuristic: "heuristic";
|
|
61
|
+
}>>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
36
63
|
}, z.core.$loose>>>;
|
|
37
64
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
38
65
|
currentPage: z.ZodNumber;
|
|
39
66
|
totalPages: z.ZodNumber;
|
|
40
|
-
perPage: z.ZodNumber;
|
|
41
|
-
totalFound: z.ZodNumber;
|
|
42
|
-
returned: z.ZodNumber;
|
|
43
67
|
hasMore: z.ZodBoolean;
|
|
44
68
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
exact: "exact";
|
|
79
|
+
reported: "reported";
|
|
80
|
+
lowerBound: "lowerBound";
|
|
81
|
+
}>>;
|
|
82
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
45
85
|
}, z.core.$strip>>;
|
|
46
86
|
}, z.core.$loose>>;
|
|
47
87
|
status: z.ZodOptional<z.ZodString>;
|
|
48
88
|
}, z.core.$loose>>>;
|
|
49
|
-
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
89
|
base: z.ZodOptional<z.ZodString>;
|
|
51
90
|
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
52
91
|
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { CodeSearchResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { GitHubCodeSearchQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
5
|
+
type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
|
|
6
|
+
/**
|
|
7
|
+
* Char-boundary truncation mirroring the Rust engine's `truncate_unicode`:
|
|
8
|
+
* keeps at most `maxChars` Unicode scalars and appends `...` when it cuts.
|
|
9
|
+
* Never slices UTF-8 mid-codepoint or mid-token — the single data-layer bound
|
|
10
|
+
* for GitHub code-search match fragments (the render layer must not re-trim).
|
|
11
|
+
*/
|
|
12
|
+
export declare function truncateSnippetChars(value: string, maxChars?: number): string;
|
|
13
|
+
export declare function mapCodeSearchToolQuery(query: WithOptionalMeta<GitHubCodeSearchQuery>): {
|
|
14
|
+
keywords: string[];
|
|
15
|
+
projectId: string;
|
|
16
|
+
owner: string;
|
|
17
|
+
path: string;
|
|
18
|
+
filename: string;
|
|
19
|
+
extension: string;
|
|
20
|
+
language: string | undefined;
|
|
21
|
+
match: "file" | "path";
|
|
22
|
+
limit: number | undefined;
|
|
23
|
+
page: number;
|
|
24
|
+
mainResearchGoal: string;
|
|
25
|
+
researchGoal: string;
|
|
26
|
+
reasoning: string;
|
|
27
|
+
};
|
|
28
|
+
export interface CodeSearchGroupedMatch {
|
|
29
|
+
path: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
pathOnly?: boolean;
|
|
32
|
+
matchIndices?: Array<{
|
|
33
|
+
start: number;
|
|
34
|
+
end: number;
|
|
35
|
+
lineOffset: number;
|
|
36
|
+
}>;
|
|
37
|
+
url?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CodeSearchGroupedResult {
|
|
40
|
+
id: string;
|
|
41
|
+
queryId?: string;
|
|
42
|
+
owner: string;
|
|
43
|
+
repo: string;
|
|
44
|
+
matches: CodeSearchGroupedMatch[];
|
|
45
|
+
}
|
|
46
|
+
export interface CodeSearchPagination {
|
|
47
|
+
currentPage: number;
|
|
48
|
+
totalPages: number;
|
|
49
|
+
perPage: number;
|
|
50
|
+
totalMatches: number;
|
|
51
|
+
reportedTotalMatches?: number;
|
|
52
|
+
reachableTotalMatches?: number;
|
|
53
|
+
totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
|
|
54
|
+
totalMatchesCapped?: boolean;
|
|
55
|
+
hasMore: boolean;
|
|
56
|
+
nextPage?: number;
|
|
57
|
+
uniqueFileCount?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface CodeSearchFlatResult {
|
|
60
|
+
results: CodeSearchGroupedResult[];
|
|
61
|
+
pagination?: CodeSearchPagination;
|
|
62
|
+
nonExistentScope?: boolean;
|
|
63
|
+
incompleteResults?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare function mapCodeSearchProviderResult(data: CodeSearchResult, query: WithOptionalMeta<GitHubCodeSearchQuery>): CodeSearchFlatResult;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FileContentResult as ProviderFileContentResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
4
|
+
import { FileContentQueryLocalSchema } from '../github_fetch_content/scheme.js';
|
|
5
|
+
type LocalFileContentQuery = z.infer<typeof FileContentQueryLocalSchema> & {
|
|
6
|
+
minify: import('../../scheme/fields.js').MinifyMode;
|
|
7
|
+
};
|
|
8
|
+
export declare function mapFileContentToolQuery(query: LocalFileContentQuery): {
|
|
9
|
+
projectId: string;
|
|
10
|
+
path: string;
|
|
11
|
+
ref: string;
|
|
12
|
+
startLine: number;
|
|
13
|
+
endLine: number;
|
|
14
|
+
matchString: string;
|
|
15
|
+
contextLines: number;
|
|
16
|
+
fullContent: boolean;
|
|
17
|
+
forceRefresh: boolean;
|
|
18
|
+
charOffset: number;
|
|
19
|
+
charLength: number;
|
|
20
|
+
minify: "none" | "standard" | "symbols";
|
|
21
|
+
matchStringIsRegex: boolean;
|
|
22
|
+
matchStringCaseSensitive: boolean;
|
|
23
|
+
mainResearchGoal: string;
|
|
24
|
+
researchGoal: string;
|
|
25
|
+
reasoning: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function mapFileContentProviderResult(data: ProviderFileContentResult, query: WithOptionalMeta<LocalFileContentQuery>): Record<string, unknown>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { PullRequestSearchResult as ProviderPullRequestSearchResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { GitHubPullRequestSearchQueryLocalSchema } from '../github_search_pull_requests/scheme.js';
|
|
4
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
5
|
+
type GitHubPullRequestSearchQuery = z.infer<typeof GitHubPullRequestSearchQueryLocalSchema>;
|
|
6
|
+
type PRDefaultKeys = 'order' | 'limit' | 'page';
|
|
7
|
+
type PartialPRQuery = WithOptionalMeta<Omit<GitHubPullRequestSearchQuery, PRDefaultKeys> & Partial<Pick<GitHubPullRequestSearchQuery, PRDefaultKeys>>>;
|
|
8
|
+
export declare function mapPullRequestToolQuery(query: PartialPRQuery): {
|
|
9
|
+
projectId: string;
|
|
10
|
+
owner: string;
|
|
11
|
+
query: string;
|
|
12
|
+
number: number;
|
|
13
|
+
state: "open" | "closed" | "merged" | "all" | undefined;
|
|
14
|
+
author: string;
|
|
15
|
+
assignee: string;
|
|
16
|
+
commenter: string;
|
|
17
|
+
involves: string;
|
|
18
|
+
mentions: string;
|
|
19
|
+
reviewRequested: string;
|
|
20
|
+
reviewedBy: string;
|
|
21
|
+
labels: string[];
|
|
22
|
+
noLabel: boolean;
|
|
23
|
+
noMilestone: boolean;
|
|
24
|
+
noProject: boolean;
|
|
25
|
+
noAssignee: boolean;
|
|
26
|
+
baseBranch: string;
|
|
27
|
+
headBranch: string;
|
|
28
|
+
created: string;
|
|
29
|
+
updated: string;
|
|
30
|
+
closed: string;
|
|
31
|
+
mergedAt: string;
|
|
32
|
+
comments: string;
|
|
33
|
+
reactions: string;
|
|
34
|
+
interactions: string;
|
|
35
|
+
draft: boolean;
|
|
36
|
+
match: ("title" | "body" | "comments")[];
|
|
37
|
+
milestone: string;
|
|
38
|
+
language: string;
|
|
39
|
+
checks: "success" | "failure" | "pending";
|
|
40
|
+
review: "none" | "approved" | "changes_requested" | "required";
|
|
41
|
+
locked: boolean;
|
|
42
|
+
visibility: "public" | "private";
|
|
43
|
+
teamMentions: string;
|
|
44
|
+
project: string;
|
|
45
|
+
archived: boolean | undefined;
|
|
46
|
+
content: unknown;
|
|
47
|
+
reviewMode: "full" | "summary";
|
|
48
|
+
filePage: number;
|
|
49
|
+
commentPage: number;
|
|
50
|
+
commitPage: number;
|
|
51
|
+
itemsPerPage: number;
|
|
52
|
+
sort: "created" | "updated" | "best-match" | "comments" | "reactions" | undefined;
|
|
53
|
+
order: "asc" | "desc" | undefined;
|
|
54
|
+
limit: number;
|
|
55
|
+
page: number;
|
|
56
|
+
charOffset: number;
|
|
57
|
+
charLength: number;
|
|
58
|
+
mainResearchGoal: string;
|
|
59
|
+
researchGoal: string;
|
|
60
|
+
reasoning: string;
|
|
61
|
+
};
|
|
62
|
+
export declare function mapPullRequestProviderResultData(data: ProviderPullRequestSearchResult, options?: {
|
|
63
|
+
includeFileChanges?: boolean;
|
|
64
|
+
}): {
|
|
65
|
+
pullRequests: {
|
|
66
|
+
sanitizationWarnings?: string[];
|
|
67
|
+
fileChanges?: {
|
|
68
|
+
path: string;
|
|
69
|
+
status: string;
|
|
70
|
+
additions: number;
|
|
71
|
+
deletions: number;
|
|
72
|
+
patch?: string;
|
|
73
|
+
}[];
|
|
74
|
+
reviewSummary: {
|
|
75
|
+
totalComments: number;
|
|
76
|
+
inlineComments: number;
|
|
77
|
+
discussionComments: number;
|
|
78
|
+
commenters: string[];
|
|
79
|
+
latestCommentAt?: string;
|
|
80
|
+
themes: string[];
|
|
81
|
+
};
|
|
82
|
+
commits: {
|
|
83
|
+
sha: string;
|
|
84
|
+
message: string;
|
|
85
|
+
author: string;
|
|
86
|
+
date: string;
|
|
87
|
+
}[];
|
|
88
|
+
reviews: {
|
|
89
|
+
id: string;
|
|
90
|
+
user: string;
|
|
91
|
+
state: string;
|
|
92
|
+
body: string;
|
|
93
|
+
submittedAt?: string;
|
|
94
|
+
commitId?: string;
|
|
95
|
+
}[];
|
|
96
|
+
comments: {
|
|
97
|
+
bodyPagination: {
|
|
98
|
+
charOffset: number;
|
|
99
|
+
charLength: number;
|
|
100
|
+
totalChars: number;
|
|
101
|
+
hasMore: boolean;
|
|
102
|
+
nextCharOffset?: number;
|
|
103
|
+
};
|
|
104
|
+
id: string;
|
|
105
|
+
author: string;
|
|
106
|
+
body: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
commentType?: "discussion" | "review_inline";
|
|
110
|
+
path?: string;
|
|
111
|
+
line?: number;
|
|
112
|
+
in_reply_to_id?: number;
|
|
113
|
+
}[];
|
|
114
|
+
url: string;
|
|
115
|
+
state: "open" | "closed" | "merged";
|
|
116
|
+
draft: boolean;
|
|
117
|
+
author: string;
|
|
118
|
+
assignees: string[];
|
|
119
|
+
labels: string[];
|
|
120
|
+
sourceBranch: string;
|
|
121
|
+
targetBranch: string;
|
|
122
|
+
sourceSha: string;
|
|
123
|
+
targetSha: string;
|
|
124
|
+
createdAt: string;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
closedAt: string;
|
|
127
|
+
mergedAt: string;
|
|
128
|
+
commentsCount: number;
|
|
129
|
+
changedFilesCount: number;
|
|
130
|
+
additions: number;
|
|
131
|
+
deletions: number;
|
|
132
|
+
bodyPagination: {
|
|
133
|
+
charOffset: number;
|
|
134
|
+
charLength: number;
|
|
135
|
+
totalChars: number;
|
|
136
|
+
hasMore: boolean;
|
|
137
|
+
nextCharOffset?: number;
|
|
138
|
+
};
|
|
139
|
+
number: number;
|
|
140
|
+
title: string;
|
|
141
|
+
body: string;
|
|
142
|
+
}[];
|
|
143
|
+
resultData: Record<string, unknown>;
|
|
144
|
+
pagination: {
|
|
145
|
+
nextPage?: number;
|
|
146
|
+
hasMore: boolean;
|
|
147
|
+
uniqueFileCount?: number;
|
|
148
|
+
totalMatchesCapped?: boolean;
|
|
149
|
+
totalMatchesKind?: "exact" | "reported" | "lowerBound";
|
|
150
|
+
reachableTotalMatches?: number;
|
|
151
|
+
reportedTotalMatches?: number;
|
|
152
|
+
totalMatches?: number;
|
|
153
|
+
currentPage: number;
|
|
154
|
+
totalPages: number;
|
|
155
|
+
perPage: number;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RepoSearchResult as ProviderRepoSearchResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { GitHubReposSearchSingleQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
import type { GitHubRepositoryOutput } from '@octocodeai/octocode-core/extra-types';
|
|
5
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
6
|
+
type GitHubReposSearchSingleQuery = z.infer<typeof GitHubReposSearchSingleQuerySchema>;
|
|
7
|
+
export declare function mapRepoSearchToolQuery(query: WithOptionalMeta<GitHubReposSearchSingleQuery>): {
|
|
8
|
+
keywords: string[];
|
|
9
|
+
topics: string[];
|
|
10
|
+
owner: string;
|
|
11
|
+
stars: string;
|
|
12
|
+
size: string;
|
|
13
|
+
created: string;
|
|
14
|
+
updated: string;
|
|
15
|
+
language: string;
|
|
16
|
+
archived: boolean | undefined;
|
|
17
|
+
visibility: "public" | "private" | undefined;
|
|
18
|
+
forks: string | undefined;
|
|
19
|
+
license: string | undefined;
|
|
20
|
+
goodFirstIssues: string | undefined;
|
|
21
|
+
match: ("description" | "name" | "readme")[];
|
|
22
|
+
sort: "stars" | "forks" | "updated" | "created" | "best-match" | undefined;
|
|
23
|
+
limit: number | undefined;
|
|
24
|
+
page: number;
|
|
25
|
+
mainResearchGoal: string;
|
|
26
|
+
researchGoal: string;
|
|
27
|
+
reasoning: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function mapRepoSearchProviderRepositories(repositories: ProviderRepoSearchResult['repositories']): GitHubRepositoryOutput[];
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RepoStructureResult as ProviderRepoStructureResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { GitHubViewRepoStructureQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
5
|
+
type GitHubViewRepoStructureQuery = z.infer<typeof GitHubViewRepoStructureQuerySchema>;
|
|
6
|
+
type PartialRepoStructureQuery = WithOptionalMeta<GitHubViewRepoStructureQuery>;
|
|
7
|
+
export declare function mapRepoStructureToolQuery(query: PartialRepoStructureQuery, resolvedBranch: string): {
|
|
8
|
+
projectId: string;
|
|
9
|
+
ref: string;
|
|
10
|
+
path: string;
|
|
11
|
+
depth: number;
|
|
12
|
+
itemsPerPage: number;
|
|
13
|
+
page: number;
|
|
14
|
+
includeSizes: boolean;
|
|
15
|
+
mainResearchGoal: string;
|
|
16
|
+
researchGoal: string;
|
|
17
|
+
reasoning: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function mapRepoStructureProviderResult(data: ProviderRepoStructureResult, _query: PartialRepoStructureQuery, filteredStructure: ProviderRepoStructureResult['structure'], resolvedBranch: string): Record<string, unknown>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small helpers shared across the providerMappers/* domain files.
|
|
3
|
+
* Kept internal to the providerMappers module (not part of its public
|
|
4
|
+
* barrel contract) — imported directly by sibling files in this directory.
|
|
5
|
+
*/
|
|
6
|
+
export declare function toProviderProjectId(owner?: string, repo?: string): string | undefined;
|
|
7
|
+
export declare function splitRepositoryPath(repositoryPath: string): {
|
|
8
|
+
owner: string;
|
|
9
|
+
repo: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function countMetadata(pagination: {
|
|
12
|
+
reportedTotalMatches?: number;
|
|
13
|
+
reachableTotalMatches?: number;
|
|
14
|
+
totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
|
|
15
|
+
totalMatchesCapped?: boolean;
|
|
16
|
+
uniqueFileCount?: number;
|
|
17
|
+
} | undefined): {
|
|
18
|
+
uniqueFileCount?: number;
|
|
19
|
+
totalMatchesCapped?: boolean;
|
|
20
|
+
totalMatchesKind?: "exact" | "reported" | "lowerBound";
|
|
21
|
+
reachableTotalMatches?: number;
|
|
22
|
+
reportedTotalMatches?: number;
|
|
23
|
+
};
|