gitnexus 1.4.9 → 1.5.0
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/README.md +6 -5
- package/dist/cli/ai-context.d.ts +4 -1
- package/dist/cli/ai-context.js +19 -11
- package/dist/cli/analyze.d.ts +6 -0
- package/dist/cli/analyze.js +105 -251
- package/dist/cli/eval-server.js +20 -11
- package/dist/cli/index-repo.js +20 -22
- package/dist/cli/index.js +8 -7
- package/dist/cli/mcp.js +1 -1
- package/dist/cli/serve.js +29 -1
- package/dist/cli/setup.js +9 -9
- package/dist/cli/skill-gen.js +15 -9
- package/dist/cli/wiki.d.ts +2 -0
- package/dist/cli/wiki.js +141 -26
- package/dist/config/ignore-service.js +102 -22
- package/dist/config/supported-languages.d.ts +8 -42
- package/dist/config/supported-languages.js +8 -43
- package/dist/core/augmentation/engine.js +19 -7
- package/dist/core/embeddings/embedder.js +19 -15
- package/dist/core/embeddings/embedding-pipeline.js +6 -6
- package/dist/core/embeddings/http-client.js +3 -3
- package/dist/core/embeddings/text-generator.js +9 -24
- package/dist/core/embeddings/types.d.ts +1 -1
- package/dist/core/embeddings/types.js +1 -7
- package/dist/core/graph/graph.js +6 -2
- package/dist/core/graph/types.d.ts +9 -59
- package/dist/core/ingestion/ast-cache.js +3 -3
- package/dist/core/ingestion/call-processor.d.ts +20 -2
- package/dist/core/ingestion/call-processor.js +347 -144
- package/dist/core/ingestion/call-routing.js +10 -4
- package/dist/core/ingestion/call-sites/extract-language-call-site.d.ts +10 -0
- package/dist/core/ingestion/call-sites/extract-language-call-site.js +22 -0
- package/dist/core/ingestion/call-sites/java.d.ts +9 -0
- package/dist/core/ingestion/call-sites/java.js +30 -0
- package/dist/core/ingestion/cluster-enricher.js +6 -8
- package/dist/core/ingestion/cobol/cobol-copy-expander.js +10 -3
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +287 -81
- package/dist/core/ingestion/cobol/jcl-parser.js +1 -1
- package/dist/core/ingestion/cobol/jcl-processor.js +1 -1
- package/dist/core/ingestion/cobol-processor.js +102 -56
- package/dist/core/ingestion/community-processor.js +21 -15
- package/dist/core/ingestion/entry-point-scoring.d.ts +1 -1
- package/dist/core/ingestion/entry-point-scoring.js +5 -6
- package/dist/core/ingestion/export-detection.js +32 -9
- package/dist/core/ingestion/field-extractor.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/configs/c-cpp.js +8 -12
- package/dist/core/ingestion/field-extractors/configs/csharp.js +45 -2
- package/dist/core/ingestion/field-extractors/configs/dart.js +5 -3
- package/dist/core/ingestion/field-extractors/configs/go.js +3 -7
- package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +5 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.js +14 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.js +7 -7
- package/dist/core/ingestion/field-extractors/configs/php.js +9 -11
- package/dist/core/ingestion/field-extractors/configs/python.js +1 -1
- package/dist/core/ingestion/field-extractors/configs/ruby.js +4 -3
- package/dist/core/ingestion/field-extractors/configs/rust.js +2 -5
- package/dist/core/ingestion/field-extractors/configs/swift.js +9 -7
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +2 -6
- package/dist/core/ingestion/field-extractors/generic.d.ts +5 -2
- package/dist/core/ingestion/field-extractors/generic.js +6 -0
- 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 +4 -2
- package/dist/core/ingestion/filesystem-walker.js +3 -3
- package/dist/core/ingestion/framework-detection.d.ts +1 -1
- package/dist/core/ingestion/framework-detection.js +355 -85
- package/dist/core/ingestion/heritage-processor.d.ts +24 -0
- package/dist/core/ingestion/heritage-processor.js +99 -8
- package/dist/core/ingestion/import-processor.js +44 -15
- package/dist/core/ingestion/import-resolvers/csharp.js +7 -3
- package/dist/core/ingestion/import-resolvers/dart.js +1 -1
- package/dist/core/ingestion/import-resolvers/go.js +4 -2
- package/dist/core/ingestion/import-resolvers/jvm.js +4 -4
- package/dist/core/ingestion/import-resolvers/php.js +4 -4
- package/dist/core/ingestion/import-resolvers/python.js +1 -1
- package/dist/core/ingestion/import-resolvers/rust.js +9 -3
- package/dist/core/ingestion/import-resolvers/standard.d.ts +1 -1
- package/dist/core/ingestion/import-resolvers/standard.js +6 -5
- package/dist/core/ingestion/import-resolvers/swift.js +2 -1
- package/dist/core/ingestion/import-resolvers/utils.js +26 -7
- package/dist/core/ingestion/language-config.js +5 -4
- package/dist/core/ingestion/language-provider.d.ts +7 -2
- package/dist/core/ingestion/languages/c-cpp.js +106 -21
- package/dist/core/ingestion/languages/cobol.js +1 -1
- package/dist/core/ingestion/languages/csharp.js +96 -19
- package/dist/core/ingestion/languages/dart.js +23 -7
- 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 +2 -3
- package/dist/core/ingestion/languages/java.js +4 -1
- package/dist/core/ingestion/languages/kotlin.js +60 -13
- package/dist/core/ingestion/languages/php.js +102 -25
- package/dist/core/ingestion/languages/python.js +28 -5
- package/dist/core/ingestion/languages/ruby.js +56 -14
- package/dist/core/ingestion/languages/rust.js +55 -11
- package/dist/core/ingestion/languages/swift.js +112 -27
- package/dist/core/ingestion/languages/typescript.js +95 -19
- package/dist/core/ingestion/markdown-processor.js +5 -5
- package/dist/core/ingestion/method-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.js +283 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.js +326 -0
- package/dist/core/ingestion/method-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/method-extractors/generic.js +137 -0
- package/dist/core/ingestion/method-types.d.ts +61 -0
- package/dist/core/ingestion/method-types.js +2 -0
- package/dist/core/ingestion/mro-processor.d.ts +1 -1
- package/dist/core/ingestion/mro-processor.js +12 -8
- package/dist/core/ingestion/named-binding-processor.js +2 -2
- package/dist/core/ingestion/named-bindings/rust.js +3 -1
- package/dist/core/ingestion/parsing-processor.js +74 -24
- package/dist/core/ingestion/pipeline.d.ts +2 -1
- package/dist/core/ingestion/pipeline.js +208 -102
- package/dist/core/ingestion/process-processor.js +12 -10
- package/dist/core/ingestion/resolution-context.js +3 -3
- package/dist/core/ingestion/route-extractors/middleware.js +31 -7
- package/dist/core/ingestion/route-extractors/php.js +2 -1
- package/dist/core/ingestion/route-extractors/response-shapes.js +8 -4
- package/dist/core/ingestion/structure-processor.d.ts +1 -1
- package/dist/core/ingestion/structure-processor.js +4 -4
- package/dist/core/ingestion/symbol-table.d.ts +1 -1
- package/dist/core/ingestion/symbol-table.js +22 -6
- 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/type-env.js +75 -50
- package/dist/core/ingestion/type-extractors/c-cpp.js +33 -30
- package/dist/core/ingestion/type-extractors/csharp.js +24 -14
- package/dist/core/ingestion/type-extractors/dart.js +6 -8
- package/dist/core/ingestion/type-extractors/go.js +7 -6
- package/dist/core/ingestion/type-extractors/jvm.js +10 -21
- package/dist/core/ingestion/type-extractors/php.js +26 -13
- package/dist/core/ingestion/type-extractors/python.js +11 -15
- package/dist/core/ingestion/type-extractors/ruby.js +8 -3
- package/dist/core/ingestion/type-extractors/rust.js +6 -8
- package/dist/core/ingestion/type-extractors/shared.js +134 -50
- package/dist/core/ingestion/type-extractors/swift.js +16 -13
- package/dist/core/ingestion/type-extractors/typescript.js +23 -15
- package/dist/core/ingestion/utils/ast-helpers.d.ts +8 -8
- package/dist/core/ingestion/utils/ast-helpers.js +72 -35
- package/dist/core/ingestion/utils/call-analysis.d.ts +2 -0
- package/dist/core/ingestion/utils/call-analysis.js +96 -49
- package/dist/core/ingestion/utils/event-loop.js +1 -1
- package/dist/core/ingestion/workers/parse-worker.d.ts +7 -2
- package/dist/core/ingestion/workers/parse-worker.js +364 -84
- package/dist/core/ingestion/workers/worker-pool.js +5 -10
- package/dist/core/lbug/csv-generator.js +54 -15
- package/dist/core/lbug/lbug-adapter.d.ts +5 -0
- package/dist/core/lbug/lbug-adapter.js +86 -23
- package/dist/core/lbug/schema.d.ts +3 -6
- package/dist/core/lbug/schema.js +6 -30
- package/dist/core/run-analyze.d.ts +49 -0
- package/dist/core/run-analyze.js +257 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +1 -1
- package/dist/core/tree-sitter/parser-loader.js +1 -1
- package/dist/core/wiki/cursor-client.js +2 -7
- package/dist/core/wiki/generator.js +38 -23
- package/dist/core/wiki/graph-queries.js +10 -10
- package/dist/core/wiki/html-viewer.js +7 -3
- package/dist/core/wiki/llm-client.d.ts +23 -2
- package/dist/core/wiki/llm-client.js +96 -26
- package/dist/core/wiki/prompts.js +7 -6
- package/dist/mcp/core/embedder.js +1 -1
- package/dist/mcp/core/lbug-adapter.d.ts +4 -1
- package/dist/mcp/core/lbug-adapter.js +17 -7
- package/dist/mcp/local/local-backend.js +247 -95
- package/dist/mcp/resources.js +14 -6
- package/dist/mcp/server.js +13 -5
- package/dist/mcp/staleness.js +5 -1
- package/dist/mcp/tools.js +100 -23
- package/dist/server/analyze-job.d.ts +53 -0
- package/dist/server/analyze-job.js +146 -0
- package/dist/server/analyze-worker.d.ts +13 -0
- package/dist/server/analyze-worker.js +59 -0
- package/dist/server/api.js +795 -44
- package/dist/server/git-clone.d.ts +25 -0
- package/dist/server/git-clone.js +91 -0
- package/dist/storage/git.js +1 -3
- package/dist/storage/repo-manager.d.ts +5 -2
- package/dist/storage/repo-manager.js +4 -4
- package/dist/types/pipeline.d.ts +1 -21
- package/dist/types/pipeline.js +1 -18
- package/hooks/claude/gitnexus-hook.cjs +52 -22
- package/package.json +13 -13
- package/dist/core/ingestion/utils/language-detection.d.ts +0 -9
- package/dist/core/ingestion/utils/language-detection.js +0 -70
|
@@ -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 'gitnexus-shared';
|
|
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';
|
|
@@ -19,10 +19,33 @@ import { PYTHON_QUERIES } from '../tree-sitter-queries.js';
|
|
|
19
19
|
import { createFieldExtractor } from '../field-extractors/generic.js';
|
|
20
20
|
import { pythonConfig as pythonFieldConfig } from '../field-extractors/configs/python.js';
|
|
21
21
|
const BUILT_INS = new Set([
|
|
22
|
-
'print',
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
22
|
+
'print',
|
|
23
|
+
'len',
|
|
24
|
+
'range',
|
|
25
|
+
'str',
|
|
26
|
+
'int',
|
|
27
|
+
'float',
|
|
28
|
+
'list',
|
|
29
|
+
'dict',
|
|
30
|
+
'set',
|
|
31
|
+
'tuple',
|
|
32
|
+
'append',
|
|
33
|
+
'extend',
|
|
34
|
+
'update',
|
|
35
|
+
'type',
|
|
36
|
+
'isinstance',
|
|
37
|
+
'issubclass',
|
|
38
|
+
'getattr',
|
|
39
|
+
'setattr',
|
|
40
|
+
'hasattr',
|
|
41
|
+
'enumerate',
|
|
42
|
+
'zip',
|
|
43
|
+
'sorted',
|
|
44
|
+
'reversed',
|
|
45
|
+
'min',
|
|
46
|
+
'max',
|
|
47
|
+
'sum',
|
|
48
|
+
'abs',
|
|
26
49
|
]);
|
|
27
50
|
export const pythonProvider = defineLanguage({
|
|
28
51
|
id: SupportedLanguages.Python,
|
|
@@ -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 'gitnexus-shared';
|
|
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';
|
|
@@ -16,19 +16,61 @@ import { RUBY_QUERIES } from '../tree-sitter-queries.js';
|
|
|
16
16
|
import { createFieldExtractor } from '../field-extractors/generic.js';
|
|
17
17
|
import { rubyConfig as rubyFieldConfig } from '../field-extractors/configs/ruby.js';
|
|
18
18
|
const BUILT_INS = new Set([
|
|
19
|
-
'puts',
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
19
|
+
'puts',
|
|
20
|
+
'p',
|
|
21
|
+
'pp',
|
|
22
|
+
'raise',
|
|
23
|
+
'fail',
|
|
24
|
+
'require',
|
|
25
|
+
'require_relative',
|
|
26
|
+
'load',
|
|
27
|
+
'autoload',
|
|
28
|
+
'include',
|
|
29
|
+
'extend',
|
|
30
|
+
'prepend',
|
|
31
|
+
'attr_accessor',
|
|
32
|
+
'attr_reader',
|
|
33
|
+
'attr_writer',
|
|
34
|
+
'public',
|
|
35
|
+
'private',
|
|
36
|
+
'protected',
|
|
37
|
+
'module_function',
|
|
38
|
+
'lambda',
|
|
39
|
+
'proc',
|
|
40
|
+
'block_given?',
|
|
41
|
+
'nil?',
|
|
42
|
+
'is_a?',
|
|
43
|
+
'kind_of?',
|
|
44
|
+
'instance_of?',
|
|
45
|
+
'respond_to?',
|
|
46
|
+
'freeze',
|
|
47
|
+
'frozen?',
|
|
48
|
+
'dup',
|
|
49
|
+
'tap',
|
|
50
|
+
'yield_self',
|
|
51
|
+
'each',
|
|
52
|
+
'select',
|
|
53
|
+
'reject',
|
|
54
|
+
'detect',
|
|
55
|
+
'collect',
|
|
56
|
+
'inject',
|
|
57
|
+
'flat_map',
|
|
58
|
+
'each_with_object',
|
|
59
|
+
'each_with_index',
|
|
60
|
+
'any?',
|
|
61
|
+
'all?',
|
|
62
|
+
'none?',
|
|
63
|
+
'count',
|
|
64
|
+
'first',
|
|
65
|
+
'last',
|
|
66
|
+
'sort_by',
|
|
67
|
+
'min_by',
|
|
68
|
+
'max_by',
|
|
69
|
+
'group_by',
|
|
70
|
+
'partition',
|
|
71
|
+
'compact',
|
|
72
|
+
'flatten',
|
|
73
|
+
'uniq',
|
|
32
74
|
]);
|
|
33
75
|
export const rubyProvider = defineLanguage({
|
|
34
76
|
id: SupportedLanguages.Ruby,
|
|
@@ -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 'gitnexus-shared';
|
|
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';
|
|
@@ -19,16 +19,60 @@ import { RUST_QUERIES } from '../tree-sitter-queries.js';
|
|
|
19
19
|
import { createFieldExtractor } from '../field-extractors/generic.js';
|
|
20
20
|
import { rustConfig as rustFieldConfig } from '../field-extractors/configs/rust.js';
|
|
21
21
|
const BUILT_INS = new Set([
|
|
22
|
-
'unwrap',
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
22
|
+
'unwrap',
|
|
23
|
+
'expect',
|
|
24
|
+
'unwrap_or',
|
|
25
|
+
'unwrap_or_else',
|
|
26
|
+
'unwrap_or_default',
|
|
27
|
+
'ok',
|
|
28
|
+
'err',
|
|
29
|
+
'is_ok',
|
|
30
|
+
'is_err',
|
|
31
|
+
'map',
|
|
32
|
+
'map_err',
|
|
33
|
+
'and_then',
|
|
34
|
+
'or_else',
|
|
35
|
+
'clone',
|
|
36
|
+
'to_string',
|
|
37
|
+
'to_owned',
|
|
38
|
+
'into',
|
|
39
|
+
'from',
|
|
40
|
+
'as_ref',
|
|
41
|
+
'as_mut',
|
|
42
|
+
'iter',
|
|
43
|
+
'into_iter',
|
|
44
|
+
'collect',
|
|
45
|
+
'filter',
|
|
46
|
+
'fold',
|
|
47
|
+
'for_each',
|
|
48
|
+
'len',
|
|
49
|
+
'is_empty',
|
|
50
|
+
'push',
|
|
51
|
+
'pop',
|
|
52
|
+
'insert',
|
|
53
|
+
'remove',
|
|
54
|
+
'contains',
|
|
55
|
+
'format',
|
|
56
|
+
'write',
|
|
57
|
+
'writeln',
|
|
58
|
+
'panic',
|
|
59
|
+
'unreachable',
|
|
60
|
+
'todo',
|
|
61
|
+
'unimplemented',
|
|
62
|
+
'vec',
|
|
63
|
+
'println',
|
|
64
|
+
'eprintln',
|
|
65
|
+
'dbg',
|
|
66
|
+
'lock',
|
|
67
|
+
'read',
|
|
68
|
+
'try_lock',
|
|
69
|
+
'spawn',
|
|
70
|
+
'join',
|
|
71
|
+
'sleep',
|
|
72
|
+
'Some',
|
|
73
|
+
'None',
|
|
74
|
+
'Ok',
|
|
75
|
+
'Err',
|
|
32
76
|
]);
|
|
33
77
|
export const rustProvider = defineLanguage({
|
|
34
78
|
id: SupportedLanguages.Rust,
|
|
@@ -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 'gitnexus-shared';
|
|
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';
|
|
@@ -29,7 +29,10 @@ function groupSwiftFilesByTarget(swiftFiles, swiftPackageConfig) {
|
|
|
29
29
|
return new Map([['__default__', swiftFiles]]);
|
|
30
30
|
}
|
|
31
31
|
// Pre-convert target dirs to normalized prefix format once
|
|
32
|
-
const targets = [...swiftPackageConfig.targets.entries()].map(([name, dir]) => ({
|
|
32
|
+
const targets = [...swiftPackageConfig.targets.entries()].map(([name, dir]) => ({
|
|
33
|
+
name,
|
|
34
|
+
prefix: dir.replace(/\\/g, '/') + '/',
|
|
35
|
+
}));
|
|
33
36
|
const groups = new Map();
|
|
34
37
|
const defaultGroup = [];
|
|
35
38
|
for (const file of swiftFiles) {
|
|
@@ -92,31 +95,113 @@ function wireSwiftImplicitImports(swiftFiles, importMap, addImportEdge, projectC
|
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
97
|
const BUILT_INS = new Set([
|
|
95
|
-
'print',
|
|
96
|
-
'
|
|
97
|
-
'
|
|
98
|
-
'
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
'
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'
|
|
117
|
-
'
|
|
118
|
-
'
|
|
119
|
-
'
|
|
98
|
+
'print',
|
|
99
|
+
'debugPrint',
|
|
100
|
+
'dump',
|
|
101
|
+
'fatalError',
|
|
102
|
+
'precondition',
|
|
103
|
+
'preconditionFailure',
|
|
104
|
+
'assert',
|
|
105
|
+
'assertionFailure',
|
|
106
|
+
'NSLog',
|
|
107
|
+
'abs',
|
|
108
|
+
'min',
|
|
109
|
+
'max',
|
|
110
|
+
'zip',
|
|
111
|
+
'stride',
|
|
112
|
+
'sequence',
|
|
113
|
+
'repeatElement',
|
|
114
|
+
'swap',
|
|
115
|
+
'withUnsafePointer',
|
|
116
|
+
'withUnsafeMutablePointer',
|
|
117
|
+
'withUnsafeBytes',
|
|
118
|
+
'autoreleasepool',
|
|
119
|
+
'unsafeBitCast',
|
|
120
|
+
'unsafeDowncast',
|
|
121
|
+
'numericCast',
|
|
122
|
+
'type',
|
|
123
|
+
'MemoryLayout',
|
|
124
|
+
'map',
|
|
125
|
+
'flatMap',
|
|
126
|
+
'compactMap',
|
|
127
|
+
'filter',
|
|
128
|
+
'reduce',
|
|
129
|
+
'forEach',
|
|
130
|
+
'contains',
|
|
131
|
+
'first',
|
|
132
|
+
'last',
|
|
133
|
+
'prefix',
|
|
134
|
+
'suffix',
|
|
135
|
+
'dropFirst',
|
|
136
|
+
'dropLast',
|
|
137
|
+
'sorted',
|
|
138
|
+
'reversed',
|
|
139
|
+
'enumerated',
|
|
140
|
+
'joined',
|
|
141
|
+
'split',
|
|
142
|
+
'append',
|
|
143
|
+
'insert',
|
|
144
|
+
'remove',
|
|
145
|
+
'removeAll',
|
|
146
|
+
'removeFirst',
|
|
147
|
+
'removeLast',
|
|
148
|
+
'isEmpty',
|
|
149
|
+
'count',
|
|
150
|
+
'index',
|
|
151
|
+
'startIndex',
|
|
152
|
+
'endIndex',
|
|
153
|
+
'addSubview',
|
|
154
|
+
'removeFromSuperview',
|
|
155
|
+
'layoutSubviews',
|
|
156
|
+
'setNeedsLayout',
|
|
157
|
+
'layoutIfNeeded',
|
|
158
|
+
'setNeedsDisplay',
|
|
159
|
+
'invalidateIntrinsicContentSize',
|
|
160
|
+
'addTarget',
|
|
161
|
+
'removeTarget',
|
|
162
|
+
'addGestureRecognizer',
|
|
163
|
+
'addConstraint',
|
|
164
|
+
'addConstraints',
|
|
165
|
+
'removeConstraint',
|
|
166
|
+
'removeConstraints',
|
|
167
|
+
'NSLocalizedString',
|
|
168
|
+
'Bundle',
|
|
169
|
+
'reloadData',
|
|
170
|
+
'reloadSections',
|
|
171
|
+
'reloadRows',
|
|
172
|
+
'performBatchUpdates',
|
|
173
|
+
'register',
|
|
174
|
+
'dequeueReusableCell',
|
|
175
|
+
'dequeueReusableSupplementaryView',
|
|
176
|
+
'beginUpdates',
|
|
177
|
+
'endUpdates',
|
|
178
|
+
'insertRows',
|
|
179
|
+
'deleteRows',
|
|
180
|
+
'insertSections',
|
|
181
|
+
'deleteSections',
|
|
182
|
+
'present',
|
|
183
|
+
'dismiss',
|
|
184
|
+
'pushViewController',
|
|
185
|
+
'popViewController',
|
|
186
|
+
'popToRootViewController',
|
|
187
|
+
'performSegue',
|
|
188
|
+
'prepare',
|
|
189
|
+
'DispatchQueue',
|
|
190
|
+
'async',
|
|
191
|
+
'sync',
|
|
192
|
+
'asyncAfter',
|
|
193
|
+
'Task',
|
|
194
|
+
'withCheckedContinuation',
|
|
195
|
+
'withCheckedThrowingContinuation',
|
|
196
|
+
'sink',
|
|
197
|
+
'store',
|
|
198
|
+
'assign',
|
|
199
|
+
'receive',
|
|
200
|
+
'subscribe',
|
|
201
|
+
'addObserver',
|
|
202
|
+
'removeObserver',
|
|
203
|
+
'post',
|
|
204
|
+
'NotificationCenter',
|
|
120
205
|
]);
|
|
121
206
|
export const swiftProvider = defineLanguage({
|
|
122
207
|
id: SupportedLanguages.Swift,
|
|
@@ -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 'gitnexus-shared';
|
|
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';
|
|
@@ -17,24 +17,100 @@ import { typescriptFieldExtractor } from '../field-extractors/typescript.js';
|
|
|
17
17
|
import { createFieldExtractor } from '../field-extractors/generic.js';
|
|
18
18
|
import { javascriptConfig } from '../field-extractors/configs/typescript-javascript.js';
|
|
19
19
|
const BUILT_INS = new Set([
|
|
20
|
-
'console',
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
20
|
+
'console',
|
|
21
|
+
'log',
|
|
22
|
+
'warn',
|
|
23
|
+
'error',
|
|
24
|
+
'info',
|
|
25
|
+
'debug',
|
|
26
|
+
'setTimeout',
|
|
27
|
+
'setInterval',
|
|
28
|
+
'clearTimeout',
|
|
29
|
+
'clearInterval',
|
|
30
|
+
'parseInt',
|
|
31
|
+
'parseFloat',
|
|
32
|
+
'isNaN',
|
|
33
|
+
'isFinite',
|
|
34
|
+
'encodeURI',
|
|
35
|
+
'decodeURI',
|
|
36
|
+
'encodeURIComponent',
|
|
37
|
+
'decodeURIComponent',
|
|
38
|
+
'JSON',
|
|
39
|
+
'parse',
|
|
40
|
+
'stringify',
|
|
41
|
+
'Object',
|
|
42
|
+
'Array',
|
|
43
|
+
'String',
|
|
44
|
+
'Number',
|
|
45
|
+
'Boolean',
|
|
46
|
+
'Symbol',
|
|
47
|
+
'BigInt',
|
|
48
|
+
'Map',
|
|
49
|
+
'Set',
|
|
50
|
+
'WeakMap',
|
|
51
|
+
'WeakSet',
|
|
52
|
+
'Promise',
|
|
53
|
+
'resolve',
|
|
54
|
+
'reject',
|
|
55
|
+
'then',
|
|
56
|
+
'catch',
|
|
57
|
+
'finally',
|
|
58
|
+
'Math',
|
|
59
|
+
'Date',
|
|
60
|
+
'RegExp',
|
|
61
|
+
'Error',
|
|
62
|
+
'require',
|
|
63
|
+
'import',
|
|
64
|
+
'export',
|
|
65
|
+
'fetch',
|
|
66
|
+
'Response',
|
|
67
|
+
'Request',
|
|
68
|
+
'useState',
|
|
69
|
+
'useEffect',
|
|
70
|
+
'useCallback',
|
|
71
|
+
'useMemo',
|
|
72
|
+
'useRef',
|
|
73
|
+
'useContext',
|
|
74
|
+
'useReducer',
|
|
75
|
+
'useLayoutEffect',
|
|
76
|
+
'useImperativeHandle',
|
|
77
|
+
'useDebugValue',
|
|
78
|
+
'createElement',
|
|
79
|
+
'createContext',
|
|
80
|
+
'createRef',
|
|
81
|
+
'forwardRef',
|
|
82
|
+
'memo',
|
|
83
|
+
'lazy',
|
|
84
|
+
'map',
|
|
85
|
+
'filter',
|
|
86
|
+
'reduce',
|
|
87
|
+
'forEach',
|
|
88
|
+
'find',
|
|
89
|
+
'findIndex',
|
|
90
|
+
'some',
|
|
91
|
+
'every',
|
|
92
|
+
'includes',
|
|
93
|
+
'indexOf',
|
|
94
|
+
'slice',
|
|
95
|
+
'splice',
|
|
96
|
+
'concat',
|
|
97
|
+
'join',
|
|
98
|
+
'split',
|
|
99
|
+
'push',
|
|
100
|
+
'pop',
|
|
101
|
+
'shift',
|
|
102
|
+
'unshift',
|
|
103
|
+
'sort',
|
|
104
|
+
'reverse',
|
|
105
|
+
'keys',
|
|
106
|
+
'values',
|
|
107
|
+
'entries',
|
|
108
|
+
'assign',
|
|
109
|
+
'freeze',
|
|
110
|
+
'seal',
|
|
111
|
+
'hasOwnProperty',
|
|
112
|
+
'toString',
|
|
113
|
+
'valueOf',
|
|
38
114
|
]);
|
|
39
115
|
export const typescriptProvider = defineLanguage({
|
|
40
116
|
id: SupportedLanguages.TypeScript,
|
|
@@ -66,9 +66,7 @@ export const processMarkdown = (graph, files, allPathSet) => {
|
|
|
66
66
|
while (sectionStack.length > 0 && sectionStack[sectionStack.length - 1].level >= level) {
|
|
67
67
|
sectionStack.pop();
|
|
68
68
|
}
|
|
69
|
-
const parentId = sectionStack.length > 0
|
|
70
|
-
? sectionStack[sectionStack.length - 1].id
|
|
71
|
-
: fileNodeId;
|
|
69
|
+
const parentId = sectionStack.length > 0 ? sectionStack[sectionStack.length - 1].id : fileNodeId;
|
|
72
70
|
graph.addRelationship({
|
|
73
71
|
id: generateId('CONTAINS', `${parentId}->${sectionId}`),
|
|
74
72
|
type: 'CONTAINS',
|
|
@@ -87,8 +85,10 @@ export const processMarkdown = (graph, files, allPathSet) => {
|
|
|
87
85
|
while ((linkMatch = LINK_RE.exec(file.content)) !== null) {
|
|
88
86
|
const href = linkMatch[2];
|
|
89
87
|
// Skip external URLs, anchors, and mailto
|
|
90
|
-
if (href.startsWith('http://') ||
|
|
91
|
-
href.startsWith('
|
|
88
|
+
if (href.startsWith('http://') ||
|
|
89
|
+
href.startsWith('https://') ||
|
|
90
|
+
href.startsWith('#') ||
|
|
91
|
+
href.startsWith('mailto:')) {
|
|
92
92
|
continue;
|
|
93
93
|
}
|
|
94
94
|
// Strip anchor fragments from local links
|