@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,49 @@
|
|
|
1
|
+
import type { BinaryInspectQuery } from './scheme.js';
|
|
2
|
+
export declare function inspectBinary(query: BinaryInspectQuery): Promise<import("../../index.js").UnifiedErrorResult | {
|
|
3
|
+
status: "success";
|
|
4
|
+
mode: "identify";
|
|
5
|
+
path: string;
|
|
6
|
+
fileType: string;
|
|
7
|
+
magicBytes: string;
|
|
8
|
+
} | {
|
|
9
|
+
pagination: {
|
|
10
|
+
currentPage: number;
|
|
11
|
+
totalPages: number;
|
|
12
|
+
hasMore: boolean;
|
|
13
|
+
entriesPerPage: number;
|
|
14
|
+
totalEntries: number;
|
|
15
|
+
};
|
|
16
|
+
status: "success";
|
|
17
|
+
mode: "list";
|
|
18
|
+
path: string;
|
|
19
|
+
backend: string;
|
|
20
|
+
totalEntries: number;
|
|
21
|
+
entries: string[];
|
|
22
|
+
} | {
|
|
23
|
+
hints: string[];
|
|
24
|
+
status: "success";
|
|
25
|
+
mode: "extract";
|
|
26
|
+
path: string;
|
|
27
|
+
archiveFile: string;
|
|
28
|
+
backend: string;
|
|
29
|
+
content: string;
|
|
30
|
+
contentLength: number;
|
|
31
|
+
isPartial: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
hints: string[];
|
|
34
|
+
status: "success";
|
|
35
|
+
mode: "decompress";
|
|
36
|
+
path: string;
|
|
37
|
+
format: "gzip" | "bzip2" | "xz" | "lzma" | "zstd" | "lz4" | "brotli" | "lzfse";
|
|
38
|
+
backend: string;
|
|
39
|
+
content: string;
|
|
40
|
+
contentLength: number;
|
|
41
|
+
isPartial: boolean;
|
|
42
|
+
} | {
|
|
43
|
+
status: "success";
|
|
44
|
+
mode: "strings";
|
|
45
|
+
path: string;
|
|
46
|
+
strings: string[];
|
|
47
|
+
totalFound: number;
|
|
48
|
+
returned: number;
|
|
49
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binary file inspection.
|
|
3
|
+
* Backs mode="identify" and mode="strings" in localBinaryInspect.
|
|
4
|
+
*/
|
|
5
|
+
export interface IdentifyResult {
|
|
6
|
+
success: boolean;
|
|
7
|
+
fileType?: string;
|
|
8
|
+
magicBytes?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function identifyFile(path: string): Promise<IdentifyResult>;
|
|
12
|
+
export interface StringsResult {
|
|
13
|
+
success: boolean;
|
|
14
|
+
strings?: string[];
|
|
15
|
+
totalFound?: number;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function extractStrings(path: string, minLength: number, includeOffsets: boolean): Promise<StringsResult>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-stream decompression.
|
|
3
|
+
* Backs mode="decompress" in localBinaryInspect.
|
|
4
|
+
*
|
|
5
|
+
* Handles: .gz .bz2 .xz .lzma .zst .lz4 .br .lzfse
|
|
6
|
+
* Does NOT handle multi-entry archives (.tar.gz, .zip etc.) — those belong to archiveOps.
|
|
7
|
+
*/
|
|
8
|
+
export type DecompressFormat = 'auto' | 'gzip' | 'bzip2' | 'xz' | 'lzma' | 'zstd' | 'lz4' | 'brotli' | 'lzfse';
|
|
9
|
+
export interface DecompressResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
content?: string;
|
|
12
|
+
format?: Exclude<DecompressFormat, 'auto'>;
|
|
13
|
+
backend?: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function decompressFile(path: string, format: DecompressFormat): Promise<DecompressResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { type BinaryInspectQuery } from './scheme.js';
|
|
3
|
+
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
|
+
export declare function executeInspectBinary(args: ToolExecutionArgs<BinaryInspectQuery>): Promise<CallToolResult>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LocalBinaryInspectQuerySchema: z.ZodObject<{
|
|
3
|
+
entryPageNumber: z.ZodDefault<z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>>>;
|
|
4
|
+
matchStringContextLines: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
5
|
+
charLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
6
|
+
page: z.ZodDefault<z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>>>;
|
|
7
|
+
path: z.ZodString;
|
|
8
|
+
mode: z.ZodEnum<{
|
|
9
|
+
list: "list";
|
|
10
|
+
identify: "identify";
|
|
11
|
+
extract: "extract";
|
|
12
|
+
decompress: "decompress";
|
|
13
|
+
strings: "strings";
|
|
14
|
+
}>;
|
|
15
|
+
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
maxEntries: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
entriesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
archiveFile: z.ZodOptional<z.ZodString>;
|
|
19
|
+
matchString: z.ZodOptional<z.ZodString>;
|
|
20
|
+
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
format: z.ZodDefault<z.ZodEnum<{
|
|
22
|
+
auto: "auto";
|
|
23
|
+
gzip: "gzip";
|
|
24
|
+
bzip2: "bzip2";
|
|
25
|
+
xz: "xz";
|
|
26
|
+
lzma: "lzma";
|
|
27
|
+
zstd: "zstd";
|
|
28
|
+
lz4: "lz4";
|
|
29
|
+
brotli: "brotli";
|
|
30
|
+
lzfse: "lzfse";
|
|
31
|
+
}>>;
|
|
32
|
+
minLength: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
includeOffsets: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
id: z.ZodOptional<z.ZodString>;
|
|
35
|
+
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
36
|
+
researchGoal: z.ZodOptional<z.ZodString>;
|
|
37
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type BinaryInspectQuery = z.infer<typeof LocalBinaryInspectQuerySchema>;
|
|
40
|
+
export declare const LocalBinaryInspectBulkQuerySchema: z.ZodObject<{
|
|
41
|
+
responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
42
|
+
responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
43
|
+
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function extractMatchingLines(lines: string[], pattern: string, contextLines: number, isRegex?: boolean, caseSensitive?: boolean, maxMatches?: number): {
|
|
2
|
+
lines: string[];
|
|
3
|
+
matchRanges: Array<{
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}>;
|
|
7
|
+
matchCount: number;
|
|
8
|
+
matchingLines: number[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { type FetchContentQuery } from './scheme.js';
|
|
3
|
+
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
|
+
export { finalizeFetchContentResult } from './fetchContent.js';
|
|
5
|
+
export declare function executeFetchContent(args: ToolExecutionArgs<FetchContentQuery>): Promise<CallToolResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LocalGetFileContentToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
2
|
+
import type { FetchContentQuery } from './scheme.js';
|
|
3
|
+
export declare function fetchContent(query: FetchContentQuery): Promise<LocalGetFileContentToolResult>;
|
|
4
|
+
export declare function finalizeFetchContentResult(result: LocalGetFileContentToolResult, _query: FetchContentQuery, _totalLines: number): LocalGetFileContentToolResult;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type MinifyMode } from '../../scheme/fields.js';
|
|
3
|
+
export declare const LocalFetchContentQuerySchema: z.ZodObject<{
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
fullContent: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
matchString: z.ZodOptional<z.ZodString>;
|
|
7
|
+
matchStringIsRegex: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
matchStringCaseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
contextLines: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
charOffset: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
charLength: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
minify: z.ZodDefault<z.ZodEnum<{
|
|
15
|
+
none: "none";
|
|
16
|
+
standard: "standard";
|
|
17
|
+
symbols: "symbols";
|
|
18
|
+
}>>;
|
|
19
|
+
id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
21
|
+
researchGoal: z.ZodOptional<z.ZodString>;
|
|
22
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type FetchContentQuery = z.infer<typeof LocalFetchContentQuerySchema> & {
|
|
25
|
+
minify?: MinifyMode;
|
|
26
|
+
};
|
|
27
|
+
export declare const LocalFetchContentBulkQuerySchema: z.ZodObject<{
|
|
28
|
+
responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
29
|
+
responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
30
|
+
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { type FindFilesQuery } from './scheme.js';
|
|
3
|
+
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
|
+
export { finalizeFindFilesResult } from './findFiles.js';
|
|
5
|
+
export declare function executeFindFiles(args: ToolExecutionArgs<FindFilesQuery>): Promise<CallToolResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { FindFilesQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
3
|
+
import type { LocalFindFilesToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
4
|
+
type UpstreamFindFilesQuery = z.infer<typeof FindFilesQuerySchema>;
|
|
5
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
6
|
+
type FindFilesQuery = WithOptionalMeta<UpstreamFindFilesQuery>;
|
|
7
|
+
export declare function findFiles(query: FindFilesQuery): Promise<LocalFindFilesToolResult>;
|
|
8
|
+
export declare function finalizeFindFilesResult(result: LocalFindFilesToolResult, _query: FindFilesQuery, _totals: {
|
|
9
|
+
totalFiles: number;
|
|
10
|
+
}): LocalFindFilesToolResult;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FindFilesQuerySchema as CoreFindFilesQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
3
|
+
export type FindFilesQuery = Omit<z.infer<typeof CoreFindFilesQuerySchema>, 'regexType'>;
|
|
4
|
+
export declare const LocalFindFilesQuerySchema: z.ZodType<FindFilesQuery>;
|
|
5
|
+
export declare const LocalFindFilesBulkQuerySchema: z.ZodObject<{
|
|
6
|
+
responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
7
|
+
responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
8
|
+
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { type RipgrepQuery } from './scheme.js';
|
|
3
|
+
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
|
+
export { finalizeRipgrepResult } from './ripgrepResultBuilder.js';
|
|
5
|
+
export declare function executeRipgrepSearch(args: ToolExecutionArgs<RipgrepQuery>): Promise<CallToolResult>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LocalSearchCodeToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
2
|
+
import { type RipgrepQuery } from './scheme.js';
|
|
3
|
+
export declare function executeGrepFallbackSearch(configuredQuery: RipgrepQuery, unavailableReason?: string): Promise<LocalSearchCodeToolResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface RipgrepPatternInput {
|
|
2
|
+
pattern: string;
|
|
3
|
+
fixedString?: boolean;
|
|
4
|
+
perlRegex?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface RipgrepPatternValidation {
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
errors: string[];
|
|
9
|
+
warnings: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function preflightValidateRipgrepPattern(input: RipgrepPatternInput): RipgrepPatternValidation;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
|
|
2
|
+
import type { RipgrepQuery } from './scheme.js';
|
|
3
|
+
import type { SearchStats } from '../../utils/core/types.js';
|
|
4
|
+
export declare function parseFilesOnlyOutput(stdout: string): LocalSearchCodeFile[];
|
|
5
|
+
export declare function parseCountOutput(stdout: string): LocalSearchCodeFile[];
|
|
6
|
+
export declare function parseRipgrepOutput(stdout: string, configuredQuery: RipgrepQuery): {
|
|
7
|
+
files: LocalSearchCodeFile[];
|
|
8
|
+
stats: SearchStats;
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
|
|
2
|
+
import type { LocalSearchCodeToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
3
|
+
import type { SearchStats } from '../../utils/core/types.js';
|
|
4
|
+
import type { RipgrepQuery } from './scheme.js';
|
|
5
|
+
export declare function buildSearchResult(parsedFiles: LocalSearchCodeFile[], configuredQuery: RipgrepQuery, _searchEngine: 'rg' | 'grep', warnings: string[], stats?: SearchStats): Promise<LocalSearchCodeToolResult>;
|
|
6
|
+
export declare function finalizeRipgrepResult(result: LocalSearchCodeToolResult, _query: RipgrepQuery, _totals: {
|
|
7
|
+
totalMatches: number;
|
|
8
|
+
totalFiles: number;
|
|
9
|
+
}): LocalSearchCodeToolResult;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LocalRipgrepQuerySchema: z.ZodObject<{
|
|
3
|
+
keywords: z.ZodOptional<z.ZodString>;
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
6
|
+
paginated: "paginated";
|
|
7
|
+
discovery: "discovery";
|
|
8
|
+
detailed: "detailed";
|
|
9
|
+
structural: "structural";
|
|
10
|
+
}>>;
|
|
11
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
12
|
+
rule: z.ZodOptional<z.ZodString>;
|
|
13
|
+
fixedString: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
perlRegex: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
caseInsensitive: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
wholeWord: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
invertMatch: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
excludeDir: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
noIgnore: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
filesOnly: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
filesWithoutMatch: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
matchContentLength: z.ZodDefault<z.ZodNumber>;
|
|
28
|
+
maxMatchesPerFile: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
multiline: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
multilineDotall: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
sort: z.ZodDefault<z.ZodEnum<{
|
|
33
|
+
path: "path";
|
|
34
|
+
modified: "modified";
|
|
35
|
+
created: "created";
|
|
36
|
+
accessed: "accessed";
|
|
37
|
+
}>>;
|
|
38
|
+
sortReverse: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
langType: z.ZodOptional<z.ZodString>;
|
|
40
|
+
countLinesPerFile: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
countMatchesPerFile: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
matchPage: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
id: z.ZodOptional<z.ZodString>;
|
|
46
|
+
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
47
|
+
researchGoal: z.ZodOptional<z.ZodString>;
|
|
48
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type RipgrepQuery = z.infer<typeof LocalRipgrepQuerySchema>;
|
|
51
|
+
export declare const LocalRipgrepBulkQuerySchema: z.ZodObject<{
|
|
52
|
+
responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
53
|
+
responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
54
|
+
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RipgrepQuery as LocalRipgrepQuery } from './scheme.js';
|
|
2
|
+
type RipgrepQuery = LocalRipgrepQuery;
|
|
3
|
+
import type { LocalSearchCodeToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
4
|
+
export declare function searchContentRipgrep(query: RipgrepQuery): Promise<LocalSearchCodeToolResult>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LocalSearchCodeToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
2
|
+
import type { RipgrepQuery } from './scheme.js';
|
|
3
|
+
/**
|
|
4
|
+
* mode:"structural" execution path. Resolves candidate files, pre-filters them
|
|
5
|
+
* with a literal anchor when the pattern provides one, runs the AST engine per
|
|
6
|
+
* file, and reuses the ripgrep result builder so the output shape (pagination,
|
|
7
|
+
* sizing) is identical to the other localSearchCode modes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function searchContentStructural(query: RipgrepQuery): Promise<LocalSearchCodeToolResult>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { type ViewStructureQuery } from './scheme.js';
|
|
3
|
+
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
|
+
export { finalizeViewStructureResult } from './local_view_structure.js';
|
|
5
|
+
export declare function executeViewStructure(args: ToolExecutionArgs<ViewStructureQuery>): Promise<CallToolResult>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LocalViewStructureToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
2
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
3
|
+
import type { ViewStructureQuery as LocalViewStructureQuery } from './scheme.js';
|
|
4
|
+
type ViewStructureQuery = WithOptionalMeta<LocalViewStructureQuery>;
|
|
5
|
+
export declare function viewStructure(query: ViewStructureQuery): Promise<LocalViewStructureToolResult>;
|
|
6
|
+
export declare function finalizeViewStructureResult(result: LocalViewStructureToolResult, _query: ViewStructureQuery): LocalViewStructureToolResult;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LocalViewStructureQuerySchema: z.ZodObject<{
|
|
3
|
+
path: z.ZodString;
|
|
4
|
+
details: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
sortBy: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
extension: "extension";
|
|
8
|
+
size: "size";
|
|
9
|
+
name: "name";
|
|
10
|
+
time: "time";
|
|
11
|
+
}>>;
|
|
12
|
+
reverse: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
14
|
+
directoriesOnly: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
filesOnly: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
showFileLastModified: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
22
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
id: z.ZodOptional<z.ZodString>;
|
|
24
|
+
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
25
|
+
researchGoal: z.ZodOptional<z.ZodString>;
|
|
26
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type ViewStructureQuery = z.infer<typeof LocalViewStructureQuerySchema>;
|
|
29
|
+
export declare const LocalViewStructureBulkQuerySchema: z.ZodObject<{
|
|
30
|
+
responseCharOffset: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
31
|
+
responseCharLength: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
32
|
+
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface DirectoryEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
path?: string;
|
|
4
|
+
type: 'file' | 'directory' | 'symlink';
|
|
5
|
+
size?: string;
|
|
6
|
+
sizeBytes?: number;
|
|
7
|
+
modified?: string;
|
|
8
|
+
permissions?: string;
|
|
9
|
+
extension?: string;
|
|
10
|
+
depth?: number;
|
|
11
|
+
}
|
|
12
|
+
type EntryFilterQuery = Pick<{
|
|
13
|
+
pattern?: string;
|
|
14
|
+
extensions?: string[];
|
|
15
|
+
directoriesOnly?: boolean;
|
|
16
|
+
filesOnly?: boolean;
|
|
17
|
+
}, 'pattern' | 'extensions' | 'directoriesOnly' | 'filesOnly'>;
|
|
18
|
+
export declare function applyEntryFilters(entries: DirectoryEntry[], query: EntryFilterQuery): DirectoryEntry[];
|
|
19
|
+
export declare function formatEntryString(entry: DirectoryEntry, indent?: number): string;
|
|
20
|
+
interface EntryOutput {
|
|
21
|
+
type: 'file' | 'dir' | 'link';
|
|
22
|
+
depth?: number;
|
|
23
|
+
size?: string;
|
|
24
|
+
modified?: string;
|
|
25
|
+
permissions?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function toGroupedLists(entries: DirectoryEntry[]): {
|
|
28
|
+
files?: string[];
|
|
29
|
+
folders?: string[];
|
|
30
|
+
links?: string[];
|
|
31
|
+
};
|
|
32
|
+
export declare function toEntryObject(entry: DirectoryEntry): EntryOutput;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DirectoryEntry } from './structureFilters.js';
|
|
2
|
+
export declare function parseLsSimple(output: string, basePath: string, showModified?: boolean): Promise<DirectoryEntry[]>;
|
|
3
|
+
export declare function parseLsLongFormat(output: string, showModified?: boolean): DirectoryEntry[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DirectoryEntry } from './structureFilters.js';
|
|
2
|
+
export interface WalkStats {
|
|
3
|
+
skipped: number;
|
|
4
|
+
permissionDenied: number;
|
|
5
|
+
wasCapped?: boolean;
|
|
6
|
+
rootError?: {
|
|
7
|
+
code: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function summarizeEntries(entries: DirectoryEntry[]): string;
|
|
12
|
+
export declare function paginateEntries(entries: DirectoryEntry[], query: {
|
|
13
|
+
itemsPerPage?: number;
|
|
14
|
+
page?: number;
|
|
15
|
+
}): {
|
|
16
|
+
paginatedEntries: DirectoryEntry[];
|
|
17
|
+
endIdx: number;
|
|
18
|
+
pagination: {
|
|
19
|
+
currentPage: number;
|
|
20
|
+
totalPages: number;
|
|
21
|
+
entriesPerPage: number;
|
|
22
|
+
totalEntries: number;
|
|
23
|
+
hasMore: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare function buildEntryPaginationHints(entries: DirectoryEntry[], paginatedCount: number, pagination: {
|
|
27
|
+
currentPage: number;
|
|
28
|
+
totalPages: number;
|
|
29
|
+
totalEntries: number;
|
|
30
|
+
hasMore: boolean;
|
|
31
|
+
}, endIdx: number): string[];
|
|
32
|
+
export declare function buildWalkWarnings(walkStats: WalkStats): string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DirectoryEntry } from './structureFilters.js';
|
|
2
|
+
export interface WalkStats {
|
|
3
|
+
skipped: number;
|
|
4
|
+
permissionDenied: number;
|
|
5
|
+
wasCapped?: boolean;
|
|
6
|
+
rootError?: {
|
|
7
|
+
code: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface WalkDirectoryOptions {
|
|
12
|
+
basePath: string;
|
|
13
|
+
currentPath: string;
|
|
14
|
+
depth: number;
|
|
15
|
+
maxDepth: number;
|
|
16
|
+
entries: DirectoryEntry[];
|
|
17
|
+
maxEntries?: number;
|
|
18
|
+
showHidden?: boolean;
|
|
19
|
+
showModified?: boolean;
|
|
20
|
+
stats: WalkStats;
|
|
21
|
+
showDetails?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function walkDirectory(options: WalkDirectoryOptions): Promise<void>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import type { ToolExecutionArgs } from '../../../types/execution.js';
|
|
3
|
+
import { type LspGetSemanticsQuery } from '../shared/semanticTypes.js';
|
|
4
|
+
export declare function executeLspGetSemantics(args: ToolExecutionArgs<LspGetSemanticsQuery>): Promise<CallToolResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolHintGenerators } from '../../../types/metadata.js';
|
|
2
|
+
import type { SemanticContentType } from '../shared/semanticTypes.js';
|
|
3
|
+
export declare const hints: ToolHintGenerators;
|
|
4
|
+
export declare function semanticHints(type: SemanticContentType, complete: boolean): string[];
|