@octocodeai/octocode-tools-core 16.2.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/dist/commands/BaseCommandBuilder.d.ts +14 -0
- package/dist/commands/FindCommandBuilder.d.ts +23 -0
- package/dist/commands/LsCommandBuilder.d.ts +15 -0
- package/dist/commands/RipgrepCommandBuilder.d.ts +27 -0
- package/dist/config.d.ts +16 -0
- package/dist/direct.d.ts +3 -0
- package/dist/direct.js +53 -0
- package/dist/errors/ToolError.d.ts +21 -0
- package/dist/errors/domainErrors.d.ts +310 -0
- package/dist/errors/errorFactories.d.ts +12 -0
- package/dist/errors/localToolErrors.d.ts +29 -0
- package/dist/errors/pathUtils.d.ts +1 -0
- package/dist/github/client.d.ts +12 -0
- package/dist/github/codeSearch.d.ts +8 -0
- package/dist/github/directoryFetch.d.ts +5 -0
- package/dist/github/errorConstants.d.ts +81 -0
- package/dist/github/errors.d.ts +3 -0
- package/dist/github/fileContent.d.ts +4 -0
- package/dist/github/fileContentProcess.d.ts +11 -0
- package/dist/github/fileContentRaw.d.ts +12 -0
- package/dist/github/githubAPI.d.ts +237 -0
- package/dist/github/history.d.ts +16 -0
- package/dist/github/prByNumber.d.ts +5 -0
- package/dist/github/prContentFetcher.d.ts +5 -0
- package/dist/github/prTransformation.d.ts +109 -0
- package/dist/github/pullRequestSearch.d.ts +4 -0
- package/dist/github/queryBuilders.d.ts +12 -0
- package/dist/github/repoSearch.d.ts +25 -0
- package/dist/github/repoStructure.d.ts +7 -0
- package/dist/github/repoStructurePagination.d.ts +6 -0
- package/dist/github/repoStructureRecursive.d.ts +3 -0
- package/dist/github/responseHeaders.d.ts +1 -0
- package/dist/hints/dynamic.d.ts +6 -0
- package/dist/hints/index.d.ts +2 -0
- package/dist/hints/types.d.ts +1 -0
- package/dist/index.d.ts +187 -0
- package/dist/index.js +64 -0
- package/dist/providers/capabilities.d.ts +2 -0
- package/dist/providers/factory.d.ts +9 -0
- package/dist/providers/github/GitHubProvider.d.ts +14 -0
- package/dist/providers/github/githubContent.d.ts +9 -0
- package/dist/providers/github/githubPullRequests.d.ts +12 -0
- package/dist/providers/github/githubSearch.d.ts +12 -0
- package/dist/providers/github/githubStructure.d.ts +9 -0
- package/dist/providers/github/utils.d.ts +10 -0
- package/dist/providers/providerQueries.d.ts +111 -0
- package/dist/providers/providerResults.d.ts +175 -0
- package/dist/providers/types.d.ts +48 -0
- package/dist/responses.d.ts +47 -0
- package/dist/scheme/coreSchemas.d.ts +10 -0
- package/dist/scheme/fields.d.ts +13 -0
- package/dist/scheme/responseEnvelope.d.ts +16 -0
- package/dist/security/bridge.d.ts +10 -0
- package/dist/serverConfig.d.ts +23 -0
- package/dist/session.d.ts +25 -0
- package/dist/tools/directToolCatalog.d.ts +56 -0
- package/dist/tools/executionGuard.d.ts +14 -0
- package/dist/tools/github_clone_repo/cache.d.ts +21 -0
- package/dist/tools/github_clone_repo/cloneRepo.d.ts +6 -0
- package/dist/tools/github_clone_repo/execution.d.ts +8 -0
- package/dist/tools/github_clone_repo/hints.d.ts +2 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +50 -0
- package/dist/tools/github_clone_repo/types.d.ts +19 -0
- package/dist/tools/github_fetch_content/execution.d.ts +7 -0
- package/dist/tools/github_fetch_content/finalizer.d.ts +10 -0
- package/dist/tools/github_fetch_content/hints.d.ts +2 -0
- package/dist/tools/github_fetch_content/scheme.d.ts +120 -0
- package/dist/tools/github_fetch_content/types.d.ts +66 -0
- package/dist/tools/github_search_code/execution.d.ts +8 -0
- package/dist/tools/github_search_code/finalizer.d.ts +6 -0
- package/dist/tools/github_search_code/hints.d.ts +2 -0
- package/dist/tools/github_search_code/scheme.d.ts +88 -0
- package/dist/tools/github_search_pull_requests/contentRequest.d.ts +52 -0
- package/dist/tools/github_search_pull_requests/contentResponse.d.ts +18 -0
- package/dist/tools/github_search_pull_requests/execution.d.ts +17 -0
- package/dist/tools/github_search_pull_requests/hints.d.ts +2 -0
- package/dist/tools/github_search_pull_requests/scheme.d.ts +224 -0
- package/dist/tools/github_search_pull_requests/types.d.ts +120 -0
- package/dist/tools/github_search_repos/execution.d.ts +17 -0
- package/dist/tools/github_search_repos/hints.d.ts +2 -0
- package/dist/tools/github_search_repos/scheme.d.ts +96 -0
- package/dist/tools/github_view_repo_structure/constants.d.ts +4 -0
- package/dist/tools/github_view_repo_structure/execution.d.ts +20 -0
- package/dist/tools/github_view_repo_structure/hints.d.ts +2 -0
- package/dist/tools/github_view_repo_structure/scheme.d.ts +81 -0
- package/dist/tools/github_view_repo_structure/types.d.ts +39 -0
- package/dist/tools/local_binary_inspect/archiveOps.d.ts +22 -0
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +49 -0
- package/dist/tools/local_binary_inspect/binaryOps.d.ts +18 -0
- package/dist/tools/local_binary_inspect/decompressOps.d.ts +16 -0
- package/dist/tools/local_binary_inspect/execution.d.ts +4 -0
- package/dist/tools/local_binary_inspect/scheme.d.ts +44 -0
- package/dist/tools/local_fetch_content/contentExtractor.d.ts +9 -0
- package/dist/tools/local_fetch_content/execution.d.ts +5 -0
- package/dist/tools/local_fetch_content/fetchContent.d.ts +4 -0
- package/dist/tools/local_fetch_content/hints.d.ts +2 -0
- package/dist/tools/local_fetch_content/scheme.d.ts +31 -0
- package/dist/tools/local_find_files/execution.d.ts +5 -0
- package/dist/tools/local_find_files/findFiles.d.ts +11 -0
- package/dist/tools/local_find_files/hints.d.ts +2 -0
- package/dist/tools/local_find_files/scheme.d.ts +9 -0
- package/dist/tools/local_ripgrep/execution.d.ts +5 -0
- package/dist/tools/local_ripgrep/grepFallbackExecutor.d.ts +3 -0
- package/dist/tools/local_ripgrep/hints.d.ts +2 -0
- package/dist/tools/local_ripgrep/patternValidation.d.ts +12 -0
- package/dist/tools/local_ripgrep/ripgrepExecutor.d.ts +3 -0
- package/dist/tools/local_ripgrep/ripgrepParser.d.ts +9 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +9 -0
- package/dist/tools/local_ripgrep/scheme.d.ts +55 -0
- package/dist/tools/local_ripgrep/searchContentRipgrep.d.ts +5 -0
- package/dist/tools/local_ripgrep/structuralSearch.d.ts +9 -0
- package/dist/tools/local_view_structure/execution.d.ts +5 -0
- package/dist/tools/local_view_structure/hints.d.ts +2 -0
- package/dist/tools/local_view_structure/local_view_structure.d.ts +7 -0
- package/dist/tools/local_view_structure/scheme.d.ts +33 -0
- package/dist/tools/local_view_structure/structureFilters.d.ts +33 -0
- package/dist/tools/local_view_structure/structureParser.d.ts +3 -0
- package/dist/tools/local_view_structure/structureResponse.d.ts +32 -0
- package/dist/tools/local_view_structure/structureWalker.d.ts +24 -0
- package/dist/tools/lsp/semantic_content/execution.d.ts +4 -0
- package/dist/tools/lsp/semantic_content/hints.d.ts +4 -0
- package/dist/tools/lsp/semantic_content/index.d.ts +2 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +509 -0
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +11 -0
- package/dist/tools/lsp/shared/resolveSymbolAnchor.d.ts +20 -0
- package/dist/tools/lsp/shared/semanticTypes.d.ts +134 -0
- package/dist/tools/package_search/execution.d.ts +7 -0
- package/dist/tools/package_search/hints.d.ts +2 -0
- package/dist/tools/package_search/scheme.d.ts +51 -0
- package/dist/tools/providerExecution.d.ts +51 -0
- package/dist/tools/providerMappers.d.ts +277 -0
- package/dist/tools/toolConfig.d.ts +41 -0
- package/dist/tools/toolMetadata/baseSchema.d.ts +2 -0
- package/dist/tools/toolMetadata/descriptions.d.ts +1 -0
- package/dist/tools/toolMetadata/gateway.d.ts +7 -0
- package/dist/tools/toolMetadata/metadataPresence.d.ts +1 -0
- package/dist/tools/toolMetadata/names.d.ts +2 -0
- package/dist/tools/toolMetadata/proxies.d.ts +10 -0
- package/dist/tools/toolMetadata/state.d.ts +5 -0
- package/dist/tools/toolMetadata/types.d.ts +2 -0
- package/dist/tools/toolNames.d.ts +2 -0
- package/dist/tools/utils.d.ts +27 -0
- package/dist/types/bulk.d.ts +41 -0
- package/dist/types/execution.d.ts +11 -0
- package/dist/types/metadata.d.ts +69 -0
- package/dist/types/promise.d.ts +12 -0
- package/dist/types/responseTypes.d.ts +57 -0
- package/dist/types/server.d.ts +15 -0
- package/dist/types/session.d.ts +29 -0
- package/dist/types/toolResults.d.ts +62 -0
- package/dist/utils/contextUtils.d.ts +31 -0
- package/dist/utils/core/bestEffort.d.ts +2 -0
- package/dist/utils/core/compare.d.ts +1 -0
- package/dist/utils/core/constants.d.ts +47 -0
- package/dist/utils/core/promise.d.ts +2 -0
- package/dist/utils/core/safeRegex.d.ts +5 -0
- package/dist/utils/core/types.d.ts +50 -0
- package/dist/utils/environment/environmentDetection.d.ts +5 -0
- package/dist/utils/exec/commandAvailability.d.ts +19 -0
- package/dist/utils/exec/npm.d.ts +16 -0
- package/dist/utils/exec/ripgrepBinary.d.ts +3 -0
- package/dist/utils/exec/safe.d.ts +2 -0
- package/dist/utils/exec/spawn.d.ts +34 -0
- package/dist/utils/file/byteOffset.d.ts +12 -0
- package/dist/utils/file/filters.d.ts +11 -0
- package/dist/utils/file/size.d.ts +2 -0
- package/dist/utils/file/toolHelpers.d.ts +28 -0
- package/dist/utils/http/cache.d.ts +16 -0
- package/dist/utils/http/circuitBreaker.d.ts +17 -0
- package/dist/utils/http/fetch.d.ts +13 -0
- package/dist/utils/package/common.d.ts +5 -0
- package/dist/utils/package/npm.d.ts +8 -0
- package/dist/utils/package/schemas.d.ts +60 -0
- package/dist/utils/package/types.d.ts +55 -0
- package/dist/utils/pagination/boundary.d.ts +11 -0
- package/dist/utils/pagination/charLimit.d.ts +3 -0
- package/dist/utils/pagination/core.d.ts +15 -0
- package/dist/utils/pagination/hints.d.ts +3 -0
- package/dist/utils/pagination/outputSizeLimit.d.ts +16 -0
- package/dist/utils/pagination/types.d.ts +43 -0
- package/dist/utils/parsers/diff.d.ts +2 -0
- package/dist/utils/parsers/ripgrep.d.ts +11 -0
- package/dist/utils/parsers/schemas.d.ts +72 -0
- package/dist/utils/response/bulk.d.ts +5 -0
- package/dist/utils/response/callToolResult.d.ts +3 -0
- package/dist/utils/response/charSavings.d.ts +3 -0
- package/dist/utils/response/error.d.ts +20 -0
- package/dist/utils/response/groupedFinalizer.d.ts +37 -0
- package/dist/utils/response/pathRelativize.d.ts +9 -0
- package/dist/utils/response/structuredPagination.d.ts +9 -0
- package/dist/zod.d.ts +1 -0
- package/dist/zod.js +8 -0
- package/package.json +66 -0
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LspGetSemanticsQueryDisplaySchema: z.ZodObject<{
|
|
3
|
+
uri: z.ZodString;
|
|
4
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
5
|
+
references: "references";
|
|
6
|
+
definition: "definition";
|
|
7
|
+
callers: "callers";
|
|
8
|
+
callees: "callees";
|
|
9
|
+
callHierarchy: "callHierarchy";
|
|
10
|
+
hover: "hover";
|
|
11
|
+
documentSymbols: "documentSymbols";
|
|
12
|
+
typeDefinition: "typeDefinition";
|
|
13
|
+
implementation: "implementation";
|
|
14
|
+
}>>;
|
|
15
|
+
symbolName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
lineHint: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
orderHint: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
includeDeclaration: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
+
groupByFile: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
22
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
format: z.ZodDefault<z.ZodEnum<{
|
|
25
|
+
structured: "structured";
|
|
26
|
+
compact: "compact";
|
|
27
|
+
}>>;
|
|
28
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
29
|
+
id: z.ZodOptional<z.ZodString>;
|
|
30
|
+
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
31
|
+
researchGoal: z.ZodOptional<z.ZodString>;
|
|
32
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export declare const LspGetSemanticsQuerySchema: z.ZodObject<{
|
|
35
|
+
uri: z.ZodString;
|
|
36
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
37
|
+
references: "references";
|
|
38
|
+
definition: "definition";
|
|
39
|
+
callers: "callers";
|
|
40
|
+
callees: "callees";
|
|
41
|
+
callHierarchy: "callHierarchy";
|
|
42
|
+
hover: "hover";
|
|
43
|
+
documentSymbols: "documentSymbols";
|
|
44
|
+
typeDefinition: "typeDefinition";
|
|
45
|
+
implementation: "implementation";
|
|
46
|
+
}>>;
|
|
47
|
+
symbolName: z.ZodOptional<z.ZodString>;
|
|
48
|
+
lineHint: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
orderHint: z.ZodDefault<z.ZodNumber>;
|
|
50
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
includeDeclaration: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
groupByFile: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
54
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
format: z.ZodDefault<z.ZodEnum<{
|
|
57
|
+
structured: "structured";
|
|
58
|
+
compact: "compact";
|
|
59
|
+
}>>;
|
|
60
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
61
|
+
id: z.ZodOptional<z.ZodString>;
|
|
62
|
+
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
63
|
+
researchGoal: z.ZodOptional<z.ZodString>;
|
|
64
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const BulkLspGetSemanticsQuerySchema: z.ZodObject<{
|
|
67
|
+
responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
68
|
+
responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
69
|
+
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
72
|
+
base: z.ZodOptional<z.ZodString>;
|
|
73
|
+
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
74
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
76
|
+
id: z.ZodString;
|
|
77
|
+
status: z.ZodLiteral<"empty">;
|
|
78
|
+
data: z.ZodObject<{
|
|
79
|
+
type: z.ZodString;
|
|
80
|
+
uri: z.ZodString;
|
|
81
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
82
|
+
structured: "structured";
|
|
83
|
+
compact: "compact";
|
|
84
|
+
}>>;
|
|
85
|
+
resolvedSymbol: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
uri: z.ZodString;
|
|
88
|
+
foundAtLine: z.ZodNumber;
|
|
89
|
+
orderHint: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
lsp: z.ZodObject<{
|
|
92
|
+
serverAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
94
|
+
source: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
97
|
+
kind: z.ZodLiteral<"definition">;
|
|
98
|
+
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
99
|
+
uri: z.ZodString;
|
|
100
|
+
content: z.ZodOptional<z.ZodString>;
|
|
101
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
startLine: z.ZodNumber;
|
|
103
|
+
endLine: z.ZodNumber;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
107
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
+
kind: z.ZodLiteral<"typeDefinition">;
|
|
109
|
+
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
110
|
+
uri: z.ZodString;
|
|
111
|
+
content: z.ZodOptional<z.ZodString>;
|
|
112
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
startLine: z.ZodNumber;
|
|
114
|
+
endLine: z.ZodNumber;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
118
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
119
|
+
kind: z.ZodLiteral<"implementation">;
|
|
120
|
+
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
121
|
+
uri: z.ZodString;
|
|
122
|
+
content: z.ZodOptional<z.ZodString>;
|
|
123
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
startLine: z.ZodNumber;
|
|
125
|
+
endLine: z.ZodNumber;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
129
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
kind: z.ZodLiteral<"references">;
|
|
131
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
132
|
+
uri: z.ZodString;
|
|
133
|
+
content: z.ZodOptional<z.ZodString>;
|
|
134
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
startLine: z.ZodNumber;
|
|
136
|
+
endLine: z.ZodNumber;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
140
|
+
byFile: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
141
|
+
uri: z.ZodString;
|
|
142
|
+
count: z.ZodNumber;
|
|
143
|
+
firstLine: z.ZodNumber;
|
|
144
|
+
firstCharacter: z.ZodNumber;
|
|
145
|
+
lines: z.ZodArray<z.ZodNumber>;
|
|
146
|
+
hasDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
148
|
+
totalReferences: z.ZodNumber;
|
|
149
|
+
totalFiles: z.ZodNumber;
|
|
150
|
+
empty: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
category: z.ZodEnum<{
|
|
152
|
+
serverUnavailable: "serverUnavailable";
|
|
153
|
+
unsupportedOperation: "unsupportedOperation";
|
|
154
|
+
symbolNotFound: "symbolNotFound";
|
|
155
|
+
anchorFailed: "anchorFailed";
|
|
156
|
+
noLocations: "noLocations";
|
|
157
|
+
noReferences: "noReferences";
|
|
158
|
+
noHover: "noHover";
|
|
159
|
+
noCalls: "noCalls";
|
|
160
|
+
}>;
|
|
161
|
+
reason: z.ZodString;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
}, z.core.$strip>, ...z.ZodObject<{
|
|
164
|
+
kind: z.ZodLiteral<"callers" | "callees" | "callHierarchy">;
|
|
165
|
+
root: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
166
|
+
name: z.ZodString;
|
|
167
|
+
kind: z.ZodString;
|
|
168
|
+
uri: z.ZodString;
|
|
169
|
+
line: z.ZodNumber;
|
|
170
|
+
endLine: z.ZodNumber;
|
|
171
|
+
selectionLine: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
173
|
+
direction: z.ZodEnum<{
|
|
174
|
+
incoming: "incoming";
|
|
175
|
+
outgoing: "outgoing";
|
|
176
|
+
both: "both";
|
|
177
|
+
}>;
|
|
178
|
+
calls: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
179
|
+
direction: z.ZodEnum<{
|
|
180
|
+
incoming: "incoming";
|
|
181
|
+
outgoing: "outgoing";
|
|
182
|
+
}>;
|
|
183
|
+
item: z.ZodObject<{
|
|
184
|
+
name: z.ZodString;
|
|
185
|
+
kind: z.ZodString;
|
|
186
|
+
uri: z.ZodString;
|
|
187
|
+
line: z.ZodNumber;
|
|
188
|
+
endLine: z.ZodNumber;
|
|
189
|
+
selectionLine: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
ranges: z.ZodArray<z.ZodObject<{
|
|
192
|
+
line: z.ZodNumber;
|
|
193
|
+
character: z.ZodNumber;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
rangeCount: z.ZodNumber;
|
|
196
|
+
rangeSampleCount: z.ZodNumber;
|
|
197
|
+
contentPreview: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
199
|
+
incomingCalls: z.ZodNumber;
|
|
200
|
+
outgoingCalls: z.ZodNumber;
|
|
201
|
+
completeness: z.ZodObject<{
|
|
202
|
+
complete: z.ZodBoolean;
|
|
203
|
+
truncatedByDepth: z.ZodBoolean;
|
|
204
|
+
cycleCount: z.ZodNumber;
|
|
205
|
+
failedRequestCount: z.ZodNumber;
|
|
206
|
+
dynamicCallsExcluded: z.ZodLiteral<true>;
|
|
207
|
+
stdlibCallsExcluded: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
empty: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
category: z.ZodEnum<{
|
|
211
|
+
serverUnavailable: "serverUnavailable";
|
|
212
|
+
unsupportedOperation: "unsupportedOperation";
|
|
213
|
+
symbolNotFound: "symbolNotFound";
|
|
214
|
+
anchorFailed: "anchorFailed";
|
|
215
|
+
noLocations: "noLocations";
|
|
216
|
+
noReferences: "noReferences";
|
|
217
|
+
noHover: "noHover";
|
|
218
|
+
noCalls: "noCalls";
|
|
219
|
+
}>;
|
|
220
|
+
reason: z.ZodString;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
}, z.core.$strip>[], z.ZodObject<{
|
|
223
|
+
kind: z.ZodLiteral<"hover">;
|
|
224
|
+
markdown: z.ZodOptional<z.ZodString>;
|
|
225
|
+
text: z.ZodOptional<z.ZodString>;
|
|
226
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
start: z.ZodObject<{
|
|
228
|
+
line: z.ZodNumber;
|
|
229
|
+
character: z.ZodNumber;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
end: z.ZodObject<{
|
|
232
|
+
line: z.ZodNumber;
|
|
233
|
+
character: z.ZodNumber;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
kind: z.ZodLiteral<"documentSymbols">;
|
|
238
|
+
symbols: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
239
|
+
name: z.ZodString;
|
|
240
|
+
kind: z.ZodString;
|
|
241
|
+
line: z.ZodNumber;
|
|
242
|
+
character: z.ZodNumber;
|
|
243
|
+
endLine: z.ZodNumber;
|
|
244
|
+
childCount: z.ZodNumber;
|
|
245
|
+
containerName: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
247
|
+
totalSymbols: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
topLevelSymbols: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
empty: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
category: z.ZodEnum<{
|
|
251
|
+
serverUnavailable: "serverUnavailable";
|
|
252
|
+
unsupportedOperation: "unsupportedOperation";
|
|
253
|
+
symbolNotFound: "symbolNotFound";
|
|
254
|
+
anchorFailed: "anchorFailed";
|
|
255
|
+
noLocations: "noLocations";
|
|
256
|
+
noReferences: "noReferences";
|
|
257
|
+
noHover: "noHover";
|
|
258
|
+
noCalls: "noCalls";
|
|
259
|
+
}>;
|
|
260
|
+
reason: z.ZodString;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
263
|
+
kind: z.ZodLiteral<"empty">;
|
|
264
|
+
category: z.ZodEnum<{
|
|
265
|
+
serverUnavailable: "serverUnavailable";
|
|
266
|
+
unsupportedOperation: "unsupportedOperation";
|
|
267
|
+
symbolNotFound: "symbolNotFound";
|
|
268
|
+
anchorFailed: "anchorFailed";
|
|
269
|
+
noLocations: "noLocations";
|
|
270
|
+
noReferences: "noReferences";
|
|
271
|
+
noHover: "noHover";
|
|
272
|
+
noCalls: "noCalls";
|
|
273
|
+
}>;
|
|
274
|
+
reason: z.ZodString;
|
|
275
|
+
}, z.core.$strip>], "kind">;
|
|
276
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
277
|
+
currentPage: z.ZodNumber;
|
|
278
|
+
totalPages: z.ZodNumber;
|
|
279
|
+
totalResults: z.ZodNumber;
|
|
280
|
+
hasMore: z.ZodBoolean;
|
|
281
|
+
itemsPerPage: z.ZodNumber;
|
|
282
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
}, z.core.$strip>>;
|
|
284
|
+
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
285
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
286
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
+
id: z.ZodString;
|
|
290
|
+
status: z.ZodLiteral<"error">;
|
|
291
|
+
data: z.ZodObject<{
|
|
292
|
+
id: z.ZodOptional<z.ZodString>;
|
|
293
|
+
error: z.ZodString;
|
|
294
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
297
|
+
id: z.ZodString;
|
|
298
|
+
data: z.ZodObject<{
|
|
299
|
+
type: z.ZodString;
|
|
300
|
+
uri: z.ZodString;
|
|
301
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
302
|
+
structured: "structured";
|
|
303
|
+
compact: "compact";
|
|
304
|
+
}>>;
|
|
305
|
+
resolvedSymbol: z.ZodOptional<z.ZodObject<{
|
|
306
|
+
name: z.ZodString;
|
|
307
|
+
uri: z.ZodString;
|
|
308
|
+
foundAtLine: z.ZodNumber;
|
|
309
|
+
orderHint: z.ZodOptional<z.ZodNumber>;
|
|
310
|
+
}, z.core.$strip>>;
|
|
311
|
+
lsp: z.ZodObject<{
|
|
312
|
+
serverAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
313
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
314
|
+
source: z.ZodOptional<z.ZodString>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
317
|
+
kind: z.ZodLiteral<"definition">;
|
|
318
|
+
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
319
|
+
uri: z.ZodString;
|
|
320
|
+
content: z.ZodOptional<z.ZodString>;
|
|
321
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
322
|
+
startLine: z.ZodNumber;
|
|
323
|
+
endLine: z.ZodNumber;
|
|
324
|
+
}, z.core.$strip>>;
|
|
325
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
327
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
328
|
+
kind: z.ZodLiteral<"typeDefinition">;
|
|
329
|
+
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
330
|
+
uri: z.ZodString;
|
|
331
|
+
content: z.ZodOptional<z.ZodString>;
|
|
332
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
333
|
+
startLine: z.ZodNumber;
|
|
334
|
+
endLine: z.ZodNumber;
|
|
335
|
+
}, z.core.$strip>>;
|
|
336
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
338
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
339
|
+
kind: z.ZodLiteral<"implementation">;
|
|
340
|
+
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
341
|
+
uri: z.ZodString;
|
|
342
|
+
content: z.ZodOptional<z.ZodString>;
|
|
343
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
344
|
+
startLine: z.ZodNumber;
|
|
345
|
+
endLine: z.ZodNumber;
|
|
346
|
+
}, z.core.$strip>>;
|
|
347
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
348
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
349
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
350
|
+
kind: z.ZodLiteral<"references">;
|
|
351
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
352
|
+
uri: z.ZodString;
|
|
353
|
+
content: z.ZodOptional<z.ZodString>;
|
|
354
|
+
displayRange: z.ZodOptional<z.ZodObject<{
|
|
355
|
+
startLine: z.ZodNumber;
|
|
356
|
+
endLine: z.ZodNumber;
|
|
357
|
+
}, z.core.$strip>>;
|
|
358
|
+
isDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
359
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
360
|
+
byFile: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
361
|
+
uri: z.ZodString;
|
|
362
|
+
count: z.ZodNumber;
|
|
363
|
+
firstLine: z.ZodNumber;
|
|
364
|
+
firstCharacter: z.ZodNumber;
|
|
365
|
+
lines: z.ZodArray<z.ZodNumber>;
|
|
366
|
+
hasDefinition: z.ZodOptional<z.ZodBoolean>;
|
|
367
|
+
}, z.core.$strip>, z.ZodString]>>>;
|
|
368
|
+
totalReferences: z.ZodNumber;
|
|
369
|
+
totalFiles: z.ZodNumber;
|
|
370
|
+
empty: z.ZodOptional<z.ZodObject<{
|
|
371
|
+
category: z.ZodEnum<{
|
|
372
|
+
serverUnavailable: "serverUnavailable";
|
|
373
|
+
unsupportedOperation: "unsupportedOperation";
|
|
374
|
+
symbolNotFound: "symbolNotFound";
|
|
375
|
+
anchorFailed: "anchorFailed";
|
|
376
|
+
noLocations: "noLocations";
|
|
377
|
+
noReferences: "noReferences";
|
|
378
|
+
noHover: "noHover";
|
|
379
|
+
noCalls: "noCalls";
|
|
380
|
+
}>;
|
|
381
|
+
reason: z.ZodString;
|
|
382
|
+
}, z.core.$strip>>;
|
|
383
|
+
}, z.core.$strip>, ...z.ZodObject<{
|
|
384
|
+
kind: z.ZodLiteral<"callers" | "callees" | "callHierarchy">;
|
|
385
|
+
root: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
386
|
+
name: z.ZodString;
|
|
387
|
+
kind: z.ZodString;
|
|
388
|
+
uri: z.ZodString;
|
|
389
|
+
line: z.ZodNumber;
|
|
390
|
+
endLine: z.ZodNumber;
|
|
391
|
+
selectionLine: z.ZodOptional<z.ZodNumber>;
|
|
392
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
393
|
+
direction: z.ZodEnum<{
|
|
394
|
+
incoming: "incoming";
|
|
395
|
+
outgoing: "outgoing";
|
|
396
|
+
both: "both";
|
|
397
|
+
}>;
|
|
398
|
+
calls: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
399
|
+
direction: z.ZodEnum<{
|
|
400
|
+
incoming: "incoming";
|
|
401
|
+
outgoing: "outgoing";
|
|
402
|
+
}>;
|
|
403
|
+
item: z.ZodObject<{
|
|
404
|
+
name: z.ZodString;
|
|
405
|
+
kind: z.ZodString;
|
|
406
|
+
uri: z.ZodString;
|
|
407
|
+
line: z.ZodNumber;
|
|
408
|
+
endLine: z.ZodNumber;
|
|
409
|
+
selectionLine: z.ZodOptional<z.ZodNumber>;
|
|
410
|
+
}, z.core.$strip>;
|
|
411
|
+
ranges: z.ZodArray<z.ZodObject<{
|
|
412
|
+
line: z.ZodNumber;
|
|
413
|
+
character: z.ZodNumber;
|
|
414
|
+
}, z.core.$strip>>;
|
|
415
|
+
rangeCount: z.ZodNumber;
|
|
416
|
+
rangeSampleCount: z.ZodNumber;
|
|
417
|
+
contentPreview: z.ZodOptional<z.ZodString>;
|
|
418
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
419
|
+
incomingCalls: z.ZodNumber;
|
|
420
|
+
outgoingCalls: z.ZodNumber;
|
|
421
|
+
completeness: z.ZodObject<{
|
|
422
|
+
complete: z.ZodBoolean;
|
|
423
|
+
truncatedByDepth: z.ZodBoolean;
|
|
424
|
+
cycleCount: z.ZodNumber;
|
|
425
|
+
failedRequestCount: z.ZodNumber;
|
|
426
|
+
dynamicCallsExcluded: z.ZodLiteral<true>;
|
|
427
|
+
stdlibCallsExcluded: z.ZodOptional<z.ZodNumber>;
|
|
428
|
+
}, z.core.$strip>;
|
|
429
|
+
empty: z.ZodOptional<z.ZodObject<{
|
|
430
|
+
category: z.ZodEnum<{
|
|
431
|
+
serverUnavailable: "serverUnavailable";
|
|
432
|
+
unsupportedOperation: "unsupportedOperation";
|
|
433
|
+
symbolNotFound: "symbolNotFound";
|
|
434
|
+
anchorFailed: "anchorFailed";
|
|
435
|
+
noLocations: "noLocations";
|
|
436
|
+
noReferences: "noReferences";
|
|
437
|
+
noHover: "noHover";
|
|
438
|
+
noCalls: "noCalls";
|
|
439
|
+
}>;
|
|
440
|
+
reason: z.ZodString;
|
|
441
|
+
}, z.core.$strip>>;
|
|
442
|
+
}, z.core.$strip>[], z.ZodObject<{
|
|
443
|
+
kind: z.ZodLiteral<"hover">;
|
|
444
|
+
markdown: z.ZodOptional<z.ZodString>;
|
|
445
|
+
text: z.ZodOptional<z.ZodString>;
|
|
446
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
447
|
+
start: z.ZodObject<{
|
|
448
|
+
line: z.ZodNumber;
|
|
449
|
+
character: z.ZodNumber;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
end: z.ZodObject<{
|
|
452
|
+
line: z.ZodNumber;
|
|
453
|
+
character: z.ZodNumber;
|
|
454
|
+
}, z.core.$strip>;
|
|
455
|
+
}, z.core.$strip>>;
|
|
456
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
457
|
+
kind: z.ZodLiteral<"documentSymbols">;
|
|
458
|
+
symbols: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
459
|
+
name: z.ZodString;
|
|
460
|
+
kind: z.ZodString;
|
|
461
|
+
line: z.ZodNumber;
|
|
462
|
+
character: z.ZodNumber;
|
|
463
|
+
endLine: z.ZodNumber;
|
|
464
|
+
childCount: z.ZodNumber;
|
|
465
|
+
containerName: z.ZodOptional<z.ZodString>;
|
|
466
|
+
}, z.core.$strip>, z.ZodString]>>;
|
|
467
|
+
totalSymbols: z.ZodOptional<z.ZodNumber>;
|
|
468
|
+
topLevelSymbols: z.ZodOptional<z.ZodNumber>;
|
|
469
|
+
empty: z.ZodOptional<z.ZodObject<{
|
|
470
|
+
category: z.ZodEnum<{
|
|
471
|
+
serverUnavailable: "serverUnavailable";
|
|
472
|
+
unsupportedOperation: "unsupportedOperation";
|
|
473
|
+
symbolNotFound: "symbolNotFound";
|
|
474
|
+
anchorFailed: "anchorFailed";
|
|
475
|
+
noLocations: "noLocations";
|
|
476
|
+
noReferences: "noReferences";
|
|
477
|
+
noHover: "noHover";
|
|
478
|
+
noCalls: "noCalls";
|
|
479
|
+
}>;
|
|
480
|
+
reason: z.ZodString;
|
|
481
|
+
}, z.core.$strip>>;
|
|
482
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
483
|
+
kind: z.ZodLiteral<"empty">;
|
|
484
|
+
category: z.ZodEnum<{
|
|
485
|
+
serverUnavailable: "serverUnavailable";
|
|
486
|
+
unsupportedOperation: "unsupportedOperation";
|
|
487
|
+
symbolNotFound: "symbolNotFound";
|
|
488
|
+
anchorFailed: "anchorFailed";
|
|
489
|
+
noLocations: "noLocations";
|
|
490
|
+
noReferences: "noReferences";
|
|
491
|
+
noHover: "noHover";
|
|
492
|
+
noCalls: "noCalls";
|
|
493
|
+
}>;
|
|
494
|
+
reason: z.ZodString;
|
|
495
|
+
}, z.core.$strip>], "kind">;
|
|
496
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
497
|
+
currentPage: z.ZodNumber;
|
|
498
|
+
totalPages: z.ZodNumber;
|
|
499
|
+
totalResults: z.ZodNumber;
|
|
500
|
+
hasMore: z.ZodBoolean;
|
|
501
|
+
itemsPerPage: z.ZodNumber;
|
|
502
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
503
|
+
}, z.core.$strip>>;
|
|
504
|
+
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
505
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
506
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
}, z.core.$strip>]>>;
|
|
509
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LSPClient } from 'octocode-lsp/client';
|
|
2
|
+
import type { CallHierarchyItem, IncomingCall, OutgoingCall } from 'octocode-lsp/types';
|
|
3
|
+
export type TraversalResult<T> = {
|
|
4
|
+
calls: T[];
|
|
5
|
+
truncatedByDepth: boolean;
|
|
6
|
+
cycleCount: number;
|
|
7
|
+
failedRequestCount: number;
|
|
8
|
+
};
|
|
9
|
+
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>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LspGetSemanticsQuery, ResolvedSymbol } from './semanticTypes.js';
|
|
2
|
+
export type FileAnchor = {
|
|
3
|
+
uri: string;
|
|
4
|
+
absolutePath: string;
|
|
5
|
+
content: string;
|
|
6
|
+
};
|
|
7
|
+
export type SymbolAnchor = FileAnchor & {
|
|
8
|
+
resolvedSymbol: ResolvedSymbol;
|
|
9
|
+
};
|
|
10
|
+
export type AnchorResolutionResult<T> = {
|
|
11
|
+
ok: true;
|
|
12
|
+
value: T;
|
|
13
|
+
} | {
|
|
14
|
+
ok: false;
|
|
15
|
+
error: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
export declare function resolveFileAnchor(query: {
|
|
18
|
+
uri?: string;
|
|
19
|
+
}, toolName: string): Promise<AnchorResolutionResult<FileAnchor>>;
|
|
20
|
+
export declare function resolveSymbolAnchor(query: LspGetSemanticsQuery, toolName: string): Promise<AnchorResolutionResult<SymbolAnchor>>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ExactPosition, LSPRange } from 'octocode-lsp/types';
|
|
2
|
+
export declare const LSP_GET_SEMANTIC_CONTENT_TOOL_NAME = "lspGetSemantics";
|
|
3
|
+
export declare const SEMANTIC_CONTENT_TYPES: readonly ["definition", "references", "callers", "callees", "callHierarchy", "hover", "documentSymbols", "typeDefinition", "implementation"];
|
|
4
|
+
export type SemanticContentType = (typeof SEMANTIC_CONTENT_TYPES)[number];
|
|
5
|
+
export type SemanticOutputFormat = 'structured' | 'compact';
|
|
6
|
+
export type SemanticQueryBase = {
|
|
7
|
+
id?: string;
|
|
8
|
+
type: SemanticContentType;
|
|
9
|
+
uri?: string;
|
|
10
|
+
workspaceRoot?: string;
|
|
11
|
+
page?: number;
|
|
12
|
+
itemsPerPage?: number;
|
|
13
|
+
contextLines?: number;
|
|
14
|
+
format?: SemanticOutputFormat;
|
|
15
|
+
mainResearchGoal?: string;
|
|
16
|
+
researchGoal?: string;
|
|
17
|
+
reasoning?: string;
|
|
18
|
+
};
|
|
19
|
+
export type SymbolAnchoredSemanticQuery = SemanticQueryBase & {
|
|
20
|
+
type: Exclude<SemanticContentType, 'documentSymbols'>;
|
|
21
|
+
symbolName: string;
|
|
22
|
+
lineHint: number;
|
|
23
|
+
orderHint?: number;
|
|
24
|
+
depth?: number;
|
|
25
|
+
includeDeclaration?: boolean;
|
|
26
|
+
groupByFile?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type DocumentSymbolsSemanticQuery = SemanticQueryBase & {
|
|
29
|
+
type: 'documentSymbols';
|
|
30
|
+
};
|
|
31
|
+
export type LspGetSemanticsQuery = SymbolAnchoredSemanticQuery | DocumentSymbolsSemanticQuery;
|
|
32
|
+
export type ResolvedSymbol = {
|
|
33
|
+
name: string;
|
|
34
|
+
uri: string;
|
|
35
|
+
range: LSPRange;
|
|
36
|
+
foundAtLine: number;
|
|
37
|
+
orderHint?: number;
|
|
38
|
+
position: ExactPosition;
|
|
39
|
+
isAmbiguous?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type CompactResolvedSymbol = {
|
|
42
|
+
name: string;
|
|
43
|
+
uri: string;
|
|
44
|
+
foundAtLine: number;
|
|
45
|
+
orderHint?: number;
|
|
46
|
+
isAmbiguous?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare function compactResolvedSymbol(symbol: ResolvedSymbol): CompactResolvedSymbol;
|
|
49
|
+
export type CompactLocation = {
|
|
50
|
+
uri: string;
|
|
51
|
+
content?: string;
|
|
52
|
+
displayRange?: {
|
|
53
|
+
startLine: number;
|
|
54
|
+
endLine: number;
|
|
55
|
+
};
|
|
56
|
+
isDefinition?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export declare function compactLocation(snippet: {
|
|
59
|
+
uri: string;
|
|
60
|
+
content?: string;
|
|
61
|
+
displayRange?: {
|
|
62
|
+
startLine: number;
|
|
63
|
+
endLine: number;
|
|
64
|
+
};
|
|
65
|
+
isDefinition?: boolean;
|
|
66
|
+
}): CompactLocation;
|
|
67
|
+
export type SemanticEmptyCategory = 'serverUnavailable' | 'unsupportedOperation' | 'symbolNotFound' | 'anchorFailed' | 'noLocations' | 'noReferences' | 'noHover' | 'noCalls';
|
|
68
|
+
export type SemanticEmptyState = {
|
|
69
|
+
category: SemanticEmptyCategory;
|
|
70
|
+
reason: string;
|
|
71
|
+
};
|
|
72
|
+
export type LspSemanticEnvelope = {
|
|
73
|
+
type: SemanticContentType;
|
|
74
|
+
uri: string;
|
|
75
|
+
format?: SemanticOutputFormat;
|
|
76
|
+
resolvedSymbol?: CompactResolvedSymbol;
|
|
77
|
+
lsp: {
|
|
78
|
+
serverAvailable?: boolean;
|
|
79
|
+
provider?: string;
|
|
80
|
+
source?: string;
|
|
81
|
+
};
|
|
82
|
+
summary?: unknown;
|
|
83
|
+
payload: {
|
|
84
|
+
kind: 'definition';
|
|
85
|
+
locations: Array<CompactLocation | string>;
|
|
86
|
+
} | {
|
|
87
|
+
kind: 'references';
|
|
88
|
+
locations?: Array<CompactLocation | string>;
|
|
89
|
+
byFile?: unknown[];
|
|
90
|
+
totalReferences: number;
|
|
91
|
+
totalFiles: number;
|
|
92
|
+
empty?: SemanticEmptyState;
|
|
93
|
+
} | {
|
|
94
|
+
kind: 'callers' | 'callees' | 'callHierarchy';
|
|
95
|
+
direction: 'incoming' | 'outgoing' | 'both';
|
|
96
|
+
root?: unknown;
|
|
97
|
+
calls: unknown[];
|
|
98
|
+
incomingCalls?: number;
|
|
99
|
+
outgoingCalls?: number;
|
|
100
|
+
completeness: {
|
|
101
|
+
complete: boolean;
|
|
102
|
+
truncatedByDepth: boolean;
|
|
103
|
+
cycleCount: number;
|
|
104
|
+
failedRequestCount: number;
|
|
105
|
+
dynamicCallsExcluded: true;
|
|
106
|
+
stdlibCallsExcluded?: number;
|
|
107
|
+
};
|
|
108
|
+
empty?: SemanticEmptyState;
|
|
109
|
+
} | {
|
|
110
|
+
kind: 'hover';
|
|
111
|
+
markdown?: string;
|
|
112
|
+
text?: string;
|
|
113
|
+
range?: LSPRange;
|
|
114
|
+
} | {
|
|
115
|
+
kind: 'typeDefinition';
|
|
116
|
+
locations: Array<CompactLocation | string>;
|
|
117
|
+
} | {
|
|
118
|
+
kind: 'implementation';
|
|
119
|
+
locations: Array<CompactLocation | string>;
|
|
120
|
+
} | {
|
|
121
|
+
kind: 'documentSymbols';
|
|
122
|
+
symbols: unknown[];
|
|
123
|
+
totalSymbols?: number;
|
|
124
|
+
topLevelSymbols?: number;
|
|
125
|
+
empty?: SemanticEmptyState;
|
|
126
|
+
} | {
|
|
127
|
+
kind: 'empty';
|
|
128
|
+
category: SemanticEmptyCategory;
|
|
129
|
+
reason: string;
|
|
130
|
+
};
|
|
131
|
+
pagination?: unknown;
|
|
132
|
+
warnings?: string[];
|
|
133
|
+
hints?: string[];
|
|
134
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { NpmPackageQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
type NpmSearchQuery = z.input<typeof NpmPackageQuerySchema>;
|
|
5
|
+
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
6
|
+
export declare function searchPackages(args: ToolExecutionArgs<NpmSearchQuery>): Promise<CallToolResult>;
|
|
7
|
+
export {};
|