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
|
@@ -0,0 +1,727 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Function-as-value capture (#756) — registration-linking for callbacks.
|
|
4
|
+
*
|
|
5
|
+
* A function name used as a VALUE — passed as a call argument
|
|
6
|
+
* (`register_handler(target_cb)`, `signal(SIGINT, handler)`), assigned to a
|
|
7
|
+
* field or function pointer (`o->cb = target_cb`, `OnFire := TargetCb`),
|
|
8
|
+
* placed in a struct/object initializer (`{ .recv_cb = my_cb }`,
|
|
9
|
+
* `{ recv: targetCb }`, `Ops{Cb: targetCb}`), or listed in a function table
|
|
10
|
+
* (`static cb_t table[] = { cb_a, cb_b }`) — is a real dependency that static
|
|
11
|
+
* call extraction misses entirely: `callers(target_cb)` showed nothing but
|
|
12
|
+
* direct calls, so every callback looked dead and its registration sites were
|
|
13
|
+
* invisible to impact analysis.
|
|
14
|
+
*
|
|
15
|
+
* This module captures those value positions during the AST walk as
|
|
16
|
+
* `function_ref` candidates. Capture is table-driven per language (the value
|
|
17
|
+
* positions and wrapper forms differ per grammar — `&fn` in C, `Main::fn` in
|
|
18
|
+
* Java, `::fn` in Kotlin, `#selector(fn)` in Swift, `@TargetCb` in Pascal,
|
|
19
|
+
* `method(:fn)` in Ruby). Candidates are GATED at end-of-file extraction
|
|
20
|
+
* (see `TreeSitterExtractor.flushFnRefCandidates`): only names matching a
|
|
21
|
+
* same-file function/method or an imported binding survive, which bounds
|
|
22
|
+
* volume and keeps precision high. Resolution then matches survivors against
|
|
23
|
+
* function/method nodes ONLY (`matchFunctionRef` in
|
|
24
|
+
* `src/resolution/name-matcher.ts`) and persists them as `references` edges,
|
|
25
|
+
* which `callers`/`impact` already traverse.
|
|
26
|
+
*
|
|
27
|
+
* Deliberately NOT covered (resolving the *dispatch* — `o->cb(x)` → the
|
|
28
|
+
* registered function — needs data-flow through struct fields; a wrong edge
|
|
29
|
+
* is worse than none): indirect-call resolution and `obj.method` member
|
|
30
|
+
* values where `obj` isn't `this`/`self` (the receiver's type is statically
|
|
31
|
+
* unknowable without local data-flow).
|
|
32
|
+
*/
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.FN_REF_SPECS = void 0;
|
|
35
|
+
exports.captureFnRefCandidates = captureFnRefCandidates;
|
|
36
|
+
const tree_sitter_helpers_1 = require("./tree-sitter-helpers");
|
|
37
|
+
/** Names that are never function references even when grammars call them identifiers. */
|
|
38
|
+
const NAME_STOPLIST = new Set([
|
|
39
|
+
'this',
|
|
40
|
+
'self',
|
|
41
|
+
'super',
|
|
42
|
+
'null',
|
|
43
|
+
'nil',
|
|
44
|
+
'true',
|
|
45
|
+
'false',
|
|
46
|
+
'undefined',
|
|
47
|
+
'new',
|
|
48
|
+
'NULL',
|
|
49
|
+
'nullptr',
|
|
50
|
+
'None',
|
|
51
|
+
]);
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// Per-language specs. Node types verified against each grammar (probe fixtures
|
|
54
|
+
// in the #756 investigation; see docs/design/function-ref-capture.md).
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
/** C / C++ / Objective-C share the C-family initializer & assignment shapes. */
|
|
57
|
+
function cFamilySpec(extra) {
|
|
58
|
+
return {
|
|
59
|
+
idTypes: new Set(['identifier']),
|
|
60
|
+
dispatch: new Map([
|
|
61
|
+
['argument_list', { mode: 'args' }],
|
|
62
|
+
['assignment_expression', { mode: 'rhs', field: 'right' }],
|
|
63
|
+
['init_declarator', { mode: 'varinit', field: 'value' }],
|
|
64
|
+
['initializer_list', { mode: 'list' }],
|
|
65
|
+
['initializer_pair', { mode: 'value', field: 'value' }],
|
|
66
|
+
]),
|
|
67
|
+
unwrap: new Map([['pointer_expression', 'argument']]),
|
|
68
|
+
special: new Set(extra?.special ?? []),
|
|
69
|
+
// C has no symbol imports, and callbacks are registered cross-file at repo
|
|
70
|
+
// scale (redis: server.c's command table names handlers from t_*.c) — so
|
|
71
|
+
// initializer positions bypass the gate and lean on resolution's
|
|
72
|
+
// unique-or-drop rule. ONLY 'value'/'list' (struct/array initializers),
|
|
73
|
+
// and the flush additionally requires FILE scope: a C file-scope
|
|
74
|
+
// initializer is a constant-expression context, so a bare identifier
|
|
75
|
+
// there can only be a function address (or enum/macro, which the
|
|
76
|
+
// function-kind filter drops) — never a variable. 'rhs'/'varinit' were
|
|
77
|
+
// tried and produced false edges (`prev = next`, `*str = field` — data
|
|
78
|
+
// assignments matching a unique same-named function elsewhere), so
|
|
79
|
+
// assignments stay gated to same-file/import.
|
|
80
|
+
ungatedModes: new Set(['value', 'list']),
|
|
81
|
+
addressOfOnly: extra?.addressOfOnly,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// `this.handleClick` capture (member_expression) emits a `this.`-PREFIXED
|
|
85
|
+
// candidate name: resolution scopes it to the enclosing symbol's class
|
|
86
|
+
// (qualified-name prefix), so `this.fonts` (a property, post-#808) and
|
|
87
|
+
// inherited/unknown members yield no edge, while same-class methods —
|
|
88
|
+
// `btn.on('click', this.handleClick)`, the observer-registration idiom —
|
|
89
|
+
// resolve precisely. Bare identifiers stay function-kind-only (a bare id can
|
|
90
|
+
// never be a method value in JS).
|
|
91
|
+
const TS_JS_SPEC = {
|
|
92
|
+
idTypes: new Set(['identifier']),
|
|
93
|
+
dispatch: new Map([
|
|
94
|
+
['arguments', { mode: 'args' }],
|
|
95
|
+
['assignment_expression', { mode: 'rhs', field: 'right' }],
|
|
96
|
+
['variable_declarator', { mode: 'varinit', field: 'value' }],
|
|
97
|
+
['pair', { mode: 'value', field: 'value' }],
|
|
98
|
+
['array', { mode: 'list' }],
|
|
99
|
+
]),
|
|
100
|
+
special: new Set(['member_expression']),
|
|
101
|
+
};
|
|
102
|
+
const PYTHON_SPEC = {
|
|
103
|
+
idTypes: new Set(['identifier']),
|
|
104
|
+
dispatch: new Map([
|
|
105
|
+
['argument_list', { mode: 'args' }],
|
|
106
|
+
['assignment', { mode: 'rhs', field: 'right' }],
|
|
107
|
+
['keyword_argument', { mode: 'value', field: 'value' }], // Thread(target=worker)
|
|
108
|
+
['pair', { mode: 'value', field: 'value' }],
|
|
109
|
+
['list', { mode: 'list' }],
|
|
110
|
+
]),
|
|
111
|
+
special: new Set(['attribute']),
|
|
112
|
+
};
|
|
113
|
+
const GO_SPEC = {
|
|
114
|
+
idTypes: new Set(['identifier']),
|
|
115
|
+
dispatch: new Map([
|
|
116
|
+
['argument_list', { mode: 'args' }],
|
|
117
|
+
['assignment_statement', { mode: 'rhs', field: 'right' }],
|
|
118
|
+
['short_var_declaration', { mode: 'rhs', field: 'right' }],
|
|
119
|
+
['var_spec', { mode: 'varinit', field: 'value' }],
|
|
120
|
+
['keyed_element', { mode: 'value' }], // value = last literal_element child
|
|
121
|
+
['literal_value', { mode: 'list' }], // positional composite literals
|
|
122
|
+
]),
|
|
123
|
+
layers: new Map([
|
|
124
|
+
['literal_element', null],
|
|
125
|
+
['expression_list', null],
|
|
126
|
+
]),
|
|
127
|
+
};
|
|
128
|
+
const RUST_SPEC = {
|
|
129
|
+
idTypes: new Set(['identifier']),
|
|
130
|
+
dispatch: new Map([
|
|
131
|
+
['arguments', { mode: 'args' }],
|
|
132
|
+
['assignment_expression', { mode: 'rhs', field: 'right' }],
|
|
133
|
+
['field_initializer', { mode: 'value', field: 'value' }],
|
|
134
|
+
['array_expression', { mode: 'list' }],
|
|
135
|
+
['static_item', { mode: 'varinit', field: 'value' }],
|
|
136
|
+
['let_declaration', { mode: 'varinit', field: 'value' }],
|
|
137
|
+
]),
|
|
138
|
+
};
|
|
139
|
+
const JAVA_SPEC = {
|
|
140
|
+
// No bare-identifier function values in Java — only method references.
|
|
141
|
+
idTypes: new Set(),
|
|
142
|
+
dispatch: new Map([
|
|
143
|
+
['argument_list', { mode: 'args' }],
|
|
144
|
+
['assignment_expression', { mode: 'rhs', field: 'right' }],
|
|
145
|
+
['variable_declarator', { mode: 'varinit', field: 'value' }],
|
|
146
|
+
]),
|
|
147
|
+
special: new Set(['method_reference']),
|
|
148
|
+
};
|
|
149
|
+
const KOTLIN_SPEC = {
|
|
150
|
+
idTypes: new Set(),
|
|
151
|
+
dispatch: new Map([
|
|
152
|
+
['value_arguments', { mode: 'args' }],
|
|
153
|
+
['assignment', { mode: 'rhs' }], // RHS = last named child (no field in grammar)
|
|
154
|
+
]),
|
|
155
|
+
layers: new Map([['value_argument', null]]),
|
|
156
|
+
special: new Set(['callable_reference', 'navigation_expression']),
|
|
157
|
+
};
|
|
158
|
+
const CSHARP_SPEC = {
|
|
159
|
+
idTypes: new Set(['identifier']),
|
|
160
|
+
dispatch: new Map([
|
|
161
|
+
['argument_list', { mode: 'args' }],
|
|
162
|
+
['assignment_expression', { mode: 'rhs', field: 'right' }], // covers `+=` event subscription
|
|
163
|
+
['initializer_expression', { mode: 'list' }],
|
|
164
|
+
['variable_declarator', { mode: 'varinit' }],
|
|
165
|
+
]),
|
|
166
|
+
layers: new Map([['argument', null]]),
|
|
167
|
+
special: new Set(['member_access_expression']),
|
|
168
|
+
};
|
|
169
|
+
const RUBY_SPEC = {
|
|
170
|
+
// Bare identifiers in Ruby args are method CALLS or locals, never function
|
|
171
|
+
// values — only the `method(:name)` idiom (and `&method(:name)`) plus
|
|
172
|
+
// hook-DSL symbols (`before_action :authenticate`) qualify.
|
|
173
|
+
idTypes: new Set(),
|
|
174
|
+
dispatch: new Map([
|
|
175
|
+
['argument_list', { mode: 'args' }],
|
|
176
|
+
['pair', { mode: 'value', field: 'value' }],
|
|
177
|
+
]),
|
|
178
|
+
layers: new Map([['block_argument', null]]),
|
|
179
|
+
special: new Set(['call', 'simple_symbol']),
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Rails/ActiveSupport-style hook DSLs whose symbol arguments name a method of
|
|
183
|
+
* the enclosing class: lifecycle callbacks (`before_action`, `after_save`,
|
|
184
|
+
* `around_create`, `skip_before_action`…), `validate :method`, `set_callback`,
|
|
185
|
+
* `helper_method`, and `rescue_from(..., with: :handler)`. NOT `validates`
|
|
186
|
+
* (plural) — its symbols name ATTRIBUTES, not methods.
|
|
187
|
+
*/
|
|
188
|
+
const RUBY_HOOK_RE = /^(skip_)?(before|after|around)_[a-z_]+$/;
|
|
189
|
+
const RUBY_HOOK_NAMES = new Set(['validate', 'set_callback', 'helper_method', 'rescue_from']);
|
|
190
|
+
function isRubyHookCall(name) {
|
|
191
|
+
return RUBY_HOOK_RE.test(name) || RUBY_HOOK_NAMES.has(name);
|
|
192
|
+
}
|
|
193
|
+
const SWIFT_SPEC = {
|
|
194
|
+
idTypes: new Set(['simple_identifier']),
|
|
195
|
+
dispatch: new Map([
|
|
196
|
+
['value_arguments', { mode: 'args' }],
|
|
197
|
+
['assignment', { mode: 'rhs', field: 'result' }],
|
|
198
|
+
['array_literal', { mode: 'list' }],
|
|
199
|
+
['property_declaration', { mode: 'varinit', field: 'value' }],
|
|
200
|
+
]),
|
|
201
|
+
layers: new Map([['value_argument', 'value']]),
|
|
202
|
+
special: new Set(['selector_expression']),
|
|
203
|
+
};
|
|
204
|
+
const SCALA_SPEC = {
|
|
205
|
+
idTypes: new Set(['identifier']),
|
|
206
|
+
dispatch: new Map([
|
|
207
|
+
['arguments', { mode: 'args' }],
|
|
208
|
+
['assignment_expression', { mode: 'rhs', field: 'right' }],
|
|
209
|
+
['val_definition', { mode: 'varinit', field: 'value' }],
|
|
210
|
+
]),
|
|
211
|
+
unwrap: new Map([['postfix_expression', null]]), // eta-expansion `fn _`
|
|
212
|
+
};
|
|
213
|
+
const DART_SPEC = {
|
|
214
|
+
idTypes: new Set(['identifier']),
|
|
215
|
+
dispatch: new Map([
|
|
216
|
+
['arguments', { mode: 'args' }],
|
|
217
|
+
['assignment_expression', { mode: 'rhs', field: 'right' }],
|
|
218
|
+
['pair', { mode: 'value', field: 'value' }],
|
|
219
|
+
['list_literal', { mode: 'list' }],
|
|
220
|
+
['static_final_declaration', { mode: 'varinit' }],
|
|
221
|
+
]),
|
|
222
|
+
layers: new Map([['argument', null]]),
|
|
223
|
+
};
|
|
224
|
+
const LUA_SPEC = {
|
|
225
|
+
idTypes: new Set(['identifier']),
|
|
226
|
+
dispatch: new Map([
|
|
227
|
+
['arguments', { mode: 'args' }],
|
|
228
|
+
['assignment_statement', { mode: 'rhs' }], // RHS expression_list children carry `value` fields
|
|
229
|
+
['field', { mode: 'value', field: 'value' }], // table fields, keyed AND positional
|
|
230
|
+
]),
|
|
231
|
+
layers: new Map([['expression_list', null]]),
|
|
232
|
+
};
|
|
233
|
+
const PASCAL_SPEC = {
|
|
234
|
+
idTypes: new Set(['identifier']),
|
|
235
|
+
dispatch: new Map([
|
|
236
|
+
['exprArgs', { mode: 'args' }],
|
|
237
|
+
['assignment', { mode: 'rhs', field: 'rhs' }], // OnClick := Handler
|
|
238
|
+
]),
|
|
239
|
+
unwrap: new Map([['exprUnary', 'operand']]), // @Handler
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* PHP core functions whose string arguments are CALLABLES — the positional
|
|
243
|
+
* prior that makes a bare string trustworthy as a function reference.
|
|
244
|
+
* Deliberately core-PHP only; framework registries (WordPress `add_action`)
|
|
245
|
+
* belong in a frameworks/ resolver if ever added.
|
|
246
|
+
*/
|
|
247
|
+
const PHP_CALLABLE_HOFS = new Set([
|
|
248
|
+
'array_map', 'array_filter', 'array_walk', 'array_walk_recursive', 'array_reduce',
|
|
249
|
+
'usort', 'uasort', 'uksort',
|
|
250
|
+
'array_udiff', 'array_udiff_assoc', 'array_uintersect', 'array_uintersect_assoc',
|
|
251
|
+
'call_user_func', 'call_user_func_array',
|
|
252
|
+
'forward_static_call', 'forward_static_call_array',
|
|
253
|
+
'preg_replace_callback', 'preg_replace_callback_array',
|
|
254
|
+
'register_shutdown_function', 'register_tick_function',
|
|
255
|
+
'set_error_handler', 'set_exception_handler', 'spl_autoload_register',
|
|
256
|
+
'ob_start', 'iterator_apply', 'header_register_callback',
|
|
257
|
+
'is_callable',
|
|
258
|
+
]);
|
|
259
|
+
const PHP_SPEC = {
|
|
260
|
+
// PHP has no bare-identifier function values (the first-class callable
|
|
261
|
+
// `fn(...)` already extracts as a `calls` edge). What qualifies:
|
|
262
|
+
// - a string argument to a known callable-taking core function
|
|
263
|
+
// (`usort($a, 'cmp_items')`) — see PHP_CALLABLE_HOFS
|
|
264
|
+
// - array callables: `[$this, 'method']` (class-scoped) and
|
|
265
|
+
// `[Foo::class, 'method']` (qualified), in any call's arguments
|
|
266
|
+
idTypes: new Set(),
|
|
267
|
+
dispatch: new Map([['arguments', { mode: 'args' }]]),
|
|
268
|
+
layers: new Map([['argument', null]]),
|
|
269
|
+
special: new Set(['encapsed_string', 'string', 'array_creation_expression']),
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Capture specs by language.
|
|
273
|
+
*/
|
|
274
|
+
exports.FN_REF_SPECS = {
|
|
275
|
+
c: cFamilySpec(),
|
|
276
|
+
cpp: cFamilySpec({ addressOfOnly: true }),
|
|
277
|
+
objc: cFamilySpec({ special: ['selector_expression'] }),
|
|
278
|
+
typescript: TS_JS_SPEC,
|
|
279
|
+
tsx: TS_JS_SPEC,
|
|
280
|
+
javascript: TS_JS_SPEC,
|
|
281
|
+
jsx: TS_JS_SPEC,
|
|
282
|
+
python: PYTHON_SPEC,
|
|
283
|
+
go: GO_SPEC,
|
|
284
|
+
rust: RUST_SPEC,
|
|
285
|
+
java: JAVA_SPEC,
|
|
286
|
+
kotlin: KOTLIN_SPEC,
|
|
287
|
+
csharp: CSHARP_SPEC,
|
|
288
|
+
php: PHP_SPEC,
|
|
289
|
+
ruby: RUBY_SPEC,
|
|
290
|
+
swift: SWIFT_SPEC,
|
|
291
|
+
scala: SCALA_SPEC,
|
|
292
|
+
dart: DART_SPEC,
|
|
293
|
+
lua: LUA_SPEC,
|
|
294
|
+
luau: LUA_SPEC,
|
|
295
|
+
pascal: PASCAL_SPEC,
|
|
296
|
+
};
|
|
297
|
+
// ---------------------------------------------------------------------------
|
|
298
|
+
// Capture
|
|
299
|
+
// ---------------------------------------------------------------------------
|
|
300
|
+
/**
|
|
301
|
+
* Extract candidate names from a dispatched container node. Returns the
|
|
302
|
+
* (name, position) pairs of every function-value-shaped expression found.
|
|
303
|
+
*/
|
|
304
|
+
function captureFnRefCandidates(container, rule, spec, source) {
|
|
305
|
+
const valueNodes = [];
|
|
306
|
+
switch (rule.mode) {
|
|
307
|
+
case 'args':
|
|
308
|
+
case 'list': {
|
|
309
|
+
for (let i = 0; i < container.namedChildCount; i++) {
|
|
310
|
+
const child = container.namedChild(i);
|
|
311
|
+
if (child)
|
|
312
|
+
valueNodes.push(child);
|
|
313
|
+
}
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
case 'rhs': {
|
|
317
|
+
const rhs = rule.field
|
|
318
|
+
? (0, tree_sitter_helpers_1.getChildByField)(container, rule.field)
|
|
319
|
+
: container.namedChild(container.namedChildCount - 1);
|
|
320
|
+
if (rhs) {
|
|
321
|
+
// Param-storage skip: `this.status = status` / `o->cb = cb` — when
|
|
322
|
+
// the assigned member's name EQUALS the RHS identifier, the RHS is a
|
|
323
|
+
// local/parameter being stored, and the function it holds (if any)
|
|
324
|
+
// is unknowable statically. A same-named function elsewhere would
|
|
325
|
+
// resolve to the WRONG target (excalidraw A/B finding), so skip.
|
|
326
|
+
const lhs = (0, tree_sitter_helpers_1.getChildByField)(container, 'left') ??
|
|
327
|
+
(0, tree_sitter_helpers_1.getChildByField)(container, 'lhs') ??
|
|
328
|
+
(0, tree_sitter_helpers_1.getChildByField)(container, 'target') ??
|
|
329
|
+
(container.namedChildCount >= 2 ? container.namedChild(0) : null);
|
|
330
|
+
const lhsText = lhs ? (0, tree_sitter_helpers_1.getNodeText)(lhs, source) : '';
|
|
331
|
+
const lhsLastName = lhsText.match(/([A-Za-z_$][A-Za-z0-9_$]*)\s*$/)?.[1];
|
|
332
|
+
const rhsText = (0, tree_sitter_helpers_1.getNodeText)(rhs, source).trim();
|
|
333
|
+
if (lhsLastName && lhsLastName === rhsText)
|
|
334
|
+
break;
|
|
335
|
+
valueNodes.push(rhs);
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
case 'value': {
|
|
340
|
+
let value = rule.field ? (0, tree_sitter_helpers_1.getChildByField)(container, rule.field) : null;
|
|
341
|
+
// Keyed containers without a value field (Go keyed_element): the value
|
|
342
|
+
// is the LAST named child (the first is the key).
|
|
343
|
+
if (!value && container.namedChildCount > 0) {
|
|
344
|
+
value = container.namedChild(container.namedChildCount - 1);
|
|
345
|
+
}
|
|
346
|
+
if (value)
|
|
347
|
+
valueNodes.push(value);
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
case 'varinit': {
|
|
351
|
+
// Destructuring (`const { center } = ellipse`) extracts DATA from the
|
|
352
|
+
// RHS — never a function alias. Without this skip, a parameter that
|
|
353
|
+
// shadows a same-named imported function produced a wrong edge.
|
|
354
|
+
const nameNode = (0, tree_sitter_helpers_1.getChildByField)(container, 'name') ?? (0, tree_sitter_helpers_1.getChildByField)(container, 'pattern');
|
|
355
|
+
if (nameNode && (nameNode.type === 'object_pattern' || nameNode.type === 'array_pattern' ||
|
|
356
|
+
nameNode.type === 'tuple_pattern' || nameNode.type === 'struct_pattern')) {
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
if (rule.field) {
|
|
360
|
+
const value = (0, tree_sitter_helpers_1.getChildByField)(container, rule.field);
|
|
361
|
+
if (value)
|
|
362
|
+
valueNodes.push(value);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
// No value field in this grammar (C# variable_declarator, Dart
|
|
366
|
+
// static_final_declaration): the initializer is the last named child —
|
|
367
|
+
// but a declarator WITHOUT an initializer has its NAME there instead.
|
|
368
|
+
// Require ≥2 named children and never pick the name/pattern child.
|
|
369
|
+
const value = container.namedChild(container.namedChildCount - 1);
|
|
370
|
+
const nameChild = (0, tree_sitter_helpers_1.getChildByField)(container, 'name') ?? (0, tree_sitter_helpers_1.getChildByField)(container, 'pattern');
|
|
371
|
+
if (value &&
|
|
372
|
+
container.namedChildCount >= 2 &&
|
|
373
|
+
(!nameChild || value.id !== nameChild.id)) {
|
|
374
|
+
valueNodes.push(value);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const out = [];
|
|
381
|
+
for (const v of valueNodes) {
|
|
382
|
+
// A bare identifier is one that normalizes without passing through an
|
|
383
|
+
// unwrap/special reference form. C++'s addressOfOnly policy (applied at
|
|
384
|
+
// flush, where file scope is known) drops bare ids outside file-scope
|
|
385
|
+
// initializer tables.
|
|
386
|
+
const explicitRef = !spec.idTypes.has(v.type);
|
|
387
|
+
for (const { name, node, skipGate } of normalizeValue(v, spec, source, 0)) {
|
|
388
|
+
if (!name || NAME_STOPLIST.has(name))
|
|
389
|
+
continue;
|
|
390
|
+
out.push({
|
|
391
|
+
name,
|
|
392
|
+
line: node.startPosition.row + 1,
|
|
393
|
+
column: node.startPosition.column,
|
|
394
|
+
mode: rule.mode,
|
|
395
|
+
explicitRef,
|
|
396
|
+
skipGate,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return out;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Normalize one value expression to zero or more function names. Recursion is
|
|
404
|
+
* bounded (wrapper layers only); anything that isn't a recognized
|
|
405
|
+
* function-value shape yields [].
|
|
406
|
+
*/
|
|
407
|
+
function normalizeValue(node, spec, source, depth) {
|
|
408
|
+
if (depth > 4)
|
|
409
|
+
return [];
|
|
410
|
+
const type = node.type;
|
|
411
|
+
// Bare identifier
|
|
412
|
+
if (spec.idTypes.has(type)) {
|
|
413
|
+
return [{ name: (0, tree_sitter_helpers_1.getNodeText)(node, source), node }];
|
|
414
|
+
}
|
|
415
|
+
// Transparent layers (argument, value_argument, literal_element,
|
|
416
|
+
// expression_list, block_argument). expression_list fans out (Go `a, b = f, g`).
|
|
417
|
+
const layerField = spec.layers?.get(type);
|
|
418
|
+
if (spec.layers?.has(type)) {
|
|
419
|
+
// Labeled-argument param-forward skip (Swift/Kotlin): `value: value` /
|
|
420
|
+
// `delay: delay` — when the label EQUALS the value identifier, the value
|
|
421
|
+
// is a forwarded local/parameter, not a function reference (Alamofire
|
|
422
|
+
// A/B finding; same rationale as the `this.x = x` assignment skip).
|
|
423
|
+
if (type === 'value_argument') {
|
|
424
|
+
const label = (0, tree_sitter_helpers_1.getChildByField)(node, 'name');
|
|
425
|
+
const value = (0, tree_sitter_helpers_1.getChildByField)(node, 'value') ?? node.namedChild(node.namedChildCount - 1);
|
|
426
|
+
if (label &&
|
|
427
|
+
value &&
|
|
428
|
+
(0, tree_sitter_helpers_1.getNodeText)(label, source).trim() === (0, tree_sitter_helpers_1.getNodeText)(value, source).trim()) {
|
|
429
|
+
return [];
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (layerField) {
|
|
433
|
+
const inner = (0, tree_sitter_helpers_1.getChildByField)(node, layerField);
|
|
434
|
+
return inner ? normalizeValue(inner, spec, source, depth + 1) : [];
|
|
435
|
+
}
|
|
436
|
+
const results = [];
|
|
437
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
438
|
+
const child = node.namedChild(i);
|
|
439
|
+
if (child)
|
|
440
|
+
results.push(...normalizeValue(child, spec, source, depth + 1));
|
|
441
|
+
}
|
|
442
|
+
return results;
|
|
443
|
+
}
|
|
444
|
+
// Unary wrappers: &fn / @Fn / `fn _`
|
|
445
|
+
const unwrapField = spec.unwrap?.get(type);
|
|
446
|
+
if (spec.unwrap?.has(type)) {
|
|
447
|
+
// C-family `pointer_expression` covers BOTH `&x` (address-of — a function
|
|
448
|
+
// value) and `*x` (dereference — a data read, never a function value).
|
|
449
|
+
// Only `&` qualifies; without this, fmt's `*begin` reads resolved to its
|
|
450
|
+
// free `begin()` functions.
|
|
451
|
+
if (type === 'pointer_expression' && node.child(0)?.type !== '&')
|
|
452
|
+
return [];
|
|
453
|
+
const inner = unwrapField ? (0, tree_sitter_helpers_1.getChildByField)(node, unwrapField) : node.namedChild(0);
|
|
454
|
+
if (!inner)
|
|
455
|
+
return [];
|
|
456
|
+
// C++ `&Widget::on_click` — keep the QUALIFIED name. Resolution scopes the
|
|
457
|
+
// method to that class (more precise than a bare-name match, and exempt
|
|
458
|
+
// from the cpp bare-ids-are-free-functions rule since `&Cls::m` is an
|
|
459
|
+
// explicit member-pointer).
|
|
460
|
+
if (inner.type === 'qualified_identifier') {
|
|
461
|
+
const text = (0, tree_sitter_helpers_1.getNodeText)(inner, source).trim();
|
|
462
|
+
return /^[A-Za-z_][\w:]*$/.test(text) ? [{ name: text, node: inner }] : [];
|
|
463
|
+
}
|
|
464
|
+
return normalizeValue(inner, spec, source, depth + 1);
|
|
465
|
+
}
|
|
466
|
+
// Special whole-node reference forms
|
|
467
|
+
if (spec.special?.has(type)) {
|
|
468
|
+
return normalizeSpecial(node, type, source);
|
|
469
|
+
}
|
|
470
|
+
return [];
|
|
471
|
+
}
|
|
472
|
+
/** Rightmost descendant-or-self named child of one of the given types. */
|
|
473
|
+
function lastNamedOfType(node, types) {
|
|
474
|
+
let found = null;
|
|
475
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
476
|
+
const child = node.namedChild(i);
|
|
477
|
+
if (!child)
|
|
478
|
+
continue;
|
|
479
|
+
if (types.has(child.type))
|
|
480
|
+
found = child;
|
|
481
|
+
const deeper = lastNamedOfType(child, types);
|
|
482
|
+
if (deeper)
|
|
483
|
+
found = deeper;
|
|
484
|
+
}
|
|
485
|
+
return found;
|
|
486
|
+
}
|
|
487
|
+
function normalizeSpecial(node, type, source) {
|
|
488
|
+
switch (type) {
|
|
489
|
+
// Java method references. Receiver decides the resolution route (#808):
|
|
490
|
+
// `this::run0` / `super::close` → `this.<m>` (class-scoped resolver;
|
|
491
|
+
// super rides the inherited-member supertype pass)
|
|
492
|
+
// `Type::method` (capitalized) → qualified `Type::method` (suffix-
|
|
493
|
+
// matched against that type's members, cross-file capable)
|
|
494
|
+
// `variable::method` → nothing (receiver type unknown statically —
|
|
495
|
+
// the deferred obj.method class)
|
|
496
|
+
case 'method_reference': {
|
|
497
|
+
let last = null;
|
|
498
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
499
|
+
const child = node.namedChild(i);
|
|
500
|
+
if (child && child.type === 'identifier')
|
|
501
|
+
last = child;
|
|
502
|
+
}
|
|
503
|
+
if (!last)
|
|
504
|
+
return [];
|
|
505
|
+
const m = (0, tree_sitter_helpers_1.getNodeText)(last, source);
|
|
506
|
+
const text = (0, tree_sitter_helpers_1.getNodeText)(node, source);
|
|
507
|
+
if (text.startsWith('this::') || text.startsWith('super::')) {
|
|
508
|
+
return [{ name: `this.${m}`, node: last }];
|
|
509
|
+
}
|
|
510
|
+
const recv = text.match(/^([A-Z][A-Za-z0-9_]*)\s*::/);
|
|
511
|
+
if (recv) {
|
|
512
|
+
// `Type::method` — but `Type::new` (constructor ref) has no method
|
|
513
|
+
// node to land on; let the stoplist drop it via the bare name.
|
|
514
|
+
return m === 'new' ? [] : [{ name: `${recv[1]}::${m}`, node: last }];
|
|
515
|
+
}
|
|
516
|
+
return [];
|
|
517
|
+
}
|
|
518
|
+
// Kotlin `::targetCb` (one part) / `OtherClass::handle` (two parts —
|
|
519
|
+
// receiver is a type_identifier; lowercase receivers are variables, the
|
|
520
|
+
// deferred obj.method class).
|
|
521
|
+
case 'callable_reference': {
|
|
522
|
+
let receiver = null;
|
|
523
|
+
let member = null;
|
|
524
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
525
|
+
const child = node.namedChild(i);
|
|
526
|
+
if (!child)
|
|
527
|
+
continue;
|
|
528
|
+
if (child.type === 'type_identifier')
|
|
529
|
+
receiver = child;
|
|
530
|
+
if (child.type === 'simple_identifier')
|
|
531
|
+
member = child;
|
|
532
|
+
}
|
|
533
|
+
if (!member)
|
|
534
|
+
return [];
|
|
535
|
+
const m = (0, tree_sitter_helpers_1.getNodeText)(member, source);
|
|
536
|
+
if (!receiver)
|
|
537
|
+
return [{ name: m, node: member }]; // ::topLevelFn
|
|
538
|
+
const recvText = (0, tree_sitter_helpers_1.getNodeText)(receiver, source);
|
|
539
|
+
return /^[A-Z]/.test(recvText)
|
|
540
|
+
? [{ name: `${recvText}::${m}`, node: member }]
|
|
541
|
+
: []; // variable::method — unknown receiver type
|
|
542
|
+
}
|
|
543
|
+
// Kotlin `this::fire` parses as navigation_expression with a `::fire`
|
|
544
|
+
// navigation_suffix — route through the class-scoped `this.` resolver.
|
|
545
|
+
// Ordinary `a.b` navigation (and any non-`this` receiver) MUST yield
|
|
546
|
+
// nothing.
|
|
547
|
+
case 'navigation_expression': {
|
|
548
|
+
if (!(0, tree_sitter_helpers_1.getNodeText)(node, source).startsWith('this::'))
|
|
549
|
+
return [];
|
|
550
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
551
|
+
const child = node.namedChild(i);
|
|
552
|
+
if (child && child.type === 'navigation_suffix' && (0, tree_sitter_helpers_1.getNodeText)(child, source).startsWith('::')) {
|
|
553
|
+
const id = child.namedChild(child.namedChildCount - 1);
|
|
554
|
+
if (id)
|
|
555
|
+
return [{ name: `this.${(0, tree_sitter_helpers_1.getNodeText)(id, source)}`, node: id }];
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return [];
|
|
559
|
+
}
|
|
560
|
+
// Swift `#selector(Holder.fire)` → fire. ObjC `@selector(storeImage:)` →
|
|
561
|
+
// `storeImage:` verbatim (ObjC method nodes keep their selector colons).
|
|
562
|
+
case 'selector_expression': {
|
|
563
|
+
const inner = node.namedChild(0);
|
|
564
|
+
if (!inner)
|
|
565
|
+
return [];
|
|
566
|
+
if (inner.type === 'identifier' || inner.type === 'simple_identifier') {
|
|
567
|
+
return [{ name: (0, tree_sitter_helpers_1.getNodeText)(inner, source), node: inner }];
|
|
568
|
+
}
|
|
569
|
+
// Swift dotted form: rightmost simple_identifier. ObjC keyword selector:
|
|
570
|
+
// text as-is.
|
|
571
|
+
const last = lastNamedOfType(node, new Set(['simple_identifier']));
|
|
572
|
+
if (last)
|
|
573
|
+
return [{ name: (0, tree_sitter_helpers_1.getNodeText)(last, source), node: last }];
|
|
574
|
+
return [{ name: (0, tree_sitter_helpers_1.getNodeText)(inner, source).trim(), node: inner }];
|
|
575
|
+
}
|
|
576
|
+
// Ruby `method(:target_cb)` — a `call` whose method is literally `method`
|
|
577
|
+
// with a single symbol argument.
|
|
578
|
+
case 'call': {
|
|
579
|
+
const method = (0, tree_sitter_helpers_1.getChildByField)(node, 'method');
|
|
580
|
+
if (!method || (0, tree_sitter_helpers_1.getNodeText)(method, source) !== 'method')
|
|
581
|
+
return [];
|
|
582
|
+
const args = (0, tree_sitter_helpers_1.getChildByField)(node, 'arguments');
|
|
583
|
+
if (!args || args.namedChildCount !== 1)
|
|
584
|
+
return [];
|
|
585
|
+
const sym = args.namedChild(0);
|
|
586
|
+
if (!sym || sym.type !== 'simple_symbol')
|
|
587
|
+
return [];
|
|
588
|
+
const name = (0, tree_sitter_helpers_1.getNodeText)(sym, source).replace(/^:/, '');
|
|
589
|
+
return name ? [{ name, node: sym }] : [];
|
|
590
|
+
}
|
|
591
|
+
// `this.handleClick` (TS/JS) — object must be EXACTLY `this`. The name
|
|
592
|
+
// keeps the `this.` prefix so resolution can scope it to the enclosing
|
|
593
|
+
// class (see resolveThisMemberFnRef) instead of bare name-matching.
|
|
594
|
+
case 'member_expression': {
|
|
595
|
+
const obj = (0, tree_sitter_helpers_1.getChildByField)(node, 'object');
|
|
596
|
+
const prop = (0, tree_sitter_helpers_1.getChildByField)(node, 'property');
|
|
597
|
+
if (obj && prop && obj.type === 'this' && prop.type === 'property_identifier') {
|
|
598
|
+
return [{ name: `this.${(0, tree_sitter_helpers_1.getNodeText)(prop, source)}`, node: prop }];
|
|
599
|
+
}
|
|
600
|
+
return [];
|
|
601
|
+
}
|
|
602
|
+
// `self.handle_click` (Python) — object must be EXACTLY `self`.
|
|
603
|
+
case 'attribute': {
|
|
604
|
+
const obj = (0, tree_sitter_helpers_1.getChildByField)(node, 'object');
|
|
605
|
+
const attr = (0, tree_sitter_helpers_1.getChildByField)(node, 'attribute');
|
|
606
|
+
if (obj && attr && obj.type === 'identifier' && (0, tree_sitter_helpers_1.getNodeText)(obj, source) === 'self') {
|
|
607
|
+
return [{ name: (0, tree_sitter_helpers_1.getNodeText)(attr, source), node: attr }];
|
|
608
|
+
}
|
|
609
|
+
return [];
|
|
610
|
+
}
|
|
611
|
+
// `this.Run0` (C#) — receiver must be EXACTLY `this`. Two grammar shapes:
|
|
612
|
+
// newer tree-sitter-c-sharp exposes an `expression` field holding a
|
|
613
|
+
// `this_expression`; the vendored grammar keeps `this` as an anonymous
|
|
614
|
+
// token (only the `name` field is a named child), so fall back to the
|
|
615
|
+
// node text.
|
|
616
|
+
case 'member_access_expression': {
|
|
617
|
+
const name = (0, tree_sitter_helpers_1.getChildByField)(node, 'name');
|
|
618
|
+
if (!name)
|
|
619
|
+
return [];
|
|
620
|
+
const expr = (0, tree_sitter_helpers_1.getChildByField)(node, 'expression');
|
|
621
|
+
const isThisReceiver = expr
|
|
622
|
+
? expr.type === 'this_expression' || expr.type === 'this'
|
|
623
|
+
: (0, tree_sitter_helpers_1.getNodeText)(node, source).startsWith('this.');
|
|
624
|
+
return isThisReceiver ? [{ name: (0, tree_sitter_helpers_1.getNodeText)(name, source), node: name }] : [];
|
|
625
|
+
}
|
|
626
|
+
// PHP string callable — trustworthy ONLY as an argument to a known
|
|
627
|
+
// callable-taking core function (`usort($a, 'cmp_items')`). PHP global
|
|
628
|
+
// functions are referenced cross-file without imports, so these skip the
|
|
629
|
+
// name gate and rely on resolution's unique-or-drop rule. A
|
|
630
|
+
// `'Cls::method'` string becomes a qualified candidate.
|
|
631
|
+
case 'encapsed_string':
|
|
632
|
+
case 'string': {
|
|
633
|
+
const callee = phpEnclosingCallName(node);
|
|
634
|
+
if (!callee || !PHP_CALLABLE_HOFS.has(callee))
|
|
635
|
+
return [];
|
|
636
|
+
const content = phpStringContent(node, source);
|
|
637
|
+
if (!content)
|
|
638
|
+
return [];
|
|
639
|
+
if (/^[A-Za-z_][A-Za-z0-9_]*$/.test(content)) {
|
|
640
|
+
return [{ name: content, node, skipGate: true }];
|
|
641
|
+
}
|
|
642
|
+
if (/^[A-Za-z_][A-Za-z0-9_]*::[A-Za-z_][A-Za-z0-9_]*$/.test(content)) {
|
|
643
|
+
return [{ name: content, node, skipGate: true }];
|
|
644
|
+
}
|
|
645
|
+
return [];
|
|
646
|
+
}
|
|
647
|
+
// PHP array callables, valid in ANY call's arguments (the shape itself is
|
|
648
|
+
// unambiguous): `[$this, 'method']` → class-scoped `this.method`;
|
|
649
|
+
// `[Foo::class, 'method']` → qualified `Foo::method`.
|
|
650
|
+
case 'array_creation_expression': {
|
|
651
|
+
if (node.namedChildCount !== 2)
|
|
652
|
+
return [];
|
|
653
|
+
const recv = node.namedChild(0)?.namedChild(0);
|
|
654
|
+
const strEl = node.namedChild(1)?.namedChild(0);
|
|
655
|
+
if (!recv || !strEl)
|
|
656
|
+
return [];
|
|
657
|
+
if (strEl.type !== 'encapsed_string' && strEl.type !== 'string')
|
|
658
|
+
return [];
|
|
659
|
+
const member = phpStringContent(strEl, source);
|
|
660
|
+
if (!member || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(member))
|
|
661
|
+
return [];
|
|
662
|
+
if (recv.type === 'variable_name' && (0, tree_sitter_helpers_1.getNodeText)(recv, source) === '$this') {
|
|
663
|
+
return [{ name: `this.${member}`, node: strEl }];
|
|
664
|
+
}
|
|
665
|
+
if (recv.type === 'class_constant_access_expression') {
|
|
666
|
+
const cls = recv.namedChild(0);
|
|
667
|
+
const kw = recv.namedChild(1);
|
|
668
|
+
if (cls && kw && (0, tree_sitter_helpers_1.getNodeText)(kw, source) === 'class') {
|
|
669
|
+
return [{ name: `${(0, tree_sitter_helpers_1.getNodeText)(cls, source)}::${member}`, node: strEl }];
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return [];
|
|
673
|
+
}
|
|
674
|
+
// Ruby hook-DSL symbols (`before_action :authenticate`,
|
|
675
|
+
// `rescue_from E, with: :render_404`): the symbol names a method of the
|
|
676
|
+
// ENCLOSING class — route through the class-scoped `this.` resolver
|
|
677
|
+
// (which also walks superclasses, covering ApplicationController-style
|
|
678
|
+
// inheritance). Symbols under any other call yield nothing.
|
|
679
|
+
case 'simple_symbol': {
|
|
680
|
+
const call = rubyEnclosingCall(node);
|
|
681
|
+
if (!call)
|
|
682
|
+
return [];
|
|
683
|
+
const method = (0, tree_sitter_helpers_1.getChildByField)(call, 'method');
|
|
684
|
+
if (!method || !isRubyHookCall((0, tree_sitter_helpers_1.getNodeText)(method, source)))
|
|
685
|
+
return [];
|
|
686
|
+
const sym = (0, tree_sitter_helpers_1.getNodeText)(node, source).replace(/^:/, '');
|
|
687
|
+
if (!/^[A-Za-z_][A-Za-z0-9_?!]*$/.test(sym))
|
|
688
|
+
return [];
|
|
689
|
+
return [{ name: `this.${sym}`, node }];
|
|
690
|
+
}
|
|
691
|
+
default:
|
|
692
|
+
return [];
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
/** Content of a PHP string literal node (single- or double-quoted). */
|
|
696
|
+
function phpStringContent(node, source) {
|
|
697
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
698
|
+
const child = node.namedChild(i);
|
|
699
|
+
if (child?.type === 'string_content')
|
|
700
|
+
return (0, tree_sitter_helpers_1.getNodeText)(child, source).trim();
|
|
701
|
+
}
|
|
702
|
+
return null;
|
|
703
|
+
}
|
|
704
|
+
/** The function name of the PHP call whose arguments contain `node`, if any. */
|
|
705
|
+
function phpEnclosingCallName(node) {
|
|
706
|
+
let cur = node.parent;
|
|
707
|
+
for (let hops = 0; cur && hops < 4; hops++, cur = cur.parent) {
|
|
708
|
+
if (cur.type === 'function_call_expression') {
|
|
709
|
+
const fn = (0, tree_sitter_helpers_1.getChildByField)(cur, 'function');
|
|
710
|
+
return fn ? fn.text : null;
|
|
711
|
+
}
|
|
712
|
+
if (cur.type === 'member_call_expression' || cur.type === 'scoped_call_expression') {
|
|
713
|
+
return null; // method calls aren't core HOFs
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
}
|
|
718
|
+
/** The Ruby `call` node whose argument_list (or keyword pair) contains `node`. */
|
|
719
|
+
function rubyEnclosingCall(node) {
|
|
720
|
+
let cur = node.parent;
|
|
721
|
+
for (let hops = 0; cur && hops < 4; hops++, cur = cur.parent) {
|
|
722
|
+
if (cur.type === 'call')
|
|
723
|
+
return cur;
|
|
724
|
+
}
|
|
725
|
+
return null;
|
|
726
|
+
}
|
|
727
|
+
//# sourceMappingURL=function-ref.js.map
|