@octocodeai/octocode-tools-core 18.1.2 → 18.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/README.md +113 -162
- package/dist/cacheMaintenance.d.ts +8 -0
- package/dist/direct.js +41 -51
- package/dist/github/client.d.ts +1 -1
- package/dist/github/codeSearch.d.ts +2 -2
- package/dist/github/commit.d.ts +48 -0
- package/dist/github/compare.d.ts +2 -2
- package/dist/github/directoryFetch/fetchDirectoryContents.d.ts +1 -1
- package/dist/github/directoryFetch/fetchFileContentToDisk.d.ts +1 -1
- package/dist/github/directoryFetch/refResolution.d.ts +6 -0
- package/dist/github/fileContent.d.ts +1 -1
- package/dist/github/fileContentRaw/fetch.d.ts +2 -2
- package/dist/github/githubAPI.d.ts +1 -2
- package/dist/github/history/commitFiles.d.ts +5 -0
- package/dist/github/history.d.ts +1 -1
- package/dist/github/issues/fetchers.d.ts +1 -1
- package/dist/github/issues/orchestrator.d.ts +1 -1
- package/dist/github/issues/types.d.ts +5 -0
- package/dist/github/prByNumber.d.ts +1 -1
- package/dist/github/prContentFetcher/commits.d.ts +1 -1
- package/dist/github/prContentFetcher/transform.d.ts +1 -1
- package/dist/github/pullRequestSearch.d.ts +1 -1
- package/dist/github/queryBuilders/codeAndRepo.d.ts +1 -1
- package/dist/github/repoSearch.d.ts +2 -2
- package/dist/github/repoStructure/contentResolution.d.ts +1 -1
- package/dist/github/repoStructure/fetchOrchestration.d.ts +2 -2
- package/dist/github/repoStructurePagination.d.ts +1 -1
- package/dist/graph/advancedOperations.d.ts +22 -0
- package/dist/{tools/local_dead_code/graphBuilder.d.ts → graph/buildFileGraph.d.ts} +6 -5
- package/dist/graph/cycleOperations.d.ts +12 -0
- package/dist/{tools/local_dead_code → graph}/importResolver.d.ts +1 -1
- package/dist/graph/operations.d.ts +7 -0
- package/dist/{tools/local_dead_code → graph}/reachability.d.ts +1 -1
- package/dist/{tools/local_dead_code → graph}/types.d.ts +11 -0
- package/dist/graph/workspacePackageResolver.d.ts +2 -0
- package/dist/index.d.ts +11 -30
- package/dist/index.js +45 -55
- package/dist/providers/github/githubContent.d.ts +1 -1
- package/dist/providers/github/githubPullRequests.d.ts +1 -1
- package/dist/providers/github/githubSearch.d.ts +1 -1
- package/dist/providers/github/githubStructure.d.ts +1 -1
- package/dist/providers/github/paginationMetadata.d.ts +4 -5
- package/dist/providers/providerQueries.d.ts +1 -3
- package/dist/providers/providerResults.d.ts +4 -0
- package/dist/providers/types.d.ts +1 -1
- package/dist/responses.d.ts +1 -1
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +13 -1
- package/dist/scheme/conditionalSchemas.d.ts +12 -0
- package/dist/scheme/fields.d.ts +2 -1
- package/dist/security/bridge.d.ts +7 -10
- package/dist/shared/credentials/index.js +2 -2
- package/dist/shared/paths.d.ts +1 -0
- package/dist/shared/paths.js +1 -1
- package/dist/shared/session/index.js +1 -1
- package/dist/toolContract/descriptions.d.ts +14 -0
- package/dist/toolContract/input/resources/global.d.ts +15 -0
- package/dist/toolContract/input/resources/toolRelations.d.ts +1 -0
- package/dist/toolContract/input/resources/toolVariants.d.ts +9 -0
- package/dist/toolContract/input/resources/tools/_toolkit.d.ts +75 -0
- package/dist/toolContract/input/resources/tools/ghCloneRepo.d.ts +12 -0
- package/dist/toolContract/input/resources/tools/ghGetFileContent.d.ts +30 -0
- package/dist/toolContract/input/resources/tools/ghSearch.d.ts +76 -0
- package/dist/toolContract/input/resources/tools/githubCodeOperation.d.ts +29 -0
- package/dist/toolContract/input/resources/tools/githubHistorySchema.d.ts +114 -0
- package/dist/toolContract/input/resources/tools/githubRepositoriesOperation.d.ts +54 -0
- package/dist/toolContract/input/resources/tools/githubTreeOperation.d.ts +26 -0
- package/dist/toolContract/input/resources/tools/historyCommitInput.d.ts +21 -0
- package/dist/toolContract/input/resources/tools/historyIssueInput.d.ts +59 -0
- package/dist/toolContract/input/resources/tools/historyPullRequestInput.d.ts +98 -0
- package/dist/toolContract/input/resources/tools/localAnalyzeGraph.d.ts +75 -0
- package/dist/toolContract/input/resources/tools/localFilesOperation.d.ts +70 -0
- package/dist/toolContract/input/resources/tools/localGetFileContent.d.ts +22 -0
- package/dist/toolContract/input/resources/tools/localSearch.d.ts +258 -0
- package/dist/toolContract/input/resources/tools/localTextOperation.d.ts +113 -0
- package/dist/toolContract/input/resources/tools/localTreeOperation.d.ts +44 -0
- package/dist/toolContract/input/resources/tools/lspGetSemantics.d.ts +37 -0
- package/dist/toolContract/input/resources/tools/npmSearch.d.ts +10 -0
- package/dist/toolContract/input/types/index.d.ts +24 -0
- package/dist/toolContract/metadata.d.ts +11 -0
- package/dist/toolContract/runtime.d.ts +11 -0
- package/dist/toolContract/schemas.d.ts +31 -0
- package/dist/toolContract/types.d.ts +11 -0
- package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +6 -16
- package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +1 -1
- package/dist/tools/directToolCatalog/toolCommandPatternUnifiedSearchQueries.d.ts +6 -0
- package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +2 -2
- package/dist/tools/directToolCatalog/toolSchemaIntrospection.d.ts +10 -0
- package/dist/tools/directToolCatalog/toolSchemaRelations.d.ts +9 -0
- package/dist/tools/directToolCatalog/toolSpecifications.d.ts +13 -0
- package/dist/tools/directToolCatalog.exec.d.ts +1 -1
- package/dist/tools/directToolCatalog.meta.d.ts +1 -0
- package/dist/tools/executionGuard.d.ts +1 -2
- package/dist/tools/github_clone_repo/cache.d.ts +1 -2
- package/dist/tools/github_clone_repo/cacheArtifacts.d.ts +3 -0
- package/dist/tools/github_clone_repo/cachePaths.d.ts +1 -1
- package/dist/tools/github_clone_repo/cloneRepo.d.ts +1 -1
- package/dist/tools/github_clone_repo/execution.d.ts +1 -1
- package/dist/tools/github_clone_repo/scheme.d.ts +24 -24
- package/dist/tools/github_fetch_content/execution.d.ts +1 -1
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +19 -16
- package/dist/tools/github_fetch_content/scheme.d.ts +19 -16
- package/dist/tools/github_fetch_content/types.d.ts +4 -3
- package/dist/tools/github_search/execution.d.ts +4 -0
- package/dist/tools/github_search/finalizer.d.ts +3 -0
- package/dist/tools/github_search/scheme.d.ts +79 -0
- package/dist/tools/github_search_code/execution.d.ts +4 -2
- package/dist/tools/github_search_code/finalizer/groups.d.ts +3 -3
- package/dist/tools/github_search_code/finalizer/ranking.d.ts +1 -2
- package/dist/tools/github_search_code/scheme.d.ts +10 -16
- package/dist/tools/github_search_pull_requests/contentRequest.d.ts +1 -4
- package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +8 -4
- package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +13 -10
- package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +3 -2
- package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +10 -3
- package/dist/tools/github_search_pull_requests/execution/commitsMode.d.ts +2 -2
- package/dist/tools/github_search_pull_requests/execution/issuesMode.d.ts +2 -2
- package/dist/tools/github_search_pull_requests/execution/pullRequestsMode.d.ts +1 -1
- package/dist/tools/github_search_pull_requests/execution.d.ts +1 -1
- package/dist/tools/github_search_pull_requests/historyContinuations.d.ts +15 -0
- package/dist/tools/github_search_pull_requests/historyExecutions.d.ts +6 -0
- package/dist/tools/github_search_pull_requests/historyPartialContinuations.d.ts +5 -0
- package/dist/tools/github_search_pull_requests/historySchemes.d.ts +58 -0
- package/dist/tools/github_search_pull_requests/historySearchPagination.d.ts +3 -0
- package/dist/tools/github_search_pull_requests/scheme.d.ts +14 -30
- package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +1 -2
- package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +197 -181
- package/dist/tools/github_search_repos/execution/pagination.d.ts +4 -4
- package/dist/tools/github_search_repos/execution/queryVariants.d.ts +3 -1
- package/dist/tools/github_search_repos/execution.d.ts +3 -1
- package/dist/tools/github_search_repos/scheme.d.ts +5 -7
- package/dist/tools/github_view_repo_structure/execution.d.ts +4 -2
- package/dist/tools/github_view_repo_structure/scheme.d.ts +2 -4
- package/dist/tools/github_view_repo_structure/types.d.ts +3 -0
- package/dist/tools/local_analyze_graph/analysisTypes.d.ts +46 -0
- package/dist/tools/local_analyze_graph/analyzeGraph.d.ts +3 -0
- package/dist/tools/{local_dead_code → local_analyze_graph}/deadCodeScan.d.ts +2 -1
- package/dist/tools/{local_dead_code → local_analyze_graph}/entrypoints.d.ts +1 -0
- package/dist/tools/local_analyze_graph/execution.d.ts +4 -0
- package/dist/tools/local_analyze_graph/pagination.d.ts +3 -0
- package/dist/tools/{local_dead_code → local_analyze_graph}/retention.d.ts +1 -1
- package/dist/tools/{local_dead_code → local_analyze_graph}/scheme.d.ts +31 -15
- package/dist/tools/local_fetch_content/execution.d.ts +1 -1
- package/dist/tools/local_fetch_content/scheme.d.ts +2 -4
- package/dist/tools/local_find_files/execution.d.ts +1 -1
- package/dist/tools/local_find_files/findFiles.d.ts +1 -1
- package/dist/tools/local_find_files/findFilesNext.d.ts +3 -3
- package/dist/tools/local_find_files/scheme.d.ts +6 -2
- package/dist/tools/local_ripgrep/captureBudget.d.ts +1 -0
- package/dist/tools/local_ripgrep/execution.d.ts +1 -1
- package/dist/tools/local_ripgrep/rankingProfile/rankingLexical.d.ts +20 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -18
- package/dist/tools/local_ripgrep/rankingProfile.d.ts +5 -4
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +4 -1
- package/dist/tools/local_ripgrep/scheme.d.ts +9 -7
- package/dist/tools/local_ripgrep/structuralSearch.d.ts +1 -1
- package/dist/tools/local_search/execution.d.ts +5 -0
- package/dist/tools/local_search/scheme.d.ts +260 -0
- package/dist/tools/local_view_structure/execution.d.ts +1 -1
- package/dist/tools/local_view_structure/scheme.d.ts +8 -5
- package/dist/tools/local_view_structure/viewStructureNext.d.ts +3 -3
- package/dist/tools/lsp/semantic_content/execution.d.ts +1 -1
- package/dist/tools/lsp/semantic_content/scheme.d.ts +4 -42
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +1 -1
- package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +1 -1
- package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +0 -1
- package/dist/tools/lsp/shared/semanticTypes.d.ts +6 -3
- package/dist/tools/package_search/execution.d.ts +6 -13
- package/dist/tools/package_search/pagination.d.ts +21 -0
- package/dist/tools/package_search/queryHelpers.d.ts +3 -5
- package/dist/tools/package_search/scheme.d.ts +12 -7
- package/dist/tools/providerExecution.d.ts +3 -4
- package/dist/tools/providerMappers/codeSearch.d.ts +3 -4
- package/dist/tools/providerMappers/fileContent.d.ts +1 -2
- package/dist/tools/providerMappers/pullRequests.d.ts +6 -6
- package/dist/tools/providerMappers/repoSearch.d.ts +7 -4
- package/dist/tools/providerMappers/repoStructure.d.ts +2 -3
- package/dist/tools/toolCatalogFactory.d.ts +5 -6
- package/dist/tools/toolConfig.d.ts +6 -17
- package/dist/tools/toolMetadata/baseSchema.d.ts +1 -2
- package/dist/tools/toolMetadata/descriptions.d.ts +1 -1
- package/dist/tools/toolMetadata/names.d.ts +18 -2
- package/dist/tools/toolMetadata/state.d.ts +3 -3
- package/dist/tools/toolMetadata/types.d.ts +1 -1
- package/dist/tools/toolNames.d.ts +16 -3
- package/dist/tools/toolSchemaImports.d.ts +5 -4
- package/dist/tools/utils.d.ts +3 -6
- package/dist/types/bulk.d.ts +11 -1
- package/dist/types/execution.d.ts +6 -1
- package/dist/types/server.d.ts +0 -2
- package/dist/types/toolOutput.d.ts +10 -9
- package/dist/types/toolResults.d.ts +17 -1
- package/dist/utils/contextUtils.d.ts +4 -2
- package/dist/utils/file/toolHelpers.d.ts +1 -1
- package/dist/utils/http/cache/conditional.d.ts +9 -4
- package/dist/utils/http/cache/dataCache.d.ts +7 -2
- package/dist/utils/http/cache/diskStore.d.ts +30 -0
- package/dist/utils/http/cache/management.d.ts +5 -0
- package/dist/utils/http/cache/store.d.ts +1 -0
- package/dist/utils/http/cache/trace.d.ts +10 -0
- package/dist/utils/http/cache.d.ts +1 -0
- package/dist/utils/package/types.d.ts +5 -2
- package/dist/utils/pagination/charLimit.d.ts +0 -2
- package/dist/utils/response/bulk/pagination.d.ts +2 -1
- package/dist/utils/response/bulk/paginationDiagnostics.d.ts +2 -0
- package/dist/utils/response/bulk/queries.d.ts +0 -9
- package/dist/utils/response/bulk/response.d.ts +3 -2
- package/dist/utils/response/bulk.d.ts +1 -1
- package/dist/utils/response/callToolResult.d.ts +1 -1
- package/dist/utils/response/error.d.ts +3 -4
- package/dist/utils/response/groupedFinalizer.d.ts +2 -6
- package/dist/utils/response/normalizedError.d.ts +6 -0
- package/dist/utils/response/responseChannels.d.ts +4 -0
- package/package.json +7 -6
- package/dist/github/discussions.d.ts +0 -45
- package/dist/github/releases.d.ts +0 -45
- package/dist/scheme/responseEnvelope.d.ts +0 -88
- package/dist/tools/github_search_discussions/execution.d.ts +0 -15
- package/dist/tools/github_search_discussions/scheme.d.ts +0 -16
- package/dist/tools/github_search_pull_requests/execution/releasesMode.d.ts +0 -4
- package/dist/tools/local_dead_code/execution.d.ts +0 -4
- package/dist/tools/local_dead_code/local_dead_code.d.ts +0 -5
- package/dist/tools/local_find_files/pathPatternBraces.d.ts +0 -20
- package/dist/tools/toolMetadata/gateway.d.ts +0 -7
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type LocalTextResultView = 'paginated' | 'discovery' | 'detailed' | 'content' | 'files' | 'filesWithout' | 'countLines' | 'countMatches' | 'matchOnly';
|
|
3
|
+
export declare function toLegacyTextQuery(query: Record<string, unknown>, resultView: LocalTextResultView): Record<string, unknown>;
|
|
4
|
+
export declare const LocalSearchQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
path: "path";
|
|
8
|
+
created: "created";
|
|
9
|
+
relevance: "relevance";
|
|
10
|
+
matchCount: "matchCount";
|
|
11
|
+
modified: "modified";
|
|
12
|
+
accessed: "accessed";
|
|
13
|
+
}>>;
|
|
14
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
15
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
16
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
langType: z.ZodOptional<z.ZodString>;
|
|
20
|
+
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
regex: z.ZodDefault<z.ZodEnum<{
|
|
22
|
+
fixed: "fixed";
|
|
23
|
+
smart: "smart";
|
|
24
|
+
perl: "perl";
|
|
25
|
+
}>>;
|
|
26
|
+
caseMode: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
smart: "smart";
|
|
28
|
+
sensitive: "sensitive";
|
|
29
|
+
insensitive: "insensitive";
|
|
30
|
+
}>>;
|
|
31
|
+
wholeWord: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
invertMatch: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
noIgnore: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
matchContentLength: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
maxMatchesPerFile: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
multiline: z.ZodDefault<z.ZodEnum<{
|
|
41
|
+
off: "off";
|
|
42
|
+
on: "on";
|
|
43
|
+
dotall: "dotall";
|
|
44
|
+
}>>;
|
|
45
|
+
rankingProfile: z.ZodDefault<z.ZodEnum<{
|
|
46
|
+
typescript: "typescript";
|
|
47
|
+
auto: "auto";
|
|
48
|
+
javascript: "javascript";
|
|
49
|
+
rust: "rust";
|
|
50
|
+
python: "python";
|
|
51
|
+
go: "go";
|
|
52
|
+
java: "java";
|
|
53
|
+
scala: "scala";
|
|
54
|
+
markdown: "markdown";
|
|
55
|
+
json: "json";
|
|
56
|
+
yaml: "yaml";
|
|
57
|
+
generic: "generic";
|
|
58
|
+
}>>;
|
|
59
|
+
matchPage: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
operation: z.ZodLiteral<"text">;
|
|
61
|
+
searchText: z.ZodString;
|
|
62
|
+
resultView: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
content: "content";
|
|
64
|
+
files: "files";
|
|
65
|
+
paginated: "paginated";
|
|
66
|
+
discovery: "discovery";
|
|
67
|
+
detailed: "detailed";
|
|
68
|
+
filesWithout: "filesWithout";
|
|
69
|
+
countLines: "countLines";
|
|
70
|
+
countMatches: "countMatches";
|
|
71
|
+
matchOnly: "matchOnly";
|
|
72
|
+
}>>>;
|
|
73
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
unique: z.ZodDefault<z.ZodEnum<{
|
|
76
|
+
count: "count";
|
|
77
|
+
list: "list";
|
|
78
|
+
off: "off";
|
|
79
|
+
}>>;
|
|
80
|
+
matchWindow: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
82
|
+
path: z.ZodString;
|
|
83
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
84
|
+
path: "path";
|
|
85
|
+
created: "created";
|
|
86
|
+
relevance: "relevance";
|
|
87
|
+
matchCount: "matchCount";
|
|
88
|
+
modified: "modified";
|
|
89
|
+
accessed: "accessed";
|
|
90
|
+
}>>;
|
|
91
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
92
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
93
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
94
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
|
+
langType: z.ZodOptional<z.ZodString>;
|
|
97
|
+
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
|
+
noIgnore: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
matchContentLength: z.ZodDefault<z.ZodNumber>;
|
|
103
|
+
maxMatchesPerFile: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
rankingProfile: z.ZodDefault<z.ZodEnum<{
|
|
106
|
+
typescript: "typescript";
|
|
107
|
+
auto: "auto";
|
|
108
|
+
javascript: "javascript";
|
|
109
|
+
rust: "rust";
|
|
110
|
+
python: "python";
|
|
111
|
+
go: "go";
|
|
112
|
+
java: "java";
|
|
113
|
+
scala: "scala";
|
|
114
|
+
markdown: "markdown";
|
|
115
|
+
json: "json";
|
|
116
|
+
yaml: "yaml";
|
|
117
|
+
generic: "generic";
|
|
118
|
+
}>>;
|
|
119
|
+
captureText: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
matchPage: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
operation: z.ZodLiteral<"structural">;
|
|
122
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
pattern: z.ZodString;
|
|
125
|
+
resultView: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
126
|
+
content: "content";
|
|
127
|
+
files: "files";
|
|
128
|
+
countMatches: "countMatches";
|
|
129
|
+
}>>>;
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
+
path: z.ZodString;
|
|
132
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
133
|
+
path: "path";
|
|
134
|
+
created: "created";
|
|
135
|
+
relevance: "relevance";
|
|
136
|
+
matchCount: "matchCount";
|
|
137
|
+
modified: "modified";
|
|
138
|
+
accessed: "accessed";
|
|
139
|
+
}>>;
|
|
140
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
141
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
142
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
143
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
|
+
langType: z.ZodOptional<z.ZodString>;
|
|
146
|
+
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
148
|
+
excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
149
|
+
noIgnore: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
matchContentLength: z.ZodDefault<z.ZodNumber>;
|
|
152
|
+
maxMatchesPerFile: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
rankingProfile: z.ZodDefault<z.ZodEnum<{
|
|
155
|
+
typescript: "typescript";
|
|
156
|
+
auto: "auto";
|
|
157
|
+
javascript: "javascript";
|
|
158
|
+
rust: "rust";
|
|
159
|
+
python: "python";
|
|
160
|
+
go: "go";
|
|
161
|
+
java: "java";
|
|
162
|
+
scala: "scala";
|
|
163
|
+
markdown: "markdown";
|
|
164
|
+
json: "json";
|
|
165
|
+
yaml: "yaml";
|
|
166
|
+
generic: "generic";
|
|
167
|
+
}>>;
|
|
168
|
+
captureText: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
matchPage: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
operation: z.ZodLiteral<"structural">;
|
|
171
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
rule: z.ZodString;
|
|
174
|
+
resultView: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
175
|
+
content: "content";
|
|
176
|
+
files: "files";
|
|
177
|
+
countMatches: "countMatches";
|
|
178
|
+
}>>>;
|
|
179
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
180
|
+
path: z.ZodString;
|
|
181
|
+
empty: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
183
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
184
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
185
|
+
size: z.ZodOptional<z.ZodObject<{
|
|
186
|
+
greater: z.ZodOptional<z.ZodString>;
|
|
187
|
+
less: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
names: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
191
|
+
excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
192
|
+
minDepth: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
pathPattern: z.ZodOptional<z.ZodString>;
|
|
194
|
+
time: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
modifiedWithin: z.ZodOptional<z.ZodString>;
|
|
196
|
+
modifiedBefore: z.ZodOptional<z.ZodString>;
|
|
197
|
+
accessedWithin: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
200
|
+
entryType: z.ZodOptional<z.ZodEnum<{
|
|
201
|
+
f: "f";
|
|
202
|
+
d: "d";
|
|
203
|
+
}>>;
|
|
204
|
+
permissions: z.ZodOptional<z.ZodString>;
|
|
205
|
+
access: z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
executable: "executable";
|
|
207
|
+
readable: "readable";
|
|
208
|
+
writable: "writable";
|
|
209
|
+
}>>;
|
|
210
|
+
detail: z.ZodDefault<z.ZodEnum<{
|
|
211
|
+
full: "full";
|
|
212
|
+
modified: "modified";
|
|
213
|
+
basic: "basic";
|
|
214
|
+
}>>;
|
|
215
|
+
operation: z.ZodLiteral<"files">;
|
|
216
|
+
pathRegex: z.ZodOptional<z.ZodString>;
|
|
217
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
219
|
+
name: "name";
|
|
220
|
+
path: "path";
|
|
221
|
+
size: "size";
|
|
222
|
+
modified: "modified";
|
|
223
|
+
}>>;
|
|
224
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
225
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
226
|
+
path: z.ZodString;
|
|
227
|
+
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
229
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
230
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
231
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
233
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
235
|
+
entryType: z.ZodOptional<z.ZodEnum<{
|
|
236
|
+
f: "f";
|
|
237
|
+
d: "d";
|
|
238
|
+
}>>;
|
|
239
|
+
detail: z.ZodDefault<z.ZodEnum<{
|
|
240
|
+
full: "full";
|
|
241
|
+
modified: "modified";
|
|
242
|
+
basic: "basic";
|
|
243
|
+
}>>;
|
|
244
|
+
operation: z.ZodLiteral<"tree">;
|
|
245
|
+
namePattern: z.ZodOptional<z.ZodString>;
|
|
246
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
248
|
+
name: "name";
|
|
249
|
+
extension: "extension";
|
|
250
|
+
size: "size";
|
|
251
|
+
time: "time";
|
|
252
|
+
}>>;
|
|
253
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
}, z.core.$strict>]>;
|
|
255
|
+
export type LocalSearchQuery = z.infer<typeof LocalSearchQuerySchema>;
|
|
256
|
+
export declare const LocalSearchBulkQuerySchema: z.ZodObject<{
|
|
257
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
258
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
259
|
+
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
260
|
+
}, z.core.$strict>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
2
2
|
import { type ViewStructureQuery } from './scheme.js';
|
|
3
3
|
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
4
|
export declare function executeViewStructure(args: ToolExecutionArgs<ViewStructureQuery>): Promise<CallToolResult>;
|
|
@@ -10,9 +10,9 @@ export declare const LocalViewStructureQuerySchema: z.ZodObject<{
|
|
|
10
10
|
}>>;
|
|
11
11
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
12
12
|
sortBy: z.ZodDefault<z.ZodEnum<{
|
|
13
|
+
name: "name";
|
|
13
14
|
extension: "extension";
|
|
14
15
|
size: "size";
|
|
15
|
-
name: "name";
|
|
16
16
|
time: "time";
|
|
17
17
|
}>>;
|
|
18
18
|
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -23,13 +23,12 @@ export declare const LocalViewStructureQuerySchema: z.ZodObject<{
|
|
|
23
23
|
}>>;
|
|
24
24
|
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
25
25
|
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
27
|
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
27
28
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
28
29
|
page: z.ZodDefault<z.ZodNumber>;
|
|
29
30
|
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
|
|
31
|
-
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
32
|
-
researchGoal: z.ZodOptional<z.ZodString>;
|
|
31
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
33
32
|
reasoning: z.ZodOptional<z.ZodString>;
|
|
34
33
|
}, z.core.$strip>;
|
|
35
34
|
export type ViewStructureQuery = z.infer<typeof LocalViewStructureQuerySchema>;
|
|
@@ -37,7 +36,7 @@ export declare const LocalViewStructureBulkQuerySchema: z.ZodObject<{
|
|
|
37
36
|
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
38
37
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
39
38
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
40
|
-
}, z.core.$
|
|
39
|
+
}, z.core.$strict>;
|
|
41
40
|
export interface LocalViewStructureEntry {
|
|
42
41
|
name?: string;
|
|
43
42
|
type: 'file' | 'dir' | 'directory' | 'link' | 'symlink';
|
|
@@ -59,5 +58,9 @@ export interface LocalViewStructureData {
|
|
|
59
58
|
summary?: string | Record<string, unknown>;
|
|
60
59
|
pagination?: LocalItemPagination;
|
|
61
60
|
next?: Record<string, ToolContinuation>;
|
|
61
|
+
terminalLimit?: boolean;
|
|
62
|
+
truncated?: boolean;
|
|
63
|
+
partialReasons?: Array<'limit' | 'walkLimit'>;
|
|
64
|
+
totalAvailable?: number;
|
|
62
65
|
}
|
|
63
66
|
export type LocalViewStructureOutput = BulkToolOutput<LocalViewStructureData>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DirectoryEntry } from './structureFilters.js';
|
|
2
2
|
type ViewStructureNextCall = {
|
|
3
|
-
tool: 'localGetFileContent' | '
|
|
3
|
+
tool: 'localGetFileContent' | 'local.tree';
|
|
4
4
|
query: Record<string, unknown>;
|
|
5
5
|
why: string;
|
|
6
6
|
confidence?: 'exact' | 'high' | 'medium' | 'low';
|
|
@@ -10,7 +10,7 @@ export type ViewStructureNextMap = {
|
|
|
10
10
|
viewDeeper?: ViewStructureNextCall;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* Build per-result continuation hints for a
|
|
13
|
+
* Build per-result continuation hints for a local tree response: read
|
|
14
14
|
* the first listed file, and/or descend into the first listed subdirectory.
|
|
15
15
|
* `nextPage` (pagination) is added separately by the caller.
|
|
16
16
|
*
|
|
@@ -19,7 +19,7 @@ export type ViewStructureNextMap = {
|
|
|
19
19
|
* SKIP_TRAVERSAL_KEYS in utils/response/pathRelativize.ts), so hints stay
|
|
20
20
|
* directly callable with no manual path conversion. Meta-free by construction:
|
|
21
21
|
* queries are built from the entry path alone, never spread from the caller
|
|
22
|
-
* query, so no auto-filled
|
|
22
|
+
* query, so no auto-filled goal/reasoning can leak in.
|
|
23
23
|
*/
|
|
24
24
|
export declare function buildViewStructureNextMap(entries: readonly DirectoryEntry[]): ViewStructureNextMap | undefined;
|
|
25
25
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { ToolExecutionArgs } from '../../../types/execution.js';
|
|
3
3
|
import { type LspGetSemanticsQuery } from '../shared/semanticTypes.js';
|
|
4
4
|
export declare function executeLspGetSemantics(args: ToolExecutionArgs<LspGetSemanticsQuery>): Promise<CallToolResult>;
|
|
@@ -1,55 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { ItemPagination, ToolContinuation } from '../../../scheme/pagination.js';
|
|
3
3
|
import type { BulkToolOutput } from '../../../types/toolOutput.js';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const LspGetSemanticsQuerySchema: z.ZodObject<{
|
|
5
5
|
uri: z.ZodOptional<z.ZodString>;
|
|
6
6
|
type: z.ZodDefault<z.ZodEnum<{
|
|
7
7
|
definition: "definition";
|
|
8
|
-
references: "references";
|
|
9
|
-
callers: "callers";
|
|
10
|
-
callees: "callees";
|
|
11
|
-
callHierarchy: "callHierarchy";
|
|
12
|
-
hover: "hover";
|
|
13
8
|
documentSymbols: "documentSymbols";
|
|
14
|
-
typeDefinition: "typeDefinition";
|
|
15
|
-
implementation: "implementation";
|
|
16
9
|
workspaceSymbol: "workspaceSymbol";
|
|
17
|
-
supertypes: "supertypes";
|
|
18
|
-
subtypes: "subtypes";
|
|
19
|
-
diagnostic: "diagnostic";
|
|
20
|
-
}>>;
|
|
21
|
-
symbolName: z.ZodOptional<z.ZodString>;
|
|
22
|
-
lineHint: z.ZodOptional<z.ZodNumber>;
|
|
23
|
-
orderHint: z.ZodDefault<z.ZodNumber>;
|
|
24
|
-
depth: z.ZodOptional<z.ZodNumber>;
|
|
25
|
-
includeDeclaration: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
-
groupByFile: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
-
page: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
29
|
-
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
format: z.ZodDefault<z.ZodEnum<{
|
|
31
|
-
structured: "structured";
|
|
32
|
-
compact: "compact";
|
|
33
|
-
}>>;
|
|
34
|
-
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
35
|
-
id: z.ZodOptional<z.ZodString>;
|
|
36
|
-
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
37
|
-
researchGoal: z.ZodOptional<z.ZodString>;
|
|
38
|
-
reasoning: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
export declare const LspGetSemanticsQuerySchema: z.ZodObject<{
|
|
41
|
-
uri: z.ZodOptional<z.ZodString>;
|
|
42
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
43
|
-
definition: "definition";
|
|
44
10
|
references: "references";
|
|
45
11
|
callers: "callers";
|
|
46
12
|
callees: "callees";
|
|
47
13
|
callHierarchy: "callHierarchy";
|
|
48
14
|
hover: "hover";
|
|
49
|
-
documentSymbols: "documentSymbols";
|
|
50
15
|
typeDefinition: "typeDefinition";
|
|
51
16
|
implementation: "implementation";
|
|
52
|
-
workspaceSymbol: "workspaceSymbol";
|
|
53
17
|
supertypes: "supertypes";
|
|
54
18
|
subtypes: "subtypes";
|
|
55
19
|
diagnostic: "diagnostic";
|
|
@@ -61,23 +25,21 @@ export declare const LspGetSemanticsQuerySchema: z.ZodObject<{
|
|
|
61
25
|
includeDeclaration: z.ZodDefault<z.ZodBoolean>;
|
|
62
26
|
groupByFile: z.ZodOptional<z.ZodBoolean>;
|
|
63
27
|
page: z.ZodDefault<z.ZodNumber>;
|
|
64
|
-
|
|
28
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
65
29
|
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
66
30
|
format: z.ZodDefault<z.ZodEnum<{
|
|
67
31
|
structured: "structured";
|
|
68
32
|
compact: "compact";
|
|
69
33
|
}>>;
|
|
70
34
|
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
71
|
-
|
|
72
|
-
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
73
|
-
researchGoal: z.ZodOptional<z.ZodString>;
|
|
35
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
74
36
|
reasoning: z.ZodOptional<z.ZodString>;
|
|
75
37
|
}, z.core.$strip>;
|
|
76
38
|
export declare const BulkLspGetSemanticsQuerySchema: z.ZodObject<{
|
|
77
39
|
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
78
40
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
79
41
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
80
|
-
}, z.core.$
|
|
42
|
+
}, z.core.$strict>;
|
|
81
43
|
interface LspLocation {
|
|
82
44
|
uri: string;
|
|
83
45
|
absolutePath?: string;
|
|
@@ -8,7 +8,7 @@ export type PaginationInfo = {
|
|
|
8
8
|
totalPages: number;
|
|
9
9
|
totalResults: number;
|
|
10
10
|
hasMore: boolean;
|
|
11
|
-
|
|
11
|
+
pageSize: number;
|
|
12
12
|
nextPage?: number;
|
|
13
13
|
};
|
|
14
14
|
export declare function emptyCategoryForReason(type: SemanticContentType, reason: string): SemanticEmptyCategory;
|
|
@@ -30,7 +30,7 @@ export declare function nativeDocumentSymbols(uri: string, content: string): unk
|
|
|
30
30
|
* extractor (`extractJsSymbols`) declines — notably Flow-typed `.js` (Flow
|
|
31
31
|
* syntax like type annotations/generics can make oxc's default JS grammar
|
|
32
32
|
* fail the whole-file parse, returning an empty body). `extractGraphFacts`
|
|
33
|
-
* uses a more lenient extraction already proven elsewhere (
|
|
33
|
+
* uses a more lenient extraction already proven elsewhere (localAnalyzeGraph)
|
|
34
34
|
* to tolerate this exact file class, and its declarations already carry
|
|
35
35
|
* 0-based LSP `range`s — so they slot into the same DocumentSymbol shape
|
|
36
36
|
* `nativeDocumentSymbols` produces, just without a full symbol hierarchy
|
|
@@ -21,7 +21,6 @@ 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 { withSemanticNext } from './semanticNext.js';
|
|
25
24
|
export declare function isSemanticEnvelope(value: LspSemanticEnvelope | Record<string, unknown>): value is LspSemanticEnvelope;
|
|
26
25
|
export declare function compactSemanticEnvelope(envelope: LspSemanticEnvelope): LspSemanticEnvelope;
|
|
27
26
|
export declare function compactSemanticPayload(payload: LspSemanticEnvelope['payload']): LspSemanticEnvelope['payload'];
|
|
@@ -9,11 +9,10 @@ export type SemanticQueryBase = {
|
|
|
9
9
|
uri?: string;
|
|
10
10
|
workspaceRoot?: string;
|
|
11
11
|
page?: number;
|
|
12
|
-
|
|
12
|
+
pageSize?: number;
|
|
13
13
|
contextLines?: number;
|
|
14
14
|
format?: SemanticOutputFormat;
|
|
15
|
-
|
|
16
|
-
researchGoal?: string;
|
|
15
|
+
goal?: string;
|
|
17
16
|
reasoning?: string;
|
|
18
17
|
};
|
|
19
18
|
export type SymbolAnchoredSemanticQuery = SemanticQueryBase & {
|
|
@@ -86,6 +85,7 @@ export type SemanticEmptyState = {
|
|
|
86
85
|
export type LspSemanticEnvelope = {
|
|
87
86
|
type: SemanticContentType;
|
|
88
87
|
uri: string;
|
|
88
|
+
workspaceRoot?: string;
|
|
89
89
|
format?: SemanticOutputFormat;
|
|
90
90
|
resolvedSymbol?: CompactResolvedSymbol;
|
|
91
91
|
lsp: {
|
|
@@ -174,6 +174,9 @@ export type LspSemanticEnvelope = {
|
|
|
174
174
|
pagination?: unknown;
|
|
175
175
|
warnings?: string[];
|
|
176
176
|
hints?: string[];
|
|
177
|
+
terminalLimit?: boolean;
|
|
178
|
+
truncated?: boolean;
|
|
179
|
+
partialReasons?: Array<'warmupCap' | 'depth' | 'budget'>;
|
|
177
180
|
next?: Record<string, {
|
|
178
181
|
tool: string;
|
|
179
182
|
query: Record<string, unknown>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type {
|
|
4
|
-
type NpmSearchQuery = z.input<typeof
|
|
3
|
+
import type { NpmSearchQueryLocalSchema } from './scheme.js';
|
|
4
|
+
type NpmSearchQuery = z.input<typeof NpmSearchQueryLocalSchema> & {
|
|
5
|
+
pageSize?: number;
|
|
6
|
+
};
|
|
5
7
|
export { foldKeywords, isPackageNotFoundError } from './queryHelpers.js';
|
|
6
8
|
import type { PackageResult } from '../../utils/package/common.js';
|
|
7
9
|
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
10
|
+
export { buildPackagePagination } from './pagination.js';
|
|
8
11
|
/**
|
|
9
12
|
* Normalize the many repository URL shapes npm packages carry
|
|
10
13
|
* (ssh://git@…, git+https://…, git://…, git@host:owner/repo, and npm's
|
|
@@ -38,14 +41,4 @@ type CompactPackageData = {
|
|
|
38
41
|
};
|
|
39
42
|
export declare function formatPackageData(pkg: PackageResult): PackageData;
|
|
40
43
|
export declare function compactPackageRepositories(packages: PackageData[]): CompactPackageData;
|
|
41
|
-
type PackagePagination = {
|
|
42
|
-
currentPage: number;
|
|
43
|
-
totalPages: number;
|
|
44
|
-
perPage: number;
|
|
45
|
-
totalFound: number;
|
|
46
|
-
returned: number;
|
|
47
|
-
hasMore: boolean;
|
|
48
|
-
nextPage?: number;
|
|
49
|
-
};
|
|
50
|
-
export declare function buildPackagePagination(query: NpmSearchQuery, totalFound: number, returned: number, isKeyword: boolean): PackagePagination;
|
|
51
44
|
export declare function searchPackages(args: ToolExecutionArgs<NpmSearchQuery>): Promise<CallToolResult>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type PackagePageQuery = {
|
|
2
|
+
keywords?: string[];
|
|
3
|
+
page?: number;
|
|
4
|
+
pageSize?: number;
|
|
5
|
+
};
|
|
6
|
+
export type PackagePagination = {
|
|
7
|
+
currentPage: number;
|
|
8
|
+
totalPages: number;
|
|
9
|
+
perPage: number;
|
|
10
|
+
totalFound: number;
|
|
11
|
+
returned: number;
|
|
12
|
+
hasMore: boolean;
|
|
13
|
+
nextPage?: number;
|
|
14
|
+
continuationUnavailable?: {
|
|
15
|
+
reason: 'schemaPageLimit';
|
|
16
|
+
maxPage: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare function buildPackagePagination(query: PackagePageQuery, totalFound: number, returned: number, isKeyword: boolean): PackagePagination;
|
|
20
|
+
export declare function buildPackagePageContinuation(query: PackagePageQuery, pagination: PackagePagination): Record<string, unknown> | undefined;
|
|
21
|
+
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fold
|
|
3
|
-
*
|
|
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.
|
|
2
|
+
* Fold keyword terms into one registry query string. Returns undefined when
|
|
3
|
+
* the list is absent or empty.
|
|
6
4
|
*/
|
|
7
|
-
export declare function foldKeywords(keywords: string
|
|
5
|
+
export declare function foldKeywords(keywords: string[] | undefined): string | undefined;
|
|
8
6
|
export declare function isPackageNotFoundError(message: string): boolean;
|
|
@@ -2,19 +2,17 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { ItemPagination, ToolContinuation } from '../../scheme/pagination.js';
|
|
3
3
|
import type { BulkToolOutput } from '../../types/toolOutput.js';
|
|
4
4
|
export declare const NpmSearchQueryLocalSchema: z.ZodObject<{
|
|
5
|
-
packageName: z.ZodString
|
|
6
|
-
keywords: z.ZodOptional<z.
|
|
5
|
+
packageName: z.ZodOptional<z.ZodString>;
|
|
6
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7
7
|
page: z.ZodDefault<z.ZodNumber>;
|
|
8
|
-
|
|
9
|
-
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
10
|
-
researchGoal: z.ZodOptional<z.ZodString>;
|
|
8
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
11
9
|
reasoning: z.ZodOptional<z.ZodString>;
|
|
12
10
|
}, z.core.$strip>;
|
|
13
11
|
export declare const NpmSearchBulkQueryLocalSchema: z.ZodObject<{
|
|
14
12
|
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
15
13
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
16
14
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
17
|
-
}, z.core.$
|
|
15
|
+
}, z.core.$strict>;
|
|
18
16
|
export interface NpmSearchPackage {
|
|
19
17
|
name: string;
|
|
20
18
|
version?: string;
|
|
@@ -35,10 +33,17 @@ export interface NpmSearchRepository {
|
|
|
35
33
|
next: Record<string, ToolContinuation>;
|
|
36
34
|
[key: string]: unknown;
|
|
37
35
|
}
|
|
36
|
+
export type NpmSearchPagination = ItemPagination & {
|
|
37
|
+
continuationUnavailable?: {
|
|
38
|
+
reason: 'schemaPageLimit';
|
|
39
|
+
maxPage: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
38
42
|
export interface NpmSearchData {
|
|
39
43
|
packages?: NpmSearchPackage[];
|
|
40
44
|
repositories?: Record<string, NpmSearchRepository>;
|
|
41
|
-
pagination?:
|
|
45
|
+
pagination?: NpmSearchPagination;
|
|
46
|
+
next?: Record<string, ToolContinuation>;
|
|
42
47
|
[key: string]: unknown;
|
|
43
48
|
}
|
|
44
49
|
export type NpmSearchOutputLocal = BulkToolOutput<NpmSearchData>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AuthInfo } from '@modelcontextprotocol/
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { ProcessedBulkResult } from '../types/toolResults.js';
|
|
3
3
|
import { type ICodeHostProvider, type ProviderCapabilities, type ProviderResponse, type ProviderType } from '../providers/types.js';
|
|
4
|
-
interface ProviderExecutionContext {
|
|
4
|
+
export interface ProviderExecutionContext {
|
|
5
5
|
providerType: ProviderType;
|
|
6
6
|
provider: ICodeHostProvider;
|
|
7
7
|
capabilities: ProviderCapabilities;
|
|
@@ -32,8 +32,7 @@ export declare function createProviderExecutionContext(authInfo?: AuthInfo): Pro
|
|
|
32
32
|
export declare function createLazyProviderContext(authInfo?: AuthInfo): () => ProviderExecutionContext;
|
|
33
33
|
export declare function providerSupports(context: Pick<ProviderExecutionContext, 'capabilities'>, capability: keyof ProviderCapabilities): boolean;
|
|
34
34
|
export declare function executeProviderOperation<TQuery extends {
|
|
35
|
-
|
|
36
|
-
researchGoal?: string;
|
|
35
|
+
goal?: string;
|
|
37
36
|
reasoning?: string;
|
|
38
37
|
}, TData>(query: TQuery, operation: () => Promise<ProviderResponse<TData>>): Promise<{
|
|
39
38
|
ok: true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CodeSearchResult } from '../../providers/types.js';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type { GitHubCodeSearchQuerySchema } from '
|
|
3
|
+
import type { GitHubCodeSearchQuerySchema } from '../../toolContract/schemas.js';
|
|
4
4
|
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
5
5
|
type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
|
|
6
6
|
/**
|
|
@@ -21,8 +21,7 @@ export declare function mapCodeSearchToolQuery(query: WithOptionalMeta<GitHubCod
|
|
|
21
21
|
match: "file" | "path";
|
|
22
22
|
limit: number | undefined;
|
|
23
23
|
page: number;
|
|
24
|
-
|
|
25
|
-
researchGoal: string;
|
|
24
|
+
goal: string;
|
|
26
25
|
reasoning: string;
|
|
27
26
|
};
|
|
28
27
|
export interface CodeSearchGroupedMatch {
|
|
@@ -37,7 +36,7 @@ export interface CodeSearchGroupedMatch {
|
|
|
37
36
|
}
|
|
38
37
|
export interface CodeSearchGroupedResult {
|
|
39
38
|
id: string;
|
|
40
|
-
|
|
39
|
+
queryIndex?: number;
|
|
41
40
|
owner: string;
|
|
42
41
|
repo: string;
|
|
43
42
|
matches: CodeSearchGroupedMatch[];
|
|
@@ -20,8 +20,7 @@ export declare function mapFileContentToolQuery(query: LocalFileContentQuery): {
|
|
|
20
20
|
minify: "none" | "standard" | "symbols";
|
|
21
21
|
matchStringIsRegex: boolean;
|
|
22
22
|
matchStringCaseSensitive: boolean;
|
|
23
|
-
|
|
24
|
-
researchGoal: string;
|
|
23
|
+
goal: string;
|
|
25
24
|
reasoning: string;
|
|
26
25
|
};
|
|
27
26
|
export declare function mapFileContentProviderResult(data: ProviderFileContentResult, query: WithOptionalMeta<LocalFileContentQuery>): Record<string, unknown>;
|