gitnexus 1.6.2-rc.16 → 1.6.2-rc.17

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.
@@ -1,13 +1,11 @@
1
1
  import { KnowledgeGraph } from '../graph/types.js';
2
2
  import { ASTCache } from './ast-cache.js';
3
- import type { SymbolDefinition, SymbolTableReader } from './model/symbol-table.js';
3
+ import type { SymbolDefinition, SymbolTableReader, HeritageMap, ExtractedHeritage } from './model/index.js';
4
4
  import type { ResolutionContext } from './model/resolution-context.js';
5
5
  import type { TieredCandidates } from './model/resolution-context.js';
6
6
  import type { TypeEnvironment } from './type-env.js';
7
- import type { HeritageMap } from './model/heritage-map.js';
8
7
  import type { BindingAccumulator } from './binding-accumulator.js';
9
8
  import type { ExtractedCall, ExtractedAssignment, ExtractedRoute, ExtractedFetchCall, FileConstructorBindings } from './workers/parse-worker.js';
10
- import type { ExtractedHeritage } from './model/heritage-map.js';
11
9
  import type { LiteralTypeInferrer } from './type-extractors/types.js';
12
10
  import type { SyntaxNode } from './utils/ast-helpers.js';
13
11
  /** Per-file resolved type bindings for exported symbols.
@@ -1,4 +1,4 @@
1
- import { CLASS_TYPES, CALL_TARGET_TYPES } from './model/symbol-table.js';
1
+ import { CLASS_TYPES, CALL_TARGET_TYPES, lookupMethodByOwnerWithMRO } from './model/index.js';
2
2
  import Parser from 'tree-sitter';
3
3
  import { TIER_CONFIDENCE } from './model/resolution-context.js';
4
4
  import { isLanguageAvailable, loadParser, loadLanguage } from '../tree-sitter/parser-loader.js';
@@ -15,7 +15,6 @@ import { getTreeSitterBufferSize } from './constants.js';
15
15
  import { normalizeFetchURL, routeMatches } from './route-extractors/nextjs.js';
16
16
  import { extractTemplateComponents } from './vue-sfc-extractor.js';
17
17
  import { extractReturnTypeName, stripNullable } from './type-extractors/shared.js';
18
- import { lookupMethodByOwnerWithMRO } from './model/resolve.js';
19
18
  /**
20
19
  * Type labels treated as class-like **method-dispatch receivers** by the call
21
20
  * resolver — the set walked by the MRO / heritage path for member and static
@@ -1,5 +1,5 @@
1
1
  import type { TypeEnvironment } from './type-env.js';
2
- import type { SymbolTableReader } from './model/symbol-table.js';
2
+ import type { SymbolTableReader } from './model/index.js';
3
3
  import { SupportedLanguages } from '../../_shared/index.js';
4
4
  /**
5
5
  * Visibility levels used across all supported languages.
@@ -10,11 +10,11 @@
10
10
  * `SymbolTable` by design.
11
11
  */
12
12
  export { type SemanticModel, type MutableSemanticModel, createSemanticModel, } from './semantic-model.js';
13
- export { type SymbolTableReader, type SymbolTableWriter, createSymbolTable, } from './symbol-table.js';
13
+ export { type SymbolTableReader, type SymbolTableWriter, createSymbolTable, type SymbolDefinition, type AddMetadata, CLASS_TYPES, CLASS_TYPES_TUPLE, type ClassLikeLabel, FREE_CALLABLE_TYPES, FREE_CALLABLE_TUPLE, type FreeCallableLabel, CALL_TARGET_TYPES, } from './symbol-table.js';
14
14
  export { type TypeRegistry, type MutableTypeRegistry, createTypeRegistry, } from './type-registry.js';
15
15
  export { type MethodRegistry, type MutableMethodRegistry, createMethodRegistry, } from './method-registry.js';
16
16
  export { type FieldRegistry, type MutableFieldRegistry, createFieldRegistry, } from './field-registry.js';
17
17
  export { lookupMethodByOwnerWithMRO } from './resolve.js';
18
18
  export { type NamedImportBinding, type NamedImportMap, isFileInPackageDir, } from './resolution-context.js';
