dsh-plugin-codegraph-tree-sitter 0.1.0 → 0.1.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/lib/index.d.ts +7 -3
- package/lib/index.js +7 -3
- package/lib/watcher.js +12 -0
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -44,7 +44,11 @@ export declare const inject: string[];
|
|
|
44
44
|
export declare const DATABASE_RELATIVE_PATH = ".codegraph/codegraph.db";
|
|
45
45
|
/** Default branded identity this indexer reserves on the seam. */
|
|
46
46
|
export declare const DEFAULT_INDEXER_ID = "codegraph-tree-sitter";
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Directory segments never descended into by default. Includes this package's own `.codegraph`
|
|
49
|
+
* output — without it, a watcher would treat its own `writeGraph()` as an in-scope change and
|
|
50
|
+
* rebuild forever.
|
|
51
|
+
*/
|
|
48
52
|
export declare const DEFAULT_EXCLUDE: string[];
|
|
49
53
|
/** Default ceiling on a single file's size before it is skipped. */
|
|
50
54
|
export declare const DEFAULT_MAX_FILE_BYTES = 2000000;
|
|
@@ -84,8 +88,8 @@ export interface Config {
|
|
|
84
88
|
concurrency?: number;
|
|
85
89
|
/**
|
|
86
90
|
* Watch the workspace for file changes and refresh the index automatically after a successful
|
|
87
|
-
* `index()` call establishes a baseline (default
|
|
88
|
-
*
|
|
91
|
+
* `index()` call establishes a baseline (default true). Set `watch: false` to keep indexing purely
|
|
92
|
+
* explicit instead.
|
|
89
93
|
*
|
|
90
94
|
* Overridden off by default on a WSL2 kernel watching a path mounted in from the Windows host
|
|
91
95
|
* (`/mnt/<drive>/...`), since inotify does not reliably deliver events over that 9P mount — see
|
package/lib/index.js
CHANGED
|
@@ -43,8 +43,12 @@ export const inject = ['codegraph'];
|
|
|
43
43
|
export const DATABASE_RELATIVE_PATH = '.codegraph/codegraph.db';
|
|
44
44
|
/** Default branded identity this indexer reserves on the seam. */
|
|
45
45
|
export const DEFAULT_INDEXER_ID = 'codegraph-tree-sitter';
|
|
46
|
-
/**
|
|
47
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Directory segments never descended into by default. Includes this package's own `.codegraph`
|
|
48
|
+
* output — without it, a watcher would treat its own `writeGraph()` as an in-scope change and
|
|
49
|
+
* rebuild forever.
|
|
50
|
+
*/
|
|
51
|
+
export const DEFAULT_EXCLUDE = ['node_modules', 'dist', 'build', 'coverage', '.git', '.codegraph'];
|
|
48
52
|
/** Default ceiling on a single file's size before it is skipped. */
|
|
49
53
|
export const DEFAULT_MAX_FILE_BYTES = 2_000_000;
|
|
50
54
|
/** Default ceiling on how many files one run indexes. */
|
|
@@ -63,7 +67,7 @@ export const Config = z.object({
|
|
|
63
67
|
maxFileBytes: z.number().default(DEFAULT_MAX_FILE_BYTES),
|
|
64
68
|
maxFiles: z.number().default(DEFAULT_MAX_FILES),
|
|
65
69
|
concurrency: z.number().default(DEFAULT_CONCURRENCY),
|
|
66
|
-
watch: z.boolean().default(
|
|
70
|
+
watch: z.boolean().default(true),
|
|
67
71
|
watchDebounceMs: z.number().default(DEFAULT_WATCH_DEBOUNCE_MS),
|
|
68
72
|
maxWatchedDirectories: z.number().default(DEFAULT_MAX_WATCHED_DIRECTORIES),
|
|
69
73
|
});
|
package/lib/watcher.js
CHANGED
|
@@ -275,7 +275,19 @@ export function createWatcher(config, primitive = nodeWatch) {
|
|
|
275
275
|
syncFailureCount = 0;
|
|
276
276
|
pendingPaths.clear();
|
|
277
277
|
if (process.platform === 'darwin' || process.platform === 'win32') {
|
|
278
|
+
// Started immediately, unlike the per-directory branch below, because the recursive `fs.watch`
|
|
279
|
+
// call itself must stay synchronous within start() — nothing here should make callers await a
|
|
280
|
+
// gitignore read just to get a watch installed. `gitignoreRules` starts empty and is filled in
|
|
281
|
+
// once the read resolves; every event that arrives before then is a startup-window race no
|
|
282
|
+
// different in kind from the FSEvents kernel-side warm-up delay already documented above, and
|
|
283
|
+
// resolves in the time to read one small file, not the time a human takes to edit one.
|
|
278
284
|
startRecursive();
|
|
285
|
+
if (config.respectGitignore) {
|
|
286
|
+
void loadGitignore(config.root).then(rules => {
|
|
287
|
+
if (running)
|
|
288
|
+
gitignoreRules = rules;
|
|
289
|
+
});
|
|
290
|
+
}
|
|
279
291
|
return;
|
|
280
292
|
}
|
|
281
293
|
void (async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-codegraph-tree-sitter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Self-built code-graph indexer for DeepSeek Harness — parses a workspace with web-tree-sitter and writes schema version 4 to .codegraph/codegraph.db, the same on-disk format the codegraph CLI writes, so no external indexer is required",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
52
52
|
"tree-sitter-wasms": "^0.1.13",
|
|
53
53
|
"web-tree-sitter": "^0.25.10",
|
|
54
|
-
"dsh-plugin-codegraph-service": "^0.1.
|
|
54
|
+
"dsh-plugin-codegraph-service": "^0.1.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@deepseek-ai/cordis": ">=4.0.1",
|