cgraphx 1.4.3 → 2.0.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 +1 -1
- package/README.en.md +126 -0
- package/README.md +78 -196
- package/dist/.claude-template/.cgraphx/timeline-current-turn.json +1 -0
- package/dist/.claude-template/CLAUDE.md +10 -0
- package/dist/.claude-template/FLOW-MAP.md +107 -0
- package/dist/.claude-template/agents/knowledge-recall.md +11 -17
- package/dist/.claude-template/commands/my-query.md +1 -1
- package/dist/.claude-template/deprecated-assets.json +11 -0
- package/dist/.claude-template/hooks/precommit-check/precommit-check.cjs +27 -24
- package/dist/.claude-template/skills/.cgraphx/timeline-current-turn.json +1 -0
- package/dist/.claude-template/skills/cgraphx-guide/SKILL.md +22 -24
- package/dist/.claude-template/skills/cgraphx-guide/how-to-use.html +273 -156
- package/dist/.claude-template/skills/cgraphx-guide/how-to-use.md +148 -86
- package/dist/.claude-template/skills/clarify-requirements/SKILL.md +75 -384
- package/dist/.claude-template/skills/developer-timeline/SKILL.md +3 -2
- package/dist/.claude-template/skills/export-table-ddl/SKILL.md +3 -2
- package/dist/.claude-template/skills/handdrawn-deck/.cgraphx/timeline-current-turn.json +1 -0
- package/dist/.claude-template/skills/handdrawn-deck/SKILL.md +305 -0
- package/dist/.claude-template/skills/handdrawn-deck/references/.cgraphx/timeline-current-turn.json +1 -0
- package/dist/.claude-template/skills/handdrawn-deck/references/deck-template.html +469 -0
- package/dist/.claude-template/skills/handdrawn-deck/references/gen-script-md.cjs +44 -0
- package/dist/.claude-template/skills/handdrawn-deck/references/seg.cjs +54 -0
- package/dist/.claude-template/skills/handdrawn-sketch-engine/.cgraphx/timeline-current-turn.json +1 -0
- package/dist/.claude-template/skills/handdrawn-sketch-engine/SKILL.md +279 -0
- package/dist/.claude-template/skills/handdrawn-sketch-engine/assets/icon-library.js +238 -0
- package/dist/.claude-template/skills/handdrawn-sketch-engine/references/engine-template.html +275 -0
- package/dist/.claude-template/skills/handdrawn-sketch-engine/references/reference-render.html +445 -0
- package/dist/.claude-template/skills/implementation/SKILL.md +36 -130
- package/dist/.claude-template/skills/init-project-guides/SKILL.md +81 -0
- package/dist/.claude-template/skills/init-project-guides/templates/git-standards.md +37 -0
- package/dist/.claude-template/skills/init-project-guides/templates/go.md +160 -0
- package/dist/.claude-template/skills/init-project-guides/templates/java.md +173 -0
- package/dist/.claude-template/skills/init-project-guides/templates/schema-convention.md +11 -0
- package/dist/.claude-template/skills/init-project-guides/templates/typescript.md +156 -0
- package/dist/.claude-template/skills/knowledge-api/SKILL.md +143 -0
- package/dist/.claude-template/skills/knowledge-api/agent-prompt.md +51 -0
- package/dist/.claude-template/skills/knowledge-init/SKILL.md +761 -0
- package/dist/.claude-template/skills/knowledge-migrate/SKILL.md +173 -0
- package/dist/.claude-template/skills/knowledge-recall/SKILL.md +5 -4
- package/dist/.claude-template/skills/knowledge-write/SKILL.md +126 -0
- package/dist/.claude-template/skills/knowledge-write/template-concept.md +95 -0
- package/dist/.claude-template/skills/knowledge-write/template-flow.md +100 -0
- package/dist/.claude-template/skills/knowledge-write/template-guide.md +77 -0
- package/dist/.claude-template/skills/knowledge-write/template-memory.md +61 -0
- package/dist/.claude-template/skills/run-api-test/SKILL.md +6 -4
- package/dist/.claude-template/skills/run-api-test/assets/template-test-report.md +448 -55
- package/dist/.claude-template/skills/run-api-test/assets/template-test-verify.jsonl +5 -5
- package/dist/.claude-template/skills/run-api-test/references/report-format.md +54 -19
- package/dist/.claude-template/skills/subagent-implement/SKILL.md +60 -183
- package/dist/.claude-template/skills/subagent-implement/implementer-prompt.md +9 -4
- package/dist/.claude-template/skills/subagent-implement/quality-reviewer-prompt.md +1 -1
- package/dist/.claude-template/skills/subagent-implement/spec-reviewer-prompt.md +1 -0
- package/dist/.claude-template/skills/write-api/SKILL.md +7 -5
- package/dist/.claude-template/skills/write-api/assets/template-api-spec.md +2 -3
- package/dist/.claude-template/skills/write-api/assets/template-request.bru +21 -0
- package/dist/.claude-template/skills/write-api/references/ai-prompts.md +1 -2
- package/dist/.claude-template/skills/write-api/references/api-spec-format.md +0 -1
- package/dist/.claude-template/skills/write-api-doc/SKILL.md +8 -7
- package/dist/.claude-template/skills/write-design-doc/SKILL.md +86 -0
- package/dist/.claude-template/skills/write-design-doc/template-design-html.md +357 -0
- package/dist/.claude-template/skills/write-design-doc/template-design-md.md +164 -0
- package/dist/.claude-template/skills/write-plan/SKILL.md +94 -291
- package/dist/.claude-template/skills/write-plan/plan-document-reviewer-prompt.md +24 -6
- package/dist/.claude-template/skills/write-prd/SKILL.md +4 -2
- package/dist/.claude-template/skills/write-spec/SKILL.md +75 -282
- package/dist/.claude-template/skills/write-unit-test-code/SKILL.md +87 -2
- package/dist/.claude-template/skills/write-workload/SKILL.md +130 -0
- package/dist/cli/fatal-handler.d.ts +21 -0
- package/dist/cli/fatal-handler.d.ts.map +1 -0
- package/dist/cli/fatal-handler.js +109 -0
- package/dist/cli/fatal-handler.js.map +1 -0
- package/dist/cli/index.d.ts +27 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +248 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/installer/claude-assets.d.ts +101 -0
- package/dist/cli/installer/claude-assets.d.ts.map +1 -0
- package/dist/cli/installer/claude-assets.js +321 -0
- package/dist/cli/installer/claude-assets.js.map +1 -0
- package/dist/cli/installer/index.d.ts +105 -0
- package/dist/cli/installer/index.d.ts.map +1 -0
- package/dist/cli/installer/index.js +548 -0
- package/dist/cli/installer/index.js.map +1 -0
- package/dist/cli/installer/targets/claude.d.ts +72 -0
- package/dist/cli/installer/targets/claude.d.ts.map +1 -0
- package/dist/cli/installer/targets/claude.js +580 -0
- package/dist/cli/installer/targets/claude.js.map +1 -0
- package/dist/cli/installer/targets/registry.d.ts +32 -0
- package/dist/cli/installer/targets/registry.d.ts.map +1 -0
- package/dist/cli/installer/targets/registry.js +72 -0
- package/dist/cli/installer/targets/registry.js.map +1 -0
- package/dist/cli/installer/targets/shared.d.ts +66 -0
- package/dist/cli/installer/targets/shared.d.ts.map +1 -0
- package/dist/cli/installer/targets/shared.js +228 -0
- package/dist/cli/installer/targets/shared.js.map +1 -0
- package/dist/cli/installer/targets/types.d.ts +97 -0
- package/dist/cli/installer/targets/types.d.ts.map +1 -0
- package/dist/cli/installer/targets/types.js +16 -0
- package/dist/cli/installer/targets/types.js.map +1 -0
- package/dist/cli/node-version-check.d.ts +32 -0
- package/dist/cli/node-version-check.d.ts.map +1 -0
- package/dist/cli/node-version-check.js +54 -0
- package/dist/cli/node-version-check.js.map +1 -0
- package/dist/cli/ui/glyphs.d.ts +43 -0
- package/dist/cli/ui/glyphs.d.ts.map +1 -0
- package/dist/cli/ui/glyphs.js +79 -0
- package/dist/cli/ui/glyphs.js.map +1 -0
- package/dist/cli/uninstall.d.ts +18 -0
- package/dist/cli/uninstall.d.ts.map +1 -0
- package/dist/cli/uninstall.js +19 -0
- package/dist/cli/uninstall.js.map +1 -0
- package/dist/cli/upgrade/index.d.ts +81 -0
- package/dist/cli/upgrade/index.d.ts.map +1 -0
- package/dist/cli/upgrade/index.js +257 -0
- package/dist/cli/upgrade/index.js.map +1 -0
- package/dist/core/db/index.d.ts +123 -0
- package/dist/core/db/index.d.ts.map +1 -0
- package/dist/core/db/index.js +260 -0
- package/dist/core/db/index.js.map +1 -0
- package/dist/core/db/migrate.d.ts +29 -0
- package/dist/core/db/migrate.d.ts.map +1 -0
- package/dist/core/db/migrate.js +100 -0
- package/dist/core/db/migrate.js.map +1 -0
- package/dist/core/db/sqlite-adapter.d.ts +51 -0
- package/dist/core/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/core/db/sqlite-adapter.js +116 -0
- package/dist/core/db/sqlite-adapter.js.map +1 -0
- package/dist/core/dbquery/cli.d.ts +17 -0
- package/dist/core/dbquery/cli.d.ts.map +1 -0
- package/dist/core/dbquery/cli.js +246 -0
- package/dist/core/dbquery/cli.js.map +1 -0
- package/dist/core/dbquery/config.d.ts.map +1 -0
- package/dist/core/dbquery/config.js.map +1 -0
- package/dist/core/dbquery/constants.d.ts.map +1 -0
- package/dist/core/dbquery/constants.js.map +1 -0
- package/dist/core/dbquery/drivers/mysql.d.ts.map +1 -0
- package/dist/core/dbquery/drivers/mysql.js.map +1 -0
- package/dist/core/dbquery/drivers/postgres.d.ts.map +1 -0
- package/dist/core/dbquery/drivers/postgres.js.map +1 -0
- package/dist/core/dbquery/errors.d.ts +40 -0
- package/dist/core/dbquery/errors.d.ts.map +1 -0
- package/dist/core/dbquery/errors.js +85 -0
- package/dist/core/dbquery/errors.js.map +1 -0
- package/dist/core/dbquery/executor.d.ts.map +1 -0
- package/dist/core/dbquery/executor.js.map +1 -0
- package/dist/core/dbquery/format.d.ts.map +1 -0
- package/dist/core/dbquery/format.js.map +1 -0
- package/dist/core/dbquery/identifiers.d.ts.map +1 -0
- package/dist/core/dbquery/identifiers.js.map +1 -0
- package/dist/core/dbquery/index.d.ts.map +1 -0
- package/dist/core/dbquery/index.js.map +1 -0
- package/dist/core/dbquery/init.d.ts +33 -0
- package/dist/core/dbquery/init.d.ts.map +1 -0
- package/dist/core/dbquery/init.js +125 -0
- package/dist/core/dbquery/init.js.map +1 -0
- package/dist/core/dbquery/logging.d.ts.map +1 -0
- package/dist/core/dbquery/logging.js.map +1 -0
- package/dist/core/dbquery/queries.d.ts.map +1 -0
- package/dist/core/dbquery/queries.js.map +1 -0
- package/dist/core/dbquery/safety.d.ts.map +1 -0
- package/dist/core/dbquery/safety.js.map +1 -0
- package/dist/core/dbquery/types.d.ts +139 -0
- package/dist/core/dbquery/types.d.ts.map +1 -0
- package/dist/core/dbquery/types.js +10 -0
- package/dist/core/dbquery/types.js.map +1 -0
- package/dist/core/directory.d.ts +60 -0
- package/dist/core/directory.d.ts.map +1 -0
- package/dist/core/directory.js +243 -0
- package/dist/core/directory.js.map +1 -0
- package/dist/core/errors.d.ts +79 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +133 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/features/cli.d.ts +12 -0
- package/dist/core/features/cli.d.ts.map +1 -0
- package/dist/core/features/cli.js +154 -0
- package/dist/core/features/cli.js.map +1 -0
- package/dist/core/features/index.d.ts +15 -0
- package/dist/core/features/index.d.ts.map +1 -0
- package/dist/core/features/index.js +39 -0
- package/dist/core/features/index.js.map +1 -0
- package/dist/core/features/scanner.d.ts +26 -0
- package/dist/core/features/scanner.d.ts.map +1 -0
- package/dist/core/features/scanner.js +198 -0
- package/dist/core/features/scanner.js.map +1 -0
- package/dist/core/features/sync.d.ts +26 -0
- package/dist/core/features/sync.d.ts.map +1 -0
- package/dist/core/features/sync.js +108 -0
- package/dist/core/features/sync.js.map +1 -0
- package/dist/core/features/types.d.ts +35 -0
- package/dist/core/features/types.d.ts.map +1 -0
- package/dist/core/features/types.js +12 -0
- package/dist/core/features/types.js.map +1 -0
- package/dist/core/markdown/cli.d.ts +16 -0
- package/dist/core/markdown/cli.d.ts.map +1 -0
- package/dist/core/markdown/cli.js +575 -0
- package/dist/core/markdown/cli.js.map +1 -0
- package/dist/core/markdown/constants.d.ts +22 -0
- package/dist/core/markdown/constants.d.ts.map +1 -0
- package/dist/core/markdown/constants.js +61 -0
- package/dist/core/markdown/constants.js.map +1 -0
- package/dist/core/markdown/dedup.d.ts.map +1 -0
- package/dist/core/markdown/dedup.js.map +1 -0
- package/dist/core/markdown/errors.d.ts +22 -0
- package/dist/core/markdown/errors.d.ts.map +1 -0
- package/dist/core/markdown/errors.js +45 -0
- package/dist/core/markdown/errors.js.map +1 -0
- package/dist/core/markdown/extractor.d.ts.map +1 -0
- package/dist/core/markdown/extractor.js.map +1 -0
- package/dist/core/markdown/frontmatter-parser.d.ts +54 -0
- package/dist/core/markdown/frontmatter-parser.d.ts.map +1 -0
- package/dist/core/markdown/frontmatter-parser.js +229 -0
- package/dist/core/markdown/frontmatter-parser.js.map +1 -0
- package/dist/core/markdown/index.d.ts +21 -0
- package/dist/core/markdown/index.d.ts.map +1 -0
- package/dist/core/markdown/index.js +36 -0
- package/dist/core/markdown/index.js.map +1 -0
- package/dist/core/markdown/indexer.d.ts +34 -0
- package/dist/core/markdown/indexer.d.ts.map +1 -0
- package/dist/core/markdown/indexer.js +256 -0
- package/dist/core/markdown/indexer.js.map +1 -0
- package/dist/core/markdown/query-dedup.d.ts +23 -0
- package/dist/core/markdown/query-dedup.d.ts.map +1 -0
- package/dist/core/markdown/query-dedup.js +141 -0
- package/dist/core/markdown/query-dedup.js.map +1 -0
- package/dist/core/markdown/query-helpers.d.ts +66 -0
- package/dist/core/markdown/query-helpers.d.ts.map +1 -0
- package/dist/core/markdown/query-helpers.js +334 -0
- package/dist/core/markdown/query-helpers.js.map +1 -0
- package/dist/core/markdown/query.d.ts +125 -0
- package/dist/core/markdown/query.d.ts.map +1 -0
- package/dist/core/markdown/query.js +367 -0
- package/dist/core/markdown/query.js.map +1 -0
- package/dist/core/markdown/schema-bootstrap.d.ts +40 -0
- package/dist/core/markdown/schema-bootstrap.d.ts.map +1 -0
- package/dist/core/markdown/schema-bootstrap.js +85 -0
- package/dist/core/markdown/schema-bootstrap.js.map +1 -0
- package/dist/core/markdown/schema.sql +124 -0
- package/dist/core/markdown/store.d.ts.map +1 -0
- package/dist/core/markdown/store.js.map +1 -0
- package/dist/core/markdown/summary-extractor.d.ts.map +1 -0
- package/dist/core/markdown/summary-extractor.js.map +1 -0
- package/dist/core/markdown/types.d.ts +186 -0
- package/dist/core/markdown/types.d.ts.map +1 -0
- package/dist/core/markdown/types.js.map +1 -0
- package/dist/core/markdown/validator.d.ts +44 -0
- package/dist/core/markdown/validator.d.ts.map +1 -0
- package/dist/core/markdown/validator.js +95 -0
- package/dist/core/markdown/validator.js.map +1 -0
- package/dist/core/timeline/bash-semantics.d.ts.map +1 -0
- package/dist/core/timeline/bash-semantics.js.map +1 -0
- package/dist/core/timeline/cli.d.ts.map +1 -0
- package/dist/core/timeline/cli.js.map +1 -0
- package/dist/core/timeline/constants.d.ts +62 -0
- package/dist/core/timeline/constants.d.ts.map +1 -0
- package/dist/core/timeline/constants.js +73 -0
- package/dist/core/timeline/constants.js.map +1 -0
- package/dist/core/timeline/errors.d.ts.map +1 -0
- package/dist/core/timeline/errors.js.map +1 -0
- package/dist/core/timeline/hook-runner.d.ts.map +1 -0
- package/dist/core/timeline/hook-runner.js.map +1 -0
- package/dist/core/timeline/hooks.d.ts.map +1 -0
- package/dist/core/timeline/hooks.js.map +1 -0
- package/dist/core/timeline/index.d.ts.map +1 -0
- package/dist/core/timeline/index.js.map +1 -0
- package/dist/core/timeline/indexer.d.ts.map +1 -0
- package/dist/core/timeline/indexer.js.map +1 -0
- package/dist/core/timeline/installer.d.ts.map +1 -0
- package/dist/core/timeline/installer.js.map +1 -0
- package/dist/core/timeline/payload.d.ts.map +1 -0
- package/dist/core/timeline/payload.js.map +1 -0
- package/dist/core/timeline/post-tool-summary.d.ts.map +1 -0
- package/dist/core/timeline/post-tool-summary.js.map +1 -0
- package/dist/core/timeline/recorder.d.ts.map +1 -0
- package/dist/core/timeline/recorder.js.map +1 -0
- package/dist/core/timeline/schema-bootstrap.d.ts +42 -0
- package/dist/core/timeline/schema-bootstrap.d.ts.map +1 -0
- package/dist/core/timeline/schema-bootstrap.js +81 -0
- package/dist/core/timeline/schema-bootstrap.js.map +1 -0
- package/dist/core/timeline/store.d.ts.map +1 -0
- package/dist/core/timeline/store.js.map +1 -0
- package/dist/core/timeline/types.d.ts.map +1 -0
- package/dist/core/timeline/types.js.map +1 -0
- package/dist/core/types.d.ts +25 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +12 -0
- package/dist/core/types.js.map +1 -0
- package/dist/web/bootstrap.d.ts +26 -0
- package/dist/web/bootstrap.d.ts.map +1 -0
- package/dist/web/bootstrap.js +98 -0
- package/dist/web/bootstrap.js.map +1 -0
- package/dist/web/constants.d.ts +27 -0
- package/dist/web/constants.d.ts.map +1 -0
- package/dist/web/constants.js +41 -0
- package/dist/web/constants.js.map +1 -0
- package/dist/web/errors.d.ts +46 -0
- package/dist/web/errors.d.ts.map +1 -0
- package/dist/web/errors.js +56 -0
- package/dist/web/errors.js.map +1 -0
- package/dist/web/index.d.ts +13 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +20 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/layout.d.ts +31 -0
- package/dist/web/layout.d.ts.map +1 -0
- package/dist/web/layout.js +77 -0
- package/dist/web/layout.js.map +1 -0
- package/dist/web/markdown.d.ts +23 -0
- package/dist/web/markdown.d.ts.map +1 -0
- package/dist/web/markdown.js +38 -0
- package/dist/web/markdown.js.map +1 -0
- package/dist/web/overview-templates.d.ts +123 -0
- package/dist/web/overview-templates.d.ts.map +1 -0
- package/dist/web/overview-templates.js +213 -0
- package/dist/web/overview-templates.js.map +1 -0
- package/dist/web/pages-detail.d.ts +32 -0
- package/dist/web/pages-detail.d.ts.map +1 -0
- package/dist/web/pages-detail.js +275 -0
- package/dist/web/pages-detail.js.map +1 -0
- package/dist/web/pages-overview.d.ts +60 -0
- package/dist/web/pages-overview.d.ts.map +1 -0
- package/dist/web/pages-overview.js +304 -0
- package/dist/web/pages-overview.js.map +1 -0
- package/dist/web/public/app.css +1772 -0
- package/dist/web/public/app.js +41 -0
- package/dist/web/register.d.ts +12 -0
- package/dist/web/register.d.ts.map +1 -0
- package/dist/web/register.js +88 -0
- package/dist/web/register.js.map +1 -0
- package/dist/web/render-utils.d.ts +28 -0
- package/dist/web/render-utils.d.ts.map +1 -0
- package/dist/web/render-utils.js +54 -0
- package/dist/web/render-utils.js.map +1 -0
- package/dist/web/server.d.ts +42 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +292 -0
- package/dist/web/server.js.map +1 -0
- package/package.json +14 -27
- package/scripts/copy-assets.cjs +89 -0
- package/dist/.claude-template/commands/my-commit.md +0 -9
- package/dist/.claude-template/skills/cgraphx/SKILL.md +0 -143
- package/dist/.claude-template/skills/cgraphx/agent-prompt.md +0 -56
- package/dist/.claude-template/skills/code-impact-api/SKILL.md +0 -143
- package/dist/.claude-template/skills/code-impact-api/agent-prompt.md +0 -51
- package/dist/.claude-template/skills/code-impact-docgen/SKILL.md +0 -376
- package/dist/.claude-template/skills/code-impact-docgen/template-design-html.md +0 -357
- package/dist/.claude-template/skills/code-impact-docgen/template-design-md.md +0 -164
- package/dist/.claude-template/skills/code-impact-init/SKILL.md +0 -803
- package/dist/.claude-template/skills/code-impact-markdown/SKILL.md +0 -353
- package/dist/.claude-template/skills/code-impact-markdown/template-guide.md +0 -68
- package/dist/.claude-template/skills/code-impact-markdown/template-memory.md +0 -82
- package/dist/.claude-template/skills/code-impact-markdown/template-runbook.md +0 -58
- package/dist/.claude-template/skills/precommit-review/SKILL.md +0 -50
- package/dist/api-test/ai-fields.d.ts +0 -37
- package/dist/api-test/ai-fields.d.ts.map +0 -1
- package/dist/api-test/ai-fields.js +0 -114
- package/dist/api-test/ai-fields.js.map +0 -1
- package/dist/api-test/assemble.d.ts +0 -76
- package/dist/api-test/assemble.d.ts.map +0 -1
- package/dist/api-test/assemble.js +0 -185
- package/dist/api-test/assemble.js.map +0 -1
- package/dist/api-test/bru-cli-invoker.d.ts +0 -72
- package/dist/api-test/bru-cli-invoker.d.ts.map +0 -1
- package/dist/api-test/bru-cli-invoker.js +0 -169
- package/dist/api-test/bru-cli-invoker.js.map +0 -1
- package/dist/api-test/bru-report-parser.d.ts +0 -24
- package/dist/api-test/bru-report-parser.d.ts.map +0 -1
- package/dist/api-test/bru-report-parser.js +0 -110
- package/dist/api-test/bru-report-parser.js.map +0 -1
- package/dist/api-test/bru-runner.d.ts +0 -101
- package/dist/api-test/bru-runner.d.ts.map +0 -1
- package/dist/api-test/bru-runner.js +0 -316
- package/dist/api-test/bru-runner.js.map +0 -1
- package/dist/api-test/bru-writer.d.ts +0 -52
- package/dist/api-test/bru-writer.d.ts.map +0 -1
- package/dist/api-test/bru-writer.js +0 -159
- package/dist/api-test/bru-writer.js.map +0 -1
- package/dist/api-test/call-chain-extractor.d.ts +0 -80
- package/dist/api-test/call-chain-extractor.d.ts.map +0 -1
- package/dist/api-test/call-chain-extractor.js +0 -179
- package/dist/api-test/call-chain-extractor.js.map +0 -1
- package/dist/api-test/cli.d.ts +0 -133
- package/dist/api-test/cli.d.ts.map +0 -1
- package/dist/api-test/cli.js +0 -1009
- package/dist/api-test/cli.js.map +0 -1
- package/dist/api-test/config.d.ts +0 -75
- package/dist/api-test/config.d.ts.map +0 -1
- package/dist/api-test/config.js +0 -406
- package/dist/api-test/config.js.map +0 -1
- package/dist/api-test/db-query-cli.d.ts +0 -51
- package/dist/api-test/db-query-cli.d.ts.map +0 -1
- package/dist/api-test/db-query-cli.js +0 -119
- package/dist/api-test/db-query-cli.js.map +0 -1
- package/dist/api-test/enhance-prepare.d.ts +0 -111
- package/dist/api-test/enhance-prepare.d.ts.map +0 -1
- package/dist/api-test/enhance-prepare.js +0 -425
- package/dist/api-test/enhance-prepare.js.map +0 -1
- package/dist/api-test/enhance-write.d.ts +0 -28
- package/dist/api-test/enhance-write.d.ts.map +0 -1
- package/dist/api-test/enhance-write.js +0 -145
- package/dist/api-test/enhance-write.js.map +0 -1
- package/dist/api-test/errors.d.ts +0 -48
- package/dist/api-test/errors.d.ts.map +0 -1
- package/dist/api-test/errors.js +0 -76
- package/dist/api-test/errors.js.map +0 -1
- package/dist/api-test/field-extractor.d.ts +0 -98
- package/dist/api-test/field-extractor.d.ts.map +0 -1
- package/dist/api-test/field-extractor.js +0 -327
- package/dist/api-test/field-extractor.js.map +0 -1
- package/dist/api-test/impl-finder.d.ts +0 -37
- package/dist/api-test/impl-finder.d.ts.map +0 -1
- package/dist/api-test/impl-finder.js +0 -54
- package/dist/api-test/impl-finder.js.map +0 -1
- package/dist/api-test/index.d.ts +0 -41
- package/dist/api-test/index.d.ts.map +0 -1
- package/dist/api-test/index.js +0 -124
- package/dist/api-test/index.js.map +0 -1
- package/dist/api-test/java-parser.d.ts +0 -89
- package/dist/api-test/java-parser.d.ts.map +0 -1
- package/dist/api-test/java-parser.js +0 -508
- package/dist/api-test/java-parser.js.map +0 -1
- package/dist/api-test/md-writer.d.ts +0 -49
- package/dist/api-test/md-writer.d.ts.map +0 -1
- package/dist/api-test/md-writer.js +0 -202
- package/dist/api-test/md-writer.js.map +0 -1
- package/dist/api-test/parser-httpservice.d.ts +0 -91
- package/dist/api-test/parser-httpservice.d.ts.map +0 -1
- package/dist/api-test/parser-httpservice.js +0 -271
- package/dist/api-test/parser-httpservice.js.map +0 -1
- package/dist/api-test/report.d.ts +0 -188
- package/dist/api-test/report.d.ts.map +0 -1
- package/dist/api-test/report.js +0 -522
- package/dist/api-test/report.js.map +0 -1
- package/dist/api-test/snapshot.d.ts +0 -26
- package/dist/api-test/snapshot.d.ts.map +0 -1
- package/dist/api-test/snapshot.js +0 -150
- package/dist/api-test/snapshot.js.map +0 -1
- package/dist/api-test/test-history.d.ts +0 -48
- package/dist/api-test/test-history.d.ts.map +0 -1
- package/dist/api-test/test-history.js +0 -122
- package/dist/api-test/test-history.js.map +0 -1
- package/dist/api-test/types.d.ts +0 -174
- package/dist/api-test/types.d.ts.map +0 -1
- package/dist/api-test/types.js +0 -13
- package/dist/api-test/types.js.map +0 -1
- package/dist/api-test/verify-prepare.d.ts +0 -30
- package/dist/api-test/verify-prepare.d.ts.map +0 -1
- package/dist/api-test/verify-prepare.js +0 -150
- package/dist/api-test/verify-prepare.js.map +0 -1
- package/dist/api-test/verify-write.d.ts +0 -31
- package/dist/api-test/verify-write.d.ts.map +0 -1
- package/dist/api-test/verify-write.js +0 -159
- package/dist/api-test/verify-write.js.map +0 -1
- package/dist/bin/codegraph.d.ts +0 -26
- package/dist/bin/codegraph.d.ts.map +0 -1
- package/dist/bin/codegraph.js +0 -1914
- package/dist/bin/codegraph.js.map +0 -1
- package/dist/bin/fatal-handler.d.ts +0 -20
- package/dist/bin/fatal-handler.d.ts.map +0 -1
- package/dist/bin/fatal-handler.js +0 -118
- package/dist/bin/fatal-handler.js.map +0 -1
- package/dist/bin/node-version-check.d.ts +0 -51
- package/dist/bin/node-version-check.d.ts.map +0 -1
- package/dist/bin/node-version-check.js +0 -114
- package/dist/bin/node-version-check.js.map +0 -1
- package/dist/bin/uninstall.d.ts +0 -14
- package/dist/bin/uninstall.d.ts.map +0 -1
- package/dist/bin/uninstall.js +0 -36
- package/dist/bin/uninstall.js.map +0 -1
- package/dist/context/formatter.d.ts +0 -30
- package/dist/context/formatter.d.ts.map +0 -1
- package/dist/context/formatter.js +0 -263
- package/dist/context/formatter.js.map +0 -1
- package/dist/context/index.d.ts +0 -119
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -1296
- package/dist/context/index.js.map +0 -1
- package/dist/context/markers.d.ts +0 -19
- package/dist/context/markers.d.ts.map +0 -1
- package/dist/context/markers.js +0 -22
- package/dist/context/markers.js.map +0 -1
- package/dist/db/index.d.ts +0 -122
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js +0 -296
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations.d.ts +0 -44
- package/dist/db/migrations.d.ts.map +0 -1
- package/dist/db/migrations.js +0 -140
- package/dist/db/migrations.js.map +0 -1
- package/dist/db/queries.d.ts +0 -401
- package/dist/db/queries.d.ts.map +0 -1
- package/dist/db/queries.js +0 -1591
- package/dist/db/queries.js.map +0 -1
- package/dist/db/schema.sql +0 -152
- package/dist/db/sqlite-adapter.d.ts +0 -53
- package/dist/db/sqlite-adapter.d.ts.map +0 -1
- package/dist/db/sqlite-adapter.js +0 -117
- package/dist/db/sqlite-adapter.js.map +0 -1
- package/dist/dbquery/cli.d.ts +0 -17
- package/dist/dbquery/cli.d.ts.map +0 -1
- package/dist/dbquery/cli.js +0 -246
- package/dist/dbquery/cli.js.map +0 -1
- package/dist/dbquery/config.d.ts.map +0 -1
- package/dist/dbquery/config.js.map +0 -1
- package/dist/dbquery/constants.d.ts.map +0 -1
- package/dist/dbquery/constants.js.map +0 -1
- package/dist/dbquery/drivers/mysql.d.ts.map +0 -1
- package/dist/dbquery/drivers/mysql.js.map +0 -1
- package/dist/dbquery/drivers/postgres.d.ts.map +0 -1
- package/dist/dbquery/drivers/postgres.js.map +0 -1
- package/dist/dbquery/dump-schema.d.ts +0 -46
- package/dist/dbquery/dump-schema.d.ts.map +0 -1
- package/dist/dbquery/dump-schema.js +0 -379
- package/dist/dbquery/dump-schema.js.map +0 -1
- package/dist/dbquery/errors.d.ts +0 -40
- package/dist/dbquery/errors.d.ts.map +0 -1
- package/dist/dbquery/errors.js +0 -85
- package/dist/dbquery/errors.js.map +0 -1
- package/dist/dbquery/executor.d.ts.map +0 -1
- package/dist/dbquery/executor.js.map +0 -1
- package/dist/dbquery/format.d.ts.map +0 -1
- package/dist/dbquery/format.js.map +0 -1
- package/dist/dbquery/identifiers.d.ts.map +0 -1
- package/dist/dbquery/identifiers.js.map +0 -1
- package/dist/dbquery/index.d.ts.map +0 -1
- package/dist/dbquery/index.js.map +0 -1
- package/dist/dbquery/init.d.ts +0 -33
- package/dist/dbquery/init.d.ts.map +0 -1
- package/dist/dbquery/init.js +0 -125
- package/dist/dbquery/init.js.map +0 -1
- package/dist/dbquery/logging.d.ts.map +0 -1
- package/dist/dbquery/logging.js.map +0 -1
- package/dist/dbquery/mcp-tools.d.ts +0 -29
- package/dist/dbquery/mcp-tools.d.ts.map +0 -1
- package/dist/dbquery/mcp-tools.js +0 -206
- package/dist/dbquery/mcp-tools.js.map +0 -1
- package/dist/dbquery/queries.d.ts.map +0 -1
- package/dist/dbquery/queries.js.map +0 -1
- package/dist/dbquery/safety.d.ts.map +0 -1
- package/dist/dbquery/safety.js.map +0 -1
- package/dist/dbquery/types.d.ts +0 -139
- package/dist/dbquery/types.d.ts.map +0 -1
- package/dist/dbquery/types.js +0 -10
- package/dist/dbquery/types.js.map +0 -1
- package/dist/directory.d.ts +0 -147
- package/dist/directory.d.ts.map +0 -1
- package/dist/directory.js +0 -523
- package/dist/directory.js.map +0 -1
- package/dist/errors.d.ts +0 -136
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -219
- package/dist/errors.js.map +0 -1
- package/dist/extraction/astro-extractor.d.ts +0 -79
- package/dist/extraction/astro-extractor.d.ts.map +0 -1
- package/dist/extraction/astro-extractor.js +0 -320
- package/dist/extraction/astro-extractor.js.map +0 -1
- package/dist/extraction/dfm-extractor.d.ts +0 -31
- package/dist/extraction/dfm-extractor.d.ts.map +0 -1
- package/dist/extraction/dfm-extractor.js +0 -151
- package/dist/extraction/dfm-extractor.js.map +0 -1
- package/dist/extraction/extraction-version.d.ts +0 -25
- package/dist/extraction/extraction-version.d.ts.map +0 -1
- package/dist/extraction/extraction-version.js +0 -28
- package/dist/extraction/extraction-version.js.map +0 -1
- package/dist/extraction/function-ref.d.ts +0 -118
- package/dist/extraction/function-ref.d.ts.map +0 -1
- package/dist/extraction/function-ref.js +0 -727
- package/dist/extraction/function-ref.js.map +0 -1
- package/dist/extraction/generated-detection.d.ts +0 -30
- package/dist/extraction/generated-detection.d.ts.map +0 -1
- package/dist/extraction/generated-detection.js +0 -83
- package/dist/extraction/generated-detection.js.map +0 -1
- package/dist/extraction/grammars.d.ts +0 -114
- package/dist/extraction/grammars.d.ts.map +0 -1
- package/dist/extraction/grammars.js +0 -477
- package/dist/extraction/grammars.js.map +0 -1
- package/dist/extraction/index.d.ts +0 -175
- package/dist/extraction/index.d.ts.map +0 -1
- package/dist/extraction/index.js +0 -1887
- package/dist/extraction/index.js.map +0 -1
- package/dist/extraction/languages/c-cpp.d.ts +0 -12
- package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
- package/dist/extraction/languages/c-cpp.js +0 -275
- package/dist/extraction/languages/c-cpp.js.map +0 -1
- package/dist/extraction/languages/csharp.d.ts +0 -25
- package/dist/extraction/languages/csharp.d.ts.map +0 -1
- package/dist/extraction/languages/csharp.js +0 -175
- package/dist/extraction/languages/csharp.js.map +0 -1
- package/dist/extraction/languages/dart.d.ts +0 -3
- package/dist/extraction/languages/dart.d.ts.map +0 -1
- package/dist/extraction/languages/dart.js +0 -374
- package/dist/extraction/languages/dart.js.map +0 -1
- package/dist/extraction/languages/go.d.ts +0 -3
- package/dist/extraction/languages/go.d.ts.map +0 -1
- package/dist/extraction/languages/go.js +0 -111
- package/dist/extraction/languages/go.js.map +0 -1
- package/dist/extraction/languages/index.d.ts +0 -10
- package/dist/extraction/languages/index.d.ts.map +0 -1
- package/dist/extraction/languages/index.js +0 -53
- package/dist/extraction/languages/index.js.map +0 -1
- package/dist/extraction/languages/java.d.ts +0 -3
- package/dist/extraction/languages/java.d.ts.map +0 -1
- package/dist/extraction/languages/java.js +0 -315
- package/dist/extraction/languages/java.js.map +0 -1
- package/dist/extraction/languages/javascript.d.ts +0 -3
- package/dist/extraction/languages/javascript.d.ts.map +0 -1
- package/dist/extraction/languages/javascript.js +0 -106
- package/dist/extraction/languages/javascript.js.map +0 -1
- package/dist/extraction/languages/kotlin.d.ts +0 -3
- package/dist/extraction/languages/kotlin.d.ts.map +0 -1
- package/dist/extraction/languages/kotlin.js +0 -379
- package/dist/extraction/languages/kotlin.js.map +0 -1
- package/dist/extraction/languages/lua.d.ts +0 -3
- package/dist/extraction/languages/lua.d.ts.map +0 -1
- package/dist/extraction/languages/lua.js +0 -150
- package/dist/extraction/languages/lua.js.map +0 -1
- package/dist/extraction/languages/luau.d.ts +0 -3
- package/dist/extraction/languages/luau.d.ts.map +0 -1
- package/dist/extraction/languages/luau.js +0 -37
- package/dist/extraction/languages/luau.js.map +0 -1
- package/dist/extraction/languages/objc.d.ts +0 -3
- package/dist/extraction/languages/objc.d.ts.map +0 -1
- package/dist/extraction/languages/objc.js +0 -175
- package/dist/extraction/languages/objc.js.map +0 -1
- package/dist/extraction/languages/pascal.d.ts +0 -3
- package/dist/extraction/languages/pascal.d.ts.map +0 -1
- package/dist/extraction/languages/pascal.js +0 -77
- package/dist/extraction/languages/pascal.js.map +0 -1
- package/dist/extraction/languages/php.d.ts +0 -3
- package/dist/extraction/languages/php.d.ts.map +0 -1
- package/dist/extraction/languages/php.js +0 -196
- package/dist/extraction/languages/php.js.map +0 -1
- package/dist/extraction/languages/python.d.ts +0 -3
- package/dist/extraction/languages/python.d.ts.map +0 -1
- package/dist/extraction/languages/python.js +0 -56
- package/dist/extraction/languages/python.js.map +0 -1
- package/dist/extraction/languages/r.d.ts +0 -3
- package/dist/extraction/languages/r.d.ts.map +0 -1
- package/dist/extraction/languages/r.js +0 -314
- package/dist/extraction/languages/r.js.map +0 -1
- package/dist/extraction/languages/ruby.d.ts +0 -3
- package/dist/extraction/languages/ruby.d.ts.map +0 -1
- package/dist/extraction/languages/ruby.js +0 -149
- package/dist/extraction/languages/ruby.js.map +0 -1
- package/dist/extraction/languages/rust.d.ts +0 -3
- package/dist/extraction/languages/rust.d.ts.map +0 -1
- package/dist/extraction/languages/rust.js +0 -142
- package/dist/extraction/languages/rust.js.map +0 -1
- package/dist/extraction/languages/scala.d.ts +0 -3
- package/dist/extraction/languages/scala.d.ts.map +0 -1
- package/dist/extraction/languages/scala.js +0 -209
- package/dist/extraction/languages/scala.js.map +0 -1
- package/dist/extraction/languages/swift.d.ts +0 -3
- package/dist/extraction/languages/swift.d.ts.map +0 -1
- package/dist/extraction/languages/swift.js +0 -152
- package/dist/extraction/languages/swift.js.map +0 -1
- package/dist/extraction/languages/typescript.d.ts +0 -16
- package/dist/extraction/languages/typescript.d.ts.map +0 -1
- package/dist/extraction/languages/typescript.js +0 -167
- package/dist/extraction/languages/typescript.js.map +0 -1
- package/dist/extraction/liquid-extractor.d.ts +0 -59
- package/dist/extraction/liquid-extractor.d.ts.map +0 -1
- package/dist/extraction/liquid-extractor.js +0 -357
- package/dist/extraction/liquid-extractor.js.map +0 -1
- package/dist/extraction/mybatis-extractor.d.ts +0 -48
- package/dist/extraction/mybatis-extractor.d.ts.map +0 -1
- package/dist/extraction/mybatis-extractor.js +0 -198
- package/dist/extraction/mybatis-extractor.js.map +0 -1
- package/dist/extraction/parse-worker.d.ts +0 -8
- package/dist/extraction/parse-worker.d.ts.map +0 -1
- package/dist/extraction/parse-worker.js +0 -97
- package/dist/extraction/parse-worker.js.map +0 -1
- package/dist/extraction/razor-extractor.d.ts +0 -42
- package/dist/extraction/razor-extractor.d.ts.map +0 -1
- package/dist/extraction/razor-extractor.js +0 -285
- package/dist/extraction/razor-extractor.js.map +0 -1
- package/dist/extraction/svelte-extractor.d.ts +0 -56
- package/dist/extraction/svelte-extractor.d.ts.map +0 -1
- package/dist/extraction/svelte-extractor.js +0 -275
- package/dist/extraction/svelte-extractor.js.map +0 -1
- package/dist/extraction/tree-sitter-helpers.d.ts +0 -28
- package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-helpers.js +0 -152
- package/dist/extraction/tree-sitter-helpers.js.map +0 -1
- package/dist/extraction/tree-sitter-types.d.ts +0 -239
- package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-types.js +0 -10
- package/dist/extraction/tree-sitter-types.js.map +0 -1
- package/dist/extraction/tree-sitter.d.ts +0 -647
- package/dist/extraction/tree-sitter.d.ts.map +0 -1
- package/dist/extraction/tree-sitter.js +0 -5592
- package/dist/extraction/tree-sitter.js.map +0 -1
- package/dist/extraction/vue-extractor.d.ts +0 -51
- package/dist/extraction/vue-extractor.d.ts.map +0 -1
- package/dist/extraction/vue-extractor.js +0 -254
- package/dist/extraction/vue-extractor.js.map +0 -1
- 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 +0 -38
- package/dist/extraction/wasm-runtime-flags.d.ts.map +0 -1
- package/dist/extraction/wasm-runtime-flags.js +0 -106
- package/dist/extraction/wasm-runtime-flags.js.map +0 -1
- package/dist/graph/index.d.ts +0 -8
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js +0 -13
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/queries.d.ts +0 -106
- package/dist/graph/queries.d.ts.map +0 -1
- package/dist/graph/queries.js +0 -339
- package/dist/graph/queries.js.map +0 -1
- package/dist/graph/traversal.d.ts +0 -127
- package/dist/graph/traversal.d.ts.map +0 -1
- package/dist/graph/traversal.js +0 -540
- package/dist/graph/traversal.js.map +0 -1
- package/dist/index.d.ts +0 -563
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1041
- package/dist/index.js.map +0 -1
- package/dist/installer/claude-assets.d.ts +0 -45
- package/dist/installer/claude-assets.d.ts.map +0 -1
- package/dist/installer/claude-assets.js +0 -144
- package/dist/installer/claude-assets.js.map +0 -1
- package/dist/installer/config-writer.d.ts +0 -28
- package/dist/installer/config-writer.d.ts.map +0 -1
- package/dist/installer/config-writer.js +0 -91
- package/dist/installer/config-writer.js.map +0 -1
- package/dist/installer/index.d.ts +0 -101
- package/dist/installer/index.d.ts.map +0 -1
- package/dist/installer/index.js +0 -692
- package/dist/installer/index.js.map +0 -1
- package/dist/installer/instructions-template.d.ts +0 -41
- package/dist/installer/instructions-template.d.ts.map +0 -1
- package/dist/installer/instructions-template.js +0 -53
- package/dist/installer/instructions-template.js.map +0 -1
- package/dist/installer/targets/antigravity.d.ts +0 -57
- package/dist/installer/targets/antigravity.d.ts.map +0 -1
- package/dist/installer/targets/antigravity.js +0 -308
- package/dist/installer/targets/antigravity.js.map +0 -1
- package/dist/installer/targets/claude.d.ts +0 -81
- package/dist/installer/targets/claude.d.ts.map +0 -1
- package/dist/installer/targets/claude.js +0 -617
- package/dist/installer/targets/claude.js.map +0 -1
- package/dist/installer/targets/codex.d.ts +0 -18
- package/dist/installer/targets/codex.d.ts.map +0 -1
- package/dist/installer/targets/codex.js +0 -185
- package/dist/installer/targets/codex.js.map +0 -1
- package/dist/installer/targets/cursor.d.ts +0 -35
- package/dist/installer/targets/cursor.d.ts.map +0 -1
- package/dist/installer/targets/cursor.js +0 -254
- package/dist/installer/targets/cursor.js.map +0 -1
- package/dist/installer/targets/gemini.d.ts +0 -26
- package/dist/installer/targets/gemini.d.ts.map +0 -1
- package/dist/installer/targets/gemini.js +0 -165
- package/dist/installer/targets/gemini.js.map +0 -1
- package/dist/installer/targets/hermes.d.ts +0 -18
- package/dist/installer/targets/hermes.d.ts.map +0 -1
- package/dist/installer/targets/hermes.js +0 -359
- package/dist/installer/targets/hermes.js.map +0 -1
- package/dist/installer/targets/kiro.d.ts +0 -27
- package/dist/installer/targets/kiro.d.ts.map +0 -1
- package/dist/installer/targets/kiro.js +0 -178
- package/dist/installer/targets/kiro.js.map +0 -1
- package/dist/installer/targets/opencode.d.ts +0 -38
- package/dist/installer/targets/opencode.d.ts.map +0 -1
- package/dist/installer/targets/opencode.js +0 -288
- package/dist/installer/targets/opencode.js.map +0 -1
- package/dist/installer/targets/registry.d.ts +0 -35
- package/dist/installer/targets/registry.d.ts.map +0 -1
- package/dist/installer/targets/registry.js +0 -91
- package/dist/installer/targets/registry.js.map +0 -1
- package/dist/installer/targets/shared.d.ts +0 -101
- package/dist/installer/targets/shared.d.ts.map +0 -1
- package/dist/installer/targets/shared.js +0 -264
- package/dist/installer/targets/shared.js.map +0 -1
- package/dist/installer/targets/toml.d.ts +0 -52
- package/dist/installer/targets/toml.d.ts.map +0 -1
- package/dist/installer/targets/toml.js +0 -147
- package/dist/installer/targets/toml.js.map +0 -1
- package/dist/installer/targets/types.d.ts +0 -108
- package/dist/installer/targets/types.d.ts.map +0 -1
- package/dist/installer/targets/types.js +0 -16
- package/dist/installer/targets/types.js.map +0 -1
- package/dist/markdown/cli.d.ts +0 -16
- package/dist/markdown/cli.d.ts.map +0 -1
- package/dist/markdown/cli.js +0 -575
- package/dist/markdown/cli.js.map +0 -1
- package/dist/markdown/constants.d.ts +0 -22
- package/dist/markdown/constants.d.ts.map +0 -1
- package/dist/markdown/constants.js +0 -71
- package/dist/markdown/constants.js.map +0 -1
- package/dist/markdown/dedup.d.ts.map +0 -1
- package/dist/markdown/dedup.js.map +0 -1
- package/dist/markdown/errors.d.ts +0 -22
- package/dist/markdown/errors.d.ts.map +0 -1
- package/dist/markdown/errors.js +0 -45
- package/dist/markdown/errors.js.map +0 -1
- package/dist/markdown/extractor.d.ts.map +0 -1
- package/dist/markdown/extractor.js.map +0 -1
- package/dist/markdown/frontmatter-parser.d.ts +0 -47
- package/dist/markdown/frontmatter-parser.d.ts.map +0 -1
- package/dist/markdown/frontmatter-parser.js +0 -199
- package/dist/markdown/frontmatter-parser.js.map +0 -1
- package/dist/markdown/indexer.d.ts +0 -34
- package/dist/markdown/indexer.d.ts.map +0 -1
- package/dist/markdown/indexer.js +0 -256
- package/dist/markdown/indexer.js.map +0 -1
- package/dist/markdown/mcp-tools.d.ts +0 -33
- package/dist/markdown/mcp-tools.d.ts.map +0 -1
- package/dist/markdown/mcp-tools.js +0 -300
- package/dist/markdown/mcp-tools.js.map +0 -1
- package/dist/markdown/query.d.ts +0 -108
- package/dist/markdown/query.d.ts.map +0 -1
- package/dist/markdown/query.js +0 -570
- package/dist/markdown/query.js.map +0 -1
- package/dist/markdown/schema-bootstrap.d.ts +0 -40
- package/dist/markdown/schema-bootstrap.d.ts.map +0 -1
- package/dist/markdown/schema-bootstrap.js +0 -85
- package/dist/markdown/schema-bootstrap.js.map +0 -1
- package/dist/markdown/schema.sql +0 -124
- package/dist/markdown/store.d.ts.map +0 -1
- package/dist/markdown/store.js.map +0 -1
- package/dist/markdown/summary-extractor.d.ts.map +0 -1
- package/dist/markdown/summary-extractor.js.map +0 -1
- package/dist/markdown/types.d.ts +0 -159
- package/dist/markdown/types.d.ts.map +0 -1
- package/dist/markdown/types.js.map +0 -1
- package/dist/markdown/validator.d.ts +0 -44
- package/dist/markdown/validator.d.ts.map +0 -1
- package/dist/markdown/validator.js +0 -95
- package/dist/markdown/validator.js.map +0 -1
- package/dist/mcp/daemon-manager.d.ts +0 -42
- package/dist/mcp/daemon-manager.d.ts.map +0 -1
- package/dist/mcp/daemon-manager.js +0 -129
- package/dist/mcp/daemon-manager.js.map +0 -1
- package/dist/mcp/daemon-paths.d.ts +0 -46
- package/dist/mcp/daemon-paths.d.ts.map +0 -1
- package/dist/mcp/daemon-paths.js +0 -125
- package/dist/mcp/daemon-paths.js.map +0 -1
- package/dist/mcp/daemon-registry.d.ts +0 -47
- package/dist/mcp/daemon-registry.d.ts.map +0 -1
- package/dist/mcp/daemon-registry.js +0 -229
- package/dist/mcp/daemon-registry.js.map +0 -1
- package/dist/mcp/daemon.d.ts +0 -220
- package/dist/mcp/daemon.d.ts.map +0 -1
- package/dist/mcp/daemon.js +0 -637
- package/dist/mcp/daemon.js.map +0 -1
- package/dist/mcp/dynamic-boundaries.d.ts +0 -41
- package/dist/mcp/dynamic-boundaries.d.ts.map +0 -1
- package/dist/mcp/dynamic-boundaries.js +0 -359
- package/dist/mcp/dynamic-boundaries.js.map +0 -1
- package/dist/mcp/engine.d.ts +0 -105
- package/dist/mcp/engine.d.ts.map +0 -1
- package/dist/mcp/engine.js +0 -278
- package/dist/mcp/engine.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -113
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -499
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/liveness-watchdog.d.ts +0 -18
- package/dist/mcp/liveness-watchdog.d.ts.map +0 -1
- package/dist/mcp/liveness-watchdog.js +0 -207
- package/dist/mcp/liveness-watchdog.js.map +0 -1
- package/dist/mcp/ppid-watchdog.d.ts +0 -44
- package/dist/mcp/ppid-watchdog.d.ts.map +0 -1
- package/dist/mcp/ppid-watchdog.js +0 -27
- package/dist/mcp/ppid-watchdog.js.map +0 -1
- package/dist/mcp/proxy.d.ts +0 -87
- package/dist/mcp/proxy.d.ts.map +0 -1
- package/dist/mcp/proxy.js +0 -641
- package/dist/mcp/proxy.js.map +0 -1
- package/dist/mcp/server-instructions.d.ts +0 -34
- package/dist/mcp/server-instructions.d.ts.map +0 -1
- package/dist/mcp/server-instructions.js +0 -106
- package/dist/mcp/server-instructions.js.map +0 -1
- package/dist/mcp/session.d.ts +0 -79
- package/dist/mcp/session.d.ts.map +0 -1
- package/dist/mcp/session.js +0 -330
- package/dist/mcp/session.js.map +0 -1
- package/dist/mcp/stdin-teardown.d.ts +0 -27
- package/dist/mcp/stdin-teardown.d.ts.map +0 -1
- package/dist/mcp/stdin-teardown.js +0 -49
- package/dist/mcp/stdin-teardown.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -547
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -4122
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/transport.d.ts +0 -188
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js +0 -359
- package/dist/mcp/transport.js.map +0 -1
- package/dist/mcp/version.d.ts +0 -19
- package/dist/mcp/version.d.ts.map +0 -1
- package/dist/mcp/version.js +0 -71
- package/dist/mcp/version.js.map +0 -1
- package/dist/project-config.d.ts +0 -36
- package/dist/project-config.d.ts.map +0 -1
- package/dist/project-config.js +0 -235
- package/dist/project-config.js.map +0 -1
- package/dist/reasoning/config.d.ts +0 -45
- package/dist/reasoning/config.d.ts.map +0 -1
- package/dist/reasoning/config.js +0 -171
- package/dist/reasoning/config.js.map +0 -1
- package/dist/reasoning/credentials.d.ts +0 -5
- package/dist/reasoning/credentials.d.ts.map +0 -1
- package/dist/reasoning/credentials.js +0 -83
- package/dist/reasoning/credentials.js.map +0 -1
- package/dist/reasoning/login.d.ts +0 -21
- package/dist/reasoning/login.d.ts.map +0 -1
- package/dist/reasoning/login.js +0 -85
- package/dist/reasoning/login.js.map +0 -1
- package/dist/reasoning/reasoner.d.ts +0 -43
- package/dist/reasoning/reasoner.d.ts.map +0 -1
- package/dist/reasoning/reasoner.js +0 -308
- package/dist/reasoning/reasoner.js.map +0 -1
- package/dist/resolution/c-fnptr-synthesizer.d.ts +0 -33
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +0 -1
- package/dist/resolution/c-fnptr-synthesizer.js +0 -352
- package/dist/resolution/c-fnptr-synthesizer.js.map +0 -1
- package/dist/resolution/callback-synthesizer.d.ts +0 -15
- package/dist/resolution/callback-synthesizer.d.ts.map +0 -1
- package/dist/resolution/callback-synthesizer.js +0 -2926
- package/dist/resolution/callback-synthesizer.js.map +0 -1
- package/dist/resolution/frameworks/astro.d.ts +0 -9
- package/dist/resolution/frameworks/astro.d.ts.map +0 -1
- package/dist/resolution/frameworks/astro.js +0 -169
- package/dist/resolution/frameworks/astro.js.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.d.ts +0 -18
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.js +0 -225
- package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
- package/dist/resolution/frameworks/csharp.d.ts +0 -8
- package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
- package/dist/resolution/frameworks/csharp.js +0 -241
- package/dist/resolution/frameworks/csharp.js.map +0 -1
- package/dist/resolution/frameworks/drupal.d.ts +0 -51
- package/dist/resolution/frameworks/drupal.d.ts.map +0 -1
- package/dist/resolution/frameworks/drupal.js +0 -367
- package/dist/resolution/frameworks/drupal.js.map +0 -1
- package/dist/resolution/frameworks/expo-modules.d.ts +0 -3
- package/dist/resolution/frameworks/expo-modules.d.ts.map +0 -1
- package/dist/resolution/frameworks/expo-modules.js +0 -148
- package/dist/resolution/frameworks/expo-modules.js.map +0 -1
- package/dist/resolution/frameworks/express.d.ts +0 -8
- package/dist/resolution/frameworks/express.d.ts.map +0 -1
- package/dist/resolution/frameworks/express.js +0 -308
- package/dist/resolution/frameworks/express.js.map +0 -1
- package/dist/resolution/frameworks/fabric.d.ts +0 -3
- package/dist/resolution/frameworks/fabric.d.ts.map +0 -1
- package/dist/resolution/frameworks/fabric.js +0 -354
- package/dist/resolution/frameworks/fabric.js.map +0 -1
- package/dist/resolution/frameworks/go.d.ts +0 -8
- package/dist/resolution/frameworks/go.d.ts.map +0 -1
- package/dist/resolution/frameworks/go.js +0 -161
- package/dist/resolution/frameworks/go.js.map +0 -1
- package/dist/resolution/frameworks/goframe.d.ts +0 -41
- package/dist/resolution/frameworks/goframe.d.ts.map +0 -1
- package/dist/resolution/frameworks/goframe.js +0 -112
- package/dist/resolution/frameworks/goframe.js.map +0 -1
- package/dist/resolution/frameworks/index.d.ts +0 -50
- package/dist/resolution/frameworks/index.d.ts.map +0 -1
- package/dist/resolution/frameworks/index.js +0 -169
- package/dist/resolution/frameworks/index.js.map +0 -1
- package/dist/resolution/frameworks/java.d.ts +0 -8
- package/dist/resolution/frameworks/java.d.ts.map +0 -1
- package/dist/resolution/frameworks/java.js +0 -509
- package/dist/resolution/frameworks/java.js.map +0 -1
- package/dist/resolution/frameworks/laravel.d.ts +0 -13
- package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
- package/dist/resolution/frameworks/laravel.js +0 -257
- package/dist/resolution/frameworks/laravel.js.map +0 -1
- package/dist/resolution/frameworks/nestjs.d.ts +0 -26
- package/dist/resolution/frameworks/nestjs.d.ts.map +0 -1
- package/dist/resolution/frameworks/nestjs.js +0 -698
- package/dist/resolution/frameworks/nestjs.js.map +0 -1
- package/dist/resolution/frameworks/play.d.ts +0 -19
- package/dist/resolution/frameworks/play.d.ts.map +0 -1
- package/dist/resolution/frameworks/play.js +0 -111
- package/dist/resolution/frameworks/play.js.map +0 -1
- package/dist/resolution/frameworks/python.d.ts +0 -10
- package/dist/resolution/frameworks/python.d.ts.map +0 -1
- package/dist/resolution/frameworks/python.js +0 -400
- package/dist/resolution/frameworks/python.js.map +0 -1
- package/dist/resolution/frameworks/react-native.d.ts +0 -3
- package/dist/resolution/frameworks/react-native.d.ts.map +0 -1
- package/dist/resolution/frameworks/react-native.js +0 -410
- package/dist/resolution/frameworks/react-native.js.map +0 -1
- package/dist/resolution/frameworks/react.d.ts +0 -8
- package/dist/resolution/frameworks/react.d.ts.map +0 -1
- package/dist/resolution/frameworks/react.js +0 -334
- package/dist/resolution/frameworks/react.js.map +0 -1
- package/dist/resolution/frameworks/ruby.d.ts +0 -8
- package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
- package/dist/resolution/frameworks/ruby.js +0 -302
- package/dist/resolution/frameworks/ruby.js.map +0 -1
- package/dist/resolution/frameworks/rust.d.ts +0 -8
- package/dist/resolution/frameworks/rust.d.ts.map +0 -1
- package/dist/resolution/frameworks/rust.js +0 -304
- package/dist/resolution/frameworks/rust.js.map +0 -1
- package/dist/resolution/frameworks/svelte.d.ts +0 -9
- package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
- package/dist/resolution/frameworks/svelte.js +0 -253
- package/dist/resolution/frameworks/svelte.js.map +0 -1
- package/dist/resolution/frameworks/swift-objc.d.ts +0 -37
- package/dist/resolution/frameworks/swift-objc.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift-objc.js +0 -252
- package/dist/resolution/frameworks/swift-objc.js.map +0 -1
- package/dist/resolution/frameworks/swift.d.ts +0 -10
- package/dist/resolution/frameworks/swift.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift.js +0 -400
- package/dist/resolution/frameworks/swift.js.map +0 -1
- package/dist/resolution/frameworks/vue.d.ts +0 -9
- package/dist/resolution/frameworks/vue.d.ts.map +0 -1
- package/dist/resolution/frameworks/vue.js +0 -303
- package/dist/resolution/frameworks/vue.js.map +0 -1
- package/dist/resolution/go-module.d.ts +0 -26
- package/dist/resolution/go-module.d.ts.map +0 -1
- package/dist/resolution/go-module.js +0 -78
- package/dist/resolution/go-module.js.map +0 -1
- package/dist/resolution/goframe-synthesizer.d.ts +0 -28
- package/dist/resolution/goframe-synthesizer.d.ts.map +0 -1
- package/dist/resolution/goframe-synthesizer.js +0 -158
- package/dist/resolution/goframe-synthesizer.js.map +0 -1
- package/dist/resolution/import-resolver.d.ts +0 -78
- package/dist/resolution/import-resolver.d.ts.map +0 -1
- package/dist/resolution/import-resolver.js +0 -1849
- package/dist/resolution/import-resolver.js.map +0 -1
- package/dist/resolution/index.d.ts +0 -196
- package/dist/resolution/index.d.ts.map +0 -1
- package/dist/resolution/index.js +0 -1341
- package/dist/resolution/index.js.map +0 -1
- package/dist/resolution/lru-cache.d.ts +0 -24
- package/dist/resolution/lru-cache.d.ts.map +0 -1
- package/dist/resolution/lru-cache.js +0 -62
- package/dist/resolution/lru-cache.js.map +0 -1
- package/dist/resolution/name-matcher.d.ts +0 -93
- package/dist/resolution/name-matcher.d.ts.map +0 -1
- package/dist/resolution/name-matcher.js +0 -1212
- package/dist/resolution/name-matcher.js.map +0 -1
- package/dist/resolution/path-aliases.d.ts +0 -68
- package/dist/resolution/path-aliases.d.ts.map +0 -1
- package/dist/resolution/path-aliases.js +0 -238
- package/dist/resolution/path-aliases.js.map +0 -1
- package/dist/resolution/scope-index.d.ts +0 -86
- package/dist/resolution/scope-index.d.ts.map +0 -1
- package/dist/resolution/scope-index.js +0 -143
- package/dist/resolution/scope-index.js.map +0 -1
- package/dist/resolution/stdlib-blocklist.d.ts +0 -53
- package/dist/resolution/stdlib-blocklist.d.ts.map +0 -1
- package/dist/resolution/stdlib-blocklist.js +0 -143
- package/dist/resolution/stdlib-blocklist.js.map +0 -1
- package/dist/resolution/strip-comments.d.ts +0 -27
- package/dist/resolution/strip-comments.d.ts.map +0 -1
- package/dist/resolution/strip-comments.js +0 -443
- package/dist/resolution/strip-comments.js.map +0 -1
- package/dist/resolution/swift-objc-bridge.d.ts +0 -134
- package/dist/resolution/swift-objc-bridge.d.ts.map +0 -1
- package/dist/resolution/swift-objc-bridge.js +0 -256
- package/dist/resolution/swift-objc-bridge.js.map +0 -1
- package/dist/resolution/types.d.ts +0 -233
- package/dist/resolution/types.d.ts.map +0 -1
- package/dist/resolution/types.js +0 -8
- package/dist/resolution/types.js.map +0 -1
- package/dist/resolution/workspace-packages.d.ts +0 -48
- package/dist/resolution/workspace-packages.d.ts.map +0 -1
- package/dist/resolution/workspace-packages.js +0 -208
- package/dist/resolution/workspace-packages.js.map +0 -1
- package/dist/search/ast-helpers.d.ts +0 -42
- package/dist/search/ast-helpers.d.ts.map +0 -1
- package/dist/search/ast-helpers.js +0 -106
- package/dist/search/ast-helpers.js.map +0 -1
- package/dist/search/call-sites.d.ts +0 -398
- package/dist/search/call-sites.d.ts.map +0 -1
- package/dist/search/call-sites.js +0 -1433
- package/dist/search/call-sites.js.map +0 -1
- package/dist/search/context.d.ts +0 -134
- package/dist/search/context.d.ts.map +0 -1
- package/dist/search/context.js +0 -575
- package/dist/search/context.js.map +0 -1
- package/dist/search/impact.d.ts +0 -139
- package/dist/search/impact.d.ts.map +0 -1
- package/dist/search/impact.js +0 -646
- package/dist/search/impact.js.map +0 -1
- package/dist/search/query-parser.d.ts +0 -57
- package/dist/search/query-parser.d.ts.map +0 -1
- package/dist/search/query-parser.js +0 -177
- package/dist/search/query-parser.js.map +0 -1
- package/dist/search/query-utils.d.ts +0 -87
- package/dist/search/query-utils.d.ts.map +0 -1
- package/dist/search/query-utils.js +0 -449
- package/dist/search/query-utils.js.map +0 -1
- package/dist/search/related.d.ts +0 -178
- package/dist/search/related.d.ts.map +0 -1
- package/dist/search/related.js +0 -667
- package/dist/search/related.js.map +0 -1
- package/dist/search/slice.d.ts +0 -148
- package/dist/search/slice.d.ts.map +0 -1
- package/dist/search/slice.js +0 -460
- package/dist/search/slice.js.map +0 -1
- package/dist/search/snr-constants.d.ts +0 -41
- package/dist/search/snr-constants.d.ts.map +0 -1
- package/dist/search/snr-constants.js +0 -44
- package/dist/search/snr-constants.js.map +0 -1
- package/dist/search/types.d.ts +0 -28
- package/dist/search/types.d.ts.map +0 -1
- package/dist/search/types.js +0 -12
- package/dist/search/types.js.map +0 -1
- package/dist/sync/git-hooks.d.ts +0 -45
- package/dist/sync/git-hooks.d.ts.map +0 -1
- package/dist/sync/git-hooks.js +0 -225
- package/dist/sync/git-hooks.js.map +0 -1
- package/dist/sync/index.d.ts +0 -19
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js +0 -35
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/watch-policy.d.ts +0 -48
- package/dist/sync/watch-policy.d.ts.map +0 -1
- package/dist/sync/watch-policy.js +0 -124
- package/dist/sync/watch-policy.js.map +0 -1
- package/dist/sync/watcher.d.ts +0 -350
- package/dist/sync/watcher.d.ts.map +0 -1
- package/dist/sync/watcher.js +0 -811
- package/dist/sync/watcher.js.map +0 -1
- package/dist/sync/worktree.d.ts +0 -54
- package/dist/sync/worktree.d.ts.map +0 -1
- package/dist/sync/worktree.js +0 -137
- package/dist/sync/worktree.js.map +0 -1
- package/dist/telemetry/index.d.ts +0 -143
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -541
- package/dist/telemetry/index.js.map +0 -1
- package/dist/timeline/bash-semantics.d.ts.map +0 -1
- package/dist/timeline/bash-semantics.js.map +0 -1
- package/dist/timeline/cli.d.ts.map +0 -1
- package/dist/timeline/cli.js.map +0 -1
- package/dist/timeline/constants.d.ts +0 -62
- package/dist/timeline/constants.d.ts.map +0 -1
- package/dist/timeline/constants.js +0 -73
- package/dist/timeline/constants.js.map +0 -1
- package/dist/timeline/errors.d.ts.map +0 -1
- package/dist/timeline/errors.js.map +0 -1
- package/dist/timeline/hook-runner.d.ts.map +0 -1
- package/dist/timeline/hook-runner.js.map +0 -1
- package/dist/timeline/hooks.d.ts.map +0 -1
- package/dist/timeline/hooks.js.map +0 -1
- package/dist/timeline/index.d.ts.map +0 -1
- package/dist/timeline/index.js.map +0 -1
- package/dist/timeline/indexer.d.ts.map +0 -1
- package/dist/timeline/indexer.js.map +0 -1
- package/dist/timeline/installer.d.ts.map +0 -1
- package/dist/timeline/installer.js.map +0 -1
- package/dist/timeline/payload.d.ts.map +0 -1
- package/dist/timeline/payload.js.map +0 -1
- package/dist/timeline/post-tool-summary.d.ts.map +0 -1
- package/dist/timeline/post-tool-summary.js.map +0 -1
- package/dist/timeline/recorder.d.ts.map +0 -1
- package/dist/timeline/recorder.js.map +0 -1
- package/dist/timeline/schema-bootstrap.d.ts +0 -42
- package/dist/timeline/schema-bootstrap.d.ts.map +0 -1
- package/dist/timeline/schema-bootstrap.js +0 -81
- package/dist/timeline/schema-bootstrap.js.map +0 -1
- package/dist/timeline/store.d.ts.map +0 -1
- package/dist/timeline/store.js.map +0 -1
- package/dist/timeline/types.d.ts.map +0 -1
- package/dist/timeline/types.js.map +0 -1
- package/dist/types.d.ts +0 -392
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -81
- package/dist/types.js.map +0 -1
- package/dist/ui/glyphs.d.ts +0 -42
- package/dist/ui/glyphs.d.ts.map +0 -1
- package/dist/ui/glyphs.js +0 -78
- package/dist/ui/glyphs.js.map +0 -1
- package/dist/ui/shimmer-progress.d.ts +0 -11
- package/dist/ui/shimmer-progress.d.ts.map +0 -1
- package/dist/ui/shimmer-progress.js +0 -90
- package/dist/ui/shimmer-progress.js.map +0 -1
- package/dist/ui/shimmer-worker.d.ts +0 -2
- package/dist/ui/shimmer-worker.d.ts.map +0 -1
- package/dist/ui/shimmer-worker.js +0 -118
- package/dist/ui/shimmer-worker.js.map +0 -1
- package/dist/ui/types.d.ts +0 -17
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/ui/types.js +0 -3
- package/dist/ui/types.js.map +0 -1
- package/dist/upgrade/index.d.ts +0 -132
- package/dist/upgrade/index.d.ts.map +0 -1
- package/dist/upgrade/index.js +0 -498
- package/dist/upgrade/index.js.map +0 -1
- package/dist/utils.d.ts +0 -224
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -583
- package/dist/utils.js.map +0 -1
- package/scripts/add-lang/bench.sh +0 -60
- package/scripts/add-lang/check-grammar.mjs +0 -75
- package/scripts/add-lang/dump-ast.mjs +0 -103
- package/scripts/add-lang/verify-extraction.mjs +0 -70
- package/scripts/agent-eval/ab-adoption.sh +0 -91
- package/scripts/agent-eval/ab-hook.sh +0 -86
- package/scripts/agent-eval/ab-impl.sh +0 -78
- package/scripts/agent-eval/ab-new-vs-baseline.sh +0 -102
- package/scripts/agent-eval/ab-sufficiency.sh +0 -78
- package/scripts/agent-eval/arms-F.sh +0 -21
- package/scripts/agent-eval/arms-matrix.sh +0 -37
- package/scripts/agent-eval/audit.sh +0 -68
- package/scripts/agent-eval/bench-readme.sh +0 -28
- package/scripts/agent-eval/bench-why-repo.sh +0 -22
- package/scripts/agent-eval/block-read-hook.sh +0 -19
- package/scripts/agent-eval/hook-settings.json +0 -15
- package/scripts/agent-eval/itrun.sh +0 -120
- package/scripts/agent-eval/offload-eval-3arm.sh +0 -72
- package/scripts/agent-eval/offload-eval-cost.mjs +0 -133
- package/scripts/agent-eval/offload-eval-effort.mjs +0 -108
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +0 -25
- package/scripts/agent-eval/offload-eval-frontload.sh +0 -47
- package/scripts/agent-eval/offload-eval-ground-truth.json +0 -18
- package/scripts/agent-eval/offload-eval-hook.mjs +0 -84
- package/scripts/agent-eval/offload-eval-judge.mjs +0 -103
- package/scripts/agent-eval/offload-eval-matrix.sh +0 -20
- package/scripts/agent-eval/offload-eval-metrics.mjs +0 -94
- package/scripts/agent-eval/offload-eval-refs1.sh +0 -50
- package/scripts/agent-eval/offload-eval-setup.sh +0 -24
- package/scripts/agent-eval/offload-eval-styles.sh +0 -72
- package/scripts/agent-eval/offload-eval-summarize.mjs +0 -68
- package/scripts/agent-eval/offload-eval.md +0 -76
- package/scripts/agent-eval/parse-arms.mjs +0 -116
- package/scripts/agent-eval/parse-bench-readme.mjs +0 -84
- package/scripts/agent-eval/parse-run.mjs +0 -45
- package/scripts/agent-eval/parse-session.mjs +0 -93
- package/scripts/agent-eval/probe-context.mjs +0 -21
- package/scripts/agent-eval/probe-explore.mjs +0 -40
- package/scripts/agent-eval/probe-node.mjs +0 -20
- package/scripts/agent-eval/probe-sweep.mjs +0 -119
- package/scripts/agent-eval/probe-trace.mjs +0 -20
- package/scripts/agent-eval/redirect-read-hook.sh +0 -38
- package/scripts/agent-eval/run-agent.sh +0 -34
- package/scripts/agent-eval/run-all.sh +0 -69
- package/scripts/agent-eval/run-arms.sh +0 -56
- package/scripts/agent-eval/seq-matrix.mjs +0 -137
- package/scripts/agent-eval/subagent-token-cost.py +0 -188
- package/scripts/build-bundle.sh +0 -118
- package/scripts/extract-release-notes.mjs +0 -130
- package/scripts/local-install.sh +0 -41
- package/scripts/npm-sdk.js +0 -75
- package/scripts/npm-shim.js +0 -246
- package/scripts/pack-npm.sh +0 -118
- package/scripts/prepare-release.mjs +0 -270
- /package/dist/{dbquery → core/dbquery}/config.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/config.js +0 -0
- /package/dist/{dbquery → core/dbquery}/constants.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/constants.js +0 -0
- /package/dist/{dbquery → core/dbquery}/drivers/mysql.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/drivers/mysql.js +0 -0
- /package/dist/{dbquery → core/dbquery}/drivers/postgres.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/drivers/postgres.js +0 -0
- /package/dist/{dbquery → core/dbquery}/executor.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/executor.js +0 -0
- /package/dist/{dbquery → core/dbquery}/format.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/format.js +0 -0
- /package/dist/{dbquery → core/dbquery}/identifiers.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/identifiers.js +0 -0
- /package/dist/{dbquery → core/dbquery}/index.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/index.js +0 -0
- /package/dist/{dbquery → core/dbquery}/logging.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/logging.js +0 -0
- /package/dist/{dbquery → core/dbquery}/queries.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/queries.js +0 -0
- /package/dist/{dbquery → core/dbquery}/safety.d.ts +0 -0
- /package/dist/{dbquery → core/dbquery}/safety.js +0 -0
- /package/dist/{markdown → core/markdown}/dedup.d.ts +0 -0
- /package/dist/{markdown → core/markdown}/dedup.js +0 -0
- /package/dist/{markdown → core/markdown}/extractor.d.ts +0 -0
- /package/dist/{markdown → core/markdown}/extractor.js +0 -0
- /package/dist/{markdown → core/markdown}/store.d.ts +0 -0
- /package/dist/{markdown → core/markdown}/store.js +0 -0
- /package/dist/{markdown → core/markdown}/summary-extractor.d.ts +0 -0
- /package/dist/{markdown → core/markdown}/summary-extractor.js +0 -0
- /package/dist/{markdown → core/markdown}/types.js +0 -0
- /package/dist/{timeline → core/timeline}/bash-semantics.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/bash-semantics.js +0 -0
- /package/dist/{timeline → core/timeline}/cli.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/cli.js +0 -0
- /package/dist/{timeline → core/timeline}/errors.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/errors.js +0 -0
- /package/dist/{timeline → core/timeline}/hook-runner.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/hook-runner.js +0 -0
- /package/dist/{timeline → core/timeline}/hooks.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/hooks.js +0 -0
- /package/dist/{timeline → core/timeline}/index.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/index.js +0 -0
- /package/dist/{timeline → core/timeline}/indexer.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/indexer.js +0 -0
- /package/dist/{timeline → core/timeline}/installer.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/installer.js +0 -0
- /package/dist/{timeline → core/timeline}/payload.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/payload.js +0 -0
- /package/dist/{timeline → core/timeline}/post-tool-summary.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/post-tool-summary.js +0 -0
- /package/dist/{timeline → core/timeline}/recorder.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/recorder.js +0 -0
- /package/dist/{timeline → core/timeline}/schema.sql +0 -0
- /package/dist/{timeline → core/timeline}/store.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/store.js +0 -0
- /package/dist/{timeline → core/timeline}/types.d.ts +0 -0
- /package/dist/{timeline → core/timeline}/types.js +0 -0
|
@@ -1,1433 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Call site search — finds method-invocation sites by name across the project.
|
|
4
|
-
*
|
|
5
|
-
* Designed as an agent-facing "structured grep": returns call sites with AST
|
|
6
|
-
* context (containing class/method), not raw text matches. AST naturally
|
|
7
|
-
* excludes comments/strings (they're not method_invocation nodes), so the
|
|
8
|
-
* output is signal-dense for agent consumption — saves the agent the
|
|
9
|
-
* comment/string/overload filtering that grep forces it to do.
|
|
10
|
-
*
|
|
11
|
-
* Does NOT depend on cgraphx's resolve pipeline. Walks source files directly
|
|
12
|
-
* via tree-sitter, so it works on any project (indexed or not) and avoids the
|
|
13
|
-
* resolve-accuracy issues that broke L3 scope-bounded on Java dotted names.
|
|
14
|
-
*/
|
|
15
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
-
}
|
|
21
|
-
Object.defineProperty(o, k2, desc);
|
|
22
|
-
}) : (function(o, m, k, k2) {
|
|
23
|
-
if (k2 === undefined) k2 = k;
|
|
24
|
-
o[k2] = m[k];
|
|
25
|
-
}));
|
|
26
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
-
}) : function(o, v) {
|
|
29
|
-
o["default"] = v;
|
|
30
|
-
});
|
|
31
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
-
var ownKeys = function(o) {
|
|
33
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
-
var ar = [];
|
|
35
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
-
return ar;
|
|
37
|
-
};
|
|
38
|
-
return ownKeys(o);
|
|
39
|
-
};
|
|
40
|
-
return function (mod) {
|
|
41
|
-
if (mod && mod.__esModule) return mod;
|
|
42
|
-
var result = {};
|
|
43
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
-
__setModuleDefault(result, mod);
|
|
45
|
-
return result;
|
|
46
|
-
};
|
|
47
|
-
})();
|
|
48
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.DEFAULT_EXCLUDE_DIRS = void 0;
|
|
50
|
-
exports.searchCallSites = searchCallSites;
|
|
51
|
-
exports.compareCallSitesTiebreak = compareCallSitesTiebreak;
|
|
52
|
-
exports.listJavaFamilyFiles = listJavaFamilyFiles;
|
|
53
|
-
exports.formatCallSitesResult = formatCallSitesResult;
|
|
54
|
-
exports.resolveMethodSymbol = resolveMethodSymbol;
|
|
55
|
-
exports.findEnclosingClassType = findEnclosingClassType;
|
|
56
|
-
exports.extractInjectedFields = extractInjectedFields;
|
|
57
|
-
exports.findFilesWithClass = findFilesWithClass;
|
|
58
|
-
exports.containsBizVerbSegment = containsBizVerbSegment;
|
|
59
|
-
exports.rootIdentifier = rootIdentifier;
|
|
60
|
-
exports.computeSnrScore = computeSnrScore;
|
|
61
|
-
exports.computeSnrBreakdown = computeSnrBreakdown;
|
|
62
|
-
exports.formatSnrBreakdown = formatSnrBreakdown;
|
|
63
|
-
exports.compareBySnr = compareBySnr;
|
|
64
|
-
exports.collectSameClassMethodNames = collectSameClassMethodNames;
|
|
65
|
-
exports.markSameClassBiz = markSameClassBiz;
|
|
66
|
-
exports.searchCallees = searchCallees;
|
|
67
|
-
exports.applyTieredBudget = applyTieredBudget;
|
|
68
|
-
exports.formatCalleesResult = formatCalleesResult;
|
|
69
|
-
const fs_1 = require("fs");
|
|
70
|
-
const path = __importStar(require("path"));
|
|
71
|
-
const grammars_1 = require("../extraction/grammars");
|
|
72
|
-
const ast_helpers_1 = require("./ast-helpers");
|
|
73
|
-
const snr_constants_1 = require("./snr-constants");
|
|
74
|
-
// ---------------------------------------------------------------------------
|
|
75
|
-
// Built-in file-scan exclusions (targeted at Java/JVM build output + noise)
|
|
76
|
-
// ---------------------------------------------------------------------------
|
|
77
|
-
exports.DEFAULT_EXCLUDE_DIRS = new Set([
|
|
78
|
-
'.git',
|
|
79
|
-
'.cgraphx',
|
|
80
|
-
'.idea',
|
|
81
|
-
'.vscode',
|
|
82
|
-
'node_modules',
|
|
83
|
-
'target', // Maven
|
|
84
|
-
'build', // Gradle
|
|
85
|
-
'out', // IntelliJ out
|
|
86
|
-
'.gradle',
|
|
87
|
-
'.mvn',
|
|
88
|
-
'dist',
|
|
89
|
-
'__pycache__',
|
|
90
|
-
'.cache',
|
|
91
|
-
]);
|
|
92
|
-
const JAVA_FAMILY_EXTENSIONS = new Set(['.java', '.kt', '.kts']);
|
|
93
|
-
// ---------------------------------------------------------------------------
|
|
94
|
-
// Main entry
|
|
95
|
-
// ---------------------------------------------------------------------------
|
|
96
|
-
async function searchCallSites(projectRoot, methodName, options = {}) {
|
|
97
|
-
const { topK = 20, topPerReceiver = 3, budget = 4000, receiver, languages = ['java', 'kotlin'], excludeDirs = [], } = options;
|
|
98
|
-
// initGrammars() only initializes the WASM runtime; loadGrammarsForLanguages
|
|
99
|
-
// actually loads the Java/Kotlin grammar WASM. Without this, getParser()
|
|
100
|
-
// returns null and we silently find 0 call sites.
|
|
101
|
-
await (0, grammars_1.loadGrammarsForLanguages)(languages);
|
|
102
|
-
const excludeSet = new Set([...exports.DEFAULT_EXCLUDE_DIRS, ...excludeDirs]);
|
|
103
|
-
// 1. Walk project, collect Java-family files
|
|
104
|
-
const allFiles = await listJavaFamilyFiles(projectRoot, excludeSet);
|
|
105
|
-
// 2. Pre-parse text filter: only parse files that contain methodName as text.
|
|
106
|
-
// Reading the file is unavoidable (we need content to parse), so we do the
|
|
107
|
-
// text check on the same read and skip parse if no match.
|
|
108
|
-
const candidateFiles = [];
|
|
109
|
-
let skippedFiles = 0;
|
|
110
|
-
for (const file of allFiles) {
|
|
111
|
-
let content;
|
|
112
|
-
try {
|
|
113
|
-
content = await fs_1.promises.readFile(file, 'utf-8');
|
|
114
|
-
}
|
|
115
|
-
catch {
|
|
116
|
-
skippedFiles++;
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
if (!content.includes(methodName)) {
|
|
120
|
-
skippedFiles++;
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
const language = (0, grammars_1.detectLanguage)(file, content);
|
|
124
|
-
if (!languages.includes(language)) {
|
|
125
|
-
skippedFiles++;
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
candidateFiles.push({ file, content, language });
|
|
129
|
-
}
|
|
130
|
-
// 3. Parse each candidate + extract method_invocation nodes matching methodName.
|
|
131
|
-
// extractMethodInvocationsWithSnr walks the tree once per file and computes
|
|
132
|
-
// xBdy / sameClassBiz / snrScore inline (mirrors the callees path) so the
|
|
133
|
-
// downstream cluster + sort can be SNR-driven. Injected-field and sibling-
|
|
134
|
-
// method lookups are cached per enclosing class node to avoid re-walking
|
|
135
|
-
// the same class body for every method_invocation inside it.
|
|
136
|
-
const allCallSites = [];
|
|
137
|
-
for (const { file, content, language } of candidateFiles) {
|
|
138
|
-
const parser = (0, grammars_1.getParser)(language);
|
|
139
|
-
if (!parser)
|
|
140
|
-
continue;
|
|
141
|
-
const tree = parser.parse(content);
|
|
142
|
-
if (!tree)
|
|
143
|
-
continue;
|
|
144
|
-
const sites = extractMethodInvocationsWithSnr(tree.rootNode, content, methodName, projectRoot, file);
|
|
145
|
-
allCallSites.push(...sites);
|
|
146
|
-
}
|
|
147
|
-
// 4. Receiver filter (optional)
|
|
148
|
-
let filtered = allCallSites;
|
|
149
|
-
let filteredByReceiver = 0;
|
|
150
|
-
if (receiver) {
|
|
151
|
-
const before = filtered.length;
|
|
152
|
-
filtered = filtered.filter((s) => s.receiverText === receiver);
|
|
153
|
-
filteredByReceiver = before - filtered.length;
|
|
154
|
-
}
|
|
155
|
-
// 5. Cluster by receiver (high-frequency methods get called by many
|
|
156
|
-
// receivers; without clustering, topK returns only the most-common
|
|
157
|
-
// receiver's first K calls — agent sees 20 CollectionUtils.isNotEmpty
|
|
158
|
-
// and misses StringUtils.isNotEmpty). Each receiver gets up to
|
|
159
|
-
// `topPerReceiver` representatives, capped by global `topK`.
|
|
160
|
-
const distinctReceivers = new Set(filtered.map((s) => s.receiverText)).size;
|
|
161
|
-
const byReceiver = new Map();
|
|
162
|
-
for (const site of filtered) {
|
|
163
|
-
const key = site.receiverText;
|
|
164
|
-
const group = byReceiver.get(key) ?? [];
|
|
165
|
-
group.push(site);
|
|
166
|
-
byReceiver.set(key, group);
|
|
167
|
-
}
|
|
168
|
-
// Sort each group internally by SNR desc (was: confidence > path depth).
|
|
169
|
-
// Same ranking as callees mode — `compareBySnr` tiebreaks on filePath depth
|
|
170
|
-
// asc + line asc per spec §2.4.
|
|
171
|
-
for (const group of byReceiver.values()) {
|
|
172
|
-
group.sort(compareBySnr);
|
|
173
|
-
}
|
|
174
|
-
// Receivers ordered by their top caller's SNR score (was: group size desc).
|
|
175
|
-
// xBdy callers score +100 so xBdy groups naturally rise to the top; a
|
|
176
|
-
// receiver like `customerOrderService` (injected service field) outranks
|
|
177
|
-
// `Objects`/`CollectionUtils` noise even when the noise group is larger.
|
|
178
|
-
const sortedReceivers = [...byReceiver.entries()].sort((a, b) => {
|
|
179
|
-
const aTop = a[1][0]?.snrScore ?? -Infinity;
|
|
180
|
-
const bTop = b[1][0]?.snrScore ?? -Infinity;
|
|
181
|
-
if (aTop !== bTop)
|
|
182
|
-
return bTop - aTop;
|
|
183
|
-
return b[1].length - a[1].length; // tiebreak: larger group first
|
|
184
|
-
});
|
|
185
|
-
const receivers = [];
|
|
186
|
-
const topSites = [];
|
|
187
|
-
for (const [receiverKey, group] of sortedReceivers) {
|
|
188
|
-
const maxSnrScore = group[0]?.snrScore;
|
|
189
|
-
if (topSites.length >= topK) {
|
|
190
|
-
receivers.push({ receiver: receiverKey, total: group.length, returned: 0, maxSnrScore });
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
const take = Math.min(topPerReceiver, group.length, topK - topSites.length);
|
|
194
|
-
topSites.push(...group.slice(0, take));
|
|
195
|
-
receivers.push({ receiver: receiverKey, total: group.length, returned: take, maxSnrScore });
|
|
196
|
-
}
|
|
197
|
-
const truncatedByTopK = Math.max(0, filtered.length - topSites.length);
|
|
198
|
-
// 7. Budget (estimated by JSON size per site)
|
|
199
|
-
let usedBudget = 0;
|
|
200
|
-
const budgeted = [];
|
|
201
|
-
let truncatedByBudget = 0;
|
|
202
|
-
for (const site of topSites) {
|
|
203
|
-
const siteSize = estimateSiteSize(site);
|
|
204
|
-
if (usedBudget + siteSize > budget && budgeted.length > 0) {
|
|
205
|
-
truncatedByBudget = topSites.length - budgeted.length;
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
budgeted.push(site);
|
|
209
|
-
usedBudget += siteSize;
|
|
210
|
-
}
|
|
211
|
-
return {
|
|
212
|
-
query: methodName,
|
|
213
|
-
kind: 'call',
|
|
214
|
-
totalFound: allCallSites.length,
|
|
215
|
-
returned: budgeted.length,
|
|
216
|
-
distinctReceivers,
|
|
217
|
-
receivers,
|
|
218
|
-
omitted: {
|
|
219
|
-
commentMatches: 0,
|
|
220
|
-
stringMatches: 0,
|
|
221
|
-
skippedFiles,
|
|
222
|
-
filteredByReceiver,
|
|
223
|
-
truncatedByTopK,
|
|
224
|
-
truncatedByBudget,
|
|
225
|
-
},
|
|
226
|
-
callSites: budgeted,
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
// ---------------------------------------------------------------------------
|
|
230
|
-
// AST extraction
|
|
231
|
-
// ---------------------------------------------------------------------------
|
|
232
|
-
/**
|
|
233
|
-
* Walk the tree, find `method_invocation` nodes whose `name` field matches,
|
|
234
|
-
* and build CallSite records with enclosing class/method context.
|
|
235
|
-
*
|
|
236
|
-
* Java/Kotlin grammar uses `method_invocation` with `object` (receiver) and
|
|
237
|
-
* `name` (method) fields — see cgraphx/src/extraction/tree-sitter.ts:3440.
|
|
238
|
-
*/
|
|
239
|
-
function extractMethodInvocations(root, content, methodName, projectRoot, filePath) {
|
|
240
|
-
const sites = [];
|
|
241
|
-
const relativePath = path.relative(projectRoot, filePath).replace(/\\/g, '/');
|
|
242
|
-
(0, ast_helpers_1.walkTree)(root, (node) => {
|
|
243
|
-
if (node.type !== 'method_invocation')
|
|
244
|
-
return;
|
|
245
|
-
const nameNode = node.childForFieldName('name');
|
|
246
|
-
if (!nameNode)
|
|
247
|
-
return;
|
|
248
|
-
// methodName === null = wildcard (callees mode collects all invocations
|
|
249
|
-
// regardless of name; callers mode filters to a specific name).
|
|
250
|
-
if (methodName !== null && nameNode.text !== methodName)
|
|
251
|
-
return;
|
|
252
|
-
const objectNode = node.childForFieldName('object');
|
|
253
|
-
const receiverText = objectNode?.text ?? null;
|
|
254
|
-
sites.push({
|
|
255
|
-
methodName: nameNode.text,
|
|
256
|
-
receiverText,
|
|
257
|
-
filePath: relativePath,
|
|
258
|
-
line: node.startPosition.row + 1,
|
|
259
|
-
column: node.startPosition.column,
|
|
260
|
-
containingClass: findAncestorName(node, [
|
|
261
|
-
'class_declaration',
|
|
262
|
-
'interface_declaration',
|
|
263
|
-
'enum_declaration',
|
|
264
|
-
'record_declaration',
|
|
265
|
-
'annotation_type_declaration',
|
|
266
|
-
]),
|
|
267
|
-
containingMethod: findAncestorName(node, [
|
|
268
|
-
'method_declaration',
|
|
269
|
-
'constructor_declaration',
|
|
270
|
-
'compact_constructor_declaration',
|
|
271
|
-
]),
|
|
272
|
-
snippet: extractSnippet(content, node.startPosition.row, node.endPosition.row),
|
|
273
|
-
confidence: receiverText ? 'high' : 'probable',
|
|
274
|
-
reason: receiverText
|
|
275
|
-
? `method invocation with receiver '${receiverText}'`
|
|
276
|
-
: 'unqualified method invocation (no receiver — likely same-class or static)',
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
return sites;
|
|
280
|
-
}
|
|
281
|
-
function findAncestorName(node, ancestorTypes) {
|
|
282
|
-
let cur = node.parent;
|
|
283
|
-
while (cur) {
|
|
284
|
-
if (ancestorTypes.includes(cur.type)) {
|
|
285
|
-
const nameChild = cur.childForFieldName('name');
|
|
286
|
-
if (nameChild)
|
|
287
|
-
return nameChild.text;
|
|
288
|
-
}
|
|
289
|
-
cur = cur.parent;
|
|
290
|
-
}
|
|
291
|
-
return null;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Same shape as `extractMethodInvocations` (same pre-order walk, same CallSite
|
|
295
|
-
* fields), but additionally computes `crossBoundary`, `sameClassBiz`, and
|
|
296
|
-
* `snrScore` on each site — used by callers mode (`searchCallSites`) so the
|
|
297
|
-
* downstream cluster + sort can be SNR-driven, identical to callees mode.
|
|
298
|
-
*
|
|
299
|
-
* The callees path (`searchCallees`) resolves a single method body and enriches
|
|
300
|
-
* inline; this variant is for the callers path which walks the whole project
|
|
301
|
-
* and needs per-file, per-class enrichment.
|
|
302
|
-
*
|
|
303
|
-
* Injected-field maps and sibling-method-name sets are cached per enclosing
|
|
304
|
-
* class node (a single file may host many classes — outer, inner, nested — and
|
|
305
|
-
* every method_invocation inside one class shares its body's lookup).
|
|
306
|
-
*/
|
|
307
|
-
function extractMethodInvocationsWithSnr(root, content, methodName, projectRoot, filePath) {
|
|
308
|
-
const sites = [];
|
|
309
|
-
const relativePath = path.relative(projectRoot, filePath).replace(/\\/g, '/');
|
|
310
|
-
const injectedFieldsByClass = new WeakMap();
|
|
311
|
-
const siblingNamesByClass = new WeakMap();
|
|
312
|
-
(0, ast_helpers_1.walkTree)(root, (node) => {
|
|
313
|
-
if (node.type !== 'method_invocation')
|
|
314
|
-
return;
|
|
315
|
-
const nameNode = node.childForFieldName('name');
|
|
316
|
-
if (!nameNode)
|
|
317
|
-
return;
|
|
318
|
-
if (methodName !== null && nameNode.text !== methodName)
|
|
319
|
-
return;
|
|
320
|
-
const objectNode = node.childForFieldName('object');
|
|
321
|
-
const receiverText = objectNode?.text ?? null;
|
|
322
|
-
// Resolve the enclosing class once for this call site, then look up (or
|
|
323
|
-
// populate) the per-class caches for injected fields + sibling method names.
|
|
324
|
-
const classNode = findEnclosingClassType(node);
|
|
325
|
-
let injectedFields;
|
|
326
|
-
let siblingNames;
|
|
327
|
-
if (classNode) {
|
|
328
|
-
injectedFields = injectedFieldsByClass.get(classNode);
|
|
329
|
-
if (!injectedFields) {
|
|
330
|
-
injectedFields = extractInjectedFields(classNode);
|
|
331
|
-
injectedFieldsByClass.set(classNode, injectedFields);
|
|
332
|
-
}
|
|
333
|
-
siblingNames = siblingNamesByClass.get(classNode);
|
|
334
|
-
if (!siblingNames) {
|
|
335
|
-
siblingNames = collectSameClassMethodNames(classNode);
|
|
336
|
-
siblingNamesByClass.set(classNode, siblingNames);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
// xBdy: receiver matches an injected field declared in the enclosing class.
|
|
340
|
-
// (Symmetric to the callees path — a call like `customerOrderService.sceneCommit()`
|
|
341
|
-
// where `customerOrderService` is an @Resource/@Autowired/@Inject field crosses
|
|
342
|
-
// a module/service boundary and is a high-signal hop for tracing.)
|
|
343
|
-
let crossBoundary;
|
|
344
|
-
if (receiverText && injectedFields) {
|
|
345
|
-
const injected = injectedFields.get(receiverText);
|
|
346
|
-
if (injected) {
|
|
347
|
-
crossBoundary = {
|
|
348
|
-
kind: 'injected',
|
|
349
|
-
fieldType: injected.fieldType,
|
|
350
|
-
annotation: injected.annotation,
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
// sameClassBiz: unqualified call whose name is a biz-verb declared as a
|
|
355
|
-
// sibling method in the same class. Only checked when NOT xBdy (xBdy
|
|
356
|
-
// short-circuits in computeSnrScore anyway, and we don't want to falsely
|
|
357
|
-
// tag an xBdy field call as sameClassBiz).
|
|
358
|
-
let sameClassBiz;
|
|
359
|
-
if (!crossBoundary &&
|
|
360
|
-
(receiverText === null || receiverText === '') &&
|
|
361
|
-
siblingNames &&
|
|
362
|
-
containsBizVerbSegment(nameNode.text) &&
|
|
363
|
-
siblingNames.has(nameNode.text)) {
|
|
364
|
-
sameClassBiz = true;
|
|
365
|
-
}
|
|
366
|
-
const site = {
|
|
367
|
-
methodName: nameNode.text,
|
|
368
|
-
receiverText,
|
|
369
|
-
filePath: relativePath,
|
|
370
|
-
line: node.startPosition.row + 1,
|
|
371
|
-
column: node.startPosition.column,
|
|
372
|
-
containingClass: findAncestorName(node, [
|
|
373
|
-
'class_declaration',
|
|
374
|
-
'interface_declaration',
|
|
375
|
-
'enum_declaration',
|
|
376
|
-
'record_declaration',
|
|
377
|
-
'annotation_type_declaration',
|
|
378
|
-
]),
|
|
379
|
-
containingMethod: findAncestorName(node, [
|
|
380
|
-
'method_declaration',
|
|
381
|
-
'constructor_declaration',
|
|
382
|
-
'compact_constructor_declaration',
|
|
383
|
-
]),
|
|
384
|
-
snippet: extractSnippet(content, node.startPosition.row, node.endPosition.row),
|
|
385
|
-
confidence: receiverText ? 'high' : 'probable',
|
|
386
|
-
reason: receiverText
|
|
387
|
-
? `method invocation with receiver '${receiverText}'`
|
|
388
|
-
: 'unqualified method invocation (no receiver — likely same-class or static)',
|
|
389
|
-
};
|
|
390
|
-
if (crossBoundary)
|
|
391
|
-
site.crossBoundary = crossBoundary;
|
|
392
|
-
if (sameClassBiz)
|
|
393
|
-
site.sameClassBiz = sameClassBiz;
|
|
394
|
-
site.snrScore = computeSnrScore(site);
|
|
395
|
-
sites.push(site);
|
|
396
|
-
});
|
|
397
|
-
return sites;
|
|
398
|
-
}
|
|
399
|
-
function extractSnippet(content, startRow, endRow) {
|
|
400
|
-
const lines = content.split('\n');
|
|
401
|
-
// Cap snippet at 3 lines; method_invocation usually fits on 1-2 lines.
|
|
402
|
-
const maxLines = 3;
|
|
403
|
-
const sliceEnd = Math.min(endRow + 1, startRow + maxLines);
|
|
404
|
-
const snippetLines = lines.slice(startRow, sliceEnd);
|
|
405
|
-
return snippetLines.join('\n').trim();
|
|
406
|
-
}
|
|
407
|
-
// ---------------------------------------------------------------------------
|
|
408
|
-
// Ranking + budgeting
|
|
409
|
-
// ---------------------------------------------------------------------------
|
|
410
|
-
/**
|
|
411
|
-
* Tiebreaker-only comparator for callers-mode call sites.
|
|
412
|
-
*
|
|
413
|
-
* Previously this was the primary ranking for `searchCallSites` (confidence +
|
|
414
|
-
* path-depth, as `compareCallSites`). After iteration-3 B-2 callers switched
|
|
415
|
-
* to SNR-driven ranking via `compareBySnr`, the SNR tiebreaker chain
|
|
416
|
-
* (filePath depth asc + filePath localeCompare + line asc, per spec §2.4)
|
|
417
|
-
* already covers every case this comparator handled, so the callers path no
|
|
418
|
-
* longer calls it.
|
|
419
|
-
*
|
|
420
|
-
* Exported as a pure tiebreaker for any external/manual sort that wants a
|
|
421
|
-
* stable order without caring about SNR — symmetric to `compareBySnr` minus
|
|
422
|
-
* the SNR primary key.
|
|
423
|
-
*/
|
|
424
|
-
function compareCallSitesTiebreak(a, b) {
|
|
425
|
-
// Shallower path = likely more central (controller/service > impl/detail)
|
|
426
|
-
const aDepth = a.filePath.split('/').length;
|
|
427
|
-
const bDepth = b.filePath.split('/').length;
|
|
428
|
-
if (aDepth !== bDepth)
|
|
429
|
-
return aDepth - bDepth;
|
|
430
|
-
// Stable tiebreak by file:line
|
|
431
|
-
if (a.filePath !== b.filePath)
|
|
432
|
-
return a.filePath.localeCompare(b.filePath);
|
|
433
|
-
return a.line - b.line;
|
|
434
|
-
}
|
|
435
|
-
function estimateSiteSize(site) {
|
|
436
|
-
// Rough: snippet dominates. Count snippet + fixed overhead per field.
|
|
437
|
-
return site.snippet.length + 200;
|
|
438
|
-
}
|
|
439
|
-
// ---------------------------------------------------------------------------
|
|
440
|
-
// File walk
|
|
441
|
-
// ---------------------------------------------------------------------------
|
|
442
|
-
async function listJavaFamilyFiles(projectRoot, excludeDirs) {
|
|
443
|
-
const results = [];
|
|
444
|
-
await walkDir(projectRoot, projectRoot, excludeDirs, results);
|
|
445
|
-
return results;
|
|
446
|
-
}
|
|
447
|
-
async function walkDir(root, currentDir, excludeDirs, results) {
|
|
448
|
-
let entries;
|
|
449
|
-
try {
|
|
450
|
-
entries = await fs_1.promises.readdir(currentDir, { withFileTypes: true });
|
|
451
|
-
}
|
|
452
|
-
catch {
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
for (const entry of entries) {
|
|
456
|
-
if (entry.isDirectory()) {
|
|
457
|
-
if (excludeDirs.has(entry.name))
|
|
458
|
-
continue;
|
|
459
|
-
// Skip hidden dirs (except none — we exclude all starting with '.')
|
|
460
|
-
if (entry.name.startsWith('.') && entry.name !== '.')
|
|
461
|
-
continue;
|
|
462
|
-
await walkDir(root, path.join(currentDir, entry.name), excludeDirs, results);
|
|
463
|
-
}
|
|
464
|
-
else if (entry.isFile()) {
|
|
465
|
-
const ext = path.extname(entry.name).toLowerCase();
|
|
466
|
-
if (JAVA_FAMILY_EXTENSIONS.has(ext)) {
|
|
467
|
-
results.push(path.join(currentDir, entry.name));
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
// ---------------------------------------------------------------------------
|
|
473
|
-
// Formatting (CLI / MCP consume these)
|
|
474
|
-
// ---------------------------------------------------------------------------
|
|
475
|
-
/**
|
|
476
|
-
* Format the result as agent-friendly markdown. Compact by default to keep
|
|
477
|
-
* token cost low — agent gets signal density without reading whole files.
|
|
478
|
-
*/
|
|
479
|
-
function formatCallSitesResult(result, options) {
|
|
480
|
-
const lines = [];
|
|
481
|
-
const receiverWord = result.distinctReceivers === 1 ? 'receiver' : 'receivers';
|
|
482
|
-
lines.push(`**Call sites for \`${result.query}\` (${result.totalFound} found across ${result.distinctReceivers} ${receiverWord}, returning ${result.returned})**`);
|
|
483
|
-
// Group callSites by receiver — they're already clustered + ordered by
|
|
484
|
-
// SNR in searchCallSites: receiver groups sorted by the group's top caller
|
|
485
|
-
// SNR score (xBdy injected-service callers first, noise groups last), and
|
|
486
|
-
// within each group callers are sorted by SNR desc. We just walk and split
|
|
487
|
-
// on receiver change.
|
|
488
|
-
let currentReceiver = undefined;
|
|
489
|
-
for (const site of result.callSites) {
|
|
490
|
-
if (site.receiverText !== currentReceiver) {
|
|
491
|
-
const summary = result.receivers.find((r) => r.receiver === site.receiverText);
|
|
492
|
-
const label = site.receiverText ?? '(unqualified)';
|
|
493
|
-
const totalStr = summary
|
|
494
|
-
? ` (${summary.total} ${summary.total === 1 ? 'call' : 'calls'}${summary.returned < summary.total ? `, top ${summary.returned}` : ''})`
|
|
495
|
-
: '';
|
|
496
|
-
lines.push('');
|
|
497
|
-
lines.push(`### ${label}.${site.methodName}${totalStr}`);
|
|
498
|
-
currentReceiver = site.receiverText;
|
|
499
|
-
}
|
|
500
|
-
const loc = `${site.filePath}:${site.line}`;
|
|
501
|
-
const ctx = [];
|
|
502
|
-
if (site.containingMethod) {
|
|
503
|
-
ctx.push(site.containingClass ? `${site.containingClass}#${site.containingMethod}` : `#${site.containingMethod}`);
|
|
504
|
-
}
|
|
505
|
-
else if (site.containingClass) {
|
|
506
|
-
ctx.push(site.containingClass);
|
|
507
|
-
}
|
|
508
|
-
const ctxStr = ctx.length > 0 ? ` _in ${ctx.join(' :: ')}_` : '';
|
|
509
|
-
lines.push(`- \`${site.confidence}\` — ${site.reason}`);
|
|
510
|
-
lines.push(` \`${loc}\`${ctxStr}`);
|
|
511
|
-
if (site.snippet) {
|
|
512
|
-
const snippetLines = site.snippet.split('\n').slice(0, 3);
|
|
513
|
-
for (const sl of snippetLines) {
|
|
514
|
-
lines.push(` > ${sl}`);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
if (options?.explain) {
|
|
518
|
-
lines.push(` _score: ${formatSnrBreakdown(site)}_`);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
// Omitted summary — transparency so agent knows what was filtered
|
|
522
|
-
const o = result.omitted;
|
|
523
|
-
const omittedParts = [];
|
|
524
|
-
if (o.skippedFiles > 0)
|
|
525
|
-
omittedParts.push(`${o.skippedFiles} files without text match`);
|
|
526
|
-
if (o.filteredByReceiver > 0)
|
|
527
|
-
omittedParts.push(`${o.filteredByReceiver} filtered by receiver`);
|
|
528
|
-
if (o.truncatedByTopK > 0)
|
|
529
|
-
omittedParts.push(`${o.truncatedByTopK} past topK`);
|
|
530
|
-
if (o.truncatedByBudget > 0)
|
|
531
|
-
omittedParts.push(`${o.truncatedByBudget} truncated by budget`);
|
|
532
|
-
if (omittedParts.length > 0) {
|
|
533
|
-
lines.push('');
|
|
534
|
-
lines.push(`_Omitted: ${omittedParts.join(' · ')}_`);
|
|
535
|
-
}
|
|
536
|
-
// Other receivers truncated by topK — surfaced so the agent knows they
|
|
537
|
-
// exist without re-querying. Tells the agent "if you need calls from these
|
|
538
|
-
// receivers, re-query with --receiver X".
|
|
539
|
-
const unreturnedReceivers = result.receivers.filter((r) => r.returned === 0);
|
|
540
|
-
if (unreturnedReceivers.length > 0) {
|
|
541
|
-
lines.push('');
|
|
542
|
-
const summary = unreturnedReceivers
|
|
543
|
-
.map((r) => `${r.receiver ?? '(unqualified)'} (${r.total})`)
|
|
544
|
-
.join(' · ');
|
|
545
|
-
lines.push(`_Other receivers (topK reached, use \`-r <receiver>\` to drill in): ${summary}_`);
|
|
546
|
-
}
|
|
547
|
-
lines.push('');
|
|
548
|
-
lines.push('_Note: AST-based — comments and string literals are excluded by construction (reported as 0)._');
|
|
549
|
-
return lines.join('\n');
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* Resolve a symbol reference to its AST method_declaration node.
|
|
553
|
-
*
|
|
554
|
-
* Supported formats:
|
|
555
|
-
* - `file:line` — absolute precision; finds the method_declaration containing that line
|
|
556
|
-
* - `Class#method` — text-search for `class Class`, then AST-verifies the method inside
|
|
557
|
-
* - `pkg.Class#method` — same as above, pkg is currently ignored (text search by Class name only)
|
|
558
|
-
*/
|
|
559
|
-
async function resolveMethodSymbol(projectRoot, symbol, languages) {
|
|
560
|
-
// Case 1: file:line
|
|
561
|
-
const lineMatch = symbol.match(/^(.+):(\d+)$/);
|
|
562
|
-
if (lineMatch) {
|
|
563
|
-
const [, relPath, lineStr] = lineMatch;
|
|
564
|
-
if (!relPath || !lineStr) {
|
|
565
|
-
throw new Error(`Invalid file:line symbol: "${symbol}"`);
|
|
566
|
-
}
|
|
567
|
-
const file = path.resolve(projectRoot, relPath);
|
|
568
|
-
const content = await fs_1.promises.readFile(file, 'utf-8');
|
|
569
|
-
const language = (0, grammars_1.detectLanguage)(file, content);
|
|
570
|
-
if (!languages.includes(language)) {
|
|
571
|
-
throw new Error(`File ${relPath} is ${language}, not in supported ${languages.join('/')}`);
|
|
572
|
-
}
|
|
573
|
-
await (0, grammars_1.loadGrammarsForLanguages)([language]);
|
|
574
|
-
const parser = (0, grammars_1.getParser)(language);
|
|
575
|
-
if (!parser)
|
|
576
|
-
throw new Error(`No parser available for ${language}`);
|
|
577
|
-
const tree = parser.parse(content);
|
|
578
|
-
if (!tree)
|
|
579
|
-
throw new Error(`Failed to parse ${relPath}`);
|
|
580
|
-
const line = parseInt(lineStr, 10);
|
|
581
|
-
const methodNode = findMethodDeclarationContaining(tree.rootNode, line);
|
|
582
|
-
if (!methodNode) {
|
|
583
|
-
throw new Error(`No method_declaration contains line ${line} in ${relPath}`);
|
|
584
|
-
}
|
|
585
|
-
return {
|
|
586
|
-
file,
|
|
587
|
-
methodNode,
|
|
588
|
-
methodQualifiedName: qualifyMethod(methodNode),
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
// Case 2: Class#method
|
|
592
|
-
const hashMatch = symbol.match(/^(?:([\w.]+)\.)?(\w+)#(\w+)$/);
|
|
593
|
-
if (hashMatch) {
|
|
594
|
-
const [, , className, methodName] = hashMatch;
|
|
595
|
-
if (!className || !methodName) {
|
|
596
|
-
throw new Error(`Invalid Class#method symbol: "${symbol}"`);
|
|
597
|
-
}
|
|
598
|
-
const candidateFiles = await findFilesWithClass(projectRoot, className);
|
|
599
|
-
await (0, grammars_1.loadGrammarsForLanguages)(languages);
|
|
600
|
-
let lastErr = null;
|
|
601
|
-
for (const file of candidateFiles) {
|
|
602
|
-
let content;
|
|
603
|
-
try {
|
|
604
|
-
content = await fs_1.promises.readFile(file, 'utf-8');
|
|
605
|
-
}
|
|
606
|
-
catch {
|
|
607
|
-
continue;
|
|
608
|
-
}
|
|
609
|
-
const language = (0, grammars_1.detectLanguage)(file, content);
|
|
610
|
-
if (!languages.includes(language))
|
|
611
|
-
continue;
|
|
612
|
-
const parser = (0, grammars_1.getParser)(language);
|
|
613
|
-
if (!parser)
|
|
614
|
-
continue;
|
|
615
|
-
const tree = parser.parse(content);
|
|
616
|
-
if (!tree)
|
|
617
|
-
continue;
|
|
618
|
-
const methodNode = findMethodInClass(tree.rootNode, className, methodName);
|
|
619
|
-
if (methodNode) {
|
|
620
|
-
return {
|
|
621
|
-
file,
|
|
622
|
-
methodNode,
|
|
623
|
-
methodQualifiedName: `${className}#${methodName}`,
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
lastErr = new Error(`Class ${className} found in ${file} but method ${methodName} not declared`);
|
|
627
|
-
}
|
|
628
|
-
throw lastErr ?? new Error(`Class ${className} not found in any source file`);
|
|
629
|
-
}
|
|
630
|
-
throw new Error(`Unrecognized symbol format: "${symbol}". Use "file:line" (e.g., src/Foo.java:82) or "Class#method" (e.g., Foo#bar).`);
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* Find the deepest method_declaration whose range contains `line`.
|
|
634
|
-
* Tolerates nested methods (anonymous classes / lambdas) by preferring the inner-most.
|
|
635
|
-
*/
|
|
636
|
-
function findMethodDeclarationContaining(root, line) {
|
|
637
|
-
let best = null;
|
|
638
|
-
(0, ast_helpers_1.walkTree)(root, (n) => {
|
|
639
|
-
if (n.type === 'method_declaration' ||
|
|
640
|
-
n.type === 'constructor_declaration' ||
|
|
641
|
-
n.type === 'compact_constructor_declaration') {
|
|
642
|
-
const startLine = n.startPosition.row + 1;
|
|
643
|
-
const endLine = n.endPosition.row + 1;
|
|
644
|
-
if (line >= startLine && line <= endLine) {
|
|
645
|
-
// Deepest = latest-starting (inner-most for nested)
|
|
646
|
-
if (!best || n.startPosition.row > best.startPosition.row) {
|
|
647
|
-
best = n;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
});
|
|
652
|
-
return best;
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* Find a method_declaration named `methodName` inside any class/interface/enum/record
|
|
656
|
-
* named `className`. Walks all type-declaration kinds so that interface methods
|
|
657
|
-
* (`IFoo#bar`) resolve correctly, not just concrete-class methods.
|
|
658
|
-
*/
|
|
659
|
-
function findMethodInClass(root, className, methodName) {
|
|
660
|
-
let found = null;
|
|
661
|
-
(0, ast_helpers_1.walkTree)(root, (n) => {
|
|
662
|
-
if (found)
|
|
663
|
-
return;
|
|
664
|
-
if (n.type !== 'class_declaration' &&
|
|
665
|
-
n.type !== 'interface_declaration' &&
|
|
666
|
-
n.type !== 'enum_declaration' &&
|
|
667
|
-
n.type !== 'record_declaration')
|
|
668
|
-
return;
|
|
669
|
-
const nameNode = n.childForFieldName('name');
|
|
670
|
-
if (!nameNode || nameNode.text !== className)
|
|
671
|
-
return;
|
|
672
|
-
(0, ast_helpers_1.walkTree)(n, (m) => {
|
|
673
|
-
if (found)
|
|
674
|
-
return;
|
|
675
|
-
if (m.type !== 'method_declaration' && m.type !== 'constructor_declaration')
|
|
676
|
-
return;
|
|
677
|
-
const mNameNode = m.childForFieldName('name');
|
|
678
|
-
if (mNameNode && mNameNode.text === methodName) {
|
|
679
|
-
found = m;
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
});
|
|
683
|
-
return found;
|
|
684
|
-
}
|
|
685
|
-
function qualifyMethod(methodNode) {
|
|
686
|
-
const classNode = findAncestorName(methodNode, [
|
|
687
|
-
'class_declaration',
|
|
688
|
-
'interface_declaration',
|
|
689
|
-
'enum_declaration',
|
|
690
|
-
'record_declaration',
|
|
691
|
-
]);
|
|
692
|
-
const nameNode = methodNode.childForFieldName('name');
|
|
693
|
-
const methodName = nameNode?.text ?? '<anonymous>';
|
|
694
|
-
return classNode ? `${classNode}#${methodName}` : methodName;
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Find the nearest enclosing named type declaration (class/interface/enum/record)
|
|
698
|
-
* for a node. Returns the declaration node itself, not just its name.
|
|
699
|
-
*/
|
|
700
|
-
function findEnclosingClassType(node) {
|
|
701
|
-
let cur = node.parent;
|
|
702
|
-
while (cur) {
|
|
703
|
-
if (cur.type === 'class_declaration' ||
|
|
704
|
-
cur.type === 'interface_declaration' ||
|
|
705
|
-
cur.type === 'enum_declaration' ||
|
|
706
|
-
cur.type === 'record_declaration') {
|
|
707
|
-
return cur;
|
|
708
|
-
}
|
|
709
|
-
cur = cur.parent;
|
|
710
|
-
}
|
|
711
|
-
return null;
|
|
712
|
-
}
|
|
713
|
-
/**
|
|
714
|
-
* Walk a class body, find every field_declaration whose modifiers carry an
|
|
715
|
-
* injection annotation (@Resource / @Autowired / @Inject), and return a map
|
|
716
|
-
* keyed by field name. Used to mark cross-boundary callees.
|
|
717
|
-
*
|
|
718
|
-
* Java/Kotlin grammar: `field_declaration` has `modifiers` (list of modifier
|
|
719
|
-
* + annotation nodes) and `type`, and contains one or more `variable_declarator`
|
|
720
|
-
* nodes (each with a `name`). Multiple declarators share the same type+annotation.
|
|
721
|
-
*
|
|
722
|
-
* Annotations we recognize (Java):
|
|
723
|
-
* - jakarta/javax.annotation.Resource — JSR-250
|
|
724
|
-
* - org.springframework.beans.factory.annotation.Autowired — Spring
|
|
725
|
-
* - jakarta.inject.Inject — JSR-330
|
|
726
|
-
*
|
|
727
|
-
* Kotlin equivalent (kotlinx injected via spring) uses the same annotation types
|
|
728
|
-
* on `property_declaration`; we don't yet handle Kotlin property syntax, so
|
|
729
|
-
* Kotlin injection is under-detected — fine for the Java-first hx use case.
|
|
730
|
-
*
|
|
731
|
-
* The annotation short-name set lives in ./snr-constants.ts (INJECTION_ANNOTATIONS).
|
|
732
|
-
*/
|
|
733
|
-
function extractInjectedFields(classNode) {
|
|
734
|
-
const result = new Map();
|
|
735
|
-
(0, ast_helpers_1.walkTree)(classNode, (n) => {
|
|
736
|
-
if (n.type !== 'field_declaration')
|
|
737
|
-
return;
|
|
738
|
-
// tree-sitter-java: field_declaration has `type` as a named field, but
|
|
739
|
-
// `modifiers` is a positional child node (type 'modifiers'), not a named
|
|
740
|
-
// field — childForFieldName('modifiers') returns null. Iterate children.
|
|
741
|
-
let modifiersNode = null;
|
|
742
|
-
for (const child of n.children) {
|
|
743
|
-
if (child?.type === 'modifiers') {
|
|
744
|
-
modifiersNode = child;
|
|
745
|
-
break;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
if (!modifiersNode)
|
|
749
|
-
return;
|
|
750
|
-
let annotation = null;
|
|
751
|
-
for (const child of modifiersNode.children) {
|
|
752
|
-
if (!child)
|
|
753
|
-
continue;
|
|
754
|
-
if (child.type !== 'annotation' && child.type !== 'marker_annotation')
|
|
755
|
-
continue;
|
|
756
|
-
const nameNode = child.childForFieldName('name');
|
|
757
|
-
if (!nameNode)
|
|
758
|
-
continue;
|
|
759
|
-
// Spring/javax annotations may be fully-qualified in some codebases;
|
|
760
|
-
// take the last segment for the lookup.
|
|
761
|
-
const shortName = nameNode.text.split('.').pop() ?? nameNode.text;
|
|
762
|
-
if (snr_constants_1.INJECTION_ANNOTATIONS.has(shortName)) {
|
|
763
|
-
annotation = shortName;
|
|
764
|
-
break;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
if (!annotation)
|
|
768
|
-
return;
|
|
769
|
-
const typeNode = n.childForFieldName('type');
|
|
770
|
-
if (!typeNode)
|
|
771
|
-
return;
|
|
772
|
-
const fieldType = typeNode.text;
|
|
773
|
-
(0, ast_helpers_1.walkTree)(n, (v) => {
|
|
774
|
-
if (v.type !== 'variable_declarator')
|
|
775
|
-
return;
|
|
776
|
-
const nameNode = v.childForFieldName('name');
|
|
777
|
-
if (!nameNode || nameNode.type !== 'identifier')
|
|
778
|
-
return;
|
|
779
|
-
result.set(nameNode.text, { fieldName: nameNode.text, fieldType, annotation });
|
|
780
|
-
});
|
|
781
|
-
});
|
|
782
|
-
return result;
|
|
783
|
-
}
|
|
784
|
-
/**
|
|
785
|
-
* Find source files that textually look like they declare `class className`.
|
|
786
|
-
* Uses a fast regex pre-filter; AST verification happens later in findMethodInClass.
|
|
787
|
-
*/
|
|
788
|
-
async function findFilesWithClass(projectRoot, className) {
|
|
789
|
-
const allFiles = await listJavaFamilyFiles(projectRoot, exports.DEFAULT_EXCLUDE_DIRS);
|
|
790
|
-
const candidates = [];
|
|
791
|
-
const pattern = new RegExp(`\\b(class|interface|enum|record)\\s+${escapeRegex(className)}\\b`);
|
|
792
|
-
for (const file of allFiles) {
|
|
793
|
-
try {
|
|
794
|
-
const content = await fs_1.promises.readFile(file, 'utf-8');
|
|
795
|
-
if (pattern.test(content)) {
|
|
796
|
-
candidates.push(file);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
catch {
|
|
800
|
-
// skip unreadable
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
return candidates;
|
|
804
|
-
}
|
|
805
|
-
function escapeRegex(s) {
|
|
806
|
-
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
807
|
-
}
|
|
808
|
-
// ===========================================================================
|
|
809
|
-
// SNR scoring (spec §2)
|
|
810
|
-
//
|
|
811
|
-
// Per-callee score that ranks "agent would need to follow this hop" higher
|
|
812
|
-
// than "boilerplate the agent can ignore". Validated against 6 hx samples
|
|
813
|
-
// (see docs/features/2026-07-01-calls-command/snr-probe.md).
|
|
814
|
-
// ===========================================================================
|
|
815
|
-
// RE_BIZ_VERB and the rest of the SNR-scoring regex/Set constants now live
|
|
816
|
-
// in ./snr-constants.ts (shared with context.ts).
|
|
817
|
-
/**
|
|
818
|
-
* Split a camelCase / PascalCase identifier into lowercase segments.
|
|
819
|
-
* `saleOrderSceneGroupCommit` → `['sale', 'order', 'scene', 'group', 'commit']`.
|
|
820
|
-
*
|
|
821
|
-
* Used by same-class biz detection (§2.3) so methods whose biz verb appears
|
|
822
|
-
* as an inner segment — `saleOrderSceneGroupCommit` contains `scene` and
|
|
823
|
-
* `commit` — still get tagged. The strict `^biz-verb` prefix in RE_BIZ_VERB
|
|
824
|
-
* would miss these. Probe sample 3 surfaced exactly this case.
|
|
825
|
-
*/
|
|
826
|
-
function camelCaseSegments(name) {
|
|
827
|
-
return name.split(/(?=[A-Z])/).map((s) => s.toLowerCase());
|
|
828
|
-
}
|
|
829
|
-
/** True if any camelCase segment of `name` starts with a biz verb. */
|
|
830
|
-
function containsBizVerbSegment(name) {
|
|
831
|
-
return camelCaseSegments(name).some((s) => snr_constants_1.RE_BIZ_VERB.test(s));
|
|
832
|
-
}
|
|
833
|
-
/**
|
|
834
|
-
* Param / local VO variable names observed across the hx corpus. Matched as
|
|
835
|
-
* exact root identifier (after `rootIdentifier()` extraction). Generalized
|
|
836
|
-
* `param/params/vo/dto/resp/req/result/response/exception/e/ex/err` cover
|
|
837
|
-
* most local-var patterns; hx-specific names kept for fidelity but the
|
|
838
|
-
* heuristic generalizes via the suffix-match in `looksLikeVO`.
|
|
839
|
-
*/
|
|
840
|
-
const PARAM_VO_NAMES = new Set([
|
|
841
|
-
'reqVo', 'rspVo', 'reqVo1', 'rspVo1',
|
|
842
|
-
'req', 'rsp', 'request', 'response', 'resp',
|
|
843
|
-
'result', 'finalResult', 'curResult', 'responseVo', 'errRspVo',
|
|
844
|
-
'baseInfo', 'orderInfo', 'prod', 'ord', 'safe',
|
|
845
|
-
'custOrder', 'customerOrder', 'sysCustomerOrder',
|
|
846
|
-
'cartDelReqVo', 'chargeInfo', 'chargeInfoByCustOrderNbr', 'pkgGrpReqVo',
|
|
847
|
-
'confirmRspVo', 'createCustomerOrderRspVo', 'createCustomerOrderReqVo',
|
|
848
|
-
'reqReceiptVo', 'acctInfo', 'newAcctInfo', 'respAcctInfo',
|
|
849
|
-
'exception', 'e', 'ex', 'err', 't',
|
|
850
|
-
'param', 'params', 'map', 'vo', 'dto',
|
|
851
|
-
]);
|
|
852
|
-
/**
|
|
853
|
-
* Static-const access pattern: `UpperCamel.UPPER_SNAKE`. Catches `SoMDA.X`,
|
|
854
|
-
* `BizCodeType.X`, `ErrIntfResultCode.X`, `SomeEnum.X`. The all-caps second
|
|
855
|
-
* segment distinguishes from `UpperCamel.lowerMethod(` calls.
|
|
856
|
-
*/
|
|
857
|
-
const RE_STATIC_CONST = /^[A-Z][a-zA-Z0-9]*\.[A-Z][A-Z0-9_]+/;
|
|
858
|
-
/**
|
|
859
|
-
* Stream-chain receiver: contains `.stream()` or a `.map(/.filter(/...` call
|
|
860
|
-
* (the opening paren distinguishes from getter `getX`).
|
|
861
|
-
*/
|
|
862
|
-
function isStreamChain(receiver) {
|
|
863
|
-
return (receiver.includes('.stream()') ||
|
|
864
|
-
/\.(map|filter|collect|forEach|reduce|flatMap|sorted|distinct|limit|peek)\s*\(/.test(receiver));
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Literal receiver: starts (after whitespace/parens) with a quote or digit.
|
|
868
|
-
* Catches `"Y".equals(...)`, `0`, etc.
|
|
869
|
-
*/
|
|
870
|
-
function isLiteral(receiver) {
|
|
871
|
-
return /^[\s(]*["'`\d]/.test(receiver);
|
|
872
|
-
}
|
|
873
|
-
/**
|
|
874
|
-
* Extract the root identifier from a (possibly chained/cast) receiver.
|
|
875
|
-
* `((BxError) e)` → `e`; `sysCustomerOrder.getOrderInfo()` → `sysCustomerOrder`;
|
|
876
|
-
* `prods` → `prods`. Returns the LAST identifier in the first dot-segment,
|
|
877
|
-
* which correctly skips cast type names.
|
|
878
|
-
*/
|
|
879
|
-
function rootIdentifier(receiver) {
|
|
880
|
-
const firstPart = receiver.split('.')[0] ?? '';
|
|
881
|
-
const idents = firstPart.match(/[a-zA-Z_$][a-zA-Z0-9_$]*/g);
|
|
882
|
-
if (!idents || idents.length === 0)
|
|
883
|
-
return '';
|
|
884
|
-
return idents[idents.length - 1] ?? '';
|
|
885
|
-
}
|
|
886
|
-
/**
|
|
887
|
-
* Compute the SNR score for a callee (spec §2).
|
|
888
|
-
*
|
|
889
|
-
* Receiver features are mutually exclusive and applied first; method-name
|
|
890
|
-
* features apply on top UNLESS the receiver is xBdy (short-circuit per §2.1).
|
|
891
|
-
*
|
|
892
|
-
* xBdy callees short-circuit to +100 — every other consideration is noise
|
|
893
|
-
* relative to "this is an injected business collaborator".
|
|
894
|
-
*/
|
|
895
|
-
function computeSnrScore(site) {
|
|
896
|
-
return computeSnrBreakdown(site).total;
|
|
897
|
-
}
|
|
898
|
-
function computeSnrBreakdown(site) {
|
|
899
|
-
// xBdy short-circuit
|
|
900
|
-
if (site.crossBoundary) {
|
|
901
|
-
return { receiver: 100, method: 0, total: 100, matchedRules: ['xBdy'] };
|
|
902
|
-
}
|
|
903
|
-
let receiverScore = 0;
|
|
904
|
-
let methodScore = 0;
|
|
905
|
-
const matchedRules = [];
|
|
906
|
-
const receiver = site.receiverText ?? '';
|
|
907
|
-
const method = site.methodName;
|
|
908
|
-
// === Receiver features (mutually exclusive) ===
|
|
909
|
-
if (site.sameClassBiz) {
|
|
910
|
-
receiverScore += 50; // sibling biz-verb in same class
|
|
911
|
-
matchedRules.push('sibling');
|
|
912
|
-
}
|
|
913
|
-
else if (receiver === '') {
|
|
914
|
-
receiverScore += 10; // unqualified, not biz — likely this.helper() or static import
|
|
915
|
-
matchedRules.push('unqualified');
|
|
916
|
-
}
|
|
917
|
-
else if (isStreamChain(receiver)) {
|
|
918
|
-
receiverScore -= 60;
|
|
919
|
-
matchedRules.push('streamOp');
|
|
920
|
-
}
|
|
921
|
-
else if (isLiteral(receiver)) {
|
|
922
|
-
receiverScore -= 40;
|
|
923
|
-
matchedRules.push('literal');
|
|
924
|
-
}
|
|
925
|
-
else {
|
|
926
|
-
const root = rootIdentifier(receiver);
|
|
927
|
-
if (snr_constants_1.RE_JDK_STDLIB.test(root)) {
|
|
928
|
-
receiverScore -= 60;
|
|
929
|
-
matchedRules.push('jdkStdlib');
|
|
930
|
-
}
|
|
931
|
-
else if (snr_constants_1.RE_APACHE_UTIL.test(root)) {
|
|
932
|
-
receiverScore -= 60;
|
|
933
|
-
matchedRules.push('apacheUtil');
|
|
934
|
-
}
|
|
935
|
-
else if (snr_constants_1.RE_GUAVA.test(root)) {
|
|
936
|
-
receiverScore -= 60;
|
|
937
|
-
matchedRules.push('guavaUtil');
|
|
938
|
-
}
|
|
939
|
-
else if (root === 'log' || /Logger$/.test(root)) {
|
|
940
|
-
receiverScore -= 60;
|
|
941
|
-
matchedRules.push('logCall');
|
|
942
|
-
}
|
|
943
|
-
else if (PARAM_VO_NAMES.has(root)) {
|
|
944
|
-
receiverScore -= 30;
|
|
945
|
-
matchedRules.push('paramVo');
|
|
946
|
-
}
|
|
947
|
-
else if (RE_STATIC_CONST.test(receiver)) {
|
|
948
|
-
receiverScore -= 40;
|
|
949
|
-
matchedRules.push('staticConst');
|
|
950
|
-
}
|
|
951
|
-
else if (/Util$|Helper$/.test(root)) {
|
|
952
|
-
receiverScore -= 50;
|
|
953
|
-
matchedRules.push('utilClass');
|
|
954
|
-
}
|
|
955
|
-
else if (/(Service|Client|Api|Mapper|Repository|Facade|Gateway|Busi)$/i.test(root)) {
|
|
956
|
-
receiverScore += 60;
|
|
957
|
-
matchedRules.push('serviceIsh');
|
|
958
|
-
}
|
|
959
|
-
// else: neutral (score += 0)
|
|
960
|
-
}
|
|
961
|
-
// === Method-name features (apply to all non-xBdy, including sameClassBiz) ===
|
|
962
|
-
// sameClassBiz implies biz-verb (per §2.3), so the biz-verb branch naturally
|
|
963
|
-
// adds +30 on top of the +50 from sameClassBiz — sameClassBiz callee totals +80.
|
|
964
|
-
if (snr_constants_1.OBJECT_METHODS.has(method)) {
|
|
965
|
-
methodScore -= 80;
|
|
966
|
-
matchedRules.push('objectMethod');
|
|
967
|
-
}
|
|
968
|
-
else if (snr_constants_1.MAP_OPS.has(method)) {
|
|
969
|
-
methodScore -= 25;
|
|
970
|
-
matchedRules.push('mapOp');
|
|
971
|
-
}
|
|
972
|
-
else if (snr_constants_1.RE_GETTER.test(method)) {
|
|
973
|
-
methodScore -= 20;
|
|
974
|
-
matchedRules.push('getter');
|
|
975
|
-
}
|
|
976
|
-
else if (snr_constants_1.RE_SETTER.test(method)) {
|
|
977
|
-
methodScore -= 20;
|
|
978
|
-
matchedRules.push('setter');
|
|
979
|
-
}
|
|
980
|
-
else if (snr_constants_1.RE_BOOL_GETTER.test(method)) {
|
|
981
|
-
methodScore -= 15;
|
|
982
|
-
matchedRules.push('boolGetter');
|
|
983
|
-
}
|
|
984
|
-
else if (snr_constants_1.RE_BIZ_VERB.test(method)) {
|
|
985
|
-
methodScore += 30;
|
|
986
|
-
matchedRules.push('bizVerb');
|
|
987
|
-
}
|
|
988
|
-
return {
|
|
989
|
-
receiver: receiverScore,
|
|
990
|
-
method: methodScore,
|
|
991
|
-
total: receiverScore + methodScore,
|
|
992
|
-
matchedRules,
|
|
993
|
-
};
|
|
994
|
-
}
|
|
995
|
-
/**
|
|
996
|
-
* Format an SNR breakdown as a single-line score explanation for the
|
|
997
|
-
* `--explain` flag. Shape:
|
|
998
|
-
* `+100 xBdy = 100`
|
|
999
|
-
* `+60 serviceIsh +30 bizVerb = 90`
|
|
1000
|
-
* `-60 jdkStdlib -80 objectMethod = -140`
|
|
1001
|
-
* `+10 unqualified -25 mapOp = -15`
|
|
1002
|
-
*
|
|
1003
|
-
* Neutral axes (no rule fired) are omitted to keep the breakdown scannable.
|
|
1004
|
-
*
|
|
1005
|
-
* Only fires on non-impact call sites — impact call sites have hop decay and
|
|
1006
|
-
* use `formatImpactSnrBreakdown` instead.
|
|
1007
|
-
*/
|
|
1008
|
-
function formatSnrBreakdown(site) {
|
|
1009
|
-
const bd = computeSnrBreakdown(site);
|
|
1010
|
-
const receiverRules = bd.matchedRules.filter(isReceiverRule);
|
|
1011
|
-
const methodRules = bd.matchedRules.filter(isMethodRule);
|
|
1012
|
-
const parts = [];
|
|
1013
|
-
// xBdy short-circuits, so receiver is the only axis that matters.
|
|
1014
|
-
if (receiverRules.length > 0) {
|
|
1015
|
-
parts.push(formatScoreComponent(bd.receiver, receiverRules));
|
|
1016
|
-
}
|
|
1017
|
-
if (methodRules.length > 0) {
|
|
1018
|
-
parts.push(formatScoreComponent(bd.method, methodRules));
|
|
1019
|
-
}
|
|
1020
|
-
// Edge case: both axes neutral (score 0, no rules) — show `+0` so the
|
|
1021
|
-
// line isn't empty.
|
|
1022
|
-
if (parts.length === 0) {
|
|
1023
|
-
parts.push('+0');
|
|
1024
|
-
}
|
|
1025
|
-
return `${parts.join(' ')} = ${bd.total}`;
|
|
1026
|
-
}
|
|
1027
|
-
/**
|
|
1028
|
-
* Format a score component as `[+|-]<points> <rule1,rule2>`.
|
|
1029
|
-
*/
|
|
1030
|
-
function formatScoreComponent(score, rules) {
|
|
1031
|
-
const sign = score >= 0 ? '+' : '';
|
|
1032
|
-
const rulesStr = rules.length > 0 ? ` ${rules.join(',')}` : '';
|
|
1033
|
-
return `${sign}${score}${rulesStr}`;
|
|
1034
|
-
}
|
|
1035
|
-
/**
|
|
1036
|
-
* Receiver-axis rules — those applied first (mutually exclusive). Used to
|
|
1037
|
-
* split the breakdown into receiver / method halves for display.
|
|
1038
|
-
*/
|
|
1039
|
-
const RECEIVER_RULES = new Set([
|
|
1040
|
-
'xBdy',
|
|
1041
|
-
'sibling',
|
|
1042
|
-
'unqualified',
|
|
1043
|
-
'streamOp',
|
|
1044
|
-
'literal',
|
|
1045
|
-
'jdkStdlib',
|
|
1046
|
-
'apacheUtil',
|
|
1047
|
-
'guavaUtil',
|
|
1048
|
-
'logCall',
|
|
1049
|
-
'paramVo',
|
|
1050
|
-
'staticConst',
|
|
1051
|
-
'utilClass',
|
|
1052
|
-
'serviceIsh',
|
|
1053
|
-
]);
|
|
1054
|
-
function isReceiverRule(rule) {
|
|
1055
|
-
return RECEIVER_RULES.has(rule);
|
|
1056
|
-
}
|
|
1057
|
-
function isMethodRule(rule) {
|
|
1058
|
-
return !RECEIVER_RULES.has(rule);
|
|
1059
|
-
}
|
|
1060
|
-
/**
|
|
1061
|
-
* Compare two callees by SNR score desc, then by filePath depth asc (shallower
|
|
1062
|
-
* = more central), then by line asc (call order). Stable tiebreaker chain.
|
|
1063
|
-
*/
|
|
1064
|
-
function compareBySnr(a, b) {
|
|
1065
|
-
const sa = a.snrScore ?? 0;
|
|
1066
|
-
const sb = b.snrScore ?? 0;
|
|
1067
|
-
if (sa !== sb)
|
|
1068
|
-
return sb - sa;
|
|
1069
|
-
const da = a.filePath.split('/').length;
|
|
1070
|
-
const db = b.filePath.split('/').length;
|
|
1071
|
-
if (da !== db)
|
|
1072
|
-
return da - db;
|
|
1073
|
-
if (a.filePath !== b.filePath)
|
|
1074
|
-
return a.filePath.localeCompare(b.filePath);
|
|
1075
|
-
return a.line - b.line;
|
|
1076
|
-
}
|
|
1077
|
-
/**
|
|
1078
|
-
* Collect names of all method/constructor declarations directly in a class body.
|
|
1079
|
-
* Used by same-class biz-verb detection (§2.3) — when an unqualified call's
|
|
1080
|
-
* method name is in this set AND matches a biz-verb regex, mark the callee as
|
|
1081
|
-
* `sameClassBiz: true`.
|
|
1082
|
-
*
|
|
1083
|
-
* Walks only direct children of the class_body (no nested-class descent) so
|
|
1084
|
-
* that a method declared in an inner class isn't mistaken for a sibling of
|
|
1085
|
-
* the outer class's methods.
|
|
1086
|
-
*/
|
|
1087
|
-
function collectSameClassMethodNames(classNode) {
|
|
1088
|
-
const names = new Set();
|
|
1089
|
-
// Find the class_body child of the class_declaration.
|
|
1090
|
-
let body = null;
|
|
1091
|
-
for (const child of classNode.children) {
|
|
1092
|
-
if (child?.type === 'class_body' || child?.type === 'enum_body' || child?.type === 'interface_body' || child?.type === 'record_body') {
|
|
1093
|
-
body = child;
|
|
1094
|
-
break;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
if (!body)
|
|
1098
|
-
return names;
|
|
1099
|
-
// Direct children only (no descent) — avoids catching inner-class methods.
|
|
1100
|
-
for (const child of body.children) {
|
|
1101
|
-
if (!child)
|
|
1102
|
-
continue;
|
|
1103
|
-
if (child.type === 'method_declaration' ||
|
|
1104
|
-
child.type === 'constructor_declaration' ||
|
|
1105
|
-
child.type === 'compact_constructor_declaration') {
|
|
1106
|
-
const nameNode = child.childForFieldName('name');
|
|
1107
|
-
if (nameNode)
|
|
1108
|
-
names.add(nameNode.text);
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
return names;
|
|
1112
|
-
}
|
|
1113
|
-
/**
|
|
1114
|
-
* Mark `sameClassBiz: true` on each callee that satisfies §2.3:
|
|
1115
|
-
* - receiverText is null (unqualified call)
|
|
1116
|
-
* - methodName contains a biz-verb segment (camelCase-aware — catches
|
|
1117
|
-
* `saleOrderSceneGroupCommit`, which the strict prefix regex misses)
|
|
1118
|
-
* - methodName is declared in the same class
|
|
1119
|
-
*
|
|
1120
|
-
* Returns a new array (does not mutate input). Exported for unit tests;
|
|
1121
|
-
* production path inlines the same logic in `searchCallees` to avoid the
|
|
1122
|
-
* extra array copy.
|
|
1123
|
-
*/
|
|
1124
|
-
function markSameClassBiz(callees, siblingNames) {
|
|
1125
|
-
return callees.map((c) => {
|
|
1126
|
-
if ((c.receiverText === null || c.receiverText === '') &&
|
|
1127
|
-
containsBizVerbSegment(c.methodName) &&
|
|
1128
|
-
siblingNames.has(c.methodName)) {
|
|
1129
|
-
return { ...c, sameClassBiz: true };
|
|
1130
|
-
}
|
|
1131
|
-
return c;
|
|
1132
|
-
});
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
|
-
* Find callees of a method — what does it call internally?
|
|
1136
|
-
* Walks the method body and collects every method_invocation, clustered by receiver.
|
|
1137
|
-
*
|
|
1138
|
-
* Ranking (spec §2):
|
|
1139
|
-
* 1. crossBoundary (`@Resource`/`@Autowired`/`@Inject`) — SNR +100
|
|
1140
|
-
* 2. sameClassBiz (unqualified + biz-verb + declared in same class) — SNR +50
|
|
1141
|
-
* 3. service-ish receiver name — SNR +60
|
|
1142
|
-
* 4. JDK/Apache stdlib, stream chains, param/local VO — negative scores
|
|
1143
|
-
* 5. method-name patterns stacked on top (except for xBdy which short-circuits)
|
|
1144
|
-
*
|
|
1145
|
-
* Cross-boundary detection walks the enclosing class for injected field
|
|
1146
|
-
* declarations; same-class biz detection walks it for sibling method names.
|
|
1147
|
-
* Both feed into `computeSnrScore`, which is what the sort uses.
|
|
1148
|
-
*
|
|
1149
|
-
* Tiered budget (spec §3): essential tier always emitted for every kept
|
|
1150
|
-
* callee; recommended/optional tiers filled in SNR order while budget
|
|
1151
|
-
* remains. `withSnippet` forces minimum recommended tier; `full` forces
|
|
1152
|
-
* optional tier and ignores the budget ceiling.
|
|
1153
|
-
*/
|
|
1154
|
-
async function searchCallees(projectRoot, symbol, options = {}) {
|
|
1155
|
-
const { topK = 20, topPerReceiver = 3, budget = 4000, languages = ['java', 'kotlin'], withSnippet = false, full = false, } = options;
|
|
1156
|
-
// 1. Resolve symbol → method_declaration AST node
|
|
1157
|
-
const resolved = await resolveMethodSymbol(projectRoot, symbol, languages);
|
|
1158
|
-
const content = await fs_1.promises.readFile(resolved.file, 'utf-8');
|
|
1159
|
-
// 2. Walk the method body, collect ALL method_invocation (wildcard)
|
|
1160
|
-
const rawCallees = extractMethodInvocations(resolved.methodNode, content, null, // null = wildcard (collect every method_invocation in the body)
|
|
1161
|
-
projectRoot, resolved.file);
|
|
1162
|
-
// 3. Cross-boundary + same-class biz detection
|
|
1163
|
-
const classNode = findEnclosingClassType(resolved.methodNode);
|
|
1164
|
-
const injectedFields = classNode
|
|
1165
|
-
? extractInjectedFields(classNode)
|
|
1166
|
-
: new Map();
|
|
1167
|
-
const siblingNames = classNode ? collectSameClassMethodNames(classNode) : new Set();
|
|
1168
|
-
const allCallees = rawCallees.map((site) => {
|
|
1169
|
-
// xBdy
|
|
1170
|
-
if (site.receiverText) {
|
|
1171
|
-
const injected = injectedFields.get(site.receiverText);
|
|
1172
|
-
if (injected) {
|
|
1173
|
-
site.crossBoundary = {
|
|
1174
|
-
kind: 'injected',
|
|
1175
|
-
fieldType: injected.fieldType,
|
|
1176
|
-
annotation: injected.annotation,
|
|
1177
|
-
};
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
// sameClassBiz (only if NOT xBdy — xBdy short-circuits in computeSnrScore anyway,
|
|
1181
|
-
// but we also don't want to falsely tag an xBdy field call as sameClassBiz).
|
|
1182
|
-
if (!site.crossBoundary &&
|
|
1183
|
-
(site.receiverText === null || site.receiverText === '') &&
|
|
1184
|
-
containsBizVerbSegment(site.methodName) &&
|
|
1185
|
-
siblingNames.has(site.methodName)) {
|
|
1186
|
-
site.sameClassBiz = true;
|
|
1187
|
-
}
|
|
1188
|
-
// SNR score
|
|
1189
|
-
site.snrScore = computeSnrScore(site);
|
|
1190
|
-
return site;
|
|
1191
|
-
});
|
|
1192
|
-
// 4. Cluster by receiver
|
|
1193
|
-
const distinctReceivers = new Set(allCallees.map((s) => s.receiverText)).size;
|
|
1194
|
-
const byReceiver = new Map();
|
|
1195
|
-
for (const site of allCallees) {
|
|
1196
|
-
const key = site.receiverText;
|
|
1197
|
-
const group = byReceiver.get(key) ?? [];
|
|
1198
|
-
group.push(site);
|
|
1199
|
-
byReceiver.set(key, group);
|
|
1200
|
-
}
|
|
1201
|
-
// Within each receiver group, sort by SNR desc (was: line asc)
|
|
1202
|
-
for (const group of byReceiver.values()) {
|
|
1203
|
-
group.sort(compareBySnr);
|
|
1204
|
-
}
|
|
1205
|
-
// Receivers ordered by their top callee's SNR score (was: xBdy first, then size).
|
|
1206
|
-
// xBdy callees score +100 so xBdy groups naturally rise to the top; sameClassBiz
|
|
1207
|
-
// groups (+80) come next; high-SNR non-xBdy groups follow; pure-noise groups
|
|
1208
|
-
// (e.g., CollectionUtils) sort to the bottom.
|
|
1209
|
-
const sortedReceivers = [...byReceiver.entries()].sort((a, b) => {
|
|
1210
|
-
const aTop = a[1][0]?.snrScore ?? -Infinity;
|
|
1211
|
-
const bTop = b[1][0]?.snrScore ?? -Infinity;
|
|
1212
|
-
if (aTop !== bTop)
|
|
1213
|
-
return bTop - aTop;
|
|
1214
|
-
return b[1].length - a[1].length; // tiebreak: larger group first
|
|
1215
|
-
});
|
|
1216
|
-
const receivers = [];
|
|
1217
|
-
const topSites = [];
|
|
1218
|
-
for (const [receiverKey, group] of sortedReceivers) {
|
|
1219
|
-
const injected = receiverKey ? injectedFields.get(receiverKey) : undefined;
|
|
1220
|
-
const topSnr = group[0]?.snrScore;
|
|
1221
|
-
const hasSibling = group.some((c) => c.sameClassBiz === true);
|
|
1222
|
-
if (topSites.length >= topK) {
|
|
1223
|
-
receivers.push({
|
|
1224
|
-
receiver: receiverKey,
|
|
1225
|
-
total: group.length,
|
|
1226
|
-
returned: 0,
|
|
1227
|
-
crossBoundary: injected,
|
|
1228
|
-
sameClassBiz: hasSibling || undefined,
|
|
1229
|
-
topSnrScore: topSnr,
|
|
1230
|
-
});
|
|
1231
|
-
continue;
|
|
1232
|
-
}
|
|
1233
|
-
const take = Math.min(topPerReceiver, group.length, topK - topSites.length);
|
|
1234
|
-
topSites.push(...group.slice(0, take));
|
|
1235
|
-
receivers.push({
|
|
1236
|
-
receiver: receiverKey,
|
|
1237
|
-
total: group.length,
|
|
1238
|
-
returned: take,
|
|
1239
|
-
crossBoundary: injected,
|
|
1240
|
-
sameClassBiz: hasSibling || undefined,
|
|
1241
|
-
topSnrScore: topSnr,
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
const truncatedByTopK = Math.max(0, allCallees.length - topSites.length);
|
|
1245
|
-
// 5. Sort the global topSites by SNR desc (so tiered-budget pass fills in order)
|
|
1246
|
-
topSites.sort(compareBySnr);
|
|
1247
|
-
// 6. Apply tiered budget (spec §3)
|
|
1248
|
-
const { tiered, truncatedByBudget } = applyTieredBudget(topSites, budget, {
|
|
1249
|
-
forceRecommended: withSnippet,
|
|
1250
|
-
forceOptional: full,
|
|
1251
|
-
});
|
|
1252
|
-
return {
|
|
1253
|
-
symbol,
|
|
1254
|
-
methodQualifiedName: resolved.methodQualifiedName,
|
|
1255
|
-
filePath: path.relative(projectRoot, resolved.file).replace(/\\/g, '/'),
|
|
1256
|
-
startLine: resolved.methodNode.startPosition.row + 1,
|
|
1257
|
-
endLine: resolved.methodNode.endPosition.row + 1,
|
|
1258
|
-
totalFound: allCallees.length,
|
|
1259
|
-
returned: tiered.length,
|
|
1260
|
-
distinctReceivers,
|
|
1261
|
-
receivers,
|
|
1262
|
-
injectedFields: [...injectedFields.values()],
|
|
1263
|
-
omitted: {
|
|
1264
|
-
truncatedByTopK,
|
|
1265
|
-
truncatedByBudget,
|
|
1266
|
-
},
|
|
1267
|
-
callees: tiered,
|
|
1268
|
-
};
|
|
1269
|
-
}
|
|
1270
|
-
// ===========================================================================
|
|
1271
|
-
// Tiered budget (spec §3)
|
|
1272
|
-
//
|
|
1273
|
-
// Three-layer output allocation: essential → recommended → optional.
|
|
1274
|
-
// Pass 1 emits essential for every kept callee; pass 2 upgrades callees to
|
|
1275
|
-
// recommended in SNR order while budget remains; pass 3 upgrades to optional.
|
|
1276
|
-
// `forceRecommended` (the --snippet alias) and `forceOptional` (--full) override
|
|
1277
|
-
// the upgrade passes uniformly.
|
|
1278
|
-
// ===========================================================================
|
|
1279
|
-
/** Per-tier marginal char cost (spec §3.3). Ratio ~1:3:10 is locked. */
|
|
1280
|
-
const TIER_ESSENTIAL_COST = 40;
|
|
1281
|
-
const TIER_RECOMMENDED_ADDITIONAL = 120;
|
|
1282
|
-
const TIER_OPTIONAL_ADDITIONAL = 400;
|
|
1283
|
-
/**
|
|
1284
|
-
* Assign each callee a `tier` ('essential' | 'recommended' | 'optional')
|
|
1285
|
-
* according to spec §3.2.
|
|
1286
|
-
*
|
|
1287
|
-
* `sorted` MUST be pre-sorted by SNR desc (use compareBySnr).
|
|
1288
|
-
*/
|
|
1289
|
-
function applyTieredBudget(sorted, budget, opts = {}) {
|
|
1290
|
-
// Pass 1: how many callees fit at essential tier?
|
|
1291
|
-
let count = 0;
|
|
1292
|
-
let essentialBudgetUsed = 0;
|
|
1293
|
-
for (let i = 0; i < sorted.length; i++) {
|
|
1294
|
-
if (essentialBudgetUsed + TIER_ESSENTIAL_COST > budget && count > 0)
|
|
1295
|
-
break;
|
|
1296
|
-
essentialBudgetUsed += TIER_ESSENTIAL_COST;
|
|
1297
|
-
count++;
|
|
1298
|
-
}
|
|
1299
|
-
const truncatedByBudget = sorted.length - count;
|
|
1300
|
-
const tiered = sorted.slice(0, count).map((c) => ({ ...c, tier: 'essential' }));
|
|
1301
|
-
// Force flags short-circuit further tier work
|
|
1302
|
-
if (opts.forceOptional) {
|
|
1303
|
-
for (const c of tiered)
|
|
1304
|
-
c.tier = 'optional';
|
|
1305
|
-
return { tiered, truncatedByBudget };
|
|
1306
|
-
}
|
|
1307
|
-
if (opts.forceRecommended) {
|
|
1308
|
-
for (const c of tiered)
|
|
1309
|
-
c.tier = 'recommended';
|
|
1310
|
-
return { tiered, truncatedByBudget };
|
|
1311
|
-
}
|
|
1312
|
-
// Pass 2: upgrade to recommended in SNR order
|
|
1313
|
-
let remaining = budget - essentialBudgetUsed;
|
|
1314
|
-
for (const c of tiered) {
|
|
1315
|
-
if (remaining >= TIER_RECOMMENDED_ADDITIONAL) {
|
|
1316
|
-
c.tier = 'recommended';
|
|
1317
|
-
remaining -= TIER_RECOMMENDED_ADDITIONAL;
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
// Pass 3: upgrade recommended → optional in SNR order
|
|
1321
|
-
for (const c of tiered) {
|
|
1322
|
-
if (c.tier !== 'recommended')
|
|
1323
|
-
continue;
|
|
1324
|
-
if (remaining >= TIER_OPTIONAL_ADDITIONAL) {
|
|
1325
|
-
c.tier = 'optional';
|
|
1326
|
-
remaining -= TIER_OPTIONAL_ADDITIONAL;
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
return { tiered, truncatedByBudget };
|
|
1330
|
-
}
|
|
1331
|
-
/**
|
|
1332
|
-
* Format callees result as agent-friendly markdown.
|
|
1333
|
-
*
|
|
1334
|
-
* Three-tier output per spec §3.1:
|
|
1335
|
-
* essential — one line per call (always emitted)
|
|
1336
|
-
* recommended — + 1–2 line snippet + enclosing Class#method
|
|
1337
|
-
* optional — same shape as recommended in this MVP (deeper snippet
|
|
1338
|
-
* window / imports / field decls deferred — agent can
|
|
1339
|
-
* `Read file:line` if it needs that depth)
|
|
1340
|
-
*
|
|
1341
|
-
* Per-callee `tier` is set by `applyTieredBudget` (or forced via the
|
|
1342
|
-
* `withSnippet`/`full` opts on `searchCallees`). Receivers are listed in
|
|
1343
|
-
* SNR order — groups whose top callee scores higher come first, so
|
|
1344
|
-
* xBdy/sibling groups surface at the top and pure-noise groups
|
|
1345
|
-
* (CollectionUtils, Objects) sink to the bottom even when they have many
|
|
1346
|
-
* calls.
|
|
1347
|
-
*
|
|
1348
|
-
* Empty callees (spec §5): methods with 0 internal calls get a friendly
|
|
1349
|
-
* message instead of "0 across 0 receivers, returning 0" (which reads as
|
|
1350
|
-
* an error).
|
|
1351
|
-
*/
|
|
1352
|
-
function formatCalleesResult(result, options) {
|
|
1353
|
-
const lines = [];
|
|
1354
|
-
lines.push(`**Callees of \`${result.methodQualifiedName}\`** \`${result.filePath}:${result.startLine}-${result.endLine}\``);
|
|
1355
|
-
// Empty-callees UX (spec §5)
|
|
1356
|
-
if (result.totalFound === 0 || result.callees.length === 0) {
|
|
1357
|
-
const methodName = result.methodQualifiedName.split('#')[1] ?? '<method>';
|
|
1358
|
-
lines.push('');
|
|
1359
|
-
lines.push(`_Method has no internal calls — likely returns a constant, field, or a single delegate._`);
|
|
1360
|
-
lines.push(`_Try \`cgraphx calls ${methodName}\` to find callers, or \`Read ${result.filePath}:${result.startLine}\` to see the body._`);
|
|
1361
|
-
return lines.join('\n');
|
|
1362
|
-
}
|
|
1363
|
-
lines.push(`— ${result.totalFound} internal call${result.totalFound === 1 ? '' : 's'} across ${result.distinctReceivers} receiver${result.distinctReceivers === 1 ? '' : 's'}, returning ${result.returned}`);
|
|
1364
|
-
// Iterate receivers in SNR order (searchCallees already sorted them by topSnrScore).
|
|
1365
|
-
// For each receiver with `returned > 0`, print group header + its callees in SNR order.
|
|
1366
|
-
for (const recvSummary of result.receivers) {
|
|
1367
|
-
if (recvSummary.returned === 0)
|
|
1368
|
-
continue;
|
|
1369
|
-
const recvCallees = result.callees.filter((c) => c.receiverText === recvSummary.receiver);
|
|
1370
|
-
if (recvCallees.length === 0)
|
|
1371
|
-
continue;
|
|
1372
|
-
const label = recvSummary.receiver ?? '(unqualified)';
|
|
1373
|
-
const totalStr = ` (${recvSummary.total} ${recvSummary.total === 1 ? 'call' : 'calls'}${recvSummary.returned < recvSummary.total ? `, top ${recvSummary.returned}` : ''})`;
|
|
1374
|
-
const tagStr = recvSummary.crossBoundary
|
|
1375
|
-
? ` — \`${recvSummary.crossBoundary.fieldType}\` @${recvSummary.crossBoundary.annotation} **[xBdy]**`
|
|
1376
|
-
: recvSummary.sameClassBiz
|
|
1377
|
-
? ` **[sibling]**`
|
|
1378
|
-
: '';
|
|
1379
|
-
lines.push('');
|
|
1380
|
-
lines.push(`### ${label}${totalStr}${tagStr}`);
|
|
1381
|
-
for (const c of recvCallees) {
|
|
1382
|
-
// Essential line — always emitted
|
|
1383
|
-
lines.push(`- **${c.methodName}** L${c.line}`);
|
|
1384
|
-
// Recommended / optional tier — snippet + enclosing context
|
|
1385
|
-
if (c.tier === 'recommended' || c.tier === 'optional') {
|
|
1386
|
-
if (c.snippet) {
|
|
1387
|
-
const snippetLines = c.snippet.split('\n').slice(0, 2);
|
|
1388
|
-
for (const sl of snippetLines) {
|
|
1389
|
-
lines.push(` > ${sl}`);
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
if (c.containingClass && c.containingMethod) {
|
|
1393
|
-
lines.push(` _in ${c.containingClass}#${c.containingMethod}_`);
|
|
1394
|
-
}
|
|
1395
|
-
else if (c.containingMethod) {
|
|
1396
|
-
lines.push(` _in #${c.containingMethod}_`);
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
if (options?.explain) {
|
|
1400
|
-
lines.push(` _score: ${formatSnrBreakdown(c)}_`);
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
// Omitted summary
|
|
1405
|
-
const o = result.omitted;
|
|
1406
|
-
const omittedParts = [];
|
|
1407
|
-
if (o.truncatedByTopK > 0)
|
|
1408
|
-
omittedParts.push(`${o.truncatedByTopK} past topK`);
|
|
1409
|
-
if (o.truncatedByBudget > 0)
|
|
1410
|
-
omittedParts.push(`${o.truncatedByBudget} truncated by budget`);
|
|
1411
|
-
if (omittedParts.length > 0) {
|
|
1412
|
-
lines.push('');
|
|
1413
|
-
lines.push(`_Omitted: ${omittedParts.join(' · ')}_`);
|
|
1414
|
-
}
|
|
1415
|
-
// Receivers truncated by topK — surfaced so agent knows they exist
|
|
1416
|
-
const unreturnedReceivers = result.receivers.filter((r) => r.returned === 0);
|
|
1417
|
-
if (unreturnedReceivers.length > 0) {
|
|
1418
|
-
lines.push('');
|
|
1419
|
-
const summary = unreturnedReceivers
|
|
1420
|
-
.map((r) => {
|
|
1421
|
-
const tag = r.crossBoundary
|
|
1422
|
-
? ` [xBdy:${r.crossBoundary.fieldType}]`
|
|
1423
|
-
: r.sameClassBiz
|
|
1424
|
-
? ' [sibling]'
|
|
1425
|
-
: '';
|
|
1426
|
-
return `${r.receiver ?? '(unqualified)'} (${r.total})${tag}`;
|
|
1427
|
-
})
|
|
1428
|
-
.join(' · ');
|
|
1429
|
-
lines.push(`_Other receivers (topK reached): ${summary}_`);
|
|
1430
|
-
}
|
|
1431
|
-
return lines.join('\n');
|
|
1432
|
-
}
|
|
1433
|
-
//# sourceMappingURL=call-sites.js.map
|