homegraph 0.9.9
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/LICENSE +21 -0
- package/README.md +709 -0
- package/dist/bin/codegraph.d.ts +26 -0
- package/dist/bin/codegraph.d.ts.map +1 -0
- package/dist/bin/codegraph.js +1572 -0
- package/dist/bin/codegraph.js.map +1 -0
- package/dist/bin/homegraph.d.ts +26 -0
- package/dist/bin/homegraph.d.ts.map +1 -0
- package/dist/bin/homegraph.js +1572 -0
- package/dist/bin/homegraph.js.map +1 -0
- package/dist/bin/node-version-check.d.ts +37 -0
- package/dist/bin/node-version-check.d.ts.map +1 -0
- package/dist/bin/node-version-check.js +79 -0
- package/dist/bin/node-version-check.js.map +1 -0
- package/dist/bin/uninstall.d.ts +14 -0
- package/dist/bin/uninstall.d.ts.map +1 -0
- package/dist/bin/uninstall.js +36 -0
- package/dist/bin/uninstall.js.map +1 -0
- package/dist/context/formatter.d.ts +30 -0
- package/dist/context/formatter.d.ts.map +1 -0
- package/dist/context/formatter.js +263 -0
- package/dist/context/formatter.js.map +1 -0
- package/dist/context/index.d.ts +119 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1289 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/markers.d.ts +19 -0
- package/dist/context/markers.d.ts.map +1 -0
- package/dist/context/markers.js +22 -0
- package/dist/context/markers.js.map +1 -0
- package/dist/db/index.d.ts +101 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +250 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +44 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +131 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +386 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1562 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +151 -0
- package/dist/db/sqlite-adapter.d.ts +53 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +117 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/directory.d.ts +57 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +253 -0
- package/dist/directory.js.map +1 -0
- package/dist/errors.d.ts +136 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +219 -0
- package/dist/errors.js.map +1 -0
- package/dist/extraction/arkanalyzer-extractor.d.ts +6 -0
- package/dist/extraction/arkanalyzer-extractor.d.ts.map +1 -0
- package/dist/extraction/arkanalyzer-extractor.js +11 -0
- package/dist/extraction/arkanalyzer-extractor.js.map +1 -0
- package/dist/extraction/arkanalyzer-project.d.ts +20 -0
- package/dist/extraction/arkanalyzer-project.d.ts.map +1 -0
- package/dist/extraction/arkanalyzer-project.js +596 -0
- package/dist/extraction/arkanalyzer-project.js.map +1 -0
- package/dist/extraction/context.d.ts +12 -0
- package/dist/extraction/context.d.ts.map +1 -0
- package/dist/extraction/context.js +29 -0
- package/dist/extraction/context.js.map +1 -0
- package/dist/extraction/dfm-extractor.d.ts +31 -0
- package/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/dist/extraction/dfm-extractor.js +151 -0
- package/dist/extraction/dfm-extractor.js.map +1 -0
- package/dist/extraction/extraction-version.d.ts +25 -0
- package/dist/extraction/extraction-version.d.ts.map +1 -0
- package/dist/extraction/extraction-version.js +28 -0
- package/dist/extraction/extraction-version.js.map +1 -0
- package/dist/extraction/generated-detection.d.ts +30 -0
- package/dist/extraction/generated-detection.d.ts.map +1 -0
- package/dist/extraction/generated-detection.js +80 -0
- package/dist/extraction/generated-detection.js.map +1 -0
- package/dist/extraction/grammars.d.ts +108 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +465 -0
- package/dist/extraction/grammars.js.map +1 -0
- package/dist/extraction/index.d.ts +138 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +1396 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/languages/arkts.d.ts +18 -0
- package/dist/extraction/languages/arkts.d.ts.map +1 -0
- package/dist/extraction/languages/arkts.js +878 -0
- package/dist/extraction/languages/arkts.js.map +1 -0
- package/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +173 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +25 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +120 -0
- package/dist/extraction/languages/csharp.js.map +1 -0
- package/dist/extraction/languages/dart.d.ts +3 -0
- package/dist/extraction/languages/dart.d.ts.map +1 -0
- package/dist/extraction/languages/dart.js +192 -0
- package/dist/extraction/languages/dart.js.map +1 -0
- package/dist/extraction/languages/go.d.ts +3 -0
- package/dist/extraction/languages/go.d.ts.map +1 -0
- package/dist/extraction/languages/go.js +74 -0
- package/dist/extraction/languages/go.js.map +1 -0
- package/dist/extraction/languages/index.d.ts +10 -0
- package/dist/extraction/languages/index.d.ts.map +1 -0
- package/dist/extraction/languages/index.js +51 -0
- package/dist/extraction/languages/index.js.map +1 -0
- package/dist/extraction/languages/java.d.ts +3 -0
- package/dist/extraction/languages/java.d.ts.map +1 -0
- package/dist/extraction/languages/java.js +74 -0
- package/dist/extraction/languages/java.js.map +1 -0
- package/dist/extraction/languages/javascript.d.ts +3 -0
- package/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/dist/extraction/languages/javascript.js +90 -0
- package/dist/extraction/languages/javascript.js.map +1 -0
- package/dist/extraction/languages/kotlin.d.ts +3 -0
- package/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/dist/extraction/languages/kotlin.js +285 -0
- package/dist/extraction/languages/kotlin.js.map +1 -0
- package/dist/extraction/languages/lua.d.ts +3 -0
- package/dist/extraction/languages/lua.d.ts.map +1 -0
- package/dist/extraction/languages/lua.js +150 -0
- package/dist/extraction/languages/lua.js.map +1 -0
- package/dist/extraction/languages/luau.d.ts +3 -0
- package/dist/extraction/languages/luau.d.ts.map +1 -0
- package/dist/extraction/languages/luau.js +37 -0
- package/dist/extraction/languages/luau.js.map +1 -0
- package/dist/extraction/languages/objc.d.ts +3 -0
- package/dist/extraction/languages/objc.d.ts.map +1 -0
- package/dist/extraction/languages/objc.js +133 -0
- package/dist/extraction/languages/objc.js.map +1 -0
- package/dist/extraction/languages/pascal.d.ts +3 -0
- package/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/dist/extraction/languages/pascal.js +66 -0
- package/dist/extraction/languages/pascal.js.map +1 -0
- package/dist/extraction/languages/php.d.ts +3 -0
- package/dist/extraction/languages/php.d.ts.map +1 -0
- package/dist/extraction/languages/php.js +120 -0
- package/dist/extraction/languages/php.js.map +1 -0
- package/dist/extraction/languages/python.d.ts +3 -0
- package/dist/extraction/languages/python.d.ts.map +1 -0
- package/dist/extraction/languages/python.js +56 -0
- package/dist/extraction/languages/python.js.map +1 -0
- package/dist/extraction/languages/ruby.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/dist/extraction/languages/ruby.js +149 -0
- package/dist/extraction/languages/ruby.js.map +1 -0
- package/dist/extraction/languages/rust.d.ts +3 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -0
- package/dist/extraction/languages/rust.js +113 -0
- package/dist/extraction/languages/rust.js.map +1 -0
- package/dist/extraction/languages/scala.d.ts +3 -0
- package/dist/extraction/languages/scala.d.ts.map +1 -0
- package/dist/extraction/languages/scala.js +174 -0
- package/dist/extraction/languages/scala.js.map +1 -0
- package/dist/extraction/languages/swift.d.ts +3 -0
- package/dist/extraction/languages/swift.d.ts.map +1 -0
- package/dist/extraction/languages/swift.js +91 -0
- package/dist/extraction/languages/swift.js.map +1 -0
- package/dist/extraction/languages/typescript.d.ts +3 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/dist/extraction/languages/typescript.js +129 -0
- package/dist/extraction/languages/typescript.js.map +1 -0
- package/dist/extraction/liquid-extractor.d.ts +59 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +354 -0
- package/dist/extraction/liquid-extractor.js.map +1 -0
- package/dist/extraction/mybatis-extractor.d.ts +48 -0
- package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
- package/dist/extraction/mybatis-extractor.js +198 -0
- package/dist/extraction/mybatis-extractor.js.map +1 -0
- package/dist/extraction/parse-worker.d.ts +8 -0
- package/dist/extraction/parse-worker.d.ts.map +1 -0
- package/dist/extraction/parse-worker.js +94 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/razor-extractor.d.ts +42 -0
- package/dist/extraction/razor-extractor.d.ts.map +1 -0
- package/dist/extraction/razor-extractor.js +285 -0
- package/dist/extraction/razor-extractor.js.map +1 -0
- package/dist/extraction/svelte-extractor.d.ts +56 -0
- package/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/dist/extraction/svelte-extractor.js +272 -0
- package/dist/extraction/svelte-extractor.js.map +1 -0
- package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-helpers.js +103 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/dist/extraction/tree-sitter-types.d.ts +210 -0
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-types.js +10 -0
- package/dist/extraction/tree-sitter-types.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts +455 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +4089 -0
- package/dist/extraction/tree-sitter.js.map +1 -0
- package/dist/extraction/vue-extractor.d.ts +51 -0
- package/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/dist/extraction/vue-extractor.js +251 -0
- package/dist/extraction/vue-extractor.js.map +1 -0
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/dist/extraction/wasm-runtime-flags.js +106 -0
- package/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/queries.d.ts +106 -0
- package/dist/graph/queries.d.ts.map +1 -0
- package/dist/graph/queries.js +339 -0
- package/dist/graph/queries.js.map +1 -0
- package/dist/graph/traversal.d.ts +127 -0
- package/dist/graph/traversal.d.ts.map +1 -0
- package/dist/graph/traversal.js +531 -0
- package/dist/graph/traversal.js.map +1 -0
- package/dist/index.d.ts +522 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +947 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/config-writer.d.ts +28 -0
- package/dist/installer/config-writer.d.ts.map +1 -0
- package/dist/installer/config-writer.js +91 -0
- package/dist/installer/config-writer.js.map +1 -0
- package/dist/installer/index.d.ts +100 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +497 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +18 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +21 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/antigravity.d.ts +57 -0
- package/dist/installer/targets/antigravity.d.ts.map +1 -0
- package/dist/installer/targets/antigravity.js +308 -0
- package/dist/installer/targets/antigravity.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +56 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +388 -0
- package/dist/installer/targets/claude.js.map +1 -0
- package/dist/installer/targets/codex.d.ts +18 -0
- package/dist/installer/targets/codex.d.ts.map +1 -0
- package/dist/installer/targets/codex.js +187 -0
- package/dist/installer/targets/codex.js.map +1 -0
- package/dist/installer/targets/cursor.d.ts +35 -0
- package/dist/installer/targets/cursor.d.ts.map +1 -0
- package/dist/installer/targets/cursor.js +254 -0
- package/dist/installer/targets/cursor.js.map +1 -0
- package/dist/installer/targets/gemini.d.ts +26 -0
- package/dist/installer/targets/gemini.d.ts.map +1 -0
- package/dist/installer/targets/gemini.js +167 -0
- package/dist/installer/targets/gemini.js.map +1 -0
- package/dist/installer/targets/hermes.d.ts +18 -0
- package/dist/installer/targets/hermes.d.ts.map +1 -0
- package/dist/installer/targets/hermes.js +359 -0
- package/dist/installer/targets/hermes.js.map +1 -0
- package/dist/installer/targets/kiro.d.ts +27 -0
- package/dist/installer/targets/kiro.d.ts.map +1 -0
- package/dist/installer/targets/kiro.js +178 -0
- package/dist/installer/targets/kiro.js.map +1 -0
- package/dist/installer/targets/opencode.d.ts +30 -0
- package/dist/installer/targets/opencode.d.ts.map +1 -0
- package/dist/installer/targets/opencode.js +237 -0
- package/dist/installer/targets/opencode.js.map +1 -0
- package/dist/installer/targets/registry.d.ts +35 -0
- package/dist/installer/targets/registry.d.ts.map +1 -0
- package/dist/installer/targets/registry.js +91 -0
- package/dist/installer/targets/registry.js.map +1 -0
- package/dist/installer/targets/shared.d.ts +77 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +247 -0
- package/dist/installer/targets/shared.js.map +1 -0
- package/dist/installer/targets/toml.d.ts +52 -0
- package/dist/installer/targets/toml.d.ts.map +1 -0
- package/dist/installer/targets/toml.js +147 -0
- package/dist/installer/targets/toml.js.map +1 -0
- package/dist/installer/targets/types.d.ts +101 -0
- package/dist/installer/targets/types.d.ts.map +1 -0
- package/dist/installer/targets/types.js +16 -0
- package/dist/installer/targets/types.js.map +1 -0
- package/dist/mcp/daemon-paths.d.ts +46 -0
- package/dist/mcp/daemon-paths.d.ts.map +1 -0
- package/dist/mcp/daemon-paths.js +125 -0
- package/dist/mcp/daemon-paths.js.map +1 -0
- package/dist/mcp/daemon.d.ts +220 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +616 -0
- package/dist/mcp/daemon.js.map +1 -0
- package/dist/mcp/engine.d.ts +105 -0
- package/dist/mcp/engine.d.ts.map +1 -0
- package/dist/mcp/engine.js +270 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/index.d.ts +112 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +478 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/ppid-watchdog.d.ts +44 -0
- package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
- package/dist/mcp/ppid-watchdog.js +27 -0
- package/dist/mcp/ppid-watchdog.js.map +1 -0
- package/dist/mcp/proxy.d.ts +81 -0
- package/dist/mcp/proxy.d.ts.map +1 -0
- package/dist/mcp/proxy.js +584 -0
- package/dist/mcp/proxy.js.map +1 -0
- package/dist/mcp/server-instructions.d.ts +19 -0
- package/dist/mcp/server-instructions.d.ts.map +1 -0
- package/dist/mcp/server-instructions.js +74 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +77 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +294 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/tools.d.ts +413 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +3049 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/transport.d.ts +188 -0
- package/dist/mcp/transport.d.ts.map +1 -0
- package/dist/mcp/transport.js +343 -0
- package/dist/mcp/transport.js.map +1 -0
- package/dist/mcp/version.d.ts +19 -0
- package/dist/mcp/version.d.ts.map +1 -0
- package/dist/mcp/version.js +71 -0
- package/dist/mcp/version.js.map +1 -0
- package/dist/resolution/callback-synthesizer.d.ts +10 -0
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/resolution/callback-synthesizer.js +1818 -0
- package/dist/resolution/callback-synthesizer.js.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/dist/resolution/frameworks/csharp.js +241 -0
- package/dist/resolution/frameworks/csharp.js.map +1 -0
- package/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
- package/dist/resolution/frameworks/drupal.js +367 -0
- package/dist/resolution/frameworks/drupal.js.map +1 -0
- package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
- package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
- package/dist/resolution/frameworks/expo-modules.js +148 -0
- package/dist/resolution/frameworks/expo-modules.js.map +1 -0
- package/dist/resolution/frameworks/express.d.ts +8 -0
- package/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/dist/resolution/frameworks/express.js +308 -0
- package/dist/resolution/frameworks/express.js.map +1 -0
- package/dist/resolution/frameworks/fabric.d.ts +3 -0
- package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
- package/dist/resolution/frameworks/fabric.js +354 -0
- package/dist/resolution/frameworks/fabric.js.map +1 -0
- package/dist/resolution/frameworks/go.d.ts +8 -0
- package/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/dist/resolution/frameworks/go.js +161 -0
- package/dist/resolution/frameworks/go.js.map +1 -0
- package/dist/resolution/frameworks/index.d.ts +48 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/resolution/frameworks/index.js +161 -0
- package/dist/resolution/frameworks/index.js.map +1 -0
- package/dist/resolution/frameworks/java.d.ts +8 -0
- package/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/dist/resolution/frameworks/java.js +504 -0
- package/dist/resolution/frameworks/java.js.map +1 -0
- package/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/dist/resolution/frameworks/laravel.js +257 -0
- package/dist/resolution/frameworks/laravel.js.map +1 -0
- package/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/dist/resolution/frameworks/nestjs.js +698 -0
- package/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/dist/resolution/frameworks/play.d.ts +19 -0
- package/dist/resolution/frameworks/play.d.ts.map +1 -0
- package/dist/resolution/frameworks/play.js +111 -0
- package/dist/resolution/frameworks/play.js.map +1 -0
- package/dist/resolution/frameworks/python.d.ts +10 -0
- package/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/dist/resolution/frameworks/python.js +400 -0
- package/dist/resolution/frameworks/python.js.map +1 -0
- package/dist/resolution/frameworks/react-native.d.ts +3 -0
- package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
- package/dist/resolution/frameworks/react-native.js +410 -0
- package/dist/resolution/frameworks/react-native.js.map +1 -0
- package/dist/resolution/frameworks/react.d.ts +8 -0
- package/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/dist/resolution/frameworks/react.js +365 -0
- package/dist/resolution/frameworks/react.js.map +1 -0
- package/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/dist/resolution/frameworks/ruby.js +302 -0
- package/dist/resolution/frameworks/ruby.js.map +1 -0
- package/dist/resolution/frameworks/rust.d.ts +8 -0
- package/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/dist/resolution/frameworks/rust.js +304 -0
- package/dist/resolution/frameworks/rust.js.map +1 -0
- package/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/dist/resolution/frameworks/svelte.js +249 -0
- package/dist/resolution/frameworks/svelte.js.map +1 -0
- package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
- package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift-objc.js +252 -0
- package/dist/resolution/frameworks/swift-objc.js.map +1 -0
- package/dist/resolution/frameworks/swift.d.ts +10 -0
- package/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift.js +400 -0
- package/dist/resolution/frameworks/swift.js.map +1 -0
- package/dist/resolution/frameworks/vue.d.ts +9 -0
- package/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/dist/resolution/frameworks/vue.js +306 -0
- package/dist/resolution/frameworks/vue.js.map +1 -0
- package/dist/resolution/go-module.d.ts +26 -0
- package/dist/resolution/go-module.d.ts.map +1 -0
- package/dist/resolution/go-module.js +78 -0
- package/dist/resolution/go-module.js.map +1 -0
- package/dist/resolution/import-resolver.d.ts +68 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -0
- package/dist/resolution/import-resolver.js +1726 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +159 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +1025 -0
- package/dist/resolution/index.js.map +1 -0
- package/dist/resolution/lru-cache.d.ts +24 -0
- package/dist/resolution/lru-cache.d.ts.map +1 -0
- package/dist/resolution/lru-cache.js +62 -0
- package/dist/resolution/lru-cache.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +52 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +707 -0
- package/dist/resolution/name-matcher.js.map +1 -0
- package/dist/resolution/path-aliases.d.ts +68 -0
- package/dist/resolution/path-aliases.d.ts.map +1 -0
- package/dist/resolution/path-aliases.js +238 -0
- package/dist/resolution/path-aliases.js.map +1 -0
- package/dist/resolution/strip-comments.d.ts +27 -0
- package/dist/resolution/strip-comments.d.ts.map +1 -0
- package/dist/resolution/strip-comments.js +441 -0
- package/dist/resolution/strip-comments.js.map +1 -0
- package/dist/resolution/swift-objc-bridge.d.ts +134 -0
- package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
- package/dist/resolution/swift-objc-bridge.js +256 -0
- package/dist/resolution/swift-objc-bridge.js.map +1 -0
- package/dist/resolution/types.d.ts +216 -0
- package/dist/resolution/types.d.ts.map +1 -0
- package/dist/resolution/types.js +8 -0
- package/dist/resolution/types.js.map +1 -0
- package/dist/resolution/workspace-packages.d.ts +48 -0
- package/dist/resolution/workspace-packages.d.ts.map +1 -0
- package/dist/resolution/workspace-packages.js +208 -0
- package/dist/resolution/workspace-packages.js.map +1 -0
- package/dist/search/query-parser.d.ts +57 -0
- package/dist/search/query-parser.d.ts.map +1 -0
- package/dist/search/query-parser.js +177 -0
- package/dist/search/query-parser.js.map +1 -0
- package/dist/search/query-utils.d.ts +71 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +380 -0
- package/dist/search/query-utils.js.map +1 -0
- package/dist/sync/git-hooks.d.ts +45 -0
- package/dist/sync/git-hooks.d.ts.map +1 -0
- package/dist/sync/git-hooks.js +225 -0
- package/dist/sync/git-hooks.js.map +1 -0
- package/dist/sync/index.d.ts +19 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +35 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/watch-policy.d.ts +48 -0
- package/dist/sync/watch-policy.d.ts.map +1 -0
- package/dist/sync/watch-policy.js +124 -0
- package/dist/sync/watch-policy.js.map +1 -0
- package/dist/sync/watcher.d.ts +283 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +606 -0
- package/dist/sync/watcher.js.map +1 -0
- package/dist/sync/worktree.d.ts +54 -0
- package/dist/sync/worktree.d.ts.map +1 -0
- package/dist/sync/worktree.js +137 -0
- package/dist/sync/worktree.js.map +1 -0
- package/dist/types.d.ts +377 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +80 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/glyphs.d.ts +42 -0
- package/dist/ui/glyphs.d.ts.map +1 -0
- package/dist/ui/glyphs.js +78 -0
- package/dist/ui/glyphs.js.map +1 -0
- package/dist/ui/shimmer-progress.d.ts +11 -0
- package/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/dist/ui/shimmer-progress.js +90 -0
- package/dist/ui/shimmer-progress.js.map +1 -0
- package/dist/ui/shimmer-worker.d.ts +2 -0
- package/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/dist/ui/shimmer-worker.js +118 -0
- package/dist/ui/shimmer-worker.js.map +1 -0
- package/dist/ui/types.d.ts +17 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +3 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/upgrade/index.d.ts +132 -0
- package/dist/upgrade/index.d.ts.map +1 -0
- package/dist/upgrade/index.js +462 -0
- package/dist/upgrade/index.js.map +1 -0
- package/dist/utils.d.ts +205 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +549 -0
- package/dist/utils.js.map +1 -0
- package/package.json +57 -0
- package/scripts/add-lang/bench.sh +60 -0
- package/scripts/add-lang/check-grammar.mjs +75 -0
- package/scripts/add-lang/dump-ast.mjs +103 -0
- package/scripts/add-lang/verify-extraction.mjs +70 -0
- package/scripts/agent-eval/arms-F.sh +21 -0
- package/scripts/agent-eval/arms-matrix.sh +37 -0
- package/scripts/agent-eval/audit.sh +68 -0
- package/scripts/agent-eval/bench-readme.sh +28 -0
- package/scripts/agent-eval/bench-why-repo.sh +22 -0
- package/scripts/agent-eval/block-read-hook.sh +19 -0
- package/scripts/agent-eval/hook-settings.json +15 -0
- package/scripts/agent-eval/itrun.sh +120 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -0
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
- package/scripts/agent-eval/parse-run.mjs +45 -0
- package/scripts/agent-eval/parse-session.mjs +93 -0
- package/scripts/agent-eval/probe-context.mjs +21 -0
- package/scripts/agent-eval/probe-explore.mjs +40 -0
- package/scripts/agent-eval/probe-node.mjs +20 -0
- package/scripts/agent-eval/probe-sweep.mjs +119 -0
- package/scripts/agent-eval/probe-trace.mjs +20 -0
- package/scripts/agent-eval/run-agent.sh +34 -0
- package/scripts/agent-eval/run-all.sh +67 -0
- package/scripts/agent-eval/run-arms.sh +56 -0
- package/scripts/agent-eval/seq-matrix.mjs +137 -0
- package/scripts/build-bundle.sh +118 -0
- package/scripts/extract-release-notes.mjs +130 -0
- package/scripts/local-install.sh +41 -0
- package/scripts/npm-sdk.js +75 -0
- package/scripts/npm-shim.js +246 -0
- package/scripts/pack-npm.sh +119 -0
- package/scripts/prepare-release.mjs +270 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-sitter-types.js","sourceRoot":"","sources":["../../src/extraction/tree-sitter-types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree-sitter Parser Wrapper
|
|
3
|
+
*
|
|
4
|
+
* Handles parsing source code and extracting structural information.
|
|
5
|
+
*/
|
|
6
|
+
import { Language, ExtractionResult } from '../types';
|
|
7
|
+
export { generateNodeId } from './tree-sitter-helpers';
|
|
8
|
+
/**
|
|
9
|
+
* TreeSitterExtractor - Main extraction class
|
|
10
|
+
*/
|
|
11
|
+
export declare class TreeSitterExtractor {
|
|
12
|
+
private filePath;
|
|
13
|
+
private language;
|
|
14
|
+
private source;
|
|
15
|
+
private tree;
|
|
16
|
+
private nodes;
|
|
17
|
+
private edges;
|
|
18
|
+
private unresolvedReferences;
|
|
19
|
+
private errors;
|
|
20
|
+
private extractor;
|
|
21
|
+
private nodeStack;
|
|
22
|
+
private methodIndex;
|
|
23
|
+
constructor(filePath: string, source: string, language?: Language);
|
|
24
|
+
/**
|
|
25
|
+
* Parse and extract from the source code
|
|
26
|
+
*/
|
|
27
|
+
extract(): ExtractionResult;
|
|
28
|
+
/**
|
|
29
|
+
* Visit a node and extract information
|
|
30
|
+
*/
|
|
31
|
+
private visitNode;
|
|
32
|
+
/**
|
|
33
|
+
* Create a Node object
|
|
34
|
+
*/
|
|
35
|
+
private createNode;
|
|
36
|
+
/**
|
|
37
|
+
* Find first named child whose type is in the given list.
|
|
38
|
+
* Used to locate inner type nodes (e.g. enum_specifier inside a typedef).
|
|
39
|
+
*/
|
|
40
|
+
private findChildByTypes;
|
|
41
|
+
/**
|
|
42
|
+
* Find a `packageTypes` child under the root, create a `namespace` node
|
|
43
|
+
* for it, and return its id so the caller can scope top-level
|
|
44
|
+
* declarations underneath. Returns null when no package header is
|
|
45
|
+
* present (script files, .kts without a package).
|
|
46
|
+
*/
|
|
47
|
+
private extractFilePackage;
|
|
48
|
+
/**
|
|
49
|
+
* Build qualified name from node stack
|
|
50
|
+
*/
|
|
51
|
+
private buildQualifiedName;
|
|
52
|
+
/**
|
|
53
|
+
* Build an ExtractorContext for passing to language-specific visitNode hooks.
|
|
54
|
+
*/
|
|
55
|
+
private makeExtractorContext;
|
|
56
|
+
/**
|
|
57
|
+
* Check if the current node stack indicates we are inside a class-like node
|
|
58
|
+
* (class, struct, interface, trait). File nodes do not count as class-like.
|
|
59
|
+
*/
|
|
60
|
+
private isInsideClassLikeNode;
|
|
61
|
+
/**
|
|
62
|
+
* Extract a function
|
|
63
|
+
*/
|
|
64
|
+
private extractFunction;
|
|
65
|
+
/**
|
|
66
|
+
* Extract a class
|
|
67
|
+
*/
|
|
68
|
+
private extractClass;
|
|
69
|
+
/**
|
|
70
|
+
* Extract a method
|
|
71
|
+
*/
|
|
72
|
+
private extractMethod;
|
|
73
|
+
/**
|
|
74
|
+
* Extract an interface/protocol/trait
|
|
75
|
+
*/
|
|
76
|
+
private extractInterface;
|
|
77
|
+
/**
|
|
78
|
+
* Extract a struct
|
|
79
|
+
*/
|
|
80
|
+
private extractStruct;
|
|
81
|
+
/**
|
|
82
|
+
* Extract an enum
|
|
83
|
+
*/
|
|
84
|
+
private extractEnum;
|
|
85
|
+
/**
|
|
86
|
+
* Extract enum member names from an enum member node.
|
|
87
|
+
* Handles multi-case declarations (Swift: `case put, delete`) and single-case patterns.
|
|
88
|
+
*/
|
|
89
|
+
private extractEnumMembers;
|
|
90
|
+
/**
|
|
91
|
+
* Extract a class property declaration (e.g. C# `public string Name { get; set; }`).
|
|
92
|
+
* Extracts as 'property' kind node inside the owning class.
|
|
93
|
+
*/
|
|
94
|
+
private extractProperty;
|
|
95
|
+
/**
|
|
96
|
+
* Extract a class field declaration (e.g. Java field_declaration, C# field_declaration).
|
|
97
|
+
* Extracts each declarator as a 'field' kind node inside the owning class.
|
|
98
|
+
*/
|
|
99
|
+
private extractField;
|
|
100
|
+
/**
|
|
101
|
+
* Extract function-valued properties of an object literal as named function
|
|
102
|
+
* nodes (named by their property key). Shared by the two object-of-functions
|
|
103
|
+
* shapes in extractVariable: the object as a direct const value, and the
|
|
104
|
+
* object returned by a store-initializer call. Handles both `key: () => {}` /
|
|
105
|
+
* `key: function() {}` pairs and method shorthand `key() {}`.
|
|
106
|
+
*/
|
|
107
|
+
private extractObjectLiteralFunctions;
|
|
108
|
+
/** Property-key text with surrounding quotes stripped (`'foo'` → `foo`). */
|
|
109
|
+
private objectKeyName;
|
|
110
|
+
/**
|
|
111
|
+
* Given a `call_expression` initializer (`create((set, get) => ({...}))`),
|
|
112
|
+
* find the object literal RETURNED by a function argument — descending through
|
|
113
|
+
* nested call_expression arguments so middleware wrappers are unwrapped
|
|
114
|
+
* (`create(persist((set, get) => ({...}), {...}))`, devtools, immer,
|
|
115
|
+
* subscribeWithSelector). Returns null when no such object is found — the
|
|
116
|
+
* common case for ordinary call initializers — so this stays cheap and silent
|
|
117
|
+
* rather than guessing. Keyed purely on AST shape; no library names.
|
|
118
|
+
*/
|
|
119
|
+
private findInitializerReturnedObject;
|
|
120
|
+
/**
|
|
121
|
+
* The object literal a function expression returns — either the `=> ({...})`
|
|
122
|
+
* arrow form (a parenthesized_expression wrapping an object) or a
|
|
123
|
+
* `=> { return {...} }` block. Returns null for any other body shape.
|
|
124
|
+
*/
|
|
125
|
+
private functionReturnedObject;
|
|
126
|
+
/**
|
|
127
|
+
* Extract a variable declaration (const, let, var, etc.)
|
|
128
|
+
*
|
|
129
|
+
* Extracts top-level and module-level variable declarations.
|
|
130
|
+
* Captures the variable name and first 100 chars of initializer in signature for searchability.
|
|
131
|
+
*/
|
|
132
|
+
private extractVariable;
|
|
133
|
+
/**
|
|
134
|
+
* Extract a type alias (e.g. `export type X = ...` in TypeScript).
|
|
135
|
+
* For languages like Go, resolveTypeAliasKind detects when the type_spec
|
|
136
|
+
* wraps a struct or interface definition and creates the correct node kind.
|
|
137
|
+
* Returns true if children should be skipped (struct/interface handled body visiting).
|
|
138
|
+
*/
|
|
139
|
+
private extractTypeAlias;
|
|
140
|
+
/**
|
|
141
|
+
* Extract the method specs of a Go `interface_type` body as `method` nodes
|
|
142
|
+
* contained by the interface (e.g. `Marshal`, `Unmarshal` of a `Core`
|
|
143
|
+
* interface). tree-sitter-go names these `method_elem` (newer) or
|
|
144
|
+
* `method_spec` (older). Embedded interfaces (`Reader` inside `ReadWriter`)
|
|
145
|
+
* are `type_identifier`s, not methods, and are left to inheritance extraction.
|
|
146
|
+
*/
|
|
147
|
+
private extractGoInterfaceMethods;
|
|
148
|
+
/**
|
|
149
|
+
* Surface the members of a TypeScript `type X = { ... }` (or intersection
|
|
150
|
+
* thereof) as `property` / `method` nodes under the type-alias node. Only
|
|
151
|
+
* walks the immediate object_type / intersection operands so anonymous
|
|
152
|
+
* nested object types inside generic arguments (`Promise<{ ok: true }>`)
|
|
153
|
+
* don't produce phantom members.
|
|
154
|
+
*/
|
|
155
|
+
private extractTsTypeAliasMembers;
|
|
156
|
+
/**
|
|
157
|
+
* `foo: () => T` → property_signature whose type_annotation contains a
|
|
158
|
+
* `function_type`. Treat that as a method-shaped contract member, since
|
|
159
|
+
* the call site `obj.foo()` has identical semantics to `bar(): T`.
|
|
160
|
+
*/
|
|
161
|
+
private isTsFunctionTypedProperty;
|
|
162
|
+
/**
|
|
163
|
+
* Extract an import
|
|
164
|
+
*
|
|
165
|
+
* Creates an import node with the full import statement stored in signature for searchability.
|
|
166
|
+
* Also creates unresolved references for resolution purposes.
|
|
167
|
+
*/
|
|
168
|
+
private extractImport;
|
|
169
|
+
/**
|
|
170
|
+
* Emit one `imports` reference per named/default import binding (TS/JS family),
|
|
171
|
+
* attributed to the file node — so the resolver links each imported symbol to
|
|
172
|
+
* the file that DEFINES it.
|
|
173
|
+
*
|
|
174
|
+
* Importing a symbol IS a dependency, but extraction only emits references for
|
|
175
|
+
* calls, instantiations, type annotations, and inheritance. A symbol that's
|
|
176
|
+
* imported and then only re-exported (`export { X } from './x'`), placed in a
|
|
177
|
+
* registry array (`[expressResolver, …]`), passed as an argument, or used in
|
|
178
|
+
* JSX produced NO cross-file edge at all — so the providing file showed a
|
|
179
|
+
* false "0 dependents" and was invisible to blast-radius / `affected`. The
|
|
180
|
+
* resolver maps the local name (alias-aware) to the provider's definition and
|
|
181
|
+
* creates a cross-file `imports` edge; `getFileDependents` picks it up, while
|
|
182
|
+
* `getImpactRadius` keeps it as a bounded leaf (the importing file node).
|
|
183
|
+
*
|
|
184
|
+
* Namespace imports (`import * as NS`) bind a whole module: `NS.member` calls
|
|
185
|
+
* resolve on their own, but a namespace used ONLY via a value-member read
|
|
186
|
+
* (`NS.SOME_CONST`) would leave no edge — so we also emit the namespace local
|
|
187
|
+
* name, which the resolver links to the module FILE as a dependency backstop.
|
|
188
|
+
*/
|
|
189
|
+
private emitImportBindingRefs;
|
|
190
|
+
/**
|
|
191
|
+
* Emit one `imports` reference per re-exported binding of a
|
|
192
|
+
* `export { A, B as C } from './y'` statement, attributed to the file node —
|
|
193
|
+
* so a barrel that re-exports from another module records a dependency on it.
|
|
194
|
+
*
|
|
195
|
+
* Links the SOURCE-side name (`A`, the `name` field — not the local alias
|
|
196
|
+
* `C`), since that is what the source module defines. `export * from './y'`
|
|
197
|
+
* has no named bindings to attribute and `export { default as X }` can't be
|
|
198
|
+
* name-matched, so both are skipped.
|
|
199
|
+
*/
|
|
200
|
+
private emitReExportRefs;
|
|
201
|
+
/**
|
|
202
|
+
* Emit one `imports` reference per binding of a Rust `use` declaration —
|
|
203
|
+
* `use crate::m::Item`, `use crate::m::{A, B as C}`, `pub use self::sub::Item`.
|
|
204
|
+
* Emits the FULL path (e.g. `self::sub::Item`, not just `Item`) so the resolver
|
|
205
|
+
* can resolve the module prefix to a file and find the leaf symbol there —
|
|
206
|
+
* disambiguating common-name re-exports (`pub use self::read::read`, where the
|
|
207
|
+
* leaf `read` collides with many same-named symbols). Falls back to name-match
|
|
208
|
+
* on the leaf when the path can't be resolved. `use ...::*` has no leaf binding.
|
|
209
|
+
*/
|
|
210
|
+
private emitRustUseBindingRefs;
|
|
211
|
+
/**
|
|
212
|
+
* Emit an `imports` reference for a single PHP `use Foo\Bar\Baz;` (grouped
|
|
213
|
+
* imports `use Foo\{A, B}` are handled where their per-item nodes are created).
|
|
214
|
+
* The reference targets the namespace-qualified `Foo\Bar::Baz` form classes are
|
|
215
|
+
* stored under (see the PHP `namespace` capture), so it resolves to the RIGHT
|
|
216
|
+
* definition — Laravel has many same-named contracts (`Factory`, `Dispatcher`,
|
|
217
|
+
* `Guard`) across namespaces that a bare-name match can't disambiguate.
|
|
218
|
+
*/
|
|
219
|
+
private emitPhpUseRefs;
|
|
220
|
+
/**
|
|
221
|
+
* Ruby `require`/`require_relative` → an `imports` ref to the required FILE.
|
|
222
|
+
* `require "sidekiq/fetch"` is load-path-relative (matched by file-path suffix
|
|
223
|
+
* via {@link matchByFilePath}); `require_relative "../foo"` is resolved against
|
|
224
|
+
* this file's directory. Bare gem/stdlib requires (`require "json"`, no slash)
|
|
225
|
+
* are skipped — they're external. The path form (a `/` + `.rb`) makes the ref
|
|
226
|
+
* resolve to the file node, so a file pulled in only by `require` — not by a
|
|
227
|
+
* resolved constant/call — still records a cross-file dependency.
|
|
228
|
+
*/
|
|
229
|
+
private emitRubyRequireRefs;
|
|
230
|
+
/** Convert a PHP FQN `Foo\Bar\Baz` to the stored `Foo\Bar::Baz` and emit an `imports` ref. */
|
|
231
|
+
private pushPhpUseRef;
|
|
232
|
+
/**
|
|
233
|
+
* Emit one `imports` reference per name imported in a Python
|
|
234
|
+
* `from module import A, B as C` statement, attributed to the file node — so
|
|
235
|
+
* the resolver links each imported name to the module that DEFINES it.
|
|
236
|
+
*
|
|
237
|
+
* Same recall gap as TS: extraction only emitted references for calls,
|
|
238
|
+
* instantiations, and inheritance, so a name imported and then used in a
|
|
239
|
+
* non-call position (a list/dict literal, a default argument, a decorator
|
|
240
|
+
* target, or simply re-exported through an `__init__.py` barrel) produced no
|
|
241
|
+
* cross-file edge — the providing module showed a false "0 dependents". Links
|
|
242
|
+
* the LOCAL name (alias when present, since that's what the resolver's import
|
|
243
|
+
* mapping keys on); `from module import *` has no names to attribute.
|
|
244
|
+
*/
|
|
245
|
+
private emitPyFromImportRefs;
|
|
246
|
+
/**
|
|
247
|
+
* Extract a function call
|
|
248
|
+
*/
|
|
249
|
+
private extractCall;
|
|
250
|
+
/**
|
|
251
|
+
* `new Foo(...)` / `Foo::new(...)` / object_creation_expression —
|
|
252
|
+
* emit an `instantiates` reference to the class name. The resolver
|
|
253
|
+
* then links it to the class node, producing the `instantiates`
|
|
254
|
+
* edge that powers "what creates instances of X" queries.
|
|
255
|
+
*
|
|
256
|
+
* Children are still walked so nested calls inside the constructor
|
|
257
|
+
* arguments (`new Foo(bar())`) get their own `calls` references.
|
|
258
|
+
*/
|
|
259
|
+
private extractInstantiation;
|
|
260
|
+
/**
|
|
261
|
+
* Static-member / value-read pass. A type/enum/class used only via a member
|
|
262
|
+
* VALUE — `Enum.value`, `Type.CONST`, `Colors.red`, `Foo::BAR` — recorded no
|
|
263
|
+
* edge, because the body walker only handled CALLS (`Type.method()`). So a
|
|
264
|
+
* type referenced only by an enum value or a static field looked like nothing
|
|
265
|
+
* depended on it (the residual frontier across Dart/Java/C#/Swift/Kotlin/PHP).
|
|
266
|
+
* Emit a `references` edge to the capitalized receiver. Gated to languages
|
|
267
|
+
* where types are Capitalized by convention, and skipped when the access is a
|
|
268
|
+
* call's callee (the call extractor already links the method).
|
|
269
|
+
*/
|
|
270
|
+
private extractStaticMemberRef;
|
|
271
|
+
private pushStaticMemberRef;
|
|
272
|
+
/**
|
|
273
|
+
* Find a `class_body` child of an `object_creation_expression` — the
|
|
274
|
+
* marker for an anonymous class (`new T() { ... }`). Returns the body
|
|
275
|
+
* node so the caller can walk it as the anon class's members.
|
|
276
|
+
*/
|
|
277
|
+
private findAnonymousClassBody;
|
|
278
|
+
/**
|
|
279
|
+
* Extract a Java/C# anonymous class — `new T() { ...members }`. Emits a
|
|
280
|
+
* `class` node named `<T$anon@line>`, an `extends` reference to T (so
|
|
281
|
+
* Phase 5.5 interface-impl can bridge), and walks the body so its
|
|
282
|
+
* `method_declaration` members become method nodes under the anon class.
|
|
283
|
+
*
|
|
284
|
+
* Why this matters: without anon-class extraction, the overrides inside
|
|
285
|
+
* a lambda-returned `new T() { @Override int foo(){...} }` are not nodes,
|
|
286
|
+
* so a call through T.foo (the abstract parent method) has no static
|
|
287
|
+
* target — the agent has to Read the file to find the implementation.
|
|
288
|
+
*/
|
|
289
|
+
private extractAnonymousClass;
|
|
290
|
+
/**
|
|
291
|
+
* Scan `declNode` and its preceding siblings (within the parent's
|
|
292
|
+
* named children) for decorator nodes, emitting a `decorates`
|
|
293
|
+
* reference from `decoratedId` to each decorator's function name.
|
|
294
|
+
*
|
|
295
|
+
* Why preceding siblings: in TypeScript, `@Foo class Bar {}` parses
|
|
296
|
+
* as an `export_statement` (or top-level wrapper) with the
|
|
297
|
+
* `decorator` as a child *before* the `class_declaration` — so the
|
|
298
|
+
* decorator isn't a child of the class itself. For methods/
|
|
299
|
+
* properties, the decorator IS a direct child of the declaration,
|
|
300
|
+
* so we also scan declNode.namedChildren.
|
|
301
|
+
*
|
|
302
|
+
* Idempotent across grammars: if neither location yields decorators
|
|
303
|
+
* (most non-decorator-using languages), the function is a no-op.
|
|
304
|
+
*/
|
|
305
|
+
private extractDecoratorsFor;
|
|
306
|
+
/**
|
|
307
|
+
* Visit function body and extract calls (and structural nodes).
|
|
308
|
+
*
|
|
309
|
+
* In addition to call expressions, this also detects class/struct/enum
|
|
310
|
+
* definitions inside function bodies. This handles two cases:
|
|
311
|
+
* 1. Local class/struct/enum definitions (valid in C++, Java, etc.)
|
|
312
|
+
* 2. C++ macro misparsing — macros like NLOHMANN_JSON_NAMESPACE_BEGIN cause
|
|
313
|
+
* tree-sitter to interpret the namespace block as a function_definition,
|
|
314
|
+
* hiding real class/struct/enum nodes inside the "function body".
|
|
315
|
+
*/
|
|
316
|
+
/**
|
|
317
|
+
* Rocket route-registration macros — `routes![a::b::handler, c::d::other]`
|
|
318
|
+
* and `catchers![not_found]`. Tree-sitter leaves a macro body as a flat
|
|
319
|
+
* `token_tree` of raw tokens (`identifier`, `::`, `,`), so the handler paths
|
|
320
|
+
* are never seen as references and each handler fn looks like it has no caller
|
|
321
|
+
* — it's mounted by Rocket at runtime, not called by in-repo code, so its file
|
|
322
|
+
* shows 0 dependents. Walk the token tree, reconstruct each comma-separated
|
|
323
|
+
* path, and emit a `references` edge; the Rust path resolver
|
|
324
|
+
* (`resolveRustPathReference`) then links it to the handler fn. The handler
|
|
325
|
+
* names are explicit in source, so this is precise static extraction, not a
|
|
326
|
+
* heuristic — no false edges (resolution still validates each path).
|
|
327
|
+
*/
|
|
328
|
+
private extractRustRouteMacro;
|
|
329
|
+
private visitFunctionBody;
|
|
330
|
+
/**
|
|
331
|
+
* Extract inheritance relationships
|
|
332
|
+
*/
|
|
333
|
+
private extractInheritance;
|
|
334
|
+
/**
|
|
335
|
+
* Rust `impl Trait for Type` — creates an implements edge from Type to Trait.
|
|
336
|
+
* For plain `impl Type { ... }` (no trait), no inheritance edge is needed.
|
|
337
|
+
*/
|
|
338
|
+
private extractRustImplItem;
|
|
339
|
+
/**
|
|
340
|
+
* Find a previously-extracted node by name (used for back-references like impl blocks)
|
|
341
|
+
*/
|
|
342
|
+
private findNodeByName;
|
|
343
|
+
/**
|
|
344
|
+
* Languages that support type annotations (TypeScript, etc.)
|
|
345
|
+
*/
|
|
346
|
+
private readonly TYPE_ANNOTATION_LANGUAGES;
|
|
347
|
+
/**
|
|
348
|
+
* PHP pseudo-types and `self`/`static`/`parent` that aren't project symbols.
|
|
349
|
+
* (Scalar primitives parse as `primitive_type` and are skipped structurally.)
|
|
350
|
+
*/
|
|
351
|
+
private readonly PHP_PSEUDO_TYPES;
|
|
352
|
+
/**
|
|
353
|
+
* Built-in/primitive type names that shouldn't create references
|
|
354
|
+
*/
|
|
355
|
+
private readonly BUILTIN_TYPES;
|
|
356
|
+
/**
|
|
357
|
+
* Extract type references from type annotations on a function/method/field node.
|
|
358
|
+
* Creates 'references' edges for parameter types, return types, and field types.
|
|
359
|
+
*/
|
|
360
|
+
private extractTypeAnnotations;
|
|
361
|
+
/**
|
|
362
|
+
* Extract C# type references from a node that owns a type position —
|
|
363
|
+
* a method/constructor declaration, a property declaration, or a
|
|
364
|
+
* field declaration (which wraps `variable_declaration → type`).
|
|
365
|
+
*
|
|
366
|
+
* Walks ONLY into known type fields, so parameter names like
|
|
367
|
+
* `request` in `Build(UserDto request)` are never mis-emitted as
|
|
368
|
+
* type references. Once inside a type subtree, `walkCsharpTypePosition`
|
|
369
|
+
* recognizes C#'s actual type-leaf node kinds (`identifier`,
|
|
370
|
+
* `qualified_name`, `generic_name`, `array_type`, `nullable_type`,
|
|
371
|
+
* `tuple_type`, …) — none of which are `type_identifier`. Closes #381.
|
|
372
|
+
*/
|
|
373
|
+
private extractCsharpTypeRefs;
|
|
374
|
+
/**
|
|
375
|
+
* Record the dependencies declared by a C# PRIMARY CONSTRUCTOR
|
|
376
|
+
* (`class Svc(IRepo repo, [FromKeyedServices("k")] ICache cache) { … }`,
|
|
377
|
+
* C# 12+). The parameter list hangs off the class/struct/record declaration
|
|
378
|
+
* as an unnamed-field `parameter_list` child (not the `parameters` field a
|
|
379
|
+
* method uses), so it's found by node type. Each parameter's declared type
|
|
380
|
+
* becomes a `references` edge from the owning type — these are exactly the
|
|
381
|
+
* services a DI-registered type depends on, so impact/blast-radius and
|
|
382
|
+
* "who depends on this contract" now see them. No-op when there's no primary
|
|
383
|
+
* constructor. (#237)
|
|
384
|
+
*/
|
|
385
|
+
private extractCsharpPrimaryCtorParamRefs;
|
|
386
|
+
/**
|
|
387
|
+
* Walk a C# subtree that is KNOWN to be in a type position
|
|
388
|
+
* (return type, parameter type, property type, field type, generic
|
|
389
|
+
* argument). Identifiers here are type names, not parameter names.
|
|
390
|
+
*/
|
|
391
|
+
private walkCsharpTypePosition;
|
|
392
|
+
/**
|
|
393
|
+
* Extract PHP type references from a method/function/property declaration.
|
|
394
|
+
* Walks ONLY type positions: each parameter's type child (inside
|
|
395
|
+
* `formal_parameters`), the return type, and a property's type — all
|
|
396
|
+
* `named_type` / `optional_type` / `union_type` / … direct children. Parameter
|
|
397
|
+
* and property NAMES are `variable_name` (`$x`), never type nodes, so they
|
|
398
|
+
* can't be mis-emitted.
|
|
399
|
+
*/
|
|
400
|
+
private extractPhpTypeRefs;
|
|
401
|
+
/** Walk a PHP subtree KNOWN to be in a type position; emit class/interface refs. */
|
|
402
|
+
private walkPhpTypePosition;
|
|
403
|
+
/**
|
|
404
|
+
* Extract type references from a variable's type annotation.
|
|
405
|
+
*/
|
|
406
|
+
private extractVariableTypeAnnotation;
|
|
407
|
+
/**
|
|
408
|
+
* Recursively walk a subtree and extract all type_identifier references.
|
|
409
|
+
* Handles unions, intersections, generics, arrays, etc.
|
|
410
|
+
*/
|
|
411
|
+
private extractTypeRefsFromSubtree;
|
|
412
|
+
/**
|
|
413
|
+
* Handle Pascal-specific AST structures.
|
|
414
|
+
* Returns true if the node was fully handled and children should be skipped.
|
|
415
|
+
*/
|
|
416
|
+
private visitPascalNode;
|
|
417
|
+
/**
|
|
418
|
+
* Extract a Pascal declType node (class, interface, enum, or type alias)
|
|
419
|
+
*/
|
|
420
|
+
private extractPascalDeclType;
|
|
421
|
+
/**
|
|
422
|
+
* Extract Pascal uses clause into individual import nodes
|
|
423
|
+
*/
|
|
424
|
+
private extractPascalUses;
|
|
425
|
+
/**
|
|
426
|
+
* Extract a Pascal constant declaration
|
|
427
|
+
*/
|
|
428
|
+
private extractPascalConst;
|
|
429
|
+
/**
|
|
430
|
+
* Extract Pascal inheritance (extends/implements) from declClass typeref children
|
|
431
|
+
*/
|
|
432
|
+
private extractPascalInheritance;
|
|
433
|
+
/**
|
|
434
|
+
* Extract calls and resolve method context from a Pascal defProc (implementation body).
|
|
435
|
+
* Does not create a new node — the declaration was already captured from the interface section.
|
|
436
|
+
*/
|
|
437
|
+
private extractPascalDefProc;
|
|
438
|
+
/**
|
|
439
|
+
* Extract function calls from a Pascal expression
|
|
440
|
+
*/
|
|
441
|
+
private extractPascalCall;
|
|
442
|
+
/**
|
|
443
|
+
* Recursively visit a Pascal block/statement tree for call expressions
|
|
444
|
+
*/
|
|
445
|
+
private visitPascalBlock;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Extract nodes and edges from source code.
|
|
449
|
+
*
|
|
450
|
+
* If `frameworkNames` is provided, framework-specific extractors matching
|
|
451
|
+
* those names and the file's language are run after the tree-sitter pass.
|
|
452
|
+
* Their nodes/references/errors are merged into the returned result.
|
|
453
|
+
*/
|
|
454
|
+
export declare function extractFromSource(filePath: string, source: string, language?: Language, frameworkNames?: string[]): ExtractionResult;
|
|
455
|
+
//# sourceMappingURL=tree-sitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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