cgraphx 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +243 -0
- package/dist/.claude-template/commands/my-commit.md +9 -0
- package/dist/.claude-template/commands/my-query.md +4 -0
- package/dist/.claude-template/hooks/context-monitor/context-monitor.cjs +216 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.d.ts +4 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.js +24 -0
- package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.d.ts +8 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.js +204 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config-reader.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.d.ts +46 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.js +220 -0
- package/dist/.claude-template/plugins/claude-hud/dist/config.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.d.ts +10 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.js +10 -0
- package/dist/.claude-template/plugins/claude-hud/dist/constants.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.d.ts +6 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.js +15 -0
- package/dist/.claude-template/plugins/claude-hud/dist/debug.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.d.ts +23 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.js +103 -0
- package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.d.ts +16 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.js +86 -0
- package/dist/.claude-template/plugins/claude-hud/dist/git.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.d.ts +24 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.js +97 -0
- package/dist/.claude-template/plugins/claude-hud/dist/index.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.js +44 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.d.ts +12 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.js +58 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/colors.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.js +379 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/index.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.js +30 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.js +52 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.d.ts +5 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.js +5 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.js +74 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.js +92 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.d.ts +7 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.js +247 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.js +25 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.js +43 -0
- package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.d.ts +7 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.js +62 -0
- package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.d.ts +9 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.js +136 -0
- package/dist/.claude-template/plugins/claude-hud/dist/stdin.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.d.ts +3 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.js +189 -0
- package/dist/.claude-template/plugins/claude-hud/dist/transcript.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.d.ts +79 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.js +5 -0
- package/dist/.claude-template/plugins/claude-hud/dist/types.js.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.d.ts +59 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.d.ts.map +1 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.js +733 -0
- package/dist/.claude-template/plugins/claude-hud/dist/usage-api.js.map +1 -0
- package/dist/.claude-template/skills/cgraphx/SKILL.md +143 -0
- package/dist/.claude-template/skills/cgraphx/agent-prompt.md +56 -0
- package/dist/.claude-template/skills/clarify-requirements/SKILL.md +425 -0
- package/dist/.claude-template/skills/code-impact-api/SKILL.md +143 -0
- package/dist/.claude-template/skills/code-impact-api/agent-prompt.md +51 -0
- package/dist/.claude-template/skills/code-impact-docgen/SKILL.md +366 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-business-html.md +242 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-business-md.md +107 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-technical-html.md +205 -0
- package/dist/.claude-template/skills/code-impact-docgen/template-technical-md.md +155 -0
- package/dist/.claude-template/skills/code-impact-init/SKILL.md +800 -0
- package/dist/.claude-template/skills/code-impact-markdown/SKILL.md +345 -0
- package/dist/.claude-template/skills/code-impact-markdown/template-guide.md +68 -0
- package/dist/.claude-template/skills/code-impact-markdown/template-memory.md +82 -0
- package/dist/.claude-template/skills/code-impact-markdown/template-runbook.md +58 -0
- package/dist/.claude-template/skills/db-query/SKILL.md +166 -0
- package/dist/.claude-template/skills/db-query/agent-prompt.md +55 -0
- package/dist/.claude-template/skills/developer-timeline/SKILL.md +302 -0
- package/dist/.claude-template/skills/developer-timeline/demo-single-page-report.html +657 -0
- package/dist/.claude-template/skills/implementation/SKILL.md +136 -0
- package/dist/.claude-template/skills/subagent-implement/SKILL.md +225 -0
- package/dist/.claude-template/skills/subagent-implement/implementer-prompt.md +127 -0
- package/dist/.claude-template/skills/subagent-implement/quality-reviewer-prompt.md +130 -0
- package/dist/.claude-template/skills/subagent-implement/spec-reviewer-prompt.md +112 -0
- package/dist/.claude-template/skills/write-plan/SKILL.md +322 -0
- package/dist/.claude-template/skills/write-plan/plan-document-reviewer-prompt.md +134 -0
- package/dist/.claude-template/skills/write-prd/SKILL.md +242 -0
- package/dist/.claude-template/skills/write-spec/SKILL.md +278 -0
- package/dist/bin/codegraph.d.ts +26 -0
- package/dist/bin/codegraph.d.ts.map +1 -0
- package/dist/bin/codegraph.js +2014 -0
- package/dist/bin/codegraph.js.map +1 -0
- package/dist/bin/fatal-handler.d.ts +20 -0
- package/dist/bin/fatal-handler.d.ts.map +1 -0
- package/dist/bin/fatal-handler.js +118 -0
- package/dist/bin/fatal-handler.js.map +1 -0
- package/dist/bin/node-version-check.d.ts +51 -0
- package/dist/bin/node-version-check.d.ts.map +1 -0
- package/dist/bin/node-version-check.js +114 -0
- package/dist/bin/node-version-check.js.map +1 -0
- package/dist/bin/uninstall.d.ts +14 -0
- package/dist/bin/uninstall.d.ts.map +1 -0
- package/dist/bin/uninstall.js +36 -0
- package/dist/bin/uninstall.js.map +1 -0
- package/dist/context/formatter.d.ts +30 -0
- package/dist/context/formatter.d.ts.map +1 -0
- package/dist/context/formatter.js +263 -0
- package/dist/context/formatter.js.map +1 -0
- package/dist/context/index.d.ts +119 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1296 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/markers.d.ts +19 -0
- package/dist/context/markers.d.ts.map +1 -0
- package/dist/context/markers.js +22 -0
- package/dist/context/markers.js.map +1 -0
- package/dist/db/index.d.ts +122 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +296 -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 +140 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +401 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1591 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +152 -0
- package/dist/db/sqlite-adapter.d.ts +53 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +117 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/dbquery/cli.d.ts +17 -0
- package/dist/dbquery/cli.d.ts.map +1 -0
- package/dist/dbquery/cli.js +229 -0
- package/dist/dbquery/cli.js.map +1 -0
- package/dist/dbquery/config.d.ts +38 -0
- package/dist/dbquery/config.d.ts.map +1 -0
- package/dist/dbquery/config.js +244 -0
- package/dist/dbquery/config.js.map +1 -0
- package/dist/dbquery/constants.d.ts +40 -0
- package/dist/dbquery/constants.d.ts.map +1 -0
- package/dist/dbquery/constants.js +65 -0
- package/dist/dbquery/constants.js.map +1 -0
- package/dist/dbquery/drivers/mysql.d.ts +15 -0
- package/dist/dbquery/drivers/mysql.d.ts.map +1 -0
- package/dist/dbquery/drivers/mysql.js +102 -0
- package/dist/dbquery/drivers/mysql.js.map +1 -0
- package/dist/dbquery/drivers/postgres.d.ts +16 -0
- package/dist/dbquery/drivers/postgres.d.ts.map +1 -0
- package/dist/dbquery/drivers/postgres.js +105 -0
- package/dist/dbquery/drivers/postgres.js.map +1 -0
- package/dist/dbquery/errors.d.ts +40 -0
- package/dist/dbquery/errors.d.ts.map +1 -0
- package/dist/dbquery/errors.js +85 -0
- package/dist/dbquery/errors.js.map +1 -0
- package/dist/dbquery/executor.d.ts +30 -0
- package/dist/dbquery/executor.d.ts.map +1 -0
- package/dist/dbquery/executor.js +243 -0
- package/dist/dbquery/executor.js.map +1 -0
- package/dist/dbquery/format.d.ts +18 -0
- package/dist/dbquery/format.d.ts.map +1 -0
- package/dist/dbquery/format.js +174 -0
- package/dist/dbquery/format.js.map +1 -0
- package/dist/dbquery/index.d.ts +10 -0
- package/dist/dbquery/index.d.ts.map +1 -0
- package/dist/dbquery/index.js +23 -0
- package/dist/dbquery/index.js.map +1 -0
- package/dist/dbquery/init.d.ts +33 -0
- package/dist/dbquery/init.d.ts.map +1 -0
- package/dist/dbquery/init.js +125 -0
- package/dist/dbquery/init.js.map +1 -0
- package/dist/dbquery/logging.d.ts +22 -0
- package/dist/dbquery/logging.d.ts.map +1 -0
- package/dist/dbquery/logging.js +140 -0
- package/dist/dbquery/logging.js.map +1 -0
- package/dist/dbquery/mcp-tools.d.ts +29 -0
- package/dist/dbquery/mcp-tools.d.ts.map +1 -0
- package/dist/dbquery/mcp-tools.js +206 -0
- package/dist/dbquery/mcp-tools.js.map +1 -0
- package/dist/dbquery/queries.d.ts +31 -0
- package/dist/dbquery/queries.d.ts.map +1 -0
- package/dist/dbquery/queries.js +160 -0
- package/dist/dbquery/queries.js.map +1 -0
- package/dist/dbquery/safety.d.ts +35 -0
- package/dist/dbquery/safety.d.ts.map +1 -0
- package/dist/dbquery/safety.js +306 -0
- package/dist/dbquery/safety.js.map +1 -0
- package/dist/dbquery/types.d.ts +152 -0
- package/dist/dbquery/types.d.ts.map +1 -0
- package/dist/dbquery/types.js +10 -0
- package/dist/dbquery/types.js.map +1 -0
- package/dist/directory.d.ts +147 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +523 -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/astro-extractor.d.ts +79 -0
- package/dist/extraction/astro-extractor.d.ts.map +1 -0
- package/dist/extraction/astro-extractor.js +320 -0
- package/dist/extraction/astro-extractor.js.map +1 -0
- package/dist/extraction/dfm-extractor.d.ts +31 -0
- package/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/dist/extraction/dfm-extractor.js +151 -0
- package/dist/extraction/dfm-extractor.js.map +1 -0
- package/dist/extraction/extraction-version.d.ts +25 -0
- package/dist/extraction/extraction-version.d.ts.map +1 -0
- package/dist/extraction/extraction-version.js +28 -0
- package/dist/extraction/extraction-version.js.map +1 -0
- package/dist/extraction/function-ref.d.ts +118 -0
- package/dist/extraction/function-ref.d.ts.map +1 -0
- package/dist/extraction/function-ref.js +727 -0
- package/dist/extraction/function-ref.js.map +1 -0
- package/dist/extraction/generated-detection.d.ts +30 -0
- package/dist/extraction/generated-detection.d.ts.map +1 -0
- package/dist/extraction/generated-detection.js +83 -0
- package/dist/extraction/generated-detection.js.map +1 -0
- package/dist/extraction/grammars.d.ts +114 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +477 -0
- package/dist/extraction/grammars.js.map +1 -0
- package/dist/extraction/index.d.ts +175 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +1887 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/languages/c-cpp.d.ts +12 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +275 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +25 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +175 -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 +374 -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 +111 -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 +53 -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 +315 -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 +106 -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 +379 -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 +175 -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 +77 -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 +196 -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/r.d.ts +3 -0
- package/dist/extraction/languages/r.d.ts.map +1 -0
- package/dist/extraction/languages/r.js +314 -0
- package/dist/extraction/languages/r.js.map +1 -0
- package/dist/extraction/languages/ruby.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/dist/extraction/languages/ruby.js +149 -0
- package/dist/extraction/languages/ruby.js.map +1 -0
- package/dist/extraction/languages/rust.d.ts +3 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -0
- package/dist/extraction/languages/rust.js +142 -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 +209 -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 +152 -0
- package/dist/extraction/languages/swift.js.map +1 -0
- package/dist/extraction/languages/typescript.d.ts +16 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/dist/extraction/languages/typescript.js +167 -0
- package/dist/extraction/languages/typescript.js.map +1 -0
- package/dist/extraction/liquid-extractor.d.ts +59 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +357 -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 +97 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/razor-extractor.d.ts +42 -0
- package/dist/extraction/razor-extractor.d.ts.map +1 -0
- package/dist/extraction/razor-extractor.js +285 -0
- package/dist/extraction/razor-extractor.js.map +1 -0
- package/dist/extraction/svelte-extractor.d.ts +56 -0
- package/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/dist/extraction/svelte-extractor.js +275 -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 +152 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/dist/extraction/tree-sitter-types.d.ts +239 -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 +647 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +5592 -0
- package/dist/extraction/tree-sitter.js.map +1 -0
- package/dist/extraction/vue-extractor.d.ts +51 -0
- package/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/dist/extraction/vue-extractor.js +254 -0
- package/dist/extraction/vue-extractor.js.map +1 -0
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/dist/extraction/wasm-runtime-flags.js +106 -0
- package/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/queries.d.ts +106 -0
- package/dist/graph/queries.d.ts.map +1 -0
- package/dist/graph/queries.js +339 -0
- package/dist/graph/queries.js.map +1 -0
- package/dist/graph/traversal.d.ts +127 -0
- package/dist/graph/traversal.d.ts.map +1 -0
- package/dist/graph/traversal.js +540 -0
- package/dist/graph/traversal.js.map +1 -0
- package/dist/index.d.ts +563 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1041 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/claude-assets.d.ts +45 -0
- package/dist/installer/claude-assets.d.ts.map +1 -0
- package/dist/installer/claude-assets.js +144 -0
- package/dist/installer/claude-assets.js.map +1 -0
- package/dist/installer/config-writer.d.ts +28 -0
- package/dist/installer/config-writer.d.ts.map +1 -0
- package/dist/installer/config-writer.js +91 -0
- package/dist/installer/config-writer.js.map +1 -0
- package/dist/installer/index.d.ts +101 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +692 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +41 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +53 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/antigravity.d.ts +57 -0
- package/dist/installer/targets/antigravity.d.ts.map +1 -0
- package/dist/installer/targets/antigravity.js +308 -0
- package/dist/installer/targets/antigravity.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +66 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +564 -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 +254 -0
- package/dist/installer/targets/cursor.js.map +1 -0
- package/dist/installer/targets/gemini.d.ts +26 -0
- package/dist/installer/targets/gemini.d.ts.map +1 -0
- package/dist/installer/targets/gemini.js +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 +178 -0
- package/dist/installer/targets/kiro.js.map +1 -0
- package/dist/installer/targets/opencode.d.ts +38 -0
- package/dist/installer/targets/opencode.d.ts.map +1 -0
- package/dist/installer/targets/opencode.js +288 -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 +101 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +264 -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 +108 -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/markdown/cli.d.ts +16 -0
- package/dist/markdown/cli.d.ts.map +1 -0
- package/dist/markdown/cli.js +533 -0
- package/dist/markdown/cli.js.map +1 -0
- package/dist/markdown/constants.d.ts +22 -0
- package/dist/markdown/constants.d.ts.map +1 -0
- package/dist/markdown/constants.js +71 -0
- package/dist/markdown/constants.js.map +1 -0
- package/dist/markdown/dedup.d.ts +20 -0
- package/dist/markdown/dedup.d.ts.map +1 -0
- package/dist/markdown/dedup.js +64 -0
- package/dist/markdown/dedup.js.map +1 -0
- package/dist/markdown/errors.d.ts +22 -0
- package/dist/markdown/errors.d.ts.map +1 -0
- package/dist/markdown/errors.js +45 -0
- package/dist/markdown/errors.js.map +1 -0
- package/dist/markdown/extractor.d.ts +43 -0
- package/dist/markdown/extractor.d.ts.map +1 -0
- package/dist/markdown/extractor.js +152 -0
- package/dist/markdown/extractor.js.map +1 -0
- package/dist/markdown/frontmatter-parser.d.ts +47 -0
- package/dist/markdown/frontmatter-parser.d.ts.map +1 -0
- package/dist/markdown/frontmatter-parser.js +199 -0
- package/dist/markdown/frontmatter-parser.js.map +1 -0
- package/dist/markdown/indexer.d.ts +34 -0
- package/dist/markdown/indexer.d.ts.map +1 -0
- package/dist/markdown/indexer.js +256 -0
- package/dist/markdown/indexer.js.map +1 -0
- package/dist/markdown/mcp-tools.d.ts +33 -0
- package/dist/markdown/mcp-tools.d.ts.map +1 -0
- package/dist/markdown/mcp-tools.js +300 -0
- package/dist/markdown/mcp-tools.js.map +1 -0
- package/dist/markdown/query.d.ts +108 -0
- package/dist/markdown/query.d.ts.map +1 -0
- package/dist/markdown/query.js +570 -0
- package/dist/markdown/query.js.map +1 -0
- package/dist/markdown/schema-bootstrap.d.ts +40 -0
- package/dist/markdown/schema-bootstrap.d.ts.map +1 -0
- package/dist/markdown/schema-bootstrap.js +85 -0
- package/dist/markdown/schema-bootstrap.js.map +1 -0
- package/dist/markdown/schema.sql +124 -0
- package/dist/markdown/store.d.ts +77 -0
- package/dist/markdown/store.d.ts.map +1 -0
- package/dist/markdown/store.js +194 -0
- package/dist/markdown/store.js.map +1 -0
- package/dist/markdown/summary-extractor.d.ts +22 -0
- package/dist/markdown/summary-extractor.d.ts.map +1 -0
- package/dist/markdown/summary-extractor.js +66 -0
- package/dist/markdown/summary-extractor.js.map +1 -0
- package/dist/markdown/types.d.ts +159 -0
- package/dist/markdown/types.d.ts.map +1 -0
- package/dist/markdown/types.js +9 -0
- package/dist/markdown/types.js.map +1 -0
- package/dist/markdown/validator.d.ts +44 -0
- package/dist/markdown/validator.d.ts.map +1 -0
- package/dist/markdown/validator.js +95 -0
- package/dist/markdown/validator.js.map +1 -0
- package/dist/mcp/daemon-manager.d.ts +42 -0
- package/dist/mcp/daemon-manager.d.ts.map +1 -0
- package/dist/mcp/daemon-manager.js +129 -0
- package/dist/mcp/daemon-manager.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-registry.d.ts +47 -0
- package/dist/mcp/daemon-registry.d.ts.map +1 -0
- package/dist/mcp/daemon-registry.js +229 -0
- package/dist/mcp/daemon-registry.js.map +1 -0
- package/dist/mcp/daemon.d.ts +220 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +637 -0
- package/dist/mcp/daemon.js.map +1 -0
- package/dist/mcp/dynamic-boundaries.d.ts +41 -0
- package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
- package/dist/mcp/dynamic-boundaries.js +359 -0
- package/dist/mcp/dynamic-boundaries.js.map +1 -0
- package/dist/mcp/engine.d.ts +105 -0
- package/dist/mcp/engine.d.ts.map +1 -0
- package/dist/mcp/engine.js +278 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/index.d.ts +113 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +499 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
- package/dist/mcp/liveness-watchdog.js +207 -0
- package/dist/mcp/liveness-watchdog.js.map +1 -0
- package/dist/mcp/ppid-watchdog.d.ts +44 -0
- package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
- package/dist/mcp/ppid-watchdog.js +27 -0
- package/dist/mcp/ppid-watchdog.js.map +1 -0
- package/dist/mcp/proxy.d.ts +87 -0
- package/dist/mcp/proxy.d.ts.map +1 -0
- package/dist/mcp/proxy.js +641 -0
- package/dist/mcp/proxy.js.map +1 -0
- package/dist/mcp/server-instructions.d.ts +34 -0
- package/dist/mcp/server-instructions.d.ts.map +1 -0
- package/dist/mcp/server-instructions.js +106 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +79 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +330 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/stdin-teardown.d.ts +27 -0
- package/dist/mcp/stdin-teardown.d.ts.map +1 -0
- package/dist/mcp/stdin-teardown.js +49 -0
- package/dist/mcp/stdin-teardown.js.map +1 -0
- package/dist/mcp/tools.d.ts +547 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +4122 -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 +359 -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/project-config.d.ts +36 -0
- package/dist/project-config.d.ts.map +1 -0
- package/dist/project-config.js +235 -0
- package/dist/project-config.js.map +1 -0
- package/dist/reasoning/config.d.ts +45 -0
- package/dist/reasoning/config.d.ts.map +1 -0
- package/dist/reasoning/config.js +171 -0
- package/dist/reasoning/config.js.map +1 -0
- package/dist/reasoning/credentials.d.ts +5 -0
- package/dist/reasoning/credentials.d.ts.map +1 -0
- package/dist/reasoning/credentials.js +83 -0
- package/dist/reasoning/credentials.js.map +1 -0
- package/dist/reasoning/login.d.ts +21 -0
- package/dist/reasoning/login.d.ts.map +1 -0
- package/dist/reasoning/login.js +85 -0
- package/dist/reasoning/login.js.map +1 -0
- package/dist/reasoning/reasoner.d.ts +43 -0
- package/dist/reasoning/reasoner.d.ts.map +1 -0
- package/dist/reasoning/reasoner.js +308 -0
- package/dist/reasoning/reasoner.js.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts +33 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.js +352 -0
- package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
- package/dist/resolution/callback-synthesizer.d.ts +15 -0
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/resolution/callback-synthesizer.js +2926 -0
- package/dist/resolution/callback-synthesizer.js.map +1 -0
- package/dist/resolution/frameworks/astro.d.ts +9 -0
- package/dist/resolution/frameworks/astro.d.ts.map +1 -0
- package/dist/resolution/frameworks/astro.js +169 -0
- package/dist/resolution/frameworks/astro.js.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/dist/resolution/frameworks/csharp.js +241 -0
- package/dist/resolution/frameworks/csharp.js.map +1 -0
- package/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
- package/dist/resolution/frameworks/drupal.js +367 -0
- package/dist/resolution/frameworks/drupal.js.map +1 -0
- package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
- package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
- package/dist/resolution/frameworks/expo-modules.js +148 -0
- package/dist/resolution/frameworks/expo-modules.js.map +1 -0
- package/dist/resolution/frameworks/express.d.ts +8 -0
- package/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/dist/resolution/frameworks/express.js +308 -0
- package/dist/resolution/frameworks/express.js.map +1 -0
- package/dist/resolution/frameworks/fabric.d.ts +3 -0
- package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
- package/dist/resolution/frameworks/fabric.js +354 -0
- package/dist/resolution/frameworks/fabric.js.map +1 -0
- package/dist/resolution/frameworks/go.d.ts +8 -0
- package/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/dist/resolution/frameworks/go.js +161 -0
- package/dist/resolution/frameworks/go.js.map +1 -0
- package/dist/resolution/frameworks/goframe.d.ts +41 -0
- package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
- package/dist/resolution/frameworks/goframe.js +112 -0
- package/dist/resolution/frameworks/goframe.js.map +1 -0
- package/dist/resolution/frameworks/index.d.ts +50 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/resolution/frameworks/index.js +169 -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 +509 -0
- package/dist/resolution/frameworks/java.js.map +1 -0
- package/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/dist/resolution/frameworks/laravel.js +257 -0
- package/dist/resolution/frameworks/laravel.js.map +1 -0
- package/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/dist/resolution/frameworks/nestjs.js +698 -0
- package/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/dist/resolution/frameworks/play.d.ts +19 -0
- package/dist/resolution/frameworks/play.d.ts.map +1 -0
- package/dist/resolution/frameworks/play.js +111 -0
- package/dist/resolution/frameworks/play.js.map +1 -0
- package/dist/resolution/frameworks/python.d.ts +10 -0
- package/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/dist/resolution/frameworks/python.js +400 -0
- package/dist/resolution/frameworks/python.js.map +1 -0
- package/dist/resolution/frameworks/react-native.d.ts +3 -0
- package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
- package/dist/resolution/frameworks/react-native.js +410 -0
- package/dist/resolution/frameworks/react-native.js.map +1 -0
- package/dist/resolution/frameworks/react.d.ts +8 -0
- package/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/dist/resolution/frameworks/react.js +334 -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 +253 -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 +303 -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/goframe-synthesizer.d.ts +28 -0
- package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
- package/dist/resolution/goframe-synthesizer.js +158 -0
- package/dist/resolution/goframe-synthesizer.js.map +1 -0
- package/dist/resolution/import-resolver.d.ts +78 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -0
- package/dist/resolution/import-resolver.js +1849 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +196 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +1328 -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 +93 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +1212 -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 +443 -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 +233 -0
- package/dist/resolution/types.d.ts.map +1 -0
- package/dist/resolution/types.js +8 -0
- package/dist/resolution/types.js.map +1 -0
- package/dist/resolution/workspace-packages.d.ts +48 -0
- package/dist/resolution/workspace-packages.d.ts.map +1 -0
- package/dist/resolution/workspace-packages.js +208 -0
- package/dist/resolution/workspace-packages.js.map +1 -0
- package/dist/search/query-parser.d.ts +57 -0
- package/dist/search/query-parser.d.ts.map +1 -0
- package/dist/search/query-parser.js +177 -0
- package/dist/search/query-parser.js.map +1 -0
- package/dist/search/query-utils.d.ts +87 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +449 -0
- package/dist/search/query-utils.js.map +1 -0
- package/dist/sync/git-hooks.d.ts +45 -0
- package/dist/sync/git-hooks.d.ts.map +1 -0
- package/dist/sync/git-hooks.js +225 -0
- package/dist/sync/git-hooks.js.map +1 -0
- package/dist/sync/index.d.ts +19 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +35 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/watch-policy.d.ts +48 -0
- package/dist/sync/watch-policy.d.ts.map +1 -0
- package/dist/sync/watch-policy.js +124 -0
- package/dist/sync/watch-policy.js.map +1 -0
- package/dist/sync/watcher.d.ts +350 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +811 -0
- package/dist/sync/watcher.js.map +1 -0
- package/dist/sync/worktree.d.ts +54 -0
- package/dist/sync/worktree.d.ts.map +1 -0
- package/dist/sync/worktree.js +137 -0
- package/dist/sync/worktree.js.map +1 -0
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +541 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/timeline/bash-semantics.d.ts +52 -0
- package/dist/timeline/bash-semantics.d.ts.map +1 -0
- package/dist/timeline/bash-semantics.js +376 -0
- package/dist/timeline/bash-semantics.js.map +1 -0
- package/dist/timeline/cli.d.ts +50 -0
- package/dist/timeline/cli.d.ts.map +1 -0
- package/dist/timeline/cli.js +367 -0
- package/dist/timeline/cli.js.map +1 -0
- package/dist/timeline/constants.d.ts +62 -0
- package/dist/timeline/constants.d.ts.map +1 -0
- package/dist/timeline/constants.js +73 -0
- package/dist/timeline/constants.js.map +1 -0
- package/dist/timeline/errors.d.ts +27 -0
- package/dist/timeline/errors.d.ts.map +1 -0
- package/dist/timeline/errors.js +51 -0
- package/dist/timeline/errors.js.map +1 -0
- package/dist/timeline/hook-runner.d.ts +36 -0
- package/dist/timeline/hook-runner.d.ts.map +1 -0
- package/dist/timeline/hook-runner.js +61 -0
- package/dist/timeline/hook-runner.js.map +1 -0
- package/dist/timeline/hooks.d.ts +45 -0
- package/dist/timeline/hooks.d.ts.map +1 -0
- package/dist/timeline/hooks.js +364 -0
- package/dist/timeline/hooks.js.map +1 -0
- package/dist/timeline/index.d.ts +12 -0
- package/dist/timeline/index.d.ts.map +1 -0
- package/dist/timeline/index.js +28 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/indexer.d.ts +37 -0
- package/dist/timeline/indexer.d.ts.map +1 -0
- package/dist/timeline/indexer.js +76 -0
- package/dist/timeline/indexer.js.map +1 -0
- package/dist/timeline/installer.d.ts +33 -0
- package/dist/timeline/installer.d.ts.map +1 -0
- package/dist/timeline/installer.js +255 -0
- package/dist/timeline/installer.js.map +1 -0
- package/dist/timeline/payload.d.ts +31 -0
- package/dist/timeline/payload.d.ts.map +1 -0
- package/dist/timeline/payload.js +58 -0
- package/dist/timeline/payload.js.map +1 -0
- package/dist/timeline/post-tool-summary.d.ts +29 -0
- package/dist/timeline/post-tool-summary.d.ts.map +1 -0
- package/dist/timeline/post-tool-summary.js +190 -0
- package/dist/timeline/post-tool-summary.js.map +1 -0
- package/dist/timeline/recorder.d.ts +36 -0
- package/dist/timeline/recorder.d.ts.map +1 -0
- package/dist/timeline/recorder.js +42 -0
- package/dist/timeline/recorder.js.map +1 -0
- package/dist/timeline/schema-bootstrap.d.ts +42 -0
- package/dist/timeline/schema-bootstrap.d.ts.map +1 -0
- package/dist/timeline/schema-bootstrap.js +81 -0
- package/dist/timeline/schema-bootstrap.js.map +1 -0
- package/dist/timeline/schema.sql +37 -0
- package/dist/timeline/store.d.ts +69 -0
- package/dist/timeline/store.d.ts.map +1 -0
- package/dist/timeline/store.js +429 -0
- package/dist/timeline/store.js.map +1 -0
- package/dist/timeline/types.d.ts +78 -0
- package/dist/timeline/types.d.ts.map +1 -0
- package/dist/timeline/types.js +9 -0
- package/dist/timeline/types.js.map +1 -0
- package/dist/types.d.ts +392 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +81 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/glyphs.d.ts +42 -0
- package/dist/ui/glyphs.d.ts.map +1 -0
- package/dist/ui/glyphs.js +78 -0
- package/dist/ui/glyphs.js.map +1 -0
- package/dist/ui/shimmer-progress.d.ts +11 -0
- package/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/dist/ui/shimmer-progress.js +90 -0
- package/dist/ui/shimmer-progress.js.map +1 -0
- package/dist/ui/shimmer-worker.d.ts +2 -0
- package/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/dist/ui/shimmer-worker.js +118 -0
- package/dist/ui/shimmer-worker.js.map +1 -0
- package/dist/ui/types.d.ts +17 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +3 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/upgrade/index.d.ts +132 -0
- package/dist/upgrade/index.d.ts.map +1 -0
- package/dist/upgrade/index.js +498 -0
- package/dist/upgrade/index.js.map +1 -0
- package/dist/utils.d.ts +224 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +583 -0
- package/dist/utils.js.map +1 -0
- package/package.json +60 -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/ab-adoption.sh +91 -0
- package/scripts/agent-eval/ab-hook.sh +86 -0
- package/scripts/agent-eval/ab-impl.sh +78 -0
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
- package/scripts/agent-eval/ab-sufficiency.sh +78 -0
- package/scripts/agent-eval/arms-F.sh +21 -0
- package/scripts/agent-eval/arms-matrix.sh +37 -0
- package/scripts/agent-eval/audit.sh +68 -0
- package/scripts/agent-eval/bench-readme.sh +28 -0
- package/scripts/agent-eval/bench-why-repo.sh +22 -0
- package/scripts/agent-eval/block-read-hook.sh +19 -0
- package/scripts/agent-eval/hook-settings.json +15 -0
- package/scripts/agent-eval/itrun.sh +120 -0
- package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
- package/scripts/agent-eval/offload-eval-setup.sh +24 -0
- package/scripts/agent-eval/offload-eval-styles.sh +72 -0
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
- package/scripts/agent-eval/offload-eval.md +76 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -0
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
- package/scripts/agent-eval/parse-run.mjs +45 -0
- package/scripts/agent-eval/parse-session.mjs +93 -0
- package/scripts/agent-eval/probe-context.mjs +21 -0
- package/scripts/agent-eval/probe-explore.mjs +40 -0
- package/scripts/agent-eval/probe-node.mjs +20 -0
- package/scripts/agent-eval/probe-sweep.mjs +119 -0
- package/scripts/agent-eval/probe-trace.mjs +20 -0
- package/scripts/agent-eval/redirect-read-hook.sh +38 -0
- package/scripts/agent-eval/run-agent.sh +34 -0
- package/scripts/agent-eval/run-all.sh +69 -0
- package/scripts/agent-eval/run-arms.sh +56 -0
- package/scripts/agent-eval/seq-matrix.mjs +137 -0
- package/scripts/build-bundle.sh +118 -0
- package/scripts/extract-release-notes.mjs +130 -0
- package/scripts/local-install.sh +41 -0
- package/scripts/npm-sdk.js +75 -0
- package/scripts/npm-shim.js +246 -0
- package/scripts/pack-npm.sh +118 -0
- package/scripts/prepare-release.mjs +270 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CodeGraph
|
|
4
|
+
*
|
|
5
|
+
* A local-first code intelligence system that builds a semantic
|
|
6
|
+
* knowledge graph from any codebase.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
42
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.CodeGraph = exports.MCPServer = exports.LockUnavailableError = exports.FileWatcher = exports.MemoryMonitor = exports.throttle = exports.debounce = exports.processInBatches = exports.FileLock = exports.Mutex = exports.defaultLogger = exports.silentLogger = exports.getLogger = exports.setLogger = exports.ConfigError = exports.VectorError = exports.SearchError = exports.DatabaseError = exports.ParseError = exports.FileError = exports.CodeGraphError = exports.loadAllGrammars = exports.loadGrammarsForLanguages = exports.initGrammars = exports.getSupportedLanguages = exports.isGrammarLoaded = exports.isLanguageSupported = exports.detectLanguage = exports.CGRAPHX_DIR = exports.findNearestCodeGraphRoot = exports.isInitialized = exports.getCodeGraphDir = exports.QueryBuilder = exports.DatabaseConnection = exports.getDatabasePath = void 0;
|
|
46
|
+
const path = __importStar(require("path"));
|
|
47
|
+
const db_1 = require("./db");
|
|
48
|
+
const queries_1 = require("./db/queries");
|
|
49
|
+
const directory_1 = require("./directory");
|
|
50
|
+
const extraction_1 = require("./extraction");
|
|
51
|
+
const resolution_1 = require("./resolution");
|
|
52
|
+
const graph_1 = require("./graph");
|
|
53
|
+
const context_1 = require("./context");
|
|
54
|
+
const utils_1 = require("./utils");
|
|
55
|
+
const sync_1 = require("./sync");
|
|
56
|
+
const extraction_version_1 = require("./extraction/extraction-version");
|
|
57
|
+
const directory_2 = require("./directory");
|
|
58
|
+
const query_utils_1 = require("./search/query-utils");
|
|
59
|
+
const version_1 = require("./mcp/version");
|
|
60
|
+
// Re-export types for consumers
|
|
61
|
+
__exportStar(require("./types"), exports);
|
|
62
|
+
// Storage building blocks for embedded/SDK consumers that drive the graph
|
|
63
|
+
// directly (open a DB, run prepared queries) rather than through the CodeGraph
|
|
64
|
+
// facade. Exposed from the package entry so they no longer require deep imports
|
|
65
|
+
// into dist/ (issue #354).
|
|
66
|
+
var db_2 = require("./db");
|
|
67
|
+
Object.defineProperty(exports, "getDatabasePath", { enumerable: true, get: function () { return db_2.getDatabasePath; } });
|
|
68
|
+
Object.defineProperty(exports, "DatabaseConnection", { enumerable: true, get: function () { return db_2.DatabaseConnection; } });
|
|
69
|
+
var queries_2 = require("./db/queries");
|
|
70
|
+
Object.defineProperty(exports, "QueryBuilder", { enumerable: true, get: function () { return queries_2.QueryBuilder; } });
|
|
71
|
+
var directory_3 = require("./directory");
|
|
72
|
+
Object.defineProperty(exports, "getCodeGraphDir", { enumerable: true, get: function () { return directory_3.getCodeGraphDir; } });
|
|
73
|
+
Object.defineProperty(exports, "isInitialized", { enumerable: true, get: function () { return directory_3.isInitialized; } });
|
|
74
|
+
Object.defineProperty(exports, "findNearestCodeGraphRoot", { enumerable: true, get: function () { return directory_3.findNearestCodeGraphRoot; } });
|
|
75
|
+
Object.defineProperty(exports, "CGRAPHX_DIR", { enumerable: true, get: function () { return directory_3.CGRAPHX_DIR; } });
|
|
76
|
+
var extraction_2 = require("./extraction");
|
|
77
|
+
Object.defineProperty(exports, "detectLanguage", { enumerable: true, get: function () { return extraction_2.detectLanguage; } });
|
|
78
|
+
Object.defineProperty(exports, "isLanguageSupported", { enumerable: true, get: function () { return extraction_2.isLanguageSupported; } });
|
|
79
|
+
Object.defineProperty(exports, "isGrammarLoaded", { enumerable: true, get: function () { return extraction_2.isGrammarLoaded; } });
|
|
80
|
+
Object.defineProperty(exports, "getSupportedLanguages", { enumerable: true, get: function () { return extraction_2.getSupportedLanguages; } });
|
|
81
|
+
Object.defineProperty(exports, "initGrammars", { enumerable: true, get: function () { return extraction_2.initGrammars; } });
|
|
82
|
+
Object.defineProperty(exports, "loadGrammarsForLanguages", { enumerable: true, get: function () { return extraction_2.loadGrammarsForLanguages; } });
|
|
83
|
+
Object.defineProperty(exports, "loadAllGrammars", { enumerable: true, get: function () { return extraction_2.loadAllGrammars; } });
|
|
84
|
+
var errors_1 = require("./errors");
|
|
85
|
+
Object.defineProperty(exports, "CodeGraphError", { enumerable: true, get: function () { return errors_1.CodeGraphError; } });
|
|
86
|
+
Object.defineProperty(exports, "FileError", { enumerable: true, get: function () { return errors_1.FileError; } });
|
|
87
|
+
Object.defineProperty(exports, "ParseError", { enumerable: true, get: function () { return errors_1.ParseError; } });
|
|
88
|
+
Object.defineProperty(exports, "DatabaseError", { enumerable: true, get: function () { return errors_1.DatabaseError; } });
|
|
89
|
+
Object.defineProperty(exports, "SearchError", { enumerable: true, get: function () { return errors_1.SearchError; } });
|
|
90
|
+
Object.defineProperty(exports, "VectorError", { enumerable: true, get: function () { return errors_1.VectorError; } });
|
|
91
|
+
Object.defineProperty(exports, "ConfigError", { enumerable: true, get: function () { return errors_1.ConfigError; } });
|
|
92
|
+
Object.defineProperty(exports, "setLogger", { enumerable: true, get: function () { return errors_1.setLogger; } });
|
|
93
|
+
Object.defineProperty(exports, "getLogger", { enumerable: true, get: function () { return errors_1.getLogger; } });
|
|
94
|
+
Object.defineProperty(exports, "silentLogger", { enumerable: true, get: function () { return errors_1.silentLogger; } });
|
|
95
|
+
Object.defineProperty(exports, "defaultLogger", { enumerable: true, get: function () { return errors_1.defaultLogger; } });
|
|
96
|
+
var utils_2 = require("./utils");
|
|
97
|
+
Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return utils_2.Mutex; } });
|
|
98
|
+
Object.defineProperty(exports, "FileLock", { enumerable: true, get: function () { return utils_2.FileLock; } });
|
|
99
|
+
Object.defineProperty(exports, "processInBatches", { enumerable: true, get: function () { return utils_2.processInBatches; } });
|
|
100
|
+
Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return utils_2.debounce; } });
|
|
101
|
+
Object.defineProperty(exports, "throttle", { enumerable: true, get: function () { return utils_2.throttle; } });
|
|
102
|
+
Object.defineProperty(exports, "MemoryMonitor", { enumerable: true, get: function () { return utils_2.MemoryMonitor; } });
|
|
103
|
+
var sync_2 = require("./sync");
|
|
104
|
+
Object.defineProperty(exports, "FileWatcher", { enumerable: true, get: function () { return sync_2.FileWatcher; } });
|
|
105
|
+
Object.defineProperty(exports, "LockUnavailableError", { enumerable: true, get: function () { return sync_2.LockUnavailableError; } });
|
|
106
|
+
var mcp_1 = require("./mcp");
|
|
107
|
+
Object.defineProperty(exports, "MCPServer", { enumerable: true, get: function () { return mcp_1.MCPServer; } });
|
|
108
|
+
/**
|
|
109
|
+
* Main CodeGraph class
|
|
110
|
+
*
|
|
111
|
+
* Provides the primary interface for interacting with the code knowledge graph.
|
|
112
|
+
*/
|
|
113
|
+
class CodeGraph {
|
|
114
|
+
db;
|
|
115
|
+
queries;
|
|
116
|
+
projectRoot;
|
|
117
|
+
// Assigned via wireLayers() from the constructor (and again on reopen) — the
|
|
118
|
+
// `!` tells TS these are definitely set even though the assignment is one
|
|
119
|
+
// method call away from the constructor body.
|
|
120
|
+
orchestrator;
|
|
121
|
+
resolver;
|
|
122
|
+
graphManager;
|
|
123
|
+
traverser;
|
|
124
|
+
contextBuilder;
|
|
125
|
+
// Mutex for preventing concurrent indexing operations (in-process)
|
|
126
|
+
indexMutex = new utils_1.Mutex();
|
|
127
|
+
// File lock for preventing concurrent writes across processes (CLI, MCP, git hooks)
|
|
128
|
+
fileLock;
|
|
129
|
+
// File watcher for auto-sync on file changes
|
|
130
|
+
watcher = null;
|
|
131
|
+
constructor(db, queries, projectRoot) {
|
|
132
|
+
this.db = db;
|
|
133
|
+
this.queries = queries;
|
|
134
|
+
this.projectRoot = projectRoot;
|
|
135
|
+
this.fileLock = new utils_1.FileLock(path.join((0, directory_2.getCodeGraphDir)(projectRoot), 'cgraphx.lock'));
|
|
136
|
+
this.wireLayers();
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* (Re)build the query/extraction/graph layers over the current `this.queries`
|
|
140
|
+
* (which wraps `this.db`). Factored out of the constructor so `reopenIfReplaced`
|
|
141
|
+
* can rebuild them against a fresh connection without duplicating the wiring.
|
|
142
|
+
* The path-based `fileLock` is independent of the DB handle, so it stays put.
|
|
143
|
+
*/
|
|
144
|
+
wireLayers() {
|
|
145
|
+
// Down-weight the project name as a query term in search ranking — it names
|
|
146
|
+
// the whole repo, not a symbol, so it has no discriminative value (#720).
|
|
147
|
+
try {
|
|
148
|
+
this.queries.setProjectNameTokens((0, query_utils_1.deriveProjectNameTokens)(this.projectRoot));
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
// Best-effort: ranking still works without it.
|
|
152
|
+
}
|
|
153
|
+
this.orchestrator = new extraction_1.ExtractionOrchestrator(this.projectRoot, this.queries);
|
|
154
|
+
this.resolver = (0, resolution_1.createResolver)(this.projectRoot, this.queries);
|
|
155
|
+
this.graphManager = new graph_1.GraphQueryManager(this.queries);
|
|
156
|
+
this.traverser = new graph_1.GraphTraverser(this.queries);
|
|
157
|
+
this.contextBuilder = (0, context_1.createContextBuilder)(this.projectRoot, this.queries, this.traverser);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Heal a stale database handle in place. If `.cgraphx/` was removed and
|
|
161
|
+
* recreated at the SAME path while this instance held the DB open — a git
|
|
162
|
+
* worktree removed and re-added, or `rm -rf .cgraphx` + `cgraphx init` —
|
|
163
|
+
* our open fd points at the now-unlinked inode and can never see the new
|
|
164
|
+
* index, so every query returns the pre-removal snapshot until the process
|
|
165
|
+
* restarts (#925). When that's detected, open the live file at the same path,
|
|
166
|
+
* rebuild the query layers, and swap them IN PLACE, so every holder of this
|
|
167
|
+
* instance (the MCP daemon's default project, cached projectPath connections)
|
|
168
|
+
* heals without a restart. Returns true iff it reopened.
|
|
169
|
+
*
|
|
170
|
+
* POSIX-only in practice: `isReplacedOnDisk` never fires on Windows (an open
|
|
171
|
+
* file can't be unlinked there, and st_ino is unreliable).
|
|
172
|
+
*/
|
|
173
|
+
reopenIfReplaced() {
|
|
174
|
+
if (!this.db.isReplacedOnDisk())
|
|
175
|
+
return false;
|
|
176
|
+
const dbPath = this.db.getPath();
|
|
177
|
+
// Open the live file FIRST — if that throws (e.g. mid-recreate), the old
|
|
178
|
+
// handle stays in place and the caller retries on the next query, rather
|
|
179
|
+
// than leaving this instance with no connection at all.
|
|
180
|
+
const fresh = db_1.DatabaseConnection.open(dbPath);
|
|
181
|
+
const stale = this.db;
|
|
182
|
+
this.db = fresh;
|
|
183
|
+
this.queries = new queries_1.QueryBuilder(fresh.getDb());
|
|
184
|
+
this.wireLayers();
|
|
185
|
+
// Releasing the dead handle also frees the leaked db/-wal/-shm fds that were
|
|
186
|
+
// pinning the unlinked inode (#925).
|
|
187
|
+
try {
|
|
188
|
+
stale.close();
|
|
189
|
+
}
|
|
190
|
+
catch { /* the old inode is gone; closing just frees fds */ }
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
// ===========================================================================
|
|
194
|
+
// Lifecycle Methods
|
|
195
|
+
// ===========================================================================
|
|
196
|
+
/**
|
|
197
|
+
* Initialize a new CodeGraph project
|
|
198
|
+
*
|
|
199
|
+
* Creates the .CodeGraph directory, database, and configuration.
|
|
200
|
+
*
|
|
201
|
+
* @param projectRoot - Path to the project root directory
|
|
202
|
+
* @param options - Initialization options
|
|
203
|
+
* @returns A new CodeGraph instance
|
|
204
|
+
*/
|
|
205
|
+
static async init(projectRoot, options = {}) {
|
|
206
|
+
await (0, extraction_1.initGrammars)();
|
|
207
|
+
const resolvedRoot = path.resolve(projectRoot);
|
|
208
|
+
// Check if already initialized
|
|
209
|
+
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
210
|
+
throw new Error(`cgraphx already initialized in ${resolvedRoot}`);
|
|
211
|
+
}
|
|
212
|
+
// Create directory structure
|
|
213
|
+
(0, directory_1.createDirectory)(resolvedRoot);
|
|
214
|
+
// Initialize database
|
|
215
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
216
|
+
const db = db_1.DatabaseConnection.initialize(dbPath);
|
|
217
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
218
|
+
const instance = new CodeGraph(db, queries, resolvedRoot);
|
|
219
|
+
// Run initial indexing if requested
|
|
220
|
+
if (options.index) {
|
|
221
|
+
await instance.indexAll({ onProgress: options.onProgress });
|
|
222
|
+
}
|
|
223
|
+
return instance;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Initialize synchronously (without indexing)
|
|
227
|
+
*/
|
|
228
|
+
static initSync(projectRoot) {
|
|
229
|
+
const resolvedRoot = path.resolve(projectRoot);
|
|
230
|
+
// Check if already initialized
|
|
231
|
+
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
232
|
+
throw new Error(`cgraphx already initialized in ${resolvedRoot}`);
|
|
233
|
+
}
|
|
234
|
+
// Create directory structure
|
|
235
|
+
(0, directory_1.createDirectory)(resolvedRoot);
|
|
236
|
+
// Initialize database
|
|
237
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
238
|
+
const db = db_1.DatabaseConnection.initialize(dbPath);
|
|
239
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
240
|
+
return new CodeGraph(db, queries, resolvedRoot);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Open an existing CodeGraph project
|
|
244
|
+
*
|
|
245
|
+
* @param projectRoot - Path to the project root directory
|
|
246
|
+
* @param options - Open options
|
|
247
|
+
* @returns A CodeGraph instance
|
|
248
|
+
*/
|
|
249
|
+
static async open(projectRoot, options = {}) {
|
|
250
|
+
await (0, extraction_1.initGrammars)();
|
|
251
|
+
const resolvedRoot = path.resolve(projectRoot);
|
|
252
|
+
// Check if initialized
|
|
253
|
+
if (!(0, directory_1.isInitialized)(resolvedRoot)) {
|
|
254
|
+
throw new Error(`cgraphx not initialized in ${resolvedRoot}. Run init() first.`);
|
|
255
|
+
}
|
|
256
|
+
// Validate directory structure
|
|
257
|
+
const validation = (0, directory_1.validateDirectory)(resolvedRoot);
|
|
258
|
+
if (!validation.valid) {
|
|
259
|
+
throw new Error(`Invalid cgraphx directory: ${validation.errors.join(', ')}`);
|
|
260
|
+
}
|
|
261
|
+
// Open database
|
|
262
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
263
|
+
const db = db_1.DatabaseConnection.open(dbPath);
|
|
264
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
265
|
+
const instance = new CodeGraph(db, queries, resolvedRoot);
|
|
266
|
+
// Sync if requested
|
|
267
|
+
if (options.sync) {
|
|
268
|
+
await instance.sync();
|
|
269
|
+
}
|
|
270
|
+
return instance;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Open synchronously (without sync)
|
|
274
|
+
*/
|
|
275
|
+
static openSync(projectRoot) {
|
|
276
|
+
const resolvedRoot = path.resolve(projectRoot);
|
|
277
|
+
// Check if initialized
|
|
278
|
+
if (!(0, directory_1.isInitialized)(resolvedRoot)) {
|
|
279
|
+
throw new Error(`cgraphx not initialized in ${resolvedRoot}. Run init() first.`);
|
|
280
|
+
}
|
|
281
|
+
// Validate directory structure
|
|
282
|
+
const validation = (0, directory_1.validateDirectory)(resolvedRoot);
|
|
283
|
+
if (!validation.valid) {
|
|
284
|
+
throw new Error(`Invalid cgraphx directory: ${validation.errors.join(', ')}`);
|
|
285
|
+
}
|
|
286
|
+
// Open database
|
|
287
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
288
|
+
const db = db_1.DatabaseConnection.open(dbPath);
|
|
289
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
290
|
+
return new CodeGraph(db, queries, resolvedRoot);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Check if a directory has been initialized as a CodeGraph project
|
|
294
|
+
*/
|
|
295
|
+
static isInitialized(projectRoot) {
|
|
296
|
+
return (0, directory_1.isInitialized)(path.resolve(projectRoot));
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Close the CodeGraph instance and release resources
|
|
300
|
+
*/
|
|
301
|
+
close() {
|
|
302
|
+
this.unwatch();
|
|
303
|
+
// Release file lock if held
|
|
304
|
+
this.fileLock.release();
|
|
305
|
+
this.db.close();
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Get the project root directory
|
|
309
|
+
*/
|
|
310
|
+
getProjectRoot() {
|
|
311
|
+
return this.projectRoot;
|
|
312
|
+
}
|
|
313
|
+
// ===========================================================================
|
|
314
|
+
// Indexing
|
|
315
|
+
// ===========================================================================
|
|
316
|
+
/**
|
|
317
|
+
* Index all files in the project
|
|
318
|
+
*
|
|
319
|
+
* Uses a mutex to prevent concurrent indexing operations.
|
|
320
|
+
*/
|
|
321
|
+
async indexAll(options = {}) {
|
|
322
|
+
return this.indexMutex.withLock(async () => {
|
|
323
|
+
try {
|
|
324
|
+
this.fileLock.acquire();
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
return { success: false, filesIndexed: 0, filesSkipped: 0, filesErrored: 0, nodesCreated: 0, edgesCreated: 0, errors: [{ message: 'Could not acquire file lock - another process may be indexing', severity: 'error' }], durationMs: 0 };
|
|
328
|
+
}
|
|
329
|
+
try {
|
|
330
|
+
const before = this.queries.getNodeAndEdgeCount();
|
|
331
|
+
const result = await this.orchestrator.indexAll(options.onProgress, options.signal, options.verbose);
|
|
332
|
+
// Re-detect frameworks now that the index is populated. The resolver
|
|
333
|
+
// is constructed with createResolver() before any files exist, so
|
|
334
|
+
// framework resolvers whose detect() consults the indexed file list
|
|
335
|
+
// (e.g. UIKit/SwiftUI scanning for imports, swift-objc-bridge looking
|
|
336
|
+
// for both Swift and ObjC files) all return false on that initial pass
|
|
337
|
+
// and silently drop themselves. Re-initializing here gives them a
|
|
338
|
+
// chance to see the actual project before resolution runs.
|
|
339
|
+
if (result.success && result.filesIndexed > 0) {
|
|
340
|
+
this.resolver.initialize();
|
|
341
|
+
// Cross-file finalization (e.g. NestJS RouterModule prefixes). Runs
|
|
342
|
+
// before resolution so updated names show up in subsequent reads.
|
|
343
|
+
this.resolver.runPostExtract();
|
|
344
|
+
}
|
|
345
|
+
// Resolve references to create call/import/extends edges
|
|
346
|
+
if (result.success && result.filesIndexed > 0) {
|
|
347
|
+
// Get count without loading all refs into memory
|
|
348
|
+
const unresolvedCount = this.queries.getUnresolvedReferencesCount();
|
|
349
|
+
options.onProgress?.({
|
|
350
|
+
phase: 'resolving',
|
|
351
|
+
current: 0,
|
|
352
|
+
total: unresolvedCount,
|
|
353
|
+
});
|
|
354
|
+
await this.resolveReferencesBatched((current, total) => {
|
|
355
|
+
options.onProgress?.({
|
|
356
|
+
phase: 'resolving',
|
|
357
|
+
current,
|
|
358
|
+
total,
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
// Second pass: chained calls whose method lives on a supertype the
|
|
362
|
+
// receiver conforms to (protocol-extension / inherited / default-
|
|
363
|
+
// interface). Needs the implements/extends edges the main pass just
|
|
364
|
+
// built, so it runs after resolution (#750).
|
|
365
|
+
this.resolver.resolveChainedCallsViaConformance();
|
|
366
|
+
// Same lifecycle for `this.<member>` callback registrations whose
|
|
367
|
+
// member is inherited from a supertype (#808).
|
|
368
|
+
this.resolver.resolveDeferredThisMemberRefs();
|
|
369
|
+
}
|
|
370
|
+
// Refresh planner stats + checkpoint the WAL after bulk writes.
|
|
371
|
+
// Cheap and non-blocking; never load-bearing for correctness.
|
|
372
|
+
if (result.success && result.filesIndexed > 0) {
|
|
373
|
+
this.db.runMaintenance();
|
|
374
|
+
}
|
|
375
|
+
// The orchestrator only sees extraction-phase counts; resolution and
|
|
376
|
+
// synthesizer edges (often >50% of the graph on JVM repos) come later.
|
|
377
|
+
// Recompute against the DB so the CLI summary reports the true totals.
|
|
378
|
+
if (result.success && result.filesIndexed > 0) {
|
|
379
|
+
const after = this.queries.getNodeAndEdgeCount();
|
|
380
|
+
result.nodesCreated = after.nodes - before.nodes;
|
|
381
|
+
result.edgesCreated = after.edges - before.edges;
|
|
382
|
+
}
|
|
383
|
+
// Stamp the index with the engine that built it, so `cgraphx status`
|
|
384
|
+
// and `cgraphx upgrade` can recommend a re-index when the running
|
|
385
|
+
// engine produces richer extraction than the one on disk. Only on a
|
|
386
|
+
// real full index — a sync touches a subset, so it must NOT advance the
|
|
387
|
+
// extraction stamp (the bulk would still be stale). See extraction-version.ts.
|
|
388
|
+
if (result.success && result.filesIndexed > 0) {
|
|
389
|
+
try {
|
|
390
|
+
this.queries.setMetadata('indexed_with_version', version_1.CodeGraphPackageVersion);
|
|
391
|
+
this.queries.setMetadata('indexed_with_extraction_version', String(extraction_version_1.EXTRACTION_VERSION));
|
|
392
|
+
}
|
|
393
|
+
catch { /* metadata is advisory — never fail an index over it */ }
|
|
394
|
+
}
|
|
395
|
+
return result;
|
|
396
|
+
}
|
|
397
|
+
finally {
|
|
398
|
+
this.fileLock.release();
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Index specific files
|
|
404
|
+
*
|
|
405
|
+
* Uses a mutex to prevent concurrent indexing operations.
|
|
406
|
+
*/
|
|
407
|
+
async indexFiles(filePaths) {
|
|
408
|
+
return this.indexMutex.withLock(async () => {
|
|
409
|
+
try {
|
|
410
|
+
this.fileLock.acquire();
|
|
411
|
+
}
|
|
412
|
+
catch {
|
|
413
|
+
return { success: false, filesIndexed: 0, filesSkipped: 0, filesErrored: 0, nodesCreated: 0, edgesCreated: 0, errors: [{ message: 'Could not acquire file lock - another process may be indexing', severity: 'error' }], durationMs: 0 };
|
|
414
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
return this.orchestrator.indexFiles(filePaths);
|
|
417
|
+
}
|
|
418
|
+
finally {
|
|
419
|
+
this.fileLock.release();
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Sync with current file state (incremental update)
|
|
425
|
+
*
|
|
426
|
+
* Uses a mutex to prevent concurrent indexing operations.
|
|
427
|
+
*/
|
|
428
|
+
async sync(options = {}) {
|
|
429
|
+
return this.indexMutex.withLock(async () => {
|
|
430
|
+
try {
|
|
431
|
+
this.fileLock.acquire();
|
|
432
|
+
}
|
|
433
|
+
catch {
|
|
434
|
+
return { filesChecked: 0, filesAdded: 0, filesModified: 0, filesRemoved: 0, nodesUpdated: 0, durationMs: 0 };
|
|
435
|
+
}
|
|
436
|
+
try {
|
|
437
|
+
const result = await this.orchestrator.sync(options.onProgress);
|
|
438
|
+
// Cross-file finalization (e.g. NestJS RouterModule prefixes). Run on
|
|
439
|
+
// every sync that touched files so edits to `app.module.ts` propagate
|
|
440
|
+
// to controllers in unchanged files. The pass is idempotent and cheap
|
|
441
|
+
// (regex over *.module.ts only).
|
|
442
|
+
if (result.filesAdded > 0 || result.filesModified > 0) {
|
|
443
|
+
this.resolver.runPostExtract();
|
|
444
|
+
}
|
|
445
|
+
// Resolve references if files were updated
|
|
446
|
+
if (result.filesAdded > 0 || result.filesModified > 0) {
|
|
447
|
+
if (result.changedFilePaths) {
|
|
448
|
+
// Scope resolution to changed files (git fast path — bounded set)
|
|
449
|
+
const unresolvedRefs = this.queries.getUnresolvedReferencesByFiles(result.changedFilePaths);
|
|
450
|
+
options.onProgress?.({
|
|
451
|
+
phase: 'resolving',
|
|
452
|
+
current: 0,
|
|
453
|
+
total: unresolvedRefs.length,
|
|
454
|
+
});
|
|
455
|
+
this.resolver.resolveAndPersist(unresolvedRefs, (current, total) => {
|
|
456
|
+
options.onProgress?.({
|
|
457
|
+
phase: 'resolving',
|
|
458
|
+
current,
|
|
459
|
+
total,
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
// No git info — use batched resolution to avoid OOM
|
|
465
|
+
const unresolvedCount = this.queries.getUnresolvedReferencesCount();
|
|
466
|
+
options.onProgress?.({
|
|
467
|
+
phase: 'resolving',
|
|
468
|
+
current: 0,
|
|
469
|
+
total: unresolvedCount,
|
|
470
|
+
});
|
|
471
|
+
await this.resolveReferencesBatched((current, total) => {
|
|
472
|
+
options.onProgress?.({
|
|
473
|
+
phase: 'resolving',
|
|
474
|
+
current,
|
|
475
|
+
total,
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
// Second pass: chained calls whose method lives on a supertype the
|
|
480
|
+
// receiver conforms to (protocol-extension / inherited). Needs the
|
|
481
|
+
// implements/extends edges built above (#750).
|
|
482
|
+
this.resolver.resolveChainedCallsViaConformance();
|
|
483
|
+
// Same lifecycle for `this.<member>` callback registrations whose
|
|
484
|
+
// member is inherited from a supertype (#808).
|
|
485
|
+
this.resolver.resolveDeferredThisMemberRefs();
|
|
486
|
+
}
|
|
487
|
+
// Refresh planner stats + checkpoint the WAL after bulk writes.
|
|
488
|
+
if (result.filesAdded > 0 || result.filesModified > 0 || result.filesRemoved > 0) {
|
|
489
|
+
this.db.runMaintenance();
|
|
490
|
+
}
|
|
491
|
+
return result;
|
|
492
|
+
}
|
|
493
|
+
finally {
|
|
494
|
+
this.fileLock.release();
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Check if an indexing operation is currently in progress
|
|
500
|
+
*/
|
|
501
|
+
isIndexing() {
|
|
502
|
+
return this.indexMutex.isLocked();
|
|
503
|
+
}
|
|
504
|
+
// ===========================================================================
|
|
505
|
+
// File Watching
|
|
506
|
+
// ===========================================================================
|
|
507
|
+
/**
|
|
508
|
+
* Start watching for file changes and auto-syncing.
|
|
509
|
+
*
|
|
510
|
+
* Uses native OS file events (FSEvents on macOS, inotify on Linux 19+,
|
|
511
|
+
* ReadDirectoryChangesW on Windows) with debouncing to avoid thrashing.
|
|
512
|
+
*
|
|
513
|
+
* @param options - Watch options (debounce delay, callbacks)
|
|
514
|
+
* @returns true if watching started successfully
|
|
515
|
+
*/
|
|
516
|
+
watch(options = {}) {
|
|
517
|
+
if (this.watcher?.isActive())
|
|
518
|
+
return true;
|
|
519
|
+
this.watcher = new sync_1.FileWatcher(this.projectRoot, async () => {
|
|
520
|
+
const result = await this.sync();
|
|
521
|
+
// sync() returns this exact zero-shape iff it failed to acquire the
|
|
522
|
+
// file lock (a real empty sync always has filesChecked > 0 because
|
|
523
|
+
// scanDirectory ran). Surface that to the watcher as a typed error
|
|
524
|
+
// so it keeps pendingFiles + reschedules instead of clearing them
|
|
525
|
+
// (#449).
|
|
526
|
+
if (result.filesChecked === 0 && result.durationMs === 0) {
|
|
527
|
+
throw new sync_1.LockUnavailableError();
|
|
528
|
+
}
|
|
529
|
+
const filesChanged = result.filesAdded + result.filesModified + result.filesRemoved;
|
|
530
|
+
return { filesChanged, durationMs: result.durationMs };
|
|
531
|
+
}, options);
|
|
532
|
+
return this.watcher.start();
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Stop watching for file changes.
|
|
536
|
+
*/
|
|
537
|
+
unwatch() {
|
|
538
|
+
if (this.watcher) {
|
|
539
|
+
this.watcher.stop();
|
|
540
|
+
this.watcher = null;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Check if the file watcher is active.
|
|
545
|
+
*/
|
|
546
|
+
isWatching() {
|
|
547
|
+
return this.watcher?.isActive() ?? false;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* True once live watching has permanently degraded (OS watch-resource
|
|
551
|
+
* exhaustion, or a write lock held past the retry budget) and auto-sync is
|
|
552
|
+
* disabled until the next {@link watch} call. Distinct from `!isWatching()`:
|
|
553
|
+
* a stopped/never-started watcher is inactive but NOT degraded. MCP tools use
|
|
554
|
+
* this to surface a whole-index "results may be stale" notice, since
|
|
555
|
+
* `getPendingFiles()` goes empty once watching stops (#876).
|
|
556
|
+
*/
|
|
557
|
+
isWatcherDegraded() {
|
|
558
|
+
return this.watcher?.isDegraded() ?? false;
|
|
559
|
+
}
|
|
560
|
+
/** The reason live watching degraded, or null if it is healthy (#876). */
|
|
561
|
+
getWatcherDegradedReason() {
|
|
562
|
+
return this.watcher?.getDegradedReason() ?? null;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Files seen by the file watcher since the last successful sync —
|
|
566
|
+
* the per-file "stale" signal MCP tools attach to responses so an agent
|
|
567
|
+
* can fall back to {@link Read} for just the affected file without
|
|
568
|
+
* waiting for a debounced sync to complete (issue #403).
|
|
569
|
+
*
|
|
570
|
+
* Returns an empty list when the watcher isn't active, or no events have
|
|
571
|
+
* arrived. Each entry includes `firstSeenMs` and `lastSeenMs` (wall-clock
|
|
572
|
+
* `Date.now()` values) so callers can render "edited Nms ago", plus an
|
|
573
|
+
* `indexing` flag indicating whether the in-flight sync (if any) will
|
|
574
|
+
* absorb that file.
|
|
575
|
+
*/
|
|
576
|
+
getPendingFiles() {
|
|
577
|
+
return this.watcher?.getPendingFiles() ?? [];
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Resolves once the file watcher has installed its watch set. Useful for
|
|
581
|
+
* tests that need a deterministic boundary before asserting on
|
|
582
|
+
* `getPendingFiles()`. Resolves immediately when no watcher is active.
|
|
583
|
+
*/
|
|
584
|
+
waitUntilWatcherReady(timeoutMs) {
|
|
585
|
+
return this.watcher ? this.watcher.waitUntilReady(timeoutMs) : Promise.resolve();
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Get files that have changed since last index
|
|
589
|
+
*/
|
|
590
|
+
getChangedFiles() {
|
|
591
|
+
return this.orchestrator.getChangedFiles();
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Most recent index timestamp (ms since epoch) across all tracked files, or
|
|
595
|
+
* null when nothing is indexed yet. Lets library consumers check index
|
|
596
|
+
* freshness without shelling out to `cgraphx status --json`. (#329)
|
|
597
|
+
*/
|
|
598
|
+
getLastIndexedAt() {
|
|
599
|
+
return this.queries.getLastIndexedAt();
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Which engine built the current index: the package version + extraction
|
|
603
|
+
* version stamped at the last full `indexAll`. Either field is null for an
|
|
604
|
+
* index built before stamping existed (treated as stale). See
|
|
605
|
+
* `extraction-version.ts` and `isIndexStale()`.
|
|
606
|
+
*/
|
|
607
|
+
getIndexBuildInfo() {
|
|
608
|
+
const version = this.queries.getMetadata('indexed_with_version');
|
|
609
|
+
const ev = this.queries.getMetadata('indexed_with_extraction_version');
|
|
610
|
+
const parsed = ev != null ? parseInt(ev, 10) : NaN;
|
|
611
|
+
return { version, extractionVersion: Number.isFinite(parsed) ? parsed : null };
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* True when the on-disk index was built by an engine whose extraction is
|
|
615
|
+
* older than the one now running — i.e. a re-index would add data a migration
|
|
616
|
+
* can't backfill. False when there's no index yet (nothing to refresh) or the
|
|
617
|
+
* stamp is current. This is the signal behind `cgraphx status`'s re-index
|
|
618
|
+
* hint and `cgraphx upgrade`'s reminder.
|
|
619
|
+
*/
|
|
620
|
+
isIndexStale() {
|
|
621
|
+
if (this.queries.getLastIndexedAt() == null)
|
|
622
|
+
return false;
|
|
623
|
+
const { extractionVersion } = this.getIndexBuildInfo();
|
|
624
|
+
return extractionVersion == null || extractionVersion < extraction_version_1.EXTRACTION_VERSION;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Extract nodes and edges from source code (without storing)
|
|
628
|
+
*/
|
|
629
|
+
extractFromSource(filePath, source) {
|
|
630
|
+
return (0, extraction_1.extractFromSource)(filePath, source);
|
|
631
|
+
}
|
|
632
|
+
// ===========================================================================
|
|
633
|
+
// Reference Resolution
|
|
634
|
+
// ===========================================================================
|
|
635
|
+
/**
|
|
636
|
+
* Resolve unresolved references and create edges
|
|
637
|
+
*
|
|
638
|
+
* This method takes unresolved references from extraction and attempts
|
|
639
|
+
* to resolve them using multiple strategies:
|
|
640
|
+
* - Framework-specific patterns (React, Express, Laravel)
|
|
641
|
+
* - Import-based resolution
|
|
642
|
+
* - Name-based symbol matching
|
|
643
|
+
*/
|
|
644
|
+
resolveReferences(onProgress) {
|
|
645
|
+
// Get all unresolved references from the database
|
|
646
|
+
const unresolvedRefs = this.queries.getUnresolvedReferences();
|
|
647
|
+
return this.resolver.resolveAndPersist(unresolvedRefs, onProgress);
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Resolve references in batches to keep memory bounded on large codebases.
|
|
651
|
+
* Processes chunks of unresolved refs, persisting results after each batch.
|
|
652
|
+
*/
|
|
653
|
+
async resolveReferencesBatched(onProgress) {
|
|
654
|
+
return this.resolver.resolveAndPersistBatched(onProgress);
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Get detected frameworks in the project
|
|
658
|
+
*/
|
|
659
|
+
getDetectedFrameworks() {
|
|
660
|
+
return this.resolver.getDetectedFrameworks();
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Re-initialize the resolver (useful after adding new files)
|
|
664
|
+
*/
|
|
665
|
+
reinitializeResolver() {
|
|
666
|
+
this.resolver.initialize();
|
|
667
|
+
}
|
|
668
|
+
// ===========================================================================
|
|
669
|
+
// Graph Statistics
|
|
670
|
+
// ===========================================================================
|
|
671
|
+
/**
|
|
672
|
+
* Get statistics about the knowledge graph
|
|
673
|
+
*/
|
|
674
|
+
getStats() {
|
|
675
|
+
const stats = this.queries.getStats();
|
|
676
|
+
stats.dbSizeBytes = this.db.getSize();
|
|
677
|
+
return stats;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Active SQLite backend for this project's connection (`node-sqlite` — Node's
|
|
681
|
+
* built-in real-SQLite module). Surfaced via `cgraphx status` and the
|
|
682
|
+
* `codegraph_status` MCP tool alongside the effective journal mode.
|
|
683
|
+
*/
|
|
684
|
+
getBackend() {
|
|
685
|
+
return this.db.getBackend();
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* The journal mode actually in effect ('wal', 'delete', …). 'wal' means
|
|
689
|
+
* readers never block on a concurrent writer; anything else means they can,
|
|
690
|
+
* which is the precondition for the "database is locked" failures in issue
|
|
691
|
+
* #238. Surfaced via `codegraph status` and the `codegraph_status` MCP tool.
|
|
692
|
+
*/
|
|
693
|
+
getJournalMode() {
|
|
694
|
+
return this.db.getJournalMode();
|
|
695
|
+
}
|
|
696
|
+
// ===========================================================================
|
|
697
|
+
// Node Operations
|
|
698
|
+
// ===========================================================================
|
|
699
|
+
/**
|
|
700
|
+
* Get a node by ID
|
|
701
|
+
*/
|
|
702
|
+
getNode(id) {
|
|
703
|
+
return this.queries.getNodeById(id);
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Get all nodes in a file
|
|
707
|
+
*/
|
|
708
|
+
getNodesInFile(filePath) {
|
|
709
|
+
return this.queries.getNodesByFile(filePath);
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Get all nodes of a specific kind
|
|
713
|
+
*/
|
|
714
|
+
getNodesByKind(kind) {
|
|
715
|
+
return this.queries.getNodesByKind(kind);
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Get ALL nodes with an exact name (direct index lookup, not FTS-ranked/capped).
|
|
719
|
+
* Used to enumerate every overload of a heavily-overloaded name so the specific
|
|
720
|
+
* definition the caller wants is never dropped below a search cut.
|
|
721
|
+
*/
|
|
722
|
+
getNodesByName(name) {
|
|
723
|
+
return this.queries.getNodesByName(name);
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Search nodes by text
|
|
727
|
+
*/
|
|
728
|
+
searchNodes(query, options) {
|
|
729
|
+
return this.queries.searchNodes(query, options);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Normalized project-name tokens (go.mod / package.json / repo dir) used to
|
|
733
|
+
* down-weight the non-discriminative project name in search ranking (#720).
|
|
734
|
+
* Exposed so explore can exclude it from the PascalCase type-disambiguation
|
|
735
|
+
* bias, which would otherwise pull overloaded tokens toward whichever stack
|
|
736
|
+
* embeds the project name.
|
|
737
|
+
*/
|
|
738
|
+
getProjectNameTokens() {
|
|
739
|
+
return this.queries.getProjectNameTokens();
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Find the project's "primary route file" — the file with the densest
|
|
743
|
+
* concentration of framework-emitted `route` nodes (≥3 routes, ≥30%
|
|
744
|
+
* of all non-test routes). Used to inline the routing config in
|
|
745
|
+
* `codegraph_explore` responses on small realworld template repos
|
|
746
|
+
* (rails-realworld, laravel-realworld, drupal-admintoolbar, …) where
|
|
747
|
+
* Glob+Read of `routes.rb`/`urls.py`/etc. otherwise beats codegraph.
|
|
748
|
+
*/
|
|
749
|
+
getTopRouteFile() {
|
|
750
|
+
return this.queries.getTopRouteFile();
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Build a URL → handler routing manifest from the index. Each entry
|
|
754
|
+
* pairs a route node (URL + method) with its handler function/method
|
|
755
|
+
* via the `references` edge that framework resolvers emit. Returns
|
|
756
|
+
* null when fewer than 3 valid (non-test) routes exist.
|
|
757
|
+
*/
|
|
758
|
+
getRoutingManifest(limit) {
|
|
759
|
+
return this.queries.getRoutingManifest(limit);
|
|
760
|
+
}
|
|
761
|
+
// ===========================================================================
|
|
762
|
+
// Edge Operations
|
|
763
|
+
// ===========================================================================
|
|
764
|
+
/**
|
|
765
|
+
* Get outgoing edges from a node
|
|
766
|
+
*/
|
|
767
|
+
getOutgoingEdges(nodeId) {
|
|
768
|
+
return this.queries.getOutgoingEdges(nodeId);
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Get incoming edges to a node
|
|
772
|
+
*/
|
|
773
|
+
getIncomingEdges(nodeId) {
|
|
774
|
+
return this.queries.getIncomingEdges(nodeId);
|
|
775
|
+
}
|
|
776
|
+
// ===========================================================================
|
|
777
|
+
// File Operations
|
|
778
|
+
// ===========================================================================
|
|
779
|
+
/**
|
|
780
|
+
* Get a file record by path
|
|
781
|
+
*/
|
|
782
|
+
getFile(filePath) {
|
|
783
|
+
return this.queries.getFileByPath(filePath);
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Get all tracked files
|
|
787
|
+
*/
|
|
788
|
+
getFiles() {
|
|
789
|
+
return this.queries.getAllFiles();
|
|
790
|
+
}
|
|
791
|
+
// ===========================================================================
|
|
792
|
+
// Graph Query Methods
|
|
793
|
+
// ===========================================================================
|
|
794
|
+
/**
|
|
795
|
+
* Get the context for a node (ancestors, children, references)
|
|
796
|
+
*
|
|
797
|
+
* Returns comprehensive context about a node including its containment
|
|
798
|
+
* hierarchy, children, incoming/outgoing references, type information,
|
|
799
|
+
* and relevant imports.
|
|
800
|
+
*
|
|
801
|
+
* @param nodeId - ID of the focal node
|
|
802
|
+
* @returns Context object with all related information
|
|
803
|
+
*/
|
|
804
|
+
getContext(nodeId) {
|
|
805
|
+
return this.graphManager.getContext(nodeId);
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Traverse the graph from a starting node
|
|
809
|
+
*
|
|
810
|
+
* Uses breadth-first search by default. Supports filtering by edge types,
|
|
811
|
+
* node types, and traversal direction.
|
|
812
|
+
*
|
|
813
|
+
* @param startId - Starting node ID
|
|
814
|
+
* @param options - Traversal options
|
|
815
|
+
* @returns Subgraph containing traversed nodes and edges
|
|
816
|
+
*/
|
|
817
|
+
traverse(startId, options) {
|
|
818
|
+
return this.traverser.traverseBFS(startId, options);
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Get the call graph for a function
|
|
822
|
+
*
|
|
823
|
+
* Returns both callers (functions that call this function) and
|
|
824
|
+
* callees (functions called by this function) up to the specified depth.
|
|
825
|
+
*
|
|
826
|
+
* @param nodeId - ID of the function/method node
|
|
827
|
+
* @param depth - Maximum depth in each direction (default: 2)
|
|
828
|
+
* @returns Subgraph containing the call graph
|
|
829
|
+
*/
|
|
830
|
+
getCallGraph(nodeId, depth = 2) {
|
|
831
|
+
return this.traverser.getCallGraph(nodeId, depth);
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Get the type hierarchy for a class/interface
|
|
835
|
+
*
|
|
836
|
+
* Returns both ancestors (types this extends/implements) and
|
|
837
|
+
* descendants (types that extend/implement this).
|
|
838
|
+
*
|
|
839
|
+
* @param nodeId - ID of the class/interface node
|
|
840
|
+
* @returns Subgraph containing the type hierarchy
|
|
841
|
+
*/
|
|
842
|
+
getTypeHierarchy(nodeId) {
|
|
843
|
+
return this.traverser.getTypeHierarchy(nodeId);
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Find all usages of a symbol
|
|
847
|
+
*
|
|
848
|
+
* Returns all nodes that reference the specified symbol through
|
|
849
|
+
* any edge type (calls, references, type_of, etc.).
|
|
850
|
+
*
|
|
851
|
+
* @param nodeId - ID of the symbol node
|
|
852
|
+
* @returns Array of nodes and edges that reference this symbol
|
|
853
|
+
*/
|
|
854
|
+
findUsages(nodeId) {
|
|
855
|
+
return this.traverser.findUsages(nodeId);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Get callers of a function/method
|
|
859
|
+
*
|
|
860
|
+
* @param nodeId - ID of the function/method node
|
|
861
|
+
* @param maxDepth - Maximum depth to traverse (default: 1)
|
|
862
|
+
* @returns Array of nodes that call this function
|
|
863
|
+
*/
|
|
864
|
+
getCallers(nodeId, maxDepth = 1) {
|
|
865
|
+
return this.traverser.getCallers(nodeId, maxDepth);
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Get callees of a function/method
|
|
869
|
+
*
|
|
870
|
+
* @param nodeId - ID of the function/method node
|
|
871
|
+
* @param maxDepth - Maximum depth to traverse (default: 1)
|
|
872
|
+
* @returns Array of nodes called by this function
|
|
873
|
+
*/
|
|
874
|
+
getCallees(nodeId, maxDepth = 1) {
|
|
875
|
+
return this.traverser.getCallees(nodeId, maxDepth);
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Calculate the impact radius of a node
|
|
879
|
+
*
|
|
880
|
+
* Returns all nodes that could be affected by changes to this node.
|
|
881
|
+
*
|
|
882
|
+
* @param nodeId - ID of the node
|
|
883
|
+
* @param maxDepth - Maximum depth to traverse (default: 3)
|
|
884
|
+
* @returns Subgraph containing potentially impacted nodes
|
|
885
|
+
*/
|
|
886
|
+
getImpactRadius(nodeId, maxDepth = 3) {
|
|
887
|
+
return this.traverser.getImpactRadius(nodeId, maxDepth);
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Find the shortest path between two nodes
|
|
891
|
+
*
|
|
892
|
+
* @param fromId - Starting node ID
|
|
893
|
+
* @param toId - Target node ID
|
|
894
|
+
* @param edgeKinds - Edge types to consider (all if empty)
|
|
895
|
+
* @returns Array of nodes and edges forming the path, or null if no path exists
|
|
896
|
+
*/
|
|
897
|
+
findPath(fromId, toId, edgeKinds) {
|
|
898
|
+
return this.traverser.findPath(fromId, toId, edgeKinds);
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Get ancestors of a node in the containment hierarchy
|
|
902
|
+
*
|
|
903
|
+
* @param nodeId - ID of the node
|
|
904
|
+
* @returns Array of ancestor nodes from immediate parent to root
|
|
905
|
+
*/
|
|
906
|
+
getAncestors(nodeId) {
|
|
907
|
+
return this.traverser.getAncestors(nodeId);
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Get immediate children of a node
|
|
911
|
+
*
|
|
912
|
+
* @param nodeId - ID of the node
|
|
913
|
+
* @returns Array of child nodes
|
|
914
|
+
*/
|
|
915
|
+
getChildren(nodeId) {
|
|
916
|
+
return this.traverser.getChildren(nodeId);
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Get dependencies of a file
|
|
920
|
+
*
|
|
921
|
+
* @param filePath - Path to the file
|
|
922
|
+
* @returns Array of file paths this file depends on
|
|
923
|
+
*/
|
|
924
|
+
getFileDependencies(filePath) {
|
|
925
|
+
return this.graphManager.getFileDependencies(filePath);
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Get dependents of a file
|
|
929
|
+
*
|
|
930
|
+
* @param filePath - Path to the file
|
|
931
|
+
* @returns Array of file paths that depend on this file
|
|
932
|
+
*/
|
|
933
|
+
getFileDependents(filePath) {
|
|
934
|
+
return this.graphManager.getFileDependents(filePath);
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Find circular dependencies in the codebase
|
|
938
|
+
*
|
|
939
|
+
* @returns Array of cycles, each cycle is an array of file paths
|
|
940
|
+
*/
|
|
941
|
+
findCircularDependencies() {
|
|
942
|
+
return this.graphManager.findCircularDependencies();
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Find dead code (unreferenced symbols)
|
|
946
|
+
*
|
|
947
|
+
* @param kinds - Node kinds to check (default: functions, methods, classes)
|
|
948
|
+
* @returns Array of unreferenced nodes
|
|
949
|
+
*/
|
|
950
|
+
findDeadCode(kinds) {
|
|
951
|
+
return this.graphManager.findDeadCode(kinds);
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Get complexity metrics for a node
|
|
955
|
+
*
|
|
956
|
+
* @param nodeId - ID of the node
|
|
957
|
+
* @returns Object containing various complexity metrics
|
|
958
|
+
*/
|
|
959
|
+
getNodeMetrics(nodeId) {
|
|
960
|
+
return this.graphManager.getNodeMetrics(nodeId);
|
|
961
|
+
}
|
|
962
|
+
// ===========================================================================
|
|
963
|
+
// Context Building
|
|
964
|
+
// ===========================================================================
|
|
965
|
+
/**
|
|
966
|
+
* Get the source code for a node
|
|
967
|
+
*
|
|
968
|
+
* Reads the file and extracts the code between startLine and endLine.
|
|
969
|
+
*
|
|
970
|
+
* @param nodeId - ID of the node
|
|
971
|
+
* @returns Code string or null if not found
|
|
972
|
+
*/
|
|
973
|
+
async getCode(nodeId) {
|
|
974
|
+
return this.contextBuilder.getCode(nodeId);
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* Find relevant subgraph for a query
|
|
978
|
+
*
|
|
979
|
+
* Combines semantic search with graph traversal to find the most
|
|
980
|
+
* relevant nodes and their relationships for a given query.
|
|
981
|
+
*
|
|
982
|
+
* @param query - Natural language query describing the task
|
|
983
|
+
* @param options - Search and traversal options
|
|
984
|
+
* @returns Subgraph of relevant nodes and edges
|
|
985
|
+
*/
|
|
986
|
+
async findRelevantContext(query, options) {
|
|
987
|
+
return this.contextBuilder.findRelevantContext(query, options);
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Build context for a task
|
|
991
|
+
*
|
|
992
|
+
* Creates comprehensive context by:
|
|
993
|
+
* 1. Running FTS search to find entry points
|
|
994
|
+
* 2. Expanding the graph around entry points
|
|
995
|
+
* 3. Extracting code blocks for key nodes
|
|
996
|
+
* 4. Formatting output for Claude
|
|
997
|
+
*
|
|
998
|
+
* @param input - Task description (string or {title, description})
|
|
999
|
+
* @param options - Build options (maxNodes, includeCode, format, etc.)
|
|
1000
|
+
* @returns TaskContext object or formatted string (markdown/JSON)
|
|
1001
|
+
*/
|
|
1002
|
+
async buildContext(input, options) {
|
|
1003
|
+
return this.contextBuilder.buildContext(input, options);
|
|
1004
|
+
}
|
|
1005
|
+
// ===========================================================================
|
|
1006
|
+
// Database Management
|
|
1007
|
+
// ===========================================================================
|
|
1008
|
+
/**
|
|
1009
|
+
* Optimize the database (vacuum and analyze)
|
|
1010
|
+
*/
|
|
1011
|
+
optimize() {
|
|
1012
|
+
this.db.optimize();
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Clear all data from the graph
|
|
1016
|
+
*/
|
|
1017
|
+
clear() {
|
|
1018
|
+
this.queries.clear();
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Alias for close() for backwards compatibility.
|
|
1022
|
+
* @deprecated Use close() instead
|
|
1023
|
+
*/
|
|
1024
|
+
destroy() {
|
|
1025
|
+
this.close();
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Completely remove CodeGraph from the project.
|
|
1029
|
+
* This closes the database and deletes the .CodeGraph directory.
|
|
1030
|
+
*
|
|
1031
|
+
* WARNING: This permanently deletes all CodeGraph data for the project.
|
|
1032
|
+
*/
|
|
1033
|
+
uninitialize() {
|
|
1034
|
+
this.close();
|
|
1035
|
+
(0, directory_1.removeDirectory)(this.projectRoot);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
exports.CodeGraph = CodeGraph;
|
|
1039
|
+
// Default export
|
|
1040
|
+
exports.default = CodeGraph;
|
|
1041
|
+
//# sourceMappingURL=index.js.map
|