@colbymchenry/codegraph 1.1.2 → 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.
@@ -7,7 +7,7 @@ import { SqliteDatabase } from './sqlite-adapter';
7
7
  /**
8
8
  * Current schema version
9
9
  */
10
- export declare const CURRENT_SCHEMA_VERSION = 5;
10
+ export declare const CURRENT_SCHEMA_VERSION = 6;
11
11
  /**
12
12
  * Migration definition
13
13
  */
@@ -7,6 +7,22 @@ import type { LanguageExtractor } from '../tree-sitter-types';
7
7
  * template args. Returns undefined for primitives / void / `auto` / empty.
8
8
  */
9
9
  export declare function normalizeCppReturnType(raw: string): string | undefined;
10
+ /**
11
+ * Strip C++ template arguments from a base-type reference name so it matches the
12
+ * bare class/struct the template was DEFINED as. `template<typename T> class
13
+ * Base { … }` is indexed as a node named `Base`, but a derived class
14
+ * `class D : public Base<int>` records its base as the full `Base<int>` (and
15
+ * `class Q : public ns::Tpl<int>` as `ns::Tpl<int>`) — neither name-matches
16
+ * `Base` / `ns::Tpl`, so the `extends` edge never resolves and the derived class
17
+ * looks like it inherits from nothing (#1043).
18
+ *
19
+ * Removes every balanced `<…>` group regardless of nesting or position, so
20
+ * `Base<int>` → `Base`, `ns::Tpl<Foo<int>>` → `ns::Tpl`, and the rare
21
+ * `Outer<int>::Inner` → `Outer::Inner`. The remaining qualified head is exactly
22
+ * what the non-templated base case already produces, so resolution treats them
23
+ * identically. A name with no template args passes through unchanged.
24
+ */
25
+ export declare function stripCppTemplateArgs(name: string): string;
10
26
  export declare const cExtractor: LanguageExtractor;
11
27
  export declare const cppExtractor: LanguageExtractor;
12
28
  //# sourceMappingURL=c-cpp.d.ts.map
