gitnexus 1.5.0 → 1.5.2
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/dist/_shared/graph/types.d.ts +65 -0
- package/dist/_shared/graph/types.d.ts.map +1 -0
- package/dist/_shared/graph/types.js +8 -0
- package/dist/_shared/graph/types.js.map +1 -0
- package/dist/_shared/index.d.ts +7 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +6 -0
- package/dist/_shared/index.js.map +1 -0
- package/dist/_shared/language-detection.d.ts +23 -0
- package/dist/_shared/language-detection.d.ts.map +1 -0
- package/dist/_shared/language-detection.js +137 -0
- package/dist/_shared/language-detection.js.map +1 -0
- package/dist/_shared/languages.d.ts +25 -0
- package/dist/_shared/languages.d.ts.map +1 -0
- package/dist/_shared/languages.js +26 -0
- package/dist/_shared/languages.js.map +1 -0
- package/dist/_shared/lbug/schema-constants.d.ts +16 -0
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -0
- package/dist/_shared/lbug/schema-constants.js +64 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -0
- package/dist/_shared/pipeline.d.ts +16 -0
- package/dist/_shared/pipeline.d.ts.map +1 -0
- package/dist/_shared/pipeline.js +5 -0
- package/dist/_shared/pipeline.js.map +1 -0
- package/dist/config/supported-languages.d.ts +1 -1
- package/dist/config/supported-languages.js +1 -1
- package/dist/core/graph/types.d.ts +2 -2
- package/dist/core/ingestion/call-processor.js +1 -1
- package/dist/core/ingestion/cobol-processor.js +1 -1
- package/dist/core/ingestion/entry-point-scoring.d.ts +1 -1
- package/dist/core/ingestion/entry-point-scoring.js +1 -1
- package/dist/core/ingestion/field-extractor.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/configs/c-cpp.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/csharp.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/dart.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/go.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/jvm.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/php.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/python.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/ruby.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/rust.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/swift.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +1 -1
- package/dist/core/ingestion/field-extractors/generic.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/typescript.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/typescript.js +1 -1
- package/dist/core/ingestion/field-types.d.ts +1 -1
- package/dist/core/ingestion/framework-detection.d.ts +1 -1
- package/dist/core/ingestion/framework-detection.js +1 -1
- package/dist/core/ingestion/heritage-processor.d.ts +1 -1
- package/dist/core/ingestion/heritage-processor.js +1 -1
- package/dist/core/ingestion/import-processor.js +1 -1
- package/dist/core/ingestion/import-resolvers/csharp.js +1 -1
- package/dist/core/ingestion/import-resolvers/dart.js +1 -1
- package/dist/core/ingestion/import-resolvers/go.js +1 -1
- package/dist/core/ingestion/import-resolvers/jvm.js +1 -1
- package/dist/core/ingestion/import-resolvers/python.js +1 -1
- package/dist/core/ingestion/import-resolvers/rust.js +1 -1
- package/dist/core/ingestion/import-resolvers/standard.d.ts +1 -1
- package/dist/core/ingestion/import-resolvers/standard.js +1 -1
- package/dist/core/ingestion/language-provider.d.ts +2 -2
- package/dist/core/ingestion/languages/c-cpp.js +1 -1
- package/dist/core/ingestion/languages/cobol.js +1 -1
- package/dist/core/ingestion/languages/csharp.js +1 -1
- package/dist/core/ingestion/languages/dart.js +1 -1
- package/dist/core/ingestion/languages/go.js +1 -1
- package/dist/core/ingestion/languages/index.d.ts +1 -1
- package/dist/core/ingestion/languages/index.js +1 -1
- package/dist/core/ingestion/languages/java.js +1 -1
- package/dist/core/ingestion/languages/kotlin.js +1 -1
- package/dist/core/ingestion/languages/php.js +1 -1
- package/dist/core/ingestion/languages/python.js +1 -1
- package/dist/core/ingestion/languages/ruby.js +1 -1
- package/dist/core/ingestion/languages/rust.js +1 -1
- package/dist/core/ingestion/languages/swift.js +1 -1
- package/dist/core/ingestion/languages/typescript.js +1 -1
- package/dist/core/ingestion/method-extractors/configs/csharp.js +1 -1
- package/dist/core/ingestion/method-extractors/configs/jvm.js +1 -1
- package/dist/core/ingestion/method-types.d.ts +1 -1
- package/dist/core/ingestion/mro-processor.d.ts +1 -1
- package/dist/core/ingestion/parsing-processor.js +1 -1
- package/dist/core/ingestion/pipeline.d.ts +1 -1
- package/dist/core/ingestion/pipeline.js +1 -1
- package/dist/core/ingestion/process-processor.js +1 -1
- package/dist/core/ingestion/symbol-table.d.ts +1 -1
- package/dist/core/ingestion/tree-sitter-queries.d.ts +1 -1
- package/dist/core/ingestion/tree-sitter-queries.js +1 -1
- package/dist/core/ingestion/type-env.d.ts +2 -2
- package/dist/core/ingestion/utils/ast-helpers.d.ts +1 -1
- package/dist/core/ingestion/workers/parse-worker.d.ts +2 -2
- package/dist/core/ingestion/workers/parse-worker.js +2 -2
- package/dist/core/lbug/schema.d.ts +2 -2
- package/dist/core/lbug/schema.js +1 -1
- package/dist/core/tree-sitter/parser-loader.d.ts +1 -1
- package/dist/core/tree-sitter/parser-loader.js +1 -1
- package/dist/server/api.js +1 -1
- package/package.json +5 -5
- package/scripts/build.js +73 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// gitnexus/src/core/ingestion/field-extractors/configs/typescript-javascript.ts
|
|
2
|
-
import { SupportedLanguages } from '
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
3
|
import { hasKeyword, findVisibility, typeFromAnnotation } from './helpers.js';
|
|
4
4
|
const VISIBILITY_KEYWORDS = new Set(['public', 'private', 'protected']);
|
|
5
5
|
const shared = {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* BaseFieldExtractor whose behaviour is entirely driven by FieldExtractionConfig.
|
|
7
7
|
*/
|
|
8
8
|
import type { SyntaxNode } from '../utils/ast-helpers.js';
|
|
9
|
-
import { SupportedLanguages } from '
|
|
9
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import type { FieldExtractor } from '../field-extractor.js';
|
|
11
11
|
import type { FieldExtractorContext, FieldInfo, FieldVisibility } from '../field-types.js';
|
|
12
12
|
export interface FieldExtractionConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SyntaxNode } from '../utils/ast-helpers.js';
|
|
2
|
-
import { SupportedLanguages } from '
|
|
2
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
3
3
|
import { BaseFieldExtractor } from '../field-extractor.js';
|
|
4
4
|
import type { FieldExtractorContext, ExtractedFields, FieldVisibility } from '../field-types.js';
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// gitnexus/src/core/ingestion/field-extractors/typescript.ts
|
|
2
|
-
import { SupportedLanguages } from '
|
|
2
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
3
3
|
import { BaseFieldExtractor } from '../field-extractor.js';
|
|
4
4
|
/**
|
|
5
5
|
* Hand-written TypeScript field extractor.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TypeEnvironment } from './type-env.js';
|
|
2
2
|
import type { SymbolTable } from './symbol-table.js';
|
|
3
|
-
import { SupportedLanguages } from '
|
|
3
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Visibility levels used across all supported languages.
|
|
6
6
|
* - public / private / protected: universal modifiers
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* DESIGN: Returns null for unknown frameworks, which causes a 1.0 multiplier
|
|
10
10
|
* (no bonus, no penalty) - same behavior as before this feature.
|
|
11
11
|
*/
|
|
12
|
-
import { SupportedLanguages } from '
|
|
12
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
13
13
|
export interface FrameworkHint {
|
|
14
14
|
framework: string;
|
|
15
15
|
entryPointMultiplier: number;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* DESIGN: Returns null for unknown frameworks, which causes a 1.0 multiplier
|
|
10
10
|
* (no bonus, no penalty) - same behavior as before this feature.
|
|
11
11
|
*/
|
|
12
|
-
import { SupportedLanguages } from '
|
|
12
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
13
13
|
// ============================================================================
|
|
14
14
|
// PATH-BASED FRAMEWORK DETECTION
|
|
15
15
|
// ============================================================================
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { KnowledgeGraph } from '../graph/types.js';
|
|
17
17
|
import { ASTCache } from './ast-cache.js';
|
|
18
|
-
import { SupportedLanguages } from '
|
|
18
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
19
19
|
import type { ExtractedHeritage } from './workers/parse-worker.js';
|
|
20
20
|
import type { ResolutionContext } from './resolution-context.js';
|
|
21
21
|
/**
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import Parser from 'tree-sitter';
|
|
17
17
|
import { isLanguageAvailable, loadParser, loadLanguage } from '../tree-sitter/parser-loader.js';
|
|
18
18
|
import { generateId } from '../../lib/utils.js';
|
|
19
|
-
import { getLanguageFromFilename } from '
|
|
19
|
+
import { getLanguageFromFilename } from '../../_shared/index.js';
|
|
20
20
|
import { isVerboseIngestionEnabled } from './utils/verbose.js';
|
|
21
21
|
import { yieldToEventLoop } from './utils/event-loop.js';
|
|
22
22
|
import { getProvider } from './languages/index.js';
|
|
@@ -2,7 +2,7 @@ import Parser from 'tree-sitter';
|
|
|
2
2
|
import { isLanguageAvailable, loadParser, loadLanguage } from '../tree-sitter/parser-loader.js';
|
|
3
3
|
import { getProvider, getProviderForFile, providersWithImplicitWiring } from './languages/index.js';
|
|
4
4
|
import { generateId } from '../../lib/utils.js';
|
|
5
|
-
import { getLanguageFromFilename } from '
|
|
5
|
+
import { getLanguageFromFilename } from '../../_shared/index.js';
|
|
6
6
|
import { isVerboseIngestionEnabled } from './utils/verbose.js';
|
|
7
7
|
import { yieldToEventLoop } from './utils/event-loop.js';
|
|
8
8
|
import { getTreeSitterBufferSize } from './constants.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Handles using-directive resolution via .csproj root namespace stripping.
|
|
4
4
|
*/
|
|
5
5
|
import { suffixResolve } from './utils.js';
|
|
6
|
-
import { SupportedLanguages } from '
|
|
6
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
7
7
|
import { resolveStandard } from './standard.js';
|
|
8
8
|
/**
|
|
9
9
|
* Resolve a C# using-directive import path to matching .cs files (low-level helper).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SDK imports (dart:*) and external packages are skipped.
|
|
5
5
|
*/
|
|
6
6
|
import { resolveStandard } from './standard.js';
|
|
7
|
-
import { SupportedLanguages } from '
|
|
7
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
8
8
|
export function resolveDartImport(rawImportPath, filePath, ctx) {
|
|
9
9
|
// Strip surrounding quotes from configurable_uri capture
|
|
10
10
|
const stripped = rawImportPath.replace(/^['"]|['"]$/g, '');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Go package import resolution.
|
|
3
3
|
* Handles Go module path-based package imports.
|
|
4
4
|
*/
|
|
5
|
-
import { SupportedLanguages } from '
|
|
5
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
6
6
|
import { resolveStandard } from './standard.js';
|
|
7
7
|
/**
|
|
8
8
|
* Extract the package directory suffix from a Go import path.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* JVM import resolution (Java + Kotlin).
|
|
3
3
|
* Handles wildcard imports, member/static imports, and Kotlin-specific patterns.
|
|
4
4
|
*/
|
|
5
|
-
import { SupportedLanguages } from '
|
|
5
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
6
6
|
import { resolveStandard } from './standard.js';
|
|
7
7
|
/** Kotlin file extensions for JVM resolver reuse */
|
|
8
8
|
export const KOTLIN_EXTENSIONS = ['.kt', '.kts'];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Import system spec: PEP 302 (original), PEP 451 (current).
|
|
4
4
|
*/
|
|
5
5
|
import { tryResolveWithExtensions } from './utils.js';
|
|
6
|
-
import { SupportedLanguages } from '
|
|
6
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
7
7
|
import { resolveStandard } from './standard.js';
|
|
8
8
|
/**
|
|
9
9
|
* Resolve a Python import to a file path (low-level helper).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Rust module import resolution.
|
|
3
3
|
* Handles crate::, super::, self:: prefix paths and :: separators.
|
|
4
4
|
*/
|
|
5
|
-
import { SupportedLanguages } from '
|
|
5
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
6
6
|
import { resolveStandard } from './standard.js';
|
|
7
7
|
/**
|
|
8
8
|
* Resolve Rust use-path to a file (low-level helper).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Used as the fallback when language-specific resolvers don't match.
|
|
5
5
|
*/
|
|
6
6
|
import type { SuffixIndex } from './utils.js';
|
|
7
|
-
import { SupportedLanguages } from '
|
|
7
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
8
8
|
import type { ImportResult, ImportResolverFn, ResolveCtx } from './types.js';
|
|
9
9
|
import type { TsconfigPaths } from '../language-config.js';
|
|
10
10
|
/** Max entries in the resolve cache. Beyond this, entries are evicted.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { tryResolveWithExtensions, suffixResolve } from './utils.js';
|
|
7
7
|
import { resolveRustImportInternal } from './rust.js';
|
|
8
|
-
import { SupportedLanguages } from '
|
|
8
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
9
9
|
/** Max entries in the resolve cache. Beyond this, entries are evicted.
|
|
10
10
|
* 100K entries ≈ 15MB — covers the most common import patterns. */
|
|
11
11
|
export const RESOLVE_CACHE_CAP = 100_000;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* The providers table in `languages/index.ts` uses `satisfies Record<SupportedLanguages, LanguageProvider>`
|
|
9
9
|
* so adding a language to the enum without creating a provider is a compiler error.
|
|
10
10
|
*/
|
|
11
|
-
import type { SupportedLanguages } from '
|
|
11
|
+
import type { SupportedLanguages } from '../../_shared/index.js';
|
|
12
12
|
import type { LanguageTypeConfig } from './type-extractors/types.js';
|
|
13
13
|
import type { CallRouter } from './call-routing.js';
|
|
14
14
|
import type { ExportChecker } from './export-detection.js';
|
|
@@ -17,7 +17,7 @@ import type { MethodExtractor } from './method-types.js';
|
|
|
17
17
|
import type { ImportResolverFn } from './import-resolvers/types.js';
|
|
18
18
|
import type { NamedBindingExtractorFn } from './named-bindings/types.js';
|
|
19
19
|
import type { SyntaxNode } from './utils/ast-helpers.js';
|
|
20
|
-
import type { NodeLabel } from '
|
|
20
|
+
import type { NodeLabel } from '../../_shared/index.js';
|
|
21
21
|
/** Tree-sitter query captures: capture name → AST node (or undefined if not captured). */
|
|
22
22
|
export type CaptureMap = Record<string, SyntaxNode | undefined>;
|
|
23
23
|
/** MRO strategy for multiple inheritance resolution. */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* C uses 'first-wins' MRO (no inheritance). C++ uses 'leftmost-base' MRO
|
|
8
8
|
* for its left-to-right multiple inheritance resolution order.
|
|
9
9
|
*/
|
|
10
|
-
import { SupportedLanguages } from '
|
|
10
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
11
11
|
import { defineLanguage } from '../language-provider.js';
|
|
12
12
|
import { typeConfig as cCppConfig } from '../type-extractors/c-cpp.js';
|
|
13
13
|
import { cCppExportChecker } from '../export-detection.js';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* This provider exists to satisfy the SupportedLanguages exhaustiveness
|
|
10
10
|
* checks and to declare parseStrategy: 'standalone'.
|
|
11
11
|
*/
|
|
12
|
-
import { SupportedLanguages } from '
|
|
12
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
13
13
|
import { defineLanguage } from '../language-provider.js';
|
|
14
14
|
export const cobolProvider = defineLanguage({
|
|
15
15
|
id: SupportedLanguages.Cobol,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* and an implements-split MRO strategy for multiple interface implementation.
|
|
6
6
|
* Interface names follow the I-prefix convention (e.g., IDisposable).
|
|
7
7
|
*/
|
|
8
|
-
import { SupportedLanguages } from '
|
|
8
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
9
9
|
import { defineLanguage } from '../language-provider.js';
|
|
10
10
|
import { typeConfig as csharpConfig } from '../type-extractors/csharp.js';
|
|
11
11
|
import { csharpExportChecker } from '../export-detection.js';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* The hook resolves the enclosing function by inspecting the previous sibling.
|
|
11
11
|
*/
|
|
12
12
|
import { FUNCTION_NODE_TYPES, extractFunctionName } from '../utils/ast-helpers.js';
|
|
13
|
-
import { SupportedLanguages } from '
|
|
13
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
14
14
|
import { defineLanguage } from '../language-provider.js';
|
|
15
15
|
import { typeConfig as dartConfig } from '../type-extractors/dart.js';
|
|
16
16
|
import { dartExportChecker } from '../export-detection.js';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - importSemantics: 'wildcard' (Go imports entire packages)
|
|
9
9
|
* - callRouter: present (Go method calls may need routing)
|
|
10
10
|
*/
|
|
11
|
-
import { SupportedLanguages } from '
|
|
11
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
12
12
|
import { defineLanguage } from '../language-provider.js';
|
|
13
13
|
import { typeConfig as goConfig } from '../type-extractors/go.js';
|
|
14
14
|
import { goExportChecker } from '../export-detection.js';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 3. Add one line to the `providers` table below
|
|
8
8
|
* 4. Run `tsc --noEmit` to verify
|
|
9
9
|
*/
|
|
10
|
-
import { SupportedLanguages } from '
|
|
10
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
11
11
|
import type { LanguageProvider } from '../language-provider.js';
|
|
12
12
|
export declare const providers: {
|
|
13
13
|
javascript: LanguageProvider;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 3. Add one line to the `providers` table below
|
|
8
8
|
* 4. Run `tsc --noEmit` to verify
|
|
9
9
|
*/
|
|
10
|
-
import { SupportedLanguages } from '
|
|
10
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
11
11
|
import { typescriptProvider, javascriptProvider } from './typescript.js';
|
|
12
12
|
import { pythonProvider } from './python.js';
|
|
13
13
|
import { javaProvider } from './java.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* EXTENDS by default with implements-split MRO for multiple
|
|
7
7
|
* interface implementation.
|
|
8
8
|
*/
|
|
9
|
-
import { SupportedLanguages } from '
|
|
9
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { defineLanguage } from '../language-provider.js';
|
|
11
11
|
import { javaTypeConfig } from '../type-extractors/jvm.js';
|
|
12
12
|
import { javaExportChecker } from '../export-detection.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Heritage uses EXTENDS by default with implements-split MRO for
|
|
7
7
|
* multiple interface implementation.
|
|
8
8
|
*/
|
|
9
|
-
import { SupportedLanguages } from '
|
|
9
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { defineLanguage } from '../language-provider.js';
|
|
11
11
|
import { kotlinTypeConfig } from '../type-extractors/jvm.js';
|
|
12
12
|
import { kotlinExportChecker } from '../export-detection.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* and standard export/import resolution. PHP files can use a variety of
|
|
6
6
|
* extensions from legacy versions through modern PHP 8.
|
|
7
7
|
*/
|
|
8
|
-
import { SupportedLanguages } from '
|
|
8
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
9
9
|
import { defineLanguage } from '../language-provider.js';
|
|
10
10
|
import { typeConfig as phpConfig } from '../type-extractors/php.js';
|
|
11
11
|
import { phpExportChecker } from '../export-detection.js';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - mroStrategy: 'c3' (Python C3 linearization for multiple inheritance)
|
|
10
10
|
* - namedBindingExtractor: present (from X import Y)
|
|
11
11
|
*/
|
|
12
|
-
import { SupportedLanguages } from '
|
|
12
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
13
13
|
import { defineLanguage } from '../language-provider.js';
|
|
14
14
|
import { typeConfig as pythonConfig } from '../type-extractors/python.js';
|
|
15
15
|
import { pythonExportChecker } from '../export-detection.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* to handle require, include/extend (heritage), and attr_accessor/
|
|
7
7
|
* attr_reader/attr_writer (property definitions) as call expressions.
|
|
8
8
|
*/
|
|
9
|
-
import { SupportedLanguages } from '
|
|
9
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { defineLanguage } from '../language-provider.js';
|
|
11
11
|
import { typeConfig as rubyConfig } from '../type-extractors/ruby.js';
|
|
12
12
|
import { routeRubyCall } from '../call-routing.js';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - mroStrategy: 'qualified-syntax' (Rust uses trait qualification, not MRO)
|
|
10
10
|
* - namedBindingExtractor: present (use X::{a, b} extracts named bindings)
|
|
11
11
|
*/
|
|
12
|
-
import { SupportedLanguages } from '
|
|
12
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
13
13
|
import { defineLanguage } from '../language-provider.js';
|
|
14
14
|
import { typeConfig as rustConfig } from '../type-extractors/rust.js';
|
|
15
15
|
import { rustExportChecker } from '../export-detection.js';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - heritageDefaultEdge: 'IMPLEMENTS' (protocols are more common than class inheritance)
|
|
10
10
|
* - implicitImportWirer: all files in the same SPM target see each other
|
|
11
11
|
*/
|
|
12
|
-
import { SupportedLanguages } from '
|
|
12
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
13
13
|
import { defineLanguage } from '../language-provider.js';
|
|
14
14
|
import { typeConfig as swiftConfig } from '../type-extractors/swift.js';
|
|
15
15
|
import { swiftExportChecker } from '../export-detection.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* (extractTsNamedBindings). They differ in file extensions, tree-sitter
|
|
7
7
|
* queries (TypeScript grammar has interface/type nodes), and language ID.
|
|
8
8
|
*/
|
|
9
|
-
import { SupportedLanguages } from '
|
|
9
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
10
10
|
import { defineLanguage } from '../language-provider.js';
|
|
11
11
|
import { typeConfig as typescriptConfig } from '../type-extractors/typescript.js';
|
|
12
12
|
import { tsExportChecker } from '../export-detection.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// gitnexus/src/core/ingestion/method-extractors/configs/csharp.ts
|
|
2
|
-
import { SupportedLanguages } from '
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
3
|
import { findVisibility, hasModifier, hasKeyword, collectModifierTexts, } from '../../field-extractors/configs/helpers.js';
|
|
4
4
|
import { extractSimpleTypeName } from '../../type-extractors/shared.js';
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// gitnexus/src/core/ingestion/method-extractors/configs/jvm.ts
|
|
2
|
-
import { SupportedLanguages } from '
|
|
2
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
3
|
import { findVisibility, hasModifier } from '../../field-extractors/configs/helpers.js';
|
|
4
4
|
import { extractSimpleTypeName } from '../../type-extractors/shared.js';
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SupportedLanguages } from '
|
|
1
|
+
import type { SupportedLanguages } from '../../_shared/index.js';
|
|
2
2
|
import type { FieldVisibility } from './field-types.js';
|
|
3
3
|
import type { SyntaxNode } from './utils/ast-helpers.js';
|
|
4
4
|
export type MethodVisibility = FieldVisibility;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Cypher: MATCH (c:Class)-[r:CodeRelation {type: 'OVERRIDES'}]->(m:Method)
|
|
20
20
|
*/
|
|
21
21
|
import { KnowledgeGraph } from '../graph/types.js';
|
|
22
|
-
import { SupportedLanguages } from '
|
|
22
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
23
23
|
export interface MROEntry {
|
|
24
24
|
classId: string;
|
|
25
25
|
className: string;
|
|
@@ -2,7 +2,7 @@ import Parser from 'tree-sitter';
|
|
|
2
2
|
import { loadParser, loadLanguage, isLanguageAvailable } from '../tree-sitter/parser-loader.js';
|
|
3
3
|
import { getProvider } from './languages/index.js';
|
|
4
4
|
import { generateId } from '../../lib/utils.js';
|
|
5
|
-
import { getLanguageFromFilename } from '
|
|
5
|
+
import { getLanguageFromFilename } from '../../_shared/index.js';
|
|
6
6
|
import { yieldToEventLoop } from './utils/event-loop.js';
|
|
7
7
|
import { getDefinitionNodeFromCaptures, findEnclosingClassId, extractMethodSignature, getLabelFromCaptures, CLASS_CONTAINER_TYPES, } from './utils/ast-helpers.js';
|
|
8
8
|
import { detectFrameworkFromAST } from './framework-detection.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PipelineProgress } from '
|
|
1
|
+
import { type PipelineProgress } from '../../_shared/index.js';
|
|
2
2
|
import { PipelineResult } from '../../types/pipeline.js';
|
|
3
3
|
/** A group of files with no mutual dependencies, safe to process in parallel. */
|
|
4
4
|
type IndependentFileGroup = readonly string[];
|
|
@@ -18,7 +18,7 @@ import { processCommunities } from './community-processor.js';
|
|
|
18
18
|
import { processProcesses } from './process-processor.js';
|
|
19
19
|
import { createResolutionContext } from './resolution-context.js';
|
|
20
20
|
import { createASTCache } from './ast-cache.js';
|
|
21
|
-
import { getLanguageFromFilename } from '
|
|
21
|
+
import { getLanguageFromFilename } from '../../_shared/index.js';
|
|
22
22
|
import { walkRepositoryPaths, readFileContents } from './filesystem-walker.js';
|
|
23
23
|
import { isLanguageAvailable } from '../tree-sitter/parser-loader.js';
|
|
24
24
|
import { providers, getProviderForFile } from './languages/index.js';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Processes help agents understand how features work through the codebase.
|
|
11
11
|
*/
|
|
12
12
|
import { calculateEntryPointScore, isTestFile } from './entry-point-scoring.js';
|
|
13
|
-
import { SupportedLanguages } from '
|
|
13
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
14
14
|
const isDev = process.env.NODE_ENV === 'development';
|
|
15
15
|
const DEFAULT_CONFIG = {
|
|
16
16
|
maxTraceDepth: 10,
|
|
@@ -12,5 +12,5 @@ export declare const RUBY_QUERIES = "\n; \u2500\u2500 Modules \u2500\u2500\u2500
|
|
|
12
12
|
export declare const KOTLIN_QUERIES = "\n; \u2500\u2500 Interfaces \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n; tree-sitter-kotlin (fwcd) has no interface_declaration node type.\n; Interfaces are class_declaration nodes with an anonymous \"interface\" keyword child.\n(class_declaration\n \"interface\"\n (type_identifier) @name) @definition.interface\n\n; \u2500\u2500 Classes (regular, data, sealed, enum) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n; All have the anonymous \"class\" keyword child. enum class has both\n; \"enum\" and \"class\" children \u2014 the \"class\" child still matches.\n(class_declaration\n \"class\"\n (type_identifier) @name) @definition.class\n\n; \u2500\u2500 Object declarations (Kotlin singletons) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(object_declaration\n (type_identifier) @name) @definition.class\n\n; \u2500\u2500 Companion objects (named only) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(companion_object\n (type_identifier) @name) @definition.class\n\n; \u2500\u2500 Functions (top-level, member, extension) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(function_declaration\n (simple_identifier) @name) @definition.function\n\n; \u2500\u2500 Properties \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(property_declaration\n (variable_declaration\n (simple_identifier) @name)) @definition.property\n\n; Primary constructor val/var parameters (data class, value class, regular class)\n; binding_pattern_kind contains \"val\" or \"var\" \u2014 without it, the param is not a property\n(class_parameter\n (binding_pattern_kind)\n (simple_identifier) @name) @definition.property\n\n; \u2500\u2500 Enum entries \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(enum_entry\n (simple_identifier) @name) @definition.enum\n\n; \u2500\u2500 Type aliases \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(type_alias\n (type_identifier) @name) @definition.type\n\n; \u2500\u2500 Imports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(import_header\n (identifier) @import.source) @import\n\n; \u2500\u2500 Function calls (direct) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(call_expression\n (simple_identifier) @call.name) @call\n\n; \u2500\u2500 Method calls (via navigation: obj.method()) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(call_expression\n (navigation_expression\n (navigation_suffix\n (simple_identifier) @call.name))) @call\n\n; \u2500\u2500 Constructor invocations \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(constructor_invocation\n (user_type\n (type_identifier) @call.name)) @call\n\n; \u2500\u2500 Infix function calls (e.g., a to b, x until y) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(infix_expression\n (simple_identifier) @call.name) @call\n\n; \u2500\u2500 Heritage: extends / implements via delegation_specifier \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n; Interface implementation (bare user_type): class Foo : Bar\n(class_declaration\n (type_identifier) @heritage.class\n (delegation_specifier\n (user_type (type_identifier) @heritage.extends))) @heritage\n\n; Class extension (constructor_invocation): class Foo : Bar()\n(class_declaration\n (type_identifier) @heritage.class\n (delegation_specifier\n (constructor_invocation\n (user_type (type_identifier) @heritage.extends)))) @heritage\n\n; Write access: obj.field = value\n(assignment\n (directly_assignable_expression\n (_) @assignment.receiver\n (navigation_suffix\n (simple_identifier) @assignment.property))\n (_)) @assignment\n\n";
|
|
13
13
|
export declare const SWIFT_QUERIES = "\n; Classes\n(class_declaration \"class\" name: (type_identifier) @name) @definition.class\n\n; Structs\n(class_declaration \"struct\" name: (type_identifier) @name) @definition.struct\n\n; Enums\n(class_declaration \"enum\" name: (type_identifier) @name) @definition.enum\n\n; Extensions (mapped to class \u2014 no dedicated label in schema)\n(class_declaration \"extension\" name: (user_type (type_identifier) @name)) @definition.class\n\n; Actors\n(class_declaration \"actor\" name: (type_identifier) @name) @definition.class\n\n; Protocols (mapped to interface)\n(protocol_declaration name: (type_identifier) @name) @definition.interface\n\n; Type aliases\n(typealias_declaration name: (type_identifier) @name) @definition.type\n\n; Functions (top-level and methods)\n(function_declaration name: (simple_identifier) @name) @definition.function\n\n; Protocol method declarations\n(protocol_function_declaration name: (simple_identifier) @name) @definition.method\n\n; Initializers\n(init_declaration) @definition.constructor\n\n; Properties (stored and computed)\n(property_declaration (pattern (simple_identifier) @name)) @definition.property\n\n; Enum cases\n(enum_entry (simple_identifier) @name) @definition.property\n\n; Imports\n(import_declaration (identifier (simple_identifier) @import.source)) @import\n\n; Calls - direct function calls\n(call_expression (simple_identifier) @call.name) @call\n\n; Calls - member/navigation calls (obj.method())\n(call_expression (navigation_expression (navigation_suffix (simple_identifier) @call.name))) @call\n\n; Heritage - class/struct/enum inheritance and protocol conformance\n(class_declaration name: (type_identifier) @heritage.class\n (inheritance_specifier inherits_from: (user_type (type_identifier) @heritage.extends))) @heritage\n\n; Heritage - protocol inheritance\n(protocol_declaration name: (type_identifier) @heritage.class\n (inheritance_specifier inherits_from: (user_type (type_identifier) @heritage.extends))) @heritage\n\n; Heritage - extension protocol conformance (e.g. extension Foo: SomeProtocol)\n; Extensions wrap the name in user_type unlike class/struct/enum declarations\n(class_declaration \"extension\" name: (user_type (type_identifier) @heritage.class)\n (inheritance_specifier inherits_from: (user_type (type_identifier) @heritage.extends))) @heritage\n\n; Write access: obj.field = value (tree-sitter-swift 0.7.1 uses named fields)\n(assignment\n target: (directly_assignable_expression\n (navigation_expression\n target: (_) @assignment.receiver\n suffix: (navigation_suffix\n suffix: (simple_identifier) @assignment.property)))\n result: (_)) @assignment\n\n";
|
|
14
14
|
export declare const DART_QUERIES = "\n; \u2500\u2500 Classes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(class_definition\n name: (identifier) @name) @definition.class\n\n; \u2500\u2500 Mixins \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(mixin_declaration\n (identifier) @name) @definition.trait\n\n; \u2500\u2500 Extensions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(extension_declaration\n name: (identifier) @name) @definition.class\n\n; \u2500\u2500 Enums \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(enum_declaration\n name: (identifier) @name) @definition.enum\n\n; \u2500\u2500 Type aliases \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n; Anchor \"=\" after the name to avoid capturing the RHS type\n(type_alias\n (type_identifier) @name\n \"=\") @definition.type\n\n; \u2500\u2500 Top-level functions (parent is program, not method_signature) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(program\n (function_signature\n name: (identifier) @name) @definition.function)\n\n; \u2500\u2500 Abstract method declarations (function_signature inside class body declaration) \u2500\u2500\n(declaration\n (function_signature\n name: (identifier) @name)) @definition.method\n\n; \u2500\u2500 Methods (inside class/mixin/extension bodies) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(method_signature\n (function_signature\n name: (identifier) @name)) @definition.method\n\n; \u2500\u2500 Constructors \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(constructor_signature\n name: (identifier) @name) @definition.constructor\n\n; \u2500\u2500 Factory constructors (anchor before param list to capture variant name, not class) \u2500\u2500\n(method_signature\n (factory_constructor_signature\n (identifier) @name . (formal_parameter_list))) @definition.constructor\n\n; \u2500\u2500 Field declarations (String name = '', Address address = Address()) \u2500\u2500\u2500\u2500\u2500\u2500\n(declaration\n (type_identifier)\n (initialized_identifier_list\n (initialized_identifier\n (identifier) @name))) @definition.property\n\n; \u2500\u2500 Nullable field declarations (String? name) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(declaration\n (nullable_type)\n (initialized_identifier_list\n (initialized_identifier\n (identifier) @name))) @definition.property\n\n; \u2500\u2500 Getters \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(method_signature\n (getter_signature\n name: (identifier) @name)) @definition.property\n\n; \u2500\u2500 Setters \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(method_signature\n (setter_signature\n name: (identifier) @name)) @definition.property\n\n; \u2500\u2500 Imports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(import_or_export\n (library_import\n (import_specification\n (configurable_uri) @import.source))) @import\n\n; \u2500\u2500 Calls: direct function/constructor calls (identifier immediately before argument_part) \u2500\u2500\n(expression_statement\n (identifier) @call.name\n .\n (selector (argument_part))) @call\n\n; \u2500\u2500 Calls: method calls (obj.method()) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(expression_statement\n (selector\n (unconditional_assignable_selector\n (identifier) @call.name))) @call\n\n; \u2500\u2500 Calls: in return statements (return User()) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(return_statement\n (identifier) @call.name\n (selector (argument_part))) @call\n\n; \u2500\u2500 Calls: in variable assignments (var x = getUser()) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(initialized_variable_definition\n value: (identifier) @call.name\n (selector (argument_part))) @call\n\n; \u2500\u2500 Re-exports (export 'foo.dart') \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(import_or_export\n (library_export\n (configurable_uri) @import.source)) @import\n\n; \u2500\u2500 Write access: obj.field = value \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(assignment_expression\n left: (assignable_expression\n (identifier) @assignment.receiver\n (unconditional_assignable_selector\n (identifier) @assignment.property))\n right: (_)) @assignment\n\n; \u2500\u2500 Write access: this.field = value \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(assignment_expression\n left: (assignable_expression\n (this) @assignment.receiver\n (unconditional_assignable_selector\n (identifier) @assignment.property))\n right: (_)) @assignment\n\n; \u2500\u2500 Heritage: extends \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(class_definition\n name: (identifier) @heritage.class\n superclass: (superclass\n (type_identifier) @heritage.extends)) @heritage\n\n; \u2500\u2500 Heritage: implements \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(class_definition\n name: (identifier) @heritage.class\n interfaces: (interfaces\n (type_identifier) @heritage.implements)) @heritage.impl\n\n; \u2500\u2500 Heritage: with (mixins) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n(class_definition\n name: (identifier) @heritage.class\n superclass: (superclass\n (mixins\n (type_identifier) @heritage.trait))) @heritage\n";
|
|
15
|
-
import { SupportedLanguages } from '
|
|
15
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
16
16
|
export declare const LANGUAGE_QUERIES: Record<SupportedLanguages, string>;
|
|
@@ -1131,7 +1131,7 @@ export const DART_QUERIES = `
|
|
|
1131
1131
|
(mixins
|
|
1132
1132
|
(type_identifier) @heritage.trait))) @heritage
|
|
1133
1133
|
`;
|
|
1134
|
-
import { SupportedLanguages } from '
|
|
1134
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
1135
1135
|
export const LANGUAGE_QUERIES = {
|
|
1136
1136
|
[SupportedLanguages.TypeScript]: TYPESCRIPT_QUERIES,
|
|
1137
1137
|
[SupportedLanguages.JavaScript]: JAVASCRIPT_QUERIES,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SyntaxNode } from './utils/ast-helpers.js';
|
|
2
|
-
import { SupportedLanguages } from '
|
|
2
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
3
3
|
import type { SymbolTable } from './symbol-table.js';
|
|
4
|
-
import type { NodeLabel } from '
|
|
4
|
+
import type { NodeLabel } from '../../_shared/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Per-file type environment with receiver resolution.
|
|
7
7
|
* Built once per file via `buildTypeEnv`, used for receiver-type filtering,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type Parser from 'tree-sitter';
|
|
2
|
-
import type { NodeLabel } from '
|
|
2
|
+
import type { NodeLabel } from '../../../_shared/index.js';
|
|
3
3
|
import type { LanguageProvider } from '../language-provider.js';
|
|
4
4
|
/** Tree-sitter AST node. Re-exported for use across ingestion modules. */
|
|
5
5
|
export type SyntaxNode = Parser.SyntaxNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SupportedLanguages } from '
|
|
1
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
2
2
|
import { type MixedChainStep } from '../utils/call-analysis.js';
|
|
3
3
|
import type { ConstructorBinding } from '../type-env.js';
|
|
4
4
|
import type { NamedBinding } from '../named-bindings/types.js';
|
|
5
|
-
import type { NodeLabel } from '
|
|
5
|
+
import type { NodeLabel } from '../../../_shared/index.js';
|
|
6
6
|
interface ParsedNode {
|
|
7
7
|
id: string;
|
|
8
8
|
label: string;
|
|
@@ -12,7 +12,7 @@ import Rust from 'tree-sitter-rust';
|
|
|
12
12
|
import PHP from 'tree-sitter-php';
|
|
13
13
|
import Ruby from 'tree-sitter-ruby';
|
|
14
14
|
import { createRequire } from 'node:module';
|
|
15
|
-
import { SupportedLanguages } from '
|
|
15
|
+
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
16
16
|
import { getProvider } from '../languages/index.js';
|
|
17
17
|
import { getTreeSitterBufferSize, TREE_SITTER_MAX_BUFFER } from '../constants.js';
|
|
18
18
|
// tree-sitter-swift is an optionalDependency — may not be installed
|
|
@@ -34,7 +34,7 @@ try {
|
|
|
34
34
|
Kotlin = _require('tree-sitter-kotlin');
|
|
35
35
|
}
|
|
36
36
|
catch { }
|
|
37
|
-
import { getLanguageFromFilename } from '
|
|
37
|
+
import { getLanguageFromFilename } from '../../../_shared/index.js';
|
|
38
38
|
import { FUNCTION_NODE_TYPES, extractFunctionName, getDefinitionNodeFromCaptures, findEnclosingClassId, getLabelFromCaptures, extractMethodSignature, findDescendant, extractStringContent, } from '../utils/ast-helpers.js';
|
|
39
39
|
import { countCallArguments, inferCallForm, extractReceiverName, extractReceiverNode, extractMixedChain, extractCallArgTypes, } from '../utils/call-analysis.js';
|
|
40
40
|
import { extractParsedCallSite } from '../call-sites/extract-language-call-site.js';
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* This allows LLMs to write natural Cypher queries like:
|
|
9
9
|
* MATCH (f:Function)-[r:CodeRelation {type: 'CALLS'}]->(g:Function) RETURN f, g
|
|
10
10
|
*/
|
|
11
|
-
import { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME } from '
|
|
11
|
+
import { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME } from '../../_shared/index.js';
|
|
12
12
|
export { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME };
|
|
13
|
-
export type { NodeTableName, RelType } from '
|
|
13
|
+
export type { NodeTableName, RelType } from '../../_shared/index.js';
|
|
14
14
|
export declare const FILE_SCHEMA = "\nCREATE NODE TABLE File (\n id STRING,\n name STRING,\n filePath STRING,\n content STRING,\n PRIMARY KEY (id)\n)";
|
|
15
15
|
export declare const FOLDER_SCHEMA = "\nCREATE NODE TABLE Folder (\n id STRING,\n name STRING,\n filePath STRING,\n PRIMARY KEY (id)\n)";
|
|
16
16
|
export declare const FUNCTION_SCHEMA = "\nCREATE NODE TABLE Function (\n id STRING,\n name STRING,\n filePath STRING,\n startLine INT64,\n endLine INT64,\n isExported BOOLEAN,\n content STRING,\n description STRING,\n PRIMARY KEY (id)\n)";
|
package/dist/core/lbug/schema.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* MATCH (f:Function)-[r:CodeRelation {type: 'CALLS'}]->(g:Function) RETURN f, g
|
|
10
10
|
*/
|
|
11
11
|
// Import from shared package (single source of truth) — used in DDL templates below
|
|
12
|
-
import { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME } from '
|
|
12
|
+
import { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME } from '../../_shared/index.js';
|
|
13
13
|
// Re-export so downstream consumers keep the same import path
|
|
14
14
|
export { NODE_TABLES, REL_TABLE_NAME, REL_TYPES, EMBEDDING_TABLE_NAME };
|
|
15
15
|
// ============================================================================
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Parser from 'tree-sitter';
|
|
2
|
-
import { SupportedLanguages } from '
|
|
2
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
3
3
|
export declare const isLanguageAvailable: (language: SupportedLanguages) => boolean;
|
|
4
4
|
export declare const loadParser: () => Promise<Parser>;
|
|
5
5
|
export declare const loadLanguage: (language: SupportedLanguages, filePath?: string) => Promise<void>;
|
|
@@ -11,7 +11,7 @@ import Rust from 'tree-sitter-rust';
|
|
|
11
11
|
import PHP from 'tree-sitter-php';
|
|
12
12
|
import Ruby from 'tree-sitter-ruby';
|
|
13
13
|
import { createRequire } from 'node:module';
|
|
14
|
-
import { SupportedLanguages } from '
|
|
14
|
+
import { SupportedLanguages } from '../../_shared/index.js';
|
|
15
15
|
// tree-sitter-swift and tree-sitter-dart are optionalDependencies — may not be installed
|
|
16
16
|
const _require = createRequire(import.meta.url);
|
|
17
17
|
let Swift = null;
|
package/dist/server/api.js
CHANGED
|
@@ -15,7 +15,7 @@ import { createRequire } from 'node:module';
|
|
|
15
15
|
import { loadMeta, listRegisteredRepos, getStoragePath } from '../storage/repo-manager.js';
|
|
16
16
|
import { executeQuery, executePrepared, executeWithReusedStatement, closeLbug, withLbugDb, } from '../core/lbug/lbug-adapter.js';
|
|
17
17
|
import { isWriteQuery } from '../mcp/core/lbug-adapter.js';
|
|
18
|
-
import { NODE_TABLES } from '
|
|
18
|
+
import { NODE_TABLES } from '../_shared/index.js';
|
|
19
19
|
import { searchFTSFromLbug } from '../core/search/bm25-index.js';
|
|
20
20
|
import { hybridSearch } from '../core/search/hybrid-search.js';
|
|
21
21
|
// Embedding imports are lazy (dynamic import) to avoid loading onnxruntime-node
|