@octocodeai/octocode-tools-core 16.3.0 → 16.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +546 -0
- package/dist/config.d.ts +7 -0
- package/dist/direct.js +34 -41
- package/dist/errors/pathUtils.d.ts +1 -1
- package/dist/github/directoryFetch.d.ts +2 -1
- package/dist/github/githubAPI.d.ts +10 -1
- package/dist/github/repoStructureRecursive.d.ts +6 -0
- package/dist/index.d.ts +15 -27
- package/dist/index.js +41 -48
- package/dist/providers/providerQueries.d.ts +9 -0
- package/dist/providers/providerResults.d.ts +2 -0
- package/dist/scheme/coreSchemas.d.ts +5 -5
- package/dist/scheme/fields.d.ts +6 -6
- package/dist/serverConfig.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/shared/config/defaults.d.ts +15 -0
- package/dist/shared/config/index.d.ts +10 -0
- package/dist/shared/config/index.js +10 -0
- package/dist/shared/config/loader.d.ts +7 -0
- package/dist/shared/config/resolver.d.ts +2 -0
- package/dist/shared/config/resolverCache.d.ts +12 -0
- package/dist/shared/config/resolverSections.d.ts +12 -0
- package/dist/shared/config/runtimeSurface.d.ts +21 -0
- package/dist/shared/config/schemas.d.ts +12 -0
- package/dist/shared/config/types.d.ts +100 -0
- package/dist/shared/config/validator.d.ts +2 -0
- package/dist/shared/credentials/constants.d.ts +2 -0
- package/dist/shared/credentials/credentialCache.d.ts +13 -0
- package/dist/shared/credentials/credentialEncryption.d.ts +10 -0
- package/dist/shared/credentials/credentialUtils.d.ts +4 -0
- package/dist/shared/credentials/envTokens.d.ts +9 -0
- package/dist/shared/credentials/ghCli.d.ts +1 -0
- package/dist/shared/credentials/index.d.ts +3 -0
- package/dist/shared/credentials/index.js +9 -0
- package/dist/shared/credentials/schemas.d.ts +22 -0
- package/dist/shared/credentials/storage.d.ts +30 -0
- package/dist/shared/credentials/testing.d.ts +2 -0
- package/dist/shared/credentials/testing.js +8 -0
- package/dist/shared/credentials/tokenRefresh.d.ts +24 -0
- package/dist/shared/credentials/tokenResolution.d.ts +30 -0
- package/dist/shared/credentials/types.d.ts +28 -0
- package/dist/shared/fs-utils.d.ts +2 -0
- package/dist/shared/fs-utils.js +8 -0
- package/dist/shared/index.d.ts +7 -0
- package/dist/shared/logger/index.d.ts +2 -0
- package/dist/shared/logger/logger.d.ts +17 -0
- package/dist/shared/paths.d.ts +33 -0
- package/dist/shared/paths.js +8 -0
- package/dist/shared/platform/index.d.ts +1 -0
- package/dist/shared/platform/index.js +8 -0
- package/dist/shared/platform/platform.d.ts +8 -0
- package/dist/shared/session/index.d.ts +5 -0
- package/dist/shared/session/index.js +9 -0
- package/dist/shared/session/schemas.d.ts +103 -0
- package/dist/shared/session/sessionCache.d.ts +9 -0
- package/dist/shared/session/sessionDiskIO.d.ts +6 -0
- package/dist/shared/session/statsDefaults.d.ts +4 -0
- package/dist/shared/session/storage.d.ts +20 -0
- package/dist/shared/session/types.d.ts +53 -0
- package/dist/tools/github_clone_repo/cache.d.ts +4 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +56 -9
- package/dist/tools/github_clone_repo/types.d.ts +1 -1
- package/dist/tools/github_fetch_content/scheme.d.ts +8 -4
- package/dist/tools/github_fetch_content/types.d.ts +12 -0
- package/dist/tools/github_search_code/scheme.d.ts +6 -6
- package/dist/tools/github_search_pull_requests/contentResponse.d.ts +0 -1
- package/dist/tools/github_search_pull_requests/execution.d.ts +1 -11
- package/dist/tools/github_search_pull_requests/scheme.d.ts +6 -2
- package/dist/tools/github_search_repos/scheme.d.ts +7 -6
- package/dist/tools/github_view_repo_structure/execution.d.ts +0 -9
- package/dist/tools/github_view_repo_structure/scheme.d.ts +10 -6
- package/dist/tools/local_binary_inspect/archiveOps.d.ts +2 -0
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +48 -7
- package/dist/tools/local_binary_inspect/binaryOps.d.ts +16 -7
- package/dist/tools/local_binary_inspect/scheme.d.ts +10 -7
- package/dist/tools/local_fetch_content/scheme.d.ts +2 -2
- package/dist/tools/local_find_files/scheme.d.ts +2 -2
- package/dist/tools/local_ripgrep/lspBoost.d.ts +54 -0
- package/dist/tools/local_ripgrep/rankingProfile.d.ts +113 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +10 -1
- package/dist/tools/local_ripgrep/scheme.d.ts +29 -4
- package/dist/tools/local_ripgrep/structuralSearch.d.ts +3 -4
- package/dist/tools/local_view_structure/scheme.d.ts +2 -2
- package/dist/tools/local_view_structure/structureFilters.d.ts +1 -3
- package/dist/tools/local_view_structure/structureResponse.d.ts +1 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +4 -8
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +2 -2
- package/dist/tools/lsp/shared/semanticTypes.d.ts +2 -1
- package/dist/tools/package_search/scheme.d.ts +9 -7
- package/dist/tools/providerMappers.d.ts +19 -0
- package/dist/tools/toolMetadata/proxies.d.ts +0 -6
- package/dist/tools/utils.d.ts +3 -7
- package/dist/types/bulk.d.ts +0 -2
- package/dist/types/execution.d.ts +1 -2
- package/dist/types/toolResults.d.ts +2 -3
- package/dist/utils/contextUtils.d.ts +35 -2
- package/dist/utils/core/lines.d.ts +16 -0
- package/dist/utils/core/types.d.ts +10 -0
- package/dist/utils/file/filters.d.ts +2 -11
- package/dist/utils/parsers/diff.d.ts +18 -0
- package/dist/utils/ranking/evidenceRanker.d.ts +86 -0
- package/dist/utils/response/error.d.ts +38 -4
- package/dist/utils/response/groupedFinalizer.d.ts +0 -2
- package/package.json +43 -14
- package/dist/commands/RipgrepCommandBuilder.d.ts +0 -27
- package/dist/hints/dynamic.d.ts +0 -6
- package/dist/hints/index.d.ts +0 -2
- package/dist/hints/types.d.ts +0 -1
- package/dist/tools/github_clone_repo/hints.d.ts +0 -2
- package/dist/tools/github_fetch_content/hints.d.ts +0 -2
- package/dist/tools/github_search_code/hints.d.ts +0 -2
- package/dist/tools/github_search_pull_requests/hints.d.ts +0 -2
- package/dist/tools/github_search_repos/hints.d.ts +0 -2
- package/dist/tools/github_view_repo_structure/hints.d.ts +0 -2
- package/dist/tools/local_fetch_content/hints.d.ts +0 -2
- package/dist/tools/local_find_files/hints.d.ts +0 -2
- package/dist/tools/local_ripgrep/grepFallbackExecutor.d.ts +0 -3
- package/dist/tools/local_ripgrep/hints.d.ts +0 -2
- package/dist/tools/local_ripgrep/ripgrepParser.d.ts +0 -9
- package/dist/tools/local_view_structure/hints.d.ts +0 -2
- package/dist/tools/local_view_structure/structureParser.d.ts +0 -3
- package/dist/tools/local_view_structure/structureWalker.d.ts +0 -24
- package/dist/tools/lsp/semantic_content/hints.d.ts +0 -4
- package/dist/tools/package_search/hints.d.ts +0 -2
- package/dist/types/metadata.d.ts +0 -69
- package/dist/utils/exec/commandAvailability.d.ts +0 -19
- package/dist/utils/exec/ripgrepBinary.d.ts +0 -3
|
@@ -130,8 +130,8 @@ export declare const GitHubPullRequestSearchQueryLocalSchema: z.ZodObject<{
|
|
|
130
130
|
reasoning: z.ZodOptional<z.ZodString>;
|
|
131
131
|
}, z.core.$strip>;
|
|
132
132
|
export declare const GitHubPullRequestSearchBulkQueryLocalSchema: z.ZodObject<{
|
|
133
|
-
responseCharOffset: z.ZodOptional<z.
|
|
134
|
-
responseCharLength: z.ZodOptional<z.
|
|
133
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
134
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
135
135
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
136
136
|
}, z.core.$strip>;
|
|
137
137
|
export declare const GitHubSearchPullRequestsOutputLocalSchema: z.ZodObject<{
|
|
@@ -160,6 +160,8 @@ export declare const GitHubSearchPullRequestsOutputLocalSchema: z.ZodObject<{
|
|
|
160
160
|
currentPage: z.ZodNumber;
|
|
161
161
|
totalPages: z.ZodNumber;
|
|
162
162
|
hasMore: z.ZodBoolean;
|
|
163
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
nextMatchPage: z.ZodOptional<z.ZodNumber>;
|
|
163
165
|
perPage: z.ZodOptional<z.ZodNumber>;
|
|
164
166
|
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
165
167
|
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
@@ -189,6 +191,8 @@ export declare const GitHubSearchPullRequestsOutputLocalSchema: z.ZodObject<{
|
|
|
189
191
|
currentPage: z.ZodNumber;
|
|
190
192
|
totalPages: z.ZodNumber;
|
|
191
193
|
hasMore: z.ZodBoolean;
|
|
194
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
nextMatchPage: z.ZodOptional<z.ZodNumber>;
|
|
192
196
|
perPage: z.ZodOptional<z.ZodNumber>;
|
|
193
197
|
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
194
198
|
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
@@ -37,8 +37,8 @@ export declare const GitHubReposSearchSingleQueryLocalSchema: z.ZodObject<{
|
|
|
37
37
|
reasoning: z.ZodOptional<z.ZodString>;
|
|
38
38
|
}, z.core.$strip>;
|
|
39
39
|
export declare const GitHubReposSearchBulkQueryLocalSchema: z.ZodObject<{
|
|
40
|
-
responseCharOffset: z.ZodOptional<z.
|
|
41
|
-
responseCharLength: z.ZodOptional<z.
|
|
40
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
41
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
42
42
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
43
43
|
}, z.core.$strip>;
|
|
44
44
|
export declare const GitHubSearchRepositoriesOutputLocalSchema: z.ZodObject<{
|
|
@@ -78,13 +78,14 @@ export declare const GitHubSearchRepositoriesOutputLocalSchema: z.ZodObject<{
|
|
|
78
78
|
lowerBound: "lowerBound";
|
|
79
79
|
}>>;
|
|
80
80
|
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
81
82
|
}, z.core.$strip>>;
|
|
82
83
|
}, z.core.$loose>>;
|
|
83
84
|
}, z.core.$loose>>>;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
base: z.ZodOptional<z.ZodString>;
|
|
87
|
+
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
88
|
+
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
88
89
|
currentPage: z.ZodNumber;
|
|
89
90
|
totalPages: z.ZodNumber;
|
|
90
91
|
hasMore: z.ZodBoolean;
|
|
@@ -8,13 +8,4 @@ type PartialRepoStructureQuery = WithOptionalMeta<GitHubViewRepoStructureQuery>;
|
|
|
8
8
|
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
9
9
|
export declare function filterStructure(structure: Record<string, GitHubRepoStructureDirectoryEntry>): Record<string, GitHubRepoStructureDirectoryEntry>;
|
|
10
10
|
export declare function exploreMultipleRepositoryStructures(args: ToolExecutionArgs<PartialRepoStructureQuery>): Promise<CallToolResult>;
|
|
11
|
-
export declare function buildRepoStructureOutput(input: {
|
|
12
|
-
data: Record<string, unknown>;
|
|
13
|
-
entryCount: number;
|
|
14
|
-
wasTruncated: boolean;
|
|
15
|
-
extraHints: string[];
|
|
16
|
-
}, _query: PartialRepoStructureQuery): {
|
|
17
|
-
data: Record<string, unknown>;
|
|
18
|
-
extraHints: string[];
|
|
19
|
-
};
|
|
20
11
|
export {};
|
|
@@ -13,8 +13,8 @@ export declare const GitHubViewRepoStructureQueryLocalSchema: import("zod").ZodO
|
|
|
13
13
|
reasoning: import("zod").ZodOptional<import("zod").ZodString>;
|
|
14
14
|
}, import("zod/v4/core").$strip>;
|
|
15
15
|
export declare const GitHubViewRepoStructureBulkQueryLocalSchema: import("zod").ZodObject<{
|
|
16
|
-
responseCharOffset: import("zod").ZodOptional<import("zod").
|
|
17
|
-
responseCharLength: import("zod").ZodOptional<import("zod").
|
|
16
|
+
responseCharOffset: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodNumber>>;
|
|
17
|
+
responseCharLength: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodNumber>>;
|
|
18
18
|
queries: import("zod").ZodArray<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>;
|
|
19
19
|
}, import("zod/v4/core").$strip>;
|
|
20
20
|
export declare const GitHubViewRepoStructureOutputLocalSchema: import("zod").ZodObject<{
|
|
@@ -33,6 +33,8 @@ export declare const GitHubViewRepoStructureOutputLocalSchema: import("zod").Zod
|
|
|
33
33
|
currentPage: import("zod").ZodNumber;
|
|
34
34
|
totalPages: import("zod").ZodNumber;
|
|
35
35
|
hasMore: import("zod").ZodBoolean;
|
|
36
|
+
nextPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
37
|
+
nextMatchPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
36
38
|
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
37
39
|
totalMatches: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
38
40
|
totalFiles: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -53,6 +55,8 @@ export declare const GitHubViewRepoStructureOutputLocalSchema: import("zod").Zod
|
|
|
53
55
|
currentPage: import("zod").ZodNumber;
|
|
54
56
|
totalPages: import("zod").ZodNumber;
|
|
55
57
|
hasMore: import("zod").ZodBoolean;
|
|
58
|
+
nextPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
59
|
+
nextMatchPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
56
60
|
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
57
61
|
totalMatches: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
58
62
|
totalFiles: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -66,10 +70,10 @@ export declare const GitHubViewRepoStructureOutputLocalSchema: import("zod").Zod
|
|
|
66
70
|
kind: import("zod").ZodString;
|
|
67
71
|
}, import("zod/v4/core").$loose>]>>>;
|
|
68
72
|
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
hints: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
74
|
+
base: import("zod").ZodOptional<import("zod").ZodString>;
|
|
75
|
+
shared: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>>;
|
|
76
|
+
responsePagination: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
73
77
|
currentPage: import("zod").ZodNumber;
|
|
74
78
|
totalPages: import("zod").ZodNumber;
|
|
75
79
|
hasMore: import("zod").ZodBoolean;
|
|
@@ -20,3 +20,5 @@ export declare function listArchiveEntries(path: string, verbose: boolean): Prom
|
|
|
20
20
|
entries?: string[];
|
|
21
21
|
}>;
|
|
22
22
|
export declare function extractArchiveEntry(path: string, entry: string): Promise<ArchiveChainResult>;
|
|
23
|
+
/** Extracts the whole archive into destDir (which must already exist). */
|
|
24
|
+
export declare function extractArchiveToDir(path: string, destDir: string): Promise<ArchiveChainResult>;
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
import type { BinaryInspectQuery } from './scheme.js';
|
|
2
|
+
interface ContentCharPagination {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
hasMore: boolean;
|
|
6
|
+
charOffset: number;
|
|
7
|
+
charLength: number;
|
|
8
|
+
totalChars: number;
|
|
9
|
+
nextCharOffset?: number;
|
|
10
|
+
}
|
|
2
11
|
export declare function inspectBinary(query: BinaryInspectQuery): Promise<import("../../index.js").UnifiedErrorResult | {
|
|
12
|
+
warnings?: string[];
|
|
13
|
+
truncated?: boolean;
|
|
14
|
+
detailed?: boolean;
|
|
15
|
+
libraries?: string[];
|
|
16
|
+
sections?: string[];
|
|
17
|
+
exports?: string[];
|
|
18
|
+
imports?: string[];
|
|
19
|
+
symbols?: string[];
|
|
20
|
+
symbolCount: number;
|
|
21
|
+
importCount: number;
|
|
22
|
+
exportCount: number;
|
|
23
|
+
entry?: string;
|
|
24
|
+
stripped?: boolean;
|
|
25
|
+
endianness?: string;
|
|
26
|
+
bits?: number;
|
|
27
|
+
arch?: string;
|
|
3
28
|
status: "success";
|
|
4
|
-
mode: "
|
|
29
|
+
mode: "inspect";
|
|
5
30
|
path: string;
|
|
6
|
-
|
|
31
|
+
format: string;
|
|
32
|
+
description: string;
|
|
7
33
|
magicBytes: string;
|
|
8
34
|
} | {
|
|
9
35
|
pagination: {
|
|
@@ -20,30 +46,45 @@ export declare function inspectBinary(query: BinaryInspectQuery): Promise<import
|
|
|
20
46
|
totalEntries: number;
|
|
21
47
|
entries: string[];
|
|
22
48
|
} | {
|
|
23
|
-
|
|
49
|
+
pagination?: ContentCharPagination;
|
|
24
50
|
status: "success";
|
|
25
51
|
mode: "extract";
|
|
26
52
|
path: string;
|
|
27
53
|
archiveFile: string;
|
|
28
54
|
backend: string;
|
|
55
|
+
localPath: string;
|
|
29
56
|
content: string;
|
|
30
57
|
contentLength: number;
|
|
31
58
|
isPartial: boolean;
|
|
32
59
|
} | {
|
|
33
|
-
|
|
60
|
+
pagination?: ContentCharPagination;
|
|
34
61
|
status: "success";
|
|
35
62
|
mode: "decompress";
|
|
36
63
|
path: string;
|
|
37
64
|
format: "gzip" | "bzip2" | "xz" | "lzma" | "zstd" | "lz4" | "brotli" | "lzfse";
|
|
38
65
|
backend: string;
|
|
66
|
+
localPath: string;
|
|
39
67
|
content: string;
|
|
40
68
|
contentLength: number;
|
|
41
69
|
isPartial: boolean;
|
|
42
70
|
} | {
|
|
71
|
+
nextScanOffset?: number;
|
|
72
|
+
scanOffset: number;
|
|
73
|
+
pagination?: ContentCharPagination;
|
|
74
|
+
contentLength: number;
|
|
75
|
+
totalFound: number;
|
|
76
|
+
isPartial: boolean;
|
|
77
|
+
localPath?: string;
|
|
43
78
|
status: "success";
|
|
44
79
|
mode: "strings";
|
|
45
80
|
path: string;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
81
|
+
content: string;
|
|
82
|
+
} | {
|
|
83
|
+
status: "success";
|
|
84
|
+
mode: "unpack";
|
|
85
|
+
path: string;
|
|
86
|
+
localPath: string;
|
|
87
|
+
cached: boolean;
|
|
88
|
+
topLevelEntries: number;
|
|
49
89
|
}>;
|
|
90
|
+
export {};
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Binary file inspection.
|
|
3
|
-
* Backs mode="
|
|
2
|
+
* Binary file inspection (format lane) — native, via octocode-engine.
|
|
3
|
+
* Backs mode="inspect" and mode="strings" in localBinaryInspect.
|
|
4
|
+
*
|
|
5
|
+
* No GNU binutils/coreutils dependency: `goblin`-backed parsing and a native
|
|
6
|
+
* string scanner replace the old `file` / `xxd` / `strings` shell-outs, so this
|
|
7
|
+
* lane works on Windows and on distroless/Alpine Linux, returns parser-stable
|
|
8
|
+
* structured data, and recovers UTF-16 strings GNU `strings -a` misses.
|
|
4
9
|
*/
|
|
5
|
-
|
|
10
|
+
import type { BinaryInspectInfo } from '@octocodeai/octocode-engine';
|
|
11
|
+
export interface InspectResult {
|
|
6
12
|
success: boolean;
|
|
7
|
-
|
|
8
|
-
magicBytes?: string;
|
|
13
|
+
info?: BinaryInspectInfo;
|
|
9
14
|
error?: string;
|
|
10
15
|
}
|
|
11
|
-
export declare function
|
|
16
|
+
export declare function inspectBinaryFile(path: string): InspectResult;
|
|
12
17
|
export interface StringsResult {
|
|
13
18
|
success: boolean;
|
|
14
19
|
strings?: string[];
|
|
15
20
|
totalFound?: number;
|
|
21
|
+
/** True when more of the file remains to scan beyond this window (follow nextScanOffset). */
|
|
22
|
+
truncated?: boolean;
|
|
23
|
+
/** Absolute byte offset for the next scan window, or undefined at EOF. */
|
|
24
|
+
nextScanOffset?: number;
|
|
16
25
|
error?: string;
|
|
17
26
|
}
|
|
18
|
-
export declare function extractStrings(path: string, minLength: number, includeOffsets: boolean):
|
|
27
|
+
export declare function extractStrings(path: string, minLength: number, includeOffsets: boolean, scanOffset?: number): StringsResult;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const LocalBinaryInspectQuerySchema: z.ZodObject<{
|
|
3
|
-
entryPageNumber: z.ZodDefault<z.ZodDefault<z.ZodOptional<z.
|
|
4
|
-
matchStringContextLines: z.ZodDefault<z.
|
|
5
|
-
charLength: z.ZodOptional<z.
|
|
6
|
-
page: z.ZodDefault<z.ZodDefault<z.ZodOptional<z.
|
|
3
|
+
entryPageNumber: z.ZodDefault<z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>>>;
|
|
4
|
+
matchStringContextLines: z.ZodDefault<z.ZodPreprocess<z.ZodNumber>>;
|
|
5
|
+
charLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
6
|
+
page: z.ZodDefault<z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>>>;
|
|
7
|
+
detailed: z.ZodOptional<z.ZodBoolean>;
|
|
7
8
|
path: z.ZodString;
|
|
8
9
|
mode: z.ZodEnum<{
|
|
9
10
|
list: "list";
|
|
10
|
-
|
|
11
|
+
inspect: "inspect";
|
|
11
12
|
extract: "extract";
|
|
12
13
|
decompress: "decompress";
|
|
13
14
|
strings: "strings";
|
|
15
|
+
unpack: "unpack";
|
|
14
16
|
}>;
|
|
15
17
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
16
18
|
maxEntries: z.ZodDefault<z.ZodNumber>;
|
|
@@ -31,6 +33,7 @@ export declare const LocalBinaryInspectQuerySchema: z.ZodObject<{
|
|
|
31
33
|
}>>;
|
|
32
34
|
minLength: z.ZodDefault<z.ZodNumber>;
|
|
33
35
|
includeOffsets: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
scanOffset: z.ZodOptional<z.ZodNumber>;
|
|
34
37
|
id: z.ZodOptional<z.ZodString>;
|
|
35
38
|
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
36
39
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
@@ -38,7 +41,7 @@ export declare const LocalBinaryInspectQuerySchema: z.ZodObject<{
|
|
|
38
41
|
}, z.core.$strict>;
|
|
39
42
|
export type BinaryInspectQuery = z.infer<typeof LocalBinaryInspectQuerySchema>;
|
|
40
43
|
export declare const LocalBinaryInspectBulkQuerySchema: z.ZodObject<{
|
|
41
|
-
responseCharOffset: z.ZodOptional<z.
|
|
42
|
-
responseCharLength: z.ZodOptional<z.
|
|
44
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
45
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
43
46
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
44
47
|
}, z.core.$strip>;
|
|
@@ -25,7 +25,7 @@ export type FetchContentQuery = z.infer<typeof LocalFetchContentQuerySchema> & {
|
|
|
25
25
|
minify?: MinifyMode;
|
|
26
26
|
};
|
|
27
27
|
export declare const LocalFetchContentBulkQuerySchema: z.ZodObject<{
|
|
28
|
-
responseCharOffset: z.ZodOptional<z.
|
|
29
|
-
responseCharLength: z.ZodOptional<z.
|
|
28
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
29
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
30
30
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
31
31
|
}, z.core.$strip>;
|
|
@@ -3,7 +3,7 @@ import { FindFilesQuerySchema as CoreFindFilesQuerySchema } from '@octocodeai/oc
|
|
|
3
3
|
export type FindFilesQuery = Omit<z.infer<typeof CoreFindFilesQuerySchema>, 'regexType'>;
|
|
4
4
|
export declare const LocalFindFilesQuerySchema: z.ZodType<FindFilesQuery>;
|
|
5
5
|
export declare const LocalFindFilesBulkQuerySchema: z.ZodObject<{
|
|
6
|
-
responseCharOffset: z.ZodOptional<z.
|
|
7
|
-
responseCharLength: z.ZodOptional<z.
|
|
6
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
7
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
8
8
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier 1 Phase 3 — optional, bounded LSP semantic boost for relevance ranking.
|
|
3
|
+
*
|
|
4
|
+
* Runs only for `sort:"relevance"` + `semanticRanking:true`, and only over the
|
|
5
|
+
* top-N relevance candidates already produced by the text/AST scorer. LSP
|
|
6
|
+
* enriches; it never gates. Rules (see RANKING-ARCHITECTURE.md):
|
|
7
|
+
* 1. LSP never adds or removes a result — only reorders the top-N.
|
|
8
|
+
* 2. Failure/timeout degrades to the existing text/AST order (graceful).
|
|
9
|
+
* 3. Boosts are capped and deterministic given the resolver's output.
|
|
10
|
+
* 4. An LSP boost never outweighs a strong exact declaration on its own.
|
|
11
|
+
*/
|
|
12
|
+
import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
|
|
13
|
+
import type { FileScore } from './rankingProfile.js';
|
|
14
|
+
/** What LSP can tell us about a candidate's anchor symbol. */
|
|
15
|
+
export interface LspSignal {
|
|
16
|
+
isDefinition?: boolean;
|
|
17
|
+
isExportedOrPublic?: boolean;
|
|
18
|
+
hasCallers?: boolean;
|
|
19
|
+
isImplementationOrType?: boolean;
|
|
20
|
+
/** Resolver couldn't anchor / server unavailable — treated as no boost. */
|
|
21
|
+
unavailable?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Capped additive boosts. Sum is bounded by LSP_BOOST_CAP. */
|
|
24
|
+
export declare const LSP_BOOST: {
|
|
25
|
+
readonly definition: 3;
|
|
26
|
+
readonly exportedOrPublic: 2;
|
|
27
|
+
readonly hasCallers: 1;
|
|
28
|
+
readonly implementationOrType: 1;
|
|
29
|
+
readonly cap: 5;
|
|
30
|
+
};
|
|
31
|
+
export declare function lspBoostScore(signal: LspSignal | null | undefined): {
|
|
32
|
+
delta: number;
|
|
33
|
+
reasons: string[];
|
|
34
|
+
};
|
|
35
|
+
export type LspResolver = (file: LocalSearchCodeFile) => Promise<LspSignal | null>;
|
|
36
|
+
export interface SemanticBoostResult {
|
|
37
|
+
files: LocalSearchCodeFile[];
|
|
38
|
+
/** Updated debug scores (boost folded in) keyed by path, when debug is on. */
|
|
39
|
+
debug?: Map<string, FileScore>;
|
|
40
|
+
/** True if any candidate was enriched; false means full graceful degrade. */
|
|
41
|
+
enriched: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Apply a bounded LSP boost to the top-N already-relevance-ranked files.
|
|
45
|
+
*
|
|
46
|
+
* `baseScores` is the Tier 1 score per path (when available). The resolver is
|
|
47
|
+
* injected so this is unit-testable and the live wiring (lspGetSemantics) stays
|
|
48
|
+
* out of the pure scoring path. Any resolver rejection degrades that one
|
|
49
|
+
* candidate to its base order; the call never throws.
|
|
50
|
+
*/
|
|
51
|
+
export declare function applySemanticBoost(rankedFiles: LocalSearchCodeFile[], resolve: LspResolver, opts?: {
|
|
52
|
+
topN?: number;
|
|
53
|
+
baseScores?: Map<string, FileScore>;
|
|
54
|
+
}): Promise<SemanticBoostResult>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier 1 — within-source language-aware ranking for localSearchCode.
|
|
3
|
+
*
|
|
4
|
+
* Replaces "more matches first, then path" with a stable, inspectable relevance
|
|
5
|
+
* score. See `.octocode/RANKING-ARCHITECTURE.md`.
|
|
6
|
+
*
|
|
7
|
+
* Hard rules (Tier 1 determinism):
|
|
8
|
+
* - Same inputs -> same ranking. No LLM, no clock, no randomness, no
|
|
9
|
+
* filesystem-order dependency.
|
|
10
|
+
* - Every score is explainable from explicit features (`debugRanking`).
|
|
11
|
+
* - Sort is total: score desc -> raw matchCount desc -> path asc.
|
|
12
|
+
* - Profile selection is deterministic from query + file path; unknown
|
|
13
|
+
* languages fall back to the generic profile.
|
|
14
|
+
*
|
|
15
|
+
* Not rigid: profiles are declarative tables, all weights live in one policy
|
|
16
|
+
* object, new languages register by adding a profile. AST/LSP signals (Phase
|
|
17
|
+
* 2/3) layer on top without changing this contract.
|
|
18
|
+
*/
|
|
19
|
+
import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
|
|
20
|
+
export type RankingProfileId = 'typescript' | 'javascript' | 'rust' | 'python' | 'go' | 'java' | 'scala' | 'markdown' | 'json' | 'yaml' | 'generic';
|
|
21
|
+
/** TS-level result orderings. `relevance` is the language-aware scorer. */
|
|
22
|
+
export type RankSort = 'relevance' | 'matchCount' | 'path' | 'created' | 'modified' | 'accessed';
|
|
23
|
+
export declare const RANKING_PROFILE_IDS: readonly ["typescript", "javascript", "rust", "python", "go", "java", "scala", "markdown", "json", "yaml", "generic"];
|
|
24
|
+
type PathRole = 'source' | 'test' | 'docs' | 'config' | 'generated' | 'fixture' | 'unknown';
|
|
25
|
+
/**
|
|
26
|
+
* All ranking weights in one place. Tuning happens here and in the golden
|
|
27
|
+
* fixtures, never scattered across the scorer. Values are deliberately
|
|
28
|
+
* integer-ish and additive so a score can be read back from its reasons.
|
|
29
|
+
*/
|
|
30
|
+
export declare const RANK_WEIGHTS: {
|
|
31
|
+
readonly exactWholeWord: 6;
|
|
32
|
+
readonly exactCaseInsensitive: 3;
|
|
33
|
+
readonly substring: 1;
|
|
34
|
+
readonly declarationLine: 8;
|
|
35
|
+
readonly exportLine: 4;
|
|
36
|
+
readonly importLine: 3;
|
|
37
|
+
readonly configKeyLine: 4;
|
|
38
|
+
readonly headingLine: 4;
|
|
39
|
+
readonly commentOrStringPenalty: -2;
|
|
40
|
+
readonly pathUnderQuery: 4;
|
|
41
|
+
readonly pathSegmentToken: 3;
|
|
42
|
+
readonly extMatchesLangType: 2;
|
|
43
|
+
readonly sourceDir: 1.5;
|
|
44
|
+
readonly lowSignalPathPenalty: -5;
|
|
45
|
+
readonly rareQueryTokenScale: 2;
|
|
46
|
+
readonly rareQueryTokenCap: 3;
|
|
47
|
+
readonly matchCountScale: 1.5;
|
|
48
|
+
readonly matchCountCap: 6;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Bound on how many files get full scoring before pagination. The engine text
|
|
52
|
+
* path returns the entire result set unbounded (no global file/match cap), so
|
|
53
|
+
* for broad terms in a large monorepo we must not score O(total files). When
|
|
54
|
+
* the cap bites we deterministically prefilter (matchCount desc, path asc)
|
|
55
|
+
* before scoring, and the builder surfaces a `truncated`-style note.
|
|
56
|
+
*/
|
|
57
|
+
export declare const RANK_CANDIDATE_CAP = 2000;
|
|
58
|
+
interface RankingProfile {
|
|
59
|
+
id: RankingProfileId;
|
|
60
|
+
extensions: readonly string[];
|
|
61
|
+
/** Lines that declare/define a symbol named like the query — highest signal. */
|
|
62
|
+
declaration: readonly RegExp[];
|
|
63
|
+
/** Exported/public surface. */
|
|
64
|
+
export: readonly RegExp[];
|
|
65
|
+
/** Import/use lines. */
|
|
66
|
+
import: readonly RegExp[];
|
|
67
|
+
}
|
|
68
|
+
/** Deterministic profile selection from query langType then file extension. */
|
|
69
|
+
export declare function selectProfile(path: string, langType?: string, override?: RankingProfileId | 'auto'): RankingProfile;
|
|
70
|
+
export declare function classifyPathRole(path: string): PathRole;
|
|
71
|
+
export interface RankContext {
|
|
72
|
+
/** Validated, sanitized search base path (query.path). */
|
|
73
|
+
queryPath?: string;
|
|
74
|
+
/** The literal keyword/pattern, used for whole-word / token / path checks. */
|
|
75
|
+
keyword?: string;
|
|
76
|
+
langType?: string;
|
|
77
|
+
caseSensitive?: boolean;
|
|
78
|
+
wholeWord?: boolean;
|
|
79
|
+
/** Profile override from query.rankingProfile. */
|
|
80
|
+
profileOverride?: RankingProfileId | 'auto';
|
|
81
|
+
/** True when the user explicitly searched into a low-signal/test/docs area. */
|
|
82
|
+
explicitLowSignal?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface FileScore {
|
|
85
|
+
score: number;
|
|
86
|
+
profile: RankingProfileId;
|
|
87
|
+
pathRole: PathRole;
|
|
88
|
+
reasons: string[];
|
|
89
|
+
}
|
|
90
|
+
/** Score one file. Pure and deterministic. */
|
|
91
|
+
export declare function scoreFile(file: LocalSearchCodeFile, ctx: RankContext): FileScore;
|
|
92
|
+
export interface RankResult {
|
|
93
|
+
files: LocalSearchCodeFile[];
|
|
94
|
+
/** Per-path debug info, only populated when debug is requested. */
|
|
95
|
+
debug?: Map<string, FileScore>;
|
|
96
|
+
/** Number of files dropped by the candidate cap before scoring (0 if none). */
|
|
97
|
+
cappedCandidates: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Rank files by the requested sort mode. `relevance` is the language-aware
|
|
101
|
+
* scorer (default); `matchCount` and `path` are deterministic escape hatches;
|
|
102
|
+
* filesystem sorts (created/modified/accessed) preserve the engine's order.
|
|
103
|
+
*/
|
|
104
|
+
export declare function rankFiles(files: LocalSearchCodeFile[], sort: RankSort, ctx: RankContext, opts?: {
|
|
105
|
+
debug?: boolean;
|
|
106
|
+
candidateCap?: number;
|
|
107
|
+
}): RankResult;
|
|
108
|
+
/** True when the query path explicitly targets a low-signal area, so the
|
|
109
|
+
* scorer should not penalize generated/test/docs/fixture roles. Uses anchored
|
|
110
|
+
* path-segment matching (not substring) so `latest/`, `contest/`, `manifest/`
|
|
111
|
+
* do NOT count as low-signal. */
|
|
112
|
+
export declare function isLowSignalQueryPath(path: string | undefined): boolean;
|
|
113
|
+
export {};
|
|
@@ -2,8 +2,17 @@ import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
|
|
|
2
2
|
import type { LocalSearchCodeToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
3
3
|
import type { SearchStats } from '../../utils/core/types.js';
|
|
4
4
|
import type { RipgrepQuery } from './scheme.js';
|
|
5
|
-
export
|
|
5
|
+
export type LocalSearchEngine = 'rg' | 'structural';
|
|
6
|
+
type FlowMatch = {
|
|
7
|
+
line?: number;
|
|
8
|
+
endLine?: number;
|
|
9
|
+
value?: string;
|
|
10
|
+
metavars?: Record<string, string[]>;
|
|
11
|
+
};
|
|
12
|
+
export declare function buildSearchResult(parsedFiles: LocalSearchCodeFile[], configuredQuery: RipgrepQuery, searchEngine: LocalSearchEngine, warnings: string[], stats?: SearchStats): Promise<LocalSearchCodeToolResult>;
|
|
6
13
|
export declare function finalizeRipgrepResult(result: LocalSearchCodeToolResult, _query: RipgrepQuery, _totals: {
|
|
7
14
|
totalMatches: number;
|
|
8
15
|
totalFiles: number;
|
|
9
16
|
}): LocalSearchCodeToolResult;
|
|
17
|
+
export declare function inferLspSymbolName(match: FlowMatch | undefined, query: RipgrepQuery, searchEngine: LocalSearchEngine): string | undefined;
|
|
18
|
+
export {};
|
|
@@ -31,14 +31,36 @@ export declare const LocalRipgrepQuerySchema: z.ZodObject<{
|
|
|
31
31
|
multilineDotall: z.ZodOptional<z.ZodBoolean>;
|
|
32
32
|
sort: z.ZodDefault<z.ZodEnum<{
|
|
33
33
|
path: "path";
|
|
34
|
-
modified: "modified";
|
|
35
34
|
created: "created";
|
|
35
|
+
relevance: "relevance";
|
|
36
|
+
matchCount: "matchCount";
|
|
37
|
+
modified: "modified";
|
|
36
38
|
accessed: "accessed";
|
|
37
39
|
}>>;
|
|
38
40
|
sortReverse: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
rankingProfile: z.ZodDefault<z.ZodEnum<{
|
|
42
|
+
auto: "auto";
|
|
43
|
+
typescript: "typescript";
|
|
44
|
+
javascript: "javascript";
|
|
45
|
+
rust: "rust";
|
|
46
|
+
python: "python";
|
|
47
|
+
go: "go";
|
|
48
|
+
java: "java";
|
|
49
|
+
scala: "scala";
|
|
50
|
+
markdown: "markdown";
|
|
51
|
+
json: "json";
|
|
52
|
+
yaml: "yaml";
|
|
53
|
+
generic: "generic";
|
|
54
|
+
}>>;
|
|
55
|
+
debugRanking: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
semanticRanking: z.ZodOptional<z.ZodBoolean>;
|
|
39
57
|
langType: z.ZodOptional<z.ZodString>;
|
|
40
58
|
countLinesPerFile: z.ZodOptional<z.ZodBoolean>;
|
|
41
59
|
countMatchesPerFile: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
onlyMatching: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
unique: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
countUnique: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
matchWindow: z.ZodOptional<z.ZodNumber>;
|
|
42
64
|
matchPage: z.ZodOptional<z.ZodNumber>;
|
|
43
65
|
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
44
66
|
page: z.ZodDefault<z.ZodNumber>;
|
|
@@ -47,9 +69,12 @@ export declare const LocalRipgrepQuerySchema: z.ZodObject<{
|
|
|
47
69
|
researchGoal: z.ZodOptional<z.ZodString>;
|
|
48
70
|
reasoning: z.ZodOptional<z.ZodString>;
|
|
49
71
|
}, z.core.$strip>;
|
|
50
|
-
export type RipgrepQuery = z.infer<typeof LocalRipgrepQuerySchema
|
|
72
|
+
export type RipgrepQuery = z.infer<typeof LocalRipgrepQuerySchema> & {
|
|
73
|
+
unique?: boolean;
|
|
74
|
+
countUnique?: boolean;
|
|
75
|
+
};
|
|
51
76
|
export declare const LocalRipgrepBulkQuerySchema: z.ZodObject<{
|
|
52
|
-
responseCharOffset: z.ZodOptional<z.
|
|
53
|
-
responseCharLength: z.ZodOptional<z.
|
|
77
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
78
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
54
79
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
55
80
|
}, z.core.$strip>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { LocalSearchCodeToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
2
2
|
import type { RipgrepQuery } from './scheme.js';
|
|
3
3
|
/**
|
|
4
|
-
* mode:"structural" execution path.
|
|
5
|
-
* with
|
|
6
|
-
*
|
|
7
|
-
* sizing) is identical to the other localSearchCode modes.
|
|
4
|
+
* mode:"structural" execution path. Path validation and result shaping stay in
|
|
5
|
+
* TypeScript with the rest of localSearchCode; filesystem traversal, file reads,
|
|
6
|
+
* pre-filtering, parsing, and Octocode AST matching run in native Rust.
|
|
8
7
|
*/
|
|
9
8
|
export declare function searchContentStructural(query: RipgrepQuery): Promise<LocalSearchCodeToolResult>;
|
|
@@ -27,7 +27,7 @@ export declare const LocalViewStructureQuerySchema: z.ZodObject<{
|
|
|
27
27
|
}, z.core.$strip>;
|
|
28
28
|
export type ViewStructureQuery = z.infer<typeof LocalViewStructureQuerySchema>;
|
|
29
29
|
export declare const LocalViewStructureBulkQuerySchema: z.ZodObject<{
|
|
30
|
-
responseCharOffset: z.ZodOptional<z.
|
|
31
|
-
responseCharLength: z.ZodOptional<z.
|
|
30
|
+
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
31
|
+
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
32
32
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
33
33
|
}, z.core.$strip>;
|
|
@@ -11,12 +11,10 @@ export interface DirectoryEntry {
|
|
|
11
11
|
}
|
|
12
12
|
type EntryFilterQuery = Pick<{
|
|
13
13
|
pattern?: string;
|
|
14
|
-
extensions?: string[];
|
|
15
14
|
directoriesOnly?: boolean;
|
|
16
15
|
filesOnly?: boolean;
|
|
17
|
-
}, 'pattern' | '
|
|
16
|
+
}, 'pattern' | 'directoriesOnly' | 'filesOnly'>;
|
|
18
17
|
export declare function applyEntryFilters(entries: DirectoryEntry[], query: EntryFilterQuery): DirectoryEntry[];
|
|
19
|
-
export declare function formatEntryString(entry: DirectoryEntry, indent?: number): string;
|
|
20
18
|
interface EntryOutput {
|
|
21
19
|
type: 'file' | 'dir' | 'link';
|
|
22
20
|
depth?: number;
|
|
@@ -21,6 +21,7 @@ export declare function paginateEntries(entries: DirectoryEntry[], query: {
|
|
|
21
21
|
entriesPerPage: number;
|
|
22
22
|
totalEntries: number;
|
|
23
23
|
hasMore: boolean;
|
|
24
|
+
nextPage?: number;
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
export declare function buildEntryPaginationHints(entries: DirectoryEntry[], paginatedCount: number, pagination: {
|