@j0hanz/fs-context-mcp 2.0.1 → 2.0.3
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 +46 -54
- package/dist/instructions.md +34 -35
- package/dist/lib/constants.js +1 -1
- package/dist/lib/file-operations/glob-engine.d.ts.map +1 -1
- package/dist/lib/file-operations/glob-engine.js +158 -21
- package/dist/lib/file-operations/glob-engine.js.map +1 -1
- package/dist/lib/file-operations/list-directory.d.ts.map +1 -1
- package/dist/lib/file-operations/list-directory.js +23 -3
- package/dist/lib/file-operations/list-directory.js.map +1 -1
- package/dist/lib/file-operations/search-content.d.ts +22 -19
- package/dist/lib/file-operations/search-content.d.ts.map +1 -1
- package/dist/lib/file-operations/search-content.js +102 -34
- package/dist/lib/file-operations/search-content.js.map +1 -1
- package/dist/lib/file-operations/search-worker.d.ts +1 -28
- package/dist/lib/file-operations/search-worker.d.ts.map +1 -1
- package/dist/lib/file-operations/search-worker.js +1 -10
- package/dist/lib/file-operations/search-worker.js.map +1 -1
- package/dist/lib/fs-helpers.d.ts +1 -8
- package/dist/lib/fs-helpers.d.ts.map +1 -1
- package/dist/lib/fs-helpers.js +1 -1
- package/dist/lib/fs-helpers.js.map +1 -1
- package/dist/lib/path-validation.d.ts +0 -4
- package/dist/lib/path-validation.d.ts.map +1 -1
- package/dist/lib/path-validation.js +16 -5
- package/dist/lib/path-validation.js.map +1 -1
- package/dist/schemas.d.ts +1 -62
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +13 -158
- package/dist/schemas.js.map +1 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -6
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts +1 -8
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +52 -124
- package/dist/tools.js.map +1 -1
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ A secure, read-only MCP server for filesystem scanning, searching, and analysis
|
|
|
20
20
|
|
|
21
21
|
- Directory listing (immediate contents)
|
|
22
22
|
- File search with glob patterns
|
|
23
|
-
- Content search
|
|
23
|
+
- Content search (grep-like literal text search)
|
|
24
24
|
- File reading with head previews (first N lines)
|
|
25
25
|
- Batch reads and metadata lookups in parallel
|
|
26
26
|
- Security: path validation, symlink escape protection, read-only operations
|
|
@@ -54,7 +54,7 @@ Or pass explicit directories:
|
|
|
54
54
|
npx -y @j0hanz/fs-context-mcp@latest /path/to/project /path/to/docs
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
If your MCP client supports the Roots protocol, you can omit directory arguments and let the client provide allowed directories. Otherwise, pass explicit directories or use `--allow-cwd` (if neither is provided, the server
|
|
57
|
+
If your MCP client supports the Roots protocol, you can omit directory arguments and let the client provide allowed directories. Otherwise, pass explicit directories or use `--allow-cwd` (if neither is provided, the server starts with no accessible directories until roots are provided).
|
|
58
58
|
|
|
59
59
|
### VS Code (workspace folder)
|
|
60
60
|
|
|
@@ -105,7 +105,7 @@ Access is always restricted to explicitly allowed directories.
|
|
|
105
105
|
3. MCP Roots from the client are used next:
|
|
106
106
|
- If CLI and/or `--allow-cwd` are provided, only roots inside those baseline directories are accepted.
|
|
107
107
|
- If no baseline is provided, roots become the allowed directories.
|
|
108
|
-
4. If nothing is configured and the client provides no roots, the server
|
|
108
|
+
4. If nothing is configured and the client provides no roots, the server starts with no accessible directories and logs a warning until roots are provided.
|
|
109
109
|
|
|
110
110
|
Notes:
|
|
111
111
|
|
|
@@ -123,7 +123,7 @@ All configuration is optional. Sizes in bytes, timeouts in milliseconds.
|
|
|
123
123
|
| `MAX_FILE_SIZE` | 10MB | Max file size for read operations (range: 1MB-100MB) |
|
|
124
124
|
| `MAX_SEARCH_SIZE` | 1MB | Max file size for content search (range: 100KB-10MB) |
|
|
125
125
|
| `DEFAULT_SEARCH_TIMEOUT` | 30000 | Timeout for search/list operations (range: 100-3600000ms) |
|
|
126
|
-
| `FS_CONTEXT_SEARCH_WORKERS` | min(cpu cores, 8) | Search worker threads (range:
|
|
126
|
+
| `FS_CONTEXT_SEARCH_WORKERS` | min(cpu cores, 8) | Search worker threads (range: 0-16; 0 disables) |
|
|
127
127
|
|
|
128
128
|
See [CONFIGURATION.md](CONFIGURATION.md) for examples and CLI usage.
|
|
129
129
|
|
|
@@ -149,20 +149,12 @@ Returns: Allowed directory paths. Structured output includes `ok` and
|
|
|
149
149
|
### `ls`
|
|
150
150
|
|
|
151
151
|
List the immediate contents of a directory (non-recursive). Omit `path` to use
|
|
152
|
-
the first allowed root.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
| `
|
|
158
|
-
| `includeHidden` | boolean | No | `false` | Include hidden files and directories |
|
|
159
|
-
| `excludePatterns` | string[] | No | `[]` | Glob patterns to exclude |
|
|
160
|
-
| `pattern` | string | No | - | Glob pattern to include (relative, no `..`) |
|
|
161
|
-
| `maxDepth` | number | No | `10` | Maximum depth when using pattern (0-100) |
|
|
162
|
-
| `maxEntries` | number | No | `10000` | Maximum entries to return (1-100000) |
|
|
163
|
-
| `timeoutMs` | number | No | `30000` | Timeout in milliseconds |
|
|
164
|
-
| `sortBy` | string | No | `name` | Sort by: `name`, `size`, `modified`, `type` |
|
|
165
|
-
| `includeSymlinkTargets` | boolean | No | `false` | Include symlink target paths (symlinks are not followed) |
|
|
152
|
+
the first allowed root.
|
|
153
|
+
|
|
154
|
+
| Parameter | Type | Required | Default | Description |
|
|
155
|
+
| --------------- | ------- | -------- | ------------ | ----------------------------------------------- |
|
|
156
|
+
| `path` | string | No | `first root` | Directory path to list (omit to use first root) |
|
|
157
|
+
| `includeHidden` | boolean | No | `false` | Include hidden files and directories |
|
|
166
158
|
|
|
167
159
|
Returns: Entries with name, relativePath, type, size, and modified time.
|
|
168
160
|
Structured output includes `ok`, `path`, `entries`, and `totalEntries`.
|
|
@@ -172,14 +164,16 @@ Structured output includes `ok`, `path`, `entries`, and `totalEntries`.
|
|
|
172
164
|
### `find`
|
|
173
165
|
|
|
174
166
|
Search for files using glob patterns. Omit `path` to search from the first
|
|
175
|
-
allowed root. `find`
|
|
176
|
-
|
|
167
|
+
allowed root. By default, `find` excludes common dependency/build directories
|
|
168
|
+
(node_modules, dist, .git, etc.); set `includeIgnored: true` to include ignored
|
|
169
|
+
directories and disable built-in excludes.
|
|
177
170
|
|
|
178
|
-
| Parameter
|
|
179
|
-
|
|
|
180
|
-
| `path`
|
|
181
|
-
| `pattern`
|
|
182
|
-
| `
|
|
171
|
+
| Parameter | Type | Required | Default | Description |
|
|
172
|
+
| ---------------- | ------- | -------- | ------------ | ------------------------------------------------------ |
|
|
173
|
+
| `path` | string | No | `first root` | Base directory to search from (omit to use first root) |
|
|
174
|
+
| `pattern` | string | Yes | - | Glob pattern (e.g., `**/*.ts`, `src/**/*.js`) |
|
|
175
|
+
| `includeIgnored` | boolean | No | `false` | Include ignored dirs and disable built-in excludes |
|
|
176
|
+
| `maxResults` | number | No | `100` | Maximum matches to return (1-10000) |
|
|
183
177
|
|
|
184
178
|
Returns: Matching paths (relative) with size and modified date. Structured
|
|
185
179
|
output includes `ok`, `results`, `totalMatches`, and `truncated`.
|
|
@@ -256,43 +250,41 @@ Returns: Array of file info with individual success/error status, plus summary
|
|
|
256
250
|
|
|
257
251
|
### `grep`
|
|
258
252
|
|
|
259
|
-
Search for text content within files
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
|
267
|
-
|
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
| `wholeWord` | boolean | No | `false` | Match whole words only |
|
|
278
|
-
| `isLiteral` | boolean | No | `false` | Treat pattern as literal string (escape regex chars) |
|
|
279
|
-
| `baseNameMatch` | boolean | No | `false` | Match file patterns without slashes against basenames |
|
|
280
|
-
| `caseSensitiveFileMatch` | boolean | No | `true` | Case-sensitive filename matching |
|
|
253
|
+
Search for text content within files.
|
|
254
|
+
|
|
255
|
+
- Omit `path` to search from the first allowed root.
|
|
256
|
+
- Pass a file path in `path` to search only that file.
|
|
257
|
+
|
|
258
|
+
`pattern` is treated as a literal string.
|
|
259
|
+
|
|
260
|
+
| Parameter | Type | Required | Default | Description |
|
|
261
|
+
| --------------- | ------- | -------- | ------------ | ---------------------------------------- |
|
|
262
|
+
| `path` | string | No | `first root` | Base directory or file path to search in |
|
|
263
|
+
| `pattern` | string | Yes | - | Text pattern to search for |
|
|
264
|
+
| `includeHidden` | boolean | No | `false` | Include hidden files and directories |
|
|
265
|
+
|
|
266
|
+
Example (search a single file):
|
|
267
|
+
|
|
268
|
+
```json
|
|
269
|
+
{ "path": "src/transform.ts", "pattern": "TODO" }
|
|
270
|
+
```
|
|
281
271
|
|
|
282
272
|
Returns: Matching lines with file path, line number, content, and optional
|
|
283
|
-
context.
|
|
284
|
-
|
|
273
|
+
context.
|
|
274
|
+
|
|
275
|
+
Note: the `grep` tool currently exposes only `path`, `pattern`, and
|
|
276
|
+
`includeHidden`. Context fields are omitted unless enabled internally.
|
|
277
|
+
|
|
278
|
+
Structured output includes `ok`, `matches`, `totalMatches`, and `truncated`.
|
|
285
279
|
Matched line content is trimmed to 200 characters.
|
|
286
280
|
|
|
287
281
|
---
|
|
288
282
|
|
|
289
|
-
Built-in exclude list
|
|
290
|
-
`includeIgnored` is false) includes common dependency/build/output directories
|
|
283
|
+
Built-in exclude list: `grep` skips common dependency/build/output directories
|
|
291
284
|
and files: `node_modules`, `dist`, `build`, `coverage`, `.git`, `.vscode`,
|
|
292
285
|
`.idea`, `.DS_Store`, `.next`, `.nuxt`, `.output`, `.svelte-kit`, `.cache`,
|
|
293
286
|
`.yarn`, `jspm_packages`, `bower_components`, `out`, `tmp`, `.temp`,
|
|
294
|
-
`npm-debug.log`, `yarn-debug.log`, `yarn-error.log`, `Thumbs.db`.
|
|
295
|
-
`excludePatterns: []` or `includeIgnored: true` to disable it.
|
|
287
|
+
`npm-debug.log`, `yarn-debug.log`, `yarn-error.log`, `Thumbs.db`.
|
|
296
288
|
|
|
297
289
|
## Error Codes
|
|
298
290
|
|
|
@@ -466,7 +458,7 @@ dist/ # Build output (generated)
|
|
|
466
458
|
| "Binary file" warning | `read` only supports UTF-8 text and rejects binary files. |
|
|
467
459
|
| No directories available | Pass explicit paths, use `--allow-cwd`, or ensure the client provides Roots. |
|
|
468
460
|
| Symlink blocked | Symlinks that resolve outside allowed directories are blocked. |
|
|
469
|
-
| Invalid
|
|
461
|
+
| Invalid pattern | Simplify the pattern (note: `grep` treats `pattern` as literal text). |
|
|
470
462
|
|
|
471
463
|
## Contributing
|
|
472
464
|
|
package/dist/instructions.md
CHANGED
|
@@ -10,16 +10,16 @@ explicitly allowed directories and never write to disk.
|
|
|
10
10
|
|
|
11
11
|
## Quick Reference
|
|
12
12
|
|
|
13
|
-
| Goal | Tool | Key Parameters
|
|
14
|
-
| ------------------- | ----------- |
|
|
15
|
-
| Check access | `roots` | -
|
|
16
|
-
| List contents | `ls` | `path`
|
|
17
|
-
| Find files | `find` | `pattern` (glob), `maxResults`
|
|
18
|
-
| Search in files | `grep` | `pattern`
|
|
19
|
-
| Read file | `read` | `head`
|
|
20
|
-
| Read multiple files | `read_many` | `paths[]` - preferred for 2+
|
|
21
|
-
| File metadata | `stat` | `path`
|
|
22
|
-
| Batch file metadata | `stat_many` | `paths[]` - preferred for 2+
|
|
13
|
+
| Goal | Tool | Key Parameters |
|
|
14
|
+
| ------------------- | ----------- | ------------------------------ |
|
|
15
|
+
| Check access | `roots` | - |
|
|
16
|
+
| List contents | `ls` | `path` |
|
|
17
|
+
| Find files | `find` | `pattern` (glob), `maxResults` |
|
|
18
|
+
| Search in files | `grep` | `pattern` |
|
|
19
|
+
| Read file | `read` | `head` |
|
|
20
|
+
| Read multiple files | `read_many` | `paths[]` - preferred for 2+ |
|
|
21
|
+
| File metadata | `stat` | `path` |
|
|
22
|
+
| Batch file metadata | `stat_many` | `paths[]` - preferred for 2+ |
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -27,10 +27,10 @@ explicitly allowed directories and never write to disk.
|
|
|
27
27
|
|
|
28
28
|
- **Allowed directories:** All tools only operate inside the allowed roots.
|
|
29
29
|
Run `roots` first to confirm scope. If nothing is configured and the client
|
|
30
|
-
provides no roots, the server
|
|
31
|
-
|
|
32
|
-
- **Globs vs
|
|
33
|
-
|
|
30
|
+
provides no roots, the server starts with no accessible directories and logs
|
|
31
|
+
a warning until roots are provided.
|
|
32
|
+
- **Globs vs patterns:** `find` uses glob patterns. `grep` treats `pattern` as a
|
|
33
|
+
literal string.
|
|
34
34
|
- **Symlinks:** Symlinks are never followed for security.
|
|
35
35
|
|
|
36
36
|
---
|
|
@@ -55,7 +55,7 @@ read_many([...results])
|
|
|
55
55
|
### Search patterns in code
|
|
56
56
|
|
|
57
57
|
```text
|
|
58
|
-
grep(pattern="TODO
|
|
58
|
+
grep(pattern="TODO")
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
---
|
|
@@ -105,9 +105,10 @@ List the immediate contents of a directory (non-recursive). Returns entry name,
|
|
|
105
105
|
relative path, type, size, and modified date. Omit `path` to use the first
|
|
106
106
|
allowed root. Symlinks are not followed.
|
|
107
107
|
|
|
108
|
-
| Parameter
|
|
109
|
-
|
|
|
110
|
-
| `path`
|
|
108
|
+
| Parameter | Default | Description |
|
|
109
|
+
| --------------- | ------- | ------------------------------------ |
|
|
110
|
+
| `path` | - | Directory path |
|
|
111
|
+
| `includeHidden` | false | Include hidden files and directories |
|
|
111
112
|
|
|
112
113
|
For recursive or filtered file searches, use `find` instead.
|
|
113
114
|
|
|
@@ -119,29 +120,27 @@ Find files using glob patterns. Automatically excludes common dependency/build
|
|
|
119
120
|
directories (node_modules, dist, .git, etc.). Omit `path` to use the first
|
|
120
121
|
allowed root.
|
|
121
122
|
|
|
122
|
-
| Parameter
|
|
123
|
-
|
|
|
124
|
-
| `path`
|
|
125
|
-
| `pattern`
|
|
126
|
-
| `
|
|
123
|
+
| Parameter | Default | Description |
|
|
124
|
+
| ---------------- | ------- | ------------------------- |
|
|
125
|
+
| `path` | - | Base directory |
|
|
126
|
+
| `pattern` | - | Glob: `**/*.ts`, `src/**` |
|
|
127
|
+
| `includeIgnored` | false | Include ignored dirs |
|
|
128
|
+
| `maxResults` | 100 | Limit (up to 10,000) |
|
|
127
129
|
|
|
128
130
|
---
|
|
129
131
|
|
|
130
132
|
### `grep`
|
|
131
133
|
|
|
132
|
-
Grep-like search across file contents
|
|
133
|
-
allowed root.
|
|
134
|
+
Grep-like search across file contents. `pattern` is treated as a literal string.
|
|
135
|
+
Omit `path` to use the first allowed root.
|
|
136
|
+
|
|
137
|
+
| Parameter | Default | Description |
|
|
138
|
+
| --------------- | ------- | ------------------------------------ |
|
|
139
|
+
| `path` | - | Base directory or file path |
|
|
140
|
+
| `pattern` | - | Text pattern |
|
|
141
|
+
| `includeHidden` | false | Include hidden files and directories |
|
|
134
142
|
|
|
135
|
-
|
|
136
|
-
| ---------------- | ------- | ------------------------------------ |
|
|
137
|
-
| `path` | - | Base directory |
|
|
138
|
-
| `pattern` | - | Regex: `TODO\|FIXME` |
|
|
139
|
-
| `filePattern` | `**/*` | Glob filter for files |
|
|
140
|
-
| `caseSensitive` | false | Case-sensitive matching |
|
|
141
|
-
| `isLiteral` | false | Treat pattern as literal string |
|
|
142
|
-
| `maxResults` | 100 | Maximum matches to return |
|
|
143
|
-
| `contextLines` | 0 | Lines of context before/after (0-10) |
|
|
144
|
-
| `includeIgnored` | false | Include ignored dirs (node_modules) |
|
|
143
|
+
Tip: pass a file path to search only that file.
|
|
145
144
|
|
|
146
145
|
---
|
|
147
146
|
|
package/dist/lib/constants.js
CHANGED
|
@@ -27,7 +27,7 @@ export const DEFAULT_SEARCH_TIMEOUT_MS = parseEnvInt('DEFAULT_SEARCH_TIMEOUT', 3
|
|
|
27
27
|
* Default: CPU cores (capped at 8 for optimal I/O performance).
|
|
28
28
|
* Configurable via FS_CONTEXT_SEARCH_WORKERS env var.
|
|
29
29
|
*/
|
|
30
|
-
export const SEARCH_WORKERS = parseEnvInt('FS_CONTEXT_SEARCH_WORKERS', Math.min(availableParallelism(), 8),
|
|
30
|
+
export const SEARCH_WORKERS = parseEnvInt('FS_CONTEXT_SEARCH_WORKERS', Math.min(availableParallelism(), 8), 0, 16);
|
|
31
31
|
// Hardcoded defaults
|
|
32
32
|
export const DEFAULT_MAX_DEPTH = 10;
|
|
33
33
|
export const DEFAULT_LIST_MAX_ENTRIES = 10000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob-engine.d.ts","sourceRoot":"","sources":["../../../src/lib/file-operations/glob-engine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glob-engine.d.ts","sourceRoot":"","sources":["../../../src/lib/file-operations/glob-engine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAUrC,UAAU,UAAU;IAClB,WAAW,IAAI,OAAO,CAAC;IACvB,MAAM,IAAI,OAAO,CAAC;IAClB,cAAc,IAAI,OAAO,CAAC;CAC3B;AAOD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAkQD,wBAAuB,WAAW,CAChC,OAAO,EAAE,kBAAkB,GAC1B,cAAc,CAAC,SAAS,CAAC,CAmB3B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as fs from 'node:fs/promises';
|
|
2
|
-
import
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { glob as fsGlob } from 'node:fs/promises';
|
|
3
4
|
import { publishOpsTraceEnd, publishOpsTraceError, publishOpsTraceStart, shouldPublishOpsTrace, } from '../observability.js';
|
|
4
5
|
function normalizePattern(pattern, baseNameMatch) {
|
|
5
6
|
const normalized = pattern.replace(/\\/gu, '/');
|
|
@@ -12,6 +13,150 @@ function normalizePattern(pattern, baseNameMatch) {
|
|
|
12
13
|
function normalizeIgnorePatterns(patterns) {
|
|
13
14
|
return patterns.map((pattern) => pattern.replace(/\\/gu, '/'));
|
|
14
15
|
}
|
|
16
|
+
function hasGlobMagic(segment) {
|
|
17
|
+
return /[*?[\]{}!]/u.test(segment);
|
|
18
|
+
}
|
|
19
|
+
function splitPatternPrefix(normalizedPattern) {
|
|
20
|
+
const segments = normalizedPattern.split('/');
|
|
21
|
+
let splitIndex = segments.length;
|
|
22
|
+
for (let i = 0; i < segments.length; i += 1) {
|
|
23
|
+
if (hasGlobMagic(segments[i] ?? '')) {
|
|
24
|
+
splitIndex = i;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (splitIndex === 0) {
|
|
29
|
+
return { prefix: '', remainder: normalizedPattern };
|
|
30
|
+
}
|
|
31
|
+
if (splitIndex >= segments.length) {
|
|
32
|
+
const last = segments[segments.length - 1] ?? '';
|
|
33
|
+
const prefixSegments = segments.slice(0, Math.max(0, segments.length - 1));
|
|
34
|
+
const prefix = prefixSegments.length > 0 ? `${prefixSegments.join('/')}/` : '';
|
|
35
|
+
return { prefix, remainder: last };
|
|
36
|
+
}
|
|
37
|
+
const prefixSegments = segments.slice(0, splitIndex);
|
|
38
|
+
const remainderSegments = segments.slice(splitIndex);
|
|
39
|
+
return {
|
|
40
|
+
prefix: `${prefixSegments.join('/')}/`,
|
|
41
|
+
remainder: remainderSegments.join('/'),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function normalizeToPosixPath(filePath) {
|
|
45
|
+
return filePath.replace(/\\/gu, '/');
|
|
46
|
+
}
|
|
47
|
+
function buildHiddenPatterns(normalizedPattern, maxDepth) {
|
|
48
|
+
const patterns = new Set();
|
|
49
|
+
patterns.add(normalizedPattern);
|
|
50
|
+
const { prefix, remainder } = splitPatternPrefix(normalizedPattern);
|
|
51
|
+
const remainderSegments = remainder.length > 0 ? remainder.split('/') : [];
|
|
52
|
+
const dotfileSegments = [...remainderSegments];
|
|
53
|
+
const firstCandidateIndex = dotfileSegments.findIndex((segment) => segment !== '**' && segment.length > 0);
|
|
54
|
+
if (firstCandidateIndex !== -1) {
|
|
55
|
+
const original = dotfileSegments[firstCandidateIndex] ?? '';
|
|
56
|
+
if (!original.startsWith('.')) {
|
|
57
|
+
dotfileSegments[firstCandidateIndex] = `.${original}`;
|
|
58
|
+
patterns.add(`${prefix}${dotfileSegments.join('/')}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (remainder.startsWith('**/')) {
|
|
62
|
+
const afterGlobstar = remainder.slice('**/'.length);
|
|
63
|
+
for (let depth = 0; depth <= maxDepth; depth += 1) {
|
|
64
|
+
const depthPrefix = depth > 0 ? '*/'.repeat(depth) : '';
|
|
65
|
+
patterns.add(`${prefix}${depthPrefix}.*/**/${afterGlobstar}`);
|
|
66
|
+
if (afterGlobstar.length > 0 && !afterGlobstar.startsWith('.')) {
|
|
67
|
+
patterns.add(`${prefix}${depthPrefix}.${afterGlobstar}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return [...patterns];
|
|
72
|
+
}
|
|
73
|
+
function toAbsolutePath(cwd, match) {
|
|
74
|
+
return path.isAbsolute(match) ? match : path.resolve(cwd, match);
|
|
75
|
+
}
|
|
76
|
+
function toAbsolutePathFromDirent(cwd, dirent) {
|
|
77
|
+
const base = dirent.parentPath && dirent.parentPath.length > 0 ? dirent.parentPath : cwd;
|
|
78
|
+
return path.resolve(base, dirent.name);
|
|
79
|
+
}
|
|
80
|
+
function isGlobDirentLike(value) {
|
|
81
|
+
return (typeof value === 'object' &&
|
|
82
|
+
value !== null &&
|
|
83
|
+
'name' in value &&
|
|
84
|
+
typeof value.name === 'string');
|
|
85
|
+
}
|
|
86
|
+
function resolveAbsolutePathFromGlobMatch(cwd, match) {
|
|
87
|
+
return typeof match === 'string'
|
|
88
|
+
? toAbsolutePath(cwd, match)
|
|
89
|
+
: toAbsolutePathFromDirent(cwd, match);
|
|
90
|
+
}
|
|
91
|
+
function isWithinDepthLimit(options, entryPath) {
|
|
92
|
+
if (options.maxDepth === undefined)
|
|
93
|
+
return true;
|
|
94
|
+
return resolveDepth(options.cwd, entryPath) <= options.maxDepth;
|
|
95
|
+
}
|
|
96
|
+
function createGlobIterator(pattern, cwd, exclude, withFileTypes, suppressErrors) {
|
|
97
|
+
try {
|
|
98
|
+
return fsGlob(pattern, {
|
|
99
|
+
cwd,
|
|
100
|
+
exclude,
|
|
101
|
+
withFileTypes,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
if (suppressErrors)
|
|
106
|
+
return null;
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function shouldUseGlobDirents(options) {
|
|
111
|
+
return !options.stats && !options.followSymbolicLinks;
|
|
112
|
+
}
|
|
113
|
+
function buildEntryFromGlobDirent(absolutePath, dirent, options) {
|
|
114
|
+
if (options.onlyFiles && !dirent.isFile())
|
|
115
|
+
return null;
|
|
116
|
+
return { path: absolutePath, dirent };
|
|
117
|
+
}
|
|
118
|
+
async function processGlobMatch(match, options, seen, useDirents) {
|
|
119
|
+
const absolutePath = resolveAbsolutePathFromGlobMatch(options.cwd, match);
|
|
120
|
+
if (seen.has(absolutePath))
|
|
121
|
+
return null;
|
|
122
|
+
seen.add(absolutePath);
|
|
123
|
+
if (!isWithinDepthLimit(options, absolutePath))
|
|
124
|
+
return null;
|
|
125
|
+
const entry = useDirents && isGlobDirentLike(match)
|
|
126
|
+
? buildEntryFromGlobDirent(absolutePath, match, options)
|
|
127
|
+
: await buildEntry(absolutePath, options);
|
|
128
|
+
if (!entry)
|
|
129
|
+
return null;
|
|
130
|
+
if (options.onlyFiles && !entry.dirent.isFile())
|
|
131
|
+
return null;
|
|
132
|
+
return entry;
|
|
133
|
+
}
|
|
134
|
+
async function* scanPattern(pattern, options, exclude, seen) {
|
|
135
|
+
const useDirents = shouldUseGlobDirents(options);
|
|
136
|
+
const iterator = createGlobIterator(pattern, options.cwd, exclude, useDirents, options.suppressErrors ?? false);
|
|
137
|
+
if (!iterator)
|
|
138
|
+
return;
|
|
139
|
+
try {
|
|
140
|
+
for await (const match of iterator) {
|
|
141
|
+
const entry = await processGlobMatch(match, options, seen, useDirents);
|
|
142
|
+
if (entry)
|
|
143
|
+
yield entry;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
if (options.suppressErrors)
|
|
148
|
+
return;
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function resolveDepth(cwd, entryPath) {
|
|
153
|
+
const relative = path.relative(cwd, entryPath);
|
|
154
|
+
if (relative.length === 0)
|
|
155
|
+
return 0;
|
|
156
|
+
const normalized = normalizeToPosixPath(relative);
|
|
157
|
+
const parts = normalized.split('/').filter((part) => part.length > 0);
|
|
158
|
+
return parts.length;
|
|
159
|
+
}
|
|
15
160
|
async function buildEntry(entryPath, options) {
|
|
16
161
|
try {
|
|
17
162
|
const stats = options.followSymbolicLinks
|
|
@@ -32,28 +177,20 @@ async function buildEntry(entryPath, options) {
|
|
|
32
177
|
throw error;
|
|
33
178
|
}
|
|
34
179
|
}
|
|
35
|
-
async function*
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
caseSensitiveMatch: options.caseSensitiveMatch,
|
|
46
|
-
expandDirectories: false,
|
|
47
|
-
});
|
|
48
|
-
for (const entryPath of entries) {
|
|
49
|
-
const entry = await buildEntry(entryPath, options);
|
|
50
|
-
if (!entry)
|
|
51
|
-
continue;
|
|
52
|
-
yield entry;
|
|
180
|
+
async function* nativeGlobEntries(options) {
|
|
181
|
+
const normalized = normalizePattern(options.pattern, options.baseNameMatch);
|
|
182
|
+
const maxHiddenDepth = options.maxDepth ?? 10;
|
|
183
|
+
const patterns = options.includeHidden
|
|
184
|
+
? buildHiddenPatterns(normalized, maxHiddenDepth)
|
|
185
|
+
: [normalized];
|
|
186
|
+
const exclude = normalizeIgnorePatterns(options.excludePatterns);
|
|
187
|
+
const seen = new Set();
|
|
188
|
+
for (const pattern of patterns) {
|
|
189
|
+
yield* scanPattern(pattern, options, exclude, seen);
|
|
53
190
|
}
|
|
54
191
|
}
|
|
55
192
|
export async function* globEntries(options) {
|
|
56
|
-
const engine = '
|
|
193
|
+
const engine = 'node:fs/promises.glob';
|
|
57
194
|
const traceContext = shouldPublishOpsTrace()
|
|
58
195
|
? {
|
|
59
196
|
op: 'globEntries',
|
|
@@ -63,7 +200,7 @@ export async function* globEntries(options) {
|
|
|
63
200
|
if (traceContext)
|
|
64
201
|
publishOpsTraceStart(traceContext);
|
|
65
202
|
try {
|
|
66
|
-
yield*
|
|
203
|
+
yield* nativeGlobEntries(options);
|
|
67
204
|
}
|
|
68
205
|
catch (error) {
|
|
69
206
|
if (traceContext)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob-engine.js","sourceRoot":"","sources":["../../../src/lib/file-operations/glob-engine.ts"],"names":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AAC,UAAU,EAAE,cAAc,CAAC;QACjD,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAEjB,MAAM,OAAO,GAAG,uBAAuB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,KAAK,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,CAChC,OAA2B;IAE3B,MAAM,MAAM,GAAG,uBAAuB,CAAC;IAEvC,MAAM,YAAY,GAAG,qBAAqB,EAAE;QAC1C,CAAC,CAAC;YACE,EAAE,EAAE,aAAa;YACjB,MAAM;SACP;QACH,CAAC,CAAC,SAAS,CAAC;IACd,IAAI,YAAY;QAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAErD,IAAI,CAAC;QACH,KAAK,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,YAAY;YAAE,oBAAoB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAC5D,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,YAAY;YAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-directory.d.ts","sourceRoot":"","sources":["../../../src/lib/file-operations/list-directory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"list-directory.d.ts","sourceRoot":"","sources":["../../../src/lib/file-operations/list-directory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAW3E,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IAC/C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAqSD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAkB9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fsp from 'node:fs/promises';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import { DEFAULT_LIST_MAX_ENTRIES, DEFAULT_MAX_DEPTH, DEFAULT_SEARCH_TIMEOUT_MS, } from '../constants.js';
|
|
3
|
+
import { DEFAULT_LIST_MAX_ENTRIES, DEFAULT_MAX_DEPTH, DEFAULT_SEARCH_TIMEOUT_MS, PARALLEL_CONCURRENCY, } from '../constants.js';
|
|
4
4
|
import { createTimedAbortSignal } from '../fs-helpers.js';
|
|
5
5
|
import { validateExistingDirectory } from '../path-validation.js';
|
|
6
6
|
import { globEntries } from './glob-engine.js';
|
|
@@ -131,15 +131,35 @@ async function collectEntries(basePath, normalized, signal, needsStats, maxDepth
|
|
|
131
131
|
const totals = { files: 0, directories: 0 };
|
|
132
132
|
let truncated = false;
|
|
133
133
|
let stoppedReason;
|
|
134
|
+
const pending = [];
|
|
135
|
+
let scheduledCount = 0;
|
|
134
136
|
const stream = createEntryStream(basePath, normalized, maxDepth, needsStats);
|
|
137
|
+
const flushPending = async () => {
|
|
138
|
+
if (pending.length === 0)
|
|
139
|
+
return;
|
|
140
|
+
await Promise.allSettled(pending.splice(0));
|
|
141
|
+
};
|
|
135
142
|
for await (const entry of stream) {
|
|
136
|
-
const stop = shouldStopScan(signal,
|
|
143
|
+
const stop = shouldStopScan(signal, scheduledCount, normalized.maxEntries);
|
|
137
144
|
if (stop.stop) {
|
|
138
145
|
truncated = true;
|
|
139
146
|
stoppedReason = stop.reason;
|
|
140
147
|
break;
|
|
141
148
|
}
|
|
142
|
-
|
|
149
|
+
scheduledCount += 1;
|
|
150
|
+
const task = appendEntry(basePath, entry, normalized, needsStats, totals, entries);
|
|
151
|
+
if (normalized.includeSymlinkTargets) {
|
|
152
|
+
pending.push(task);
|
|
153
|
+
if (pending.length >= PARALLEL_CONCURRENCY) {
|
|
154
|
+
await flushPending();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
await task;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (normalized.includeSymlinkTargets) {
|
|
162
|
+
await flushPending();
|
|
143
163
|
}
|
|
144
164
|
return { entries, totals, truncated, stoppedReason };
|
|
145
165
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-directory.js","sourceRoot":"","sources":["../../../src/lib/file-operations/list-directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"list-directory.js","sourceRoot":"","sources":["../../../src/lib/file-operations/list-directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,E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