@j0hanz/fs-context-mcp 2.0.0 → 2.0.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 +22 -17
- package/dist/config.d.ts +117 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +31 -0
- package/dist/config.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/constants.d.ts +3 -3
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +129 -3
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +9 -9
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/file-operations/file-info.d.ts +7 -1
- package/dist/lib/file-operations/file-info.d.ts.map +1 -1
- package/dist/lib/file-operations/file-info.js +84 -8
- package/dist/lib/file-operations/file-info.js.map +1 -1
- package/dist/lib/file-operations/get-multiple-file-info.d.ts.map +1 -1
- package/dist/lib/file-operations/get-multiple-file-info.js +8 -4
- package/dist/lib/file-operations/get-multiple-file-info.js.map +1 -1
- package/dist/lib/file-operations/glob-engine.d.ts.map +1 -1
- package/dist/lib/file-operations/glob-engine.js +46 -19
- package/dist/lib/file-operations/glob-engine.js.map +1 -1
- package/dist/lib/file-operations/list-directory-entry.d.ts.map +1 -1
- package/dist/lib/file-operations/list-directory-entry.js +5 -3
- package/dist/lib/file-operations/list-directory-entry.js.map +1 -1
- package/dist/lib/file-operations/list-directory-helpers.d.ts.map +1 -1
- package/dist/lib/file-operations/list-directory-helpers.js +11 -4
- package/dist/lib/file-operations/list-directory-helpers.js.map +1 -1
- package/dist/lib/file-operations/list-directory.d.ts +12 -2
- package/dist/lib/file-operations/list-directory.d.ts.map +1 -1
- package/dist/lib/file-operations/list-directory.js +155 -3
- package/dist/lib/file-operations/list-directory.js.map +1 -1
- package/dist/lib/file-operations/read-multiple-files-helpers.d.ts.map +1 -1
- package/dist/lib/file-operations/read-multiple-files-helpers.js +40 -19
- package/dist/lib/file-operations/read-multiple-files-helpers.js.map +1 -1
- package/dist/lib/file-operations/read-multiple-files.d.ts +18 -1
- package/dist/lib/file-operations/read-multiple-files.d.ts.map +1 -1
- package/dist/lib/file-operations/read-multiple-files.js +107 -2
- package/dist/lib/file-operations/read-multiple-files.js.map +1 -1
- package/dist/lib/file-operations/search/engine.d.ts.map +1 -1
- package/dist/lib/file-operations/search/engine.js +7 -2
- package/dist/lib/file-operations/search/engine.js.map +1 -1
- package/dist/lib/file-operations/search/scan-file.d.ts.map +1 -1
- package/dist/lib/file-operations/search/scan-file.js +6 -3
- package/dist/lib/file-operations/search/scan-file.js.map +1 -1
- package/dist/lib/file-operations/search/scan-runner.d.ts.map +1 -1
- package/dist/lib/file-operations/search/scan-runner.js +21 -16
- package/dist/lib/file-operations/search/scan-runner.js.map +1 -1
- package/dist/lib/file-operations/search-content.d.ts +64 -17
- package/dist/lib/file-operations/search-content.d.ts.map +1 -1
- package/dist/lib/file-operations/search-content.js +828 -3
- package/dist/lib/file-operations/search-content.js.map +1 -1
- package/dist/lib/file-operations/search-files-collector.d.ts +2 -2
- package/dist/lib/file-operations/search-files-collector.d.ts.map +1 -1
- package/dist/lib/file-operations/search-files-collector.js +23 -11
- package/dist/lib/file-operations/search-files-collector.js.map +1 -1
- package/dist/lib/file-operations/search-files-helpers.d.ts.map +1 -1
- package/dist/lib/file-operations/search-files-helpers.js +5 -2
- package/dist/lib/file-operations/search-files-helpers.js.map +1 -1
- package/dist/lib/file-operations/search-files.d.ts +20 -2
- package/dist/lib/file-operations/search-files.d.ts.map +1 -1
- package/dist/lib/file-operations/search-files.js +192 -5
- package/dist/lib/file-operations/search-files.js.map +1 -1
- package/dist/lib/file-operations/search-worker.d.ts +30 -0
- package/dist/lib/file-operations/search-worker.d.ts.map +1 -0
- package/dist/lib/file-operations/search-worker.js +98 -0
- package/dist/lib/file-operations/search-worker.js.map +1 -0
- package/dist/lib/fs-helpers/readers/read-modes.d.ts.map +1 -1
- package/dist/lib/fs-helpers/readers/read-modes.js +6 -4
- package/dist/lib/fs-helpers/readers/read-modes.js.map +1 -1
- package/dist/lib/fs-helpers/readers/read-options.d.ts.map +1 -1
- package/dist/lib/fs-helpers/readers/read-options.js +8 -3
- package/dist/lib/fs-helpers/readers/read-options.js.map +1 -1
- package/dist/lib/fs-helpers.d.ts +49 -5
- package/dist/lib/fs-helpers.d.ts.map +1 -1
- package/dist/lib/fs-helpers.js +479 -5
- package/dist/lib/fs-helpers.js.map +1 -1
- package/dist/lib/observability/diagnostics-helpers.d.ts +3 -0
- package/dist/lib/observability/diagnostics-helpers.d.ts.map +1 -0
- package/dist/lib/observability/diagnostics-helpers.js +50 -0
- package/dist/lib/observability/diagnostics-helpers.js.map +1 -0
- package/dist/lib/observability/diagnostics.d.ts.map +1 -1
- package/dist/lib/observability/diagnostics.js +24 -59
- package/dist/lib/observability/diagnostics.js.map +1 -1
- package/dist/lib/observability.d.ts +15 -0
- package/dist/lib/observability.d.ts.map +1 -0
- package/dist/lib/observability.js +196 -0
- package/dist/lib/observability.js.map +1 -0
- package/dist/lib/path-validation/validate-existing.js +1 -1
- package/dist/lib/path-validation/validate-existing.js.map +1 -1
- package/dist/lib/path-validation.d.ts +22 -5
- package/dist/lib/path-validation.d.ts.map +1 -1
- package/dist/lib/path-validation.js +340 -5
- package/dist/lib/path-validation.js.map +1 -1
- package/dist/schemas/inputs/directory.d.ts +1 -1
- package/dist/schemas/inputs/directory.d.ts.map +1 -1
- package/dist/schemas/inputs/directory.js +1 -12
- package/dist/schemas/inputs/directory.js.map +1 -1
- package/dist/schemas/inputs/helpers.d.ts +2 -0
- package/dist/schemas/inputs/helpers.d.ts.map +1 -0
- package/dist/schemas/inputs/helpers.js +13 -0
- package/dist/schemas/inputs/helpers.js.map +1 -0
- package/dist/schemas/inputs/safe-glob.d.ts +2 -0
- package/dist/schemas/inputs/safe-glob.d.ts.map +1 -0
- package/dist/schemas/inputs/safe-glob.js +13 -0
- package/dist/schemas/inputs/safe-glob.js.map +1 -0
- package/dist/schemas/inputs/search.d.ts.map +1 -1
- package/dist/schemas/inputs/search.js +2 -13
- package/dist/schemas/inputs/search.js.map +1 -1
- package/dist/schemas/output-helpers.d.ts +6 -1
- package/dist/schemas/output-helpers.d.ts.map +1 -1
- package/dist/schemas/output-helpers.js +5 -0
- package/dist/schemas/output-helpers.js.map +1 -1
- package/dist/schemas/outputs/file-info.d.ts +2 -2
- package/dist/schemas/outputs/file-info.d.ts.map +1 -1
- package/dist/schemas/outputs/file-info.js +2 -8
- package/dist/schemas/outputs/file-info.js.map +1 -1
- package/dist/schemas/outputs/read.d.ts.map +1 -1
- package/dist/schemas/outputs/read.js +2 -7
- package/dist/schemas/outputs/read.js.map +1 -1
- package/dist/schemas.d.ts +256 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +379 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server/roots.d.ts.map +1 -1
- package/dist/server/roots.js +19 -15
- package/dist/server/roots.js.map +1 -1
- package/dist/server.d.ts +11 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +212 -10
- package/dist/server.js.map +1 -1
- package/dist/tools/get-file-info.d.ts.map +1 -1
- package/dist/tools/get-file-info.js +5 -1
- package/dist/tools/get-file-info.js.map +1 -1
- package/dist/tools/get-multiple-file-info.d.ts.map +1 -1
- package/dist/tools/get-multiple-file-info.js +6 -3
- package/dist/tools/get-multiple-file-info.js.map +1 -1
- package/dist/tools/list-directory-formatting.d.ts.map +1 -1
- package/dist/tools/list-directory-formatting.js +7 -1
- package/dist/tools/list-directory-formatting.js.map +1 -1
- package/dist/tools/list-directory.d.ts.map +1 -1
- package/dist/tools/list-directory.js +5 -4
- package/dist/tools/list-directory.js.map +1 -1
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +9 -4
- package/dist/tools/read-file.js.map +1 -1
- package/dist/tools/read-multiple-files.d.ts.map +1 -1
- package/dist/tools/read-multiple-files.js +9 -4
- package/dist/tools/read-multiple-files.js.map +1 -1
- package/dist/tools/search-content.d.ts.map +1 -1
- package/dist/tools/search-content.js +19 -17
- package/dist/tools/search-content.js.map +1 -1
- package/dist/tools/search-files.d.ts.map +1 -1
- package/dist/tools/search-files.js +15 -12
- package/dist/tools/search-files.js.map +1 -1
- package/dist/tools/shared/file-info.d.ts +4 -2
- package/dist/tools/shared/file-info.d.ts.map +1 -1
- package/dist/tools/shared/file-info.js +4 -2
- package/dist/tools/shared/file-info.js.map +1 -1
- package/dist/tools/shared/resolve-path.d.ts +2 -0
- package/dist/tools/shared/resolve-path.d.ts.map +1 -0
- package/dist/tools/shared/resolve-path.js +11 -0
- package/dist/tools/shared/resolve-path.js.map +1 -0
- package/dist/tools/shared/search-formatting.d.ts.map +1 -1
- package/dist/tools/shared/search-formatting.js +58 -38
- package/dist/tools/shared/search-formatting.js.map +1 -1
- package/dist/tools/tool-response.d.ts.map +1 -1
- package/dist/tools/tool-response.js +11 -6
- package/dist/tools/tool-response.js.map +1 -1
- package/dist/tools.d.ts +41 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +624 -0
- package/dist/tools.js.map +1 -0
- package/package.json +5 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ErrorSchema } from '../error-schema.js';
|
|
3
|
+
import { OperationSummarySchema } from '../output-helpers.js';
|
|
3
4
|
export const ReadFileOutputSchema = z.object({
|
|
4
5
|
ok: z.boolean(),
|
|
5
6
|
path: z.string().optional(),
|
|
@@ -18,13 +19,7 @@ export const ReadMultipleFilesOutputSchema = z.object({
|
|
|
18
19
|
error: z.string().optional(),
|
|
19
20
|
}))
|
|
20
21
|
.optional(),
|
|
21
|
-
summary:
|
|
22
|
-
.object({
|
|
23
|
-
total: z.number(),
|
|
24
|
-
succeeded: z.number(),
|
|
25
|
-
failed: z.number(),
|
|
26
|
-
})
|
|
27
|
-
.optional(),
|
|
22
|
+
summary: OperationSummarySchema.optional(),
|
|
28
23
|
error: ErrorSchema.optional(),
|
|
29
24
|
});
|
|
30
25
|
//# sourceMappingURL=read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/schemas/outputs/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../src/schemas/outputs/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE;IACf,OAAO,EAAE,CAAC;SACP,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC,CACH;SACA,QAAQ,EAAE;IACb,OAAO,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAC1C,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FileTypeSchema: z.ZodEnum<{
|
|
3
|
+
file: "file";
|
|
4
|
+
directory: "directory";
|
|
5
|
+
symlink: "symlink";
|
|
6
|
+
other: "other";
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ErrorSchema: z.ZodObject<{
|
|
9
|
+
code: z.ZodString;
|
|
10
|
+
message: z.ZodString;
|
|
11
|
+
path: z.ZodOptional<z.ZodString>;
|
|
12
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const HeadLinesSchema: z.ZodOptional<z.ZodInt>;
|
|
15
|
+
export declare const FileInfoSchema: z.ZodObject<{
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
type: z.ZodEnum<{
|
|
19
|
+
file: "file";
|
|
20
|
+
directory: "directory";
|
|
21
|
+
symlink: "symlink";
|
|
22
|
+
other: "other";
|
|
23
|
+
}>;
|
|
24
|
+
size: z.ZodNumber;
|
|
25
|
+
created: z.ZodOptional<z.ZodString>;
|
|
26
|
+
modified: z.ZodString;
|
|
27
|
+
accessed: z.ZodOptional<z.ZodString>;
|
|
28
|
+
permissions: z.ZodString;
|
|
29
|
+
isHidden: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
31
|
+
symlinkTarget: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export declare const OperationSummarySchema: z.ZodObject<{
|
|
34
|
+
total: z.ZodNumber;
|
|
35
|
+
succeeded: z.ZodNumber;
|
|
36
|
+
failed: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const ListDirectoryInputSchema: z.ZodObject<{
|
|
39
|
+
path: z.ZodOptional<z.ZodString>;
|
|
40
|
+
includeHidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
41
|
+
excludePatterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
42
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
43
|
+
maxDepth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
44
|
+
maxEntries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
45
|
+
timeoutMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
46
|
+
sortBy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
name: "name";
|
|
48
|
+
size: "size";
|
|
49
|
+
modified: "modified";
|
|
50
|
+
type: "type";
|
|
51
|
+
}>>>;
|
|
52
|
+
includeSymlinkTargets: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export declare const ListAllowedDirectoriesInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
55
|
+
export declare const SearchFilesInputSchema: z.ZodObject<{
|
|
56
|
+
path: z.ZodOptional<z.ZodString>;
|
|
57
|
+
pattern: z.ZodString;
|
|
58
|
+
maxResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
export declare const SearchContentInputSchema: z.ZodObject<{
|
|
61
|
+
path: z.ZodOptional<z.ZodString>;
|
|
62
|
+
pattern: z.ZodString;
|
|
63
|
+
filePattern: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
64
|
+
excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
caseSensitive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
66
|
+
maxResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
67
|
+
maxFileSize: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
maxFilesScanned: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
69
|
+
timeoutMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
70
|
+
skipBinary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
71
|
+
includeHidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
72
|
+
contextLines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
73
|
+
wholeWord: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
74
|
+
isLiteral: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
75
|
+
baseNameMatch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
76
|
+
caseSensitiveFileMatch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
77
|
+
includeIgnored: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export declare const ReadFileInputSchema: z.ZodObject<{
|
|
80
|
+
path: z.ZodString;
|
|
81
|
+
head: z.ZodOptional<z.ZodInt>;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
export declare const ReadMultipleFilesInputSchema: z.ZodObject<{
|
|
84
|
+
paths: z.ZodArray<z.ZodString>;
|
|
85
|
+
head: z.ZodOptional<z.ZodInt>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
export declare const GetFileInfoInputSchema: z.ZodObject<{
|
|
88
|
+
path: z.ZodString;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
export declare const GetMultipleFileInfoInputSchema: z.ZodObject<{
|
|
91
|
+
paths: z.ZodArray<z.ZodString>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
export declare const ListAllowedDirectoriesOutputSchema: z.ZodObject<{
|
|
94
|
+
ok: z.ZodBoolean;
|
|
95
|
+
directories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
code: z.ZodString;
|
|
98
|
+
message: z.ZodString;
|
|
99
|
+
path: z.ZodOptional<z.ZodString>;
|
|
100
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export declare const ListDirectoryOutputSchema: z.ZodObject<{
|
|
104
|
+
ok: z.ZodBoolean;
|
|
105
|
+
path: z.ZodOptional<z.ZodString>;
|
|
106
|
+
entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
107
|
+
name: z.ZodString;
|
|
108
|
+
relativePath: z.ZodOptional<z.ZodString>;
|
|
109
|
+
type: z.ZodEnum<{
|
|
110
|
+
file: "file";
|
|
111
|
+
directory: "directory";
|
|
112
|
+
symlink: "symlink";
|
|
113
|
+
other: "other";
|
|
114
|
+
}>;
|
|
115
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
modified: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>>>;
|
|
118
|
+
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
code: z.ZodString;
|
|
121
|
+
message: z.ZodString;
|
|
122
|
+
path: z.ZodOptional<z.ZodString>;
|
|
123
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export declare const SearchFilesOutputSchema: z.ZodObject<{
|
|
127
|
+
ok: z.ZodBoolean;
|
|
128
|
+
results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
129
|
+
path: z.ZodString;
|
|
130
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
modified: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>>>;
|
|
133
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
code: z.ZodString;
|
|
137
|
+
message: z.ZodString;
|
|
138
|
+
path: z.ZodOptional<z.ZodString>;
|
|
139
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
export declare const SearchContentOutputSchema: z.ZodObject<{
|
|
143
|
+
ok: z.ZodBoolean;
|
|
144
|
+
matches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
+
file: z.ZodString;
|
|
146
|
+
line: z.ZodNumber;
|
|
147
|
+
content: z.ZodString;
|
|
148
|
+
contextBefore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
149
|
+
contextAfter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
150
|
+
}, z.core.$strip>>>;
|
|
151
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
154
|
+
code: z.ZodString;
|
|
155
|
+
message: z.ZodString;
|
|
156
|
+
path: z.ZodOptional<z.ZodString>;
|
|
157
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
export declare const ReadFileOutputSchema: z.ZodObject<{
|
|
161
|
+
ok: z.ZodBoolean;
|
|
162
|
+
path: z.ZodOptional<z.ZodString>;
|
|
163
|
+
content: z.ZodOptional<z.ZodString>;
|
|
164
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
totalLines: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
code: z.ZodString;
|
|
168
|
+
message: z.ZodString;
|
|
169
|
+
path: z.ZodOptional<z.ZodString>;
|
|
170
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strip>>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
export declare const ReadMultipleFilesOutputSchema: z.ZodObject<{
|
|
174
|
+
ok: z.ZodBoolean;
|
|
175
|
+
results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
176
|
+
path: z.ZodString;
|
|
177
|
+
content: z.ZodOptional<z.ZodString>;
|
|
178
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
error: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, z.core.$strip>>>;
|
|
181
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
182
|
+
total: z.ZodNumber;
|
|
183
|
+
succeeded: z.ZodNumber;
|
|
184
|
+
failed: z.ZodNumber;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
code: z.ZodString;
|
|
188
|
+
message: z.ZodString;
|
|
189
|
+
path: z.ZodOptional<z.ZodString>;
|
|
190
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strip>>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
export declare const GetFileInfoOutputSchema: z.ZodObject<{
|
|
194
|
+
ok: z.ZodBoolean;
|
|
195
|
+
info: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
name: z.ZodString;
|
|
197
|
+
path: z.ZodString;
|
|
198
|
+
type: z.ZodEnum<{
|
|
199
|
+
file: "file";
|
|
200
|
+
directory: "directory";
|
|
201
|
+
symlink: "symlink";
|
|
202
|
+
other: "other";
|
|
203
|
+
}>;
|
|
204
|
+
size: z.ZodNumber;
|
|
205
|
+
created: z.ZodOptional<z.ZodString>;
|
|
206
|
+
modified: z.ZodString;
|
|
207
|
+
accessed: z.ZodOptional<z.ZodString>;
|
|
208
|
+
permissions: z.ZodString;
|
|
209
|
+
isHidden: z.ZodOptional<z.ZodBoolean>;
|
|
210
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
211
|
+
symlinkTarget: z.ZodOptional<z.ZodString>;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
code: z.ZodString;
|
|
215
|
+
message: z.ZodString;
|
|
216
|
+
path: z.ZodOptional<z.ZodString>;
|
|
217
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
export declare const GetMultipleFileInfoOutputSchema: z.ZodObject<{
|
|
221
|
+
ok: z.ZodBoolean;
|
|
222
|
+
results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
223
|
+
path: z.ZodString;
|
|
224
|
+
info: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
path: z.ZodString;
|
|
227
|
+
type: z.ZodEnum<{
|
|
228
|
+
file: "file";
|
|
229
|
+
directory: "directory";
|
|
230
|
+
symlink: "symlink";
|
|
231
|
+
other: "other";
|
|
232
|
+
}>;
|
|
233
|
+
size: z.ZodNumber;
|
|
234
|
+
created: z.ZodOptional<z.ZodString>;
|
|
235
|
+
modified: z.ZodString;
|
|
236
|
+
accessed: z.ZodOptional<z.ZodString>;
|
|
237
|
+
permissions: z.ZodString;
|
|
238
|
+
isHidden: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
240
|
+
symlinkTarget: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
error: z.ZodOptional<z.ZodString>;
|
|
243
|
+
}, z.core.$strip>>>;
|
|
244
|
+
summary: z.ZodOptional<z.ZodObject<{
|
|
245
|
+
total: z.ZodNumber;
|
|
246
|
+
succeeded: z.ZodNumber;
|
|
247
|
+
failed: z.ZodNumber;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
250
|
+
code: z.ZodString;
|
|
251
|
+
message: z.ZodString;
|
|
252
|
+
path: z.ZodOptional<z.ZodString>;
|
|
253
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,cAAc;;;;;EAAoD,CAAC;AAEhF,eAAO,MAAM,WAAW;;;;;iBAKtB,CAAC;AAEH,eAAO,MAAM,eAAe,yBAKc,CAAC;AAE3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;iBAYzB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;kBAuEnC,CAAC;AAEH,eAAO,MAAM,iCAAiC,iCAEX,CAAC;AAEpC,eAAO,MAAM,sBAAsB;;;;kBAuCjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;kBA4HnC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;kBAW9B,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;kBAUvC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;kBAQjC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;kBASzC,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;iBAI7C,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;iBAgBpC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;iBAclC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;iBAgBpC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAO/B,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;iBAcxC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa1C,CAAC"}
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
function isSafeGlobPattern(value) {
|
|
3
|
+
if (value.length === 0)
|
|
4
|
+
return false;
|
|
5
|
+
const absolutePattern = /^([/\\]|[A-Za-z]:[/\\]|\\\\)/u;
|
|
6
|
+
if (absolutePattern.test(value)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (/[\\/]\.\.(?:[/\\]|$)/u.test(value) || value.startsWith('..')) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
export const FileTypeSchema = z.enum(['file', 'directory', 'symlink', 'other']);
|
|
15
|
+
export const ErrorSchema = z.object({
|
|
16
|
+
code: z.string().describe('Error code (e.g., E_NOT_FOUND)'),
|
|
17
|
+
message: z.string().describe('Human-readable error message'),
|
|
18
|
+
path: z.string().optional().describe('Path that caused the error'),
|
|
19
|
+
suggestion: z.string().optional().describe('Suggested action to resolve'),
|
|
20
|
+
});
|
|
21
|
+
export const HeadLinesSchema = z
|
|
22
|
+
.int({ error: 'head must be an integer' })
|
|
23
|
+
.min(1, 'head must be at least 1')
|
|
24
|
+
.max(100000, 'head cannot exceed 100,000 lines')
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Read only the first N lines');
|
|
27
|
+
export const FileInfoSchema = z.object({
|
|
28
|
+
name: z.string(),
|
|
29
|
+
path: z.string(),
|
|
30
|
+
type: FileTypeSchema,
|
|
31
|
+
size: z.number(),
|
|
32
|
+
created: z.string().optional(),
|
|
33
|
+
modified: z.string(),
|
|
34
|
+
accessed: z.string().optional(),
|
|
35
|
+
permissions: z.string(),
|
|
36
|
+
isHidden: z.boolean().optional(),
|
|
37
|
+
mimeType: z.string().optional(),
|
|
38
|
+
symlinkTarget: z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
export const OperationSummarySchema = z.object({
|
|
41
|
+
total: z.number(),
|
|
42
|
+
succeeded: z.number(),
|
|
43
|
+
failed: z.number(),
|
|
44
|
+
});
|
|
45
|
+
export const ListDirectoryInputSchema = z.strictObject({
|
|
46
|
+
path: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Directory path to list (leave empty for workspace root). ' +
|
|
50
|
+
'Examples: "src", "src/components", "lib/utils"'),
|
|
51
|
+
includeHidden: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.optional()
|
|
54
|
+
.default(false)
|
|
55
|
+
.describe('Include hidden files and directories'),
|
|
56
|
+
excludePatterns: z
|
|
57
|
+
.array(z
|
|
58
|
+
.string()
|
|
59
|
+
.min(1, 'Exclude pattern cannot be empty')
|
|
60
|
+
.max(500, 'Exclude pattern is too long')
|
|
61
|
+
.refine(isSafeGlobPattern, {
|
|
62
|
+
error: 'Exclude pattern must be relative (no absolute or ".." segments)',
|
|
63
|
+
}))
|
|
64
|
+
.max(100, 'Too many exclude patterns (max 100)')
|
|
65
|
+
.optional()
|
|
66
|
+
.default([])
|
|
67
|
+
.describe('Glob patterns to exclude'),
|
|
68
|
+
pattern: z
|
|
69
|
+
.string()
|
|
70
|
+
.min(1, 'Pattern cannot be empty')
|
|
71
|
+
.max(1000, 'Pattern is too long (max 1000 characters)')
|
|
72
|
+
.optional()
|
|
73
|
+
.refine((value) => value === undefined || isSafeGlobPattern(value), {
|
|
74
|
+
error: 'Pattern must be relative (no absolute or ".." segments)',
|
|
75
|
+
})
|
|
76
|
+
.describe('Glob pattern to include (relative, no "..")'),
|
|
77
|
+
maxDepth: z
|
|
78
|
+
.number()
|
|
79
|
+
.int({ error: 'maxDepth must be an integer' })
|
|
80
|
+
.min(0, 'maxDepth must be at least 0')
|
|
81
|
+
.max(100, 'maxDepth cannot exceed 100')
|
|
82
|
+
.optional()
|
|
83
|
+
.default(10)
|
|
84
|
+
.describe('Maximum depth when using pattern (0-100)'),
|
|
85
|
+
maxEntries: z
|
|
86
|
+
.number()
|
|
87
|
+
.int({ error: 'maxEntries must be an integer' })
|
|
88
|
+
.min(1, 'maxEntries must be at least 1')
|
|
89
|
+
.max(100000, 'maxEntries cannot exceed 100,000')
|
|
90
|
+
.optional()
|
|
91
|
+
.default(10000)
|
|
92
|
+
.describe('Maximum entries to return (1-100000)'),
|
|
93
|
+
timeoutMs: z
|
|
94
|
+
.number()
|
|
95
|
+
.int({ error: 'timeoutMs must be an integer' })
|
|
96
|
+
.min(100, 'timeoutMs must be at least 100ms')
|
|
97
|
+
.max(3600000, 'timeoutMs cannot exceed 1 hour')
|
|
98
|
+
.optional()
|
|
99
|
+
.default(30000)
|
|
100
|
+
.describe('Timeout in milliseconds'),
|
|
101
|
+
sortBy: z
|
|
102
|
+
.enum(['name', 'size', 'modified', 'type'])
|
|
103
|
+
.optional()
|
|
104
|
+
.default('name')
|
|
105
|
+
.describe('Sort by: name, size, modified, type'),
|
|
106
|
+
includeSymlinkTargets: z
|
|
107
|
+
.boolean()
|
|
108
|
+
.optional()
|
|
109
|
+
.default(false)
|
|
110
|
+
.describe('Include symlink target paths (symlinks are not followed)'),
|
|
111
|
+
});
|
|
112
|
+
export const ListAllowedDirectoriesInputSchema = z
|
|
113
|
+
.strictObject({})
|
|
114
|
+
.describe('No input parameters.');
|
|
115
|
+
export const SearchFilesInputSchema = z.strictObject({
|
|
116
|
+
path: z
|
|
117
|
+
.string()
|
|
118
|
+
.optional()
|
|
119
|
+
.describe('Base directory to search from (leave empty for workspace root). ' +
|
|
120
|
+
'Examples: "src", "lib", "tests"'),
|
|
121
|
+
pattern: z
|
|
122
|
+
.string()
|
|
123
|
+
.min(1, 'Pattern cannot be empty')
|
|
124
|
+
.max(1000, 'Pattern is too long (max 1000 characters)')
|
|
125
|
+
.refine((val) => {
|
|
126
|
+
try {
|
|
127
|
+
if (val.includes('**/**/**')) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
return isSafeGlobPattern(val);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
error: 'Invalid glob pattern syntax or unsafe path (absolute/.. segments not allowed)',
|
|
137
|
+
})
|
|
138
|
+
.describe('Glob pattern to match files. Examples: "**/*.ts" (all TypeScript files), "src/**/*.js" (JS files in src), "*.json" (JSON files in current dir)'),
|
|
139
|
+
maxResults: z
|
|
140
|
+
.number()
|
|
141
|
+
.int({ error: 'maxResults must be an integer' })
|
|
142
|
+
.min(1, 'maxResults must be at least 1')
|
|
143
|
+
.max(10000, 'maxResults cannot exceed 10,000')
|
|
144
|
+
.optional()
|
|
145
|
+
.default(100)
|
|
146
|
+
.describe('Maximum matches to return (1-10000)'),
|
|
147
|
+
});
|
|
148
|
+
export const SearchContentInputSchema = z.strictObject({
|
|
149
|
+
path: z
|
|
150
|
+
.string()
|
|
151
|
+
.optional()
|
|
152
|
+
.describe('Base directory to search within (leave empty for workspace root). ' +
|
|
153
|
+
'Examples: "src", "lib", "tests"'),
|
|
154
|
+
pattern: z
|
|
155
|
+
.string()
|
|
156
|
+
.min(1, 'Pattern cannot be empty')
|
|
157
|
+
.max(1000, 'Pattern is too long (max 1000 characters)')
|
|
158
|
+
.describe('Text to search for. Examples: "console.log", "import React", "className"'),
|
|
159
|
+
filePattern: z
|
|
160
|
+
.string()
|
|
161
|
+
.min(1, 'File pattern cannot be empty')
|
|
162
|
+
.max(500, 'File pattern is too long')
|
|
163
|
+
.optional()
|
|
164
|
+
.default('**/*')
|
|
165
|
+
.refine(isSafeGlobPattern, {
|
|
166
|
+
error: 'File pattern must be relative to the base path (no absolute or ".." segments)',
|
|
167
|
+
})
|
|
168
|
+
.describe('Glob pattern to filter files. Examples: "**/*.ts", "src/**/*.js"'),
|
|
169
|
+
excludePatterns: z
|
|
170
|
+
.array(z
|
|
171
|
+
.string()
|
|
172
|
+
.min(1, 'Exclude pattern cannot be empty')
|
|
173
|
+
.max(500, 'Exclude pattern is too long')
|
|
174
|
+
.refine(isSafeGlobPattern, {
|
|
175
|
+
error: 'Exclude pattern must be relative to the base path (no absolute or ".." segments)',
|
|
176
|
+
}))
|
|
177
|
+
.max(100, 'Too many exclude patterns (max 100)')
|
|
178
|
+
.optional()
|
|
179
|
+
.describe('Glob patterns to exclude'),
|
|
180
|
+
caseSensitive: z
|
|
181
|
+
.boolean()
|
|
182
|
+
.optional()
|
|
183
|
+
.default(false)
|
|
184
|
+
.describe('Case-sensitive search'),
|
|
185
|
+
maxResults: z
|
|
186
|
+
.number()
|
|
187
|
+
.int({ error: 'maxResults must be an integer' })
|
|
188
|
+
.min(1, 'maxResults must be at least 1')
|
|
189
|
+
.max(10000, 'maxResults cannot exceed 10,000')
|
|
190
|
+
.optional()
|
|
191
|
+
.default(100)
|
|
192
|
+
.describe('Maximum number of results'),
|
|
193
|
+
maxFileSize: z
|
|
194
|
+
.number()
|
|
195
|
+
.int({ error: 'maxFileSize must be an integer' })
|
|
196
|
+
.min(1024, 'maxFileSize must be at least 1024 bytes')
|
|
197
|
+
.max(10 * 1024 * 1024, 'maxFileSize cannot exceed 10MB')
|
|
198
|
+
.optional()
|
|
199
|
+
.describe('Maximum file size to scan'),
|
|
200
|
+
maxFilesScanned: z
|
|
201
|
+
.number()
|
|
202
|
+
.int({ error: 'maxFilesScanned must be an integer' })
|
|
203
|
+
.min(1, 'maxFilesScanned must be at least 1')
|
|
204
|
+
.max(200000, 'maxFilesScanned cannot exceed 200,000')
|
|
205
|
+
.optional()
|
|
206
|
+
.default(20000)
|
|
207
|
+
.describe('Maximum files to scan before stopping'),
|
|
208
|
+
timeoutMs: z
|
|
209
|
+
.number()
|
|
210
|
+
.int({ error: 'timeoutMs must be an integer' })
|
|
211
|
+
.min(100, 'timeoutMs must be at least 100ms')
|
|
212
|
+
.max(3600000, 'timeoutMs cannot exceed 1 hour')
|
|
213
|
+
.optional()
|
|
214
|
+
.default(30000)
|
|
215
|
+
.describe('Timeout in milliseconds'),
|
|
216
|
+
skipBinary: z
|
|
217
|
+
.boolean()
|
|
218
|
+
.optional()
|
|
219
|
+
.default(true)
|
|
220
|
+
.describe('Skip likely-binary files'),
|
|
221
|
+
includeHidden: z
|
|
222
|
+
.boolean()
|
|
223
|
+
.optional()
|
|
224
|
+
.default(false)
|
|
225
|
+
.describe('Include hidden files and directories'),
|
|
226
|
+
contextLines: z
|
|
227
|
+
.number()
|
|
228
|
+
.int({ error: 'contextLines must be an integer' })
|
|
229
|
+
.min(0, 'contextLines must be at least 0')
|
|
230
|
+
.max(10, 'contextLines cannot exceed 10')
|
|
231
|
+
.optional()
|
|
232
|
+
.default(0)
|
|
233
|
+
.describe('Lines of context before/after match (0-10)'),
|
|
234
|
+
wholeWord: z
|
|
235
|
+
.boolean()
|
|
236
|
+
.optional()
|
|
237
|
+
.default(false)
|
|
238
|
+
.describe('Match whole words only'),
|
|
239
|
+
isLiteral: z
|
|
240
|
+
.boolean()
|
|
241
|
+
.optional()
|
|
242
|
+
.default(false)
|
|
243
|
+
.describe('Treat pattern as literal string (escape regex chars)'),
|
|
244
|
+
baseNameMatch: z
|
|
245
|
+
.boolean()
|
|
246
|
+
.optional()
|
|
247
|
+
.default(false)
|
|
248
|
+
.describe('Match file patterns without slashes against basenames'),
|
|
249
|
+
caseSensitiveFileMatch: z
|
|
250
|
+
.boolean()
|
|
251
|
+
.optional()
|
|
252
|
+
.default(true)
|
|
253
|
+
.describe('Case-sensitive filename matching'),
|
|
254
|
+
includeIgnored: z
|
|
255
|
+
.boolean()
|
|
256
|
+
.optional()
|
|
257
|
+
.default(false)
|
|
258
|
+
.describe('Include normally ignored directories (node_modules, dist, .git, etc). ' +
|
|
259
|
+
'Set to true when debugging in dependencies.'),
|
|
260
|
+
});
|
|
261
|
+
export const ReadFileInputSchema = z.strictObject({
|
|
262
|
+
path: z
|
|
263
|
+
.string()
|
|
264
|
+
.min(1, 'Path cannot be empty')
|
|
265
|
+
.describe('Path to the file to read. ' +
|
|
266
|
+
'Examples: "README.md", "src/index.ts", "package.json"'),
|
|
267
|
+
head: HeadLinesSchema.describe('Read only the first N lines of the file (useful for previewing large files)'),
|
|
268
|
+
});
|
|
269
|
+
export const ReadMultipleFilesInputSchema = z.strictObject({
|
|
270
|
+
paths: z
|
|
271
|
+
.array(z.string().min(1, 'Path cannot be empty'))
|
|
272
|
+
.min(1, 'At least one path is required')
|
|
273
|
+
.max(100, 'Cannot read more than 100 files at once')
|
|
274
|
+
.describe('Array of file paths to read. ' +
|
|
275
|
+
'Examples: ["README.md", "package.json"], ["src/index.ts", "src/server.ts"]'),
|
|
276
|
+
head: HeadLinesSchema.describe('Read only the first N lines of each file'),
|
|
277
|
+
});
|
|
278
|
+
export const GetFileInfoInputSchema = z.strictObject({
|
|
279
|
+
path: z
|
|
280
|
+
.string()
|
|
281
|
+
.min(1, 'Path cannot be empty')
|
|
282
|
+
.describe('Path to file or directory. ' +
|
|
283
|
+
'Examples: "src", "README.md", "src/index.ts"'),
|
|
284
|
+
});
|
|
285
|
+
export const GetMultipleFileInfoInputSchema = z.strictObject({
|
|
286
|
+
paths: z
|
|
287
|
+
.array(z.string().min(1, 'Path cannot be empty'))
|
|
288
|
+
.min(1, 'At least one path is required')
|
|
289
|
+
.max(100, 'Cannot get info for more than 100 files at once')
|
|
290
|
+
.describe('Array of file or directory paths. ' +
|
|
291
|
+
'Examples: ["src", "lib"], ["package.json", "tsconfig.json"]'),
|
|
292
|
+
});
|
|
293
|
+
export const ListAllowedDirectoriesOutputSchema = z.object({
|
|
294
|
+
ok: z.boolean(),
|
|
295
|
+
directories: z.array(z.string()).optional(),
|
|
296
|
+
error: ErrorSchema.optional(),
|
|
297
|
+
});
|
|
298
|
+
export const ListDirectoryOutputSchema = z.object({
|
|
299
|
+
ok: z.boolean(),
|
|
300
|
+
path: z.string().optional(),
|
|
301
|
+
entries: z
|
|
302
|
+
.array(z.object({
|
|
303
|
+
name: z.string().describe('Entry name (basename)'),
|
|
304
|
+
relativePath: z.string().optional(),
|
|
305
|
+
type: FileTypeSchema,
|
|
306
|
+
size: z.number().optional(),
|
|
307
|
+
modified: z.string().optional(),
|
|
308
|
+
}))
|
|
309
|
+
.optional(),
|
|
310
|
+
totalEntries: z.number().optional(),
|
|
311
|
+
error: ErrorSchema.optional(),
|
|
312
|
+
});
|
|
313
|
+
export const SearchFilesOutputSchema = z.object({
|
|
314
|
+
ok: z.boolean(),
|
|
315
|
+
results: z
|
|
316
|
+
.array(z.object({
|
|
317
|
+
path: z.string().describe('Relative path from search base'),
|
|
318
|
+
size: z.number().optional(),
|
|
319
|
+
modified: z.string().optional(),
|
|
320
|
+
}))
|
|
321
|
+
.optional(),
|
|
322
|
+
totalMatches: z.number().optional(),
|
|
323
|
+
truncated: z.boolean().optional(),
|
|
324
|
+
error: ErrorSchema.optional(),
|
|
325
|
+
});
|
|
326
|
+
export const SearchContentOutputSchema = z.object({
|
|
327
|
+
ok: z.boolean(),
|
|
328
|
+
matches: z
|
|
329
|
+
.array(z.object({
|
|
330
|
+
file: z.string().describe('Relative path from search base'),
|
|
331
|
+
line: z.number(),
|
|
332
|
+
content: z.string(),
|
|
333
|
+
contextBefore: z.array(z.string()).optional(),
|
|
334
|
+
contextAfter: z.array(z.string()).optional(),
|
|
335
|
+
}))
|
|
336
|
+
.optional(),
|
|
337
|
+
totalMatches: z.number().optional(),
|
|
338
|
+
truncated: z.boolean().optional(),
|
|
339
|
+
error: ErrorSchema.optional(),
|
|
340
|
+
});
|
|
341
|
+
export const ReadFileOutputSchema = z.object({
|
|
342
|
+
ok: z.boolean(),
|
|
343
|
+
path: z.string().optional(),
|
|
344
|
+
content: z.string().optional(),
|
|
345
|
+
truncated: z.boolean().optional(),
|
|
346
|
+
totalLines: z.number().optional(),
|
|
347
|
+
error: ErrorSchema.optional(),
|
|
348
|
+
});
|
|
349
|
+
export const ReadMultipleFilesOutputSchema = z.object({
|
|
350
|
+
ok: z.boolean(),
|
|
351
|
+
results: z
|
|
352
|
+
.array(z.object({
|
|
353
|
+
path: z.string(),
|
|
354
|
+
content: z.string().optional(),
|
|
355
|
+
truncated: z.boolean().optional(),
|
|
356
|
+
error: z.string().optional(),
|
|
357
|
+
}))
|
|
358
|
+
.optional(),
|
|
359
|
+
summary: OperationSummarySchema.optional(),
|
|
360
|
+
error: ErrorSchema.optional(),
|
|
361
|
+
});
|
|
362
|
+
export const GetFileInfoOutputSchema = z.object({
|
|
363
|
+
ok: z.boolean(),
|
|
364
|
+
info: FileInfoSchema.optional(),
|
|
365
|
+
error: ErrorSchema.optional(),
|
|
366
|
+
});
|
|
367
|
+
export const GetMultipleFileInfoOutputSchema = z.object({
|
|
368
|
+
ok: z.boolean(),
|
|
369
|
+
results: z
|
|
370
|
+
.array(z.object({
|
|
371
|
+
path: z.string(),
|
|
372
|
+
info: FileInfoSchema.optional(),
|
|
373
|
+
error: z.string().optional(),
|
|
374
|
+
}))
|
|
375
|
+
.optional(),
|
|
376
|
+
summary: OperationSummarySchema.optional(),
|
|
377
|
+
error: ErrorSchema.optional(),
|
|
378
|
+
});
|
|
379
|
+
//# sourceMappingURL=schemas.js.map
|