@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
|
@@ -3,5 +3,11 @@ import type { SymbolAnchor } from '../shared/resolveSymbolAnchor.js';
|
|
|
3
3
|
import type { LspSemanticEnvelope, SymbolAnchoredSemanticQuery } from '../shared/semanticTypes.js';
|
|
4
4
|
declare const CONSUMER_SCOPED_TYPES: ReadonlySet<string>;
|
|
5
5
|
export { CONSUMER_SCOPED_TYPES };
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export type ConsumerWarmupStats = {
|
|
7
|
+
candidates: number;
|
|
8
|
+
warmedFiles: number;
|
|
9
|
+
skippedLarge: number;
|
|
10
|
+
possiblyTruncated: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function warmLikelyConsumers(client: NonNullable<Awaited<ReturnType<typeof acquirePooledClient>>>, anchor: SymbolAnchor, workspaceRoot: string): Promise<ConsumerWarmupStats>;
|
|
13
|
+
export declare function dispatchAnchoredSemantic(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, client: NonNullable<Awaited<ReturnType<typeof acquirePooledClient>>>, warmupStats?: ConsumerWarmupStats): Promise<LspSemanticEnvelope>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { LSPRange, ReferenceLocation, ReferencesByFile, CodeSnippet } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
2
|
import { type LspSemanticEnvelope, type SymbolAnchoredSemanticQuery } from '../../shared/semanticTypes.js';
|
|
3
3
|
import type { SymbolAnchor } from '../../shared/resolveSymbolAnchor.js';
|
|
4
|
+
import type { ConsumerWarmupStats } from '../semanticAnchored.js';
|
|
4
5
|
export declare function locationsEnvelope(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, kind: 'definition' | 'typeDefinition' | 'implementation', provider: string, locations: CodeSnippet[]): LspSemanticEnvelope;
|
|
5
|
-
export declare function referencesEnvelope(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, locations: CodeSnippet[]): LspSemanticEnvelope;
|
|
6
|
+
export declare function referencesEnvelope(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, locations: CodeSnippet[], warmupStats?: ConsumerWarmupStats): LspSemanticEnvelope;
|
|
6
7
|
export declare function hoverEnvelope(_query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, hover: unknown): Promise<LspSemanticEnvelope>;
|
|
7
8
|
export declare function buildReferencesByFile(locations: readonly ReferenceLocation[]): ReferencesByFile[];
|
|
8
9
|
export declare function normalizeHover(hover: unknown): {
|
|
@@ -9,7 +9,10 @@ export declare function isNativeJsTsFile(uri: string): boolean;
|
|
|
9
9
|
* search instead. documentSymbols/structural search keep their tree-sitter path
|
|
10
10
|
* and never reach here.
|
|
11
11
|
*/
|
|
12
|
-
export declare function throwLspUnavailable(uri: string, op: SemanticContentType
|
|
12
|
+
export declare function throwLspUnavailable(uri: string, op: SemanticContentType, detail?: {
|
|
13
|
+
kind?: string;
|
|
14
|
+
message?: string;
|
|
15
|
+
}): never;
|
|
13
16
|
export declare function toLocalPath(value: string, workspaceRoot: string): string;
|
|
14
17
|
export declare function workspaceSymbolAnchorExtensions(): string[];
|
|
15
18
|
export declare function workspaceSymbolAnchorIncludeGlobs(): string[];
|
|
@@ -22,3 +25,16 @@ export declare function lspErrorMessage(error: unknown): string;
|
|
|
22
25
|
* to the "no symbols" empty state.
|
|
23
26
|
*/
|
|
24
27
|
export declare function nativeDocumentSymbols(uri: string, content: string): unknown[] | null;
|
|
28
|
+
/**
|
|
29
|
+
* Fallback document-symbol source for JS/TS files oxc's full-fidelity symbol
|
|
30
|
+
* extractor (`extractJsSymbols`) declines — notably Flow-typed `.js` (Flow
|
|
31
|
+
* syntax like type annotations/generics can make oxc's default JS grammar
|
|
32
|
+
* fail the whole-file parse, returning an empty body). `extractGraphFacts`
|
|
33
|
+
* uses a more lenient extraction already proven elsewhere (localFindDeadCode)
|
|
34
|
+
* to tolerate this exact file class, and its declarations already carry
|
|
35
|
+
* 0-based LSP `range`s — so they slot into the same DocumentSymbol shape
|
|
36
|
+
* `nativeDocumentSymbols` produces, just without a full symbol hierarchy
|
|
37
|
+
* (flat top-level declarations only; `kind` is used as-is by `symbolKindName`,
|
|
38
|
+
* which already passes string kinds through unchanged).
|
|
39
|
+
*/
|
|
40
|
+
export declare function graphFactsDocumentSymbols(uri: string, content: string): unknown[] | null;
|
|
@@ -21,7 +21,7 @@ export type CompactCall = {
|
|
|
21
21
|
};
|
|
22
22
|
export declare function attachSemanticRawEvidence<T extends object>(result: T): T;
|
|
23
23
|
export declare function formatSemanticResult(query: LspGetSemanticsQuery, result: LspSemanticEnvelope | Record<string, unknown>): LspSemanticEnvelope | Record<string, unknown>;
|
|
24
|
-
export
|
|
24
|
+
export { withSemanticNext } from './semanticNext.js';
|
|
25
25
|
export declare function isSemanticEnvelope(value: LspSemanticEnvelope | Record<string, unknown>): value is LspSemanticEnvelope;
|
|
26
26
|
export declare function compactSemanticEnvelope(envelope: LspSemanticEnvelope): LspSemanticEnvelope;
|
|
27
27
|
export declare function compactSemanticPayload(payload: LspSemanticEnvelope['payload']): LspSemanticEnvelope['payload'];
|
|
@@ -3,9 +3,21 @@ import type { CallHierarchyItem, IncomingCall, OutgoingCall } from '@octocodeai/
|
|
|
3
3
|
export type TraversalResult<T> = {
|
|
4
4
|
calls: T[];
|
|
5
5
|
truncatedByDepth: boolean;
|
|
6
|
+
truncatedByBudget: boolean;
|
|
7
|
+
visitedNodeCount: number;
|
|
8
|
+
requestCount: number;
|
|
6
9
|
cycleCount: number;
|
|
7
10
|
failedRequestCount: number;
|
|
8
11
|
};
|
|
12
|
+
export type TraversalBudget = {
|
|
13
|
+
maxNodes: number;
|
|
14
|
+
maxRequests: number;
|
|
15
|
+
};
|
|
16
|
+
export type MutableTraversalBudget = TraversalBudget & {
|
|
17
|
+
visitedNodeCount: number;
|
|
18
|
+
requestCount: number;
|
|
19
|
+
truncatedByBudget: boolean;
|
|
20
|
+
};
|
|
9
21
|
export declare function createCallItemKey(item: CallHierarchyItem): string;
|
|
10
|
-
export declare function gatherIncomingCallsRecursive(client: LSPClient | null, item: CallHierarchyItem, remainingDepth: number, visited: Set<string>, contextLines: number): Promise<TraversalResult<IncomingCall>>;
|
|
11
|
-
export declare function gatherOutgoingCallsRecursive(client: LSPClient | null, item: CallHierarchyItem, remainingDepth: number, visited: Set<string>, contextLines: number): Promise<TraversalResult<OutgoingCall>>;
|
|
22
|
+
export declare function gatherIncomingCallsRecursive(client: LSPClient | null, item: CallHierarchyItem, remainingDepth: number, visited: Set<string>, contextLines: number, budget?: MutableTraversalBudget): Promise<TraversalResult<IncomingCall>>;
|
|
23
|
+
export declare function gatherOutgoingCallsRecursive(client: LSPClient | null, item: CallHierarchyItem, remainingDepth: number, visited: Set<string>, contextLines: number, budget?: MutableTraversalBudget): Promise<TraversalResult<OutgoingCall>>;
|
|
@@ -46,6 +46,9 @@ export type ResolvedSymbol = {
|
|
|
46
46
|
orderHint?: number;
|
|
47
47
|
position: ExactPosition;
|
|
48
48
|
isAmbiguous?: boolean;
|
|
49
|
+
/** Lines between the caller's lineHint and the line actually bound —
|
|
50
|
+
* present only when nonzero, so a stale hint is visible in the result. */
|
|
51
|
+
lineDeviation?: number;
|
|
49
52
|
};
|
|
50
53
|
export type CompactResolvedSymbol = {
|
|
51
54
|
name: string;
|
|
@@ -53,6 +56,7 @@ export type CompactResolvedSymbol = {
|
|
|
53
56
|
foundAtLine: number;
|
|
54
57
|
orderHint?: number;
|
|
55
58
|
isAmbiguous?: boolean;
|
|
59
|
+
lineDeviation?: number;
|
|
56
60
|
};
|
|
57
61
|
export declare function compactResolvedSymbol(symbol: ResolvedSymbol): CompactResolvedSymbol;
|
|
58
62
|
export type CompactLocation = {
|
|
@@ -99,6 +103,12 @@ export type LspSemanticEnvelope = {
|
|
|
99
103
|
byFile?: unknown[];
|
|
100
104
|
totalReferences: number;
|
|
101
105
|
totalFiles: number;
|
|
106
|
+
warmup?: {
|
|
107
|
+
candidates: number;
|
|
108
|
+
warmedFiles: number;
|
|
109
|
+
skippedLarge: number;
|
|
110
|
+
possiblyTruncated: boolean;
|
|
111
|
+
};
|
|
102
112
|
empty?: SemanticEmptyState;
|
|
103
113
|
} | {
|
|
104
114
|
kind: 'callers' | 'callees' | 'callHierarchy';
|
|
@@ -110,6 +120,9 @@ export type LspSemanticEnvelope = {
|
|
|
110
120
|
completeness: {
|
|
111
121
|
complete: boolean;
|
|
112
122
|
truncatedByDepth: boolean;
|
|
123
|
+
truncatedByBudget?: boolean;
|
|
124
|
+
visitedNodeCount?: number;
|
|
125
|
+
requestCount?: number;
|
|
113
126
|
cycleCount: number;
|
|
114
127
|
failedRequestCount: number;
|
|
115
128
|
dynamicCallsExcluded: true;
|
|
@@ -165,6 +178,6 @@ export type LspSemanticEnvelope = {
|
|
|
165
178
|
tool: string;
|
|
166
179
|
query: Record<string, unknown>;
|
|
167
180
|
why?: string;
|
|
168
|
-
confidence?: 'exact' | '
|
|
181
|
+
confidence?: 'exact' | 'high' | 'medium' | 'low';
|
|
169
182
|
}>;
|
|
170
183
|
};
|
|
@@ -2,8 +2,17 @@ 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
|
+
export { foldKeywords, isPackageNotFoundError } from './queryHelpers.js';
|
|
5
6
|
import type { PackageResult } from '../../utils/package/common.js';
|
|
6
7
|
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
8
|
+
/**
|
|
9
|
+
* Normalize the many repository URL shapes npm packages carry
|
|
10
|
+
* (ssh://git@…, git+https://…, git://…, git@host:owner/repo, and npm's
|
|
11
|
+
* `github:owner/repo` / `gitlab:` / `bitbucket:` shorthands) into a
|
|
12
|
+
* canonical `https://host/owner/repo` form. Falls back to the cleaned
|
|
13
|
+
* original when the shape is unrecognized.
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeRepoUrl(url: string | null | undefined): string | undefined;
|
|
7
16
|
type PackageData = {
|
|
8
17
|
name: string;
|
|
9
18
|
version?: string;
|
|
@@ -15,11 +24,6 @@ type PackageData = {
|
|
|
15
24
|
repositoryId?: string;
|
|
16
25
|
next?: Record<string, unknown>;
|
|
17
26
|
warnings?: string[];
|
|
18
|
-
diagnostics?: Array<{
|
|
19
|
-
level: 'info' | 'warning' | 'error';
|
|
20
|
-
message: string;
|
|
21
|
-
code?: string;
|
|
22
|
-
}>;
|
|
23
27
|
};
|
|
24
28
|
type PackageRepositoryData = {
|
|
25
29
|
repository: string;
|
|
@@ -45,4 +49,3 @@ type PackagePagination = {
|
|
|
45
49
|
};
|
|
46
50
|
export declare function buildPackagePagination(query: NpmSearchQuery, totalFound: number, returned: number, isKeyword: boolean): PackagePagination;
|
|
47
51
|
export declare function searchPackages(args: ToolExecutionArgs<NpmSearchQuery>): Promise<CallToolResult>;
|
|
48
|
-
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fold a `keywords` field (string as-is, or an array joined with spaces) into a
|
|
3
|
+
* single registry query string. Sibling tools (ghSearchCode/localSearchCode)
|
|
4
|
+
* take keyword arrays, so agents pass arrays here too — the scheme accepts both
|
|
5
|
+
* shapes and this is where the array is collapsed. Returns undefined when empty.
|
|
6
|
+
*/
|
|
7
|
+
export declare function foldKeywords(keywords: string | string[] | undefined): string | undefined;
|
|
8
|
+
export declare function isPackageNotFoundError(message: string): boolean;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { ItemPagination, ToolContinuation } from '../../scheme/pagination.js';
|
|
3
|
+
import type { BulkToolOutput } from '../../types/toolOutput.js';
|
|
2
4
|
export declare const NpmSearchQueryLocalSchema: z.ZodObject<{
|
|
3
5
|
packageName: z.ZodString;
|
|
6
|
+
keywords: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
4
7
|
page: z.ZodDefault<z.ZodNumber>;
|
|
5
8
|
id: z.ZodOptional<z.ZodString>;
|
|
6
9
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -12,89 +15,30 @@ export declare const NpmSearchBulkQueryLocalSchema: z.ZodObject<{
|
|
|
12
15
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
13
16
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
14
17
|
}, z.core.$strip>;
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
warning: "warning";
|
|
43
|
-
}>;
|
|
44
|
-
message: z.ZodString;
|
|
45
|
-
field: z.ZodOptional<z.ZodString>;
|
|
46
|
-
code: z.ZodOptional<z.ZodString>;
|
|
47
|
-
}, z.core.$strip>>>;
|
|
48
|
-
}, z.core.$loose>>>;
|
|
49
|
-
repositories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
50
|
-
repository: z.ZodString;
|
|
51
|
-
owner: z.ZodString;
|
|
52
|
-
repo: z.ZodString;
|
|
53
|
-
repositoryDirectory: z.ZodOptional<z.ZodString>;
|
|
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>>;
|
|
63
|
-
}, z.core.$loose>>>;
|
|
64
|
-
pagination: z.ZodOptional<z.ZodObject<{
|
|
65
|
-
currentPage: z.ZodNumber;
|
|
66
|
-
totalPages: z.ZodNumber;
|
|
67
|
-
hasMore: z.ZodBoolean;
|
|
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>;
|
|
85
|
-
}, z.core.$strip>>;
|
|
86
|
-
}, z.core.$loose>>;
|
|
87
|
-
status: z.ZodOptional<z.ZodString>;
|
|
88
|
-
}, z.core.$loose>>>;
|
|
89
|
-
base: z.ZodOptional<z.ZodString>;
|
|
90
|
-
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
91
|
-
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
92
|
-
currentPage: z.ZodNumber;
|
|
93
|
-
totalPages: z.ZodNumber;
|
|
94
|
-
hasMore: z.ZodBoolean;
|
|
95
|
-
charOffset: z.ZodNumber;
|
|
96
|
-
charLength: z.ZodNumber;
|
|
97
|
-
totalChars: z.ZodNumber;
|
|
98
|
-
nextCharOffset: z.ZodOptional<z.ZodNumber>;
|
|
99
|
-
}, z.core.$strip>>;
|
|
100
|
-
}, z.core.$strip>;
|
|
18
|
+
export interface NpmSearchPackage {
|
|
19
|
+
name: string;
|
|
20
|
+
version?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
license?: string;
|
|
23
|
+
downloads?: number;
|
|
24
|
+
repository?: string;
|
|
25
|
+
repositoryDirectory?: string;
|
|
26
|
+
repositoryId?: string;
|
|
27
|
+
next?: Record<string, ToolContinuation>;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export interface NpmSearchRepository {
|
|
31
|
+
repository: string;
|
|
32
|
+
owner: string;
|
|
33
|
+
repo: string;
|
|
34
|
+
repositoryDirectory?: string;
|
|
35
|
+
next: Record<string, ToolContinuation>;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface NpmSearchData {
|
|
39
|
+
packages?: NpmSearchPackage[];
|
|
40
|
+
repositories?: Record<string, NpmSearchRepository>;
|
|
41
|
+
pagination?: ItemPagination;
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
export type NpmSearchOutputLocal = BulkToolOutput<NpmSearchData>;
|
|
@@ -14,15 +14,10 @@ export declare function mapPullRequestToolQuery(query: PartialPRQuery): {
|
|
|
14
14
|
author: string;
|
|
15
15
|
assignee: string;
|
|
16
16
|
commenter: string;
|
|
17
|
-
involves: string;
|
|
18
17
|
mentions: string;
|
|
19
18
|
reviewRequested: string;
|
|
20
19
|
reviewedBy: string;
|
|
21
20
|
labels: string[];
|
|
22
|
-
noLabel: boolean;
|
|
23
|
-
noMilestone: boolean;
|
|
24
|
-
noProject: boolean;
|
|
25
|
-
noAssignee: boolean;
|
|
26
21
|
baseBranch: string;
|
|
27
22
|
headBranch: string;
|
|
28
23
|
created: string;
|
|
@@ -31,17 +26,10 @@ export declare function mapPullRequestToolQuery(query: PartialPRQuery): {
|
|
|
31
26
|
mergedAt: string;
|
|
32
27
|
comments: string;
|
|
33
28
|
reactions: string;
|
|
34
|
-
interactions: string;
|
|
35
29
|
draft: boolean;
|
|
36
30
|
match: ("title" | "body" | "comments")[];
|
|
37
|
-
milestone: string;
|
|
38
|
-
language: string;
|
|
39
31
|
checks: "success" | "failure" | "pending";
|
|
40
32
|
review: "none" | "approved" | "changes_requested" | "required";
|
|
41
|
-
locked: boolean;
|
|
42
|
-
visibility: "public" | "private";
|
|
43
|
-
teamMentions: string;
|
|
44
|
-
project: string;
|
|
45
33
|
archived: boolean | undefined;
|
|
46
34
|
content: unknown;
|
|
47
35
|
reviewMode: "full" | "summary";
|
|
@@ -111,7 +99,6 @@ export declare function mapPullRequestProviderResultData(data: ProviderPullReque
|
|
|
111
99
|
line?: number;
|
|
112
100
|
in_reply_to_id?: number;
|
|
113
101
|
}[];
|
|
114
|
-
url: string;
|
|
115
102
|
state: "open" | "closed" | "merged";
|
|
116
103
|
draft: boolean;
|
|
117
104
|
author: string;
|
|
@@ -9,17 +9,13 @@ export declare function mapRepoSearchToolQuery(query: WithOptionalMeta<GitHubRep
|
|
|
9
9
|
topics: string[];
|
|
10
10
|
owner: string;
|
|
11
11
|
stars: string;
|
|
12
|
-
size: string;
|
|
13
|
-
created: string;
|
|
14
12
|
updated: string;
|
|
15
13
|
language: string;
|
|
16
14
|
archived: boolean | undefined;
|
|
17
15
|
visibility: "public" | "private" | undefined;
|
|
18
|
-
forks: string | undefined;
|
|
19
16
|
license: string | undefined;
|
|
20
|
-
goodFirstIssues: string | undefined;
|
|
21
17
|
match: ("description" | "name" | "readme")[];
|
|
22
|
-
sort: "
|
|
18
|
+
sort: "updated" | "best-match" | "stars" | "forks" | "help-wanted-issues";
|
|
23
19
|
limit: number | undefined;
|
|
24
20
|
page: number;
|
|
25
21
|
mainResearchGoal: string;
|
|
@@ -12,6 +12,10 @@ export declare function mapRepoStructureToolQuery(query: PartialRepoStructureQue
|
|
|
12
12
|
itemsPerPage: number;
|
|
13
13
|
page: number;
|
|
14
14
|
includeSizes: boolean;
|
|
15
|
+
includeLanguages: boolean;
|
|
16
|
+
includeContributors: boolean;
|
|
17
|
+
includeBranches: boolean;
|
|
18
|
+
includeTags: boolean;
|
|
15
19
|
mainResearchGoal: string;
|
|
16
20
|
researchGoal: string;
|
|
17
21
|
reasoning: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import type { ToolNames } from '@octocodeai/octocode-core/types';
|
|
3
|
+
import { type z } from 'zod';
|
|
4
|
+
import { type ToolMetadataGateway } from './toolMetadata/gateway.js';
|
|
5
|
+
export type ToolDirectSecurity = 'basic' | 'remote';
|
|
6
|
+
export interface ToolDirectExecutionConfig {
|
|
7
|
+
schema: z.ZodType;
|
|
8
|
+
inputSchema: z.ZodType;
|
|
9
|
+
executionFn: (input: never) => Promise<CallToolResult>;
|
|
10
|
+
security: ToolDirectSecurity;
|
|
11
|
+
requiresServerRuntime?: boolean;
|
|
12
|
+
requiresProviders?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ToolConfig {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
isDefault: boolean;
|
|
18
|
+
isLocal: boolean;
|
|
19
|
+
isClone?: boolean;
|
|
20
|
+
type: 'search' | 'content' | 'history' | 'debug';
|
|
21
|
+
skipMetadataCheck?: boolean;
|
|
22
|
+
direct: ToolDirectExecutionConfig;
|
|
23
|
+
}
|
|
24
|
+
export declare const getDescription: (toolName: string, gateway?: Pick<ToolMetadataGateway, "getDescription">) => string;
|
|
25
|
+
export declare function createTool(gateway: ToolMetadataGateway, nameKey: keyof ToolNames, config: Omit<ToolConfig, 'name' | 'description'>): ToolConfig;
|
|
@@ -1,40 +1,25 @@
|
|
|
1
|
-
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { type z } from 'zod';
|
|
3
1
|
import { DEFAULT_TOOL_METADATA_GATEWAY, type ToolMetadataGateway } from './toolMetadata/gateway.js';
|
|
2
|
+
import { getDescription, type ToolConfig, type ToolDirectExecutionConfig, type ToolDirectSecurity } from './toolCatalogFactory.js';
|
|
4
3
|
export type { ToolMetadataGateway };
|
|
5
4
|
export { DEFAULT_TOOL_METADATA_GATEWAY };
|
|
5
|
+
export { getDescription };
|
|
6
|
+
export type { ToolConfig, ToolDirectExecutionConfig, ToolDirectSecurity };
|
|
6
7
|
export type { ToolInvocationCallback } from '../types/toolResults.js';
|
|
7
|
-
export type ToolDirectSecurity = 'basic' | 'remote';
|
|
8
|
-
export interface ToolDirectExecutionConfig {
|
|
9
|
-
schema: z.ZodType;
|
|
10
|
-
inputSchema: z.ZodType;
|
|
11
|
-
executionFn: (input: never) => Promise<CallToolResult>;
|
|
12
|
-
security: ToolDirectSecurity;
|
|
13
|
-
requiresServerRuntime?: boolean;
|
|
14
|
-
requiresProviders?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface ToolConfig {
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
isDefault: boolean;
|
|
20
|
-
isLocal: boolean;
|
|
21
|
-
isClone?: boolean;
|
|
22
|
-
type: 'search' | 'content' | 'history' | 'debug';
|
|
23
|
-
skipMetadataCheck?: boolean;
|
|
24
|
-
direct: ToolDirectExecutionConfig;
|
|
25
|
-
}
|
|
26
|
-
export declare const getDescription: (toolName: string, gateway?: Pick<ToolMetadataGateway, "getDescription">) => string;
|
|
27
8
|
export declare const GITHUB_SEARCH_CODE: ToolConfig;
|
|
28
9
|
export declare const GITHUB_FETCH_CONTENT: ToolConfig;
|
|
29
10
|
export declare const GITHUB_VIEW_REPO_STRUCTURE: ToolConfig;
|
|
30
11
|
export declare const GITHUB_SEARCH_REPOSITORIES: ToolConfig;
|
|
31
|
-
export declare const
|
|
12
|
+
export declare const GITHUB_PULL_REQUESTS: ToolConfig;
|
|
13
|
+
export declare const GITHUB_ISSUES: ToolConfig;
|
|
14
|
+
export declare const GITHUB_COMMITS: ToolConfig;
|
|
15
|
+
export declare const GITHUB_RELEASES: ToolConfig;
|
|
16
|
+
export declare const GITHUB_DISCUSSIONS: ToolConfig;
|
|
32
17
|
export declare const PACKAGE_SEARCH: ToolConfig;
|
|
33
18
|
export declare const GITHUB_CLONE_REPO: ToolConfig;
|
|
34
19
|
export declare const LOCAL_RIPGREP: ToolConfig;
|
|
35
20
|
export declare const LOCAL_VIEW_STRUCTURE: ToolConfig;
|
|
36
21
|
export declare const LOCAL_FIND_FILES: ToolConfig;
|
|
22
|
+
export declare const LOCAL_FIND_DEAD_CODE: ToolConfig;
|
|
37
23
|
export declare const LOCAL_FETCH_CONTENT: ToolConfig;
|
|
38
24
|
export declare const LSP_GET_SEMANTIC_CONTENT: ToolConfig;
|
|
39
|
-
export declare const OQL_SEARCH: ToolConfig;
|
|
40
25
|
export declare const ALL_TOOLS: ToolConfig[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const STATIC_TOOL_NAMES: import("@octocodeai/octocode-core/types").ToolNames;
|
|
2
2
|
export declare const LSP_GET_SEMANTICS_TOOL_NAME: "lspGetSemantics";
|
|
3
|
-
export declare
|
|
4
|
-
export declare function
|
|
3
|
+
export declare function isReleasesEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
4
|
+
export declare function isDiscussionsEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
5
5
|
export declare function isLocalTool(toolName: string): boolean;
|
|
@@ -2,12 +2,14 @@ export { CloneRepoQueryLocalSchema, BulkCloneRepoLocalSchema, } from './github_c
|
|
|
2
2
|
export { FileContentQueryLocalSchema, FileContentBulkQueryLocalSchema, } from './github_fetch_content/scheme.js';
|
|
3
3
|
export { GitHubCodeSearchQueryLocalSchema, GitHubCodeSearchBulkQueryLocalSchema, } from './github_search_code/scheme.js';
|
|
4
4
|
export { GitHubPullRequestSearchQueryLocalSchema, GitHubPullRequestSearchBulkQueryLocalSchema, } from './github_search_pull_requests/scheme.js';
|
|
5
|
+
export { SearchPullRequestsLocalSchema, SearchPullRequestsBulkLocalSchema, SearchIssuesLocalSchema, SearchIssuesBulkLocalSchema, SearchCommitsLocalSchema, SearchCommitsBulkLocalSchema, ListReleasesLocalSchema, ListReleasesBulkLocalSchema, } from './github_search_pull_requests/splitSchemes.js';
|
|
6
|
+
export { SearchDiscussionsLocalSchema, SearchDiscussionsBulkLocalSchema, } from './github_search_discussions/scheme.js';
|
|
5
7
|
export { GitHubReposSearchSingleQueryLocalSchema, GitHubReposSearchBulkQueryLocalSchema, } from './github_search_repos/scheme.js';
|
|
6
8
|
export { GitHubViewRepoStructureQueryLocalSchema, GitHubViewRepoStructureBulkQueryLocalSchema, } from './github_view_repo_structure/scheme.js';
|
|
7
9
|
export { NpmSearchQueryLocalSchema, NpmSearchBulkQueryLocalSchema, } from './package_search/scheme.js';
|
|
8
10
|
export { LocalFetchContentQuerySchema, LocalFetchContentBulkQuerySchema, } from './local_fetch_content/scheme.js';
|
|
9
11
|
export { LocalFindFilesQuerySchema, LocalFindFilesBulkQuerySchema, } from './local_find_files/scheme.js';
|
|
12
|
+
export { LocalFindDeadCodeQuerySchema, LocalFindDeadCodeBulkQuerySchema, } from './local_dead_code/scheme.js';
|
|
10
13
|
export { LocalRipgrepQuerySchema, LocalRipgrepBulkQuerySchema, } from './local_ripgrep/scheme.js';
|
|
11
14
|
export { LocalViewStructureQuerySchema, LocalViewStructureBulkQuerySchema, } from './local_view_structure/scheme.js';
|
|
12
15
|
export { BulkLspGetSemanticsQuerySchema, LspGetSemanticsQueryDisplaySchema, } from './lsp/semantic_content/scheme.js';
|
|
13
|
-
export { OqlDisplayQuerySchema as OqlSearchQuerySchema, OqlSearchInputSchema, } from '../oql/schema.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-written output TYPES for the direct tools.
|
|
3
|
+
*
|
|
4
|
+
* The per-tool zod OUTPUT schemas were removed: the MCP server registers no
|
|
5
|
+
* outputSchema (see octocode-mcp registerBasicTool), so they validated nothing
|
|
6
|
+
* at runtime, duplicated the tool result shapes, and forced every output-shape
|
|
7
|
+
* change to be made in twelve places. Tools keep a plain TypeScript output
|
|
8
|
+
* type instead — one shared envelope generic plus a per-tool `data` interface.
|
|
9
|
+
*
|
|
10
|
+
* INPUT/query schemas are unaffected: those are registered and parsed, so they
|
|
11
|
+
* stay as zod.
|
|
12
|
+
*/
|
|
13
|
+
import type { ToolContinuation } from '../scheme/pagination.js';
|
|
14
|
+
/** Outermost char-window pagination wrapping a whole bulk response. */
|
|
15
|
+
export interface ResponsePaginationInfo {
|
|
16
|
+
currentPage: number;
|
|
17
|
+
totalPages: number;
|
|
18
|
+
hasMore: boolean;
|
|
19
|
+
charOffset: number;
|
|
20
|
+
charLength: number;
|
|
21
|
+
totalChars: number;
|
|
22
|
+
nextCharOffset?: number;
|
|
23
|
+
}
|
|
24
|
+
/** One result row in a bulk tool response. */
|
|
25
|
+
export interface BulkToolResultRow<TData> {
|
|
26
|
+
id: string;
|
|
27
|
+
status?: 'empty' | 'error';
|
|
28
|
+
data: TData;
|
|
29
|
+
next?: Record<string, ToolContinuation>;
|
|
30
|
+
}
|
|
31
|
+
/** The shared bulk envelope every direct tool returns, parameterized by its per-query `data` payload. */
|
|
32
|
+
export interface BulkToolOutput<TData> {
|
|
33
|
+
results: Array<BulkToolResultRow<TData>>;
|
|
34
|
+
base?: string;
|
|
35
|
+
shared?: Record<string, string | number | boolean>;
|
|
36
|
+
responsePagination?: ResponsePaginationInfo;
|
|
37
|
+
next?: Record<string, ToolContinuation>;
|
|
38
|
+
}
|
|
@@ -49,6 +49,12 @@ export declare const contextUtils: {
|
|
|
49
49
|
getGraphFactCapabilities(): string;
|
|
50
50
|
structuralSearch(content: string, filePath: string, pattern?: string | null, rule?: string | null): Promise<NativeContextUtils.StructuralMatch[]>;
|
|
51
51
|
structuralSearchFiles(options: NativeContextUtils.StructuralSearchFilesOptions): Promise<NativeContextUtils.StructuralSearchFilesResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Detailed structural search: same matching as structuralSearchFiles plus a
|
|
54
|
+
* query explanation (kind, literal anchor, pre-filter mode) and staged
|
|
55
|
+
* diagnostics with recovery hints — the payload zero-match guidance needs.
|
|
56
|
+
*/
|
|
57
|
+
structuralSearchFilesDetailed(options: NativeContextUtils.StructuralSearchFilesOptions): NativeContextUtils.StructuralSearchFilesDetailedResult;
|
|
52
58
|
getSupportedStructuralExtensions(): string[];
|
|
53
59
|
validateRipgrepPattern(pattern: string, fixedString?: boolean | null, perlRegex?: boolean | null): NativeContextUtils.RipgrepPatternValidationResult;
|
|
54
60
|
getSemanticBoundaryOffsets(content: string, filePath: string): Promise<number[]>;
|
|
@@ -29,6 +29,10 @@ export interface SearchStats {
|
|
|
29
29
|
filesSearched?: number;
|
|
30
30
|
bytesSearched?: number;
|
|
31
31
|
searchTime?: string;
|
|
32
|
+
/** The scan consumed its entire maxFiles candidate budget — totals reflect
|
|
33
|
+
* only the scanned subset and may understate the true count; raise maxFiles
|
|
34
|
+
* to count exhaustively. (Typed signal: responses carry no warnings.) */
|
|
35
|
+
capReached?: boolean;
|
|
32
36
|
}
|
|
33
37
|
export interface CacheStats {
|
|
34
38
|
hits: number;
|