@colbymchenry/codegraph-darwin-x64 1.1.1 → 1.1.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/lib/dist/bin/codegraph.js +99 -59
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.d.ts +12 -0
- package/lib/dist/bin/command-supervision.d.ts.map +1 -0
- package/lib/dist/bin/command-supervision.js +76 -0
- package/lib/dist/bin/command-supervision.js.map +1 -0
- package/lib/dist/db/migrations.d.ts +1 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +25 -1
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +10 -2
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +11 -0
- package/lib/dist/directory.d.ts +32 -0
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +83 -0
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +13 -1
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +310 -218
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts +16 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +33 -0
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +126 -0
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -0
- package/lib/dist/extraction/parse-pool.js +319 -0
- package/lib/dist/extraction/parse-pool.js.map +1 -0
- package/lib/dist/extraction/tree-sitter.d.ts +21 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +106 -21
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts +30 -3
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +50 -10
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +7 -3
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +48 -0
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +203 -32
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts +17 -0
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +73 -1
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +25 -43
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/ppid-watchdog.d.ts +18 -0
- package/lib/dist/mcp/ppid-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/ppid-watchdog.js +37 -0
- package/lib/dist/mcp/ppid-watchdog.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +94 -0
- package/lib/dist/mcp/query-pool.d.ts.map +1 -0
- package/lib/dist/mcp/query-pool.js +297 -0
- package/lib/dist/mcp/query-pool.js.map +1 -0
- package/lib/dist/mcp/query-worker.d.ts +24 -0
- package/lib/dist/mcp/query-worker.d.ts.map +1 -0
- package/lib/dist/mcp/query-worker.js +87 -0
- package/lib/dist/mcp/query-worker.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +57 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +196 -40
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/project-config.d.ts +20 -0
- package/lib/dist/project-config.d.ts.map +1 -1
- package/lib/dist/project-config.js +42 -2
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +0 -28
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.js +765 -79
- package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +44 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts +9 -0
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +40 -0
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/types.d.ts +6 -1
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,17 @@ export interface ProjectConfig {
|
|
|
12
12
|
* are never discovered or indexed (#970, #976).
|
|
13
13
|
*/
|
|
14
14
|
includeIgnored?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Gitignore-style patterns for paths to keep OUT of the index — even when
|
|
17
|
+
* they are git-TRACKED, which `.gitignore` cannot do (#999). The escape hatch
|
|
18
|
+
* for a committed vendor/theme/SDK directory (e.g. a checked-in Metronic theme
|
|
19
|
+
* under `static/`) that bloats the graph and slows indexing but isn't really
|
|
20
|
+
* your code. Matched against project-root-relative paths, so a directory like
|
|
21
|
+
* `"static/"`, a double-star vendor glob, or `"assets/theme"` all work.
|
|
22
|
+
* Absent/empty (the default) excludes nothing beyond the built-in defaults
|
|
23
|
+
* and your `.gitignore`.
|
|
24
|
+
*/
|
|
25
|
+
exclude?: string[];
|
|
15
26
|
}
|
|
16
27
|
/**
|
|
17
28
|
* Load the validated extension overrides for a project, mtime-cached.
|
|
@@ -31,6 +42,15 @@ export declare function loadExtensionOverrides(rootDir: string): Record<string,
|
|
|
31
42
|
* are never discovered or indexed (#970, #976).
|
|
32
43
|
*/
|
|
33
44
|
export declare function loadIncludeIgnoredPatterns(rootDir: string): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Load the validated `exclude` patterns for a project, mtime-cached.
|
|
47
|
+
*
|
|
48
|
+
* These name paths to keep OUT of the index even when git-tracked — the escape
|
|
49
|
+
* hatch for a committed vendor/theme/SDK directory `.gitignore` can't drop
|
|
50
|
+
* (#999). An empty result — the zero-config default — excludes nothing beyond
|
|
51
|
+
* the built-in defaults and the project's `.gitignore`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function loadExcludePatterns(rootDir: string): string[];
|
|
34
54
|
/** Test/maintenance hook: forget cached config (e.g. after rewriting it in a test). */
|
|
35
55
|
export declare function clearProjectConfigCache(): void;
|
|
36
56
|
//# sourceMappingURL=project-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../src/project-config.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../src/project-config.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA0LD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAE7D;AAED,uFAAuF;AACvF,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.PROJECT_CONFIG_FILENAME = void 0;
|
|
37
37
|
exports.loadExtensionOverrides = loadExtensionOverrides;
|
|
38
38
|
exports.loadIncludeIgnoredPatterns = loadIncludeIgnoredPatterns;
|
|
39
|
+
exports.loadExcludePatterns = loadExcludePatterns;
|
|
39
40
|
exports.clearProjectConfigCache = clearProjectConfigCache;
|
|
40
41
|
/**
|
|
41
42
|
* Project-scoped configuration: a committed `codegraph.json` at the project
|
|
@@ -79,6 +80,7 @@ const EMPTY_EXTENSIONS = Object.freeze({});
|
|
|
79
80
|
const EMPTY_CONFIG = Object.freeze({
|
|
80
81
|
extensions: EMPTY_EXTENSIONS,
|
|
81
82
|
includeIgnored: Object.freeze([]),
|
|
83
|
+
exclude: Object.freeze([]),
|
|
82
84
|
});
|
|
83
85
|
/**
|
|
84
86
|
* Normalize a user-provided extension key to the `.ext` lowercase form used by
|
|
@@ -132,9 +134,11 @@ function parseConfig(file) {
|
|
|
132
134
|
return EMPTY_CONFIG;
|
|
133
135
|
const extensions = extractExtensions(parsed, file);
|
|
134
136
|
const includeIgnored = extractIncludeIgnored(parsed, file);
|
|
135
|
-
|
|
137
|
+
const exclude = extractExclude(parsed, file);
|
|
138
|
+
if (extensions === EMPTY_EXTENSIONS && includeIgnored.length === 0 && exclude.length === 0) {
|
|
136
139
|
return EMPTY_CONFIG;
|
|
137
|
-
|
|
140
|
+
}
|
|
141
|
+
return { extensions, includeIgnored, exclude };
|
|
138
142
|
}
|
|
139
143
|
/**
|
|
140
144
|
* Validate the `extensions` map. Every failure mode degrades to "no overrides
|
|
@@ -183,6 +187,31 @@ function extractIncludeIgnored(parsed, file) {
|
|
|
183
187
|
}
|
|
184
188
|
return out;
|
|
185
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Validate the `exclude` patterns: an array of non-empty gitignore-style
|
|
192
|
+
* strings naming paths to keep out of the index even when git-tracked (#999). A
|
|
193
|
+
* non-array value or a non-string/blank entry warns-and-skips; never throws.
|
|
194
|
+
* Patterns are kept verbatim (trimmed) so they match exactly as a `.gitignore`
|
|
195
|
+
* line would, against project-root-relative paths.
|
|
196
|
+
*/
|
|
197
|
+
function extractExclude(parsed, file) {
|
|
198
|
+
const raw = parsed.exclude;
|
|
199
|
+
if (raw === undefined)
|
|
200
|
+
return [];
|
|
201
|
+
if (!Array.isArray(raw)) {
|
|
202
|
+
(0, errors_1.logWarn)(`Ignoring "exclude" in ${exports.PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file });
|
|
203
|
+
return [];
|
|
204
|
+
}
|
|
205
|
+
const out = [];
|
|
206
|
+
for (const entry of raw) {
|
|
207
|
+
if (typeof entry !== 'string' || !entry.trim()) {
|
|
208
|
+
(0, errors_1.logWarn)(`Ignoring an "exclude" entry in ${exports.PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file });
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
out.push(entry.trim());
|
|
212
|
+
}
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
186
215
|
/**
|
|
187
216
|
* Load the parsed `codegraph.json` for a project, mtime-cached. A missing or
|
|
188
217
|
* malformed file yields the zero-config default. One `stat` (and at most one
|
|
@@ -228,6 +257,17 @@ function loadExtensionOverrides(rootDir) {
|
|
|
228
257
|
function loadIncludeIgnoredPatterns(rootDir) {
|
|
229
258
|
return loadParsedConfig(rootDir).includeIgnored;
|
|
230
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Load the validated `exclude` patterns for a project, mtime-cached.
|
|
262
|
+
*
|
|
263
|
+
* These name paths to keep OUT of the index even when git-tracked — the escape
|
|
264
|
+
* hatch for a committed vendor/theme/SDK directory `.gitignore` can't drop
|
|
265
|
+
* (#999). An empty result — the zero-config default — excludes nothing beyond
|
|
266
|
+
* the built-in defaults and the project's `.gitignore`.
|
|
267
|
+
*/
|
|
268
|
+
function loadExcludePatterns(rootDir) {
|
|
269
|
+
return loadParsedConfig(rootDir).exclude;
|
|
270
|
+
}
|
|
231
271
|
/** Test/maintenance hook: forget cached config (e.g. after rewriting it in a test). */
|
|
232
272
|
function clearProjectConfigCache() {
|
|
233
273
|
cache.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../src/project-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../src/project-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyPA,wDAEC;AAUD,gEAEC;AAUD,kDAEC;AAGD,0DAEC;AAxRD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,uCAAyB;AACzB,2CAA6B;AAE7B,oDAA4D;AAC5D,qCAAmC;AAEnC,oFAAoF;AACvE,QAAA,uBAAuB,GAAG,gBAAgB,CAAC;AAsCxD;;;;;GAKG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;AAE5C,qEAAqE;AACrE,MAAM,gBAAgB,GAA6B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACrE,MAAM,YAAY,GAAiB,MAAM,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,gBAAgB;IAC5B,cAAc,EAAE,MAAM,CAAC,MAAM,CAA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C;IACjC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,sBAAsB,CAAC,OAAe;IACpD,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CAAC,OAAe;IACxD,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC;AAClD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IACjD,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AAC3C,CAAC;AAED,uFAAuF;AACvF,SAAgB,uBAAuB;IACrC,KAAK,CAAC,KAAK,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* C/C++ function-pointer dispatch synthesis (#932).
|
|
3
|
-
*
|
|
4
|
-
* C/C++ polymorphism is the function pointer: a struct carries a fn-pointer
|
|
5
|
-
* field (`int (*fn)(int)`, or a fn-pointer-typedef field `hook_func func`),
|
|
6
|
-
* concrete functions are *registered* into it through a table
|
|
7
|
-
* (`static struct cmd cmds[] = {{"add", cmd_add}, …}`, a designated
|
|
8
|
-
* `.fn = cmd_add`, or `x->fn = cmd_add`), and the dispatcher calls through it
|
|
9
|
-
* indirectly (`p->fn(argv)`). Static extraction captures neither the
|
|
10
|
-
* registration→field binding nor the indirect call, so the dispatcher→handler
|
|
11
|
-
* edge is missing and `git`'s `run_builtin` looks like it calls nothing, the
|
|
12
|
-
* hooks in `hook_demo.c` are unreachable, etc.
|
|
13
|
-
*
|
|
14
|
-
* This bridges it, keyed by **(struct type, fn-pointer field)**:
|
|
15
|
-
* • registrations — a function bound to `S.field` via a positional
|
|
16
|
-
* initializer (matched by field index), a designated `.field = fn`, or a
|
|
17
|
-
* direct `x.field = fn` / `x->field = fn` assignment;
|
|
18
|
-
* • dispatch — `recv->field(…)` / `recv.field(…)` where `recv` resolves to a
|
|
19
|
-
* value of struct type `S` (from the enclosing function's params / locals),
|
|
20
|
-
* falling back to the field name when it is unique to one struct;
|
|
21
|
-
* • field←field propagation — `a->f = b->g` merges `B.g`'s handlers into
|
|
22
|
-
* `A.f`, so a generic single-slot hook that is reassigned from a registry
|
|
23
|
-
* (the `hook_demo.c` shape: `h->func = found->fn`) still resolves.
|
|
24
|
-
*
|
|
25
|
-
* Whole-graph pass after base resolution; all edges are `provenance:'heuristic'`
|
|
26
|
-
* (`synthesizedBy:'fn-pointer-dispatch'`). High precision via the (type, field)
|
|
27
|
-
* key + a real-function gate; a project with no fn-pointer dispatch is a no-op.
|
|
28
|
-
*/
|
|
29
1
|
import type { Edge } from '../types';
|
|
30
2
|
import type { QueryBuilder } from '../db/queries';
|
|
31
3
|
import type { ResolutionContext } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c-fnptr-synthesizer.d.ts","sourceRoot":"","sources":["../../src/resolution/c-fnptr-synthesizer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"c-fnptr-synthesizer.d.ts","sourceRoot":"","sources":["../../src/resolution/c-fnptr-synthesizer.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA+PjD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,GAAG,IAAI,EAAE,CA4oB7F"}
|