@@ -438,6 +438,27 @@ export declare class TreeSitterExtractor {
438
438
  * arguments (`new Foo(bar())`) get their own `calls` references.
439
439
  */
440
440
  private extractInstantiation;
441
+ /**
442
+ * Is this C++ `declaration` a stack/direct-initialization object construction
443
+ * that invokes a constructor — `Calculator calc(0)` (direct-init) or
444
+ * `Widget w{1, 2}` (brace-init) — as opposed to a plain variable or a
445
+ * function declaration? Used to emit an `instantiates` edge for the
446
+ * call-less construction syntax (#1035); heap `new T(...)` is handled
447
+ * separately by INSTANTIATION_KINDS.
448
+ *
449
+ * Two signals, both required:
450
+ * - the `type` field is a class-like NAMED type (`type_identifier`,
451
+ * `template_type`, or `qualified_identifier`). Primitives (`int x(0)`),
452
+ * `auto` (`placeholder_type_specifier` — that form always carries a real
453
+ * `call_expression`, already handled), and sized specifiers are excluded —
454
+ * they construct no class; and
455
+ * - a declarator carries constructor arguments: an `init_declarator` whose
456
+ * `value` is an `argument_list` (`(args)`) or `initializer_list` (`{args}`).
457
+ * This skips default construction `Calculator c;` (no value) and the
458
+ * most-vexing-parse `Calculator c();` (a bodyless `function_declarator`,
459
+ * a function decl — not a construction).
460
+ */
461
+ private isCppStackConstruction;
441
462
  /**
442
463
  * Static-member / value-read pass. A type/enum/class used only via a member
443
464
  * VALUE — `Enum.value`, `Type.CONST`, `Colors.red`, `Foo::BAR` — recorded no
@@ -41,6 +41,16 @@
41
41
  */
42
42
  import * as net from 'net';
43
43
  import { DaemonLockInfo } from './daemon-paths';
44
+ /**
45
+ * Finalize daemon shutdown. On POSIX, exit immediately — it's clean and fast.
46
+ * On Windows, do NOT force an exit while watchers may still be closing (that
47
+ * trips the libuv assertion above); instead mark success and let the loop drain
48
+ * to a natural exit, with an UNREF'd backstop that force-exits only if a stray
49
+ * handle would otherwise hang shutdown. Pure and platform-injected so both
50
+ * branches are unit-testable off-Windows. Returns the backstop timer (Windows)
51
+ * so callers/tests can clear it.
52
+ */
53
+ export declare function finalizeDaemonExit(platform: NodeJS.Platform, exit: (code: number) => void): NodeJS.Timeout | null;
44
54
  /** Bytes/parse-window for an oversized hello line — bounded against a malicious peer. */
45
55
  declare const MAX_HELLO_LINE_BYTES = 4096;
46
56
  /**
@@ -25,6 +25,15 @@
25
25
  * is exactly the distinction this module relies on.
26
26
  */
27
27
  export declare function gitWorktreeRoot(dir: string): string | null;
28
+ /**
29
+ * Absolute, symlink-resolved git **common** directory for `dir` — the shared
30
+ * `.git` that all worktrees of one repository point at. Linked worktrees of the
31
+ * same repo report the SAME common dir; a submodule or an embedded clone is a
32
+ * DIFFERENT repository and reports its own (`…/.git/modules/<name>` or its own
33
+ * `.git`). That distinction is what separates a genuine "borrowed worktree"
34
+ * from a nested repo the parent index already covers. Null when not a repo.
35
+ */
36
+ export declare function gitCommonDir(dir: string): string | null;
28
37
  export interface WorktreeIndexMismatch {
29
38
  /** The git working tree the command was run from. */
30
39
  worktreeRoot: string;
package/dist/types.d.ts CHANGED
@@ -235,7 +235,12 @@ export interface SearchOptions {
235
235
  export interface SearchResult {
236
236
  /** Matching node */
237
237
  node: Node;
238
- /** Relevance score (0-1) */
238
+ /**
239
+ * Relevance score for relative ranking only — higher is more relevant.
240
+ * NOT normalized and NOT a 0-1 fraction: the FTS path returns an unbounded
241
+ * BM25 magnitude (often in the tens or hundreds), while the fuzzy/exact
242
+ * paths return ~0-1. Use it to order results, not as an absolute percentage.
243
+ */
239
244
  score: number;
240
245
  /** Matched text snippets for highlighting */
241
246
  highlights?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colbymchenry/codegraph",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Local-first code intelligence for AI agents (MCP). Self-contained — bundles its own runtime.",
5
5
  "bin": {
6
6
  "codegraph": "npm-shim.js"
@@ -15,12 +15,12 @@
15
15
  "./package.json": "./package.json"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@colbymchenry/codegraph-darwin-arm64": "1.1.2",
19
- "@colbymchenry/codegraph-darwin-x64": "1.1.2",
20
- "@colbymchenry/codegraph-linux-arm64": "1.1.2",
21
- "@colbymchenry/codegraph-linux-x64": "1.1.2",
22
- "@colbymchenry/codegraph-win32-arm64": "1.1.2",
23
- "@colbymchenry/codegraph-win32-x64": "1.1.2"
18
+ "@colbymchenry/codegraph-darwin-arm64": "1.1.3",
19
+ "@colbymchenry/codegraph-darwin-x64": "1.1.3",
20
+ "@colbymchenry/codegraph-linux-arm64": "1.1.3",
21
+ "@colbymchenry/codegraph-linux-x64": "1.1.3",
22
+ "@colbymchenry/codegraph-win32-arm64": "1.1.3",
23
+ "@colbymchenry/codegraph-win32-x64": "1.1.3"
24
24
  },
25
25
  "files": [
26
26
  "npm-shim.js",