kirograph 0.17.0 → 0.20.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.md +105 -1822
- package/dist/architecture/layers/dart.d.ts +10 -0
- package/dist/architecture/layers/dart.d.ts.map +1 -0
- package/dist/architecture/layers/dart.js +112 -0
- package/dist/architecture/layers/dart.js.map +7 -0
- package/dist/architecture/layers/elixir.d.ts +6 -0
- package/dist/architecture/layers/elixir.d.ts.map +1 -0
- package/dist/architecture/layers/index.d.ts.map +1 -1
- package/dist/architecture/layers/index.js +3 -1
- package/dist/architecture/layers/index.js.map +2 -2
- package/dist/architecture/layers/ocaml.d.ts +6 -0
- package/dist/architecture/layers/ocaml.d.ts.map +1 -0
- package/dist/architecture/layers/scala.d.ts +6 -0
- package/dist/architecture/layers/scala.d.ts.map +1 -0
- package/dist/architecture/layers/solidity.d.ts +6 -0
- package/dist/architecture/layers/solidity.d.ts.map +1 -0
- package/dist/architecture/layers/vue.d.ts +6 -0
- package/dist/architecture/layers/vue.d.ts.map +1 -0
- package/dist/architecture/manifest/elm.d.ts +3 -0
- package/dist/architecture/manifest/elm.d.ts.map +1 -0
- package/dist/architecture/manifest/index.d.ts.map +1 -1
- package/dist/architecture/manifest/ocaml.d.ts +3 -0
- package/dist/architecture/manifest/ocaml.d.ts.map +1 -0
- package/dist/architecture/manifest/scala.d.ts +3 -0
- package/dist/architecture/manifest/scala.d.ts.map +1 -0
- package/dist/bin/banner.d.ts.map +1 -1
- package/dist/bin/banner.js +74 -6
- package/dist/bin/banner.js.map +2 -2
- package/dist/bin/commands/affected.d.ts.map +1 -1
- package/dist/bin/commands/attack-surface.d.ts +3 -0
- package/dist/bin/commands/attack-surface.d.ts.map +1 -0
- package/dist/bin/commands/attack-surface.js +164 -0
- package/dist/bin/commands/attack-surface.js.map +7 -0
- package/dist/bin/commands/benchmark.d.ts +9 -0
- package/dist/bin/commands/benchmark.d.ts.map +1 -0
- package/dist/bin/commands/benchmark.js +206 -0
- package/dist/bin/commands/benchmark.js.map +7 -0
- package/dist/bin/commands/budget.d.ts +6 -0
- package/dist/bin/commands/budget.d.ts.map +1 -0
- package/dist/bin/commands/budget.js +70 -0
- package/dist/bin/commands/budget.js.map +7 -0
- package/dist/bin/commands/caveman.d.ts +7 -0
- package/dist/bin/commands/caveman.d.ts.map +1 -0
- package/dist/bin/commands/communities.d.ts +3 -0
- package/dist/bin/commands/communities.d.ts.map +1 -0
- package/dist/bin/commands/communities.js +77 -0
- package/dist/bin/commands/communities.js.map +7 -0
- package/dist/bin/commands/compression.d.ts +7 -0
- package/dist/bin/commands/compression.d.ts.map +1 -0
- package/dist/bin/commands/context.d.ts.map +1 -1
- package/dist/bin/commands/data.d.ts +3 -0
- package/dist/bin/commands/data.d.ts.map +1 -0
- package/dist/bin/commands/dead-code.d.ts +3 -0
- package/dist/bin/commands/dead-code.d.ts.map +1 -0
- package/dist/bin/commands/dep-confusion.d.ts +3 -0
- package/dist/bin/commands/dep-confusion.d.ts.map +1 -0
- package/dist/bin/commands/dep-confusion.js +119 -0
- package/dist/bin/commands/dep-confusion.js.map +7 -0
- package/dist/bin/commands/docs.d.ts +3 -0
- package/dist/bin/commands/docs.d.ts.map +1 -0
- package/dist/bin/commands/exec.d.ts +11 -0
- package/dist/bin/commands/exec.d.ts.map +1 -0
- package/dist/bin/commands/export.d.ts +3 -0
- package/dist/bin/commands/export.d.ts.map +1 -0
- package/dist/bin/commands/export.js +304 -10
- package/dist/bin/commands/export.js.map +2 -2
- package/dist/bin/commands/flows.d.ts +3 -0
- package/dist/bin/commands/flows.d.ts.map +1 -0
- package/dist/bin/commands/flows.js +97 -0
- package/dist/bin/commands/flows.js.map +7 -0
- package/dist/bin/commands/gain.d.ts +6 -0
- package/dist/bin/commands/gain.d.ts.map +1 -0
- package/dist/bin/commands/help.d.ts +7 -0
- package/dist/bin/commands/help.d.ts.map +1 -1
- package/dist/bin/commands/help.js +399 -101
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/hotspots.d.ts +3 -0
- package/dist/bin/commands/hotspots.d.ts.map +1 -0
- package/dist/bin/commands/hotspots.js +94 -1
- package/dist/bin/commands/hotspots.js.map +3 -3
- package/dist/bin/commands/install.d.ts.map +1 -1
- package/dist/bin/commands/install.js +90 -8
- package/dist/bin/commands/install.js.map +2 -2
- package/dist/bin/commands/licenses.d.ts +3 -0
- package/dist/bin/commands/licenses.d.ts.map +1 -0
- package/dist/bin/commands/licenses.js +201 -0
- package/dist/bin/commands/licenses.js.map +7 -0
- package/dist/bin/commands/memory.d.ts +16 -0
- package/dist/bin/commands/memory.d.ts.map +1 -0
- package/dist/bin/commands/memory.js +151 -4
- package/dist/bin/commands/memory.js.map +2 -2
- package/dist/bin/commands/path.d.ts +3 -0
- package/dist/bin/commands/path.d.ts.map +1 -0
- package/dist/bin/commands/pattern.d.ts +3 -0
- package/dist/bin/commands/pattern.d.ts.map +1 -0
- package/dist/bin/commands/pattern.js +592 -0
- package/dist/bin/commands/pattern.js.map +7 -0
- package/dist/bin/commands/query.d.ts.map +1 -1
- package/dist/bin/commands/reachability.d.ts +3 -0
- package/dist/bin/commands/reachability.d.ts.map +1 -0
- package/dist/bin/commands/reachability.js +160 -0
- package/dist/bin/commands/reachability.js.map +7 -0
- package/dist/bin/commands/read.d.ts +6 -0
- package/dist/bin/commands/read.d.ts.map +1 -0
- package/dist/bin/commands/read.js +100 -0
- package/dist/bin/commands/read.js.map +7 -0
- package/dist/bin/commands/refactor.d.ts +3 -0
- package/dist/bin/commands/refactor.d.ts.map +1 -0
- package/dist/bin/commands/refactor.js +116 -0
- package/dist/bin/commands/refactor.js.map +7 -0
- package/dist/bin/commands/remediation.d.ts +3 -0
- package/dist/bin/commands/remediation.d.ts.map +1 -0
- package/dist/bin/commands/remediation.js +133 -0
- package/dist/bin/commands/remediation.js.map +7 -0
- package/dist/bin/commands/sbom.d.ts +3 -0
- package/dist/bin/commands/sbom.d.ts.map +1 -0
- package/dist/bin/commands/sbom.js +76 -0
- package/dist/bin/commands/sbom.js.map +7 -0
- package/dist/bin/commands/security-ci-report.d.ts +9 -0
- package/dist/bin/commands/security-ci-report.d.ts.map +1 -0
- package/dist/bin/commands/security-ci-report.js +267 -0
- package/dist/bin/commands/security-ci-report.js.map +7 -0
- package/dist/bin/commands/security-export.d.ts +2 -0
- package/dist/bin/commands/security-export.d.ts.map +1 -0
- package/dist/bin/commands/security-export.js +1349 -0
- package/dist/bin/commands/security-export.js.map +7 -0
- package/dist/bin/commands/security-flows.d.ts +3 -0
- package/dist/bin/commands/security-flows.d.ts.map +1 -0
- package/dist/bin/commands/security-flows.js +126 -0
- package/dist/bin/commands/security-flows.js.map +7 -0
- package/dist/bin/commands/security-secrets.d.ts +3 -0
- package/dist/bin/commands/security-secrets.d.ts.map +1 -0
- package/dist/bin/commands/security-secrets.js +170 -0
- package/dist/bin/commands/security-secrets.js.map +7 -0
- package/dist/bin/commands/security.d.ts +3 -0
- package/dist/bin/commands/security.d.ts.map +1 -0
- package/dist/bin/commands/security.js +208 -0
- package/dist/bin/commands/security.js.map +7 -0
- package/dist/bin/commands/snapshot.d.ts +3 -0
- package/dist/bin/commands/snapshot.d.ts.map +1 -0
- package/dist/bin/commands/staleness.d.ts +3 -0
- package/dist/bin/commands/staleness.d.ts.map +1 -0
- package/dist/bin/commands/staleness.js +144 -0
- package/dist/bin/commands/staleness.js.map +7 -0
- package/dist/bin/commands/status.d.ts.map +1 -1
- package/dist/bin/commands/status.js +129 -2
- package/dist/bin/commands/status.js.map +2 -2
- package/dist/bin/commands/supply-chain.d.ts +3 -0
- package/dist/bin/commands/supply-chain.d.ts.map +1 -0
- package/dist/bin/commands/supply-chain.js +138 -0
- package/dist/bin/commands/supply-chain.js.map +7 -0
- package/dist/bin/commands/surprising.d.ts +3 -0
- package/dist/bin/commands/surprising.d.ts.map +1 -0
- package/dist/bin/commands/sync.d.ts.map +1 -1
- package/dist/bin/commands/uninit.d.ts.map +1 -1
- package/dist/bin/commands/uninit.js +109 -60
- package/dist/bin/commands/uninit.js.map +2 -2
- package/dist/bin/commands/utils.d.ts +5 -0
- package/dist/bin/commands/utils.d.ts.map +1 -1
- package/dist/bin/commands/vex.d.ts +3 -0
- package/dist/bin/commands/vex.d.ts.map +1 -0
- package/dist/bin/commands/vex.js +76 -0
- package/dist/bin/commands/vex.js.map +7 -0
- package/dist/bin/commands/vuln-suppress.d.ts +3 -0
- package/dist/bin/commands/vuln-suppress.d.ts.map +1 -0
- package/dist/bin/commands/vuln-suppress.js +95 -0
- package/dist/bin/commands/vuln-suppress.js.map +7 -0
- package/dist/bin/commands/vulns.d.ts +3 -0
- package/dist/bin/commands/vulns.d.ts.map +1 -0
- package/dist/bin/commands/vulns.js +382 -0
- package/dist/bin/commands/vulns.js.map +7 -0
- package/dist/bin/installer/archive.d.ts +47 -0
- package/dist/bin/installer/archive.d.ts.map +1 -0
- package/dist/bin/installer/auto-detect.d.ts +16 -0
- package/dist/bin/installer/auto-detect.d.ts.map +1 -0
- package/dist/bin/installer/auto-detect.js +125 -0
- package/dist/bin/installer/auto-detect.js.map +7 -0
- package/dist/bin/installer/caveman.d.ts +12 -0
- package/dist/bin/installer/caveman.d.ts.map +1 -0
- package/dist/bin/installer/cli-agent.d.ts +7 -2
- package/dist/bin/installer/cli-agent.d.ts.map +1 -1
- package/dist/bin/installer/cli-agent.js +32 -5
- package/dist/bin/installer/cli-agent.js.map +2 -2
- package/dist/bin/installer/common.d.ts +36 -0
- package/dist/bin/installer/common.d.ts.map +1 -0
- package/dist/bin/installer/common.js +48 -0
- package/dist/bin/installer/common.js.map +2 -2
- package/dist/bin/installer/config-prompt.d.ts +1 -1
- package/dist/bin/installer/config-prompt.d.ts.map +1 -1
- package/dist/bin/installer/config-prompt.js +85 -2
- package/dist/bin/installer/config-prompt.js.map +2 -2
- package/dist/bin/installer/dashboard.d.ts.map +1 -1
- package/dist/bin/installer/detect.d.ts +30 -0
- package/dist/bin/installer/detect.d.ts.map +1 -0
- package/dist/bin/installer/detect.js +309 -0
- package/dist/bin/installer/detect.js.map +7 -0
- package/dist/bin/installer/hooks.d.ts +4 -1
- package/dist/bin/installer/hooks.d.ts.map +1 -1
- package/dist/bin/installer/hooks.js +34 -0
- package/dist/bin/installer/hooks.js.map +2 -2
- package/dist/bin/installer/index.d.ts +5 -4
- package/dist/bin/installer/index.d.ts.map +1 -1
- package/dist/bin/installer/index.js +46 -8
- package/dist/bin/installer/index.js.map +2 -2
- package/dist/bin/installer/instructions.d.ts +14 -0
- package/dist/bin/installer/instructions.d.ts.map +1 -0
- package/dist/bin/installer/instructions.js +209 -3
- package/dist/bin/installer/instructions.js.map +2 -2
- package/dist/bin/installer/mcp.d.ts.map +1 -1
- package/dist/bin/installer/prompts.d.ts +17 -0
- package/dist/bin/installer/prompts.d.ts.map +1 -1
- package/dist/bin/installer/qdrant-dashboard.d.ts.map +1 -1
- package/dist/bin/installer/steering.d.ts +14 -2
- package/dist/bin/installer/steering.d.ts.map +1 -1
- package/dist/bin/installer/steering.js +488 -0
- package/dist/bin/installer/steering.js.map +2 -2
- package/dist/bin/installer/targets/aider.d.ts +6 -0
- package/dist/bin/installer/targets/aider.d.ts.map +1 -0
- package/dist/bin/installer/targets/aider.js +3 -3
- package/dist/bin/installer/targets/aider.js.map +2 -2
- package/dist/bin/installer/targets/amp.d.ts +6 -0
- package/dist/bin/installer/targets/amp.d.ts.map +1 -0
- package/dist/bin/installer/targets/amp.js +3 -3
- package/dist/bin/installer/targets/amp.js.map +2 -2
- package/dist/bin/installer/targets/antigravity.d.ts +13 -0
- package/dist/bin/installer/targets/antigravity.d.ts.map +1 -0
- package/dist/bin/installer/targets/antigravity.js +35 -6
- package/dist/bin/installer/targets/antigravity.js.map +2 -2
- package/dist/bin/installer/targets/augment.d.ts +6 -0
- package/dist/bin/installer/targets/augment.d.ts.map +1 -0
- package/dist/bin/installer/targets/augment.js +3 -3
- package/dist/bin/installer/targets/augment.js.map +2 -2
- package/dist/bin/installer/targets/claude.d.ts +6 -0
- package/dist/bin/installer/targets/claude.d.ts.map +1 -0
- package/dist/bin/installer/targets/claude.js +49 -5
- package/dist/bin/installer/targets/claude.js.map +2 -2
- package/dist/bin/installer/targets/cline.d.ts +13 -0
- package/dist/bin/installer/targets/cline.d.ts.map +1 -0
- package/dist/bin/installer/targets/cline.js +32 -6
- package/dist/bin/installer/targets/cline.js.map +2 -2
- package/dist/bin/installer/targets/codex.d.ts +6 -0
- package/dist/bin/installer/targets/codex.d.ts.map +1 -0
- package/dist/bin/installer/targets/codex.js +64 -12
- package/dist/bin/installer/targets/codex.js.map +2 -2
- package/dist/bin/installer/targets/continue.d.ts +12 -0
- package/dist/bin/installer/targets/continue.d.ts.map +1 -0
- package/dist/bin/installer/targets/continue.js +2 -2
- package/dist/bin/installer/targets/continue.js.map +2 -2
- package/dist/bin/installer/targets/copilot-cli.d.ts +12 -0
- package/dist/bin/installer/targets/copilot-cli.d.ts.map +1 -0
- package/dist/bin/installer/targets/copilot-cli.js +101 -0
- package/dist/bin/installer/targets/copilot-cli.js.map +7 -0
- package/dist/bin/installer/targets/copilot.d.ts +6 -0
- package/dist/bin/installer/targets/copilot.d.ts.map +1 -0
- package/dist/bin/installer/targets/copilot.js +31 -5
- package/dist/bin/installer/targets/copilot.js.map +2 -2
- package/dist/bin/installer/targets/cursor.d.ts +6 -0
- package/dist/bin/installer/targets/cursor.d.ts.map +1 -0
- package/dist/bin/installer/targets/cursor.js +4 -4
- package/dist/bin/installer/targets/cursor.js.map +2 -2
- package/dist/bin/installer/targets/devin.d.ts +13 -0
- package/dist/bin/installer/targets/devin.d.ts.map +1 -0
- package/dist/bin/installer/targets/devin.js +2 -2
- package/dist/bin/installer/targets/devin.js.map +2 -2
- package/dist/bin/installer/targets/gemini-cli.d.ts +16 -0
- package/dist/bin/installer/targets/gemini-cli.d.ts.map +1 -0
- package/dist/bin/installer/targets/gemini-cli.js +2 -2
- package/dist/bin/installer/targets/gemini-cli.js.map +2 -2
- package/dist/bin/installer/targets/generic.d.ts +59 -0
- package/dist/bin/installer/targets/generic.d.ts.map +1 -0
- package/dist/bin/installer/targets/generic.js +2 -14
- package/dist/bin/installer/targets/generic.js.map +2 -2
- package/dist/bin/installer/targets/goose.d.ts +6 -0
- package/dist/bin/installer/targets/goose.d.ts.map +1 -0
- package/dist/bin/installer/targets/goose.js +3 -3
- package/dist/bin/installer/targets/goose.js.map +2 -2
- package/dist/bin/installer/targets/index.d.ts +11 -0
- package/dist/bin/installer/targets/index.d.ts.map +1 -0
- package/dist/bin/installer/targets/index.js +250 -0
- package/dist/bin/installer/targets/index.js.map +2 -2
- package/dist/bin/installer/targets/junie.d.ts +13 -0
- package/dist/bin/installer/targets/junie.d.ts.map +1 -0
- package/dist/bin/installer/targets/junie.js +2 -2
- package/dist/bin/installer/targets/junie.js.map +2 -2
- package/dist/bin/installer/targets/kilo.d.ts +12 -0
- package/dist/bin/installer/targets/kilo.d.ts.map +1 -0
- package/dist/bin/installer/targets/kilo.js +2 -2
- package/dist/bin/installer/targets/kilo.js.map +2 -2
- package/dist/bin/installer/targets/kiro.d.ts +5 -0
- package/dist/bin/installer/targets/kiro.d.ts.map +1 -0
- package/dist/bin/installer/targets/kiro.js +4 -4
- package/dist/bin/installer/targets/kiro.js.map +2 -2
- package/dist/bin/installer/targets/opencode.d.ts +13 -0
- package/dist/bin/installer/targets/opencode.d.ts.map +1 -0
- package/dist/bin/installer/targets/opencode.js +2 -2
- package/dist/bin/installer/targets/opencode.js.map +2 -2
- package/dist/bin/installer/targets/openhands.d.ts +6 -0
- package/dist/bin/installer/targets/openhands.d.ts.map +1 -0
- package/dist/bin/installer/targets/openhands.js +3 -3
- package/dist/bin/installer/targets/openhands.js.map +2 -2
- package/dist/bin/installer/targets/qoder.d.ts +12 -0
- package/dist/bin/installer/targets/qoder.d.ts.map +1 -0
- package/dist/bin/installer/targets/qoder.js +91 -0
- package/dist/bin/installer/targets/qoder.js.map +7 -0
- package/dist/bin/installer/targets/qwen.d.ts +12 -0
- package/dist/bin/installer/targets/qwen.d.ts.map +1 -0
- package/dist/bin/installer/targets/qwen.js +96 -0
- package/dist/bin/installer/targets/qwen.js.map +7 -0
- package/dist/bin/installer/targets/replit.d.ts +6 -0
- package/dist/bin/installer/targets/replit.d.ts.map +1 -0
- package/dist/bin/installer/targets/replit.js +3 -3
- package/dist/bin/installer/targets/replit.js.map +2 -2
- package/dist/bin/installer/targets/roo.d.ts +13 -0
- package/dist/bin/installer/targets/roo.d.ts.map +1 -0
- package/dist/bin/installer/targets/roo.js +2 -2
- package/dist/bin/installer/targets/roo.js.map +2 -2
- package/dist/bin/installer/targets/tabnine.d.ts +6 -0
- package/dist/bin/installer/targets/tabnine.d.ts.map +1 -0
- package/dist/bin/installer/targets/tabnine.js +3 -3
- package/dist/bin/installer/targets/tabnine.js.map +2 -2
- package/dist/bin/installer/targets/trae.d.ts +6 -0
- package/dist/bin/installer/targets/trae.d.ts.map +1 -0
- package/dist/bin/installer/targets/trae.js +5 -5
- package/dist/bin/installer/targets/trae.js.map +2 -2
- package/dist/bin/installer/targets/warp.d.ts +12 -0
- package/dist/bin/installer/targets/warp.d.ts.map +1 -0
- package/dist/bin/installer/targets/warp.js +2 -2
- package/dist/bin/installer/targets/warp.js.map +2 -2
- package/dist/bin/installer/targets/windsurf.d.ts +13 -0
- package/dist/bin/installer/targets/windsurf.d.ts.map +1 -0
- package/dist/bin/installer/targets/windsurf.js +35 -6
- package/dist/bin/installer/targets/windsurf.js.map +2 -2
- package/dist/bin/kirograph.js +74 -6
- package/dist/bin/kirograph.js.map +3 -3
- package/dist/bin/progress.d.ts +16 -1
- package/dist/bin/progress.d.ts.map +1 -1
- package/dist/compression/filters/aws.d.ts +9 -0
- package/dist/compression/filters/aws.d.ts.map +1 -0
- package/dist/compression/filters/docker.d.ts +6 -0
- package/dist/compression/filters/docker.d.ts.map +1 -0
- package/dist/compression/filters/files.d.ts +6 -0
- package/dist/compression/filters/files.d.ts.map +1 -0
- package/dist/compression/filters/generic.d.ts +7 -0
- package/dist/compression/filters/generic.d.ts.map +1 -0
- package/dist/compression/filters/git.d.ts +6 -0
- package/dist/compression/filters/git.d.ts.map +1 -0
- package/dist/compression/filters/github.d.ts +6 -0
- package/dist/compression/filters/github.d.ts.map +1 -0
- package/dist/compression/filters/lint.d.ts +6 -0
- package/dist/compression/filters/lint.d.ts.map +1 -0
- package/dist/compression/filters/misc.d.ts +6 -0
- package/dist/compression/filters/misc.d.ts.map +1 -0
- package/dist/compression/filters/package.d.ts +6 -0
- package/dist/compression/filters/package.d.ts.map +1 -0
- package/dist/compression/filters/test.d.ts +6 -0
- package/dist/compression/filters/test.d.ts.map +1 -0
- package/dist/compression/index.d.ts +29 -0
- package/dist/compression/index.d.ts.map +1 -0
- package/dist/compression/naive-cost.d.ts +26 -0
- package/dist/compression/naive-cost.d.ts.map +1 -0
- package/dist/compression/tracker.d.ts +155 -0
- package/dist/compression/tracker.d.ts.map +1 -0
- package/dist/compression/tracker.js +80 -0
- package/dist/compression/tracker.js.map +2 -2
- package/dist/compression/types.d.ts +49 -0
- package/dist/compression/types.d.ts.map +1 -0
- package/dist/config.d.ts +90 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +144 -3
- package/dist/config.js.map +2 -2
- package/dist/core/lock-manager.d.ts +2 -0
- package/dist/core/lock-manager.d.ts.map +1 -1
- package/dist/core/pipeline.d.ts +4 -1
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +78 -2
- package/dist/core/pipeline.js.map +2 -2
- package/dist/core/snapshot.d.ts +58 -0
- package/dist/core/snapshot.d.ts.map +1 -0
- package/dist/data/filters.d.ts +23 -0
- package/dist/data/filters.d.ts.map +1 -0
- package/dist/data/indexer.d.ts +25 -0
- package/dist/data/indexer.d.ts.map +1 -0
- package/dist/data/linker.d.ts +37 -0
- package/dist/data/linker.d.ts.map +1 -0
- package/dist/data/lint.d.ts +27 -0
- package/dist/data/lint.d.ts.map +1 -0
- package/dist/data/parsers/csv.d.ts +11 -0
- package/dist/data/parsers/csv.d.ts.map +1 -0
- package/dist/data/parsers/excel.d.ts +10 -0
- package/dist/data/parsers/excel.d.ts.map +1 -0
- package/dist/data/parsers/index.d.ts +28 -0
- package/dist/data/parsers/index.d.ts.map +1 -0
- package/dist/data/parsers/json-array.d.ts +9 -0
- package/dist/data/parsers/json-array.d.ts.map +1 -0
- package/dist/data/parsers/jsonl.d.ts +9 -0
- package/dist/data/parsers/jsonl.d.ts.map +1 -0
- package/dist/data/parsers/parquet.d.ts +10 -0
- package/dist/data/parsers/parquet.d.ts.map +1 -0
- package/dist/data/profiler.d.ts +29 -0
- package/dist/data/profiler.d.ts.map +1 -0
- package/dist/data/queries.d.ts +95 -0
- package/dist/data/queries.d.ts.map +1 -0
- package/dist/data/types.d.ts +103 -0
- package/dist/data/types.d.ts.map +1 -0
- package/dist/db/database.d.ts +57 -0
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/database.js +75 -5
- package/dist/db/database.js.map +2 -2
- package/dist/db/memory-schema.sql +5 -1
- package/dist/db/patterns-schema.sql +23 -0
- package/dist/db/schema.sql +3 -1
- package/dist/db/security-schema.sql +72 -0
- package/dist/docs/formats/asciidoc.d.ts +9 -0
- package/dist/docs/formats/asciidoc.d.ts.map +1 -0
- package/dist/docs/formats/html.d.ts +10 -0
- package/dist/docs/formats/html.d.ts.map +1 -0
- package/dist/docs/formats/index.d.ts +31 -0
- package/dist/docs/formats/index.d.ts.map +1 -0
- package/dist/docs/formats/markdown.d.ts +11 -0
- package/dist/docs/formats/markdown.d.ts.map +1 -0
- package/dist/docs/formats/openapi.d.ts +17 -0
- package/dist/docs/formats/openapi.d.ts.map +1 -0
- package/dist/docs/formats/org.d.ts +9 -0
- package/dist/docs/formats/org.d.ts.map +1 -0
- package/dist/docs/formats/plaintext.d.ts +11 -0
- package/dist/docs/formats/plaintext.d.ts.map +1 -0
- package/dist/docs/formats/rdoc.d.ts +10 -0
- package/dist/docs/formats/rdoc.d.ts.map +1 -0
- package/dist/docs/formats/rst.d.ts +11 -0
- package/dist/docs/formats/rst.d.ts.map +1 -0
- package/dist/docs/indexer.d.ts +49 -0
- package/dist/docs/indexer.d.ts.map +1 -0
- package/dist/docs/linker.d.ts +30 -0
- package/dist/docs/linker.d.ts.map +1 -0
- package/dist/docs/lint.d.ts +27 -0
- package/dist/docs/lint.d.ts.map +1 -0
- package/dist/docs/queries.d.ts +78 -0
- package/dist/docs/queries.d.ts.map +1 -0
- package/dist/docs/section-id.d.ts +48 -0
- package/dist/docs/section-id.d.ts.map +1 -0
- package/dist/docs/summarizer.d.ts +13 -0
- package/dist/docs/summarizer.d.ts.map +1 -0
- package/dist/docs/types.d.ts +71 -0
- package/dist/docs/types.d.ts.map +1 -0
- package/dist/docs/vectors.d.ts +54 -0
- package/dist/docs/vectors.d.ts.map +1 -0
- package/dist/extraction/extractor.d.ts +1 -1
- package/dist/extraction/extractor.d.ts.map +1 -1
- package/dist/extraction/extractor.js +81 -0
- package/dist/extraction/extractor.js.map +2 -2
- package/dist/extraction/grammars.d.ts +6 -0
- package/dist/extraction/grammars.d.ts.map +1 -1
- package/dist/extraction/grammars.js +32 -8
- package/dist/extraction/grammars.js.map +2 -2
- package/dist/extraction/languages.d.ts.map +1 -1
- package/dist/extraction/languages.js +43 -1
- package/dist/extraction/languages.js.map +2 -2
- package/dist/extraction/notebook.d.ts +14 -0
- package/dist/extraction/notebook.d.ts.map +1 -0
- package/dist/extraction/notebook.js +300 -0
- package/dist/extraction/notebook.js.map +7 -0
- package/dist/extraction/wasm/tree-sitter-astro.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-gdscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-julia.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-perl.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-powershell.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-sql.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-verilog.wasm +0 -0
- package/dist/frameworks/amplify.d.ts +9 -0
- package/dist/frameworks/amplify.d.ts.map +1 -0
- package/dist/frameworks/angular.d.ts +9 -0
- package/dist/frameworks/angular.d.ts.map +1 -0
- package/dist/frameworks/ansible.d.ts +8 -0
- package/dist/frameworks/ansible.d.ts.map +1 -0
- package/dist/frameworks/cloudformation.d.ts +9 -0
- package/dist/frameworks/cloudformation.d.ts.map +1 -0
- package/dist/frameworks/docker.d.ts +9 -0
- package/dist/frameworks/docker.d.ts.map +1 -0
- package/dist/frameworks/elixir.d.ts +6 -0
- package/dist/frameworks/elixir.d.ts.map +1 -0
- package/dist/frameworks/flutter.d.ts +12 -0
- package/dist/frameworks/flutter.d.ts.map +1 -0
- package/dist/frameworks/flutter.js +130 -0
- package/dist/frameworks/flutter.js.map +7 -0
- package/dist/frameworks/iac.d.ts +10 -0
- package/dist/frameworks/iac.d.ts.map +1 -0
- package/dist/frameworks/index.d.ts +14 -0
- package/dist/frameworks/index.d.ts.map +1 -1
- package/dist/frameworks/index.js +7 -1
- package/dist/frameworks/index.js.map +3 -3
- package/dist/frameworks/kubernetes.d.ts +9 -0
- package/dist/frameworks/kubernetes.d.ts.map +1 -0
- package/dist/frameworks/pulumi.d.ts +9 -0
- package/dist/frameworks/pulumi.d.ts.map +1 -0
- package/dist/frameworks/scala.d.ts +6 -0
- package/dist/frameworks/scala.d.ts.map +1 -0
- package/dist/frameworks/solidity.d.ts +6 -0
- package/dist/frameworks/solidity.d.ts.map +1 -0
- package/dist/frameworks/terraform.d.ts +14 -0
- package/dist/frameworks/terraform.d.ts.map +1 -0
- package/dist/frameworks/vue.d.ts +7 -0
- package/dist/frameworks/vue.d.ts.map +1 -0
- package/dist/graph/communities.d.ts +43 -0
- package/dist/graph/communities.d.ts.map +1 -0
- package/dist/graph/communities.js +317 -0
- package/dist/graph/communities.js.map +7 -0
- package/dist/graph/flows.d.ts +55 -0
- package/dist/graph/flows.d.ts.map +1 -0
- package/dist/graph/flows.js +138 -0
- package/dist/graph/flows.js.map +7 -0
- package/dist/graph/refactor.d.ts +43 -0
- package/dist/graph/refactor.d.ts.map +1 -0
- package/dist/graph/refactor.js +155 -0
- package/dist/graph/refactor.js.map +7 -0
- package/dist/index.d.ts +36 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/mcp/cache.d.ts +69 -0
- package/dist/mcp/cache.d.ts.map +1 -0
- package/dist/mcp/cache.js +172 -0
- package/dist/mcp/cache.js.map +7 -0
- package/dist/mcp/read-modes.d.ts +31 -0
- package/dist/mcp/read-modes.d.ts.map +1 -0
- package/dist/mcp/read-modes.js +295 -0
- package/dist/mcp/read-modes.js.map +7 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +17 -3
- package/dist/mcp/server.js.map +2 -2
- package/dist/mcp/tool-names.d.ts +2 -0
- package/dist/mcp/tool-names.d.ts.map +1 -0
- package/dist/mcp/tool-names.js +24 -1
- package/dist/mcp/tool-names.js.map +2 -2
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +1560 -4
- package/dist/mcp/tools.js.map +3 -3
- package/dist/memory/compress.d.ts +19 -0
- package/dist/memory/compress.d.ts.map +1 -0
- package/dist/memory/database.d.ts +92 -0
- package/dist/memory/database.d.ts.map +1 -0
- package/dist/memory/database.js +70 -2
- package/dist/memory/database.js.map +2 -2
- package/dist/memory/index.d.ts +71 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +12 -2
- package/dist/memory/index.js.map +2 -2
- package/dist/memory/symbols.d.ts +21 -0
- package/dist/memory/symbols.d.ts.map +1 -0
- package/dist/memory/types.d.ts +78 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js.map +1 -1
- package/dist/memory/vectors.d.ts +43 -0
- package/dist/memory/vectors.d.ts.map +1 -0
- package/dist/patterns/graph.d.ts +16 -0
- package/dist/patterns/graph.d.ts.map +1 -0
- package/dist/patterns/graph.js +45 -0
- package/dist/patterns/graph.js.map +7 -0
- package/dist/patterns/index.d.ts +4 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +39 -0
- package/dist/patterns/index.js.map +7 -0
- package/dist/patterns/indexer.d.ts +15 -0
- package/dist/patterns/indexer.d.ts.map +1 -0
- package/dist/patterns/indexer.js +97 -0
- package/dist/patterns/indexer.js.map +7 -0
- package/dist/patterns/library/command-injection-go.yaml +11 -0
- package/dist/patterns/library/dangerous-eval-js.yaml +14 -0
- package/dist/patterns/library/dangerous-exec-py.yaml +13 -0
- package/dist/patterns/library/dangerous-reflection-java.yaml +8 -0
- package/dist/patterns/library/path-traversal-go.yaml +11 -0
- package/dist/patterns/library/path-traversal-py.yaml +12 -0
- package/dist/patterns/library/path-traversal-readfile-js.yaml +14 -0
- package/dist/patterns/library/prototype-pollution-js.yaml +12 -0
- package/dist/patterns/library/sql-injection-concat-js.yaml +12 -0
- package/dist/patterns/library/sql-injection-java.yaml +13 -0
- package/dist/patterns/library/sql-injection-py.yaml +12 -0
- package/dist/patterns/library/sql-injection-template-js.yaml +13 -0
- package/dist/patterns/library/weak-crypto-md5-js.yaml +13 -0
- package/dist/patterns/library/weak-crypto-py.yaml +13 -0
- package/dist/patterns/loader.d.ts +18 -0
- package/dist/patterns/loader.d.ts.map +1 -0
- package/dist/patterns/loader.js +277 -0
- package/dist/patterns/loader.js.map +7 -0
- package/dist/patterns/runner.d.ts +42 -0
- package/dist/patterns/runner.d.ts.map +1 -0
- package/dist/patterns/runner.js +277 -0
- package/dist/patterns/runner.js.map +7 -0
- package/dist/patterns/types.d.ts +27 -0
- package/dist/patterns/types.d.ts.map +1 -0
- package/dist/patterns/types.js +34 -0
- package/dist/patterns/types.js.map +7 -0
- package/dist/resolution/bridges/android-rn.d.ts +13 -0
- package/dist/resolution/bridges/android-rn.d.ts.map +1 -0
- package/dist/resolution/bridges/android-rn.js +298 -0
- package/dist/resolution/bridges/android-rn.js.map +7 -0
- package/dist/resolution/bridges/expo-modules.d.ts +10 -0
- package/dist/resolution/bridges/expo-modules.d.ts.map +1 -0
- package/dist/resolution/bridges/expo-modules.js +155 -0
- package/dist/resolution/bridges/expo-modules.js.map +7 -0
- package/dist/resolution/bridges/flutter-channel.d.ts +14 -0
- package/dist/resolution/bridges/flutter-channel.d.ts.map +1 -0
- package/dist/resolution/bridges/flutter-channel.js +385 -0
- package/dist/resolution/bridges/flutter-channel.js.map +7 -0
- package/dist/resolution/bridges/index.d.ts +40 -0
- package/dist/resolution/bridges/index.d.ts.map +1 -0
- package/dist/resolution/bridges/index.js +80 -0
- package/dist/resolution/bridges/index.js.map +7 -0
- package/dist/resolution/bridges/native-events.d.ts +10 -0
- package/dist/resolution/bridges/native-events.d.ts.map +1 -0
- package/dist/resolution/bridges/native-events.js +188 -0
- package/dist/resolution/bridges/native-events.js.map +7 -0
- package/dist/resolution/bridges/native-views.d.ts +13 -0
- package/dist/resolution/bridges/native-views.d.ts.map +1 -0
- package/dist/resolution/bridges/native-views.js +244 -0
- package/dist/resolution/bridges/native-views.js.map +7 -0
- package/dist/resolution/bridges/react-native.d.ts +9 -0
- package/dist/resolution/bridges/react-native.d.ts.map +1 -0
- package/dist/resolution/bridges/react-native.js +161 -0
- package/dist/resolution/bridges/react-native.js.map +7 -0
- package/dist/resolution/bridges/swift-objc.d.ts +14 -0
- package/dist/resolution/bridges/swift-objc.d.ts.map +1 -0
- package/dist/resolution/bridges/swift-objc.js +227 -0
- package/dist/resolution/bridges/swift-objc.js.map +7 -0
- package/dist/resolution/bridges/turbomodules.d.ts +10 -0
- package/dist/resolution/bridges/turbomodules.d.ts.map +1 -0
- package/dist/resolution/bridges/turbomodules.js +216 -0
- package/dist/resolution/bridges/turbomodules.js.map +7 -0
- package/dist/resolution/index.d.ts +28 -3
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +61 -2
- package/dist/resolution/index.js.map +2 -2
- package/dist/security/attack-surface.d.ts +46 -0
- package/dist/security/attack-surface.d.ts.map +1 -0
- package/dist/security/attack-surface.js +206 -0
- package/dist/security/attack-surface.js.map +7 -0
- package/dist/security/context-warnings.d.ts +40 -0
- package/dist/security/context-warnings.d.ts.map +1 -0
- package/dist/security/context-warnings.js +123 -0
- package/dist/security/context-warnings.js.map +7 -0
- package/dist/security/data-flows.d.ts +33 -0
- package/dist/security/data-flows.d.ts.map +1 -0
- package/dist/security/data-flows.js +286 -0
- package/dist/security/data-flows.js.map +7 -0
- package/dist/security/dep-confusion.d.ts +23 -0
- package/dist/security/dep-confusion.d.ts.map +1 -0
- package/dist/security/dep-confusion.js +255 -0
- package/dist/security/dep-confusion.js.map +7 -0
- package/dist/security/errors.d.ts +16 -0
- package/dist/security/errors.d.ts.map +1 -0
- package/dist/security/errors.js +51 -0
- package/dist/security/errors.js.map +7 -0
- package/dist/security/export/fix-suggestions.d.ts +21 -0
- package/dist/security/export/fix-suggestions.d.ts.map +1 -0
- package/dist/security/export/fix-suggestions.js +58 -0
- package/dist/security/export/fix-suggestions.js.map +7 -0
- package/dist/security/export/sbom.d.ts +33 -0
- package/dist/security/export/sbom.d.ts.map +1 -0
- package/dist/security/export/sbom.js +230 -0
- package/dist/security/export/sbom.js.map +7 -0
- package/dist/security/export/serialization.d.ts +62 -0
- package/dist/security/export/serialization.d.ts.map +1 -0
- package/dist/security/export/serialization.js +142 -0
- package/dist/security/export/serialization.js.map +7 -0
- package/dist/security/export/vex.d.ts +58 -0
- package/dist/security/export/vex.d.ts.map +1 -0
- package/dist/security/export/vex.js +220 -0
- package/dist/security/export/vex.js.map +7 -0
- package/dist/security/index.d.ts +21 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +67 -0
- package/dist/security/index.js.map +7 -0
- package/dist/security/integrator.d.ts +63 -0
- package/dist/security/integrator.d.ts.map +1 -0
- package/dist/security/integrator.js +491 -0
- package/dist/security/integrator.js.map +7 -0
- package/dist/security/license.d.ts +33 -0
- package/dist/security/license.d.ts.map +1 -0
- package/dist/security/license.js +70 -0
- package/dist/security/license.js.map +7 -0
- package/dist/security/manifest/adapter.d.ts +92 -0
- package/dist/security/manifest/adapter.d.ts.map +1 -0
- package/dist/security/manifest/adapter.js +243 -0
- package/dist/security/manifest/adapter.js.map +7 -0
- package/dist/security/manifest/parser.d.ts +73 -0
- package/dist/security/manifest/parser.d.ts.map +1 -0
- package/dist/security/manifest/parser.js +376 -0
- package/dist/security/manifest/parser.js.map +7 -0
- package/dist/security/manifest/plugins/cargo.d.ts +11 -0
- package/dist/security/manifest/plugins/cargo.d.ts.map +1 -0
- package/dist/security/manifest/plugins/cargo.js +233 -0
- package/dist/security/manifest/plugins/cargo.js.map +7 -0
- package/dist/security/manifest/plugins/composer.d.ts +11 -0
- package/dist/security/manifest/plugins/composer.d.ts.map +1 -0
- package/dist/security/manifest/plugins/composer.js +152 -0
- package/dist/security/manifest/plugins/composer.js.map +7 -0
- package/dist/security/manifest/plugins/go.d.ts +12 -0
- package/dist/security/manifest/plugins/go.d.ts.map +1 -0
- package/dist/security/manifest/plugins/go.js +146 -0
- package/dist/security/manifest/plugins/go.js.map +7 -0
- package/dist/security/manifest/plugins/gradle.d.ts +12 -0
- package/dist/security/manifest/plugins/gradle.d.ts.map +1 -0
- package/dist/security/manifest/plugins/gradle.js +159 -0
- package/dist/security/manifest/plugins/gradle.js.map +7 -0
- package/dist/security/manifest/plugins/hex.d.ts +11 -0
- package/dist/security/manifest/plugins/hex.d.ts.map +1 -0
- package/dist/security/manifest/plugins/hex.js +159 -0
- package/dist/security/manifest/plugins/hex.js.map +7 -0
- package/dist/security/manifest/plugins/maven.d.ts +11 -0
- package/dist/security/manifest/plugins/maven.d.ts.map +1 -0
- package/dist/security/manifest/plugins/maven.js +128 -0
- package/dist/security/manifest/plugins/maven.js.map +7 -0
- package/dist/security/manifest/plugins/npm.d.ts +11 -0
- package/dist/security/manifest/plugins/npm.d.ts.map +1 -0
- package/dist/security/manifest/plugins/npm.js +284 -0
- package/dist/security/manifest/plugins/npm.js.map +7 -0
- package/dist/security/manifest/plugins/nuget.d.ts +12 -0
- package/dist/security/manifest/plugins/nuget.d.ts.map +1 -0
- package/dist/security/manifest/plugins/nuget.js +186 -0
- package/dist/security/manifest/plugins/nuget.js.map +7 -0
- package/dist/security/manifest/plugins/pip.d.ts +11 -0
- package/dist/security/manifest/plugins/pip.d.ts.map +1 -0
- package/dist/security/manifest/plugins/pip.js +123 -0
- package/dist/security/manifest/plugins/pip.js.map +7 -0
- package/dist/security/manifest/plugins/pubspec.d.ts +11 -0
- package/dist/security/manifest/plugins/pubspec.d.ts.map +1 -0
- package/dist/security/manifest/plugins/pubspec.js +212 -0
- package/dist/security/manifest/plugins/pubspec.js.map +7 -0
- package/dist/security/manifest/plugins/pyproject.d.ts +3 -0
- package/dist/security/manifest/plugins/pyproject.d.ts.map +1 -0
- package/dist/security/manifest/plugins/pyproject.js +261 -0
- package/dist/security/manifest/plugins/pyproject.js.map +7 -0
- package/dist/security/manifest/plugins/rubygems.d.ts +11 -0
- package/dist/security/manifest/plugins/rubygems.d.ts.map +1 -0
- package/dist/security/manifest/plugins/rubygems.js +185 -0
- package/dist/security/manifest/plugins/rubygems.js.map +7 -0
- package/dist/security/manifest/plugins/swift.d.ts +11 -0
- package/dist/security/manifest/plugins/swift.d.ts.map +1 -0
- package/dist/security/manifest/plugins/swift.js +200 -0
- package/dist/security/manifest/plugins/swift.js.map +7 -0
- package/dist/security/owasp.d.ts +16 -0
- package/dist/security/owasp.d.ts.map +1 -0
- package/dist/security/owasp.js +104 -0
- package/dist/security/owasp.js.map +7 -0
- package/dist/security/pipeline.d.ts +37 -0
- package/dist/security/pipeline.d.ts.map +1 -0
- package/dist/security/pipeline.js +125 -0
- package/dist/security/pipeline.js.map +7 -0
- package/dist/security/reachability.d.ts +67 -0
- package/dist/security/reachability.d.ts.map +1 -0
- package/dist/security/reachability.js +276 -0
- package/dist/security/reachability.js.map +7 -0
- package/dist/security/remediation.d.ts +51 -0
- package/dist/security/remediation.d.ts.map +1 -0
- package/dist/security/remediation.js +126 -0
- package/dist/security/remediation.js.map +7 -0
- package/dist/security/secrets.d.ts +38 -0
- package/dist/security/secrets.d.ts.map +1 -0
- package/dist/security/secrets.js +176 -0
- package/dist/security/secrets.js.map +7 -0
- package/dist/security/staleness.d.ts +43 -0
- package/dist/security/staleness.d.ts.map +1 -0
- package/dist/security/staleness.js +231 -0
- package/dist/security/staleness.js.map +7 -0
- package/dist/security/supply-chain.d.ts +34 -0
- package/dist/security/supply-chain.d.ts.map +1 -0
- package/dist/security/supply-chain.js +301 -0
- package/dist/security/supply-chain.js.map +7 -0
- package/dist/security/suppressions.d.ts +18 -0
- package/dist/security/suppressions.d.ts.map +1 -0
- package/dist/security/suppressions.js +106 -0
- package/dist/security/suppressions.js.map +7 -0
- package/dist/security/types.d.ts +144 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/types.js +17 -0
- package/dist/security/types.js.map +7 -0
- package/dist/security/vuln/client.d.ts +90 -0
- package/dist/security/vuln/client.d.ts.map +1 -0
- package/dist/security/vuln/client.js +355 -0
- package/dist/security/vuln/client.js.map +7 -0
- package/dist/security/vuln/epss-client.d.ts +26 -0
- package/dist/security/vuln/epss-client.d.ts.map +1 -0
- package/dist/security/vuln/epss-client.js +95 -0
- package/dist/security/vuln/epss-client.js.map +7 -0
- package/dist/security/vuln/index.d.ts +6 -0
- package/dist/security/vuln/index.d.ts.map +1 -0
- package/dist/security/vuln/index.js +29 -0
- package/dist/security/vuln/index.js.map +7 -0
- package/dist/security/vuln/osv-adapter.d.ts +58 -0
- package/dist/security/vuln/osv-adapter.d.ts.map +1 -0
- package/dist/security/vuln/osv-adapter.js +321 -0
- package/dist/security/vuln/osv-adapter.js.map +7 -0
- package/dist/security/vuln/types.d.ts +29 -0
- package/dist/security/vuln/types.d.ts.map +1 -0
- package/dist/security/vuln/types.js +17 -0
- package/dist/security/vuln/types.js.map +7 -0
- package/dist/sync/index.d.ts +4 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/types.d.ts +10 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +2 -2
- package/dist/vectors/index.d.ts +11 -3
- package/dist/vectors/index.d.ts.map +1 -1
- package/dist/vectors/qdrant-index.d.ts +10 -3
- package/dist/vectors/qdrant-index.d.ts.map +1 -1
- package/dist/vectors/typesense-index.d.ts.map +1 -1
- package/dist/watchmen/index.js +83 -0
- package/dist/watchmen/index.js.map +7 -0
- package/dist/watchmen/synthesize.js +475 -0
- package/dist/watchmen/synthesize.js.map +7 -0
- package/package.json +6 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge Resolver Registry
|
|
3
|
+
*
|
|
4
|
+
* Manages cross-language bridge resolvers that synthesize edges between
|
|
5
|
+
* symbols in different languages (Swift ↔ ObjC, JS ↔ Native, etc.).
|
|
6
|
+
* Bridges run after standard resolution and emit heuristic-based edges.
|
|
7
|
+
*/
|
|
8
|
+
import type { EdgeKind } from '../../types';
|
|
9
|
+
import type { ResolutionContext } from '../../frameworks/types';
|
|
10
|
+
import type { GraphDatabase } from '../../db/database';
|
|
11
|
+
export interface SynthesizedEdge {
|
|
12
|
+
source: string;
|
|
13
|
+
target: string;
|
|
14
|
+
kind: EdgeKind;
|
|
15
|
+
confidence: 'inferred';
|
|
16
|
+
confidenceScore: number;
|
|
17
|
+
metadata: {
|
|
18
|
+
synthesizedBy: string;
|
|
19
|
+
provenance: 'heuristic';
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface BridgeResolver {
|
|
24
|
+
name: string;
|
|
25
|
+
/** Detect if this bridge is relevant for the project */
|
|
26
|
+
detect(context: ResolutionContext): boolean;
|
|
27
|
+
/** Synthesize cross-language edges */
|
|
28
|
+
resolve(context: ResolutionContext): SynthesizedEdge[];
|
|
29
|
+
}
|
|
30
|
+
export interface BridgeResolutionResult {
|
|
31
|
+
totalEdges: number;
|
|
32
|
+
bridgesRun: string[];
|
|
33
|
+
durationMs: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Run all applicable bridge resolvers and insert synthesized edges into the database.
|
|
37
|
+
* Bridges that are not relevant for the project are skipped via detect().
|
|
38
|
+
*/
|
|
39
|
+
export declare function runBridgeResolvers(context: ResolutionContext, db: GraphDatabase): BridgeResolutionResult;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resolution/bridges/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAc,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,WAAW,CAAC;QACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAC5C,sCAAsC;IACtC,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe,EAAE,CAAC;CACxD;AA0BD,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,EAAE,EAAE,aAAa,GAChB,sBAAsB,CAsCxB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var bridges_exports = {};
|
|
20
|
+
__export(bridges_exports, {
|
|
21
|
+
runBridgeResolvers: () => runBridgeResolvers
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(bridges_exports);
|
|
24
|
+
var import_errors = require("../../errors");
|
|
25
|
+
var import_swift_objc = require("./swift-objc");
|
|
26
|
+
var import_react_native = require("./react-native");
|
|
27
|
+
var import_turbomodules = require("./turbomodules");
|
|
28
|
+
var import_expo_modules = require("./expo-modules");
|
|
29
|
+
var import_native_events = require("./native-events");
|
|
30
|
+
var import_native_views = require("./native-views");
|
|
31
|
+
var import_android_rn = require("./android-rn");
|
|
32
|
+
var import_flutter_channel = require("./flutter-channel");
|
|
33
|
+
const ALL_BRIDGES = [
|
|
34
|
+
import_swift_objc.swiftObjcBridge,
|
|
35
|
+
import_react_native.reactNativeLegacyBridge,
|
|
36
|
+
import_turbomodules.turboModulesBridge,
|
|
37
|
+
import_expo_modules.expoModulesBridge,
|
|
38
|
+
import_native_events.nativeEventsBridge,
|
|
39
|
+
import_native_views.nativeViewsBridge,
|
|
40
|
+
import_android_rn.androidRnBridge,
|
|
41
|
+
import_flutter_channel.flutterChannelBridge
|
|
42
|
+
];
|
|
43
|
+
function runBridgeResolvers(context, db) {
|
|
44
|
+
const start = Date.now();
|
|
45
|
+
const bridgesRun = [];
|
|
46
|
+
let totalEdges = 0;
|
|
47
|
+
for (const bridge of ALL_BRIDGES) {
|
|
48
|
+
try {
|
|
49
|
+
if (!bridge.detect(context)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
(0, import_errors.logDebug)(`Bridge: running ${bridge.name}`);
|
|
53
|
+
const edges = bridge.resolve(context);
|
|
54
|
+
for (const synth of edges) {
|
|
55
|
+
const edge = {
|
|
56
|
+
source: synth.source,
|
|
57
|
+
target: synth.target,
|
|
58
|
+
kind: synth.kind,
|
|
59
|
+
confidence: synth.confidence,
|
|
60
|
+
confidenceScore: synth.confidenceScore,
|
|
61
|
+
metadata: synth.metadata
|
|
62
|
+
};
|
|
63
|
+
db.insertEdge(edge);
|
|
64
|
+
}
|
|
65
|
+
totalEdges += edges.length;
|
|
66
|
+
bridgesRun.push(bridge.name);
|
|
67
|
+
(0, import_errors.logDebug)(`Bridge: ${bridge.name} synthesized ${edges.length} edges`);
|
|
68
|
+
} catch (err) {
|
|
69
|
+
(0, import_errors.logWarn)(`Bridge: ${bridge.name} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const durationMs = Date.now() - start;
|
|
73
|
+
(0, import_errors.logDebug)(`Bridge resolution complete: ${totalEdges} edges from ${bridgesRun.length} bridges in ${durationMs}ms`);
|
|
74
|
+
return { totalEdges, bridgesRun, durationMs };
|
|
75
|
+
}
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
runBridgeResolvers
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/resolution/bridges/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Bridge Resolver Registry\n *\n * Manages cross-language bridge resolvers that synthesize edges between\n * symbols in different languages (Swift \u2194 ObjC, JS \u2194 Native, etc.).\n * Bridges run after standard resolution and emit heuristic-based edges.\n */\n\nimport type { Node, Edge, EdgeKind } from '../../types';\nimport type { ResolutionContext } from '../../frameworks/types';\nimport type { GraphDatabase } from '../../db/database';\nimport { logDebug, logWarn } from '../../errors';\n\n// \u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface SynthesizedEdge {\n source: string; // node ID\n target: string; // node ID\n kind: EdgeKind;\n confidence: 'inferred';\n confidenceScore: number;\n metadata: {\n synthesizedBy: string; // e.g. 'swift-objc-bridge'\n provenance: 'heuristic';\n [key: string]: unknown;\n };\n}\n\nexport interface BridgeResolver {\n name: string;\n /** Detect if this bridge is relevant for the project */\n detect(context: ResolutionContext): boolean;\n /** Synthesize cross-language edges */\n resolve(context: ResolutionContext): SynthesizedEdge[];\n}\n\n// \u2500\u2500 Bridge Registry \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nimport { swiftObjcBridge } from './swift-objc';\nimport { reactNativeLegacyBridge } from './react-native';\nimport { turboModulesBridge } from './turbomodules';\nimport { expoModulesBridge } from './expo-modules';\nimport { nativeEventsBridge } from './native-events';\nimport { nativeViewsBridge } from './native-views';\nimport { androidRnBridge } from './android-rn';\nimport { flutterChannelBridge } from './flutter-channel';\n\nconst ALL_BRIDGES: BridgeResolver[] = [\n swiftObjcBridge,\n reactNativeLegacyBridge,\n turboModulesBridge,\n expoModulesBridge,\n nativeEventsBridge,\n nativeViewsBridge,\n androidRnBridge,\n flutterChannelBridge,\n];\n\n// \u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface BridgeResolutionResult {\n totalEdges: number;\n bridgesRun: string[];\n durationMs: number;\n}\n\n/**\n * Run all applicable bridge resolvers and insert synthesized edges into the database.\n * Bridges that are not relevant for the project are skipped via detect().\n */\nexport function runBridgeResolvers(\n context: ResolutionContext,\n db: GraphDatabase\n): BridgeResolutionResult {\n const start = Date.now();\n const bridgesRun: string[] = [];\n let totalEdges = 0;\n\n for (const bridge of ALL_BRIDGES) {\n try {\n if (!bridge.detect(context)) {\n continue;\n }\n\n logDebug(`Bridge: running ${bridge.name}`);\n const edges = bridge.resolve(context);\n\n for (const synth of edges) {\n const edge: Edge = {\n source: synth.source,\n target: synth.target,\n kind: synth.kind,\n confidence: synth.confidence,\n confidenceScore: synth.confidenceScore,\n metadata: synth.metadata,\n };\n db.insertEdge(edge);\n }\n\n totalEdges += edges.length;\n bridgesRun.push(bridge.name);\n logDebug(`Bridge: ${bridge.name} synthesized ${edges.length} edges`);\n } catch (err) {\n logWarn(`Bridge: ${bridge.name} failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n const durationMs = Date.now() - start;\n logDebug(`Bridge resolution complete: ${totalEdges} edges from ${bridgesRun.length} bridges in ${durationMs}ms`);\n\n return { totalEdges, bridgesRun, durationMs };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,oBAAkC;AA2BlC,wBAAgC;AAChC,0BAAwC;AACxC,0BAAmC;AACnC,0BAAkC;AAClC,2BAAmC;AACnC,0BAAkC;AAClC,wBAAgC;AAChC,6BAAqC;AAErC,MAAM,cAAgC;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAcO,SAAS,mBACd,SACA,IACwB;AACxB,QAAM,QAAQ,KAAK,IAAI;AACvB,QAAM,aAAuB,CAAC;AAC9B,MAAI,aAAa;AAEjB,aAAW,UAAU,aAAa;AAChC,QAAI;AACF,UAAI,CAAC,OAAO,OAAO,OAAO,GAAG;AAC3B;AAAA,MACF;AAEA,kCAAS,mBAAmB,OAAO,IAAI,EAAE;AACzC,YAAM,QAAQ,OAAO,QAAQ,OAAO;AAEpC,iBAAW,SAAS,OAAO;AACzB,cAAM,OAAa;AAAA,UACjB,QAAQ,MAAM;AAAA,UACd,QAAQ,MAAM;AAAA,UACd,MAAM,MAAM;AAAA,UACZ,YAAY,MAAM;AAAA,UAClB,iBAAiB,MAAM;AAAA,UACvB,UAAU,MAAM;AAAA,QAClB;AACA,WAAG,WAAW,IAAI;AAAA,MACpB;AAEA,oBAAc,MAAM;AACpB,iBAAW,KAAK,OAAO,IAAI;AAC3B,kCAAS,WAAW,OAAO,IAAI,gBAAgB,MAAM,MAAM,QAAQ;AAAA,IACrE,SAAS,KAAK;AACZ,iCAAQ,WAAW,OAAO,IAAI,YAAY,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE;AAAA,IAC9F;AAAA,EACF;AAEA,QAAM,aAAa,KAAK,IAAI,IAAI;AAChC,8BAAS,+BAA+B,UAAU,eAAe,WAAW,MAAM,eAAe,UAAU,IAAI;AAE/G,SAAO,EAAE,YAAY,YAAY,WAAW;AAC9C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native → JS Events Bridge
|
|
3
|
+
*
|
|
4
|
+
* Synthesizes edges between native event emitters (sendEventWithName: in ObjC,
|
|
5
|
+
* .emit() in Java/Kotlin) and JavaScript event listeners (NativeEventEmitter.addListener).
|
|
6
|
+
* Matches by literal event name string.
|
|
7
|
+
*/
|
|
8
|
+
import type { BridgeResolver } from './index';
|
|
9
|
+
export declare const nativeEventsBridge: BridgeResolver;
|
|
10
|
+
//# sourceMappingURL=native-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-events.d.ts","sourceRoot":"","sources":["../../../src/resolution/bridges/native-events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAC;AAqM/D,eAAO,MAAM,kBAAkB,EAAE,cAsDhC,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var native_events_exports = {};
|
|
20
|
+
__export(native_events_exports, {
|
|
21
|
+
nativeEventsBridge: () => nativeEventsBridge
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(native_events_exports);
|
|
24
|
+
function findEventListeners(context) {
|
|
25
|
+
const listeners = [];
|
|
26
|
+
const files = context.getAllFiles();
|
|
27
|
+
for (const f of files) {
|
|
28
|
+
if (!f.endsWith(".ts") && !f.endsWith(".tsx") && !f.endsWith(".js") && !f.endsWith(".jsx")) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const content = context.readFile(f);
|
|
32
|
+
if (!content) continue;
|
|
33
|
+
const nodes = context.getNodesInFile(f);
|
|
34
|
+
const addListenerRegex = /\.addListener\s*\(\s*['"]([^'"]+)['"]/g;
|
|
35
|
+
let match;
|
|
36
|
+
while ((match = addListenerRegex.exec(content)) !== null) {
|
|
37
|
+
const eventName = match[1];
|
|
38
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
39
|
+
const enclosing = nodes.find(
|
|
40
|
+
(n) => (n.kind === "function" || n.kind === "method") && n.startLine <= lineNum && n.endLine >= lineNum
|
|
41
|
+
);
|
|
42
|
+
if (enclosing) {
|
|
43
|
+
listeners.push({ eventName, listenerNodeId: enclosing.id, filePath: f });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const deviceEmitterRegex = /DeviceEventEmitter\.addListener\s*\(\s*['"]([^'"]+)['"]/g;
|
|
47
|
+
while ((match = deviceEmitterRegex.exec(content)) !== null) {
|
|
48
|
+
const eventName = match[1];
|
|
49
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
50
|
+
const enclosing = nodes.find(
|
|
51
|
+
(n) => (n.kind === "function" || n.kind === "method") && n.startLine <= lineNum && n.endLine >= lineNum
|
|
52
|
+
);
|
|
53
|
+
if (enclosing) {
|
|
54
|
+
listeners.push({ eventName, listenerNodeId: enclosing.id, filePath: f });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const subscriptionRegex = /(?:on|subscribe|addEventListener)\s*\(\s*['"]([^'"]+)['"]/g;
|
|
58
|
+
while ((match = subscriptionRegex.exec(content)) !== null) {
|
|
59
|
+
const eventName = match[1];
|
|
60
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
61
|
+
const enclosing = nodes.find(
|
|
62
|
+
(n) => (n.kind === "function" || n.kind === "method") && n.startLine <= lineNum && n.endLine >= lineNum
|
|
63
|
+
);
|
|
64
|
+
if (enclosing) {
|
|
65
|
+
listeners.push({ eventName, listenerNodeId: enclosing.id, filePath: f });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return listeners;
|
|
70
|
+
}
|
|
71
|
+
function findEventEmitters(context) {
|
|
72
|
+
const emitters = [];
|
|
73
|
+
const files = context.getAllFiles();
|
|
74
|
+
for (const f of files) {
|
|
75
|
+
if (f.endsWith(".m") || f.endsWith(".mm")) {
|
|
76
|
+
const content = context.readFile(f);
|
|
77
|
+
if (!content) continue;
|
|
78
|
+
const nodes = context.getNodesInFile(f);
|
|
79
|
+
const sendEventRegex = /sendEventWithName\s*:\s*@"([^"]+)"/g;
|
|
80
|
+
let match;
|
|
81
|
+
while ((match = sendEventRegex.exec(content)) !== null) {
|
|
82
|
+
const eventName = match[1];
|
|
83
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
84
|
+
const enclosing = nodes.find(
|
|
85
|
+
(n) => (n.kind === "method" || n.kind === "function") && n.startLine <= lineNum && n.endLine >= lineNum
|
|
86
|
+
);
|
|
87
|
+
if (enclosing) {
|
|
88
|
+
emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: "objc" });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (f.endsWith(".swift")) {
|
|
93
|
+
const content = context.readFile(f);
|
|
94
|
+
if (!content) continue;
|
|
95
|
+
const nodes = context.getNodesInFile(f);
|
|
96
|
+
const sendEventRegex = /sendEvent\s*\(\s*withName\s*:\s*"([^"]+)"/g;
|
|
97
|
+
let match;
|
|
98
|
+
while ((match = sendEventRegex.exec(content)) !== null) {
|
|
99
|
+
const eventName = match[1];
|
|
100
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
101
|
+
const enclosing = nodes.find(
|
|
102
|
+
(n) => (n.kind === "method" || n.kind === "function") && n.startLine <= lineNum && n.endLine >= lineNum
|
|
103
|
+
);
|
|
104
|
+
if (enclosing) {
|
|
105
|
+
emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: "swift" });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const expoSendRegex = /sendEvent\s*\(\s*"([^"]+)"/g;
|
|
109
|
+
while ((match = expoSendRegex.exec(content)) !== null) {
|
|
110
|
+
const eventName = match[1];
|
|
111
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
112
|
+
const enclosing = nodes.find(
|
|
113
|
+
(n) => (n.kind === "method" || n.kind === "function") && n.startLine <= lineNum && n.endLine >= lineNum
|
|
114
|
+
);
|
|
115
|
+
if (enclosing) {
|
|
116
|
+
emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: "swift" });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (f.endsWith(".java") || f.endsWith(".kt")) {
|
|
121
|
+
const content = context.readFile(f);
|
|
122
|
+
if (!content) continue;
|
|
123
|
+
const nodes = context.getNodesInFile(f);
|
|
124
|
+
const emitRegex = /(?:\.emit|sendEvent)\s*\(\s*"([^"]+)"/g;
|
|
125
|
+
let match;
|
|
126
|
+
while ((match = emitRegex.exec(content)) !== null) {
|
|
127
|
+
const eventName = match[1];
|
|
128
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
129
|
+
const enclosing = nodes.find(
|
|
130
|
+
(n) => (n.kind === "method" || n.kind === "function") && n.startLine <= lineNum && n.endLine >= lineNum
|
|
131
|
+
);
|
|
132
|
+
if (enclosing) {
|
|
133
|
+
const lang = f.endsWith(".kt") ? "kotlin" : "java";
|
|
134
|
+
emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: lang });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return emitters;
|
|
140
|
+
}
|
|
141
|
+
const nativeEventsBridge = {
|
|
142
|
+
name: "native-events-bridge",
|
|
143
|
+
detect(context) {
|
|
144
|
+
const files = context.getAllFiles();
|
|
145
|
+
for (const f of files) {
|
|
146
|
+
if (!f.endsWith(".ts") && !f.endsWith(".tsx") && !f.endsWith(".js") && !f.endsWith(".jsx")) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const content = context.readFile(f);
|
|
150
|
+
if (!content) continue;
|
|
151
|
+
if (content.includes("NativeEventEmitter") || content.includes("DeviceEventEmitter")) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
},
|
|
157
|
+
resolve(context) {
|
|
158
|
+
const edges = [];
|
|
159
|
+
const listeners = findEventListeners(context);
|
|
160
|
+
const emitters = findEventEmitters(context);
|
|
161
|
+
for (const emitter of emitters) {
|
|
162
|
+
for (const listener of listeners) {
|
|
163
|
+
if (emitter.eventName === listener.eventName) {
|
|
164
|
+
edges.push({
|
|
165
|
+
source: emitter.emitterNodeId,
|
|
166
|
+
target: listener.listenerNodeId,
|
|
167
|
+
kind: "calls",
|
|
168
|
+
confidence: "inferred",
|
|
169
|
+
confidenceScore: 0.85,
|
|
170
|
+
metadata: {
|
|
171
|
+
synthesizedBy: "native-events-bridge",
|
|
172
|
+
provenance: "heuristic",
|
|
173
|
+
eventName: emitter.eventName,
|
|
174
|
+
direction: "native-to-js",
|
|
175
|
+
nativeLanguage: emitter.language
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return edges;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
185
|
+
0 && (module.exports = {
|
|
186
|
+
nativeEventsBridge
|
|
187
|
+
});
|
|
188
|
+
//# sourceMappingURL=native-events.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/resolution/bridges/native-events.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Native \u2192 JS Events Bridge\n *\n * Synthesizes edges between native event emitters (sendEventWithName: in ObjC,\n * .emit() in Java/Kotlin) and JavaScript event listeners (NativeEventEmitter.addListener).\n * Matches by literal event name string.\n */\n\nimport type { Node } from '../../types';\nimport type { ResolutionContext } from '../../frameworks/types';\nimport type { BridgeResolver, SynthesizedEdge } from './index';\n\n// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ninterface EventListener {\n eventName: string;\n listenerNodeId: string;\n filePath: string;\n}\n\ninterface EventEmitter {\n eventName: string;\n emitterNodeId: string;\n filePath: string;\n language: 'objc' | 'java' | 'kotlin' | 'swift';\n}\n\n/**\n * Find JS/TS event listeners using NativeEventEmitter.addListener pattern.\n */\nfunction findEventListeners(context: ResolutionContext): EventListener[] {\n const listeners: EventListener[] = [];\n const files = context.getAllFiles();\n\n for (const f of files) {\n if (!f.endsWith('.ts') && !f.endsWith('.tsx') && !f.endsWith('.js') && !f.endsWith('.jsx')) {\n continue;\n }\n\n const content = context.readFile(f);\n if (!content) continue;\n\n const nodes = context.getNodesInFile(f);\n\n // Pattern 1: emitter.addListener('eventName', callback)\n const addListenerRegex = /\\.addListener\\s*\\(\\s*['\"]([^'\"]+)['\"]/g;\n let match: RegExpExecArray | null;\n\n while ((match = addListenerRegex.exec(content)) !== null) {\n const eventName = match[1];\n const lineNum = content.slice(0, match.index).split('\\n').length;\n\n const enclosing = nodes.find(\n n => (n.kind === 'function' || n.kind === 'method') &&\n n.startLine <= lineNum && n.endLine >= lineNum\n );\n\n if (enclosing) {\n listeners.push({ eventName, listenerNodeId: enclosing.id, filePath: f });\n }\n }\n\n // Pattern 2: DeviceEventEmitter.addListener('eventName', ...)\n const deviceEmitterRegex = /DeviceEventEmitter\\.addListener\\s*\\(\\s*['\"]([^'\"]+)['\"]/g;\n while ((match = deviceEmitterRegex.exec(content)) !== null) {\n const eventName = match[1];\n const lineNum = content.slice(0, match.index).split('\\n').length;\n\n const enclosing = nodes.find(\n n => (n.kind === 'function' || n.kind === 'method') &&\n n.startLine <= lineNum && n.endLine >= lineNum\n );\n\n if (enclosing) {\n listeners.push({ eventName, listenerNodeId: enclosing.id, filePath: f });\n }\n }\n\n // Pattern 3: useEffect with subscription pattern\n const subscriptionRegex = /(?:on|subscribe|addEventListener)\\s*\\(\\s*['\"]([^'\"]+)['\"]/g;\n while ((match = subscriptionRegex.exec(content)) !== null) {\n const eventName = match[1];\n const lineNum = content.slice(0, match.index).split('\\n').length;\n\n const enclosing = nodes.find(\n n => (n.kind === 'function' || n.kind === 'method') &&\n n.startLine <= lineNum && n.endLine >= lineNum\n );\n\n if (enclosing) {\n listeners.push({ eventName, listenerNodeId: enclosing.id, filePath: f });\n }\n }\n }\n\n return listeners;\n}\n\n/**\n * Find native event emitters in ObjC/Swift/Java/Kotlin files.\n */\nfunction findEventEmitters(context: ResolutionContext): EventEmitter[] {\n const emitters: EventEmitter[] = [];\n const files = context.getAllFiles();\n\n for (const f of files) {\n // ObjC files\n if (f.endsWith('.m') || f.endsWith('.mm')) {\n const content = context.readFile(f);\n if (!content) continue;\n\n const nodes = context.getNodesInFile(f);\n\n // Pattern: sendEventWithName:@\"eventName\"\n const sendEventRegex = /sendEventWithName\\s*:\\s*@\"([^\"]+)\"/g;\n let match: RegExpExecArray | null;\n\n while ((match = sendEventRegex.exec(content)) !== null) {\n const eventName = match[1];\n const lineNum = content.slice(0, match.index).split('\\n').length;\n\n const enclosing = nodes.find(\n n => (n.kind === 'method' || n.kind === 'function') &&\n n.startLine <= lineNum && n.endLine >= lineNum\n );\n\n if (enclosing) {\n emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: 'objc' });\n }\n }\n }\n\n // Swift files\n if (f.endsWith('.swift')) {\n const content = context.readFile(f);\n if (!content) continue;\n\n const nodes = context.getNodesInFile(f);\n\n // Pattern: sendEvent(withName: \"eventName\", ...)\n const sendEventRegex = /sendEvent\\s*\\(\\s*withName\\s*:\\s*\"([^\"]+)\"/g;\n let match: RegExpExecArray | null;\n\n while ((match = sendEventRegex.exec(content)) !== null) {\n const eventName = match[1];\n const lineNum = content.slice(0, match.index).split('\\n').length;\n\n const enclosing = nodes.find(\n n => (n.kind === 'method' || n.kind === 'function') &&\n n.startLine <= lineNum && n.endLine >= lineNum\n );\n\n if (enclosing) {\n emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: 'swift' });\n }\n }\n\n // Expo pattern: sendEvent(\"eventName\", ...)\n const expoSendRegex = /sendEvent\\s*\\(\\s*\"([^\"]+)\"/g;\n while ((match = expoSendRegex.exec(content)) !== null) {\n const eventName = match[1];\n const lineNum = content.slice(0, match.index).split('\\n').length;\n\n const enclosing = nodes.find(\n n => (n.kind === 'method' || n.kind === 'function') &&\n n.startLine <= lineNum && n.endLine >= lineNum\n );\n\n if (enclosing) {\n emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: 'swift' });\n }\n }\n }\n\n // Java/Kotlin files\n if (f.endsWith('.java') || f.endsWith('.kt')) {\n const content = context.readFile(f);\n if (!content) continue;\n\n const nodes = context.getNodesInFile(f);\n\n // Pattern: .emit(\"eventName\", ...) or sendEvent(\"eventName\", ...)\n const emitRegex = /(?:\\.emit|sendEvent)\\s*\\(\\s*\"([^\"]+)\"/g;\n let match: RegExpExecArray | null;\n\n while ((match = emitRegex.exec(content)) !== null) {\n const eventName = match[1];\n const lineNum = content.slice(0, match.index).split('\\n').length;\n\n const enclosing = nodes.find(\n n => (n.kind === 'method' || n.kind === 'function') &&\n n.startLine <= lineNum && n.endLine >= lineNum\n );\n\n if (enclosing) {\n const lang = f.endsWith('.kt') ? 'kotlin' as const : 'java' as const;\n emitters.push({ eventName, emitterNodeId: enclosing.id, filePath: f, language: lang });\n }\n }\n }\n }\n\n return emitters;\n}\n\n// \u2500\u2500 Bridge Implementation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const nativeEventsBridge: BridgeResolver = {\n name: 'native-events-bridge',\n\n detect(context: ResolutionContext): boolean {\n const files = context.getAllFiles();\n\n for (const f of files) {\n if (!f.endsWith('.ts') && !f.endsWith('.tsx') && !f.endsWith('.js') && !f.endsWith('.jsx')) {\n continue;\n }\n\n const content = context.readFile(f);\n if (!content) continue;\n\n // Check for NativeEventEmitter or DeviceEventEmitter usage\n if (content.includes('NativeEventEmitter') || content.includes('DeviceEventEmitter')) {\n return true;\n }\n }\n\n return false;\n },\n\n resolve(context: ResolutionContext): SynthesizedEdge[] {\n const edges: SynthesizedEdge[] = [];\n\n const listeners = findEventListeners(context);\n const emitters = findEventEmitters(context);\n\n // Match emitters to listeners by event name\n // Direction: native emitter \u2192 JS listener (native calls into JS)\n for (const emitter of emitters) {\n for (const listener of listeners) {\n if (emitter.eventName === listener.eventName) {\n edges.push({\n source: emitter.emitterNodeId,\n target: listener.listenerNodeId,\n kind: 'calls',\n confidence: 'inferred',\n confidenceScore: 0.85,\n metadata: {\n synthesizedBy: 'native-events-bridge',\n provenance: 'heuristic',\n eventName: emitter.eventName,\n direction: 'native-to-js',\n nativeLanguage: emitter.language,\n },\n });\n }\n }\n }\n\n return edges;\n },\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fabric/Paper Native Views Bridge
|
|
3
|
+
*
|
|
4
|
+
* Synthesizes edges between JSX usage of native components (<MyView />)
|
|
5
|
+
* and their native view manager implementations. Uses convention-based
|
|
6
|
+
* name + suffix lookup to match components to their native counterparts.
|
|
7
|
+
*
|
|
8
|
+
* Conventions:
|
|
9
|
+
* <MyView /> → MyViewManager, MyViewComponentView, RCTMyViewManager
|
|
10
|
+
*/
|
|
11
|
+
import type { BridgeResolver } from './index';
|
|
12
|
+
export declare const nativeViewsBridge: BridgeResolver;
|
|
13
|
+
//# sourceMappingURL=native-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-views.d.ts","sourceRoot":"","sources":["../../../src/resolution/bridges/native-views.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAC;AAuP/D,eAAO,MAAM,iBAAiB,EAAE,cA+E/B,CAAC"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var native_views_exports = {};
|
|
20
|
+
__export(native_views_exports, {
|
|
21
|
+
nativeViewsBridge: () => nativeViewsBridge
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(native_views_exports);
|
|
24
|
+
const VIEW_MANAGER_SUFFIXES = [
|
|
25
|
+
"Manager",
|
|
26
|
+
"ViewManager",
|
|
27
|
+
"ComponentView",
|
|
28
|
+
"NativeComponent"
|
|
29
|
+
];
|
|
30
|
+
const VIEW_MANAGER_PREFIXES = ["RCT", ""];
|
|
31
|
+
function findNativeViewUsages(context) {
|
|
32
|
+
const usages = [];
|
|
33
|
+
const files = context.getAllFiles();
|
|
34
|
+
for (const f of files) {
|
|
35
|
+
if (!f.endsWith(".tsx") && !f.endsWith(".jsx")) continue;
|
|
36
|
+
const content = context.readFile(f);
|
|
37
|
+
if (!content) continue;
|
|
38
|
+
const nodes = context.getNodesInFile(f);
|
|
39
|
+
const requireNativeRegex = /requireNativeComponent\s*(?:<[^>]*>)?\s*\(\s*['"](\w+)['"]\s*\)/g;
|
|
40
|
+
let match;
|
|
41
|
+
while ((match = requireNativeRegex.exec(content)) !== null) {
|
|
42
|
+
const componentName = match[1];
|
|
43
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
44
|
+
const enclosing = nodes.find(
|
|
45
|
+
(n) => n.startLine <= lineNum && n.endLine >= lineNum
|
|
46
|
+
);
|
|
47
|
+
if (enclosing) {
|
|
48
|
+
usages.push({ componentName, usageNodeId: enclosing.id, filePath: f });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const codegenRegex = /codegenNativeComponent\s*(?:<[^>]*>)?\s*\(\s*['"](\w+)['"]\s*\)/g;
|
|
52
|
+
while ((match = codegenRegex.exec(content)) !== null) {
|
|
53
|
+
const componentName = match[1];
|
|
54
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
55
|
+
const enclosing = nodes.find(
|
|
56
|
+
(n) => n.startLine <= lineNum && n.endLine >= lineNum
|
|
57
|
+
);
|
|
58
|
+
if (enclosing) {
|
|
59
|
+
usages.push({ componentName, usageNodeId: enclosing.id, filePath: f });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const uiManagerRegex = /UIManager\.getViewManagerConfig\s*\(\s*['"](\w+)['"]\s*\)/g;
|
|
63
|
+
while ((match = uiManagerRegex.exec(content)) !== null) {
|
|
64
|
+
const componentName = match[1];
|
|
65
|
+
const lineNum = content.slice(0, match.index).split("\n").length;
|
|
66
|
+
const enclosing = nodes.find(
|
|
67
|
+
(n) => n.startLine <= lineNum && n.endLine >= lineNum
|
|
68
|
+
);
|
|
69
|
+
if (enclosing) {
|
|
70
|
+
usages.push({ componentName, usageNodeId: enclosing.id, filePath: f });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return usages;
|
|
75
|
+
}
|
|
76
|
+
function findNativeViewManagers(context) {
|
|
77
|
+
const managers = [];
|
|
78
|
+
const files = context.getAllFiles();
|
|
79
|
+
for (const f of files) {
|
|
80
|
+
if (!f.endsWith(".m") && !f.endsWith(".mm") && !f.endsWith(".swift") && !f.endsWith(".java") && !f.endsWith(".kt") && !f.endsWith(".h")) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const content = context.readFile(f);
|
|
84
|
+
if (!content) continue;
|
|
85
|
+
const nodes = context.getNodesInFile(f);
|
|
86
|
+
if (f.endsWith(".m") || f.endsWith(".mm") || f.endsWith(".h")) {
|
|
87
|
+
const implRegex = /@(?:implementation|interface)\s+(\w+(?:Manager|ViewManager|ComponentView))\b/g;
|
|
88
|
+
let match;
|
|
89
|
+
while ((match = implRegex.exec(content)) !== null) {
|
|
90
|
+
const className = match[1];
|
|
91
|
+
const componentName = extractComponentName(className);
|
|
92
|
+
const classNode = nodes.find(
|
|
93
|
+
(n) => n.kind === "class" && n.name === className
|
|
94
|
+
);
|
|
95
|
+
if (classNode && componentName) {
|
|
96
|
+
managers.push({ componentName, nodeId: classNode.id, filePath: f, className });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (content.includes("RCT_EXPORT_VIEW_PROPERTY") || content.includes("RCTViewManager")) {
|
|
100
|
+
const classImpl = content.match(/@implementation\s+(\w+)/);
|
|
101
|
+
if (classImpl) {
|
|
102
|
+
const className = classImpl[1];
|
|
103
|
+
const componentName = extractComponentName(className);
|
|
104
|
+
const classNode = nodes.find((n) => n.kind === "class" && n.name === className);
|
|
105
|
+
if (classNode && componentName) {
|
|
106
|
+
const exists = managers.some((m) => m.nodeId === classNode.id);
|
|
107
|
+
if (!exists) {
|
|
108
|
+
managers.push({ componentName, nodeId: classNode.id, filePath: f, className });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (f.endsWith(".swift")) {
|
|
115
|
+
const classRegex = /class\s+(\w+(?:Manager|ViewManager|ComponentView))\s*:\s*(\w+)/g;
|
|
116
|
+
let match;
|
|
117
|
+
while ((match = classRegex.exec(content)) !== null) {
|
|
118
|
+
const className = match[1];
|
|
119
|
+
const componentName = extractComponentName(className);
|
|
120
|
+
const classNode = nodes.find(
|
|
121
|
+
(n) => n.kind === "class" && n.name === className
|
|
122
|
+
);
|
|
123
|
+
if (classNode && componentName) {
|
|
124
|
+
managers.push({ componentName, nodeId: classNode.id, filePath: f, className });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (f.endsWith(".java") || f.endsWith(".kt")) {
|
|
129
|
+
const classRegex = /class\s+(\w+(?:Manager|ViewManager))\s+(?:extends|:)\s+\w*(?:ViewManager|SimpleViewManager|ViewGroupManager)/g;
|
|
130
|
+
let match;
|
|
131
|
+
while ((match = classRegex.exec(content)) !== null) {
|
|
132
|
+
const className = match[1];
|
|
133
|
+
const componentName = extractComponentName(className);
|
|
134
|
+
const classNode = nodes.find(
|
|
135
|
+
(n) => n.kind === "class" && n.name === className
|
|
136
|
+
);
|
|
137
|
+
if (classNode && componentName) {
|
|
138
|
+
managers.push({ componentName, nodeId: classNode.id, filePath: f, className });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const getNameMatch = content.match(/getName\s*\(\s*\)\s*(?::\s*String\s*)?\{[^}]*return\s*"(\w+)"/);
|
|
142
|
+
if (getNameMatch) {
|
|
143
|
+
const registeredName = getNameMatch[1];
|
|
144
|
+
const classMatch = content.match(/class\s+(\w+)/);
|
|
145
|
+
if (classMatch) {
|
|
146
|
+
const classNode = nodes.find((n) => n.kind === "class" && n.name === classMatch[1]);
|
|
147
|
+
if (classNode) {
|
|
148
|
+
const exists = managers.some((m) => m.nodeId === classNode.id);
|
|
149
|
+
if (!exists) {
|
|
150
|
+
managers.push({
|
|
151
|
+
componentName: registeredName,
|
|
152
|
+
nodeId: classNode.id,
|
|
153
|
+
filePath: f,
|
|
154
|
+
className: classMatch[1]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return managers;
|
|
163
|
+
}
|
|
164
|
+
function extractComponentName(className) {
|
|
165
|
+
let name = className;
|
|
166
|
+
for (const prefix of VIEW_MANAGER_PREFIXES) {
|
|
167
|
+
if (prefix && name.startsWith(prefix)) {
|
|
168
|
+
name = name.slice(prefix.length);
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
for (const suffix of VIEW_MANAGER_SUFFIXES) {
|
|
173
|
+
if (name.endsWith(suffix)) {
|
|
174
|
+
name = name.slice(0, -suffix.length);
|
|
175
|
+
if (name.length > 0) return name;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return name.length > 0 ? name : null;
|
|
179
|
+
}
|
|
180
|
+
const nativeViewsBridge = {
|
|
181
|
+
name: "native-views-bridge",
|
|
182
|
+
detect(context) {
|
|
183
|
+
const files = context.getAllFiles();
|
|
184
|
+
for (const f of files) {
|
|
185
|
+
const fileName = f.split("/").pop() ?? "";
|
|
186
|
+
if (fileName.includes("ViewManager") || fileName.includes("ComponentView")) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (f.endsWith(".tsx") || f.endsWith(".jsx") || f.endsWith(".ts") || f.endsWith(".js")) {
|
|
190
|
+
const content = context.readFile(f);
|
|
191
|
+
if (content && (content.includes("requireNativeComponent") || content.includes("codegenNativeComponent"))) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return false;
|
|
197
|
+
},
|
|
198
|
+
resolve(context) {
|
|
199
|
+
const edges = [];
|
|
200
|
+
const usages = findNativeViewUsages(context);
|
|
201
|
+
const managers = findNativeViewManagers(context);
|
|
202
|
+
for (const usage of usages) {
|
|
203
|
+
for (const manager of managers) {
|
|
204
|
+
if (usage.componentName === manager.componentName) {
|
|
205
|
+
edges.push({
|
|
206
|
+
source: usage.usageNodeId,
|
|
207
|
+
target: manager.nodeId,
|
|
208
|
+
kind: "references",
|
|
209
|
+
confidence: "inferred",
|
|
210
|
+
confidenceScore: 0.85,
|
|
211
|
+
metadata: {
|
|
212
|
+
synthesizedBy: "native-views-bridge",
|
|
213
|
+
provenance: "heuristic",
|
|
214
|
+
componentName: usage.componentName,
|
|
215
|
+
nativeClass: manager.className
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
if (usage.componentName.toLowerCase() === manager.componentName.toLowerCase() && usage.componentName !== manager.componentName) {
|
|
220
|
+
edges.push({
|
|
221
|
+
source: usage.usageNodeId,
|
|
222
|
+
target: manager.nodeId,
|
|
223
|
+
kind: "references",
|
|
224
|
+
confidence: "inferred",
|
|
225
|
+
confidenceScore: 0.75,
|
|
226
|
+
metadata: {
|
|
227
|
+
synthesizedBy: "native-views-bridge",
|
|
228
|
+
provenance: "heuristic",
|
|
229
|
+
componentName: usage.componentName,
|
|
230
|
+
nativeClass: manager.className,
|
|
231
|
+
matchType: "case-insensitive"
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return edges;
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
241
|
+
0 && (module.exports = {
|
|
242
|
+
nativeViewsBridge
|
|
243
|
+
});
|
|
244
|
+
//# sourceMappingURL=native-views.js.map
|