@colbymchenry/codegraph-darwin-arm64 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codegraph +3 -0
- package/lib/dist/bin/codegraph.d.ts +21 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -0
- package/lib/dist/bin/codegraph.js +1273 -0
- package/lib/dist/bin/codegraph.js.map +1 -0
- package/lib/dist/bin/node-version-check.d.ts +37 -0
- package/lib/dist/bin/node-version-check.d.ts.map +1 -0
- package/lib/dist/bin/node-version-check.js +79 -0
- package/lib/dist/bin/node-version-check.js.map +1 -0
- package/lib/dist/bin/uninstall.d.ts +14 -0
- package/lib/dist/bin/uninstall.d.ts.map +1 -0
- package/lib/dist/bin/uninstall.js +36 -0
- package/lib/dist/bin/uninstall.js.map +1 -0
- package/lib/dist/config.d.ts +51 -0
- package/lib/dist/config.d.ts.map +1 -0
- package/lib/dist/config.js +321 -0
- package/lib/dist/config.js.map +1 -0
- package/lib/dist/context/formatter.d.ts +30 -0
- package/lib/dist/context/formatter.d.ts.map +1 -0
- package/lib/dist/context/formatter.js +244 -0
- package/lib/dist/context/formatter.js.map +1 -0
- package/lib/dist/context/index.d.ts +97 -0
- package/lib/dist/context/index.d.ts.map +1 -0
- package/lib/dist/context/index.js +1050 -0
- package/lib/dist/context/index.js.map +1 -0
- package/lib/dist/db/index.d.ts +83 -0
- package/lib/dist/db/index.d.ts.map +1 -0
- package/lib/dist/db/index.js +219 -0
- package/lib/dist/db/index.js.map +1 -0
- package/lib/dist/db/migrations.d.ts +44 -0
- package/lib/dist/db/migrations.d.ts.map +1 -0
- package/lib/dist/db/migrations.js +131 -0
- package/lib/dist/db/migrations.js.map +1 -0
- package/lib/dist/db/queries.d.ts +253 -0
- package/lib/dist/db/queries.d.ts.map +1 -0
- package/lib/dist/db/queries.js +1207 -0
- package/lib/dist/db/queries.js.map +1 -0
- package/lib/dist/db/schema.sql +151 -0
- package/lib/dist/db/sqlite-adapter.d.ts +46 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/lib/dist/db/sqlite-adapter.js +114 -0
- package/lib/dist/db/sqlite-adapter.js.map +1 -0
- package/lib/dist/directory.d.ts +57 -0
- package/lib/dist/directory.d.ts.map +1 -0
- package/lib/dist/directory.js +264 -0
- package/lib/dist/directory.js.map +1 -0
- package/lib/dist/errors.d.ts +136 -0
- package/lib/dist/errors.d.ts.map +1 -0
- package/lib/dist/errors.js +219 -0
- package/lib/dist/errors.js.map +1 -0
- package/lib/dist/extraction/dfm-extractor.d.ts +31 -0
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/dfm-extractor.js +151 -0
- package/lib/dist/extraction/dfm-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +78 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -0
- package/lib/dist/extraction/grammars.js +332 -0
- package/lib/dist/extraction/grammars.js.map +1 -0
- package/lib/dist/extraction/index.d.ts +130 -0
- package/lib/dist/extraction/index.d.ts.map +1 -0
- package/lib/dist/extraction/index.js +1305 -0
- package/lib/dist/extraction/index.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.js +126 -0
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -0
- package/lib/dist/extraction/languages/csharp.d.ts +3 -0
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/csharp.js +72 -0
- package/lib/dist/extraction/languages/csharp.js.map +1 -0
- package/lib/dist/extraction/languages/dart.d.ts +3 -0
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -0
- package/lib/dist/extraction/languages/dart.js +192 -0
- package/lib/dist/extraction/languages/dart.js.map +1 -0
- package/lib/dist/extraction/languages/go.d.ts +3 -0
- package/lib/dist/extraction/languages/go.d.ts.map +1 -0
- package/lib/dist/extraction/languages/go.js +58 -0
- package/lib/dist/extraction/languages/go.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts +10 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -0
- package/lib/dist/extraction/languages/index.js +49 -0
- package/lib/dist/extraction/languages/index.js.map +1 -0
- package/lib/dist/extraction/languages/java.d.ts +3 -0
- package/lib/dist/extraction/languages/java.d.ts.map +1 -0
- package/lib/dist/extraction/languages/java.js +64 -0
- package/lib/dist/extraction/languages/java.js.map +1 -0
- package/lib/dist/extraction/languages/javascript.d.ts +3 -0
- package/lib/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/javascript.js +90 -0
- package/lib/dist/extraction/languages/javascript.js.map +1 -0
- package/lib/dist/extraction/languages/kotlin.d.ts +3 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/lib/dist/extraction/languages/kotlin.js +253 -0
- package/lib/dist/extraction/languages/kotlin.js.map +1 -0
- package/lib/dist/extraction/languages/lua.d.ts +3 -0
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -0
- package/lib/dist/extraction/languages/lua.js +150 -0
- package/lib/dist/extraction/languages/lua.js.map +1 -0
- package/lib/dist/extraction/languages/luau.d.ts +3 -0
- package/lib/dist/extraction/languages/luau.d.ts.map +1 -0
- package/lib/dist/extraction/languages/luau.js +37 -0
- package/lib/dist/extraction/languages/luau.js.map +1 -0
- package/lib/dist/extraction/languages/pascal.d.ts +3 -0
- package/lib/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal.js +66 -0
- package/lib/dist/extraction/languages/pascal.js.map +1 -0
- package/lib/dist/extraction/languages/php.d.ts +3 -0
- package/lib/dist/extraction/languages/php.d.ts.map +1 -0
- package/lib/dist/extraction/languages/php.js +107 -0
- package/lib/dist/extraction/languages/php.js.map +1 -0
- package/lib/dist/extraction/languages/python.d.ts +3 -0
- package/lib/dist/extraction/languages/python.d.ts.map +1 -0
- package/lib/dist/extraction/languages/python.js +56 -0
- package/lib/dist/extraction/languages/python.js.map +1 -0
- package/lib/dist/extraction/languages/ruby.d.ts +3 -0
- package/lib/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/lib/dist/extraction/languages/ruby.js +114 -0
- package/lib/dist/extraction/languages/ruby.js.map +1 -0
- package/lib/dist/extraction/languages/rust.d.ts +3 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -0
- package/lib/dist/extraction/languages/rust.js +109 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -0
- package/lib/dist/extraction/languages/scala.d.ts +3 -0
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -0
- package/lib/dist/extraction/languages/scala.js +139 -0
- package/lib/dist/extraction/languages/scala.js.map +1 -0
- package/lib/dist/extraction/languages/swift.d.ts +3 -0
- package/lib/dist/extraction/languages/swift.d.ts.map +1 -0
- package/lib/dist/extraction/languages/swift.js +91 -0
- package/lib/dist/extraction/languages/swift.js.map +1 -0
- package/lib/dist/extraction/languages/typescript.d.ts +3 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/typescript.js +129 -0
- package/lib/dist/extraction/languages/typescript.js.map +1 -0
- package/lib/dist/extraction/liquid-extractor.d.ts +52 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/liquid-extractor.js +313 -0
- package/lib/dist/extraction/liquid-extractor.js.map +1 -0
- package/lib/dist/extraction/parse-worker.d.ts +8 -0
- package/lib/dist/extraction/parse-worker.d.ts.map +1 -0
- package/lib/dist/extraction/parse-worker.js +94 -0
- package/lib/dist/extraction/parse-worker.js.map +1 -0
- package/lib/dist/extraction/svelte-extractor.d.ts +56 -0
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/svelte-extractor.js +272 -0
- package/lib/dist/extraction/svelte-extractor.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js +103 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts +179 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.js +10 -0
- package/lib/dist/extraction/tree-sitter-types.js.map +1 -0
- package/lib/dist/extraction/tree-sitter.d.ts +233 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter.js +2425 -0
- package/lib/dist/extraction/tree-sitter.js.map +1 -0
- package/lib/dist/extraction/vue-extractor.d.ts +36 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/vue-extractor.js +163 -0
- package/lib/dist/extraction/vue-extractor.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/graph/index.d.ts +8 -0
- package/lib/dist/graph/index.d.ts.map +1 -0
- package/lib/dist/graph/index.js +13 -0
- package/lib/dist/graph/index.js.map +1 -0
- package/lib/dist/graph/queries.d.ts +106 -0
- package/lib/dist/graph/queries.d.ts.map +1 -0
- package/lib/dist/graph/queries.js +366 -0
- package/lib/dist/graph/queries.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +127 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -0
- package/lib/dist/graph/traversal.js +493 -0
- package/lib/dist/graph/traversal.js.map +1 -0
- package/lib/dist/index.d.ts +453 -0
- package/lib/dist/index.d.ts.map +1 -0
- package/lib/dist/index.js +833 -0
- package/lib/dist/index.js.map +1 -0
- package/lib/dist/installer/claude-md-template.d.ts +14 -0
- package/lib/dist/installer/claude-md-template.d.ts.map +1 -0
- package/lib/dist/installer/claude-md-template.js +21 -0
- package/lib/dist/installer/claude-md-template.js.map +1 -0
- package/lib/dist/installer/config-writer.d.ts +29 -0
- package/lib/dist/installer/config-writer.d.ts.map +1 -0
- package/lib/dist/installer/config-writer.js +111 -0
- package/lib/dist/installer/config-writer.js.map +1 -0
- package/lib/dist/installer/index.d.ts +65 -0
- package/lib/dist/installer/index.d.ts.map +1 -0
- package/lib/dist/installer/index.js +406 -0
- package/lib/dist/installer/index.js.map +1 -0
- package/lib/dist/installer/instructions-template.d.ts +28 -0
- package/lib/dist/installer/instructions-template.d.ts.map +1 -0
- package/lib/dist/installer/instructions-template.js +64 -0
- package/lib/dist/installer/instructions-template.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts +47 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -0
- package/lib/dist/installer/targets/claude.js +401 -0
- package/lib/dist/installer/targets/claude.js.map +1 -0
- package/lib/dist/installer/targets/codex.d.ts +18 -0
- package/lib/dist/installer/targets/codex.d.ts.map +1 -0
- package/lib/dist/installer/targets/codex.js +185 -0
- package/lib/dist/installer/targets/codex.js.map +1 -0
- package/lib/dist/installer/targets/cursor.d.ts +35 -0
- package/lib/dist/installer/targets/cursor.d.ts.map +1 -0
- package/lib/dist/installer/targets/cursor.js +229 -0
- package/lib/dist/installer/targets/cursor.js.map +1 -0
- package/lib/dist/installer/targets/opencode.d.ts +30 -0
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -0
- package/lib/dist/installer/targets/opencode.js +235 -0
- package/lib/dist/installer/targets/opencode.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts +35 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -0
- package/lib/dist/installer/targets/registry.js +83 -0
- package/lib/dist/installer/targets/registry.js.map +1 -0
- package/lib/dist/installer/targets/shared.d.ts +77 -0
- package/lib/dist/installer/targets/shared.d.ts.map +1 -0
- package/lib/dist/installer/targets/shared.js +246 -0
- package/lib/dist/installer/targets/shared.js.map +1 -0
- package/lib/dist/installer/targets/toml.d.ts +52 -0
- package/lib/dist/installer/targets/toml.d.ts.map +1 -0
- package/lib/dist/installer/targets/toml.js +147 -0
- package/lib/dist/installer/targets/toml.js.map +1 -0
- package/lib/dist/installer/targets/types.d.ts +116 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -0
- package/lib/dist/installer/targets/types.js +16 -0
- package/lib/dist/installer/targets/types.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +94 -0
- package/lib/dist/mcp/index.d.ts.map +1 -0
- package/lib/dist/mcp/index.js +453 -0
- package/lib/dist/mcp/index.js.map +1 -0
- package/lib/dist/mcp/server-instructions.d.ts +19 -0
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -0
- package/lib/dist/mcp/server-instructions.js +71 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +257 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -0
- package/lib/dist/mcp/tools.js +1646 -0
- package/lib/dist/mcp/tools.js.map +1 -0
- package/lib/dist/mcp/transport.d.ts +106 -0
- package/lib/dist/mcp/transport.d.ts.map +1 -0
- package/lib/dist/mcp/transport.js +233 -0
- package/lib/dist/mcp/transport.js.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.js +213 -0
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts +8 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/express.js +225 -0
- package/lib/dist/resolution/frameworks/express.js.map +1 -0
- package/lib/dist/resolution/frameworks/go.d.ts +8 -0
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/go.js +158 -0
- package/lib/dist/resolution/frameworks/go.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts +42 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/index.js +133 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -0
- package/lib/dist/resolution/frameworks/java.d.ts +8 -0
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/java.js +177 -0
- package/lib/dist/resolution/frameworks/java.js.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.js +248 -0
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.js +374 -0
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/python.d.ts +10 -0
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/python.js +278 -0
- package/lib/dist/resolution/frameworks/python.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +8 -0
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react.js +272 -0
- package/lib/dist/resolution/frameworks/react.js.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.js +198 -0
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -0
- package/lib/dist/resolution/frameworks/rust.d.ts +8 -0
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/rust.js +207 -0
- package/lib/dist/resolution/frameworks/rust.js.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.js +249 -0
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -0
- package/lib/dist/resolution/frameworks/swift.d.ts +10 -0
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/swift.js +376 -0
- package/lib/dist/resolution/frameworks/swift.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue.d.ts +9 -0
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue.js +306 -0
- package/lib/dist/resolution/frameworks/vue.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +40 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -0
- package/lib/dist/resolution/import-resolver.js +663 -0
- package/lib/dist/resolution/import-resolver.js.map +1 -0
- package/lib/dist/resolution/index.d.ts +106 -0
- package/lib/dist/resolution/index.d.ts.map +1 -0
- package/lib/dist/resolution/index.js +709 -0
- package/lib/dist/resolution/index.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +32 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -0
- package/lib/dist/resolution/name-matcher.js +384 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -0
- package/lib/dist/resolution/path-aliases.d.ts +68 -0
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -0
- package/lib/dist/resolution/path-aliases.js +238 -0
- package/lib/dist/resolution/path-aliases.js.map +1 -0
- package/lib/dist/resolution/strip-comments.d.ts +27 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -0
- package/lib/dist/resolution/strip-comments.js +441 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +172 -0
- package/lib/dist/resolution/types.d.ts.map +1 -0
- package/lib/dist/resolution/types.js +8 -0
- package/lib/dist/resolution/types.js.map +1 -0
- package/lib/dist/search/query-parser.d.ts +57 -0
- package/lib/dist/search/query-parser.d.ts.map +1 -0
- package/lib/dist/search/query-parser.js +177 -0
- package/lib/dist/search/query-parser.js.map +1 -0
- package/lib/dist/search/query-utils.d.ts +53 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -0
- package/lib/dist/search/query-utils.js +350 -0
- package/lib/dist/search/query-utils.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts +45 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -0
- package/lib/dist/sync/git-hooks.js +223 -0
- package/lib/dist/sync/git-hooks.js.map +1 -0
- package/lib/dist/sync/index.d.ts +17 -0
- package/lib/dist/sync/index.d.ts.map +1 -0
- package/lib/dist/sync/index.js +28 -0
- package/lib/dist/sync/index.js.map +1 -0
- package/lib/dist/sync/watch-policy.d.ts +48 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -0
- package/lib/dist/sync/watch-policy.js +124 -0
- package/lib/dist/sync/watch-policy.js.map +1 -0
- package/lib/dist/sync/watcher.d.ts +81 -0
- package/lib/dist/sync/watcher.d.ts.map +1 -0
- package/lib/dist/sync/watcher.js +194 -0
- package/lib/dist/sync/watcher.js.map +1 -0
- package/lib/dist/types.d.ts +423 -0
- package/lib/dist/types.d.ts.map +1 -0
- package/lib/dist/types.js +262 -0
- package/lib/dist/types.js.map +1 -0
- package/lib/dist/ui/glyphs.d.ts +42 -0
- package/lib/dist/ui/glyphs.d.ts.map +1 -0
- package/lib/dist/ui/glyphs.js +78 -0
- package/lib/dist/ui/glyphs.js.map +1 -0
- package/lib/dist/ui/shimmer-progress.d.ts +11 -0
- package/lib/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-progress.js +90 -0
- package/lib/dist/ui/shimmer-progress.js.map +1 -0
- package/lib/dist/ui/shimmer-worker.d.ts +2 -0
- package/lib/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-worker.js +118 -0
- package/lib/dist/ui/shimmer-worker.js.map +1 -0
- package/lib/dist/ui/types.d.ts +17 -0
- package/lib/dist/ui/types.d.ts.map +1 -0
- package/lib/dist/ui/types.js +3 -0
- package/lib/dist/ui/types.js.map +1 -0
- package/lib/dist/utils.d.ts +205 -0
- package/lib/dist/utils.d.ts.map +1 -0
- package/lib/dist/utils.js +549 -0
- package/lib/dist/utils.js.map +1 -0
- package/lib/node_modules/.package-lock.json +116 -0
- package/lib/node_modules/@clack/core/CHANGELOG.md +348 -0
- package/lib/node_modules/@clack/core/LICENSE +9 -0
- package/lib/node_modules/@clack/core/README.md +22 -0
- package/lib/node_modules/@clack/core/dist/index.d.mts +363 -0
- package/lib/node_modules/@clack/core/dist/index.mjs +17 -0
- package/lib/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/core/package.json +63 -0
- package/lib/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/lib/node_modules/@clack/prompts/LICENSE +9 -0
- package/lib/node_modules/@clack/prompts/README.md +375 -0
- package/lib/node_modules/@clack/prompts/dist/index.d.mts +396 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs +144 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/prompts/package.json +68 -0
- package/lib/node_modules/commander/LICENSE +22 -0
- package/lib/node_modules/commander/Readme.md +1176 -0
- package/lib/node_modules/commander/esm.mjs +16 -0
- package/lib/node_modules/commander/index.js +24 -0
- package/lib/node_modules/commander/lib/argument.js +150 -0
- package/lib/node_modules/commander/lib/command.js +2777 -0
- package/lib/node_modules/commander/lib/error.js +39 -0
- package/lib/node_modules/commander/lib/help.js +747 -0
- package/lib/node_modules/commander/lib/option.js +380 -0
- package/lib/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/lib/node_modules/commander/package-support.json +19 -0
- package/lib/node_modules/commander/package.json +82 -0
- package/lib/node_modules/commander/typings/esm.d.mts +3 -0
- package/lib/node_modules/commander/typings/index.d.ts +1113 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/lib/node_modules/fast-string-truncated-width/license +21 -0
- package/lib/node_modules/fast-string-truncated-width/package.json +35 -0
- package/lib/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/lib/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-width/dist/index.js +14 -0
- package/lib/node_modules/fast-string-width/license +21 -0
- package/lib/node_modules/fast-string-width/package.json +34 -0
- package/lib/node_modules/fast-string-width/readme.md +42 -0
- package/lib/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/lib/node_modules/fast-wrap-ansi/README.md +26 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js +219 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/lib/node_modules/fast-wrap-ansi/package.json +51 -0
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/lib/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/lib/node_modules/jsonc-parser/README.md +364 -0
- package/lib/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/lib/node_modules/jsonc-parser/package.json +37 -0
- package/lib/node_modules/picomatch/LICENSE +21 -0
- package/lib/node_modules/picomatch/README.md +738 -0
- package/lib/node_modules/picomatch/index.js +17 -0
- package/lib/node_modules/picomatch/lib/constants.js +180 -0
- package/lib/node_modules/picomatch/lib/parse.js +1085 -0
- package/lib/node_modules/picomatch/lib/picomatch.js +341 -0
- package/lib/node_modules/picomatch/lib/scan.js +391 -0
- package/lib/node_modules/picomatch/lib/utils.js +72 -0
- package/lib/node_modules/picomatch/package.json +83 -0
- package/lib/node_modules/picomatch/posix.js +3 -0
- package/lib/node_modules/sisteransi/license +21 -0
- package/lib/node_modules/sisteransi/package.json +34 -0
- package/lib/node_modules/sisteransi/readme.md +113 -0
- package/lib/node_modules/sisteransi/src/index.js +58 -0
- package/lib/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/lib/node_modules/tree-sitter-wasms/LICENSE +24 -0
- package/lib/node_modules/tree-sitter-wasms/README.md +23 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/package.json +64 -0
- package/lib/node_modules/web-tree-sitter/LICENSE +21 -0
- package/lib/node_modules/web-tree-sitter/README.md +269 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs +4558 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js +4516 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm.map +31 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.c +48 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.h +41 -0
- package/lib/node_modules/web-tree-sitter/lib/array.h +291 -0
- package/lib/node_modules/web-tree-sitter/lib/atomic.h +68 -0
- package/lib/node_modules/web-tree-sitter/lib/clock.h +146 -0
- package/lib/node_modules/web-tree-sitter/lib/error_costs.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.c +523 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.h +36 -0
- package/lib/node_modules/web-tree-sitter/lib/host.h +21 -0
- package/lib/node_modules/web-tree-sitter/lib/language.c +293 -0
- package/lib/node_modules/web-tree-sitter/lib/language.h +293 -0
- package/lib/node_modules/web-tree-sitter/lib/length.h +52 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.c +483 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.h +54 -0
- package/lib/node_modules/web-tree-sitter/lib/lib.c +12 -0
- package/lib/node_modules/web-tree-sitter/lib/node.c +875 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.c +2297 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.h +286 -0
- package/lib/node_modules/web-tree-sitter/lib/point.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/query.c +4347 -0
- package/lib/node_modules/web-tree-sitter/lib/reduce_action.h +34 -0
- package/lib/node_modules/web-tree-sitter/lib/reusable_node.h +95 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.c +912 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.h +133 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.c +1034 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.h +399 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.c +987 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.cjs +2988 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm.map +1 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.c +170 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.h +31 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.c +716 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/ts_assert.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/unicode.h +75 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.c +1937 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.h +31 -0
- package/lib/node_modules/web-tree-sitter/package.json +98 -0
- package/lib/node_modules/web-tree-sitter/src/bindings.ts +26 -0
- package/lib/node_modules/web-tree-sitter/src/constants.ts +133 -0
- package/lib/node_modules/web-tree-sitter/src/index.ts +31 -0
- package/lib/node_modules/web-tree-sitter/src/language.ts +291 -0
- package/lib/node_modules/web-tree-sitter/src/lookahead_iterator.ts +75 -0
- package/lib/node_modules/web-tree-sitter/src/marshal.ts +176 -0
- package/lib/node_modules/web-tree-sitter/src/node.ts +646 -0
- package/lib/node_modules/web-tree-sitter/src/parser.ts +325 -0
- package/lib/node_modules/web-tree-sitter/src/query.ts +973 -0
- package/lib/node_modules/web-tree-sitter/src/tree.ts +145 -0
- package/lib/node_modules/web-tree-sitter/src/tree_cursor.ts +318 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs +4031 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js +3980 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm.map +30 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1030 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +56 -0
- package/lib/package.json +55 -0
- package/node +0 -0
- package/package.json +17 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Graph Query Functions
|
|
4
|
+
*
|
|
5
|
+
* Higher-level query functions built on top of traversal algorithms.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.GraphQueryManager = void 0;
|
|
9
|
+
const traversal_1 = require("./traversal");
|
|
10
|
+
/**
|
|
11
|
+
* Graph query manager for complex queries
|
|
12
|
+
*/
|
|
13
|
+
class GraphQueryManager {
|
|
14
|
+
queries;
|
|
15
|
+
traverser;
|
|
16
|
+
constructor(queries) {
|
|
17
|
+
this.queries = queries;
|
|
18
|
+
this.traverser = new traversal_1.GraphTraverser(queries);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get full context for a node
|
|
22
|
+
*
|
|
23
|
+
* Returns the focal node along with its ancestors, children,
|
|
24
|
+
* and both incoming and outgoing references.
|
|
25
|
+
*
|
|
26
|
+
* @param nodeId - ID of the focal node
|
|
27
|
+
* @returns Context object with all related information
|
|
28
|
+
*/
|
|
29
|
+
getContext(nodeId) {
|
|
30
|
+
const focal = this.queries.getNodeById(nodeId);
|
|
31
|
+
if (!focal) {
|
|
32
|
+
throw new Error(`Node not found: ${nodeId}`);
|
|
33
|
+
}
|
|
34
|
+
// Get ancestors (containment hierarchy)
|
|
35
|
+
const ancestors = this.traverser.getAncestors(nodeId);
|
|
36
|
+
// Get children
|
|
37
|
+
const children = this.traverser.getChildren(nodeId);
|
|
38
|
+
// Get incoming references (things that reference this node)
|
|
39
|
+
const incomingEdges = this.queries.getIncomingEdges(nodeId);
|
|
40
|
+
const incomingRefs = [];
|
|
41
|
+
for (const edge of incomingEdges) {
|
|
42
|
+
// Skip containment edges (already in ancestors)
|
|
43
|
+
if (edge.kind === 'contains') {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const node = this.queries.getNodeById(edge.source);
|
|
47
|
+
if (node) {
|
|
48
|
+
incomingRefs.push({ node, edge });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Get outgoing references (things this node references)
|
|
52
|
+
const outgoingEdges = this.queries.getOutgoingEdges(nodeId);
|
|
53
|
+
const outgoingRefs = [];
|
|
54
|
+
for (const edge of outgoingEdges) {
|
|
55
|
+
// Skip containment edges (already in children)
|
|
56
|
+
if (edge.kind === 'contains') {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const node = this.queries.getNodeById(edge.target);
|
|
60
|
+
if (node) {
|
|
61
|
+
outgoingRefs.push({ node, edge });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Get type information (type_of, returns edges)
|
|
65
|
+
const types = [];
|
|
66
|
+
const typeEdgeKinds = ['type_of', 'returns'];
|
|
67
|
+
for (const kind of typeEdgeKinds) {
|
|
68
|
+
const typeEdges = this.queries.getOutgoingEdges(nodeId, [kind]);
|
|
69
|
+
for (const edge of typeEdges) {
|
|
70
|
+
const typeNode = this.queries.getNodeById(edge.target);
|
|
71
|
+
if (typeNode && !types.some((t) => t.id === typeNode.id)) {
|
|
72
|
+
types.push(typeNode);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Get relevant imports
|
|
77
|
+
const imports = [];
|
|
78
|
+
const fileNode = ancestors.find((a) => a.kind === 'file');
|
|
79
|
+
if (fileNode) {
|
|
80
|
+
const importEdges = this.queries.getOutgoingEdges(fileNode.id, ['imports']);
|
|
81
|
+
for (const edge of importEdges) {
|
|
82
|
+
const importNode = this.queries.getNodeById(edge.target);
|
|
83
|
+
if (importNode) {
|
|
84
|
+
imports.push(importNode);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
focal,
|
|
90
|
+
ancestors,
|
|
91
|
+
children,
|
|
92
|
+
incomingRefs,
|
|
93
|
+
outgoingRefs,
|
|
94
|
+
types,
|
|
95
|
+
imports,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get dependencies of a file
|
|
100
|
+
*
|
|
101
|
+
* Returns all files that this file imports from.
|
|
102
|
+
*
|
|
103
|
+
* @param filePath - Path to the file
|
|
104
|
+
* @returns Array of file paths this file depends on
|
|
105
|
+
*/
|
|
106
|
+
getFileDependencies(filePath) {
|
|
107
|
+
const nodes = this.queries.getNodesByFile(filePath);
|
|
108
|
+
const fileNode = nodes.find((n) => n.kind === 'file');
|
|
109
|
+
if (!fileNode) {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
const dependencies = new Set();
|
|
113
|
+
const importEdges = this.queries.getOutgoingEdges(fileNode.id, ['imports']);
|
|
114
|
+
for (const edge of importEdges) {
|
|
115
|
+
const targetNode = this.queries.getNodeById(edge.target);
|
|
116
|
+
if (targetNode && targetNode.filePath !== filePath) {
|
|
117
|
+
dependencies.add(targetNode.filePath);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return Array.from(dependencies);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get dependents of a file
|
|
124
|
+
*
|
|
125
|
+
* Returns all files that import from this file.
|
|
126
|
+
*
|
|
127
|
+
* @param filePath - Path to the file
|
|
128
|
+
* @returns Array of file paths that depend on this file
|
|
129
|
+
*/
|
|
130
|
+
getFileDependents(filePath) {
|
|
131
|
+
const nodes = this.queries.getNodesByFile(filePath);
|
|
132
|
+
const dependents = new Set();
|
|
133
|
+
// Check file-level incoming import edges (file:X imports file:Y)
|
|
134
|
+
const fileNode = nodes.find((n) => n.kind === 'file');
|
|
135
|
+
if (fileNode) {
|
|
136
|
+
const incomingFileEdges = this.queries.getIncomingEdges(fileNode.id, ['imports']);
|
|
137
|
+
for (const edge of incomingFileEdges) {
|
|
138
|
+
const sourceNode = this.queries.getNodeById(edge.source);
|
|
139
|
+
if (sourceNode && sourceNode.filePath !== filePath) {
|
|
140
|
+
dependents.add(sourceNode.filePath);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Also check node-level imports of exported symbols
|
|
145
|
+
for (const node of nodes) {
|
|
146
|
+
if (node.isExported) {
|
|
147
|
+
const incomingEdges = this.queries.getIncomingEdges(node.id, ['imports']);
|
|
148
|
+
for (const edge of incomingEdges) {
|
|
149
|
+
const sourceNode = this.queries.getNodeById(edge.source);
|
|
150
|
+
if (sourceNode && sourceNode.filePath !== filePath) {
|
|
151
|
+
dependents.add(sourceNode.filePath);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return Array.from(dependents);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Get all symbols exported by a file
|
|
160
|
+
*
|
|
161
|
+
* @param filePath - Path to the file
|
|
162
|
+
* @returns Array of exported nodes
|
|
163
|
+
*/
|
|
164
|
+
getExportedSymbols(filePath) {
|
|
165
|
+
const nodes = this.queries.getNodesByFile(filePath);
|
|
166
|
+
return nodes.filter((n) => n.isExported);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Find symbols by qualified name pattern
|
|
170
|
+
*
|
|
171
|
+
* @param pattern - Pattern to match (supports * wildcard)
|
|
172
|
+
* @returns Array of matching nodes
|
|
173
|
+
*/
|
|
174
|
+
findByQualifiedName(pattern) {
|
|
175
|
+
// Convert glob pattern to regex
|
|
176
|
+
const regexPattern = pattern
|
|
177
|
+
.replace(/[.+^${}()|[\]\\]/g, '\\$&')
|
|
178
|
+
.replace(/\*/g, '.*')
|
|
179
|
+
.replace(/\?/g, '.');
|
|
180
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
181
|
+
// This is inefficient for large graphs - would need FTS index on qualified_name
|
|
182
|
+
// For now, use kind-based filtering if possible
|
|
183
|
+
const allNodes = [];
|
|
184
|
+
const kinds = [
|
|
185
|
+
'class',
|
|
186
|
+
'function',
|
|
187
|
+
'method',
|
|
188
|
+
'interface',
|
|
189
|
+
'type_alias',
|
|
190
|
+
'variable',
|
|
191
|
+
'constant',
|
|
192
|
+
];
|
|
193
|
+
for (const kind of kinds) {
|
|
194
|
+
const nodes = this.queries.getNodesByKind(kind);
|
|
195
|
+
for (const node of nodes) {
|
|
196
|
+
if (regex.test(node.qualifiedName)) {
|
|
197
|
+
allNodes.push(node);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return allNodes;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Get the module/package structure
|
|
205
|
+
*
|
|
206
|
+
* Returns a tree structure of files organized by directory.
|
|
207
|
+
*
|
|
208
|
+
* @returns Map of directory paths to contained files
|
|
209
|
+
*/
|
|
210
|
+
getModuleStructure() {
|
|
211
|
+
const files = this.queries.getAllFiles();
|
|
212
|
+
const structure = new Map();
|
|
213
|
+
for (const file of files) {
|
|
214
|
+
const parts = file.path.split('/');
|
|
215
|
+
const dir = parts.slice(0, -1).join('/') || '.';
|
|
216
|
+
if (!structure.has(dir)) {
|
|
217
|
+
structure.set(dir, []);
|
|
218
|
+
}
|
|
219
|
+
structure.get(dir).push(file.path);
|
|
220
|
+
}
|
|
221
|
+
return structure;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Find circular dependencies in the graph
|
|
225
|
+
*
|
|
226
|
+
* @returns Array of cycles, each cycle is an array of node IDs
|
|
227
|
+
*/
|
|
228
|
+
findCircularDependencies() {
|
|
229
|
+
const files = this.queries.getAllFiles();
|
|
230
|
+
const cycles = [];
|
|
231
|
+
const visited = new Set();
|
|
232
|
+
const recursionStack = new Set();
|
|
233
|
+
const dfs = (filePath, path) => {
|
|
234
|
+
if (recursionStack.has(filePath)) {
|
|
235
|
+
// Found a cycle
|
|
236
|
+
const cycleStart = path.indexOf(filePath);
|
|
237
|
+
if (cycleStart !== -1) {
|
|
238
|
+
cycles.push(path.slice(cycleStart));
|
|
239
|
+
}
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
if (visited.has(filePath)) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
visited.add(filePath);
|
|
246
|
+
recursionStack.add(filePath);
|
|
247
|
+
const dependencies = this.getFileDependencies(filePath);
|
|
248
|
+
for (const dep of dependencies) {
|
|
249
|
+
dfs(dep, [...path, filePath]);
|
|
250
|
+
}
|
|
251
|
+
recursionStack.delete(filePath);
|
|
252
|
+
};
|
|
253
|
+
for (const file of files) {
|
|
254
|
+
if (!visited.has(file.path)) {
|
|
255
|
+
dfs(file.path, []);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return cycles;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Get complexity metrics for a node
|
|
262
|
+
*
|
|
263
|
+
* @param nodeId - ID of the node
|
|
264
|
+
* @returns Object containing various complexity metrics
|
|
265
|
+
*/
|
|
266
|
+
getNodeMetrics(nodeId) {
|
|
267
|
+
const incomingEdges = this.queries.getIncomingEdges(nodeId);
|
|
268
|
+
const outgoingEdges = this.queries.getOutgoingEdges(nodeId);
|
|
269
|
+
const callEdges = outgoingEdges.filter((e) => e.kind === 'calls');
|
|
270
|
+
const callerEdges = incomingEdges.filter((e) => e.kind === 'calls');
|
|
271
|
+
const containsEdges = outgoingEdges.filter((e) => e.kind === 'contains');
|
|
272
|
+
const ancestors = this.traverser.getAncestors(nodeId);
|
|
273
|
+
return {
|
|
274
|
+
incomingEdgeCount: incomingEdges.length,
|
|
275
|
+
outgoingEdgeCount: outgoingEdges.length,
|
|
276
|
+
callCount: callEdges.length,
|
|
277
|
+
callerCount: callerEdges.length,
|
|
278
|
+
childCount: containsEdges.length,
|
|
279
|
+
depth: ancestors.length,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Find dead code (nodes with no incoming references)
|
|
284
|
+
*
|
|
285
|
+
* @param kinds - Node kinds to check (default: functions, methods, classes)
|
|
286
|
+
* @returns Array of unreferenced nodes
|
|
287
|
+
*/
|
|
288
|
+
findDeadCode(kinds) {
|
|
289
|
+
const targetKinds = kinds || ['function', 'method', 'class'];
|
|
290
|
+
const deadCode = [];
|
|
291
|
+
for (const kind of targetKinds) {
|
|
292
|
+
const nodes = this.queries.getNodesByKind(kind);
|
|
293
|
+
for (const node of nodes) {
|
|
294
|
+
// Skip exported symbols (they may be used externally)
|
|
295
|
+
if (node.isExported) {
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
const incomingEdges = this.queries.getIncomingEdges(node.id);
|
|
299
|
+
// Filter out containment edges
|
|
300
|
+
const references = incomingEdges.filter((e) => e.kind !== 'contains');
|
|
301
|
+
if (references.length === 0) {
|
|
302
|
+
deadCode.push(node);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return deadCode;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Get subgraph containing nodes matching a filter
|
|
310
|
+
*
|
|
311
|
+
* @param filter - Filter function to select nodes
|
|
312
|
+
* @param includeEdges - Whether to include edges between matching nodes
|
|
313
|
+
* @returns Subgraph containing matching nodes
|
|
314
|
+
*/
|
|
315
|
+
getFilteredSubgraph(filter, includeEdges = true) {
|
|
316
|
+
const nodes = new Map();
|
|
317
|
+
const edges = [];
|
|
318
|
+
// Get all nodes of common kinds
|
|
319
|
+
const kinds = [
|
|
320
|
+
'file',
|
|
321
|
+
'module',
|
|
322
|
+
'class',
|
|
323
|
+
'struct',
|
|
324
|
+
'interface',
|
|
325
|
+
'trait',
|
|
326
|
+
'function',
|
|
327
|
+
'method',
|
|
328
|
+
'variable',
|
|
329
|
+
'constant',
|
|
330
|
+
'enum',
|
|
331
|
+
'type_alias',
|
|
332
|
+
];
|
|
333
|
+
for (const kind of kinds) {
|
|
334
|
+
const kindNodes = this.queries.getNodesByKind(kind);
|
|
335
|
+
for (const node of kindNodes) {
|
|
336
|
+
if (filter(node)) {
|
|
337
|
+
nodes.set(node.id, node);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
// Include edges between matching nodes
|
|
342
|
+
if (includeEdges) {
|
|
343
|
+
for (const nodeId of nodes.keys()) {
|
|
344
|
+
const outgoing = this.queries.getOutgoingEdges(nodeId);
|
|
345
|
+
for (const edge of outgoing) {
|
|
346
|
+
if (nodes.has(edge.target)) {
|
|
347
|
+
edges.push(edge);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
nodes,
|
|
354
|
+
edges,
|
|
355
|
+
roots: [],
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Access the underlying traverser for direct traversal operations
|
|
360
|
+
*/
|
|
361
|
+
getTraverser() {
|
|
362
|
+
return this.traverser;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
exports.GraphQueryManager = GraphQueryManager;
|
|
366
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/graph/queries.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH,2CAA6C;AAE7C;;GAEG;AACH,MAAa,iBAAiB;IACpB,OAAO,CAAe;IACtB,SAAS,CAAiB;IAElC,YAAY,OAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,0BAAc,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;OAQG;IACH,UAAU,CAAC,MAAc;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE/C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;QAC/C,CAAC;QAED,wCAAwC;QACxC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAEtD,eAAe;QACf,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEpD,4DAA4D;QAC5D,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC5D,MAAM,YAAY,GAAsC,EAAE,CAAC;QAC3D,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,gDAAgD;YAChD,IAAI,IAAI,CAAC,IAAI,KAAK,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CAAC,IAAI,EAAE,EAAE,CAAC;gBAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBACvD,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;oBAC5B,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;wBAC3B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,KAAK;YACL,KAAK;YACL,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AA9ZD,8CA8ZC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Traversal Algorithms
|
|
3
|
+
*
|
|
4
|
+
* BFS and DFS traversal for the code knowledge graph.
|
|
5
|
+
*/
|
|
6
|
+
import { Node, Edge, Subgraph, TraversalOptions, EdgeKind } from '../types';
|
|
7
|
+
import { QueryBuilder } from '../db/queries';
|
|
8
|
+
/**
|
|
9
|
+
* Graph traverser for BFS and DFS traversal
|
|
10
|
+
*/
|
|
11
|
+
export declare class GraphTraverser {
|
|
12
|
+
private queries;
|
|
13
|
+
constructor(queries: QueryBuilder);
|
|
14
|
+
/**
|
|
15
|
+
* Traverse the graph using breadth-first search
|
|
16
|
+
*
|
|
17
|
+
* @param startId - Starting node ID
|
|
18
|
+
* @param options - Traversal options
|
|
19
|
+
* @returns Subgraph containing traversed nodes and edges
|
|
20
|
+
*/
|
|
21
|
+
traverseBFS(startId: string, options?: TraversalOptions): Subgraph;
|
|
22
|
+
/**
|
|
23
|
+
* Traverse the graph using depth-first search
|
|
24
|
+
*
|
|
25
|
+
* @param startId - Starting node ID
|
|
26
|
+
* @param options - Traversal options
|
|
27
|
+
* @returns Subgraph containing traversed nodes and edges
|
|
28
|
+
*/
|
|
29
|
+
traverseDFS(startId: string, options?: TraversalOptions): Subgraph;
|
|
30
|
+
/**
|
|
31
|
+
* Recursive DFS helper
|
|
32
|
+
*/
|
|
33
|
+
private dfsRecursive;
|
|
34
|
+
/**
|
|
35
|
+
* Get adjacent edges based on direction
|
|
36
|
+
*/
|
|
37
|
+
private getAdjacentEdges;
|
|
38
|
+
/**
|
|
39
|
+
* Find all callers of a function/method
|
|
40
|
+
*
|
|
41
|
+
* @param nodeId - ID of the function/method node
|
|
42
|
+
* @param maxDepth - Maximum depth to traverse (default: 1)
|
|
43
|
+
* @returns Array of nodes that call this function
|
|
44
|
+
*/
|
|
45
|
+
getCallers(nodeId: string, maxDepth?: number): Array<{
|
|
46
|
+
node: Node;
|
|
47
|
+
edge: Edge;
|
|
48
|
+
}>;
|
|
49
|
+
private getCallersRecursive;
|
|
50
|
+
/**
|
|
51
|
+
* Find all functions/methods called by a function
|
|
52
|
+
*
|
|
53
|
+
* @param nodeId - ID of the function/method node
|
|
54
|
+
* @param maxDepth - Maximum depth to traverse (default: 1)
|
|
55
|
+
* @returns Array of nodes called by this function
|
|
56
|
+
*/
|
|
57
|
+
getCallees(nodeId: string, maxDepth?: number): Array<{
|
|
58
|
+
node: Node;
|
|
59
|
+
edge: Edge;
|
|
60
|
+
}>;
|
|
61
|
+
private getCalleesRecursive;
|
|
62
|
+
/**
|
|
63
|
+
* Get the call graph for a function (both callers and callees)
|
|
64
|
+
*
|
|
65
|
+
* @param nodeId - ID of the function/method node
|
|
66
|
+
* @param depth - Maximum depth in each direction (default: 2)
|
|
67
|
+
* @returns Subgraph containing the call graph
|
|
68
|
+
*/
|
|
69
|
+
getCallGraph(nodeId: string, depth?: number): Subgraph;
|
|
70
|
+
/**
|
|
71
|
+
* Get the type hierarchy for a class/interface
|
|
72
|
+
*
|
|
73
|
+
* @param nodeId - ID of the class/interface node
|
|
74
|
+
* @returns Subgraph containing the type hierarchy
|
|
75
|
+
*/
|
|
76
|
+
getTypeHierarchy(nodeId: string): Subgraph;
|
|
77
|
+
private getTypeAncestors;
|
|
78
|
+
private getTypeDescendants;
|
|
79
|
+
/**
|
|
80
|
+
* Find all usages of a symbol
|
|
81
|
+
*
|
|
82
|
+
* @param nodeId - ID of the symbol node
|
|
83
|
+
* @returns Array of nodes and edges that reference this symbol
|
|
84
|
+
*/
|
|
85
|
+
findUsages(nodeId: string): Array<{
|
|
86
|
+
node: Node;
|
|
87
|
+
edge: Edge;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* Calculate the impact radius of a node
|
|
91
|
+
*
|
|
92
|
+
* Returns all nodes that could be affected by changes to this node.
|
|
93
|
+
*
|
|
94
|
+
* @param nodeId - ID of the node
|
|
95
|
+
* @param maxDepth - Maximum depth to traverse (default: 3)
|
|
96
|
+
* @returns Subgraph containing potentially impacted nodes
|
|
97
|
+
*/
|
|
98
|
+
getImpactRadius(nodeId: string, maxDepth?: number): Subgraph;
|
|
99
|
+
private getImpactRecursive;
|
|
100
|
+
/**
|
|
101
|
+
* Find the shortest path between two nodes
|
|
102
|
+
*
|
|
103
|
+
* @param fromId - Starting node ID
|
|
104
|
+
* @param toId - Target node ID
|
|
105
|
+
* @param edgeKinds - Edge types to consider (all if empty)
|
|
106
|
+
* @returns Array of nodes and edges forming the path, or null if no path exists
|
|
107
|
+
*/
|
|
108
|
+
findPath(fromId: string, toId: string, edgeKinds?: EdgeKind[]): Array<{
|
|
109
|
+
node: Node;
|
|
110
|
+
edge: Edge | null;
|
|
111
|
+
}> | null;
|
|
112
|
+
/**
|
|
113
|
+
* Get the containment hierarchy for a node (ancestors)
|
|
114
|
+
*
|
|
115
|
+
* @param nodeId - ID of the node
|
|
116
|
+
* @returns Array of ancestor nodes from immediate parent to root
|
|
117
|
+
*/
|
|
118
|
+
getAncestors(nodeId: string): Node[];
|
|
119
|
+
/**
|
|
120
|
+
* Get immediate children of a node
|
|
121
|
+
*
|
|
122
|
+
* @param nodeId - ID of the node
|
|
123
|
+
* @returns Array of child nodes
|
|
124
|
+
*/
|
|
125
|
+
getChildren(nodeId: string): Node[];
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=traversal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../../src/graph/traversal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAuB7C;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAe;gBAElB,OAAO,EAAE,YAAY;IAIjC;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,QAAQ;IA+EtE;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,QAAQ;IAyBtE;;OAEG;IACH,OAAO,CAAC,YAAY;IA6CpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAmBxB;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,KAAK,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;IASnF,OAAO,CAAC,mBAAmB;IAuB3B;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,KAAK,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;IASnF,OAAO,CAAC,mBAAmB;IAuB3B;;;;;;OAMG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,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