@nanonets/graft 0.9.0 → 0.10.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 +62 -26
- package/dist/ask/ask.d.ts.map +1 -1
- package/dist/ask/ask.js +10 -7
- package/dist/ask/ask.js.map +1 -1
- package/dist/ask/fuse.d.ts.map +1 -1
- package/dist/ask/fuse.js +32 -14
- package/dist/ask/fuse.js.map +1 -1
- package/dist/claude/format.js +1 -1
- package/dist/claude/format.js.map +1 -1
- package/dist/claude/init.d.ts.map +1 -1
- package/dist/claude/init.js +6 -3
- package/dist/claude/init.js.map +1 -1
- package/dist/claude/skill-template.d.ts.map +1 -1
- package/dist/claude/skill-template.js +11 -5
- package/dist/claude/skill-template.js.map +1 -1
- package/dist/cli.js +93 -39
- package/dist/cli.js.map +1 -1
- package/dist/context/savings.d.ts +12 -3
- package/dist/context/savings.d.ts.map +1 -1
- package/dist/context/savings.js +15 -3
- package/dist/context/savings.js.map +1 -1
- package/dist/engine.d.ts +6 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +4 -1
- package/dist/engine.js.map +1 -1
- package/dist/graph/build.d.ts +5 -0
- package/dist/graph/build.d.ts.map +1 -1
- package/dist/graph/build.js +21 -2
- package/dist/graph/build.js.map +1 -1
- package/dist/graph/check.d.ts +1 -1
- package/dist/graph/check.d.ts.map +1 -1
- package/dist/graph/check.js +13 -3
- package/dist/graph/check.js.map +1 -1
- package/dist/graph/generic.d.ts +25 -0
- package/dist/graph/generic.d.ts.map +1 -0
- package/dist/graph/generic.js +320 -0
- package/dist/graph/generic.js.map +1 -0
- package/dist/graph/lsp/client.d.ts +43 -0
- package/dist/graph/lsp/client.d.ts.map +1 -0
- package/dist/graph/lsp/client.js +179 -0
- package/dist/graph/lsp/client.js.map +1 -0
- package/dist/graph/lsp/enrich.d.ts +11 -0
- package/dist/graph/lsp/enrich.d.ts.map +1 -0
- package/dist/graph/lsp/enrich.js +155 -0
- package/dist/graph/lsp/enrich.js.map +1 -0
- package/dist/graph/lsp/registry.d.ts +15 -0
- package/dist/graph/lsp/registry.d.ts.map +1 -0
- package/dist/graph/lsp/registry.js +46 -0
- package/dist/graph/lsp/registry.js.map +1 -0
- package/dist/graph/map.d.ts.map +1 -1
- package/dist/graph/map.js +2 -2
- package/dist/graph/map.js.map +1 -1
- package/dist/graph/queries/c.scm +13 -0
- package/dist/graph/queries/c_sharp.scm +19 -0
- package/dist/graph/queries/cpp.scm +23 -0
- package/dist/graph/queries/elixir.scm +54 -0
- package/dist/graph/queries/java.scm +20 -0
- package/dist/graph/queries/kotlin.scm +43 -0
- package/dist/graph/queries/php.scm +40 -0
- package/dist/graph/queries/ruby.scm +65 -0
- package/dist/graph/queries/rust.scm +41 -0
- package/dist/graph/queries/scala.scm +66 -0
- package/dist/graph/queries/solidity.scm +43 -0
- package/dist/graph/queries/swift.scm +51 -0
- package/dist/graph/resolve.d.ts.map +1 -1
- package/dist/graph/resolve.js +13 -3
- package/dist/graph/resolve.js.map +1 -1
- package/dist/graph/root.d.ts +11 -0
- package/dist/graph/root.d.ts.map +1 -0
- package/dist/graph/root.js +40 -0
- package/dist/graph/root.js.map +1 -0
- package/dist/graph/source-files.d.ts.map +1 -1
- package/dist/graph/source-files.js +5 -1
- package/dist/graph/source-files.js.map +1 -1
- package/dist/graph/traverse-cli.d.ts.map +1 -1
- package/dist/graph/traverse-cli.js +2 -2
- package/dist/graph/traverse-cli.js.map +1 -1
- package/dist/graph/types.d.ts +12 -7
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/graph/types.js +2 -2
- package/dist/graph/workspace-cli.d.ts +1 -1
- package/dist/graph/workspace-cli.d.ts.map +1 -1
- package/dist/graph/workspace-cli.js +2 -2
- package/dist/graph/workspace-cli.js.map +1 -1
- package/dist/graph/workspace.d.ts +2 -2
- package/dist/graph/workspace.d.ts.map +1 -1
- package/dist/graph/workspace.js +4 -4
- package/dist/graph/workspace.js.map +1 -1
- package/dist/mcp/tools.js +8 -8
- package/dist/mcp/tools.js.map +1 -1
- package/dist/search/grep-cli.d.ts.map +1 -1
- package/dist/search/grep-cli.js +8 -9
- package/dist/search/grep-cli.js.map +1 -1
- package/package.json +6 -2
- package/scripts/build-viewer.mjs +17 -1
- package/scripts/graph-quality.mjs +117 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
; Definitions
|
|
2
|
+
|
|
3
|
+
; * modules and protocols
|
|
4
|
+
(call
|
|
5
|
+
target: (identifier) @ignore
|
|
6
|
+
(arguments (alias) @name)
|
|
7
|
+
(#any-of? @ignore "defmodule" "defprotocol")) @definition.module
|
|
8
|
+
|
|
9
|
+
; * functions/macros
|
|
10
|
+
(call
|
|
11
|
+
target: (identifier) @ignore
|
|
12
|
+
(arguments
|
|
13
|
+
[
|
|
14
|
+
; zero-arity functions with no parentheses
|
|
15
|
+
(identifier) @name
|
|
16
|
+
; regular function clause
|
|
17
|
+
(call target: (identifier) @name)
|
|
18
|
+
; function clause with a guard clause
|
|
19
|
+
(binary_operator
|
|
20
|
+
left: (call target: (identifier) @name)
|
|
21
|
+
operator: "when")
|
|
22
|
+
])
|
|
23
|
+
(#any-of? @ignore "def" "defp" "defdelegate" "defguard" "defguardp" "defmacro" "defmacrop" "defn" "defnp")) @definition.function
|
|
24
|
+
|
|
25
|
+
; References
|
|
26
|
+
|
|
27
|
+
; ignore calls to kernel/special-forms keywords
|
|
28
|
+
(call
|
|
29
|
+
target: (identifier) @ignore
|
|
30
|
+
(#any-of? @ignore "def" "defp" "defdelegate" "defguard" "defguardp" "defmacro" "defmacrop" "defn" "defnp" "defmodule" "defprotocol" "defimpl" "defstruct" "defexception" "defoverridable" "alias" "case" "cond" "else" "for" "if" "import" "quote" "raise" "receive" "require" "reraise" "super" "throw" "try" "unless" "unquote" "unquote_splicing" "use" "with"))
|
|
31
|
+
|
|
32
|
+
; ignore module attributes
|
|
33
|
+
(unary_operator
|
|
34
|
+
operator: "@"
|
|
35
|
+
operand: (call
|
|
36
|
+
target: (identifier) @ignore))
|
|
37
|
+
|
|
38
|
+
; * function call
|
|
39
|
+
(call
|
|
40
|
+
target: [
|
|
41
|
+
; local
|
|
42
|
+
(identifier) @name
|
|
43
|
+
; remote
|
|
44
|
+
(dot
|
|
45
|
+
right: (identifier) @name)
|
|
46
|
+
]) @reference.call
|
|
47
|
+
|
|
48
|
+
; * pipe into function call
|
|
49
|
+
(binary_operator
|
|
50
|
+
operator: "|>"
|
|
51
|
+
right: (identifier) @name) @reference.call
|
|
52
|
+
|
|
53
|
+
; * modules
|
|
54
|
+
(alias) @name @reference.module
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
(class_declaration
|
|
2
|
+
name: (identifier) @name) @definition.class
|
|
3
|
+
|
|
4
|
+
(method_declaration
|
|
5
|
+
name: (identifier) @name) @definition.method
|
|
6
|
+
|
|
7
|
+
(method_invocation
|
|
8
|
+
name: (identifier) @name
|
|
9
|
+
arguments: (argument_list) @reference.call)
|
|
10
|
+
|
|
11
|
+
(interface_declaration
|
|
12
|
+
name: (identifier) @name) @definition.interface
|
|
13
|
+
|
|
14
|
+
(type_list
|
|
15
|
+
(type_identifier) @name) @reference.implementation
|
|
16
|
+
|
|
17
|
+
(object_creation_expression
|
|
18
|
+
type: (type_identifier) @name) @reference.class
|
|
19
|
+
|
|
20
|
+
(superclass (type_identifier) @name) @reference.class
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
; Classes
|
|
2
|
+
(class_declaration
|
|
3
|
+
(type_identifier) @name) @definition.class
|
|
4
|
+
|
|
5
|
+
; Objects
|
|
6
|
+
(object_declaration
|
|
7
|
+
(type_identifier) @name) @definition.class
|
|
8
|
+
|
|
9
|
+
; Functions (top-level and member)
|
|
10
|
+
(function_declaration
|
|
11
|
+
(simple_identifier) @name) @definition.function
|
|
12
|
+
|
|
13
|
+
; Properties
|
|
14
|
+
(property_declaration
|
|
15
|
+
(variable_declaration
|
|
16
|
+
(simple_identifier) @name)) @definition.constant
|
|
17
|
+
|
|
18
|
+
; Enum entries
|
|
19
|
+
(enum_entry
|
|
20
|
+
(simple_identifier) @name) @definition.constant
|
|
21
|
+
|
|
22
|
+
; Type aliases
|
|
23
|
+
(type_alias
|
|
24
|
+
(type_identifier) @name) @definition.type
|
|
25
|
+
|
|
26
|
+
; Companion objects (only named ones)
|
|
27
|
+
(companion_object
|
|
28
|
+
(type_identifier) @name) @definition.class
|
|
29
|
+
|
|
30
|
+
; Function calls
|
|
31
|
+
(call_expression
|
|
32
|
+
(simple_identifier) @name) @reference.call
|
|
33
|
+
|
|
34
|
+
; Method calls via navigation
|
|
35
|
+
(call_expression
|
|
36
|
+
(navigation_expression
|
|
37
|
+
(navigation_suffix
|
|
38
|
+
(simple_identifier) @name))) @reference.call
|
|
39
|
+
|
|
40
|
+
; Constructor invocations (class references)
|
|
41
|
+
(constructor_invocation
|
|
42
|
+
(user_type
|
|
43
|
+
(type_identifier) @name)) @reference.class
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
(namespace_definition
|
|
2
|
+
name: (namespace_name) @name) @definition.module
|
|
3
|
+
|
|
4
|
+
(interface_declaration
|
|
5
|
+
name: (name) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(trait_declaration
|
|
8
|
+
name: (name) @name) @definition.interface
|
|
9
|
+
|
|
10
|
+
(class_declaration
|
|
11
|
+
name: (name) @name) @definition.class
|
|
12
|
+
|
|
13
|
+
(class_interface_clause [(name) (qualified_name)] @name) @reference.implementation
|
|
14
|
+
|
|
15
|
+
(property_declaration
|
|
16
|
+
(property_element (variable_name (name) @name))) @definition.field
|
|
17
|
+
|
|
18
|
+
(function_definition
|
|
19
|
+
name: (name) @name) @definition.function
|
|
20
|
+
|
|
21
|
+
(method_declaration
|
|
22
|
+
name: (name) @name) @definition.function
|
|
23
|
+
|
|
24
|
+
(object_creation_expression
|
|
25
|
+
[
|
|
26
|
+
(qualified_name (name) @name)
|
|
27
|
+
(variable_name (name) @name)
|
|
28
|
+
]) @reference.class
|
|
29
|
+
|
|
30
|
+
(function_call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(qualified_name (name) @name)
|
|
33
|
+
(variable_name (name)) @name
|
|
34
|
+
]) @reference.call
|
|
35
|
+
|
|
36
|
+
(scoped_call_expression
|
|
37
|
+
name: (name) @name) @reference.call
|
|
38
|
+
|
|
39
|
+
(member_call_expression
|
|
40
|
+
name: (name) @name) @reference.call
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
; Method definitions
|
|
2
|
+
|
|
3
|
+
(
|
|
4
|
+
(comment)* @doc
|
|
5
|
+
.
|
|
6
|
+
[
|
|
7
|
+
(method
|
|
8
|
+
name: (_) @name) @definition.method
|
|
9
|
+
(singleton_method
|
|
10
|
+
name: (_) @name) @definition.method
|
|
11
|
+
]
|
|
12
|
+
(#strip! @doc "^#\\s*")
|
|
13
|
+
(#select-adjacent! @doc @definition.method)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
(alias
|
|
17
|
+
name: (_) @name) @definition.method
|
|
18
|
+
|
|
19
|
+
(setter
|
|
20
|
+
(identifier) @ignore)
|
|
21
|
+
|
|
22
|
+
; Class definitions
|
|
23
|
+
|
|
24
|
+
(
|
|
25
|
+
(comment)* @doc
|
|
26
|
+
.
|
|
27
|
+
[
|
|
28
|
+
(class
|
|
29
|
+
name: [
|
|
30
|
+
(constant) @name
|
|
31
|
+
(scope_resolution
|
|
32
|
+
name: (_) @name)
|
|
33
|
+
]) @definition.class
|
|
34
|
+
(singleton_class
|
|
35
|
+
value: [
|
|
36
|
+
(constant) @name
|
|
37
|
+
(scope_resolution
|
|
38
|
+
name: (_) @name)
|
|
39
|
+
]) @definition.class
|
|
40
|
+
]
|
|
41
|
+
(#strip! @doc "^#\\s*")
|
|
42
|
+
(#select-adjacent! @doc @definition.class)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
; Module definitions
|
|
46
|
+
|
|
47
|
+
(
|
|
48
|
+
(module
|
|
49
|
+
name: [
|
|
50
|
+
(constant) @name
|
|
51
|
+
(scope_resolution
|
|
52
|
+
name: (_) @name)
|
|
53
|
+
]) @definition.module
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
; Calls
|
|
57
|
+
; NB: only explicit call nodes — the upstream tags.scm also tags bare
|
|
58
|
+
; [(identifier)(constant)] as @reference.call gated by (#is-not? local), but that
|
|
59
|
+
; predicate needs the paired @local.* captures (from locals.scm, which graft does
|
|
60
|
+
; not load) to mean anything. Without them it's a no-op, so bare *variable reads*
|
|
61
|
+
; that share a name with a same-file/unique method become bogus `calls` edges
|
|
62
|
+
; (resolve.ts can't tell a var read from a zero-arg call). Dropped for precision —
|
|
63
|
+
; consistent with every other breadth-tier query (all use explicit call nodes).
|
|
64
|
+
|
|
65
|
+
(call method: (identifier) @name) @reference.call
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
; Rust tags — standard tree-sitter tags convention (@definition.<kind> + @name + @reference.call).
|
|
2
|
+
; Vendored for graft's generic breadth tier. Predicates like (#strip! ...) are
|
|
3
|
+
; sanitized out at load time by generic.ts.
|
|
4
|
+
|
|
5
|
+
(function_item (identifier) @name) @definition.function
|
|
6
|
+
|
|
7
|
+
(function_signature_item (identifier) @name) @definition.function
|
|
8
|
+
|
|
9
|
+
(struct_item (type_identifier) @name) @definition.struct
|
|
10
|
+
|
|
11
|
+
(enum_item (type_identifier) @name) @definition.enum
|
|
12
|
+
|
|
13
|
+
(union_item (type_identifier) @name) @definition.struct
|
|
14
|
+
|
|
15
|
+
(trait_item (type_identifier) @name) @definition.interface
|
|
16
|
+
|
|
17
|
+
(type_item (type_identifier) @name) @definition.type
|
|
18
|
+
|
|
19
|
+
(mod_item (identifier) @name) @definition.module
|
|
20
|
+
|
|
21
|
+
(macro_definition (identifier) @name) @definition.function
|
|
22
|
+
|
|
23
|
+
(const_item (identifier) @name) @definition.constant
|
|
24
|
+
|
|
25
|
+
(static_item (identifier) @name) @definition.constant
|
|
26
|
+
|
|
27
|
+
; associated functions / methods inside impl blocks are function_item too,
|
|
28
|
+
; already captured above; call sites below:
|
|
29
|
+
|
|
30
|
+
(call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(identifier) @name
|
|
33
|
+
(field_expression field: (field_identifier) @name)
|
|
34
|
+
(scoped_identifier name: (identifier) @name)
|
|
35
|
+
]) @reference.call
|
|
36
|
+
|
|
37
|
+
(macro_invocation
|
|
38
|
+
macro: [
|
|
39
|
+
(identifier) @name
|
|
40
|
+
(scoped_identifier name: (identifier) @name)
|
|
41
|
+
]) @reference.call
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
; Definitions
|
|
2
|
+
|
|
3
|
+
(package_clause
|
|
4
|
+
name: (package_identifier) @name) @definition.module
|
|
5
|
+
|
|
6
|
+
(trait_definition
|
|
7
|
+
name: (identifier) @name) @definition.interface
|
|
8
|
+
|
|
9
|
+
(enum_definition
|
|
10
|
+
name: (identifier) @name) @definition.enum
|
|
11
|
+
|
|
12
|
+
(simple_enum_case
|
|
13
|
+
name: (identifier) @name) @definition.class
|
|
14
|
+
|
|
15
|
+
(full_enum_case
|
|
16
|
+
name: (identifier) @name) @definition.class
|
|
17
|
+
|
|
18
|
+
(class_definition
|
|
19
|
+
name: (identifier) @name) @definition.class
|
|
20
|
+
|
|
21
|
+
(object_definition
|
|
22
|
+
name: (identifier) @name) @definition.object
|
|
23
|
+
|
|
24
|
+
(function_definition
|
|
25
|
+
name: (identifier) @name) @definition.function
|
|
26
|
+
|
|
27
|
+
(val_definition
|
|
28
|
+
pattern: (identifier) @name) @definition.variable
|
|
29
|
+
|
|
30
|
+
(given_definition
|
|
31
|
+
name: (identifier) @name) @definition.variable
|
|
32
|
+
|
|
33
|
+
(var_definition
|
|
34
|
+
pattern: (identifier) @name) @definition.variable
|
|
35
|
+
|
|
36
|
+
(val_declaration
|
|
37
|
+
name: (identifier) @name) @definition.variable
|
|
38
|
+
|
|
39
|
+
(var_declaration
|
|
40
|
+
name: (identifier) @name) @definition.variable
|
|
41
|
+
|
|
42
|
+
(type_definition
|
|
43
|
+
name: (type_identifier) @name) @definition.type
|
|
44
|
+
|
|
45
|
+
(class_parameter
|
|
46
|
+
name: (identifier) @name) @definition.property
|
|
47
|
+
|
|
48
|
+
; References
|
|
49
|
+
|
|
50
|
+
(call_expression
|
|
51
|
+
(identifier) @name) @reference.call
|
|
52
|
+
|
|
53
|
+
(instance_expression
|
|
54
|
+
(type_identifier) @name) @reference.interface
|
|
55
|
+
|
|
56
|
+
(instance_expression
|
|
57
|
+
(generic_type
|
|
58
|
+
(type_identifier) @name)) @reference.interface
|
|
59
|
+
|
|
60
|
+
(extends_clause
|
|
61
|
+
(type_identifier) @name) @reference.class
|
|
62
|
+
|
|
63
|
+
(extends_clause
|
|
64
|
+
(generic_type
|
|
65
|
+
(type_identifier) @name)) @reference.class
|
|
66
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
;; Method and Function declarations
|
|
2
|
+
(contract_declaration (_
|
|
3
|
+
(function_definition
|
|
4
|
+
name: (identifier) @name) @definition.method))
|
|
5
|
+
|
|
6
|
+
(source_file
|
|
7
|
+
(function_definition
|
|
8
|
+
name: (identifier) @name) @definition.function)
|
|
9
|
+
|
|
10
|
+
;; Contract, struct, enum and interface declarations
|
|
11
|
+
(contract_declaration
|
|
12
|
+
name: (identifier) @name) @definition.class
|
|
13
|
+
|
|
14
|
+
(interface_declaration
|
|
15
|
+
name: (identifier) @name) @definition.interface
|
|
16
|
+
|
|
17
|
+
(library_declaration
|
|
18
|
+
name: (identifier) @name) @definition.interface
|
|
19
|
+
|
|
20
|
+
(struct_declaration name: (identifier) @name) @definition.class
|
|
21
|
+
(enum_declaration name: (identifier) @name) @definition.class
|
|
22
|
+
(event_definition name: (identifier) @name) @definition.class
|
|
23
|
+
|
|
24
|
+
;; Function calls
|
|
25
|
+
(call_expression (expression (identifier)) @name ) @reference.call
|
|
26
|
+
|
|
27
|
+
(call_expression
|
|
28
|
+
(expression (member_expression
|
|
29
|
+
property: (_) @name ))) @reference.call
|
|
30
|
+
|
|
31
|
+
;; Log emit
|
|
32
|
+
(emit_statement name: (_) @name) @reference.class
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
;; Inheritance
|
|
36
|
+
|
|
37
|
+
(inheritance_specifier
|
|
38
|
+
ancestor: (user_defined_type (_) @name . )) @reference.class
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
;; Imports ( note that unknown is not standardised )
|
|
42
|
+
(import_directive
|
|
43
|
+
import_name: (_) @name ) @reference.unknown
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
(class_declaration
|
|
2
|
+
name: (type_identifier) @name) @definition.class
|
|
3
|
+
|
|
4
|
+
(protocol_declaration
|
|
5
|
+
name: (type_identifier) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(class_declaration
|
|
8
|
+
(class_body
|
|
9
|
+
[
|
|
10
|
+
(function_declaration
|
|
11
|
+
name: (simple_identifier) @name
|
|
12
|
+
)
|
|
13
|
+
(subscript_declaration
|
|
14
|
+
(parameter (simple_identifier) @name)
|
|
15
|
+
)
|
|
16
|
+
(init_declaration "init" @name)
|
|
17
|
+
(deinit_declaration "deinit" @name)
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
) @definition.method
|
|
21
|
+
|
|
22
|
+
(protocol_declaration
|
|
23
|
+
(protocol_body
|
|
24
|
+
[
|
|
25
|
+
(protocol_function_declaration
|
|
26
|
+
name: (simple_identifier) @name
|
|
27
|
+
)
|
|
28
|
+
(subscript_declaration
|
|
29
|
+
(parameter (simple_identifier) @name)
|
|
30
|
+
)
|
|
31
|
+
(init_declaration "init" @name)
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
) @definition.method
|
|
35
|
+
|
|
36
|
+
(class_declaration
|
|
37
|
+
(class_body
|
|
38
|
+
[
|
|
39
|
+
(property_declaration
|
|
40
|
+
(pattern (simple_identifier) @name)
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
)
|
|
44
|
+
) @definition.property
|
|
45
|
+
|
|
46
|
+
(property_declaration
|
|
47
|
+
(pattern (simple_identifier) @name)
|
|
48
|
+
) @definition.property
|
|
49
|
+
|
|
50
|
+
(function_declaration
|
|
51
|
+
name: (simple_identifier) @name) @definition.function
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/graph/resolve.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,EAAY,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C;;sDAEsD;AACtD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B;;6FAEyF;IACzF,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,GAAE,cAAmB,GACxB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/graph/resolve.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,EAAY,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C;;sDAEsD;AACtD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B;;6FAEyF;IACzF,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,GAAE,cAAmB,GACxB,MAAM,EAAE,CAiGV"}
|
package/dist/graph/resolve.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Resolve {@link RawEdge} intents into concrete {@link EdgeV1} edges by matching
|
|
3
3
|
* names/specifiers against the whole-repo node index.
|
|
4
4
|
*
|
|
5
|
-
* Confidence
|
|
5
|
+
* Confidence is a two-tier provenance model:
|
|
6
6
|
* - `extracted`: the target is certain — a match within the same file, an
|
|
7
7
|
* import specifier, or a structural containment.
|
|
8
8
|
* - `inferred`: a bare function target was resolved by a unique name match
|
|
@@ -103,10 +103,20 @@ export function resolveEdges(nodes, rawEdges, opts = {}) {
|
|
|
103
103
|
if (hit)
|
|
104
104
|
add(e.source, hit.id, "calls", hit.confidence);
|
|
105
105
|
// No owner-qualified match means the call is unresolved. A unique bare
|
|
106
|
-
// method name is not evidence that this receiver has that method
|
|
106
|
+
// method name is not evidence that this receiver has that method — a
|
|
107
|
+
// name-fallback here was measured to HALVE call-edge precision (73%→37%
|
|
108
|
+
// vs a compiler-grade oracle) for a 3x count inflation, i.e. noise. See #35.
|
|
107
109
|
continue;
|
|
108
110
|
}
|
|
109
|
-
|
|
111
|
+
// Depth-tier bare calls are function calls (method calls arrive as viaMember
|
|
112
|
+
// with a receiver type). The generic breadth tier can't type receivers, so its
|
|
113
|
+
// tags.scm @reference.call/@reference.send capture ALL calls as bare names —
|
|
114
|
+
// in method-heavy languages (Java, Ruby, C#) those target methods. Widen the
|
|
115
|
+
// candidate kinds to methods ONLY for generic-origin sources, so depth-tier
|
|
116
|
+
// precision is untouched (an ambiguous function-vs-method name still drops).
|
|
117
|
+
const srcOrigin = byId.get(e.source)?.origin;
|
|
118
|
+
const callKinds = srcOrigin === "generic" ? ["function", "method"] : ["function"];
|
|
119
|
+
const hit = resolveName(e.name, e.file, callKinds, perFileName, globalName);
|
|
110
120
|
if (hit)
|
|
111
121
|
add(e.source, hit.id, "calls", hit.confidence); // drop unresolved calls (too noisy)
|
|
112
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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C1B,IAAI,OAAO,GAAkB,IAAI,CAAC;QAClC,IAAI,IAAI,KAAK,GAAG,CAAC,MAAM;YAAE,OAAO,GAAG,EAAE,CAAC;aACjC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC;YAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACxF,IAAI,OAAO,KAAK,IAAI;YAAE,SAAS;QAC/B,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM;YAAE,IAAI,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;IACnF,CAAC;IACD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,CAAC,+CAA+C;IAEvE,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** True when `dir` is a graft root of either shape — a built repo or a workspace parent. */
|
|
2
|
+
export declare function hasGraftIndex(dir: string): boolean;
|
|
3
|
+
export interface RootResolution {
|
|
4
|
+
/** Absolute dir to run the command against. */
|
|
5
|
+
root: string;
|
|
6
|
+
/** Directory levels walked up; 0 when the start dir was already the root (the common case). */
|
|
7
|
+
levels: number;
|
|
8
|
+
}
|
|
9
|
+
/** The nearest ancestor of `start` (inclusive) that holds a graft index, else `start`. */
|
|
10
|
+
export declare function nearestGraftRoot(start: string, override?: string): RootResolution;
|
|
11
|
+
//# sourceMappingURL=root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/graph/root.ts"],"names":[],"mappings":"AAqBA,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/F,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,CAUjF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where "here" is when a query names no directory. An agent session — or a plain
|
|
3
|
+
* shell — started in a subdirectory of an indexed repo should still find the
|
|
4
|
+
* graph, so the implicit root is the nearest ANCESTOR holding a graft index:
|
|
5
|
+
* either a repo's own wiring graph (`graft/.graph/wiring.json`) or a workspace
|
|
6
|
+
* parent's children index (`graft/workspace.json`). Nothing indexed anywhere
|
|
7
|
+
* above → the start dir itself, so `graft build` in a fresh repo still means
|
|
8
|
+
* "here" and no command silently retargets a sibling tree.
|
|
9
|
+
*
|
|
10
|
+
* Only the IMPLICIT case walks. An explicit `[dir]` argument is taken at face
|
|
11
|
+
* value, and a `--dir` override short-circuits entirely: `contextDirFor` returns
|
|
12
|
+
* an override verbatim and ignores the root it is handed, so every ancestor
|
|
13
|
+
* would report the same context dir and the walk would answer "level 0" for a
|
|
14
|
+
* dir that isn't the repo.
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
17
|
+
import { dirname, resolve } from "node:path";
|
|
18
|
+
import { contextDirFor } from "../context/node-file.js";
|
|
19
|
+
import { wiringPath } from "./write.js";
|
|
20
|
+
import { workspacePath } from "./workspace.js";
|
|
21
|
+
/** True when `dir` is a graft root of either shape — a built repo or a workspace parent. */
|
|
22
|
+
export function hasGraftIndex(dir) {
|
|
23
|
+
return existsSync(wiringPath(contextDirFor(dir))) || existsSync(workspacePath(dir));
|
|
24
|
+
}
|
|
25
|
+
/** The nearest ancestor of `start` (inclusive) that holds a graft index, else `start`. */
|
|
26
|
+
export function nearestGraftRoot(start, override) {
|
|
27
|
+
const from = resolve(start);
|
|
28
|
+
if (override)
|
|
29
|
+
return { root: from, levels: 0 };
|
|
30
|
+
let dir = from;
|
|
31
|
+
for (let levels = 0;; levels++) {
|
|
32
|
+
if (hasGraftIndex(dir))
|
|
33
|
+
return { root: dir, levels };
|
|
34
|
+
const up = dirname(dir);
|
|
35
|
+
if (up === dir)
|
|
36
|
+
return { root: from, levels: 0 }; // hit the filesystem root, nothing indexed
|
|
37
|
+
dir = up;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/graph/root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,4FAA4F;AAC5F,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AACtF,CAAC;AASD,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,QAAiB;IAC/D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC/C,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,KAAK,IAAI,MAAM,GAAG,CAAC,GAAI,MAAM,EAAE,EAAE,CAAC;QAChC,IAAI,aAAa,CAAC,GAAG,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QACrD,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,EAAE,KAAK,GAAG;YAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,2CAA2C;QAC7F,GAAG,GAAG,EAAE,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-files.d.ts","sourceRoot":"","sources":["../../src/graph/source-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-files.d.ts","sourceRoot":"","sources":["../../src/graph/source-files.ts"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,MAAM,EAAkD,GAClE,MAAM,EAAE,CAOV;AAED,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ;;oEAEgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAYhG"}
|
|
@@ -12,6 +12,7 @@ import { walkDir } from "../ingest/fs.js";
|
|
|
12
12
|
import { relPosix } from "../util/paths.js";
|
|
13
13
|
import { readIncludeDirs } from "../util/state.js";
|
|
14
14
|
import { languageOf } from "./extract.js";
|
|
15
|
+
import { genericLangOf } from "./generic.js";
|
|
15
16
|
/**
|
|
16
17
|
* The source files a graph build parses: supported languages, minus the
|
|
17
18
|
* output dir. When no pre-enumerated `repoFiles` is passed, the walk reads
|
|
@@ -21,7 +22,10 @@ import { languageOf } from "./extract.js";
|
|
|
21
22
|
* to the `graft build --include-dir` invocation that set it.
|
|
22
23
|
*/
|
|
23
24
|
export function listSourceFiles(root, outDir, repoFiles = walkDir(root, readIncludeDirs(resolve(root)))) {
|
|
24
|
-
|
|
25
|
+
// A file is a source file if a depth-tier grammar (languageOf) OR a breadth-tier
|
|
26
|
+
// grammar (genericLangOf) claims its extension. Both must agree here or `build`
|
|
27
|
+
// and `check` would enumerate different sets.
|
|
28
|
+
return repoFiles.filter((f) => !f.startsWith(outDir) && (languageOf(f) !== null || genericLangOf(f) !== null));
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
31
|
* {@link listSourceFiles} plus each file's `(size, mtimeMs)` — the currency of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-files.js","sourceRoot":"","sources":["../../src/graph/source-files.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAA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QACD,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-cli.d.ts","sourceRoot":"","sources":["../../src/graph/traverse-cli.ts"],"names":[],"mappings":"AAeA,OAAO,
|
|
1
|
+
{"version":3,"file":"traverse-cli.d.ts","sourceRoot":"","sources":["../../src/graph/traverse-cli.ts"],"names":[],"mappings":"AAeA,OAAO,EAA2B,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAA2B,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;kFAEkF;AAClF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;sEACsE;AACtE,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAKtF;AAED;;;sCAGsC;AACtC,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,EAAE,CAAA;CAAE,EAAE,GAC7C,OAAO,GAAG,SAAS,CAOrB;AAED;;;;;;mFAMmF;AACnF,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAQ/F;AAiDD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,IAAI,CA0E3F"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { resolve } from "node:path";
|
|
15
15
|
import { contextDirFor } from "../context/node-file.js";
|
|
16
|
-
import {
|
|
16
|
+
import { withSavings, savingsFor } from "../context/savings.js";
|
|
17
17
|
import { loadGraphCached } from "./load.js";
|
|
18
18
|
import { resolveSymbol, edgeWalk } from "./traverse.js";
|
|
19
19
|
const ARROW = { in: "←", out: "→" };
|
|
@@ -162,6 +162,6 @@ export function runCallersCommand(query, dir, opts) {
|
|
|
162
162
|
lines.push("");
|
|
163
163
|
}
|
|
164
164
|
const body = lines.join("\n").replace(/\n+$/, "\n");
|
|
165
|
-
process.stdout.write(
|
|
165
|
+
process.stdout.write(withSavings(body, saved));
|
|
166
166
|
}
|
|
167
167
|
//# sourceMappingURL=traverse-cli.js.map
|