@colbymchenry/codegraph-win32-arm64 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codegraph +1 -1
- package/bin/codegraph.cmd +1 -1
- package/lib/dist/.test-build-engine.json +1 -1
- package/lib/dist/.test-build-viewer.json +1 -1
- package/lib/dist/bin/codegraph.d.ts +3 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +425 -688
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.js +1 -57
- package/lib/dist/bin/command-supervision.js.map +1 -1
- package/lib/dist/bin/fatal-handler.js +0 -46
- package/lib/dist/bin/fatal-handler.js.map +1 -1
- package/lib/dist/bin/node-version-check.js +0 -33
- package/lib/dist/bin/node-version-check.js.map +1 -1
- package/lib/dist/bin/uninstall.js +0 -19
- package/lib/dist/bin/uninstall.js.map +1 -1
- package/lib/dist/bin/viewer-gate.js +0 -14
- package/lib/dist/bin/viewer-gate.js.map +1 -1
- package/lib/dist/compile-cache.d.ts +2 -0
- package/lib/dist/compile-cache.d.ts.map +1 -0
- package/lib/dist/compile-cache.js +45 -0
- package/lib/dist/compile-cache.js.map +1 -0
- package/lib/dist/context/formatter.js +3 -66
- package/lib/dist/context/formatter.js.map +1 -1
- package/lib/dist/context/index.d.ts +44 -1
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +123 -430
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/context/markers.js +0 -17
- package/lib/dist/context/markers.js.map +1 -1
- package/lib/dist/db/index.d.ts +44 -1
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +123 -395
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +11 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +71 -79
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/name-substring-index.d.ts +63 -0
- package/lib/dist/db/name-substring-index.d.ts.map +1 -0
- package/lib/dist/db/name-substring-index.js +151 -0
- package/lib/dist/db/name-substring-index.js.map +1 -0
- package/lib/dist/db/node-sqlite.d.ts +19 -0
- package/lib/dist/db/node-sqlite.d.ts.map +1 -0
- package/lib/dist/db/node-sqlite.js +23 -0
- package/lib/dist/db/node-sqlite.js.map +1 -0
- package/lib/dist/db/open-error.d.ts +36 -0
- package/lib/dist/db/open-error.d.ts.map +1 -0
- package/lib/dist/db/open-error.js +63 -0
- package/lib/dist/db/open-error.js.map +1 -0
- package/lib/dist/db/parameter-flow-queries.d.ts +120 -0
- package/lib/dist/db/parameter-flow-queries.d.ts.map +1 -0
- package/lib/dist/db/parameter-flow-queries.js +168 -0
- package/lib/dist/db/parameter-flow-queries.js.map +1 -0
- package/lib/dist/db/queries.d.ts +610 -33
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +1345 -1419
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/reference-tail.d.ts +83 -0
- package/lib/dist/db/reference-tail.d.ts.map +1 -0
- package/lib/dist/db/reference-tail.js +68 -0
- package/lib/dist/db/reference-tail.js.map +1 -0
- package/lib/dist/db/schema.sql +18 -2
- package/lib/dist/db/sqlite-adapter.d.ts +18 -1
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/lib/dist/db/sqlite-adapter.js +12 -62
- package/lib/dist/db/sqlite-adapter.js.map +1 -1
- package/lib/dist/db/synthesis-stage.d.ts.map +1 -1
- package/lib/dist/db/synthesis-stage.js +2 -6
- package/lib/dist/db/synthesis-stage.js.map +1 -1
- package/lib/dist/db/wal-valve.js +1 -153
- package/lib/dist/db/wal-valve.js.map +1 -1
- package/lib/dist/db/wsl-shared-index.js +0 -37
- package/lib/dist/db/wsl-shared-index.js.map +1 -1
- package/lib/dist/directory.d.ts +51 -0
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +76 -530
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/engine.d.ts +15 -0
- package/lib/dist/engine.d.ts.map +1 -0
- package/lib/dist/engine.js +34 -0
- package/lib/dist/engine.js.map +1 -0
- package/lib/dist/errors.d.ts +10 -0
- package/lib/dist/errors.d.ts.map +1 -1
- package/lib/dist/errors.js +8 -101
- package/lib/dist/errors.js.map +1 -1
- package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/astro-extractor.js +11 -101
- package/lib/dist/extraction/astro-extractor.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +27 -1
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/cfml-extractor.js +66 -204
- package/lib/dist/extraction/cfml-extractor.js.map +1 -1
- package/lib/dist/extraction/commonjs-requires.js +0 -31
- package/lib/dist/extraction/commonjs-requires.js.map +1 -1
- package/lib/dist/extraction/dfm-extractor.js +0 -21
- package/lib/dist/extraction/dfm-extractor.js.map +1 -1
- package/lib/dist/extraction/extraction-version.d.ts +1 -1
- package/lib/dist/extraction/extraction-version.js +1 -24
- package/lib/dist/extraction/extraction-version.js.map +1 -1
- package/lib/dist/extraction/function-ref.d.ts +40 -0
- package/lib/dist/extraction/function-ref.d.ts.map +1 -1
- package/lib/dist/extraction/function-ref.js +145 -206
- package/lib/dist/extraction/function-ref.js.map +1 -1
- package/lib/dist/extraction/generated-detection.js +0 -165
- package/lib/dist/extraction/generated-detection.js.map +1 -1
- package/lib/dist/extraction/grammars.d.ts +45 -4
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +53 -430
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +197 -7
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +554 -1382
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/kernel/decode.js +0 -16
- package/lib/dist/extraction/kernel/decode.js.map +1 -1
- package/lib/dist/extraction/kernel/index.d.ts +3 -1
- package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
- package/lib/dist/extraction/kernel/index.js +25 -133
- package/lib/dist/extraction/kernel/index.js.map +1 -1
- package/lib/dist/extraction/kernel/layout.js +42 -76
- package/lib/dist/extraction/kernel/layout.js.map +1 -1
- package/lib/dist/extraction/kernel/loader.js +0 -37
- package/lib/dist/extraction/kernel/loader.js.map +1 -1
- package/lib/dist/extraction/languages/arkts.js +0 -59
- package/lib/dist/extraction/languages/arkts.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts +125 -28
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +789 -856
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/cfquery.js +0 -9
- package/lib/dist/extraction/languages/cfquery.js.map +1 -1
- package/lib/dist/extraction/languages/cfscript.d.ts +20 -0
- package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/cfscript.js +80 -9
- package/lib/dist/extraction/languages/cfscript.js.map +1 -1
- package/lib/dist/extraction/languages/cobol.js +0 -114
- package/lib/dist/extraction/languages/cobol.js.map +1 -1
- package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts +66 -0
- package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cpp-brace-scopes.js +343 -0
- package/lib/dist/extraction/languages/cpp-brace-scopes.js.map +1 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.d.ts +41 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.d.ts.map +1 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.js +487 -0
- package/lib/dist/extraction/languages/cpp-macro-methods.js.map +1 -0
- package/lib/dist/extraction/languages/csharp.js +3 -55
- package/lib/dist/extraction/languages/csharp.js.map +1 -1
- package/lib/dist/extraction/languages/dart.d.ts +84 -0
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
- package/lib/dist/extraction/languages/dart.js +329 -161
- package/lib/dist/extraction/languages/dart.js.map +1 -1
- package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
- package/lib/dist/extraction/languages/erlang.js +15 -102
- package/lib/dist/extraction/languages/erlang.js.map +1 -1
- package/lib/dist/extraction/languages/go.d.ts +48 -0
- package/lib/dist/extraction/languages/go.d.ts.map +1 -1
- package/lib/dist/extraction/languages/go.js +102 -31
- package/lib/dist/extraction/languages/go.js.map +1 -1
- package/lib/dist/extraction/languages/index.js +0 -6
- package/lib/dist/extraction/languages/index.js.map +1 -1
- package/lib/dist/extraction/languages/java.d.ts.map +1 -1
- package/lib/dist/extraction/languages/java.js +67 -78
- package/lib/dist/extraction/languages/java.js.map +1 -1
- package/lib/dist/extraction/languages/javascript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/javascript.js +2 -12
- package/lib/dist/extraction/languages/javascript.js.map +1 -1
- package/lib/dist/extraction/languages/kotlin.d.ts +11 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/lib/dist/extraction/languages/kotlin.js +35 -184
- package/lib/dist/extraction/languages/kotlin.js.map +1 -1
- package/lib/dist/extraction/languages/lua.js +2 -39
- package/lib/dist/extraction/languages/lua.js.map +1 -1
- package/lib/dist/extraction/languages/luau.js +0 -14
- package/lib/dist/extraction/languages/luau.js.map +1 -1
- package/lib/dist/extraction/languages/nix.js +0 -16
- package/lib/dist/extraction/languages/nix.js.map +1 -1
- package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
- package/lib/dist/extraction/languages/objc.js +5 -16
- package/lib/dist/extraction/languages/objc.js.map +1 -1
- package/lib/dist/extraction/languages/pascal-preparse.d.ts +66 -0
- package/lib/dist/extraction/languages/pascal-preparse.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal-preparse.js +958 -0
- package/lib/dist/extraction/languages/pascal-preparse.js.map +1 -0
- package/lib/dist/extraction/languages/pascal-system.d.ts +11 -0
- package/lib/dist/extraction/languages/pascal-system.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal-system.js +23 -0
- package/lib/dist/extraction/languages/pascal-system.js.map +1 -0
- package/lib/dist/extraction/languages/pascal.d.ts.map +1 -1
- package/lib/dist/extraction/languages/pascal.js +3 -4
- package/lib/dist/extraction/languages/pascal.js.map +1 -1
- package/lib/dist/extraction/languages/php.js +5 -42
- package/lib/dist/extraction/languages/php.js.map +1 -1
- package/lib/dist/extraction/languages/python.js +2 -20
- package/lib/dist/extraction/languages/python.js.map +1 -1
- package/lib/dist/extraction/languages/r.js +8 -78
- package/lib/dist/extraction/languages/r.js.map +1 -1
- package/lib/dist/extraction/languages/ruby.d.ts.map +1 -1
- package/lib/dist/extraction/languages/ruby.js +17 -25
- package/lib/dist/extraction/languages/ruby.js.map +1 -1
- package/lib/dist/extraction/languages/rust.d.ts +10 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
- package/lib/dist/extraction/languages/rust.js +15 -47
- package/lib/dist/extraction/languages/rust.js.map +1 -1
- package/lib/dist/extraction/languages/scala.js +5 -41
- package/lib/dist/extraction/languages/scala.js.map +1 -1
- package/lib/dist/extraction/languages/solidity.js +1 -82
- package/lib/dist/extraction/languages/solidity.js.map +1 -1
- package/lib/dist/extraction/languages/swift.js +3 -47
- package/lib/dist/extraction/languages/swift.js.map +1 -1
- package/lib/dist/extraction/languages/terraform.js +6 -152
- package/lib/dist/extraction/languages/terraform.js.map +1 -1
- package/lib/dist/extraction/languages/typescript.d.ts +64 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/typescript.js +73 -49
- package/lib/dist/extraction/languages/typescript.js.map +1 -1
- package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -1
- package/lib/dist/extraction/languages/vbnet.js +9 -42
- package/lib/dist/extraction/languages/vbnet.js.map +1 -1
- package/lib/dist/extraction/lazy-frameworks.d.ts +15 -0
- package/lib/dist/extraction/lazy-frameworks.d.ts.map +1 -0
- package/lib/dist/extraction/lazy-frameworks.js +8 -0
- package/lib/dist/extraction/lazy-frameworks.js.map +1 -0
- package/lib/dist/extraction/liquid-extractor.d.ts +29 -3
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/liquid-extractor.js +89 -148
- package/lib/dist/extraction/liquid-extractor.js.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +0 -78
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/parse-budget.js +0 -13
- package/lib/dist/extraction/parse-budget.js.map +1 -1
- package/lib/dist/extraction/parse-pool.d.ts +29 -5
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +42 -174
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.d.ts +1 -1
- package/lib/dist/extraction/parse-worker.d.ts.map +1 -1
- package/lib/dist/extraction/parse-worker.js +5 -58
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/razor-extractor.d.ts +9 -0
- package/lib/dist/extraction/razor-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/razor-extractor.js +45 -69
- package/lib/dist/extraction/razor-extractor.js.map +1 -1
- package/lib/dist/extraction/razor-script.d.ts +23 -0
- package/lib/dist/extraction/razor-script.d.ts.map +1 -0
- package/lib/dist/extraction/razor-script.js +244 -0
- package/lib/dist/extraction/razor-script.js.map +1 -0
- package/lib/dist/extraction/sfc-script.d.ts +42 -0
- package/lib/dist/extraction/sfc-script.d.ts.map +1 -1
- package/lib/dist/extraction/sfc-script.js +32 -31
- package/lib/dist/extraction/sfc-script.js.map +1 -1
- package/lib/dist/extraction/store-worker.d.ts +1 -1
- package/lib/dist/extraction/store-worker.d.ts.map +1 -1
- package/lib/dist/extraction/store-worker.js +1 -38
- package/lib/dist/extraction/store-worker.js.map +1 -1
- package/lib/dist/extraction/store-writer.js +2 -34
- package/lib/dist/extraction/store-writer.js.map +1 -1
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/svelte-extractor.js +11 -87
- package/lib/dist/extraction/svelte-extractor.js.map +1 -1
- package/lib/dist/extraction/syntax-tokens.d.ts +6 -5
- package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -1
- package/lib/dist/extraction/syntax-tokens.js +4 -152
- package/lib/dist/extraction/syntax-tokens.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +37 -1
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +76 -68
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +102 -22
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.js +0 -7
- package/lib/dist/extraction/tree-sitter-types.js.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +447 -9
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +1908 -2544
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vue-extractor.d.ts +13 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vue-extractor.js +52 -92
- package/lib/dist/extraction/vue-extractor.js.map +1 -1
- package/lib/dist/extraction/vue-options-api.js +0 -32
- package/lib/dist/extraction/vue-options-api.js.map +1 -1
- package/lib/dist/extraction/vue-template-calls.d.ts +37 -0
- package/lib/dist/extraction/vue-template-calls.d.ts.map +1 -0
- package/lib/dist/extraction/vue-template-calls.js +497 -0
- package/lib/dist/extraction/vue-template-calls.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/lib/dist/extraction/wasm-runtime-flags.d.ts +6 -0
- package/lib/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/lib/dist/extraction/wasm-runtime-flags.js +1 -88
- package/lib/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/lib/dist/file-limits.d.ts +8 -0
- package/lib/dist/file-limits.d.ts.map +1 -1
- package/lib/dist/file-limits.js +13 -28
- package/lib/dist/file-limits.js.map +1 -1
- package/lib/dist/graph/branch-guards.d.ts.map +1 -1
- package/lib/dist/graph/branch-guards.js +4 -251
- package/lib/dist/graph/branch-guards.js.map +1 -1
- package/lib/dist/graph/call-sites.d.ts +12 -0
- package/lib/dist/graph/call-sites.d.ts.map +1 -0
- package/lib/dist/graph/call-sites.js +17 -0
- package/lib/dist/graph/call-sites.js.map +1 -0
- package/lib/dist/graph/cobol-copybooks.d.ts +75 -0
- package/lib/dist/graph/cobol-copybooks.d.ts.map +1 -0
- package/lib/dist/graph/cobol-copybooks.js +45 -0
- package/lib/dist/graph/cobol-copybooks.js.map +1 -0
- package/lib/dist/graph/dead-code.d.ts +26 -4
- package/lib/dist/graph/dead-code.d.ts.map +1 -1
- package/lib/dist/graph/dead-code.js +157 -311
- package/lib/dist/graph/dead-code.js.map +1 -1
- package/lib/dist/graph/dynamic-boundary-report.js +1 -88
- package/lib/dist/graph/dynamic-boundary-report.js.map +1 -1
- package/lib/dist/graph/file-cycles.d.ts +20 -0
- package/lib/dist/graph/file-cycles.d.ts.map +1 -0
- package/lib/dist/graph/file-cycles.js +79 -0
- package/lib/dist/graph/file-cycles.js.map +1 -0
- package/lib/dist/graph/go-package.d.ts +27 -0
- package/lib/dist/graph/go-package.d.ts.map +1 -0
- package/lib/dist/graph/go-package.js +49 -0
- package/lib/dist/graph/go-package.js.map +1 -0
- package/lib/dist/graph/index.d.ts +2 -0
- package/lib/dist/graph/index.d.ts.map +1 -1
- package/lib/dist/graph/index.js +4 -6
- package/lib/dist/graph/index.js.map +1 -1
- package/lib/dist/graph/named-symbol-flow.d.ts +5 -1
- package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -1
- package/lib/dist/graph/named-symbol-flow.js +82 -223
- package/lib/dist/graph/named-symbol-flow.js.map +1 -1
- package/lib/dist/graph/owning-package.d.ts +59 -0
- package/lib/dist/graph/owning-package.d.ts.map +1 -0
- package/lib/dist/graph/owning-package.js +120 -0
- package/lib/dist/graph/owning-package.js.map +1 -0
- package/lib/dist/graph/queries.d.ts +2 -2
- package/lib/dist/graph/queries.d.ts.map +1 -1
- package/lib/dist/graph/queries.js +2 -135
- package/lib/dist/graph/queries.js.map +1 -1
- package/lib/dist/graph/symbol-lookup.d.ts +15 -3
- package/lib/dist/graph/symbol-lookup.d.ts.map +1 -1
- package/lib/dist/graph/symbol-lookup.js +47 -89
- package/lib/dist/graph/symbol-lookup.js.map +1 -1
- package/lib/dist/graph/synthesized-hop.d.ts +37 -0
- package/lib/dist/graph/synthesized-hop.d.ts.map +1 -0
- package/lib/dist/graph/synthesized-hop.js +62 -0
- package/lib/dist/graph/synthesized-hop.js.map +1 -0
- package/lib/dist/graph/test-code.d.ts +21 -0
- package/lib/dist/graph/test-code.d.ts.map +1 -0
- package/lib/dist/graph/test-code.js +50 -0
- package/lib/dist/graph/test-code.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +31 -2
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +98 -226
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/graph/type-hierarchy.js +0 -138
- package/lib/dist/graph/type-hierarchy.js.map +1 -1
- package/lib/dist/index.d.ts +190 -25
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +694 -1109
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/beta-signup.js +0 -39
- package/lib/dist/installer/beta-signup.js.map +1 -1
- package/lib/dist/installer/config-writer.js +0 -24
- package/lib/dist/installer/config-writer.js.map +1 -1
- package/lib/dist/installer/index.d.ts +9 -5
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +25 -159
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/instructions-template.d.ts +1 -1
- package/lib/dist/installer/instructions-template.js +0 -37
- package/lib/dist/installer/instructions-template.js.map +1 -1
- package/lib/dist/installer/targets/antigravity.js +0 -113
- package/lib/dist/installer/targets/antigravity.js.map +1 -1
- package/lib/dist/installer/targets/bob.d.ts +20 -0
- package/lib/dist/installer/targets/bob.d.ts.map +1 -0
- package/lib/dist/installer/targets/bob.js +83 -0
- package/lib/dist/installer/targets/bob.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +1 -185
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/codex.d.ts.map +1 -1
- package/lib/dist/installer/targets/codex.js +17 -109
- package/lib/dist/installer/targets/codex.js.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.js +2 -54
- package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
- package/lib/dist/installer/targets/copilot-jetbrains.js +0 -57
- package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -1
- package/lib/dist/installer/targets/copilot-vscode.js +0 -58
- package/lib/dist/installer/targets/copilot-vscode.js.map +1 -1
- package/lib/dist/installer/targets/cursor.js +7 -88
- package/lib/dist/installer/targets/cursor.js.map +1 -1
- package/lib/dist/installer/targets/droid.d.ts +18 -0
- package/lib/dist/installer/targets/droid.d.ts.map +1 -0
- package/lib/dist/installer/targets/droid.js +92 -0
- package/lib/dist/installer/targets/droid.js.map +1 -0
- package/lib/dist/installer/targets/dsh.d.ts +35 -0
- package/lib/dist/installer/targets/dsh.d.ts.map +1 -0
- package/lib/dist/installer/targets/dsh.js +267 -0
- package/lib/dist/installer/targets/dsh.js.map +1 -0
- package/lib/dist/installer/targets/gemini.js +0 -37
- package/lib/dist/installer/targets/gemini.js.map +1 -1
- package/lib/dist/installer/targets/grok.d.ts +25 -0
- package/lib/dist/installer/targets/grok.d.ts.map +1 -0
- package/lib/dist/installer/targets/grok.js +96 -0
- package/lib/dist/installer/targets/grok.js.map +1 -0
- package/lib/dist/installer/targets/hermes.d.ts +19 -7
- package/lib/dist/installer/targets/hermes.d.ts.map +1 -1
- package/lib/dist/installer/targets/hermes.js +218 -214
- package/lib/dist/installer/targets/hermes.js.map +1 -1
- package/lib/dist/installer/targets/json-config.d.ts +45 -0
- package/lib/dist/installer/targets/json-config.d.ts.map +1 -0
- package/lib/dist/installer/targets/json-config.js +128 -0
- package/lib/dist/installer/targets/json-config.js.map +1 -0
- package/lib/dist/installer/targets/kimi.d.ts +21 -0
- package/lib/dist/installer/targets/kimi.d.ts.map +1 -0
- package/lib/dist/installer/targets/kimi.js +97 -0
- package/lib/dist/installer/targets/kimi.js.map +1 -0
- package/lib/dist/installer/targets/kiro.js +1 -41
- package/lib/dist/installer/targets/kiro.js.map +1 -1
- package/lib/dist/installer/targets/opencode.js +0 -102
- package/lib/dist/installer/targets/opencode.js.map +1 -1
- package/lib/dist/installer/targets/pi.d.ts +24 -0
- package/lib/dist/installer/targets/pi.d.ts.map +1 -0
- package/lib/dist/installer/targets/pi.js +100 -0
- package/lib/dist/installer/targets/pi.js.map +1 -0
- package/lib/dist/installer/targets/qoder.d.ts +23 -0
- package/lib/dist/installer/targets/qoder.d.ts.map +1 -0
- package/lib/dist/installer/targets/qoder.js +83 -0
- package/lib/dist/installer/targets/qoder.js.map +1 -0
- package/lib/dist/installer/targets/qwen.d.ts +21 -0
- package/lib/dist/installer/targets/qwen.d.ts.map +1 -0
- package/lib/dist/installer/targets/qwen.js +115 -0
- package/lib/dist/installer/targets/qwen.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -1
- package/lib/dist/installer/targets/registry.js +18 -25
- package/lib/dist/installer/targets/registry.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts +81 -11
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +183 -129
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/installer/targets/toml.d.ts +82 -6
- package/lib/dist/installer/targets/toml.d.ts.map +1 -1
- package/lib/dist/installer/targets/toml.js +318 -112
- package/lib/dist/installer/targets/toml.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +1 -1
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/installer/targets/types.js +0 -13
- package/lib/dist/installer/targets/types.js.map +1 -1
- package/lib/dist/installer/targets/windsurf.d.ts +22 -0
- package/lib/dist/installer/targets/windsurf.d.ts.map +1 -0
- package/lib/dist/installer/targets/windsurf.js +90 -0
- package/lib/dist/installer/targets/windsurf.js.map +1 -0
- package/lib/dist/lazy-engine.d.ts +22 -0
- package/lib/dist/lazy-engine.d.ts.map +1 -0
- package/lib/dist/lazy-engine.js +16 -0
- package/lib/dist/lazy-engine.js.map +1 -0
- package/lib/dist/mcp/answer-freshness.js +0 -6
- package/lib/dist/mcp/answer-freshness.js.map +1 -1
- package/lib/dist/mcp/daemon-manager.js +2 -23
- package/lib/dist/mcp/daemon-manager.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +2 -85
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-registry.d.ts +40 -0
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +174 -137
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +23 -0
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +89 -373
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +4 -78
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/early-ppid.js +0 -24
- package/lib/dist/mcp/early-ppid.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts +8 -0
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +33 -152
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/explore-dedup.js +0 -108
- package/lib/dist/mcp/explore-dedup.js.map +1 -1
- package/lib/dist/mcp/explore-diagnostics.js +0 -116
- package/lib/dist/mcp/explore-diagnostics.js.map +1 -1
- package/lib/dist/mcp/explore-session-state.js +0 -129
- package/lib/dist/mcp/explore-session-state.js.map +1 -1
- package/lib/dist/mcp/index-freshness-worker.js +1 -6
- package/lib/dist/mcp/index-freshness-worker.js.map +1 -1
- package/lib/dist/mcp/index-freshness.js +0 -15
- package/lib/dist/mcp/index-freshness.js.map +1 -1
- package/lib/dist/mcp/index-version-warning.d.ts +21 -0
- package/lib/dist/mcp/index-version-warning.d.ts.map +1 -0
- package/lib/dist/mcp/index-version-warning.js +38 -0
- package/lib/dist/mcp/index-version-warning.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +19 -1
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +118 -293
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +13 -3
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +106 -121
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/ppid-watchdog.js +0 -24
- package/lib/dist/mcp/ppid-watchdog.js.map +1 -1
- package/lib/dist/mcp/process-identity.d.ts +42 -0
- package/lib/dist/mcp/process-identity.d.ts.map +1 -0
- package/lib/dist/mcp/process-identity.js +130 -0
- package/lib/dist/mcp/process-identity.js.map +1 -0
- package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -1
- package/lib/dist/mcp/project-lifecycle.js +50 -17
- package/lib/dist/mcp/project-lifecycle.js.map +1 -1
- package/lib/dist/mcp/proxy.d.ts +17 -6
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +74 -248
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +43 -3
- package/lib/dist/mcp/query-pool.d.ts.map +1 -1
- package/lib/dist/mcp/query-pool.js +109 -123
- package/lib/dist/mcp/query-pool.js.map +1 -1
- package/lib/dist/mcp/query-worker.js +24 -36
- package/lib/dist/mcp/query-worker.js.map +1 -1
- package/lib/dist/mcp/server-instructions.js +0 -31
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/session.d.ts +27 -0
- package/lib/dist/mcp/session.d.ts.map +1 -1
- package/lib/dist/mcp/session.js +29 -130
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.js +1 -48
- package/lib/dist/mcp/startup-handshake.js.map +1 -1
- package/lib/dist/mcp/stdin-teardown.js +0 -28
- package/lib/dist/mcp/stdin-teardown.js.map +1 -1
- package/lib/dist/mcp/stdout-teardown.d.ts +26 -0
- package/lib/dist/mcp/stdout-teardown.d.ts.map +1 -0
- package/lib/dist/mcp/stdout-teardown.js +20 -0
- package/lib/dist/mcp/stdout-teardown.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +127 -18
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +661 -3590
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/mcp/transport.d.ts.map +1 -1
- package/lib/dist/mcp/transport.js +4 -96
- package/lib/dist/mcp/transport.js.map +1 -1
- package/lib/dist/mcp/version.d.ts +13 -1
- package/lib/dist/mcp/version.d.ts.map +1 -1
- package/lib/dist/mcp/version.js +19 -21
- package/lib/dist/mcp/version.js.map +1 -1
- package/lib/dist/mcp/writer-lock.d.ts +11 -0
- package/lib/dist/mcp/writer-lock.d.ts.map +1 -1
- package/lib/dist/mcp/writer-lock.js +49 -46
- package/lib/dist/mcp/writer-lock.js.map +1 -1
- package/lib/dist/project-config.js +1 -138
- package/lib/dist/project-config.js.map +1 -1
- package/lib/dist/resolution/alias-binding.d.ts +7 -0
- package/lib/dist/resolution/alias-binding.d.ts.map +1 -1
- package/lib/dist/resolution/alias-binding.js +7 -56
- package/lib/dist/resolution/alias-binding.js.map +1 -1
- package/lib/dist/resolution/ambient-modules.d.ts +185 -0
- package/lib/dist/resolution/ambient-modules.d.ts.map +1 -0
- package/lib/dist/resolution/ambient-modules.js +732 -0
- package/lib/dist/resolution/ambient-modules.js.map +1 -0
- package/lib/dist/resolution/angular-template-synthesizer.d.ts +48 -1
- package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/angular-template-synthesizer.js +401 -65
- package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -1
- package/lib/dist/resolution/c-feature-variants.d.ts +40 -0
- package/lib/dist/resolution/c-feature-variants.d.ts.map +1 -0
- package/lib/dist/resolution/c-feature-variants.js +249 -0
- package/lib/dist/resolution/c-feature-variants.js.map +1 -0
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/c-fnptr-synthesizer.js +23 -391
- package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/lib/dist/resolution/c-macro-renames.d.ts +25 -0
- package/lib/dist/resolution/c-macro-renames.d.ts.map +1 -0
- package/lib/dist/resolution/c-macro-renames.js +95 -0
- package/lib/dist/resolution/c-macro-renames.js.map +1 -0
- package/lib/dist/resolution/callback-synthesizer.d.ts +15 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +1355 -1270
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/const-alias-synthesizer.d.ts +48 -0
- package/lib/dist/resolution/const-alias-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/const-alias-synthesizer.js +234 -0
- package/lib/dist/resolution/const-alias-synthesizer.js.map +1 -0
- package/lib/dist/resolution/cooperative-yield.js +0 -27
- package/lib/dist/resolution/cooperative-yield.js.map +1 -1
- package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -1
- package/lib/dist/resolution/cpp-constructor.js +15 -17
- package/lib/dist/resolution/cpp-constructor.js.map +1 -1
- package/lib/dist/resolution/cpp-includers.d.ts +46 -0
- package/lib/dist/resolution/cpp-includers.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-includers.js +153 -0
- package/lib/dist/resolution/cpp-includers.js.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts +16 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -1
- package/lib/dist/resolution/cpp-macro-visibility.js +17 -68
- package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -1
- package/lib/dist/resolution/cpp-namespaces.d.ts +54 -0
- package/lib/dist/resolution/cpp-namespaces.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-namespaces.js +151 -0
- package/lib/dist/resolution/cpp-namespaces.js.map +1 -0
- package/lib/dist/resolution/cpp-raw-strings.d.ts +33 -0
- package/lib/dist/resolution/cpp-raw-strings.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-raw-strings.js +167 -0
- package/lib/dist/resolution/cpp-raw-strings.js.map +1 -0
- package/lib/dist/resolution/cpp-supertypes.d.ts +118 -0
- package/lib/dist/resolution/cpp-supertypes.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-supertypes.js +322 -0
- package/lib/dist/resolution/cpp-supertypes.js.map +1 -0
- package/lib/dist/resolution/cpp-template-instantiations.d.ts +83 -0
- package/lib/dist/resolution/cpp-template-instantiations.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-template-instantiations.js +983 -0
- package/lib/dist/resolution/cpp-template-instantiations.js.map +1 -0
- package/lib/dist/resolution/cpp-type-aliases.d.ts +194 -0
- package/lib/dist/resolution/cpp-type-aliases.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-type-aliases.js +648 -0
- package/lib/dist/resolution/cpp-type-aliases.js.map +1 -0
- package/lib/dist/resolution/dart-libraries.d.ts +75 -0
- package/lib/dist/resolution/dart-libraries.d.ts.map +1 -0
- package/lib/dist/resolution/dart-libraries.js +721 -0
- package/lib/dist/resolution/dart-libraries.js.map +1 -0
- package/lib/dist/resolution/dart-local-scope.d.ts +41 -0
- package/lib/dist/resolution/dart-local-scope.d.ts.map +1 -0
- package/lib/dist/resolution/dart-local-scope.js +565 -0
- package/lib/dist/resolution/dart-local-scope.js.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.js +0 -52
- package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/angular-router.js +41 -208
- package/lib/dist/resolution/frameworks/angular-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/astro.js +4 -60
- package/lib/dist/resolution/frameworks/astro.js.map +1 -1
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -1
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/cargo-workspace.js +65 -15
- package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -1
- package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/cics.js +7 -33
- package/lib/dist/resolution/frameworks/cics.js.map +1 -1
- package/lib/dist/resolution/frameworks/codeigniter.d.ts +23 -0
- package/lib/dist/resolution/frameworks/codeigniter.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/codeigniter.js +271 -0
- package/lib/dist/resolution/frameworks/codeigniter.js.map +1 -0
- package/lib/dist/resolution/frameworks/component-folder.d.ts +17 -0
- package/lib/dist/resolution/frameworks/component-folder.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/component-folder.js +11 -0
- package/lib/dist/resolution/frameworks/component-folder.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/csharp.js +5 -68
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
- package/lib/dist/resolution/frameworks/drupal.d.ts +17 -8
- package/lib/dist/resolution/frameworks/drupal.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/drupal.js +377 -142
- package/lib/dist/resolution/frameworks/drupal.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/expo-modules.js +8 -88
- package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/expo-router.js +9 -190
- package/lib/dist/resolution/frameworks/expo-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/express.js +182 -199
- package/lib/dist/resolution/frameworks/express.js.map +1 -1
- package/lib/dist/resolution/frameworks/fabric.js +1 -104
- package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/go.js +14 -43
- package/lib/dist/resolution/frameworks/go.js.map +1 -1
- package/lib/dist/resolution/frameworks/goframe.js +1 -55
- package/lib/dist/resolution/frameworks/goframe.js.map +1 -1
- package/lib/dist/resolution/frameworks/index.d.ts +13 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +12 -50
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +203 -129
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/laravel.js +2 -125
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
- package/lib/dist/resolution/frameworks/name-heuristic.js +0 -12
- package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.js +2 -199
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
- package/lib/dist/resolution/frameworks/next-proxy.d.ts +67 -0
- package/lib/dist/resolution/frameworks/next-proxy.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/next-proxy.js +239 -0
- package/lib/dist/resolution/frameworks/next-proxy.js.map +1 -0
- package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/nextjs.js +10 -66
- package/lib/dist/resolution/frameworks/nextjs.js.map +1 -1
- package/lib/dist/resolution/frameworks/object-literal.js +0 -21
- package/lib/dist/resolution/frameworks/object-literal.js.map +1 -1
- package/lib/dist/resolution/frameworks/package-deps.d.ts +11 -7
- package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/package-deps.js +35 -26
- package/lib/dist/resolution/frameworks/package-deps.js.map +1 -1
- package/lib/dist/resolution/frameworks/page-component.js +0 -14
- package/lib/dist/resolution/frameworks/page-component.js.map +1 -1
- package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/play.js +26 -34
- package/lib/dist/resolution/frameworks/play.js.map +1 -1
- package/lib/dist/resolution/frameworks/python.js +5 -102
- package/lib/dist/resolution/frameworks/python.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.js +1 -166
- package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-router.d.ts +13 -4
- package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react-router.js +10 -82
- package/lib/dist/resolution/frameworks/react-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/react.d.ts +57 -0
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react.js +1449 -191
- package/lib/dist/resolution/frameworks/react.js.map +1 -1
- package/lib/dist/resolution/frameworks/ruby.js +1 -61
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/rust.js +35 -56
- package/lib/dist/resolution/frameworks/rust.js.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.js +7 -75
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/sveltekit-router.js +8 -46
- package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/swift-objc.js +0 -97
- package/lib/dist/resolution/frameworks/swift-objc.js.map +1 -1
- package/lib/dist/resolution/frameworks/swift.js +0 -97
- package/lib/dist/resolution/frameworks/swift.js.map +1 -1
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/tanstack-router.js +9 -130
- package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/terraform.js +1 -85
- package/lib/dist/resolution/frameworks/terraform.js.map +1 -1
- package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/vue-router.js +11 -134
- package/lib/dist/resolution/frameworks/vue-router.js.map +1 -1
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/vue.js +42 -114
- package/lib/dist/resolution/frameworks/vue.js.map +1 -1
- package/lib/dist/resolution/go-func-field-synthesizer.d.ts +58 -0
- package/lib/dist/resolution/go-func-field-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/go-func-field-synthesizer.js +696 -0
- package/lib/dist/resolution/go-func-field-synthesizer.js.map +1 -0
- package/lib/dist/resolution/go-module.d.ts +23 -7
- package/lib/dist/resolution/go-module.d.ts.map +1 -1
- package/lib/dist/resolution/go-module.js +21 -24
- package/lib/dist/resolution/go-module.js.map +1 -1
- package/lib/dist/resolution/go-stdlib-methods.d.ts +9 -0
- package/lib/dist/resolution/go-stdlib-methods.d.ts.map +1 -0
- package/lib/dist/resolution/go-stdlib-methods.js +224 -0
- package/lib/dist/resolution/go-stdlib-methods.js.map +1 -0
- package/lib/dist/resolution/goframe-synthesizer.js +2 -53
- package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
- package/lib/dist/resolution/import-resolver.d.ts +276 -29
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +1670 -1380
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +415 -6
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +1323 -1037
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/js-builtins.d.ts +14 -0
- package/lib/dist/resolution/js-builtins.d.ts.map +1 -1
- package/lib/dist/resolution/js-builtins.js +14 -14
- package/lib/dist/resolution/js-builtins.js.map +1 -1
- package/lib/dist/resolution/js-class-expressions.d.ts +48 -0
- package/lib/dist/resolution/js-class-expressions.d.ts.map +1 -0
- package/lib/dist/resolution/js-class-expressions.js +25 -0
- package/lib/dist/resolution/js-class-expressions.js.map +1 -0
- package/lib/dist/resolution/js-super-calls.d.ts +18 -0
- package/lib/dist/resolution/js-super-calls.d.ts.map +1 -0
- package/lib/dist/resolution/js-super-calls.js +94 -0
- package/lib/dist/resolution/js-super-calls.js.map +1 -0
- package/lib/dist/resolution/jsx-code.d.ts +28 -0
- package/lib/dist/resolution/jsx-code.d.ts.map +1 -0
- package/lib/dist/resolution/jsx-code.js +459 -0
- package/lib/dist/resolution/jsx-code.js.map +1 -0
- package/lib/dist/resolution/lru-cache.d.ts +5 -13
- package/lib/dist/resolution/lru-cache.d.ts.map +1 -1
- package/lib/dist/resolution/lru-cache.js +43 -32
- package/lib/dist/resolution/lru-cache.js.map +1 -1
- package/lib/dist/resolution/memory-budget.js +0 -52
- package/lib/dist/resolution/memory-budget.js.map +1 -1
- package/lib/dist/resolution/module-importers.d.ts +185 -0
- package/lib/dist/resolution/module-importers.d.ts.map +1 -0
- package/lib/dist/resolution/module-importers.js +588 -0
- package/lib/dist/resolution/module-importers.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +858 -7
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +21030 -5110
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/next-router-synthesizer.d.ts +19 -0
- package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/next-router-synthesizer.js +46 -28
- package/lib/dist/resolution/next-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/override-parameters.d.ts +40 -0
- package/lib/dist/resolution/override-parameters.d.ts.map +1 -0
- package/lib/dist/resolution/override-parameters.js +339 -0
- package/lib/dist/resolution/override-parameters.js.map +1 -0
- package/lib/dist/resolution/parameter-flow.d.ts +218 -0
- package/lib/dist/resolution/parameter-flow.d.ts.map +1 -0
- package/lib/dist/resolution/parameter-flow.js +474 -0
- package/lib/dist/resolution/parameter-flow.js.map +1 -0
- package/lib/dist/resolution/pascal-scope.d.ts +91 -0
- package/lib/dist/resolution/pascal-scope.d.ts.map +1 -0
- package/lib/dist/resolution/pascal-scope.js +961 -0
- package/lib/dist/resolution/pascal-scope.js.map +1 -0
- package/lib/dist/resolution/path-aliases.d.ts +32 -4
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
- package/lib/dist/resolution/path-aliases.js +43 -110
- package/lib/dist/resolution/path-aliases.js.map +1 -1
- package/lib/dist/resolution/project-scans.d.ts +38 -0
- package/lib/dist/resolution/project-scans.d.ts.map +1 -0
- package/lib/dist/resolution/project-scans.js +30 -0
- package/lib/dist/resolution/project-scans.js.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/react-router-synthesizer.js +3 -55
- package/lib/dist/resolution/react-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/resolver-pool.d.ts +23 -2
- package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
- package/lib/dist/resolution/resolver-pool.js +43 -111
- package/lib/dist/resolution/resolver-pool.js.map +1 -1
- package/lib/dist/resolution/resolver-worker.d.ts +1 -1
- package/lib/dist/resolution/resolver-worker.d.ts.map +1 -1
- package/lib/dist/resolution/resolver-worker.js +8 -37
- package/lib/dist/resolution/resolver-worker.js.map +1 -1
- package/lib/dist/resolution/resurrect-ref.d.ts +25 -0
- package/lib/dist/resolution/resurrect-ref.d.ts.map +1 -0
- package/lib/dist/resolution/resurrect-ref.js +19 -0
- package/lib/dist/resolution/resurrect-ref.js.map +1 -0
- package/lib/dist/resolution/ruby-constant-paths.d.ts +56 -0
- package/lib/dist/resolution/ruby-constant-paths.d.ts.map +1 -0
- package/lib/dist/resolution/ruby-constant-paths.js +255 -0
- package/lib/dist/resolution/ruby-constant-paths.js.map +1 -0
- package/lib/dist/resolution/ruby-parameter-flow.d.ts +10 -0
- package/lib/dist/resolution/ruby-parameter-flow.d.ts.map +1 -0
- package/lib/dist/resolution/ruby-parameter-flow.js +801 -0
- package/lib/dist/resolution/ruby-parameter-flow.js.map +1 -0
- package/lib/dist/resolution/rust-scopes.d.ts +120 -0
- package/lib/dist/resolution/rust-scopes.d.ts.map +1 -0
- package/lib/dist/resolution/rust-scopes.js +730 -0
- package/lib/dist/resolution/rust-scopes.js.map +1 -0
- package/lib/dist/resolution/shopify-themes.d.ts +10 -0
- package/lib/dist/resolution/shopify-themes.d.ts.map +1 -0
- package/lib/dist/resolution/shopify-themes.js +19 -0
- package/lib/dist/resolution/shopify-themes.js.map +1 -0
- package/lib/dist/resolution/strip-comments.d.ts +20 -1
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +164 -119
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/sveltekit-synthesizer.js +0 -64
- package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -1
- package/lib/dist/resolution/swift-objc-bridge.js +0 -160
- package/lib/dist/resolution/swift-objc-bridge.js.map +1 -1
- package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -1
- package/lib/dist/resolution/swift-type-visibility.js +2 -101
- package/lib/dist/resolution/swift-type-visibility.js.map +1 -1
- package/lib/dist/resolution/synth-utils.js +1 -22
- package/lib/dist/resolution/synth-utils.js.map +1 -1
- package/lib/dist/resolution/tanstack-router-synthesizer.js +0 -32
- package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/tauri-synthesizer.d.ts +37 -0
- package/lib/dist/resolution/tauri-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tauri-synthesizer.js +1038 -0
- package/lib/dist/resolution/tauri-synthesizer.js.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.js +4 -170
- package/lib/dist/resolution/tier-synthesizer.js.map +1 -1
- package/lib/dist/resolution/type-parameters.d.ts +23 -0
- package/lib/dist/resolution/type-parameters.d.ts.map +1 -1
- package/lib/dist/resolution/type-parameters.js +52 -54
- package/lib/dist/resolution/type-parameters.js.map +1 -1
- package/lib/dist/resolution/types.d.ts +183 -11
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/types.js +0 -47
- package/lib/dist/resolution/types.js.map +1 -1
- package/lib/dist/resolution/vbnet-receivers.d.ts +92 -0
- package/lib/dist/resolution/vbnet-receivers.d.ts.map +1 -0
- package/lib/dist/resolution/vbnet-receivers.js +1482 -0
- package/lib/dist/resolution/vbnet-receivers.js.map +1 -0
- package/lib/dist/resolution/vue-router-synthesizer.js +0 -31
- package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -1
- package/lib/dist/resolution/workspace-packages.d.ts +206 -15
- package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
- package/lib/dist/resolution/workspace-packages.js +570 -152
- package/lib/dist/resolution/workspace-packages.js.map +1 -1
- package/lib/dist/search/identifier-segments.js +2 -93
- package/lib/dist/search/identifier-segments.js.map +1 -1
- package/lib/dist/search/query-parser.js +0 -54
- package/lib/dist/search/query-parser.js.map +1 -1
- package/lib/dist/search/query-paths.js +0 -167
- package/lib/dist/search/query-paths.js.map +1 -1
- package/lib/dist/search/query-utils.d.ts +44 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -1
- package/lib/dist/search/query-utils.js +120 -198
- package/lib/dist/search/query-utils.js.map +1 -1
- package/lib/dist/sync/git-hooks.d.ts +14 -5
- package/lib/dist/sync/git-hooks.d.ts.map +1 -1
- package/lib/dist/sync/git-hooks.js +118 -65
- package/lib/dist/sync/git-hooks.js.map +1 -1
- package/lib/dist/sync/index.js +0 -14
- package/lib/dist/sync/index.js.map +1 -1
- package/lib/dist/sync/watch-policy.js +0 -45
- package/lib/dist/sync/watch-policy.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +29 -11
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +83 -487
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts +7 -2
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +24 -97
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/telemetry/index.d.ts.map +1 -1
- package/lib/dist/telemetry/index.js +15 -135
- package/lib/dist/telemetry/index.js.map +1 -1
- package/lib/dist/types.d.ts +46 -0
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +15 -44
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/ui/color.js +0 -19
- package/lib/dist/ui/color.js.map +1 -1
- package/lib/dist/ui/glyphs.js +2 -45
- package/lib/dist/ui/glyphs.js.map +1 -1
- package/lib/dist/ui/shimmer-progress.js +0 -21
- package/lib/dist/ui/shimmer-progress.js.map +1 -1
- package/lib/dist/ui/shimmer-worker.js +0 -22
- package/lib/dist/ui/shimmer-worker.js.map +1 -1
- package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -1
- package/lib/dist/ui-server/api/deadcode.js +2 -31
- package/lib/dist/ui-server/api/deadcode.js.map +1 -1
- package/lib/dist/ui-server/api/effects.js +0 -111
- package/lib/dist/ui-server/api/effects.js.map +1 -1
- package/lib/dist/ui-server/api/entrypoints.js +0 -142
- package/lib/dist/ui-server/api/entrypoints.js.map +1 -1
- package/lib/dist/ui-server/api/events.js +0 -145
- package/lib/dist/ui-server/api/events.js.map +1 -1
- package/lib/dist/ui-server/api/file.js +0 -80
- package/lib/dist/ui-server/api/file.js.map +1 -1
- package/lib/dist/ui-server/api/filecode.js +0 -95
- package/lib/dist/ui-server/api/filecode.js.map +1 -1
- package/lib/dist/ui-server/api/flow.js +0 -149
- package/lib/dist/ui-server/api/flow.js.map +1 -1
- package/lib/dist/ui-server/api/hierarchy.js +0 -28
- package/lib/dist/ui-server/api/hierarchy.js.map +1 -1
- package/lib/dist/ui-server/api/index.js +0 -88
- package/lib/dist/ui-server/api/index.js.map +1 -1
- package/lib/dist/ui-server/api/map.d.ts.map +1 -1
- package/lib/dist/ui-server/api/map.js +4 -317
- package/lib/dist/ui-server/api/map.js.map +1 -1
- package/lib/dist/ui-server/api/node.js +0 -111
- package/lib/dist/ui-server/api/node.js.map +1 -1
- package/lib/dist/ui-server/api/nodes.js +0 -16
- package/lib/dist/ui-server/api/nodes.js.map +1 -1
- package/lib/dist/ui-server/api/program.js +0 -90
- package/lib/dist/ui-server/api/program.js.map +1 -1
- package/lib/dist/ui-server/api/respond.js +0 -60
- package/lib/dist/ui-server/api/respond.js.map +1 -1
- package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -1
- package/lib/dist/ui-server/api/route-roots.js +2 -44
- package/lib/dist/ui-server/api/route-roots.js.map +1 -1
- package/lib/dist/ui-server/api/routes.d.ts.map +1 -1
- package/lib/dist/ui-server/api/routes.js +4 -60
- package/lib/dist/ui-server/api/routes.js.map +1 -1
- package/lib/dist/ui-server/api/screens.d.ts.map +1 -1
- package/lib/dist/ui-server/api/screens.js +4 -174
- package/lib/dist/ui-server/api/screens.js.map +1 -1
- package/lib/dist/ui-server/api/search.js +0 -62
- package/lib/dist/ui-server/api/search.js.map +1 -1
- package/lib/dist/ui-server/api/session.js +0 -58
- package/lib/dist/ui-server/api/session.js.map +1 -1
- package/lib/dist/ui-server/api/source.d.ts.map +1 -1
- package/lib/dist/ui-server/api/source.js +0 -161
- package/lib/dist/ui-server/api/source.js.map +1 -1
- package/lib/dist/ui-server/api/stats.js +0 -58
- package/lib/dist/ui-server/api/stats.js.map +1 -1
- package/lib/dist/ui-server/api/steps.d.ts.map +1 -1
- package/lib/dist/ui-server/api/steps.js +5 -381
- package/lib/dist/ui-server/api/steps.js.map +1 -1
- package/lib/dist/ui-server/api/trail-store.d.ts +3 -3
- package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -1
- package/lib/dist/ui-server/api/trail-store.js +24 -106
- package/lib/dist/ui-server/api/trail-store.js.map +1 -1
- package/lib/dist/ui-server/api/trails.d.ts.map +1 -1
- package/lib/dist/ui-server/api/trails.js +19 -94
- package/lib/dist/ui-server/api/trails.js.map +1 -1
- package/lib/dist/ui-server/api/when.js +0 -36
- package/lib/dist/ui-server/api/when.js.map +1 -1
- package/lib/dist/ui-server/api/wire.js +0 -58
- package/lib/dist/ui-server/api/wire.js.map +1 -1
- package/lib/dist/ui-server/assets.js +0 -35
- package/lib/dist/ui-server/assets.js.map +1 -1
- package/lib/dist/ui-server/constants.js +0 -26
- package/lib/dist/ui-server/constants.js.map +1 -1
- package/lib/dist/ui-server/highlight/bounded-tokenize.js +0 -25
- package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -1
- package/lib/dist/ui-server/highlight/index.js +1 -132
- package/lib/dist/ui-server/highlight/index.js.map +1 -1
- package/lib/dist/ui-server/highlight/languages.d.ts +3 -3
- package/lib/dist/ui-server/highlight/languages.js +0 -31
- package/lib/dist/ui-server/highlight/languages.js.map +1 -1
- package/lib/dist/ui-server/highlight/tokenize-worker.js +0 -5
- package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -1
- package/lib/dist/ui-server/index.d.ts +25 -0
- package/lib/dist/ui-server/index.d.ts.map +1 -1
- package/lib/dist/ui-server/index.js +35 -103
- package/lib/dist/ui-server/index.js.map +1 -1
- package/lib/dist/ui-server/open-browser.js +0 -34
- package/lib/dist/ui-server/open-browser.js.map +1 -1
- package/lib/dist/ui-server/security.d.ts +5 -0
- package/lib/dist/ui-server/security.d.ts.map +1 -1
- package/lib/dist/ui-server/security.js +11 -147
- package/lib/dist/ui-server/security.js.map +1 -1
- package/lib/dist/ui-server/static.js +0 -41
- package/lib/dist/ui-server/static.js.map +1 -1
- package/lib/dist/upgrade/index.d.ts +18 -5
- package/lib/dist/upgrade/index.d.ts.map +1 -1
- package/lib/dist/upgrade/index.js +73 -229
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/dist/upgrade/remove-binary.js +2 -67
- package/lib/dist/upgrade/remove-binary.js.map +1 -1
- package/lib/dist/upgrade/update-check.js +1 -81
- package/lib/dist/upgrade/update-check.js.map +1 -1
- package/lib/dist/utils.d.ts +69 -1
- package/lib/dist/utils.d.ts.map +1 -1
- package/lib/dist/utils.js +224 -266
- package/lib/dist/utils.js.map +1 -1
- package/lib/dist/worker-teardown.js +0 -47
- package/lib/dist/worker-teardown.js.map +1 -1
- package/lib/kernel/codegraph-kernel.node +2 -2
- package/lib/node_modules/.package-lock.json +4 -4
- package/lib/node_modules/ignore/README.md +138 -8
- package/lib/node_modules/ignore/index.d.ts +56 -20
- package/lib/node_modules/ignore/index.js +1033 -221
- package/lib/node_modules/ignore/legacy.js +871 -178
- package/lib/node_modules/ignore/package.json +10 -4
- package/lib/package.json +14 -8
- package/node.exe +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,1038 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tauriEdges = tauriEdges;
|
|
4
|
+
exports.hasTauriPattern = hasTauriPattern;
|
|
5
|
+
const strip_comments_1 = require("./strip-comments");
|
|
6
|
+
const import_resolver_1 = require("./import-resolver");
|
|
7
|
+
const query_utils_1 = require("../search/query-utils");
|
|
8
|
+
const expo_router_1 = require("./frameworks/expo-router");
|
|
9
|
+
const synth_utils_1 = require("./synth-utils");
|
|
10
|
+
const tier_synthesizer_1 = require("./tier-synthesizer");
|
|
11
|
+
const name_matcher_1 = require("./name-matcher");
|
|
12
|
+
const FRONTEND_FILE = /\.(?:[cm]?[jt]sx?|vue|svelte)$/;
|
|
13
|
+
const FRONTEND_GATE = /invoke|listen|once|\bemit|\bcommands\b|\bevents\b|__TAURI/;
|
|
14
|
+
const RUST_GATE = /\btauri|generate_handler|collect_commands|\.\s*(?:emit|listen|once)/;
|
|
15
|
+
const MAX_VARIANTS = 6;
|
|
16
|
+
const EVENT_FANOUT_CAP = 16;
|
|
17
|
+
const API_ROOT = '@tauri-apps/api';
|
|
18
|
+
const CORE_MODULES = new Set([`${API_ROOT}/core`, `${API_ROOT}/tauri`, API_ROOT]);
|
|
19
|
+
const EVENT_MODULE = `${API_ROOT}/event`;
|
|
20
|
+
const HANDLE_MODULES = new Set([`${API_ROOT}/window`, `${API_ROOT}/webviewWindow`, `${API_ROOT}/webview`]);
|
|
21
|
+
function escapeRe(s) {
|
|
22
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
23
|
+
}
|
|
24
|
+
const CLOSER = { '(': ')', '[': ']', '{': '}' };
|
|
25
|
+
function closeBracket(code, open) {
|
|
26
|
+
const stack = [CLOSER[code[open]]];
|
|
27
|
+
for (let i = open + 1; i < code.length; i++) {
|
|
28
|
+
const c = code[i];
|
|
29
|
+
if (CLOSER[c])
|
|
30
|
+
stack.push(CLOSER[c]);
|
|
31
|
+
else if (c === stack[stack.length - 1]) {
|
|
32
|
+
stack.pop();
|
|
33
|
+
if (stack.length === 0)
|
|
34
|
+
return i;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return -1;
|
|
38
|
+
}
|
|
39
|
+
function openBracket(code, close) {
|
|
40
|
+
const opener = code[close] === ')' ? '(' : code[close] === ']' ? '[' : '{';
|
|
41
|
+
let depth = 0;
|
|
42
|
+
for (let i = close; i >= 0; i--) {
|
|
43
|
+
const c = code[i];
|
|
44
|
+
if (c === code[close])
|
|
45
|
+
depth++;
|
|
46
|
+
else if (c === opener && --depth === 0)
|
|
47
|
+
return i;
|
|
48
|
+
}
|
|
49
|
+
return -1;
|
|
50
|
+
}
|
|
51
|
+
function argumentSpans(code, open) {
|
|
52
|
+
const close = closeBracket(code, open);
|
|
53
|
+
if (close < 0)
|
|
54
|
+
return [];
|
|
55
|
+
const spans = [];
|
|
56
|
+
let start = open + 1;
|
|
57
|
+
for (let i = open + 1; i < close; i++) {
|
|
58
|
+
const c = code[i];
|
|
59
|
+
if (CLOSER[c]) {
|
|
60
|
+
const end = closeBracket(code, i);
|
|
61
|
+
if (end < 0)
|
|
62
|
+
return spans;
|
|
63
|
+
i = end;
|
|
64
|
+
}
|
|
65
|
+
else if (c === ',') {
|
|
66
|
+
spans.push([start, i]);
|
|
67
|
+
start = i + 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (code.slice(start, close).trim())
|
|
71
|
+
spans.push([start, close]);
|
|
72
|
+
return spans;
|
|
73
|
+
}
|
|
74
|
+
function skipSpace(s, i) {
|
|
75
|
+
while (i < s.length && /\s/.test(s[i]))
|
|
76
|
+
i++;
|
|
77
|
+
return i;
|
|
78
|
+
}
|
|
79
|
+
function skipTypeArguments(code, at) {
|
|
80
|
+
if (code[at] !== '<')
|
|
81
|
+
return at;
|
|
82
|
+
let depth = 0;
|
|
83
|
+
const limit = Math.min(code.length, at + 40_000);
|
|
84
|
+
for (let i = at; i < limit; i++) {
|
|
85
|
+
const c = code[i];
|
|
86
|
+
if (c === '<')
|
|
87
|
+
depth++;
|
|
88
|
+
else if (c === '>' && code[i - 1] !== '=' && --depth === 0)
|
|
89
|
+
return skipSpace(code, i + 1);
|
|
90
|
+
}
|
|
91
|
+
return at;
|
|
92
|
+
}
|
|
93
|
+
function words(name) {
|
|
94
|
+
return name.split('_').flatMap((part) => part.match(/[A-Z]+(?![a-z])|[A-Z]?[a-z0-9]+|[0-9]+/g) ?? []);
|
|
95
|
+
}
|
|
96
|
+
function toCamel(name) {
|
|
97
|
+
return words(name).map((w, i) => {
|
|
98
|
+
const lower = w.toLowerCase();
|
|
99
|
+
return i === 0 ? lower : lower.charAt(0).toUpperCase() + lower.slice(1);
|
|
100
|
+
}).join('');
|
|
101
|
+
}
|
|
102
|
+
function toKebab(name) {
|
|
103
|
+
return words(name).map((w) => w.toLowerCase()).join('-');
|
|
104
|
+
}
|
|
105
|
+
const HANDLER_LIST = /\b(?:generate_handler|collect_commands)\s*!\s*[[({]/g;
|
|
106
|
+
const PLUGIN_HEAD = /\bBuilder\s*(?:::\s*<[^;()]*>\s*)?::\s*(?:new\s*\(\s*(?:"([^"]+)"|([A-Z][A-Z0-9_]*))|default\s*\()|\.\s*plugin_name\s*\(\s*(?:"([^"]+)"|([A-Z][A-Z0-9_]*))/g;
|
|
107
|
+
const PLAIN_ATTRIBUTE = /^(?:cfg|cfg_attr|doc|allow|expect|warn|deny|forbid|inline|cold|must_use|deprecated|track_caller|test|ignore|no_mangle|rustfmt|clippy|instrument|tracing|specta|async_trait)\b/;
|
|
108
|
+
function readHandlerList(rust, constants, at, open) {
|
|
109
|
+
const close = closeBracket(rust.code, open);
|
|
110
|
+
if (close < 0)
|
|
111
|
+
return null;
|
|
112
|
+
const entries = [];
|
|
113
|
+
let opaque = false;
|
|
114
|
+
for (const [start, end] of argumentSpans(rust.code, open)) {
|
|
115
|
+
const item = rust.code.slice(start, end).replace(/#\s*\[[^\]]*\]/g, ' ').trim();
|
|
116
|
+
if (item.includes('$')) {
|
|
117
|
+
opaque = true;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const path = item.replace(/::\s*<[\s\S]*>$/, '').replace(/\s+/g, '');
|
|
121
|
+
if (!/^[A-Za-z_]\w*(?:::[A-Za-z_]\w*)*$/.test(path))
|
|
122
|
+
continue;
|
|
123
|
+
const segments = path.split('::');
|
|
124
|
+
const named = rust.code.indexOf(segments[segments.length - 1], end - item.length);
|
|
125
|
+
entries.push({ segments, line: rust.lineAt(named >= start && named < end ? named : start) });
|
|
126
|
+
}
|
|
127
|
+
return { file: rust.file, line: rust.lineAt(at), entries, opaque, plugin: pluginOf(rust, constants, at) };
|
|
128
|
+
}
|
|
129
|
+
function pluginOf(rust, constants, at) {
|
|
130
|
+
let plugin = null;
|
|
131
|
+
PLUGIN_HEAD.lastIndex = 0;
|
|
132
|
+
let m;
|
|
133
|
+
while ((m = PLUGIN_HEAD.exec(rust.text)) !== null && m.index < at) {
|
|
134
|
+
const literal = m[1] ?? m[3];
|
|
135
|
+
const constant = m[2] ?? m[4];
|
|
136
|
+
plugin = literal ?? (constant ? constants.get(constant) ?? null : null);
|
|
137
|
+
}
|
|
138
|
+
return plugin;
|
|
139
|
+
}
|
|
140
|
+
function attributesAbove(lines, startLine) {
|
|
141
|
+
const out = [lines[startLine - 1]?.trim() ?? ''];
|
|
142
|
+
for (let i = startLine - 2; i >= 0; i--) {
|
|
143
|
+
const line = lines[i].trim();
|
|
144
|
+
if (!line || line.startsWith('//'))
|
|
145
|
+
continue;
|
|
146
|
+
if (line.startsWith('#[') || line.endsWith(']') || line.endsWith(',') || line.endsWith('(')) {
|
|
147
|
+
out.push(line);
|
|
148
|
+
if (out.length > 16)
|
|
149
|
+
break;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
function isCommandFunction(node, ctx) {
|
|
157
|
+
return attributeNames(node, ctx).some((name) => !PLAIN_ATTRIBUTE.test(name));
|
|
158
|
+
}
|
|
159
|
+
function isDeclaredCommand(node, ctx) {
|
|
160
|
+
return attributeNames(node, ctx).some((name) => name === 'command' || name === 'tauri::command');
|
|
161
|
+
}
|
|
162
|
+
function attributeNames(node, ctx) {
|
|
163
|
+
if (node.decorators?.includes('tauri::command'))
|
|
164
|
+
return ['tauri::command'];
|
|
165
|
+
const lines = ctx.getFileLines?.(node.filePath) ?? ctx.readFile(node.filePath)?.split('\n');
|
|
166
|
+
if (!lines)
|
|
167
|
+
return [];
|
|
168
|
+
return attributesAbove(lines, node.startLine).flatMap((line) => {
|
|
169
|
+
const name = /^#\[\s*([A-Za-z_][\w:]*)/.exec(line)?.[1];
|
|
170
|
+
return name ? [name] : [];
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function moduleNames(file) {
|
|
174
|
+
const parts = file.replace(/\.rs$/, '').split('/');
|
|
175
|
+
const src = parts.lastIndexOf('src');
|
|
176
|
+
const names = src >= 0 ? parts.slice(Math.max(0, src - 1)).filter((_, i) => i !== 1 || src === 0) : parts.slice(-1);
|
|
177
|
+
return new Set(names.map((n) => n.replace(/-/g, '_')));
|
|
178
|
+
}
|
|
179
|
+
function pathScore(segments, node) {
|
|
180
|
+
const names = moduleNames(node.filePath);
|
|
181
|
+
return segments.slice(0, -1).filter((s) => names.has(s)).length;
|
|
182
|
+
}
|
|
183
|
+
function crateRoot(file, ctx, memo) {
|
|
184
|
+
const parts = file.split('/').slice(0, -1);
|
|
185
|
+
const seen = [];
|
|
186
|
+
for (let n = parts.length; n >= 0; n--) {
|
|
187
|
+
const dir = parts.slice(0, n).join('/');
|
|
188
|
+
const known = memo.get(dir);
|
|
189
|
+
if (known !== undefined) {
|
|
190
|
+
for (const d of seen)
|
|
191
|
+
memo.set(d, known);
|
|
192
|
+
return known;
|
|
193
|
+
}
|
|
194
|
+
seen.push(dir);
|
|
195
|
+
if (ctx.fileExists(dir ? `${dir}/Cargo.toml` : 'Cargo.toml')) {
|
|
196
|
+
for (const d of seen)
|
|
197
|
+
memo.set(d, dir);
|
|
198
|
+
return dir;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
for (const d of seen)
|
|
202
|
+
memo.set(d, '');
|
|
203
|
+
return '';
|
|
204
|
+
}
|
|
205
|
+
function conventionalRoot(file) {
|
|
206
|
+
const at = file.startsWith('src-tauri/') ? 0 : file.indexOf('/src-tauri/');
|
|
207
|
+
if (at < 0)
|
|
208
|
+
return null;
|
|
209
|
+
return file.slice(0, at);
|
|
210
|
+
}
|
|
211
|
+
function isWithin(file, root) {
|
|
212
|
+
return root === '' || file.startsWith(`${root}/`);
|
|
213
|
+
}
|
|
214
|
+
function addCommand(table, key, command) {
|
|
215
|
+
const known = table.get(key);
|
|
216
|
+
if (known === undefined)
|
|
217
|
+
table.set(key, command);
|
|
218
|
+
else if (known !== null && !sameNodes(known.nodes, command.nodes))
|
|
219
|
+
table.set(key, null);
|
|
220
|
+
}
|
|
221
|
+
function sameNodes(a, b) {
|
|
222
|
+
return a.length === b.length && a.every((n) => b.some((m) => m.id === n.id));
|
|
223
|
+
}
|
|
224
|
+
function commandsFor(entry, list, crates, ctx) {
|
|
225
|
+
const name = entry.segments[entry.segments.length - 1];
|
|
226
|
+
const named = ctx.getNodesByName(name).filter((n) => n.language === 'rust' && n.kind === 'function' && !(0, query_utils_1.isTestPath)(n.filePath));
|
|
227
|
+
let candidates = named.filter((n) => isCommandFunction(n, ctx));
|
|
228
|
+
if (candidates.length > 1) {
|
|
229
|
+
const scope = (file) => conventionalRoot(file) ?? crateRoot(file, ctx, crates);
|
|
230
|
+
const own = scope(list.file);
|
|
231
|
+
const sameScope = candidates.filter((n) => scope(n.filePath) === own);
|
|
232
|
+
if (sameScope.length > 0)
|
|
233
|
+
candidates = sameScope;
|
|
234
|
+
}
|
|
235
|
+
if (candidates.length > 1) {
|
|
236
|
+
const scores = candidates.map((n) => pathScore(entry.segments, n));
|
|
237
|
+
const best = Math.max(...scores);
|
|
238
|
+
candidates = candidates.filter((_, i) => scores[i] === best);
|
|
239
|
+
}
|
|
240
|
+
return candidates.length <= MAX_VARIANTS ? candidates : [];
|
|
241
|
+
}
|
|
242
|
+
function sameScope(a, b) {
|
|
243
|
+
return a === null || b === null || a === b;
|
|
244
|
+
}
|
|
245
|
+
function structInScope(found, scope) {
|
|
246
|
+
return found?.find((s) => s.scope === scope) ?? found?.find((s) => sameScope(s.scope, scope)) ?? null;
|
|
247
|
+
}
|
|
248
|
+
function addStruct(index, key, struct) {
|
|
249
|
+
const known = index.get(key);
|
|
250
|
+
if (known)
|
|
251
|
+
known.push(struct);
|
|
252
|
+
else
|
|
253
|
+
index.set(key, [struct]);
|
|
254
|
+
}
|
|
255
|
+
const STR_CONST = /\b(?:const|static)\s+([A-Z][A-Z0-9_]*)\s*:\s*&\s*(?:'static\s+)?str\s*=\s*"([^"\n]*)"/g;
|
|
256
|
+
const EVENT_DERIVE = /#\s*\[\s*derive\s*\(([^)]*)\)\s*\]/g;
|
|
257
|
+
const EVENT_ITEM = /^(?:\s*#\s*\[(?:[^\]]|\][^\s])*\])*\s*(?:pub(?:\s*\([^)]*\))?\s+)?(?:struct|enum)\s+([A-Za-z_]\w*)/;
|
|
258
|
+
const EVENT_RENAME = /#\s*\[\s*tauri_specta\s*\(\s*event_name\s*=\s*"([^"]+)"\s*\)\s*\]/;
|
|
259
|
+
const EMIT_CALL = /\.\s*(emit(?:_str|_all|_to|_str_to|_filter|_str_filter|_and_trigger)?)\s*(?:::\s*<[^()]*>\s*)?\(/g;
|
|
260
|
+
const LISTEN_CALL = /\.\s*(?:listen|once)(?:_any|_global)?\s*(?:::\s*<[^()]*>\s*)?\(/g;
|
|
261
|
+
const TYPED_LISTEN_CALL = /\b([A-Z]\w*)\s*::\s*(?:listen|once)(?:_any)?\s*\(/g;
|
|
262
|
+
function rustStringAt(rust, span, constants) {
|
|
263
|
+
if (!span)
|
|
264
|
+
return null;
|
|
265
|
+
const raw = rust.text.slice(span[0], span[1]).trim();
|
|
266
|
+
const literal = /^&?"([^"\\]*)"$/.exec(raw);
|
|
267
|
+
if (literal)
|
|
268
|
+
return literal[1];
|
|
269
|
+
const name = /^(?:[a-z_]\w*::)*([A-Z][A-Z0-9_]*)$/.exec(raw)?.[1];
|
|
270
|
+
return name ? constants.get(name) ?? null : null;
|
|
271
|
+
}
|
|
272
|
+
function typeAt(code, end) {
|
|
273
|
+
const head = /(?:[A-Za-z_]\w*\s*::\s*)*[A-Za-z_]\w*\s*$/.exec(code.slice(Math.max(0, end - 200), end + 1));
|
|
274
|
+
if (!head)
|
|
275
|
+
return null;
|
|
276
|
+
const segments = head[0].split('::').map((s) => s.trim());
|
|
277
|
+
for (let i = segments.length - 1; i >= 0; i--)
|
|
278
|
+
if (/^[A-Z]/.test(segments[i]))
|
|
279
|
+
return segments[i];
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
function localType(code, name, from, at) {
|
|
283
|
+
const n = escapeRe(name);
|
|
284
|
+
const pattern = new RegExp(`\\blet\\s+(?:mut\\s+)?${n}\\s*(?::\\s*&?\\s*(?:[a-z_]\\w*::)*([A-Z]\\w*)[^=;]*)?=\\s*&?\\s*(?:[a-z_]\\w*::)*([A-Z]\\w*)|\\b${n}\\s*:\\s*&?\\s*(?:[a-z_]\\w*::)*([A-Z]\\w*)`, 'g');
|
|
285
|
+
const body = code.slice(from, at);
|
|
286
|
+
let found = null;
|
|
287
|
+
let m;
|
|
288
|
+
while ((m = pattern.exec(body)) !== null)
|
|
289
|
+
found = m[1] ?? m[2] ?? m[3] ?? found;
|
|
290
|
+
return found;
|
|
291
|
+
}
|
|
292
|
+
function receiverType(code, dot, functionStart) {
|
|
293
|
+
let i = dot - 1;
|
|
294
|
+
while (i >= 0 && /\s/.test(code[i]))
|
|
295
|
+
i--;
|
|
296
|
+
if (i < 0)
|
|
297
|
+
return null;
|
|
298
|
+
const c = code[i];
|
|
299
|
+
if (c === ')' || c === '}') {
|
|
300
|
+
const open = openBracket(code, i);
|
|
301
|
+
if (open < 0)
|
|
302
|
+
return null;
|
|
303
|
+
let before = open - 1;
|
|
304
|
+
while (before >= 0 && /\s/.test(code[before]))
|
|
305
|
+
before--;
|
|
306
|
+
if (before >= 0 && /\w/.test(code[before]))
|
|
307
|
+
return typeAt(code, before);
|
|
308
|
+
return /^\s*&?\s*(?:[a-z_]\w*::)*([A-Z]\w*)/.exec(code.slice(open + 1, i))?.[1] ?? null;
|
|
309
|
+
}
|
|
310
|
+
if (!/\w/.test(c))
|
|
311
|
+
return null;
|
|
312
|
+
const word = /[A-Za-z_]\w*$/.exec(code.slice(Math.max(0, i - 120), i + 1))?.[0];
|
|
313
|
+
if (!word)
|
|
314
|
+
return null;
|
|
315
|
+
if (/^[A-Z]/.test(word))
|
|
316
|
+
return word;
|
|
317
|
+
return localType(code, word, functionStart, i);
|
|
318
|
+
}
|
|
319
|
+
function ownerOf(nodes, line, column) {
|
|
320
|
+
let best = null;
|
|
321
|
+
for (const n of nodes) {
|
|
322
|
+
if (!synth_utils_1.FN_KINDS.has(n.kind) || n.startLine > line || n.endLine < line)
|
|
323
|
+
continue;
|
|
324
|
+
if ((n.startLine === line && n.startColumn > column) || (n.endLine === line && n.endColumn <= column))
|
|
325
|
+
continue;
|
|
326
|
+
if (!best || n.startLine > best.startLine || (n.startLine === best.startLine && n.startColumn >= best.startColumn))
|
|
327
|
+
best = n;
|
|
328
|
+
}
|
|
329
|
+
return best ?? (0, synth_utils_1.enclosingValue)(nodes, line) ?? nodes.find((n) => n.kind === 'file') ?? null;
|
|
330
|
+
}
|
|
331
|
+
function columnAt(text, index) {
|
|
332
|
+
return index - (text.lastIndexOf('\n', index - 1) + 1);
|
|
333
|
+
}
|
|
334
|
+
function makeOffsetOfLine(source) {
|
|
335
|
+
let starts = null;
|
|
336
|
+
return (line) => {
|
|
337
|
+
if (!starts) {
|
|
338
|
+
starts = [0];
|
|
339
|
+
for (let i = source.indexOf('\n'); i !== -1; i = source.indexOf('\n', i + 1))
|
|
340
|
+
starts.push(i + 1);
|
|
341
|
+
}
|
|
342
|
+
return starts[Math.min(line, starts.length) - 1] ?? 0;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function readRustFile(file, source, ctx) {
|
|
346
|
+
const text = (0, strip_comments_1.stripCommentsForRegex)(source, 'rust');
|
|
347
|
+
return {
|
|
348
|
+
file, source, text, code: (0, strip_comments_1.blankStringContents)(text), nodes: ctx.getNodesInFile(file),
|
|
349
|
+
lineAt: (0, synth_utils_1.makeLineAt)(source, 1), offsetOfLine: makeOffsetOfLine(source),
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
function readEventStructs(rust, out) {
|
|
353
|
+
if (!rust.source.includes('tauri_specta'))
|
|
354
|
+
return;
|
|
355
|
+
EVENT_DERIVE.lastIndex = 0;
|
|
356
|
+
let m;
|
|
357
|
+
while ((m = EVENT_DERIVE.exec(rust.code)) !== null) {
|
|
358
|
+
if (!/\bEvent\b/.test(m[1]))
|
|
359
|
+
continue;
|
|
360
|
+
const item = EVENT_ITEM.exec(rust.code.slice(m.index + m[0].length, m.index + m[0].length + 4000));
|
|
361
|
+
if (!item)
|
|
362
|
+
continue;
|
|
363
|
+
const name = item[1];
|
|
364
|
+
const node = rust.nodes.find((n) => n.name === name && (n.kind === 'struct' || n.kind === 'enum'));
|
|
365
|
+
if (!node)
|
|
366
|
+
continue;
|
|
367
|
+
const span = rust.text.slice(Math.max(0, m.index - 400), m.index + m[0].length + item[0].length);
|
|
368
|
+
const event = EVENT_RENAME.exec(span.slice(span.lastIndexOf('}') + 1))?.[1] ?? toKebab(name);
|
|
369
|
+
const struct = { node, event, scope: out.scopeOf(rust.file) };
|
|
370
|
+
addStruct(out.byEvent, event, struct);
|
|
371
|
+
addStruct(out.byType, name, struct);
|
|
372
|
+
addStruct(out.byCamel, toCamel(name), struct);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function readEmitters(rust, constants, out) {
|
|
376
|
+
EMIT_CALL.lastIndex = 0;
|
|
377
|
+
let m;
|
|
378
|
+
while ((m = EMIT_CALL.exec(rust.code)) !== null) {
|
|
379
|
+
const open = m.index + m[0].length - 1;
|
|
380
|
+
const spans = argumentSpans(rust.code, open);
|
|
381
|
+
const line = rust.lineAt(m.index);
|
|
382
|
+
const column = columnAt(rust.source, m.index);
|
|
383
|
+
const owner = (0, synth_utils_1.enclosingFn)(rust.nodes, line);
|
|
384
|
+
if (!owner)
|
|
385
|
+
continue;
|
|
386
|
+
const targeted = /_to$/.test(m[1]);
|
|
387
|
+
let event = targeted && spans.length < 3 ? null : rustStringAt(rust, spans[targeted ? 1 : 0], constants);
|
|
388
|
+
if (event === null) {
|
|
389
|
+
const type = receiverType(rust.code, m.index, rust.offsetOfLine(owner.startLine));
|
|
390
|
+
event = type ? structInScope(out.byType.get(type), out.scopeOf(rust.file))?.event ?? null : null;
|
|
391
|
+
}
|
|
392
|
+
if (event !== null)
|
|
393
|
+
out.emitters.push({ node: owner, event, file: rust.file, line, column, rust: true, scope: out.scopeOf(rust.file) });
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function readListeners(rust, constants, out) {
|
|
397
|
+
LISTEN_CALL.lastIndex = 0;
|
|
398
|
+
let m;
|
|
399
|
+
while ((m = LISTEN_CALL.exec(rust.code)) !== null) {
|
|
400
|
+
const open = m.index + m[0].length - 1;
|
|
401
|
+
const spans = argumentSpans(rust.code, open);
|
|
402
|
+
const event = rustStringAt(rust, spans[0], constants);
|
|
403
|
+
if (event === null)
|
|
404
|
+
continue;
|
|
405
|
+
const line = rust.lineAt(m.index);
|
|
406
|
+
const owner = (0, synth_utils_1.enclosingFn)(rust.nodes, line);
|
|
407
|
+
if (owner)
|
|
408
|
+
out.listeners.push({ node: owner, event, file: rust.file, line, column: columnAt(rust.source, m.index), rust: true, scope: out.scopeOf(rust.file) });
|
|
409
|
+
}
|
|
410
|
+
TYPED_LISTEN_CALL.lastIndex = 0;
|
|
411
|
+
while ((m = TYPED_LISTEN_CALL.exec(rust.code)) !== null) {
|
|
412
|
+
const event = structInScope(out.byType.get(m[1]), out.scopeOf(rust.file))?.event;
|
|
413
|
+
const line = rust.lineAt(m.index);
|
|
414
|
+
const owner = event ? (0, synth_utils_1.enclosingFn)(rust.nodes, line) : null;
|
|
415
|
+
if (event && owner)
|
|
416
|
+
out.listeners.push({ node: owner, event, file: rust.file, line, column: columnAt(rust.source, m.index), rust: true, scope: out.scopeOf(rust.file) });
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
async function readRustSide(ctx, onYield) {
|
|
420
|
+
const files = [];
|
|
421
|
+
const conventional = new Set();
|
|
422
|
+
const constants = new Map();
|
|
423
|
+
let scanned = 0;
|
|
424
|
+
for (const file of ctx.getAllFiles()) {
|
|
425
|
+
if (!file.endsWith('.rs'))
|
|
426
|
+
continue;
|
|
427
|
+
const root = conventionalRoot(file);
|
|
428
|
+
if (root !== null)
|
|
429
|
+
conventional.add(root);
|
|
430
|
+
if ((0, query_utils_1.isTestPath)(file))
|
|
431
|
+
continue;
|
|
432
|
+
if ((++scanned & 63) === 0)
|
|
433
|
+
await onYield();
|
|
434
|
+
const source = ctx.readFile(file);
|
|
435
|
+
if (!source || !RUST_GATE.test(source))
|
|
436
|
+
continue;
|
|
437
|
+
const rust = readRustFile(file, source, ctx);
|
|
438
|
+
files.push(rust);
|
|
439
|
+
STR_CONST.lastIndex = 0;
|
|
440
|
+
let m;
|
|
441
|
+
while ((m = STR_CONST.exec(rust.text)) !== null) {
|
|
442
|
+
const known = constants.get(m[1]);
|
|
443
|
+
constants.set(m[1], known === undefined || known === m[2] ? m[2] : null);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const roots = [...conventional].sort((a, b) => b.length - a.length);
|
|
447
|
+
const side = {
|
|
448
|
+
apps: [], plugins: new Map(), anyApp: new Map(), byEvent: new Map(), byType: new Map(), byCamel: new Map(), emitters: [], listeners: [],
|
|
449
|
+
scopeOf: (file) => roots.find((root) => isWithin(file, root)) ?? null,
|
|
450
|
+
};
|
|
451
|
+
const apps = new Map();
|
|
452
|
+
const appAt = (root) => {
|
|
453
|
+
let app = apps.get(root);
|
|
454
|
+
if (!app) {
|
|
455
|
+
app = { root, commands: new Map(), openList: null };
|
|
456
|
+
apps.set(root, app);
|
|
457
|
+
}
|
|
458
|
+
return app;
|
|
459
|
+
};
|
|
460
|
+
for (const root of conventional)
|
|
461
|
+
appAt(root);
|
|
462
|
+
const crates = new Map();
|
|
463
|
+
for (const rust of files) {
|
|
464
|
+
await onYield();
|
|
465
|
+
readEventStructs(rust, side);
|
|
466
|
+
HANDLER_LIST.lastIndex = 0;
|
|
467
|
+
let m;
|
|
468
|
+
while ((m = HANDLER_LIST.exec(rust.code)) !== null) {
|
|
469
|
+
const list = readHandlerList(rust, constants, m.index, m.index + m[0].length - 1);
|
|
470
|
+
if (!list)
|
|
471
|
+
continue;
|
|
472
|
+
const app = appAt(conventionalRoot(rust.file) ?? crateRoot(rust.file, ctx, crates));
|
|
473
|
+
if (list.opaque)
|
|
474
|
+
app.openList = `${list.file}:${list.line}`;
|
|
475
|
+
for (const entry of list.entries) {
|
|
476
|
+
const nodes = commandsFor(entry, list, crates, ctx);
|
|
477
|
+
if (nodes.length === 0)
|
|
478
|
+
continue;
|
|
479
|
+
const command = { nodes, registeredAt: `${list.file}:${entry.line}` };
|
|
480
|
+
const name = entry.segments[entry.segments.length - 1];
|
|
481
|
+
if (list.plugin)
|
|
482
|
+
addCommand(side.plugins, `plugin:${list.plugin}|${name}`, command);
|
|
483
|
+
else
|
|
484
|
+
addCommand(app.commands, name, command);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
for (const app of apps.values()) {
|
|
489
|
+
if (app.openList === null)
|
|
490
|
+
continue;
|
|
491
|
+
const declared = new Map();
|
|
492
|
+
for (const rust of files) {
|
|
493
|
+
if (!isWithin(rust.file, app.root))
|
|
494
|
+
continue;
|
|
495
|
+
for (const n of rust.nodes) {
|
|
496
|
+
if (n.kind !== 'function' || !isDeclaredCommand(n, ctx))
|
|
497
|
+
continue;
|
|
498
|
+
const same = declared.get(n.name);
|
|
499
|
+
if (same)
|
|
500
|
+
same.push(n);
|
|
501
|
+
else
|
|
502
|
+
declared.set(n.name, [n]);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
for (const [name, nodes] of declared) {
|
|
506
|
+
if (nodes.length <= MAX_VARIANTS)
|
|
507
|
+
addCommand(app.commands, name, { nodes, registeredAt: app.openList });
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
for (const rust of files) {
|
|
511
|
+
await onYield();
|
|
512
|
+
readEmitters(rust, constants, side);
|
|
513
|
+
readListeners(rust, constants, side);
|
|
514
|
+
}
|
|
515
|
+
side.apps = [...apps.values()].sort((a, b) => b.root.length - a.root.length);
|
|
516
|
+
for (const app of side.apps) {
|
|
517
|
+
for (const [key, command] of app.commands) {
|
|
518
|
+
if (command === null)
|
|
519
|
+
side.anyApp.set(key, null);
|
|
520
|
+
else
|
|
521
|
+
addCommand(side.anyApp, key, command);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return side;
|
|
525
|
+
}
|
|
526
|
+
function tableFor(file, side) {
|
|
527
|
+
return side.apps.find((app) => isWithin(file, app.root) && (app.root !== '' || side.apps.length === 1 || app.commands.size > 0))?.commands
|
|
528
|
+
?? side.anyApp;
|
|
529
|
+
}
|
|
530
|
+
function callsOf(front, pattern) {
|
|
531
|
+
const sites = [];
|
|
532
|
+
pattern.lastIndex = 0;
|
|
533
|
+
let m;
|
|
534
|
+
while ((m = pattern.exec(front.code)) !== null) {
|
|
535
|
+
const open = skipTypeArguments(front.code, skipSpace(front.code, m.index + m[0].length));
|
|
536
|
+
if (front.code[open] === '(')
|
|
537
|
+
sites.push({ at: m.index, open });
|
|
538
|
+
}
|
|
539
|
+
return sites;
|
|
540
|
+
}
|
|
541
|
+
function jsStringAt(front, span) {
|
|
542
|
+
if (!span)
|
|
543
|
+
return null;
|
|
544
|
+
const at = skipSpace(front.text, span[0]);
|
|
545
|
+
const c = front.text[at];
|
|
546
|
+
if (c === '"' || c === "'" || c === '`') {
|
|
547
|
+
const value = (0, expo_router_1.readStringAt)(front.text, at);
|
|
548
|
+
if (value === null || value.includes(expo_router_1.HOLE))
|
|
549
|
+
return null;
|
|
550
|
+
return front.text.slice(at, span[1]).trim().length === closedLength(front.text, at) ? value : null;
|
|
551
|
+
}
|
|
552
|
+
const name = /^[A-Za-z_$][\w$]*$/.exec(front.text.slice(span[0], span[1]).trim())?.[0];
|
|
553
|
+
if (!name)
|
|
554
|
+
return null;
|
|
555
|
+
const constant = new RegExp(`\\bconst\\s+${escapeRe(name)}\\s*(?::[^=\\n]*)?=\\s*(['"\`])([^'"\`\\n$]*)\\1`).exec(front.text);
|
|
556
|
+
if (!constant)
|
|
557
|
+
return null;
|
|
558
|
+
const declaredIn = ownerAt(front, constant.index);
|
|
559
|
+
const local = declaredIn?.kind === 'function' || declaredIn?.kind === 'method';
|
|
560
|
+
return local && declaredIn !== ownerAt(front, span[0]) ? null : constant[2];
|
|
561
|
+
}
|
|
562
|
+
function ownerAt(front, offset) {
|
|
563
|
+
return ownerOf(front.nodes, front.lineAt(offset), columnAt(front.text, offset));
|
|
564
|
+
}
|
|
565
|
+
function closedLength(text, at) {
|
|
566
|
+
const q = text[at];
|
|
567
|
+
for (let i = at + 1; i < text.length; i++) {
|
|
568
|
+
if (text[i] === '\\')
|
|
569
|
+
i++;
|
|
570
|
+
else if (text[i] === q)
|
|
571
|
+
return i - at + 1;
|
|
572
|
+
}
|
|
573
|
+
return text.length - at;
|
|
574
|
+
}
|
|
575
|
+
const PROJECT_SPECIFIER = /^(?:\.{1,2}\/|[~@]\/|#\/|[#$]\w)/;
|
|
576
|
+
const GLOBAL_API = String.raw `(?:window\s*\.\s*)?__TAURI(?:_INTERNALS)?__`;
|
|
577
|
+
const GLOBAL_INVOKE = new RegExp(String.raw `(?<![\w$.])${GLOBAL_API}\s*\.\s*(?:(?:core|tauri)\s*\.\s*)?invoke\b`, 'g');
|
|
578
|
+
const GLOBAL_INVOKE_BINDING = new RegExp(String.raw `\b(?:const|let|var)\s*(?:\{[^}]*?\binvoke\b(?:\s*:\s*([\w$]+))?[^}]*\}\s*=\s*${GLOBAL_API}(?:\s*\.\s*(?:core|tauri))?\b|([\w$]+)\s*=\s*${GLOBAL_API}(?:\s*\.\s*(?:core|tauri))?\s*\.\s*invoke\b)`, 'g');
|
|
579
|
+
const DYNAMIC_IMPORT = /\{([^{}]*)\}\s*=\s*await\s+import\(\s*['"](@tauri-apps\/api[^'"]*)['"]\s*\)/g;
|
|
580
|
+
const GLOBAL_EVENT_BINDING = new RegExp(String.raw `\b(?:const|let|var)\s*\{([^}]*)\}\s*=\s*${GLOBAL_API}\s*\.\s*event\b`, 'g');
|
|
581
|
+
function readBindings(front, imports, language, ctx) {
|
|
582
|
+
const b = {
|
|
583
|
+
invoke: new Set(), invokeHolders: new Set(), listen: new Set(), emit: new Set(), emitTo: new Set(), dynamic: new Set(), eventHolders: new Set(),
|
|
584
|
+
handles: false, typedCommands: new Set(), typedEvents: new Set(),
|
|
585
|
+
};
|
|
586
|
+
const dynamic = [];
|
|
587
|
+
for (const m of front.text.matchAll(DYNAMIC_IMPORT)) {
|
|
588
|
+
for (const part of m[1].split(',')) {
|
|
589
|
+
const [name, local] = part.split(':').map((p) => p.trim());
|
|
590
|
+
if (!name)
|
|
591
|
+
continue;
|
|
592
|
+
dynamic.push({ localName: local || name, exportedName: name, source: m[2], isDefault: false, isNamespace: false });
|
|
593
|
+
b.dynamic.add(local || name);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
for (const m of [...imports, ...dynamic]) {
|
|
597
|
+
if (m.source === API_ROOT && m.exportedName === 'tauri')
|
|
598
|
+
b.invokeHolders.add(m.localName);
|
|
599
|
+
else if (m.source === API_ROOT && m.exportedName === 'event')
|
|
600
|
+
b.eventHolders.add(m.localName);
|
|
601
|
+
else if (CORE_MODULES.has(m.source)) {
|
|
602
|
+
if (m.isNamespace)
|
|
603
|
+
b.invokeHolders.add(m.localName);
|
|
604
|
+
else if (m.exportedName === 'invoke')
|
|
605
|
+
b.invoke.add(m.localName);
|
|
606
|
+
}
|
|
607
|
+
else if (m.source === EVENT_MODULE) {
|
|
608
|
+
if (m.isNamespace)
|
|
609
|
+
b.eventHolders.add(m.localName);
|
|
610
|
+
else if (m.exportedName === 'listen' || m.exportedName === 'once')
|
|
611
|
+
b.listen.add(m.localName);
|
|
612
|
+
else if (m.exportedName === 'emit' || m.exportedName === 'emitTo') {
|
|
613
|
+
b.emit.add(m.localName);
|
|
614
|
+
if (m.exportedName === 'emitTo')
|
|
615
|
+
b.emitTo.add(m.localName);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
else if (HANDLE_MODULES.has(m.source))
|
|
619
|
+
b.handles = true;
|
|
620
|
+
else if (m.exportedName === 'commands') {
|
|
621
|
+
if (PROJECT_SPECIFIER.test(m.source) && (0, import_resolver_1.resolveImportPath)(m.source, front.file, language, ctx) === null)
|
|
622
|
+
b.typedCommands.add(m.localName);
|
|
623
|
+
}
|
|
624
|
+
else if (m.exportedName === 'events') {
|
|
625
|
+
if (PROJECT_SPECIFIER.test(m.source) || (0, import_resolver_1.resolveImportPath)(m.source, front.file, language, ctx) !== null)
|
|
626
|
+
b.typedEvents.add(m.localName);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
GLOBAL_INVOKE_BINDING.lastIndex = 0;
|
|
630
|
+
let m;
|
|
631
|
+
while ((m = GLOBAL_INVOKE_BINDING.exec(front.code)) !== null)
|
|
632
|
+
b.invoke.add(m[1] ?? m[2] ?? 'invoke');
|
|
633
|
+
GLOBAL_EVENT_BINDING.lastIndex = 0;
|
|
634
|
+
while ((m = GLOBAL_EVENT_BINDING.exec(front.code)) !== null) {
|
|
635
|
+
for (const part of m[1].split(',')) {
|
|
636
|
+
const [name, local] = part.split(':').map((s) => s.trim());
|
|
637
|
+
if (name === 'listen' || name === 'once')
|
|
638
|
+
b.listen.add(local || name);
|
|
639
|
+
else if (name === 'emit' || name === 'emitTo') {
|
|
640
|
+
b.emit.add(local || name);
|
|
641
|
+
if (name === 'emitTo')
|
|
642
|
+
b.emitTo.add(local || name);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
return b;
|
|
647
|
+
}
|
|
648
|
+
function shadowed(name, owner, front, line, column, ctx) {
|
|
649
|
+
if (owner.kind !== 'function' && owner.kind !== 'method')
|
|
650
|
+
return false;
|
|
651
|
+
if ((0, name_matcher_1.jsCodeBindsName)(name, owner, front.file, line, ctx))
|
|
652
|
+
return true;
|
|
653
|
+
const before = front.code.slice(front.offsetOfLine(owner.startLine) + owner.startColumn, front.offsetOfLine(line) + column);
|
|
654
|
+
const n = escapeRe(name);
|
|
655
|
+
return new RegExp(`(?:\\b(?:const|let|var)\\s*|\\(\\s*)[{[][^=;(){}]*?(?<![\\w$:.])${n}(?![\\w$])`).test(before);
|
|
656
|
+
}
|
|
657
|
+
function handlerOf(front, span, imports, language, owner, ctx) {
|
|
658
|
+
if (!span)
|
|
659
|
+
return owner;
|
|
660
|
+
const name = /^(?:this\s*\.\s*)?([A-Za-z_$][\w$]*)$/.exec(front.text.slice(span[0], span[1]).trim())?.[1];
|
|
661
|
+
if (!name)
|
|
662
|
+
return owner;
|
|
663
|
+
const here = front.nodes.find((n) => n.name === name && synth_utils_1.FN_KINDS.has(n.kind));
|
|
664
|
+
if (here)
|
|
665
|
+
return here;
|
|
666
|
+
const imported = imports.find((m) => m.localName === name);
|
|
667
|
+
if (!imported)
|
|
668
|
+
return owner;
|
|
669
|
+
const path = (0, import_resolver_1.resolveImportPath)(imported.source, front.file, language, ctx);
|
|
670
|
+
if (!path)
|
|
671
|
+
return owner;
|
|
672
|
+
return ctx.getNodesInFile(path).find((n) => n.name === imported.exportedName && synth_utils_1.FN_KINDS.has(n.kind)) ?? owner;
|
|
673
|
+
}
|
|
674
|
+
function pushCommand(out, owner, key, command, callee, line, column) {
|
|
675
|
+
for (const target of command.nodes) {
|
|
676
|
+
const pair = `${owner.id}>${target.id}`;
|
|
677
|
+
if (out.seen.has(pair))
|
|
678
|
+
continue;
|
|
679
|
+
out.seen.add(pair);
|
|
680
|
+
out.edges.push({
|
|
681
|
+
source: owner.id,
|
|
682
|
+
target: target.id,
|
|
683
|
+
kind: 'calls',
|
|
684
|
+
line,
|
|
685
|
+
column,
|
|
686
|
+
provenance: 'heuristic',
|
|
687
|
+
metadata: {
|
|
688
|
+
synthesizedBy: 'tauri-command',
|
|
689
|
+
channel: 'ipc',
|
|
690
|
+
tier: tier_synthesizer_1.TIER_CLIENT_TO_SERVER,
|
|
691
|
+
callee,
|
|
692
|
+
command: key,
|
|
693
|
+
registeredAt: command.registeredAt,
|
|
694
|
+
},
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
function bareCallee(name) {
|
|
699
|
+
return new RegExp(`(?<![\\w$.])${escapeRe(name)}(?![\\w$])`, 'g');
|
|
700
|
+
}
|
|
701
|
+
function firstParameter(front, node) {
|
|
702
|
+
const start = front.offsetOfLine(node.startLine) + node.startColumn;
|
|
703
|
+
const head = front.code.slice(start, start + 600);
|
|
704
|
+
return /^[^(]*\(\s*([A-Za-z_$][\w$]*)/.exec(head)?.[1] ?? null;
|
|
705
|
+
}
|
|
706
|
+
function findForwarders(scans, ctx) {
|
|
707
|
+
const found = new Map();
|
|
708
|
+
const forwardersIn = (scan) => {
|
|
709
|
+
const here = new Map();
|
|
710
|
+
const callees = [
|
|
711
|
+
...[...scan.bindings.invoke].map(bareCallee),
|
|
712
|
+
...[...scan.bindings.invokeHolders].map((h) => new RegExp(`(?<![\\w$.])${escapeRe(h)}\\s*\\.\\s*invoke(?![\\w$])`, 'g')),
|
|
713
|
+
GLOBAL_INVOKE,
|
|
714
|
+
];
|
|
715
|
+
for (const forwarder of found.values()) {
|
|
716
|
+
const local = localForwarder(forwarder, scan, ctx);
|
|
717
|
+
if (local)
|
|
718
|
+
callees.push(bareCallee(local));
|
|
719
|
+
callees.push(new RegExp(`\\.\\s*${escapeRe(forwarder.name)}(?![\\w$])`, 'g'));
|
|
720
|
+
}
|
|
721
|
+
for (const callee of callees) {
|
|
722
|
+
for (const call of callsOf(scan.front, callee)) {
|
|
723
|
+
const span = argumentSpans(scan.front.code, call.open)[0];
|
|
724
|
+
const argument = span ? scan.front.code.slice(span[0], span[1]).trim() : '';
|
|
725
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(argument))
|
|
726
|
+
continue;
|
|
727
|
+
const line = scan.front.lineAt(call.at);
|
|
728
|
+
const owner = ownerOf(scan.front.nodes, line, columnAt(scan.front.text, call.at));
|
|
729
|
+
if (!owner || (owner.kind !== 'function' && owner.kind !== 'method') || owner.name === '<anonymous>')
|
|
730
|
+
continue;
|
|
731
|
+
if (firstParameter(scan.front, owner) === argument)
|
|
732
|
+
here.set(owner.name, { name: owner.name, file: scan.front.file });
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
return [...here.values()];
|
|
736
|
+
};
|
|
737
|
+
const aliasesOf = (forwarder, scan) => {
|
|
738
|
+
const alias = new RegExp(`(?:^|[\\s;{])(?:(?:public|private|protected|readonly|static)\\s+)*([A-Za-z_$][\\w$]*)\\s*(?::[^=;\\n]*)?=\\s*${escapeRe(forwarder.name)}\\s*[;\\n]`, 'g');
|
|
739
|
+
for (const m of scan.front.code.matchAll(alias)) {
|
|
740
|
+
if (!found.has(m[1]))
|
|
741
|
+
found.set(m[1], { name: m[1], file: forwarder.file });
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
for (let round = 0; round < 3; round++) {
|
|
745
|
+
const before = found.size;
|
|
746
|
+
for (const scan of scans) {
|
|
747
|
+
for (const forwarder of forwardersIn(scan))
|
|
748
|
+
if (!found.has(forwarder.name))
|
|
749
|
+
found.set(forwarder.name, forwarder);
|
|
750
|
+
for (const forwarder of [...found.values()])
|
|
751
|
+
if (forwarder.file === scan.front.file)
|
|
752
|
+
aliasesOf(forwarder, scan);
|
|
753
|
+
}
|
|
754
|
+
if (found.size === before)
|
|
755
|
+
break;
|
|
756
|
+
}
|
|
757
|
+
return [...found.values()];
|
|
758
|
+
}
|
|
759
|
+
function localForwarder(forwarder, scan, ctx) {
|
|
760
|
+
if (forwarder.file === scan.front.file)
|
|
761
|
+
return forwarder.name;
|
|
762
|
+
const imported = scan.imports.find((m) => m.exportedName === forwarder.name);
|
|
763
|
+
if (!imported)
|
|
764
|
+
return null;
|
|
765
|
+
return (0, import_resolver_1.resolveImportPath)(imported.source, scan.front.file, scan.language, ctx) !== null ? imported.localName : null;
|
|
766
|
+
}
|
|
767
|
+
function readFrontend(scan, forwarders, side, ctx, out) {
|
|
768
|
+
const { front, imports, language, bindings: b } = scan;
|
|
769
|
+
const table = tableFor(front.file, side);
|
|
770
|
+
const scope = side.scopeOf(front.file);
|
|
771
|
+
const hidden = (binding, at) => binding !== null && !b.dynamic.has(binding) && shadowed(binding, at.owner, front, at.line, at.column, ctx);
|
|
772
|
+
const site = (call) => {
|
|
773
|
+
const line = front.lineAt(call.at);
|
|
774
|
+
const column = columnAt(front.text, call.at);
|
|
775
|
+
const owner = ownerOf(front.nodes, line, column);
|
|
776
|
+
return owner ? { owner, line, column } : null;
|
|
777
|
+
};
|
|
778
|
+
const command = (key) => {
|
|
779
|
+
const plugin = key.startsWith('plugin:');
|
|
780
|
+
return (plugin ? side.plugins.get(key) : table.get(key)) ?? null;
|
|
781
|
+
};
|
|
782
|
+
const invokeCall = (call, binding, callee) => {
|
|
783
|
+
const key = jsStringAt(front, argumentSpans(front.code, call.open)[0]);
|
|
784
|
+
if (key === null)
|
|
785
|
+
return;
|
|
786
|
+
const target = command(key);
|
|
787
|
+
if (!target)
|
|
788
|
+
return;
|
|
789
|
+
const at = site(call);
|
|
790
|
+
if (!at || hidden(binding, at))
|
|
791
|
+
return;
|
|
792
|
+
pushCommand(out, at.owner, key, target, callee, at.line, at.column);
|
|
793
|
+
};
|
|
794
|
+
for (const name of b.invoke) {
|
|
795
|
+
for (const call of callsOf(front, bareCallee(name)))
|
|
796
|
+
invokeCall(call, name, name);
|
|
797
|
+
}
|
|
798
|
+
for (const holder of b.invokeHolders) {
|
|
799
|
+
for (const call of callsOf(front, new RegExp(`(?<![\\w$.])${escapeRe(holder)}\\s*\\.\\s*invoke(?![\\w$])`, 'g')))
|
|
800
|
+
invokeCall(call, holder, `${holder}.invoke`);
|
|
801
|
+
}
|
|
802
|
+
for (const call of callsOf(front, GLOBAL_INVOKE))
|
|
803
|
+
invokeCall(call, null, 'invoke');
|
|
804
|
+
for (const forwarder of forwarders) {
|
|
805
|
+
const local = localForwarder(forwarder, scan, ctx);
|
|
806
|
+
if (local)
|
|
807
|
+
for (const call of callsOf(front, bareCallee(local)))
|
|
808
|
+
invokeCall(call, local, local);
|
|
809
|
+
for (const call of callsOf(front, new RegExp(`\\.\\s*${escapeRe(forwarder.name)}(?![\\w$])`, 'g')))
|
|
810
|
+
invokeCall(call, null, forwarder.name);
|
|
811
|
+
}
|
|
812
|
+
for (const holder of b.typedCommands) {
|
|
813
|
+
const camel = new Map();
|
|
814
|
+
for (const key of table.keys())
|
|
815
|
+
camel.set(toCamel(key), key);
|
|
816
|
+
const pattern = new RegExp(`(?<![\\w$.])${escapeRe(holder)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`, 'g');
|
|
817
|
+
pattern.lastIndex = 0;
|
|
818
|
+
let m;
|
|
819
|
+
while ((m = pattern.exec(front.code)) !== null) {
|
|
820
|
+
const key = camel.get(m[1]);
|
|
821
|
+
const open = skipTypeArguments(front.code, skipSpace(front.code, m.index + m[0].length));
|
|
822
|
+
if (!key || front.code[open] !== '(')
|
|
823
|
+
continue;
|
|
824
|
+
const target = table.get(key);
|
|
825
|
+
const at = site({ at: m.index, open });
|
|
826
|
+
if (!target || !at || shadowed(holder, at.owner, front, at.line, at.column, ctx))
|
|
827
|
+
continue;
|
|
828
|
+
pushCommand(out, at.owner, key, target, `${holder}.${m[1]}`, at.line, at.column);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
const listenCall = (call, binding, event, handlerIndex) => {
|
|
832
|
+
const spans = argumentSpans(front.code, call.open);
|
|
833
|
+
const name = event ?? jsStringAt(front, spans[0]);
|
|
834
|
+
if (name === null || name.startsWith('tauri://'))
|
|
835
|
+
return;
|
|
836
|
+
const at = site(call);
|
|
837
|
+
if (!at || hidden(binding, at))
|
|
838
|
+
return;
|
|
839
|
+
out.listeners.push({
|
|
840
|
+
node: handlerOf(front, spans[handlerIndex], imports, language, at.owner, ctx),
|
|
841
|
+
event: name, file: front.file, line: at.line, column: at.column, rust: false, scope,
|
|
842
|
+
});
|
|
843
|
+
const struct = structInScope(side.byEvent.get(name), scope);
|
|
844
|
+
if (struct) {
|
|
845
|
+
const key = `${at.owner.id}>${struct.node.id}`;
|
|
846
|
+
if (!out.subscribed.has(key))
|
|
847
|
+
out.subscribed.set(key, { owner: at.owner, struct, line: at.line, column: at.column });
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
const emitCall = (call, binding, event, eventIndex) => {
|
|
851
|
+
const name = event ?? jsStringAt(front, argumentSpans(front.code, call.open)[eventIndex]);
|
|
852
|
+
if (name === null)
|
|
853
|
+
return;
|
|
854
|
+
const at = site(call);
|
|
855
|
+
if (!at || hidden(binding, at))
|
|
856
|
+
return;
|
|
857
|
+
out.emitters.push({ node: at.owner, event: name, file: front.file, line: at.line, column: at.column, rust: false, scope });
|
|
858
|
+
};
|
|
859
|
+
for (const name of b.listen) {
|
|
860
|
+
for (const call of callsOf(front, bareCallee(name)))
|
|
861
|
+
listenCall(call, name, null, 1);
|
|
862
|
+
}
|
|
863
|
+
for (const name of b.emit) {
|
|
864
|
+
for (const call of callsOf(front, bareCallee(name)))
|
|
865
|
+
emitCall(call, name, null, b.emitTo.has(name) ? 1 : 0);
|
|
866
|
+
}
|
|
867
|
+
for (const holder of b.eventHolders) {
|
|
868
|
+
for (const call of callsOf(front, new RegExp(`(?<![\\w$.])${escapeRe(holder)}\\s*\\.\\s*(?:listen|once)(?![\\w$])`, 'g')))
|
|
869
|
+
listenCall(call, holder, null, 1);
|
|
870
|
+
for (const call of callsOf(front, new RegExp(`(?<![\\w$.])${escapeRe(holder)}\\s*\\.\\s*emit(?![\\w$])`, 'g')))
|
|
871
|
+
emitCall(call, holder, null, 0);
|
|
872
|
+
}
|
|
873
|
+
if (b.handles) {
|
|
874
|
+
for (const call of callsOf(front, /\.\s*(?:listen|once)(?![\w$])/g))
|
|
875
|
+
listenCall(call, null, null, 1);
|
|
876
|
+
for (const call of callsOf(front, /\.\s*emit(?![\w$])/g))
|
|
877
|
+
emitCall(call, null, null, 0);
|
|
878
|
+
}
|
|
879
|
+
for (const holder of b.typedEvents) {
|
|
880
|
+
const pattern = new RegExp(`(?<![\\w$.])${escapeRe(holder)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`, 'g');
|
|
881
|
+
pattern.lastIndex = 0;
|
|
882
|
+
let m;
|
|
883
|
+
while ((m = pattern.exec(front.code)) !== null) {
|
|
884
|
+
let end = skipSpace(front.code, m.index + m[0].length);
|
|
885
|
+
if (front.code[end] === '(') {
|
|
886
|
+
const close = closeBracket(front.code, end);
|
|
887
|
+
if (close < 0)
|
|
888
|
+
continue;
|
|
889
|
+
end = skipSpace(front.code, close + 1);
|
|
890
|
+
}
|
|
891
|
+
const member = /^\.\s*(listen|once|emit)(?![\w$])/.exec(front.code.slice(end, end + 32));
|
|
892
|
+
if (!member)
|
|
893
|
+
continue;
|
|
894
|
+
const open = skipSpace(front.code, end + member[0].length);
|
|
895
|
+
if (front.code[open] !== '(')
|
|
896
|
+
continue;
|
|
897
|
+
const struct = structInScope(side.byCamel.get(m[1]), scope);
|
|
898
|
+
if (!struct)
|
|
899
|
+
continue;
|
|
900
|
+
if (member[1] === 'emit')
|
|
901
|
+
emitCall({ at: m.index, open }, holder, struct.event, 0);
|
|
902
|
+
else
|
|
903
|
+
listenCall({ at: m.index, open }, holder, struct.event, 0);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
function languageOf(file) {
|
|
908
|
+
if (file.endsWith('.svelte'))
|
|
909
|
+
return 'svelte';
|
|
910
|
+
if (file.endsWith('.vue'))
|
|
911
|
+
return 'vue';
|
|
912
|
+
return 'typescript';
|
|
913
|
+
}
|
|
914
|
+
function pairEvents(emitters, listeners, out) {
|
|
915
|
+
const emitting = new Map();
|
|
916
|
+
for (const e of emitters) {
|
|
917
|
+
const list = emitting.get(e.event);
|
|
918
|
+
if (list)
|
|
919
|
+
list.push(e);
|
|
920
|
+
else
|
|
921
|
+
emitting.set(e.event, [e]);
|
|
922
|
+
}
|
|
923
|
+
const listening = new Map();
|
|
924
|
+
for (const l of listeners) {
|
|
925
|
+
const list = listening.get(l.event);
|
|
926
|
+
if (list)
|
|
927
|
+
list.push(l);
|
|
928
|
+
else
|
|
929
|
+
listening.set(l.event, [l]);
|
|
930
|
+
}
|
|
931
|
+
for (const [event, from] of emitting) {
|
|
932
|
+
const to = listening.get(event);
|
|
933
|
+
if (!to || distinctNodes(from) > EVENT_FANOUT_CAP || distinctNodes(to) > EVENT_FANOUT_CAP)
|
|
934
|
+
continue;
|
|
935
|
+
for (const e of from) {
|
|
936
|
+
for (const l of to) {
|
|
937
|
+
if (e.node.id === l.node.id || !sameScope(e.scope, l.scope))
|
|
938
|
+
continue;
|
|
939
|
+
const pair = `${e.node.id}>${l.node.id}`;
|
|
940
|
+
if (out.seen.has(pair))
|
|
941
|
+
continue;
|
|
942
|
+
out.seen.add(pair);
|
|
943
|
+
const tier = e.rust === l.rust ? undefined : e.rust ? tier_synthesizer_1.TIER_SERVER_TO_CLIENT : tier_synthesizer_1.TIER_CLIENT_TO_SERVER;
|
|
944
|
+
out.edges.push({
|
|
945
|
+
source: e.node.id,
|
|
946
|
+
target: l.node.id,
|
|
947
|
+
kind: 'calls',
|
|
948
|
+
line: e.line,
|
|
949
|
+
column: e.column,
|
|
950
|
+
provenance: 'heuristic',
|
|
951
|
+
metadata: {
|
|
952
|
+
synthesizedBy: 'tauri-event',
|
|
953
|
+
channel: 'event',
|
|
954
|
+
...(tier ? { tier } : {}),
|
|
955
|
+
event,
|
|
956
|
+
registeredAt: `${l.file}:${l.line}`,
|
|
957
|
+
},
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
function distinctNodes(ends) {
|
|
964
|
+
return new Set(ends.map((e) => e.node.id)).size;
|
|
965
|
+
}
|
|
966
|
+
function hasTauriCore(queries, ctx) {
|
|
967
|
+
return ['tauri', 'tauri_specta'].some((name) => ctx.getNodesByName(name).some((n) => n.kind === 'import' && n.language === 'rust')) ||
|
|
968
|
+
queries.hasDecoratedFunction('rust', 'tauri::command');
|
|
969
|
+
}
|
|
970
|
+
async function tauriEdges(queries, ctx, onYield) {
|
|
971
|
+
if (!hasTauriCore(queries, ctx))
|
|
972
|
+
return [];
|
|
973
|
+
const side = await readRustSide(ctx, onYield);
|
|
974
|
+
const out = { edges: [], seen: new Set(), emitters: [...side.emitters], listeners: [...side.listeners], subscribed: new Map() };
|
|
975
|
+
const frontendFiles = ctx.getAllFiles().filter((file) => FRONTEND_FILE.test(file) && !(0, query_utils_1.isTestPath)(file));
|
|
976
|
+
const scans = new Map();
|
|
977
|
+
const scanFile = (file, source) => {
|
|
978
|
+
const text = (0, strip_comments_1.stripCommentsForRegex)(source, 'typescript');
|
|
979
|
+
const language = languageOf(file);
|
|
980
|
+
const imports = ctx.getImportMappings(file, language);
|
|
981
|
+
const front = {
|
|
982
|
+
file, text, code: (0, strip_comments_1.blankStringContents)(text), nodes: ctx.getNodesInFile(file),
|
|
983
|
+
lineAt: (0, synth_utils_1.makeLineAt)(source, 1), offsetOfLine: makeOffsetOfLine(source),
|
|
984
|
+
};
|
|
985
|
+
scans.set(file, { front, imports, language, bindings: readBindings(front, imports, language, ctx) });
|
|
986
|
+
};
|
|
987
|
+
let scanned = 0;
|
|
988
|
+
for (const file of frontendFiles) {
|
|
989
|
+
if ((++scanned & 63) === 0)
|
|
990
|
+
await onYield();
|
|
991
|
+
const source = ctx.readFile(file);
|
|
992
|
+
if (source && FRONTEND_GATE.test(source))
|
|
993
|
+
scanFile(file, source);
|
|
994
|
+
}
|
|
995
|
+
const forwarders = findForwarders([...scans.values()], ctx);
|
|
996
|
+
if (forwarders.length > 0) {
|
|
997
|
+
for (const file of frontendFiles) {
|
|
998
|
+
if (scans.has(file))
|
|
999
|
+
continue;
|
|
1000
|
+
if ((++scanned & 63) === 0)
|
|
1001
|
+
await onYield();
|
|
1002
|
+
const source = ctx.readFile(file);
|
|
1003
|
+
if (source && forwarders.some((f) => source.includes(f.name)))
|
|
1004
|
+
scanFile(file, source);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
for (const scan of scans.values()) {
|
|
1008
|
+
if ((++scanned & 63) === 0)
|
|
1009
|
+
await onYield();
|
|
1010
|
+
readFrontend(scan, forwarders, side, ctx, out);
|
|
1011
|
+
}
|
|
1012
|
+
pairEvents(out.emitters, out.listeners, out);
|
|
1013
|
+
for (const { owner, struct, line, column } of out.subscribed.values()) {
|
|
1014
|
+
out.edges.push({
|
|
1015
|
+
source: owner.id,
|
|
1016
|
+
target: struct.node.id,
|
|
1017
|
+
kind: 'references',
|
|
1018
|
+
line,
|
|
1019
|
+
column,
|
|
1020
|
+
provenance: 'heuristic',
|
|
1021
|
+
metadata: {
|
|
1022
|
+
synthesizedBy: 'tauri-event',
|
|
1023
|
+
channel: 'event',
|
|
1024
|
+
event: struct.event,
|
|
1025
|
+
registeredAt: `${struct.node.filePath}:${struct.node.startLine}`,
|
|
1026
|
+
},
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
return out.edges;
|
|
1030
|
+
}
|
|
1031
|
+
function hasTauriPattern(filePath, content) {
|
|
1032
|
+
if (filePath.endsWith('.rs'))
|
|
1033
|
+
return /\btauri|generate_handler|collect_commands|\.\s*(?:emit|listen|once)\w*\s*\(/.test(content);
|
|
1034
|
+
if (!FRONTEND_FILE.test(filePath))
|
|
1035
|
+
return false;
|
|
1036
|
+
return /@tauri-apps\/|__TAURI|[iI]nvoke\w*\s*[<(]|\b(?:commands|events)\s*\.\s*\w/.test(content);
|
|
1037
|
+
}
|
|
1038
|
+
//# sourceMappingURL=tauri-synthesizer.js.map
|