homegraph 1.5.7 → 1.5.8
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/CHANGELOG.md +21 -0
- package/README.md +2 -2
- package/dist/bin/homegraph.js +16 -14
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.js +11 -25
- package/dist/db/queries.d.ts +5 -1
- package/dist/db/queries.js +31 -2
- package/dist/db/sqlite-adapter.d.ts +6 -12
- package/dist/db/sqlite-adapter.js +13 -41
- package/dist/directory.d.ts +1 -1
- package/dist/directory.js +25 -1
- package/dist/extraction/grammars.d.ts +2 -0
- package/dist/extraction/grammars.js +7 -7
- package/dist/graph/evidence-paths.d.ts +63 -0
- package/dist/graph/evidence-paths.js +245 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +55 -17
- package/dist/mcp/arkts-evidence-packs.d.ts +67 -0
- package/dist/mcp/arkts-evidence-packs.js +352 -0
- package/dist/mcp/daemon.js +1 -1
- package/dist/mcp/engine.d.ts +20 -7
- package/dist/mcp/engine.js +113 -106
- package/dist/mcp/index-availability.d.ts +23 -0
- package/dist/mcp/index-availability.js +78 -0
- package/dist/mcp/index.js +5 -4
- package/dist/mcp/query-cache.d.ts +1 -1
- package/dist/mcp/query-cache.js +6 -2
- package/dist/mcp/query-worker.d.ts +1 -1
- package/dist/mcp/query-worker.js +1 -1
- package/dist/mcp/server-instructions.d.ts +4 -9
- package/dist/mcp/server-instructions.js +34 -74
- package/dist/mcp/session.js +12 -4
- package/dist/mcp/source-slice-identity.d.ts +3 -0
- package/dist/mcp/source-slice-identity.js +11 -0
- package/dist/mcp/tools.d.ts +24 -6
- package/dist/mcp/tools.js +201 -80
- package/dist/spec/llm/client.js +3 -15
- package/dist/spec/llm/openai-sdk.d.ts +14 -0
- package/dist/spec/llm/openai-sdk.js +37 -0
- package/dist/spec/llm/retry.js +8 -9
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +24 -0
- package/package.json +3 -5
- package/dist/addons/dynamic-import.d.ts.map +0 -1
- package/dist/addons/dynamic-import.js.map +0 -1
- package/dist/addons/init-template.d.ts.map +0 -1
- package/dist/addons/init-template.js.map +0 -1
- package/dist/addons/loader.d.ts.map +0 -1
- package/dist/addons/loader.js.map +0 -1
- package/dist/addons/manager.d.ts.map +0 -1
- package/dist/addons/manager.js.map +0 -1
- package/dist/addons/paths.d.ts.map +0 -1
- package/dist/addons/paths.js.map +0 -1
- package/dist/addons/registry.d.ts.map +0 -1
- package/dist/addons/registry.js.map +0 -1
- package/dist/addons/semver.d.ts.map +0 -1
- package/dist/addons/semver.js.map +0 -1
- package/dist/addons/types.d.ts.map +0 -1
- package/dist/addons/types.js.map +0 -1
- package/dist/addons/validate.d.ts.map +0 -1
- package/dist/addons/validate.js.map +0 -1
- package/dist/arkui/index.d.ts.map +0 -1
- package/dist/arkui/index.js.map +0 -1
- package/dist/arkui/migrate-passage.d.ts.map +0 -1
- package/dist/arkui/migrate-passage.js.map +0 -1
- package/dist/arkui/migrate-semantics.d.ts.map +0 -1
- package/dist/arkui/migrate-semantics.js.map +0 -1
- package/dist/arkui/migrate-snapshot.d.ts.map +0 -1
- package/dist/arkui/migrate-snapshot.js.map +0 -1
- package/dist/bin/addon-commands.d.ts.map +0 -1
- package/dist/bin/addon-commands.js.map +0 -1
- package/dist/bin/command-supervision.d.ts.map +0 -1
- package/dist/bin/command-supervision.js.map +0 -1
- package/dist/bin/fatal-handler.d.ts.map +0 -1
- package/dist/bin/fatal-handler.js.map +0 -1
- package/dist/bin/homegraph.d.ts.map +0 -1
- package/dist/bin/homegraph.js.map +0 -1
- package/dist/bin/node-version-check.d.ts.map +0 -1
- package/dist/bin/node-version-check.js.map +0 -1
- package/dist/bin/uninstall.d.ts.map +0 -1
- package/dist/bin/uninstall.js.map +0 -1
- package/dist/context/formatter.d.ts.map +0 -1
- package/dist/context/formatter.js.map +0 -1
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/context/markers.d.ts.map +0 -1
- package/dist/context/markers.js.map +0 -1
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations.d.ts.map +0 -1
- package/dist/db/migrations.js.map +0 -1
- package/dist/db/queries.d.ts.map +0 -1
- package/dist/db/queries.js.map +0 -1
- package/dist/db/sqlite-adapter.d.ts.map +0 -1
- package/dist/db/sqlite-adapter.js.map +0 -1
- package/dist/db/wal-valve.d.ts.map +0 -1
- package/dist/db/wal-valve.js.map +0 -1
- package/dist/directory.d.ts.map +0 -1
- package/dist/directory.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/extraction/arkts-batch-worker.d.ts.map +0 -1
- package/dist/extraction/arkts-batch-worker.js.map +0 -1
- package/dist/extraction/astro-extractor.d.ts.map +0 -1
- package/dist/extraction/astro-extractor.js.map +0 -1
- package/dist/extraction/cfml-extractor.d.ts.map +0 -1
- package/dist/extraction/cfml-extractor.js.map +0 -1
- package/dist/extraction/context.d.ts.map +0 -1
- package/dist/extraction/context.js.map +0 -1
- package/dist/extraction/default-ignore.d.ts.map +0 -1
- package/dist/extraction/default-ignore.js.map +0 -1
- package/dist/extraction/dfm-extractor.d.ts.map +0 -1
- package/dist/extraction/dfm-extractor.js.map +0 -1
- package/dist/extraction/extraction-version.d.ts.map +0 -1
- package/dist/extraction/extraction-version.js.map +0 -1
- package/dist/extraction/function-ref.d.ts.map +0 -1
- package/dist/extraction/function-ref.js.map +0 -1
- package/dist/extraction/generated-detection.d.ts.map +0 -1
- package/dist/extraction/generated-detection.js.map +0 -1
- package/dist/extraction/grammars.d.ts.map +0 -1
- package/dist/extraction/grammars.js.map +0 -1
- package/dist/extraction/index.d.ts.map +0 -1
- package/dist/extraction/index.js.map +0 -1
- package/dist/extraction/languages/arkts.d.ts.map +0 -1
- package/dist/extraction/languages/arkts.js.map +0 -1
- package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
- package/dist/extraction/languages/c-cpp.js.map +0 -1
- package/dist/extraction/languages/cfquery.d.ts.map +0 -1
- package/dist/extraction/languages/cfquery.js.map +0 -1
- package/dist/extraction/languages/cfscript.d.ts.map +0 -1
- package/dist/extraction/languages/cfscript.js.map +0 -1
- package/dist/extraction/languages/cobol.d.ts.map +0 -1
- package/dist/extraction/languages/cobol.js.map +0 -1
- package/dist/extraction/languages/csharp.d.ts.map +0 -1
- package/dist/extraction/languages/csharp.js.map +0 -1
- package/dist/extraction/languages/dart.d.ts.map +0 -1
- package/dist/extraction/languages/dart.js.map +0 -1
- package/dist/extraction/languages/erlang.d.ts.map +0 -1
- package/dist/extraction/languages/erlang.js.map +0 -1
- package/dist/extraction/languages/go.d.ts.map +0 -1
- package/dist/extraction/languages/go.js.map +0 -1
- package/dist/extraction/languages/index.d.ts.map +0 -1
- package/dist/extraction/languages/index.js.map +0 -1
- package/dist/extraction/languages/java.d.ts.map +0 -1
- package/dist/extraction/languages/java.js.map +0 -1
- package/dist/extraction/languages/javascript.d.ts.map +0 -1
- package/dist/extraction/languages/javascript.js.map +0 -1
- package/dist/extraction/languages/kotlin.d.ts.map +0 -1
- package/dist/extraction/languages/kotlin.js.map +0 -1
- package/dist/extraction/languages/lua.d.ts.map +0 -1
- package/dist/extraction/languages/lua.js.map +0 -1
- package/dist/extraction/languages/luau.d.ts.map +0 -1
- package/dist/extraction/languages/luau.js.map +0 -1
- package/dist/extraction/languages/nix.d.ts.map +0 -1
- package/dist/extraction/languages/nix.js.map +0 -1
- package/dist/extraction/languages/objc.d.ts.map +0 -1
- package/dist/extraction/languages/objc.js.map +0 -1
- package/dist/extraction/languages/pascal.d.ts.map +0 -1
- package/dist/extraction/languages/pascal.js.map +0 -1
- package/dist/extraction/languages/php.d.ts.map +0 -1
- package/dist/extraction/languages/php.js.map +0 -1
- package/dist/extraction/languages/python.d.ts.map +0 -1
- package/dist/extraction/languages/python.js.map +0 -1
- package/dist/extraction/languages/r.d.ts.map +0 -1
- package/dist/extraction/languages/r.js.map +0 -1
- package/dist/extraction/languages/ruby.d.ts.map +0 -1
- package/dist/extraction/languages/ruby.js.map +0 -1
- package/dist/extraction/languages/rust.d.ts.map +0 -1
- package/dist/extraction/languages/rust.js.map +0 -1
- package/dist/extraction/languages/scala.d.ts.map +0 -1
- package/dist/extraction/languages/scala.js.map +0 -1
- package/dist/extraction/languages/solidity.d.ts.map +0 -1
- package/dist/extraction/languages/solidity.js.map +0 -1
- package/dist/extraction/languages/swift.d.ts.map +0 -1
- package/dist/extraction/languages/swift.js.map +0 -1
- package/dist/extraction/languages/terraform.d.ts.map +0 -1
- package/dist/extraction/languages/terraform.js.map +0 -1
- package/dist/extraction/languages/typescript.d.ts.map +0 -1
- package/dist/extraction/languages/typescript.js.map +0 -1
- package/dist/extraction/languages/vbnet.d.ts.map +0 -1
- package/dist/extraction/languages/vbnet.js.map +0 -1
- package/dist/extraction/liquid-extractor.d.ts.map +0 -1
- package/dist/extraction/liquid-extractor.js.map +0 -1
- package/dist/extraction/mybatis-extractor.d.ts.map +0 -1
- package/dist/extraction/mybatis-extractor.js.map +0 -1
- package/dist/extraction/parse-pool.d.ts.map +0 -1
- package/dist/extraction/parse-pool.js.map +0 -1
- package/dist/extraction/parse-worker.d.ts.map +0 -1
- package/dist/extraction/parse-worker.js.map +0 -1
- package/dist/extraction/razor-extractor.d.ts.map +0 -1
- package/dist/extraction/razor-extractor.js.map +0 -1
- package/dist/extraction/store-worker.d.ts.map +0 -1
- package/dist/extraction/store-worker.js.map +0 -1
- package/dist/extraction/store-writer.d.ts.map +0 -1
- package/dist/extraction/store-writer.js.map +0 -1
- package/dist/extraction/svelte-extractor.d.ts.map +0 -1
- package/dist/extraction/svelte-extractor.js.map +0 -1
- package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-helpers.js.map +0 -1
- package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-types.js.map +0 -1
- package/dist/extraction/tree-sitter.d.ts.map +0 -1
- package/dist/extraction/tree-sitter.js.map +0 -1
- package/dist/extraction/vue-extractor.d.ts.map +0 -1
- package/dist/extraction/vue-extractor.js.map +0 -1
- package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +0 -1
- package/dist/extraction/wasm-runtime-flags.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/queries.d.ts.map +0 -1
- package/dist/graph/queries.js.map +0 -1
- package/dist/graph/traversal.d.ts.map +0 -1
- package/dist/graph/traversal.js.map +0 -1
- package/dist/graph-sources.d.ts.map +0 -1
- package/dist/graph-sources.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/installer/config-writer.d.ts.map +0 -1
- package/dist/installer/config-writer.js.map +0 -1
- package/dist/installer/index.d.ts.map +0 -1
- package/dist/installer/index.js.map +0 -1
- package/dist/installer/instructions-template.d.ts.map +0 -1
- package/dist/installer/instructions-template.js.map +0 -1
- package/dist/installer/targets/antigravity.d.ts.map +0 -1
- package/dist/installer/targets/antigravity.js.map +0 -1
- package/dist/installer/targets/claude.d.ts.map +0 -1
- package/dist/installer/targets/claude.js.map +0 -1
- package/dist/installer/targets/codebuddy.d.ts.map +0 -1
- package/dist/installer/targets/codebuddy.js.map +0 -1
- package/dist/installer/targets/codex.d.ts.map +0 -1
- package/dist/installer/targets/codex.js.map +0 -1
- package/dist/installer/targets/cursor.d.ts.map +0 -1
- package/dist/installer/targets/cursor.js.map +0 -1
- package/dist/installer/targets/deveco.d.ts.map +0 -1
- package/dist/installer/targets/deveco.js.map +0 -1
- package/dist/installer/targets/gemini.d.ts.map +0 -1
- package/dist/installer/targets/gemini.js.map +0 -1
- package/dist/installer/targets/hermes.d.ts.map +0 -1
- package/dist/installer/targets/hermes.js.map +0 -1
- package/dist/installer/targets/kiro.d.ts.map +0 -1
- package/dist/installer/targets/kiro.js.map +0 -1
- package/dist/installer/targets/opencode.d.ts.map +0 -1
- package/dist/installer/targets/opencode.js.map +0 -1
- package/dist/installer/targets/registry.d.ts.map +0 -1
- package/dist/installer/targets/registry.js.map +0 -1
- package/dist/installer/targets/shared.d.ts.map +0 -1
- package/dist/installer/targets/shared.js.map +0 -1
- package/dist/installer/targets/toml.d.ts.map +0 -1
- package/dist/installer/targets/toml.js.map +0 -1
- package/dist/installer/targets/types.d.ts.map +0 -1
- package/dist/installer/targets/types.js.map +0 -1
- package/dist/mcp/daemon-manager.d.ts.map +0 -1
- package/dist/mcp/daemon-manager.js.map +0 -1
- package/dist/mcp/daemon-paths.d.ts.map +0 -1
- package/dist/mcp/daemon-paths.js.map +0 -1
- package/dist/mcp/daemon-registry.d.ts.map +0 -1
- package/dist/mcp/daemon-registry.js.map +0 -1
- package/dist/mcp/daemon.d.ts.map +0 -1
- package/dist/mcp/daemon.js.map +0 -1
- package/dist/mcp/diff-impact.d.ts.map +0 -1
- package/dist/mcp/diff-impact.js.map +0 -1
- package/dist/mcp/dynamic-boundaries.d.ts.map +0 -1
- package/dist/mcp/dynamic-boundaries.js.map +0 -1
- package/dist/mcp/early-ppid.d.ts.map +0 -1
- package/dist/mcp/early-ppid.js.map +0 -1
- package/dist/mcp/engine.d.ts.map +0 -1
- package/dist/mcp/engine.js.map +0 -1
- package/dist/mcp/evidence-rendering.d.ts.map +0 -1
- package/dist/mcp/evidence-rendering.js.map +0 -1
- package/dist/mcp/explore-dedup.d.ts.map +0 -1
- package/dist/mcp/explore-dedup.js.map +0 -1
- package/dist/mcp/explore-repeat-guard.d.ts.map +0 -1
- package/dist/mcp/explore-repeat-guard.js.map +0 -1
- package/dist/mcp/explore-session-state.d.ts.map +0 -1
- package/dist/mcp/explore-session-state.js.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/liveness-watchdog.d.ts.map +0 -1
- package/dist/mcp/liveness-watchdog.js.map +0 -1
- package/dist/mcp/memory-budget.d.ts.map +0 -1
- package/dist/mcp/memory-budget.js.map +0 -1
- package/dist/mcp/ppid-watchdog.d.ts.map +0 -1
- package/dist/mcp/ppid-watchdog.js.map +0 -1
- package/dist/mcp/proxy.d.ts.map +0 -1
- package/dist/mcp/proxy.js.map +0 -1
- package/dist/mcp/query-cache.d.ts.map +0 -1
- package/dist/mcp/query-cache.js.map +0 -1
- package/dist/mcp/query-pool.d.ts.map +0 -1
- package/dist/mcp/query-pool.js.map +0 -1
- package/dist/mcp/query-worker.d.ts.map +0 -1
- package/dist/mcp/query-worker.js.map +0 -1
- package/dist/mcp/server-instructions.d.ts.map +0 -1
- package/dist/mcp/server-instructions.js.map +0 -1
- package/dist/mcp/session.d.ts.map +0 -1
- package/dist/mcp/session.js.map +0 -1
- package/dist/mcp/startup-handshake.d.ts.map +0 -1
- package/dist/mcp/startup-handshake.js.map +0 -1
- package/dist/mcp/stdin-teardown.d.ts.map +0 -1
- package/dist/mcp/stdin-teardown.js.map +0 -1
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js.map +0 -1
- package/dist/mcp/version.d.ts.map +0 -1
- package/dist/mcp/version.js.map +0 -1
- package/dist/project-config.d.ts.map +0 -1
- package/dist/project-config.js.map +0 -1
- package/dist/project-map/index.d.ts.map +0 -1
- package/dist/project-map/index.js.map +0 -1
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +0 -1
- package/dist/resolution/c-fnptr-synthesizer.js.map +0 -1
- package/dist/resolution/callback-synthesizer.d.ts.map +0 -1
- package/dist/resolution/callback-synthesizer.js.map +0 -1
- package/dist/resolution/cooperative-yield.d.ts.map +0 -1
- package/dist/resolution/cooperative-yield.js.map +0 -1
- package/dist/resolution/frameworks/arkts-entry.d.ts.map +0 -1
- package/dist/resolution/frameworks/arkts-entry.js.map +0 -1
- package/dist/resolution/frameworks/arkts-napi.d.ts.map +0 -1
- package/dist/resolution/frameworks/arkts-napi.js.map +0 -1
- package/dist/resolution/frameworks/astro.d.ts.map +0 -1
- package/dist/resolution/frameworks/astro.js.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
- package/dist/resolution/frameworks/cics.d.ts.map +0 -1
- package/dist/resolution/frameworks/cics.js.map +0 -1
- package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
- package/dist/resolution/frameworks/csharp.js.map +0 -1
- package/dist/resolution/frameworks/drupal.d.ts.map +0 -1
- package/dist/resolution/frameworks/drupal.js.map +0 -1
- package/dist/resolution/frameworks/expo-modules.d.ts.map +0 -1
- package/dist/resolution/frameworks/expo-modules.js.map +0 -1
- package/dist/resolution/frameworks/express.d.ts.map +0 -1
- package/dist/resolution/frameworks/express.js.map +0 -1
- package/dist/resolution/frameworks/fabric.d.ts.map +0 -1
- package/dist/resolution/frameworks/fabric.js.map +0 -1
- package/dist/resolution/frameworks/go.d.ts.map +0 -1
- package/dist/resolution/frameworks/go.js.map +0 -1
- package/dist/resolution/frameworks/goframe.d.ts.map +0 -1
- package/dist/resolution/frameworks/goframe.js.map +0 -1
- package/dist/resolution/frameworks/index.d.ts.map +0 -1
- package/dist/resolution/frameworks/index.js.map +0 -1
- package/dist/resolution/frameworks/java.d.ts.map +0 -1
- package/dist/resolution/frameworks/java.js.map +0 -1
- package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
- package/dist/resolution/frameworks/laravel.js.map +0 -1
- package/dist/resolution/frameworks/nestjs.d.ts.map +0 -1
- package/dist/resolution/frameworks/nestjs.js.map +0 -1
- package/dist/resolution/frameworks/play.d.ts.map +0 -1
- package/dist/resolution/frameworks/play.js.map +0 -1
- package/dist/resolution/frameworks/python.d.ts.map +0 -1
- package/dist/resolution/frameworks/python.js.map +0 -1
- package/dist/resolution/frameworks/react-native.d.ts.map +0 -1
- package/dist/resolution/frameworks/react-native.js.map +0 -1
- package/dist/resolution/frameworks/react.d.ts.map +0 -1
- package/dist/resolution/frameworks/react.js.map +0 -1
- package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
- package/dist/resolution/frameworks/ruby.js.map +0 -1
- package/dist/resolution/frameworks/rust.d.ts.map +0 -1
- package/dist/resolution/frameworks/rust.js.map +0 -1
- package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
- package/dist/resolution/frameworks/svelte.js.map +0 -1
- package/dist/resolution/frameworks/swift-objc.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift-objc.js.map +0 -1
- package/dist/resolution/frameworks/swift.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift.js.map +0 -1
- package/dist/resolution/frameworks/terraform.d.ts.map +0 -1
- package/dist/resolution/frameworks/terraform.js.map +0 -1
- package/dist/resolution/frameworks/vue.d.ts.map +0 -1
- package/dist/resolution/frameworks/vue.js.map +0 -1
- package/dist/resolution/go-module.d.ts.map +0 -1
- package/dist/resolution/go-module.js.map +0 -1
- package/dist/resolution/goframe-synthesizer.d.ts.map +0 -1
- package/dist/resolution/goframe-synthesizer.js.map +0 -1
- package/dist/resolution/import-resolver.d.ts.map +0 -1
- package/dist/resolution/import-resolver.js.map +0 -1
- package/dist/resolution/index.d.ts.map +0 -1
- package/dist/resolution/index.js.map +0 -1
- package/dist/resolution/lru-cache.d.ts.map +0 -1
- package/dist/resolution/lru-cache.js.map +0 -1
- package/dist/resolution/memory-budget.d.ts.map +0 -1
- package/dist/resolution/memory-budget.js.map +0 -1
- package/dist/resolution/name-matcher.d.ts.map +0 -1
- package/dist/resolution/name-matcher.js.map +0 -1
- package/dist/resolution/path-aliases.d.ts.map +0 -1
- package/dist/resolution/path-aliases.js.map +0 -1
- package/dist/resolution/resolver-pool.d.ts.map +0 -1
- package/dist/resolution/resolver-pool.js.map +0 -1
- package/dist/resolution/resolver-worker.d.ts.map +0 -1
- package/dist/resolution/resolver-worker.js.map +0 -1
- package/dist/resolution/strip-comments.d.ts.map +0 -1
- package/dist/resolution/strip-comments.js.map +0 -1
- package/dist/resolution/swift-objc-bridge.d.ts.map +0 -1
- package/dist/resolution/swift-objc-bridge.js.map +0 -1
- package/dist/resolution/types.d.ts.map +0 -1
- package/dist/resolution/types.js.map +0 -1
- package/dist/resolution/workspace-packages.d.ts.map +0 -1
- package/dist/resolution/workspace-packages.js.map +0 -1
- package/dist/search/identifier-segments.d.ts.map +0 -1
- package/dist/search/identifier-segments.js.map +0 -1
- package/dist/search/literal-evidence.d.ts.map +0 -1
- package/dist/search/literal-evidence.js.map +0 -1
- package/dist/search/query-parser.d.ts.map +0 -1
- package/dist/search/query-parser.js.map +0 -1
- package/dist/search/query-plan-provider.d.ts.map +0 -1
- package/dist/search/query-plan-provider.js.map +0 -1
- package/dist/search/query-plan.d.ts.map +0 -1
- package/dist/search/query-plan.js.map +0 -1
- package/dist/search/query-utils.d.ts.map +0 -1
- package/dist/search/query-utils.js.map +0 -1
- package/dist/spec/build/diff-parser.d.ts.map +0 -1
- package/dist/spec/build/diff-parser.js.map +0 -1
- package/dist/spec/build/pipeline.d.ts.map +0 -1
- package/dist/spec/build/pipeline.js.map +0 -1
- package/dist/spec/build/scan.d.ts.map +0 -1
- package/dist/spec/build/scan.js.map +0 -1
- package/dist/spec/build/scope-resolver.d.ts.map +0 -1
- package/dist/spec/build/scope-resolver.js.map +0 -1
- package/dist/spec/build/spec-extractor.d.ts.map +0 -1
- package/dist/spec/build/spec-extractor.js.map +0 -1
- package/dist/spec/config.d.ts.map +0 -1
- package/dist/spec/config.js.map +0 -1
- package/dist/spec/db/commit-node.d.ts.map +0 -1
- package/dist/spec/db/commit-node.js.map +0 -1
- package/dist/spec/db/fragment-node.d.ts.map +0 -1
- package/dist/spec/db/fragment-node.js.map +0 -1
- package/dist/spec/db/fts.d.ts.map +0 -1
- package/dist/spec/db/fts.js.map +0 -1
- package/dist/spec/db/index.d.ts.map +0 -1
- package/dist/spec/db/index.js.map +0 -1
- package/dist/spec/db/persist.d.ts.map +0 -1
- package/dist/spec/db/persist.js.map +0 -1
- package/dist/spec/db/relations.d.ts.map +0 -1
- package/dist/spec/db/relations.js.map +0 -1
- package/dist/spec/db/schema.d.ts.map +0 -1
- package/dist/spec/db/schema.js.map +0 -1
- package/dist/spec/db/spec-node.d.ts.map +0 -1
- package/dist/spec/db/spec-node.js.map +0 -1
- package/dist/spec/db/sql-utils.d.ts.map +0 -1
- package/dist/spec/db/sql-utils.js.map +0 -1
- package/dist/spec/evolve/cluster-context.d.ts.map +0 -1
- package/dist/spec/evolve/cluster-context.js.map +0 -1
- package/dist/spec/evolve/commit-spec-analyzer.d.ts.map +0 -1
- package/dist/spec/evolve/commit-spec-analyzer.js.map +0 -1
- package/dist/spec/evolve/commit-spec-persister.d.ts.map +0 -1
- package/dist/spec/evolve/commit-spec-persister.js.map +0 -1
- package/dist/spec/evolve/impact-locator.d.ts.map +0 -1
- package/dist/spec/evolve/impact-locator.js.map +0 -1
- package/dist/spec/evolve/pipeline.d.ts.map +0 -1
- package/dist/spec/evolve/pipeline.js.map +0 -1
- package/dist/spec/evolve/spec-rewriter.d.ts.map +0 -1
- package/dist/spec/evolve/spec-rewriter.js.map +0 -1
- package/dist/spec/git/commits.d.ts.map +0 -1
- package/dist/spec/git/commits.js.map +0 -1
- package/dist/spec/git/exec.d.ts.map +0 -1
- package/dist/spec/git/exec.js.map +0 -1
- package/dist/spec/git/index.d.ts.map +0 -1
- package/dist/spec/git/index.js.map +0 -1
- package/dist/spec/graph/index.d.ts.map +0 -1
- package/dist/spec/graph/index.js.map +0 -1
- package/dist/spec/graph/queries.d.ts.map +0 -1
- package/dist/spec/graph/queries.js.map +0 -1
- package/dist/spec/llm/agent-client.d.ts.map +0 -1
- package/dist/spec/llm/agent-client.js.map +0 -1
- package/dist/spec/llm/agents/claude-code.d.ts.map +0 -1
- package/dist/spec/llm/agents/claude-code.js.map +0 -1
- package/dist/spec/llm/agents/codex.d.ts.map +0 -1
- package/dist/spec/llm/agents/codex.js.map +0 -1
- package/dist/spec/llm/agents/detect-utils.d.ts.map +0 -1
- package/dist/spec/llm/agents/detect-utils.js.map +0 -1
- package/dist/spec/llm/agents/deveco-code.d.ts.map +0 -1
- package/dist/spec/llm/agents/deveco-code.js.map +0 -1
- package/dist/spec/llm/agents/index.d.ts.map +0 -1
- package/dist/spec/llm/agents/index.js.map +0 -1
- package/dist/spec/llm/agents/types.d.ts.map +0 -1
- package/dist/spec/llm/agents/types.js.map +0 -1
- package/dist/spec/llm/client.d.ts.map +0 -1
- package/dist/spec/llm/client.js.map +0 -1
- package/dist/spec/llm/factory.d.ts.map +0 -1
- package/dist/spec/llm/factory.js.map +0 -1
- package/dist/spec/llm/prompts.d.ts.map +0 -1
- package/dist/spec/llm/prompts.js.map +0 -1
- package/dist/spec/llm/retry.d.ts.map +0 -1
- package/dist/spec/llm/retry.js.map +0 -1
- package/dist/spec/mine/addon/adapter.d.ts.map +0 -1
- package/dist/spec/mine/addon/adapter.js.map +0 -1
- package/dist/spec/mine/addon/render.d.ts.map +0 -1
- package/dist/spec/mine/addon/render.js.map +0 -1
- package/dist/spec/mine/addon/types.d.ts.map +0 -1
- package/dist/spec/mine/addon/types.js.map +0 -1
- package/dist/spec/mine/clustering/features.d.ts.map +0 -1
- package/dist/spec/mine/clustering/features.js.map +0 -1
- package/dist/spec/mine/clustering/index.d.ts.map +0 -1
- package/dist/spec/mine/clustering/index.js.map +0 -1
- package/dist/spec/mine/clustering/leiden.d.ts.map +0 -1
- package/dist/spec/mine/clustering/leiden.js.map +0 -1
- package/dist/spec/mine/clustering/text-similarity.d.ts.map +0 -1
- package/dist/spec/mine/clustering/text-similarity.js.map +0 -1
- package/dist/spec/mine/generator.d.ts.map +0 -1
- package/dist/spec/mine/generator.js.map +0 -1
- package/dist/spec/mine/persist.d.ts.map +0 -1
- package/dist/spec/mine/persist.js.map +0 -1
- package/dist/spec/mine/pipeline.d.ts.map +0 -1
- package/dist/spec/mine/pipeline.js.map +0 -1
- package/dist/spec/mine/scanner.d.ts.map +0 -1
- package/dist/spec/mine/scanner.js.map +0 -1
- package/dist/spec/types.d.ts.map +0 -1
- package/dist/spec/types.js.map +0 -1
- package/dist/spec/ui/index.d.ts.map +0 -1
- package/dist/spec/ui/index.js.map +0 -1
- package/dist/spec/ui/progress-handler.d.ts.map +0 -1
- package/dist/spec/ui/progress-handler.js.map +0 -1
- package/dist/spec/ui/progress.d.ts.map +0 -1
- package/dist/spec/ui/progress.js.map +0 -1
- package/dist/spec/utils/fs.d.ts.map +0 -1
- package/dist/spec/utils/fs.js.map +0 -1
- package/dist/spec/utils/index.d.ts.map +0 -1
- package/dist/spec/utils/index.js.map +0 -1
- package/dist/spec/utils/meta.d.ts.map +0 -1
- package/dist/spec/utils/meta.js.map +0 -1
- package/dist/spec/utils/truncate.d.ts.map +0 -1
- package/dist/spec/utils/truncate.js.map +0 -1
- package/dist/sync/git-hooks.d.ts.map +0 -1
- package/dist/sync/git-hooks.js.map +0 -1
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/watch-policy.d.ts.map +0 -1
- package/dist/sync/watch-policy.js.map +0 -1
- package/dist/sync/watcher.d.ts.map +0 -1
- package/dist/sync/watcher.js.map +0 -1
- package/dist/sync/worktree.d.ts.map +0 -1
- package/dist/sync/worktree.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/ui/glyphs.d.ts.map +0 -1
- package/dist/ui/glyphs.js.map +0 -1
- package/dist/ui/shimmer-progress.d.ts.map +0 -1
- package/dist/ui/shimmer-progress.js.map +0 -1
- package/dist/ui/shimmer-worker.d.ts.map +0 -1
- package/dist/ui/shimmer-worker.js.map +0 -1
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/ui/types.js.map +0 -1
- package/dist/upgrade/index.d.ts.map +0 -1
- package/dist/upgrade/index.js.map +0 -1
- package/dist/upgrade/remove-binary.d.ts.map +0 -1
- package/dist/upgrade/remove-binary.js.map +0 -1
- package/dist/upgrade/update-check.d.ts.map +0 -1
- package/dist/upgrade/update-check.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVIDENCE_PATH_LIMITS = void 0;
|
|
4
|
+
exports.isEvidencePathNode = isEvidencePathNode;
|
|
5
|
+
exports.completeEvidencePathCandidates = completeEvidencePathCandidates;
|
|
6
|
+
exports.resolveEvidencePathGoal = resolveEvidencePathGoal;
|
|
7
|
+
exports.evidenceEdgeCost = evidenceEdgeCost;
|
|
8
|
+
exports.evidenceEdgeKey = evidenceEdgeKey;
|
|
9
|
+
exports.searchEvidencePaths = searchEvidencePaths;
|
|
10
|
+
exports.EVIDENCE_PATH_LIMITS = { anchors: 4, hops: 4, reads: 48, perNode: 24, nodes: 128, milliseconds: 60 };
|
|
11
|
+
const CONTAINERS = new Set(['class', 'struct', 'component', 'interface', 'enum']);
|
|
12
|
+
const STATES = new Set(['state-binding', 'Prop', 'Link', 'observed-ref', 'storage-api', 'data-passage']);
|
|
13
|
+
const STRUCTURAL_VIEW = new Set(['child-component', 'builder', 'builder-param', 'states']);
|
|
14
|
+
function isEvidencePathNode(n) {
|
|
15
|
+
return !['file', 'module', 'import', 'export', 'parameter'].includes(n.kind)
|
|
16
|
+
&& !n.filePath.startsWith('ohos-sdk:') && !/\.d\.(?:ts|ets)$/.test(n.filePath)
|
|
17
|
+
&& !n.filePath.includes('@dummy') && !n.name.startsWith('@dummy')
|
|
18
|
+
&& !(n.name === 'constructor' && n.startLine === 1 && n.endLine === 1);
|
|
19
|
+
}
|
|
20
|
+
/** Exact names may have been removed by generic search stopwords (e.g. Type.start).
|
|
21
|
+
* Resolve through the qualified-name index, never by picking a bare-name overload.
|
|
22
|
+
*/
|
|
23
|
+
function completeEvidencePathCandidates(query, nodes, lookup, plan) {
|
|
24
|
+
const named = [...new Set([...(query.match(/[A-Za-z_$][\w$]*(?:(?:::|\.)[A-Za-z_$][\w$]*)+/g) ?? []),
|
|
25
|
+
...(plan?.anchors ?? []).filter(a => /\.|::/.test(a))])].slice(0, exports.EVIDENCE_PATH_LIMITS.anchors);
|
|
26
|
+
const extra = [];
|
|
27
|
+
for (const name of named) {
|
|
28
|
+
for (const alias of new Set([name.replace(/::/g, '.'), name.replace(/\./g, '::')])) {
|
|
29
|
+
extra.push(...lookup(alias, 25).filter(isEvidencePathNode));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return [...new Map([...nodes, ...extra].map(n => [n.id, n])).values()];
|
|
33
|
+
}
|
|
34
|
+
/** Resolve only actual candidate identities; a bare homonym never selects the first hit. */
|
|
35
|
+
function resolveEvidencePathGoal(query, nodes, focusIds, plan) {
|
|
36
|
+
const candidates = [...new Map(nodes.filter(isEvidencePathNode).map(n => [n.id, n])).values()];
|
|
37
|
+
const mentions = [];
|
|
38
|
+
const aliases = new Map();
|
|
39
|
+
const normalize = (s) => s.replace(/::/g, '.');
|
|
40
|
+
for (const node of candidates) {
|
|
41
|
+
for (const alias of new Set([node.name, node.qualifiedName, normalize(node.qualifiedName)])) {
|
|
42
|
+
if (!alias)
|
|
43
|
+
continue;
|
|
44
|
+
aliases.set(alias, [...(aliases.get(alias) ?? []), node]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
for (const [alias, hits] of aliases) {
|
|
48
|
+
let at = query.indexOf(alias);
|
|
49
|
+
while (at >= 0) {
|
|
50
|
+
const before = query[at - 1] ?? '';
|
|
51
|
+
const after = query[at + alias.length] ?? '';
|
|
52
|
+
if (!/[\w$.]/.test(before) && !/[\w$]/.test(after)) {
|
|
53
|
+
mentions.push({ at, length: alias.length, key: alias, nodes: hits });
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
at = query.indexOf(alias, at + 1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Qualified Class.member owns the occurrence, not the nested Class/member words.
|
|
60
|
+
const maximal = mentions.filter(m => !mentions.some(other => other !== m && other.at <= m.at
|
|
61
|
+
&& other.at + other.length >= m.at + m.length && other.length > m.length)).sort((a, b) => a.at - b.at || b.length - a.length);
|
|
62
|
+
const selected = [];
|
|
63
|
+
const ambiguous = [];
|
|
64
|
+
const bound = candidates.filter(n => plan?.bindings?.some(b => n.id === b.id && n.name === b.name && n.filePath === b.filePath
|
|
65
|
+
&& n.startLine === b.startLine && (!b.qualifiedName || n.qualifiedName === b.qualifiedName)));
|
|
66
|
+
const owners = maximal.flatMap(m => m.nodes.length === 1 && CONTAINERS.has(m.nodes[0].kind) ? m.nodes : []);
|
|
67
|
+
for (const mention of maximal) {
|
|
68
|
+
let hits = [...new Map(mention.nodes.map(n => [`${n.filePath}:${n.startLine}:${n.name}`, n])).values()];
|
|
69
|
+
if (hits.length > 1) {
|
|
70
|
+
const scoped = hits.filter(n => query.includes(n.filePath) || owners.some(owner => owner.filePath === n.filePath
|
|
71
|
+
&& owner.startLine <= n.startLine && owner.endLine >= n.endLine));
|
|
72
|
+
if (scoped.length)
|
|
73
|
+
hits = scoped;
|
|
74
|
+
const inherited = hits.filter(n => bound.some(b => b.id === n.id));
|
|
75
|
+
if (inherited.length === 1)
|
|
76
|
+
hits = inherited;
|
|
77
|
+
}
|
|
78
|
+
if (hits.length === 1)
|
|
79
|
+
selected.push(hits[0]);
|
|
80
|
+
else
|
|
81
|
+
ambiguous.push(mention.key);
|
|
82
|
+
}
|
|
83
|
+
// Bindings carry identity from preceding returned source; validate every field.
|
|
84
|
+
for (const node of bound)
|
|
85
|
+
if (!selected.some(n => n.id === node.id))
|
|
86
|
+
selected.push(node);
|
|
87
|
+
const roots = selected.length || ambiguous.length ? selected : candidates.filter(n => focusIds.has(n.id));
|
|
88
|
+
const leaves = [...new Map(roots.filter(n => !CONTAINERS.has(n.kind) || !roots.some(child => child.id !== n.id
|
|
89
|
+
&& child.filePath === n.filePath && child.startLine >= n.startLine && child.endLine <= n.endLine
|
|
90
|
+
&& !CONTAINERS.has(child.kind))).map(n => [n.id, n])).values()];
|
|
91
|
+
const relation = plan?.relation;
|
|
92
|
+
const direction = relation === 'incoming_references' || relation === 'registration_sites' ? 'incoming'
|
|
93
|
+
: relation === 'outgoing_calls' ? 'outgoing' : 'either';
|
|
94
|
+
const kind = relation === 'outgoing_calls' ? 'calls'
|
|
95
|
+
: relation === 'registration_sites' || plan?.features.queryAsEventDispatchSurvey ? 'events'
|
|
96
|
+
: leaves.some(n => n.kind === 'property' || n.kind === 'field') || plan?.features.queryAsAssignedFlagImpactSurvey ? 'state'
|
|
97
|
+
: leaves.length > 0 && leaves.every(n => CONTAINERS.has(n.kind)) ? 'structure' : 'calls';
|
|
98
|
+
return { kind, direction, anchorIds: leaves.slice(0, exports.EVIDENCE_PATH_LIMITS.anchors).map(n => n.id),
|
|
99
|
+
ambiguous: [...new Set(ambiguous)], limited: leaves.length > exports.EVIDENCE_PATH_LIMITS.anchors };
|
|
100
|
+
}
|
|
101
|
+
/** Semantic admissibility is distinct from the non-probabilistic search cost. */
|
|
102
|
+
function edgeSemantics(edge) {
|
|
103
|
+
const via = typeof edge.metadata?.via === 'string' ? edge.metadata.via : '';
|
|
104
|
+
const by = edge.metadata?.synthesizedBy;
|
|
105
|
+
const state = by === 'arkui-state' || ((by === 'viewtree' || by === 'arkui-migrate')
|
|
106
|
+
&& (STATES.has(via) || typeof edge.metadata?.passageType === 'string'));
|
|
107
|
+
const event = (by === 'viewtree' && !!via && !state && !STRUCTURAL_VIEW.has(via))
|
|
108
|
+
|| ['callback', 'event-emitter', 'closure-collection', 'fn-pointer-dispatch', 'arkui-emitter', 'arkui-common-event', 'arkui-taskpool'].includes(String(by));
|
|
109
|
+
return { state, event };
|
|
110
|
+
}
|
|
111
|
+
function evidenceEdgeCost(edge, goal) {
|
|
112
|
+
const { state, event } = edgeSemantics(edge);
|
|
113
|
+
let relevanceCost;
|
|
114
|
+
if (goal.kind === 'structure') {
|
|
115
|
+
if (!['extends', 'implements', 'overrides', 'instantiates'].includes(edge.kind))
|
|
116
|
+
return null;
|
|
117
|
+
relevanceCost = 0;
|
|
118
|
+
}
|
|
119
|
+
else if (goal.kind === 'state' && state && (edge.kind === 'references' || edge.kind === 'calls'))
|
|
120
|
+
relevanceCost = 0;
|
|
121
|
+
else if (edge.kind === 'calls' && !state)
|
|
122
|
+
relevanceCost = goal.kind === 'events' ? 0.4 : goal.kind === 'state' ? 0.5 : 0;
|
|
123
|
+
else if (edge.kind === 'references' && event)
|
|
124
|
+
relevanceCost = goal.kind === 'events' ? 0 : 0.3;
|
|
125
|
+
else
|
|
126
|
+
return null;
|
|
127
|
+
const reliabilityCost = edge.provenance === 'heuristic' ? 0.75
|
|
128
|
+
: edge.provenance === 'tree-sitter' || edge.provenance === 'scip' ? 0 : 1;
|
|
129
|
+
return 1 + relevanceCost + reliabilityCost;
|
|
130
|
+
}
|
|
131
|
+
function evidenceEdgeKey(edge) {
|
|
132
|
+
return JSON.stringify([edge.source, edge.target, edge.kind, edge.line, edge.metadata?.synthesizedBy, edge.metadata?.via, edge.metadata?.registeredAt]);
|
|
133
|
+
}
|
|
134
|
+
/** One bounded search per request. Each orientation follows directed edges throughout. */
|
|
135
|
+
function searchEvidencePaths(graph, goal, options = {}) {
|
|
136
|
+
const limits = { ...exports.EVIDENCE_PATH_LIMITS, ...options.limits };
|
|
137
|
+
const now = options.now ?? Date.now;
|
|
138
|
+
const started = now();
|
|
139
|
+
const hits = new Set();
|
|
140
|
+
const stats = { adjacencyReads: 0, rowsRead: 0, nodesVisited: 0, durationMs: 0 };
|
|
141
|
+
const nodeCache = new Map();
|
|
142
|
+
const adjacency = new Map();
|
|
143
|
+
const neighbors = new Map();
|
|
144
|
+
const paths = [];
|
|
145
|
+
const missing = [];
|
|
146
|
+
const kinds = goal.kind === 'structure' ? ['extends', 'implements', 'overrides', 'instantiates'] : ['calls', 'references'];
|
|
147
|
+
const alive = () => {
|
|
148
|
+
if (now() - started >= limits.milliseconds) {
|
|
149
|
+
hits.add('time');
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
};
|
|
154
|
+
const node = (id) => {
|
|
155
|
+
if (nodeCache.has(id))
|
|
156
|
+
return nodeCache.get(id);
|
|
157
|
+
if (nodeCache.size >= limits.nodes) {
|
|
158
|
+
hits.add('nodes');
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
const value = graph.getNode(id);
|
|
162
|
+
const kept = value && isEvidencePathNode(value) ? value : null;
|
|
163
|
+
nodeCache.set(id, kept);
|
|
164
|
+
stats.nodesVisited = nodeCache.size;
|
|
165
|
+
return kept;
|
|
166
|
+
};
|
|
167
|
+
const read = (id, direction) => {
|
|
168
|
+
const key = `${direction}:${id}`;
|
|
169
|
+
if (adjacency.has(key))
|
|
170
|
+
return adjacency.get(key);
|
|
171
|
+
if (!alive())
|
|
172
|
+
return [];
|
|
173
|
+
if (stats.adjacencyReads >= limits.reads) {
|
|
174
|
+
hits.add('reads');
|
|
175
|
+
return [];
|
|
176
|
+
}
|
|
177
|
+
const rows = graph.getEdges(id, direction, kinds, limits.perNode + 1, goal.anchorIds);
|
|
178
|
+
stats.adjacencyReads++;
|
|
179
|
+
stats.rowsRead += rows.length;
|
|
180
|
+
if (rows.length > limits.perNode)
|
|
181
|
+
hits.add('neighbors');
|
|
182
|
+
const valid = rows.slice(0, limits.perNode).filter(e => evidenceEdgeCost(e, goal) !== null
|
|
183
|
+
&& node(e.source) && node(e.target)).sort((a, b) => evidenceEdgeCost(a, goal) - evidenceEdgeCost(b, goal)
|
|
184
|
+
|| evidenceEdgeKey(a).localeCompare(evidenceEdgeKey(b)));
|
|
185
|
+
adjacency.set(key, valid);
|
|
186
|
+
return valid;
|
|
187
|
+
};
|
|
188
|
+
const directions = goal.direction === 'either' ? ['outgoing', 'incoming'] : [goal.direction];
|
|
189
|
+
// Scoped one-hop evidence doubles as the direct-link fast path and bounded fallback.
|
|
190
|
+
for (const id of goal.anchorIds)
|
|
191
|
+
for (const direction of directions) {
|
|
192
|
+
for (const edge of read(id, direction).slice(0, 8))
|
|
193
|
+
neighbors.set(evidenceEdgeKey(edge), edge);
|
|
194
|
+
}
|
|
195
|
+
for (let pair = 1; pair < goal.anchorIds.length; pair++) {
|
|
196
|
+
const from = goal.anchorIds[pair - 1];
|
|
197
|
+
const to = goal.anchorIds[pair];
|
|
198
|
+
const queue = directions.map(direction => ({ id: from, ids: [from], edges: [], cost: 0, direction,
|
|
199
|
+
semantic: goal.kind === 'calls' || goal.kind === 'structure' }));
|
|
200
|
+
const best = new Map();
|
|
201
|
+
let found;
|
|
202
|
+
while (queue.length && alive()) {
|
|
203
|
+
queue.sort((a, b) => a.cost - b.cost || a.edges.length - b.edges.length || a.ids.join('/').localeCompare(b.ids.join('/')));
|
|
204
|
+
const current = queue.shift();
|
|
205
|
+
if (current.id === to && current.semantic) {
|
|
206
|
+
found = { id: `path:${pair}`, nodeIds: current.direction === 'outgoing' ? current.ids : [...current.ids].reverse(),
|
|
207
|
+
edges: current.direction === 'outgoing' ? current.edges : [...current.edges].reverse(), cost: current.cost, orientation: current.direction };
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
if (current.edges.length >= limits.hops) {
|
|
211
|
+
hits.add('hops');
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
for (const edge of read(current.id, current.direction)) {
|
|
215
|
+
const next = current.direction === 'outgoing' ? edge.target : edge.source;
|
|
216
|
+
if (current.ids.includes(next))
|
|
217
|
+
continue;
|
|
218
|
+
const cost = current.cost + evidenceEdgeCost(edge, goal);
|
|
219
|
+
const semantics = edgeSemantics(edge);
|
|
220
|
+
const semantic = current.semantic || (goal.kind === 'state' ? semantics.state : semantics.event);
|
|
221
|
+
const key = `${current.direction}:${next}:${current.edges.length + 1}:${semantic}`;
|
|
222
|
+
if (cost >= (best.get(key) ?? Infinity))
|
|
223
|
+
continue;
|
|
224
|
+
best.set(key, cost);
|
|
225
|
+
queue.push({ id: next, ids: [...current.ids, next], edges: [...current.edges, edge], cost, direction: current.direction, semantic });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (found)
|
|
229
|
+
paths.push(found);
|
|
230
|
+
else
|
|
231
|
+
missing.push({ from, to });
|
|
232
|
+
}
|
|
233
|
+
if (goal.limited)
|
|
234
|
+
hits.add('anchors');
|
|
235
|
+
stats.durationMs = Math.max(0, now() - started);
|
|
236
|
+
const hasGoalNeighbor = [...neighbors.values()].some(edge => goal.kind === 'state' ? edgeSemantics(edge).state
|
|
237
|
+
: goal.kind === 'events' ? edgeSemantics(edge).event : true);
|
|
238
|
+
const stopReason = goal.ambiguous.length ? 'ambiguous_anchors'
|
|
239
|
+
: !goal.anchorIds.length ? 'insufficient_anchors'
|
|
240
|
+
: missing.length ? hits.size ? 'budget_exhausted' : 'no_path_in_scope'
|
|
241
|
+
: goal.limited || (goal.anchorIds.length === 1 && hits.size) ? 'budget_exhausted'
|
|
242
|
+
: goal.anchorIds.length === 1 ? hasGoalNeighbor ? 'neighbors_only' : 'no_path_in_scope' : 'supported';
|
|
243
|
+
return { goal, paths, neighbors: [...neighbors.values()], missing, stopReason, limitsHit: [...hits], stats };
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=evidence-paths.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -185,6 +185,11 @@ export declare class HomeGraph {
|
|
|
185
185
|
* Check if an indexing operation is currently in progress
|
|
186
186
|
*/
|
|
187
187
|
isIndexing(): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* True when another live process holds `.homegraph/homegraph.lock` (Spec 0032).
|
|
190
|
+
* Used by MCP product-state gating — does not acquire the lock.
|
|
191
|
+
*/
|
|
192
|
+
isWriteLockedByOther(): boolean;
|
|
188
193
|
/**
|
|
189
194
|
* Start watching for file changes and auto-syncing.
|
|
190
195
|
*
|
|
@@ -318,7 +323,7 @@ export declare class HomeGraph {
|
|
|
318
323
|
*/
|
|
319
324
|
getStats(): GraphStats;
|
|
320
325
|
/**
|
|
321
|
-
* Active SQLite backend (`
|
|
326
|
+
* Active SQLite backend (`node-sqlite` or `wasm` fallback).
|
|
322
327
|
* Surfaced via `homegraph status` / `homegraph_status` with journal mode.
|
|
323
328
|
*/
|
|
324
329
|
getBackend(): import('./db').SqliteBackend;
|
package/dist/index.js
CHANGED
|
@@ -247,18 +247,36 @@ class HomeGraph {
|
|
|
247
247
|
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
248
248
|
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
249
249
|
}
|
|
250
|
-
// Create
|
|
250
|
+
// Create .homegraph/ first so the lock file has a home (Spec 0032).
|
|
251
251
|
(0, directory_1.createDirectory)(resolvedRoot);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
252
|
+
const bootLock = new utils_1.FileLock(path.join((0, directory_2.getHomeGraphDir)(resolvedRoot), 'homegraph.lock'));
|
|
253
|
+
try {
|
|
254
|
+
bootLock.acquire();
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
258
|
+
}
|
|
259
|
+
try {
|
|
260
|
+
// Winner may have finished between createDirectory and acquire.
|
|
261
|
+
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
262
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
263
|
+
}
|
|
264
|
+
// Initialize database
|
|
265
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
266
|
+
const db = db_1.DatabaseConnection.initialize(dbPath);
|
|
267
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
268
|
+
const instance = new HomeGraph(db, queries, resolvedRoot);
|
|
269
|
+
// Release before optional indexAll — that path acquires instance.fileLock
|
|
270
|
+
// on the same path (same PID would otherwise look like a foreign holder).
|
|
271
|
+
bootLock.release();
|
|
272
|
+
if (options.index) {
|
|
273
|
+
await instance.indexAll({ onProgress: options.onProgress });
|
|
274
|
+
}
|
|
275
|
+
return instance;
|
|
276
|
+
}
|
|
277
|
+
finally {
|
|
278
|
+
bootLock.release();
|
|
260
279
|
}
|
|
261
|
-
return instance;
|
|
262
280
|
}
|
|
263
281
|
/**
|
|
264
282
|
* Initialize synchronously (without indexing)
|
|
@@ -269,13 +287,26 @@ class HomeGraph {
|
|
|
269
287
|
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
270
288
|
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
271
289
|
}
|
|
272
|
-
// Create directory structure
|
|
273
290
|
(0, directory_1.createDirectory)(resolvedRoot);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
291
|
+
const bootLock = new utils_1.FileLock(path.join((0, directory_2.getHomeGraphDir)(resolvedRoot), 'homegraph.lock'));
|
|
292
|
+
try {
|
|
293
|
+
bootLock.acquire();
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
297
|
+
}
|
|
298
|
+
try {
|
|
299
|
+
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
300
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
301
|
+
}
|
|
302
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
303
|
+
const db = db_1.DatabaseConnection.initialize(dbPath);
|
|
304
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
305
|
+
return new HomeGraph(db, queries, resolvedRoot);
|
|
306
|
+
}
|
|
307
|
+
finally {
|
|
308
|
+
bootLock.release();
|
|
309
|
+
}
|
|
279
310
|
}
|
|
280
311
|
/**
|
|
281
312
|
* Open an existing HomeGraph project
|
|
@@ -783,6 +814,13 @@ class HomeGraph {
|
|
|
783
814
|
isIndexing() {
|
|
784
815
|
return this.indexMutex.isLocked();
|
|
785
816
|
}
|
|
817
|
+
/**
|
|
818
|
+
* True when another live process holds `.homegraph/homegraph.lock` (Spec 0032).
|
|
819
|
+
* Used by MCP product-state gating — does not acquire the lock.
|
|
820
|
+
*/
|
|
821
|
+
isWriteLockedByOther() {
|
|
822
|
+
return this.fileLock.isHeldByOther();
|
|
823
|
+
}
|
|
786
824
|
// ===========================================================================
|
|
787
825
|
// File Watching
|
|
788
826
|
// ===========================================================================
|
|
@@ -1012,7 +1050,7 @@ class HomeGraph {
|
|
|
1012
1050
|
return stats;
|
|
1013
1051
|
}
|
|
1014
1052
|
/**
|
|
1015
|
-
* Active SQLite backend (`
|
|
1053
|
+
* Active SQLite backend (`node-sqlite` or `wasm` fallback).
|
|
1016
1054
|
* Surfaced via `homegraph status` / `homegraph_status` with journal mode.
|
|
1017
1055
|
*/
|
|
1018
1056
|
getBackend() {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type HomeGraph from '../index';
|
|
2
|
+
import type { Edge, Node } from '../types';
|
|
3
|
+
import type { ExploreEmission } from './explore-session-state';
|
|
4
|
+
import { type EvidencePathSearch } from '../graph/evidence-paths';
|
|
5
|
+
export type EvidenceGapReason = 'budget' | 'unavailable' | 'stale' | 'invalid_range' | 'scope_limit' | 'unindexed_connection' | 'registration_source' | 'ambiguous_anchor';
|
|
6
|
+
export interface EvidenceGap {
|
|
7
|
+
target: string;
|
|
8
|
+
reason: EvidenceGapReason;
|
|
9
|
+
nextAnchor: string;
|
|
10
|
+
}
|
|
11
|
+
interface RelationEvidence {
|
|
12
|
+
source: string;
|
|
13
|
+
target: string;
|
|
14
|
+
kind: Edge['kind'];
|
|
15
|
+
provenance?: Edge['provenance'];
|
|
16
|
+
via?: string;
|
|
17
|
+
site?: string;
|
|
18
|
+
}
|
|
19
|
+
interface EvidencePack {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
sources: string[];
|
|
23
|
+
priority: number;
|
|
24
|
+
gaps: EvidenceGap[];
|
|
25
|
+
relation?: RelationEvidence;
|
|
26
|
+
path?: {
|
|
27
|
+
id: string;
|
|
28
|
+
nodeIds: string[];
|
|
29
|
+
relations: RelationEvidence[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface ArktsEvidenceResult {
|
|
33
|
+
text: string;
|
|
34
|
+
emission: ExploreEmission;
|
|
35
|
+
metadata: {
|
|
36
|
+
version: 1 | 2;
|
|
37
|
+
scope: 'bounded_static_evidence';
|
|
38
|
+
status: 'complete' | 'partial' | 'empty';
|
|
39
|
+
selectedPacks: string[];
|
|
40
|
+
gaps: EvidenceGap[];
|
|
41
|
+
relations: NonNullable<EvidencePack['relation']>[];
|
|
42
|
+
pathSearch?: {
|
|
43
|
+
goal: EvidencePathSearch['goal'];
|
|
44
|
+
stopReason: string;
|
|
45
|
+
limitsHit: string[];
|
|
46
|
+
stats: EvidencePathSearch['stats'];
|
|
47
|
+
paths: Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
nodeIds: string[];
|
|
50
|
+
cost: number;
|
|
51
|
+
evidence: 'provided' | 'partial';
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Consume already-located nodes. No text search, new planner call or recursive retrieval. */
|
|
57
|
+
export declare function buildArktsEvidencePacks(graph: Pick<HomeGraph, 'getNode' | 'getNodesInFile' | 'getFile' | 'getOutgoingEdges' | 'getIncomingEdges'>, options: {
|
|
58
|
+
projectRoot: string;
|
|
59
|
+
query: string;
|
|
60
|
+
nodes: Node[];
|
|
61
|
+
focusIds: Set<string>;
|
|
62
|
+
maxChars: number;
|
|
63
|
+
maxFiles?: number;
|
|
64
|
+
pathSearch?: EvidencePathSearch;
|
|
65
|
+
}): ArktsEvidenceResult | null;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=arkts-evidence-packs.d.ts.map
|