@kkvcrobatz107/codegraph 0.9.6-pkm.1
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 +595 -0
- package/dist/bin/codegraph.d.ts +25 -0
- package/dist/bin/codegraph.d.ts.map +1 -0
- package/dist/bin/codegraph.js +1563 -0
- package/dist/bin/codegraph.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 +244 -0
- package/dist/context/formatter.js.map +1 -0
- package/dist/context/index.d.ts +110 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1169 -0
- package/dist/context/index.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 +251 -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 +281 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1300 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +151 -0
- package/dist/db/sqlite-adapter.d.ts +46 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +114 -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 +264 -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/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/grammars.d.ts +90 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +407 -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 +1378 -0
- package/dist/extraction/index.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 +171 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +3 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +73 -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 +70 -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 +70 -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 +259 -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 +107 -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 +114 -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 +109 -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 +139 -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 +52 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +313 -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/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 +193 -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 +291 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +2961 -0
- package/dist/extraction/tree-sitter.js.map +1 -0
- package/dist/extraction/vue-extractor.d.ts +36 -0
- package/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/dist/extraction/vue-extractor.js +163 -0
- package/dist/extraction/vue-extractor.js.map +1 -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 +105 -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 +366 -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 +528 -0
- package/dist/graph/traversal.js.map +1 -0
- package/dist/index.d.ts +460 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +863 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/claude-md-template.d.ts +14 -0
- package/dist/installer/claude-md-template.d.ts.map +1 -0
- package/dist/installer/claude-md-template.js +21 -0
- package/dist/installer/claude-md-template.js.map +1 -0
- package/dist/installer/config-writer.d.ts +29 -0
- package/dist/installer/config-writer.d.ts.map +1 -0
- package/dist/installer/config-writer.js +111 -0
- package/dist/installer/config-writer.js.map +1 -0
- package/dist/installer/index.d.ts +117 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +528 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +28 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +65 -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 +307 -0
- package/dist/installer/targets/antigravity.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +47 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +401 -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 +185 -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 +283 -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 +165 -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 +196 -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 +235 -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 +246 -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 +116 -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 +161 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +403 -0
- package/dist/mcp/daemon.js.map +1 -0
- package/dist/mcp/engine.d.ts +100 -0
- package/dist/mcp/engine.d.ts.map +1 -0
- package/dist/mcp/engine.js +291 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/index.d.ts +109 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +470 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/proxy.d.ts +46 -0
- package/dist/mcp/proxy.d.ts.map +1 -0
- package/dist/mcp/proxy.js +276 -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 +73 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +67 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +276 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/tools.d.ts +385 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +2545 -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 +924 -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 +143 -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 +396 -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 +360 -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 +1231 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +116 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +878 -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 +32 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +596 -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 +209 -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/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 +53 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +350 -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 +223 -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 +191 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +398 -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 +136 -0
- package/dist/sync/worktree.js.map +1 -0
- package/dist/types.d.ts +369 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +78 -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/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 +59 -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/block-read-hook.sh +19 -0
- package/scripts/agent-eval/hook-settings.json +15 -0
- package/scripts/agent-eval/itrun.sh +107 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -0
- package/scripts/agent-eval/parse-bench-readme.mjs +67 -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-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-shim.js +246 -0
- package/scripts/pack-npm.sh +95 -0
- package/scripts/prepare-release.mjs +270 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Swift ↔ Objective-C bridging rules.
|
|
4
|
+
*
|
|
5
|
+
* Apple's auto-bridging mechanism exposes Swift declarations to the ObjC
|
|
6
|
+
* runtime under a deterministic selector name. The full rule set:
|
|
7
|
+
* https://developer.apple.com/documentation/swift/importing-swift-into-objective-c
|
|
8
|
+
*
|
|
9
|
+
* This module is **pure name math** — given a Swift declaration's base name
|
|
10
|
+
* + parameter external labels (or the raw signature text), produce the
|
|
11
|
+
* bridged ObjC selector(s); given an ObjC selector, produce the
|
|
12
|
+
* candidate Swift base names. No graph/DB access here.
|
|
13
|
+
*
|
|
14
|
+
* Used by `frameworks/swift-objc.ts` (the framework resolver that wires
|
|
15
|
+
* the rules into the resolution pipeline) and by its tests.
|
|
16
|
+
*
|
|
17
|
+
* ─── Bridging cheat sheet ───────────────────────────────────────────────
|
|
18
|
+
*
|
|
19
|
+
* Swift declaration ObjC selector
|
|
20
|
+
* ───────────────────────────────────────── ─────────────────────────
|
|
21
|
+
* func play() play
|
|
22
|
+
* func play(_ song: String) play:
|
|
23
|
+
* func play(song: String) playWithSong:
|
|
24
|
+
* func play(_ song: String, by artist: String) play:by:
|
|
25
|
+
* func play(song: String, by artist: String) playWithSong:by:
|
|
26
|
+
* init(name: String) initWithName:
|
|
27
|
+
* init(name: String, age: Int) initWithName:age:
|
|
28
|
+
* var name: String (getter / setter) name / setName:
|
|
29
|
+
* @objc(custom:) func f(_ x: Int) custom: (literal override)
|
|
30
|
+
*
|
|
31
|
+
* The reverse direction (ObjC → Swift) collapses the bridge: a Swift call
|
|
32
|
+
* site for `play(song:)` reaches us as the bare base name `play` (Swift's
|
|
33
|
+
* tree-sitter call_expression strips parameter labels from the callee
|
|
34
|
+
* name). So `swiftBaseNamesForObjcSelector('playWithSong:')` returns
|
|
35
|
+
* `['play']` — the resolver looks up Swift methods named `play`.
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.objcSelectorForSwiftMethod = objcSelectorForSwiftMethod;
|
|
39
|
+
exports.objcSelectorForSwiftInit = objcSelectorForSwiftInit;
|
|
40
|
+
exports.objcAccessorsForSwiftProperty = objcAccessorsForSwiftProperty;
|
|
41
|
+
exports.swiftBaseNamesForObjcSelector = swiftBaseNamesForObjcSelector;
|
|
42
|
+
exports.detectExplicitObjcName = detectExplicitObjcName;
|
|
43
|
+
exports.isObjcExposed = isObjcExposed;
|
|
44
|
+
/**
|
|
45
|
+
* Capitalize the first character of a string. Used for the "With"-prefix
|
|
46
|
+
* form on the first selector keyword when the Swift declaration has an
|
|
47
|
+
* explicit first-parameter label (e.g. `func play(song:)` → `playWithSong:`).
|
|
48
|
+
*/
|
|
49
|
+
function capFirst(s) {
|
|
50
|
+
return s.length > 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Lowercase the first character. Used in reverse: `setName:` setter ↔
|
|
54
|
+
* Swift property `name`.
|
|
55
|
+
*/
|
|
56
|
+
function lowerFirst(s) {
|
|
57
|
+
return s.length > 0 ? s.charAt(0).toLowerCase() + s.slice(1) : s;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Compute the auto-bridged ObjC selector for a Swift method declaration.
|
|
61
|
+
*
|
|
62
|
+
* @param baseName The Swift method's base name (e.g. `play`).
|
|
63
|
+
* @param externalLabels Parameter EXTERNAL labels in declaration order;
|
|
64
|
+
* `null` for a `_` (unlabeled) parameter.
|
|
65
|
+
* `[]` for a no-parameter method.
|
|
66
|
+
* @param explicitObjcName If `@objc(customSel:)` was specified, the
|
|
67
|
+
* literal selector — short-circuits the rule
|
|
68
|
+
* and is returned as-is.
|
|
69
|
+
* @returns The ObjC selector (e.g. `playWithSong:by:`), or `null` if it
|
|
70
|
+
* can't be determined.
|
|
71
|
+
*
|
|
72
|
+
* **Method rules:**
|
|
73
|
+
* - No params → base name (no colons)
|
|
74
|
+
* - Single param, `_` label → `baseName:`
|
|
75
|
+
* - Single param, explicit label `L` → `baseNameWithL:`
|
|
76
|
+
* - Multi-param, `_` first label → `baseName:label2:label3:`
|
|
77
|
+
* - Multi-param, explicit first label `L1` → `baseNameWithL1:label2:label3:`
|
|
78
|
+
*
|
|
79
|
+
* Initializer rules are handled by `objcSelectorForSwiftInit`.
|
|
80
|
+
*/
|
|
81
|
+
function objcSelectorForSwiftMethod(baseName, externalLabels, explicitObjcName) {
|
|
82
|
+
if (!baseName)
|
|
83
|
+
return null;
|
|
84
|
+
if (explicitObjcName)
|
|
85
|
+
return explicitObjcName;
|
|
86
|
+
if (externalLabels.length === 0) {
|
|
87
|
+
return baseName;
|
|
88
|
+
}
|
|
89
|
+
const [first, ...rest] = externalLabels;
|
|
90
|
+
// Single param: "_" → "base:" ; "label" → "baseWithLabel:"
|
|
91
|
+
// Multi-param mirrors the same first-keyword formation, then appends each
|
|
92
|
+
// subsequent label as its own keyword. A `null` later label is invalid
|
|
93
|
+
// ObjC (no way to express unlabeled middle params) — keep as `:` to be safe.
|
|
94
|
+
const firstKeyword = first === null || first === undefined || first === '_' || first === ''
|
|
95
|
+
? `${baseName}:`
|
|
96
|
+
: `${baseName}With${capFirst(first)}:`;
|
|
97
|
+
const restKeywords = rest.map((l) => `${l ?? ''}:`).join('');
|
|
98
|
+
return firstKeyword + restKeywords;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Compute the bridged ObjC selector for a Swift `init(...)` declaration.
|
|
102
|
+
*
|
|
103
|
+
* **Init rules** (different from regular methods — Apple always uses
|
|
104
|
+
* `initWith` regardless of whether the first label is `_`):
|
|
105
|
+
* - `init()` → `init`
|
|
106
|
+
* - `init(_ name: String)` → `initWithName:` (uses the INTERNAL
|
|
107
|
+
* name when external is `_`, per Apple's
|
|
108
|
+
* bridging conventions)
|
|
109
|
+
* - `init(name: String)` → `initWithName:`
|
|
110
|
+
* - `init(name: String, age: Int)` → `initWithName:age:`
|
|
111
|
+
*
|
|
112
|
+
* For the `_` case we need the internal (second identifier) name —
|
|
113
|
+
* passed via `internalNames`.
|
|
114
|
+
*/
|
|
115
|
+
function objcSelectorForSwiftInit(externalLabels, internalNames, explicitObjcName) {
|
|
116
|
+
if (explicitObjcName)
|
|
117
|
+
return explicitObjcName;
|
|
118
|
+
if (externalLabels.length === 0) {
|
|
119
|
+
return 'init';
|
|
120
|
+
}
|
|
121
|
+
const [firstExt, ...restExt] = externalLabels;
|
|
122
|
+
const [firstInt] = internalNames;
|
|
123
|
+
// Use the internal name when external is "_"; ObjC needs *some* keyword,
|
|
124
|
+
// and Swift's auto-bridger uses the parameter's local name in this case.
|
|
125
|
+
const firstLabel = firstExt === null || firstExt === '_' || firstExt === ''
|
|
126
|
+
? firstInt
|
|
127
|
+
: firstExt;
|
|
128
|
+
if (!firstLabel)
|
|
129
|
+
return null;
|
|
130
|
+
const firstKeyword = `initWith${capFirst(firstLabel)}:`;
|
|
131
|
+
const restKeywords = restExt
|
|
132
|
+
.map((label, idx) => {
|
|
133
|
+
const internal = internalNames[idx + 1];
|
|
134
|
+
const name = label && label !== '_' ? label : internal ?? '';
|
|
135
|
+
return `${name}:`;
|
|
136
|
+
})
|
|
137
|
+
.join('');
|
|
138
|
+
return firstKeyword + restKeywords;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Compute the bridged ObjC getter + setter for a Swift `@objc` property.
|
|
142
|
+
*
|
|
143
|
+
* - `var name: String` → getter `name`, setter `setName:`
|
|
144
|
+
* - `var isReady: Bool` → getter `isReady`, setter `setIsReady:`
|
|
145
|
+
* (no special `is` handling — Swift's `isReady` stays as `isReady` in ObjC;
|
|
146
|
+
* `@objc(name:)` overrides if a Cocoa-style getter `isReady` / setter
|
|
147
|
+
* `setReady:` pairing is needed — that's the responsibility of the
|
|
148
|
+
* declaration's `@objc(customGetter)` annotation, which we surface via
|
|
149
|
+
* `explicitObjcName`.)
|
|
150
|
+
*/
|
|
151
|
+
function objcAccessorsForSwiftProperty(swiftName, explicitObjcName) {
|
|
152
|
+
if (!swiftName)
|
|
153
|
+
return null;
|
|
154
|
+
// The override syntax `@objc(customGetterName)` re-points the GETTER only;
|
|
155
|
+
// the setter still follows the `setX:` rule but is keyed off the override.
|
|
156
|
+
// (`@objc(getX:setY:)` is not currently supported — that's a rarer
|
|
157
|
+
// shape; can extend later if a real codebase needs it.)
|
|
158
|
+
const getter = explicitObjcName ?? swiftName;
|
|
159
|
+
return {
|
|
160
|
+
getter,
|
|
161
|
+
setter: `set${capFirst(getter)}:`,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Reverse: from an ObjC selector, return the candidate Swift base names
|
|
166
|
+
* the resolver should try when looking for the bridged Swift declaration.
|
|
167
|
+
*
|
|
168
|
+
* Examples:
|
|
169
|
+
* `play` → ['play']
|
|
170
|
+
* `play:` → ['play']
|
|
171
|
+
* `playWithSong:` → ['play', 'playWithSong']
|
|
172
|
+
* `play:by:` → ['play']
|
|
173
|
+
* `playWithSong:by:` → ['play', 'playWithSong']
|
|
174
|
+
* `initWithName:` → ['init'] (init is its own base name)
|
|
175
|
+
* `initWithName:age:` → ['init']
|
|
176
|
+
* `setName:` → ['name', 'setName'] (could be a setter OR a regular func)
|
|
177
|
+
* `tableView:didSel…:` → ['tableView']
|
|
178
|
+
*
|
|
179
|
+
* Returns multiple candidates because the bare base name is ambiguous —
|
|
180
|
+
* `playWithSong:` could correspond to either `func play(song:)` or
|
|
181
|
+
* `func playWithSong(_ x:)` (a Swift method literally named that with a
|
|
182
|
+
* `_` first label). The resolver tries each.
|
|
183
|
+
*/
|
|
184
|
+
function swiftBaseNamesForObjcSelector(selector) {
|
|
185
|
+
if (!selector)
|
|
186
|
+
return [];
|
|
187
|
+
// Strip trailing colons and split into keywords.
|
|
188
|
+
const keywords = selector.replace(/:+$/g, '').split(':');
|
|
189
|
+
const firstKeyword = keywords[0];
|
|
190
|
+
if (!firstKeyword)
|
|
191
|
+
return [];
|
|
192
|
+
const candidates = new Set();
|
|
193
|
+
// Always a candidate: the raw first keyword. Covers
|
|
194
|
+
// `play:` → `play`
|
|
195
|
+
// `play:by:` → `play`
|
|
196
|
+
// `playWithSong:` → `playWithSong` (a literal Swift name)
|
|
197
|
+
// `tableView:...:` → `tableView`
|
|
198
|
+
candidates.add(firstKeyword);
|
|
199
|
+
// `initWith<X>:` and `initWith<X>:<more>:` always reduce to `init`.
|
|
200
|
+
if (firstKeyword.startsWith('initWith')) {
|
|
201
|
+
candidates.add('init');
|
|
202
|
+
}
|
|
203
|
+
// Preposition-prefix patterns: `<base>(With|For|By|In|On|At|From|To|Of|As)<Cap>:`
|
|
204
|
+
// covers both Swift's @objc EXPORT rule (always "With") and Cocoa's
|
|
205
|
+
// IMPORTED selectors which use other prepositions natively (e.g.
|
|
206
|
+
// `objectForKey:`, `stringWithFormat:`, `compareTo:`,
|
|
207
|
+
// `imageNamed:inBundle:`). Strip to recover the Swift base name a caller
|
|
208
|
+
// would use (e.g. `object`, `string`, `compare`, `image`).
|
|
209
|
+
const prepositionMatch = firstKeyword.match(/^([a-z][a-zA-Z0-9]*?)(?:With|For|By|In|On|At|From|To|Of|As)[A-Z]/);
|
|
210
|
+
if (prepositionMatch && prepositionMatch[1]) {
|
|
211
|
+
candidates.add(prepositionMatch[1]);
|
|
212
|
+
}
|
|
213
|
+
// `setX:` could be a property setter — the Swift property is `x` (lowercase).
|
|
214
|
+
// Only fires for the obvious shape: `set` + capital letter + ':' (one param).
|
|
215
|
+
if (keywords.length === 1 &&
|
|
216
|
+
/^set[A-Z]/.test(firstKeyword) &&
|
|
217
|
+
selector.endsWith(':')) {
|
|
218
|
+
const propName = lowerFirst(firstKeyword.slice(3));
|
|
219
|
+
if (propName)
|
|
220
|
+
candidates.add(propName);
|
|
221
|
+
}
|
|
222
|
+
return Array.from(candidates);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Detect whether a Swift method `@objc` declaration uses the `@objc(custom:)`
|
|
226
|
+
* override form, returning the literal selector when present.
|
|
227
|
+
*
|
|
228
|
+
* Regex-based scan over the small chunk of source preceding the declaration —
|
|
229
|
+
* tree-sitter would be more precise but this is only consulted as a fallback
|
|
230
|
+
* when the structured AST isn't available (e.g. resolver-time lookups
|
|
231
|
+
* via `context.readFile`).
|
|
232
|
+
*
|
|
233
|
+
* Returns `null` when the declaration is plain `@objc` (no override) or has
|
|
234
|
+
* no `@objc` attribute at all.
|
|
235
|
+
*/
|
|
236
|
+
function detectExplicitObjcName(sourceSlice) {
|
|
237
|
+
// `@objc(customName:)` or `@objc(custom:name:)` — the parens contents are
|
|
238
|
+
// the literal ObjC selector. Whitespace permitted.
|
|
239
|
+
const m = sourceSlice.match(/@objc\s*\(\s*([^)\s]+)\s*\)/);
|
|
240
|
+
return m && m[1] ? m[1] : null;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Detect whether a Swift declaration is `@objc`-exposed by scanning the
|
|
244
|
+
* source slice that precedes it. Returns true for explicit `@objc`,
|
|
245
|
+
* `@objc(custom:)`, or membership in a `@objcMembers` class (caller's
|
|
246
|
+
* responsibility to pass class-level context if relevant).
|
|
247
|
+
*
|
|
248
|
+
* `@nonobjc` returns false even if `@objc` also appears (per Swift's rule
|
|
249
|
+
* that `@nonobjc` opts out of class-level `@objcMembers`).
|
|
250
|
+
*/
|
|
251
|
+
function isObjcExposed(sourceSlice) {
|
|
252
|
+
if (/@nonobjc\b/.test(sourceSlice))
|
|
253
|
+
return false;
|
|
254
|
+
return /@objc\b/.test(sourceSlice);
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=swift-objc-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swift-objc-bridge.js","sourceRoot":"","sources":["../../src/resolution/swift-objc-bridge.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;AAyCH,gEAwBC;AAiBD,4DA8BC;AAaD,sEAcC;AAsBD,sEA+CC;AAcD,wDAKC;AAWD,sCAGC;AA/OD;;;;GAIG;AACH,SAAS,QAAQ,CAAC,CAAS;IACzB,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,0BAA0B,CACxC,QAAgB,EAChB,cAAiC,EACjC,gBAAgC;IAEhC,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,gBAAgB;QAAE,OAAO,gBAAgB,CAAC;IAE9C,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,QAAQ,CAAC;IAClB,C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AE,OAAO,KAAK,CAAC;IACjD,OAAO,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference Resolution Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the reference resolution system.
|
|
5
|
+
*/
|
|
6
|
+
import { EdgeKind, Language, Node } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* An unresolved reference from extraction
|
|
9
|
+
*/
|
|
10
|
+
export interface UnresolvedRef {
|
|
11
|
+
/** ID of the source node containing the reference */
|
|
12
|
+
fromNodeId: string;
|
|
13
|
+
/** The name being referenced */
|
|
14
|
+
referenceName: string;
|
|
15
|
+
/** Type of reference */
|
|
16
|
+
referenceKind: EdgeKind;
|
|
17
|
+
/** Line where reference occurs */
|
|
18
|
+
line: number;
|
|
19
|
+
/** Column where reference occurs */
|
|
20
|
+
column: number;
|
|
21
|
+
/** File path where reference occurs */
|
|
22
|
+
filePath: string;
|
|
23
|
+
/** Language of the source file */
|
|
24
|
+
language: Language;
|
|
25
|
+
/** Possible qualified names it might resolve to */
|
|
26
|
+
candidates?: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A resolved reference
|
|
30
|
+
*/
|
|
31
|
+
export interface ResolvedRef {
|
|
32
|
+
/** Original unresolved reference */
|
|
33
|
+
original: UnresolvedRef;
|
|
34
|
+
/** ID of the target node */
|
|
35
|
+
targetNodeId: string;
|
|
36
|
+
/** Confidence score (0-1) */
|
|
37
|
+
confidence: number;
|
|
38
|
+
/** How it was resolved */
|
|
39
|
+
resolvedBy: 'exact-match' | 'import' | 'qualified-name' | 'framework' | 'fuzzy' | 'instance-method' | 'file-path';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Result of resolution attempt
|
|
43
|
+
*/
|
|
44
|
+
export interface ResolutionResult {
|
|
45
|
+
/** Successfully resolved references */
|
|
46
|
+
resolved: ResolvedRef[];
|
|
47
|
+
/** References that couldn't be resolved */
|
|
48
|
+
unresolved: UnresolvedRef[];
|
|
49
|
+
/** Statistics */
|
|
50
|
+
stats: {
|
|
51
|
+
total: number;
|
|
52
|
+
resolved: number;
|
|
53
|
+
unresolved: number;
|
|
54
|
+
byMethod: Record<string, number>;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Context for resolution - provides access to the graph
|
|
59
|
+
*/
|
|
60
|
+
export interface ResolutionContext {
|
|
61
|
+
/** Get all nodes in a file */
|
|
62
|
+
getNodesInFile(filePath: string): Node[];
|
|
63
|
+
/** Get all nodes by name */
|
|
64
|
+
getNodesByName(name: string): Node[];
|
|
65
|
+
/** Get all nodes by qualified name */
|
|
66
|
+
getNodesByQualifiedName(qualifiedName: string): Node[];
|
|
67
|
+
/** Get all nodes of a kind */
|
|
68
|
+
getNodesByKind(kind: Node['kind']): Node[];
|
|
69
|
+
/** Check if a file exists */
|
|
70
|
+
fileExists(filePath: string): boolean;
|
|
71
|
+
/** Read file content */
|
|
72
|
+
readFile(filePath: string): string | null;
|
|
73
|
+
/** Get project root */
|
|
74
|
+
getProjectRoot(): string;
|
|
75
|
+
/** Get all files */
|
|
76
|
+
getAllFiles(): string[];
|
|
77
|
+
/** Get nodes by lowercase name (O(1) lookup for fuzzy matching) */
|
|
78
|
+
getNodesByLowerName(lowerName: string): Node[];
|
|
79
|
+
/** Get cached import mappings for a file */
|
|
80
|
+
getImportMappings(filePath: string, language: Language): ImportMapping[];
|
|
81
|
+
/**
|
|
82
|
+
* Project import-path aliases (tsconfig/jsconfig `paths`). Returns
|
|
83
|
+
* `null` when the project doesn't define any. Cached per resolver
|
|
84
|
+
* instance — safe to call from any resolver code path. Optional so
|
|
85
|
+
* existing test fixtures and external context implementations
|
|
86
|
+
* compile without modification; production resolver implements it.
|
|
87
|
+
*/
|
|
88
|
+
getProjectAliases?(): import('./path-aliases').AliasMap | null;
|
|
89
|
+
/**
|
|
90
|
+
* Go module info from `go.mod` at the project root. Returns `null`
|
|
91
|
+
* when the project has no `go.mod` (non-Go projects, pre-modules
|
|
92
|
+
* Go code, or projects whose modules live in subdirectories). Used
|
|
93
|
+
* by the Go branch of import resolution to distinguish in-module
|
|
94
|
+
* cross-package imports from third-party packages.
|
|
95
|
+
*/
|
|
96
|
+
getGoModule?(): import('./go-module').GoModule | null;
|
|
97
|
+
/**
|
|
98
|
+
* Re-exports declared by a file (`export { x } from './other'`,
|
|
99
|
+
* `export * from './other'`). Empty array when the file has none.
|
|
100
|
+
* Optional so older callers compile; the import resolver follows
|
|
101
|
+
* re-export chains when this is provided.
|
|
102
|
+
*/
|
|
103
|
+
getReExports?(filePath: string, language: Language): ReExport[];
|
|
104
|
+
/**
|
|
105
|
+
* List immediate subdirectories of `relativePath` (relative to the
|
|
106
|
+
* project root). Returns an empty array when the path doesn't exist
|
|
107
|
+
* or isn't a directory. Used by framework resolvers that need to
|
|
108
|
+
* walk build-system metadata (e.g. Cargo workspace globs). Optional
|
|
109
|
+
* so external context implementations and test fixtures compile
|
|
110
|
+
* without modification.
|
|
111
|
+
*/
|
|
112
|
+
listDirectories?(relativePath: string): string[];
|
|
113
|
+
/**
|
|
114
|
+
* C/C++ include search directories (relative to project root),
|
|
115
|
+
* extracted from compile_commands.json or discovered by heuristic.
|
|
116
|
+
* Used by resolveCppIncludePath to search -I directories when
|
|
117
|
+
* relative resolution fails. Optional so existing callers compile.
|
|
118
|
+
*/
|
|
119
|
+
getCppIncludeDirs?(): string[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Result of framework-specific file extraction.
|
|
123
|
+
*/
|
|
124
|
+
export interface FrameworkExtractionResult {
|
|
125
|
+
/** Framework-specific nodes (e.g. routes) */
|
|
126
|
+
nodes: Node[];
|
|
127
|
+
/** Framework-specific unresolved references (e.g. route -> handler) */
|
|
128
|
+
references: UnresolvedRef[];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Framework-specific resolver
|
|
132
|
+
*/
|
|
133
|
+
export interface FrameworkResolver {
|
|
134
|
+
/** Framework name */
|
|
135
|
+
name: string;
|
|
136
|
+
/** Languages this framework applies to. If omitted, applies to all languages. */
|
|
137
|
+
languages?: Language[];
|
|
138
|
+
/** Detect if project uses this framework (project-level, called once at startup) */
|
|
139
|
+
detect(context: ResolutionContext): boolean;
|
|
140
|
+
/** Resolve a reference using framework-specific patterns */
|
|
141
|
+
resolve(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null;
|
|
142
|
+
/**
|
|
143
|
+
* Opt a reference NAME through the resolver's name-exists pre-filter, even when
|
|
144
|
+
* no node is named that. Needed for dynamic dispatch where the call target is
|
|
145
|
+
* an attribute/descriptor, not a declared symbol (e.g. Django's
|
|
146
|
+
* `self._iterable_class(...)`, React effect callbacks). Returning true lets the
|
|
147
|
+
* ref reach `resolve()` instead of being dropped for having no name match.
|
|
148
|
+
*/
|
|
149
|
+
claimsReference?(name: string): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Extract framework-specific nodes and references from a file.
|
|
152
|
+
*
|
|
153
|
+
* Returns route nodes, middleware nodes, etc., plus unresolved references
|
|
154
|
+
* that link those nodes to handlers (view classes, controller methods,
|
|
155
|
+
* included modules). Unresolved references flow into the normal resolution
|
|
156
|
+
* pipeline; the framework's own `resolve()` is one of the strategies tried.
|
|
157
|
+
*/
|
|
158
|
+
extract?(filePath: string, content: string): FrameworkExtractionResult;
|
|
159
|
+
/**
|
|
160
|
+
* Cross-file finalization pass, called once after all per-file extraction
|
|
161
|
+
* completes (and again on every incremental sync). Used by frameworks where
|
|
162
|
+
* a symbol's final representation depends on a sibling file the per-file
|
|
163
|
+
* `extract()` never saw — e.g. NestJS's `RouterModule.register([...])`
|
|
164
|
+
* sets route prefixes for controllers declared elsewhere.
|
|
165
|
+
*
|
|
166
|
+
* Implementations return route/etc. nodes with mutated fields (typically
|
|
167
|
+
* `name`); the orchestrator persists each via `updateNode`. The node `id`
|
|
168
|
+
* MUST be preserved so existing edges (route → handler, etc.) stay intact;
|
|
169
|
+
* `qualifiedName` SHOULD be preserved so the pass stays idempotent — a
|
|
170
|
+
* second run can recover the original in-file form from `qualifiedName`.
|
|
171
|
+
*/
|
|
172
|
+
postExtract?(context: ResolutionContext): Node[];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Import mapping from a file
|
|
176
|
+
*/
|
|
177
|
+
export interface ImportMapping {
|
|
178
|
+
/** Local name used in the file */
|
|
179
|
+
localName: string;
|
|
180
|
+
/** Original exported name (may differ due to aliasing) */
|
|
181
|
+
exportedName: string;
|
|
182
|
+
/** Source module/path */
|
|
183
|
+
source: string;
|
|
184
|
+
/** Whether it's a default import */
|
|
185
|
+
isDefault: boolean;
|
|
186
|
+
/** Whether it's a namespace import (import * as X) */
|
|
187
|
+
isNamespace: boolean;
|
|
188
|
+
/** Resolved file path (if local) */
|
|
189
|
+
resolvedPath?: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Re-export from a file: `export { x } from './other'` or
|
|
193
|
+
* `export * from './other'`. Used by the resolver to chase
|
|
194
|
+
* symbols through barrel files.
|
|
195
|
+
*/
|
|
196
|
+
export type ReExport = {
|
|
197
|
+
kind: 'named';
|
|
198
|
+
/** Name as exported by THIS file. */
|
|
199
|
+
exportedName: string;
|
|
200
|
+
/** Name in the upstream module (differs when renamed: `as`). */
|
|
201
|
+
originalName: string;
|
|
202
|
+
/** Module specifier of the upstream module. */
|
|
203
|
+
source: string;
|
|
204
|
+
} | {
|
|
205
|
+
kind: 'wildcard';
|
|
206
|
+
/** Module specifier of the upstream module. */
|
|
207
|
+
source: string;
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/resolution/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI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-0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/resolution/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field-qualified search query parser.
|
|
3
|
+
*
|
|
4
|
+
* Splits a raw query like
|
|
5
|
+
*
|
|
6
|
+
* kind:function name:auth path:src/api authenticate
|
|
7
|
+
*
|
|
8
|
+
* into structured filters (kind=function, name="auth", path prefix
|
|
9
|
+
* "src/api") plus the free-text portion ("authenticate") that goes
|
|
10
|
+
* to FTS. Free-text and filters compose: filters narrow the result
|
|
11
|
+
* set, FTS scores within the narrowed set.
|
|
12
|
+
*
|
|
13
|
+
* Recognised fields (case-insensitive, value is the rest until
|
|
14
|
+
* whitespace):
|
|
15
|
+
*
|
|
16
|
+
* kind: one of function|method|class|interface|struct|...
|
|
17
|
+
* lang: one of typescript|python|go|... (alias: language:)
|
|
18
|
+
* path: case-insensitive substring of file_path
|
|
19
|
+
* name: case-insensitive substring of the symbol's name
|
|
20
|
+
*
|
|
21
|
+
* Unknown field prefixes (e.g. `foo:bar`) are passed through to FTS
|
|
22
|
+
* as plain text — that's how someone searching for `TODO:` gets a
|
|
23
|
+
* result instead of a parse error.
|
|
24
|
+
*
|
|
25
|
+
* Quoting:
|
|
26
|
+
* kind:function path:"src/some path/with spaces" → handled by stripping
|
|
27
|
+
* the surrounding double quotes from the value (single token only,
|
|
28
|
+
* no nested escapes).
|
|
29
|
+
*/
|
|
30
|
+
import type { NodeKind, Language } from '../types';
|
|
31
|
+
export interface ParsedQuery {
|
|
32
|
+
/** Free-text portion to feed to FTS / LIKE. May be empty. */
|
|
33
|
+
text: string;
|
|
34
|
+
/** kind: filters (OR'd). Empty when none specified. */
|
|
35
|
+
kinds: NodeKind[];
|
|
36
|
+
/** lang:/language: filters (OR'd). Empty when none specified. */
|
|
37
|
+
languages: Language[];
|
|
38
|
+
/** path: filters (OR'd, case-insensitive substring of file_path). Empty when none. */
|
|
39
|
+
pathFilters: string[];
|
|
40
|
+
/** name: filters (OR'd, case-insensitive substring of node.name). */
|
|
41
|
+
nameFilters: string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parse a raw query into structured filters + remaining text.
|
|
45
|
+
* Always returns a value; never throws.
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseQuery(raw: string): ParsedQuery;
|
|
48
|
+
/**
|
|
49
|
+
* Damerau-Levenshtein-ish bounded edit distance. Returns `maxDist + 1`
|
|
50
|
+
* as soon as the distance is known to exceed `maxDist`; that early-exit
|
|
51
|
+
* makes the fuzzy fallback cheap even over tens of thousands of names.
|
|
52
|
+
*
|
|
53
|
+
* Pure DP, O(min(len(a), len(b))) memory. Compares case-folded inputs;
|
|
54
|
+
* callers should pass `lowercase(name)` strings.
|
|
55
|
+
*/
|
|
56
|
+
export declare function boundedEditDistance(a: string, b: string, maxDist: number): number;
|
|
57
|
+
//# sourceMappingURL=query-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-parser.d.ts","sourceRoot":"","sources":["../../src/search/query-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,iEAAiE;IACjE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,sFAAsF;IACtF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,qEAAqE;IACrE,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAiBD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAiFnD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CA2BjF"}
|