19
- export { type ExtractedHeritage, type HeritageResolutionStrategy, type HeritageStrategyLookup, } from './heritage-map.js';
19
+ export { type ExtractedHeritage, type HeritageMap, type HeritageResolutionStrategy, type HeritageStrategyLookup, } from './heritage-map.js';
20
20
  export { CALLABLE_ONLY_LABELS, INERT_LABELS, DISPATCH_LABELS, ALL_NODE_LABELS, type LabelBehavior, } from './registration-table.js';
@@ -16,7 +16,7 @@ export { createSemanticModel, } from './semantic-model.js';
16
16
  // SymbolTable is exclusively owned by SemanticModel. Re-exported here
17
17
  // for the rare caller that needs the file/callable interface in
18
18
  // isolation (e.g. tests).
19
- export { createSymbolTable, } from './symbol-table.js';
19
+ export { createSymbolTable, CLASS_TYPES, CLASS_TYPES_TUPLE, FREE_CALLABLE_TYPES, FREE_CALLABLE_TUPLE, CALL_TARGET_TYPES, } from './symbol-table.js';
20
20
  // Type registry (classes, structs, interfaces, enums, records, impls)
21
21
  export { createTypeRegistry, } from './type-registry.js';
22
22
  // Method registry (owner-scoped methods with arity-aware overload lookup)
@@ -12,6 +12,9 @@ import type { MroStrategy } from '../../../_shared/index.js';
12
12
  /**
13
13
  * Gather all ancestor IDs in BFS / topological order.
14
14
  * Returns the linearized list of ancestor IDs (excluding the class itself).
15
+ *
16
+ * Uses a head-pointer BFS (`queue[head++]`) instead of `Array.shift()` to
17
+ * avoid O(n) per-dequeue re-indexing — matching `buildParentMapFromHeritage`.
15
18
  */
16
19
  declare function gatherAncestors(classId: string, parentMap: Map<string, string[]>): string[];
17
20
  /**
@@ -15,13 +15,17 @@
15
15
  /**
16
16
  * Gather all ancestor IDs in BFS / topological order.
17
17
  * Returns the linearized list of ancestor IDs (excluding the class itself).
18
+ *
19
+ * Uses a head-pointer BFS (`queue[head++]`) instead of `Array.shift()` to
20
+ * avoid O(n) per-dequeue re-indexing — matching `buildParentMapFromHeritage`.
18
21
  */
19
22
  function gatherAncestors(classId, parentMap) {
20
23
  const visited = new Set();
21
24
  const order = [];
22
25
  const queue = [...(parentMap.get(classId) ?? [])];
23
- while (queue.length > 0) {
24
- const id = queue.shift();
26
+ let head = 0;
27
+ while (head < queue.length) {
28
+ const id = queue[head++];
25
29
  if (visited.has(id))
26
30
  continue;
27
31
  visited.add(id);
@@ -1,9 +1,8 @@
1
1
  import { KnowledgeGraph } from '../graph/types.js';
2
- import type { SymbolTableWriter } from './model/symbol-table.js';
2
+ import type { SymbolTableWriter, ExtractedHeritage } from './model/index.js';
3
3
  import { ASTCache } from './ast-cache.js';
4
4
  import { WorkerPool } from './workers/worker-pool.js';
5
5
  import type { ExtractedImport, ExtractedCall, ExtractedAssignment, ExtractedRoute, ExtractedFetchCall, ExtractedDecoratorRoute, ExtractedToolDef, FileConstructorBindings, FileScopeBindings, ExtractedORMQuery } from './workers/parse-worker.js';
6
- import type { ExtractedHeritage } from './model/heritage-map.js';
7
6
  export type FileProgressCallback = (current: number, total: number, filePath: string) => void;
8
7
  export interface WorkerExtractedData {
9
8
  imports: ExtractedImport[];
@@ -1,7 +1,7 @@
1
1
  import { type SyntaxNode } from './utils/ast-helpers.js';
2
2
  import { SupportedLanguages } from '../../_shared/index.js';
3
3
  import type { BindingAccumulator } from './binding-accumulator.js';
4
- import type { SemanticModel } from './model/semantic-model.js';
4
+ import type { SemanticModel } from './model/index.js';
5
5
  import type { NodeLabel } from '../../_shared/index.js';
6
6
  /**
7
7
  * Per-file type environment with receiver resolution.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.2-rc.16",
3
+ "version": "1.6.2-rc.17",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",