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,70 @@
|
|
|
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 license_exports = {};
|
|
20
|
+
__export(license_exports, {
|
|
21
|
+
checkLicensePolicy: () => checkLicensePolicy
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(license_exports);
|
|
24
|
+
function matchesPattern(license, pattern) {
|
|
25
|
+
const lowerLicense = license.toLowerCase();
|
|
26
|
+
const lowerPattern = pattern.toLowerCase();
|
|
27
|
+
if (!lowerPattern.includes("*")) {
|
|
28
|
+
return lowerLicense === lowerPattern;
|
|
29
|
+
}
|
|
30
|
+
const regexStr = lowerPattern.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
|
31
|
+
const regex = new RegExp(`^${regexStr}$`);
|
|
32
|
+
return regex.test(lowerLicense);
|
|
33
|
+
}
|
|
34
|
+
function matchesAny(license, patterns) {
|
|
35
|
+
return patterns.some((p) => matchesPattern(license, p));
|
|
36
|
+
}
|
|
37
|
+
function checkLicensePolicy(deps, policy) {
|
|
38
|
+
const violations = [];
|
|
39
|
+
for (const dep of deps) {
|
|
40
|
+
if (!dep.license) continue;
|
|
41
|
+
const license = dep.license;
|
|
42
|
+
if (policy.deny.length > 0 && matchesAny(license, policy.deny)) {
|
|
43
|
+
violations.push({
|
|
44
|
+
packageName: dep.package_name,
|
|
45
|
+
ecosystem: dep.ecosystem,
|
|
46
|
+
license,
|
|
47
|
+
severity: "deny"
|
|
48
|
+
});
|
|
49
|
+
} else if (policy.warn.length > 0 && matchesAny(license, policy.warn)) {
|
|
50
|
+
violations.push({
|
|
51
|
+
packageName: dep.package_name,
|
|
52
|
+
ecosystem: dep.ecosystem,
|
|
53
|
+
license,
|
|
54
|
+
severity: "warn"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
violations.sort((a, b) => {
|
|
59
|
+
if (a.severity !== b.severity) {
|
|
60
|
+
return a.severity === "deny" ? -1 : 1;
|
|
61
|
+
}
|
|
62
|
+
return a.packageName.localeCompare(b.packageName);
|
|
63
|
+
});
|
|
64
|
+
return violations;
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
checkLicensePolicy
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=license.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/security/license.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * License Compliance Checker for KiroGraph-Sec\n *\n * Checks project dependencies against a license policy (deny/warn lists).\n * Supports case-insensitive matching and wildcard patterns (e.g. GPL-* matches\n * GPL-2.0, GPL-3.0-only, etc.).\n */\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 LicenseViolation {\n packageName: string;\n ecosystem: string;\n license: string;\n severity: 'deny' | 'warn';\n}\n\n// \u2500\u2500 Wildcard matching \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\n/**\n * Test whether a license string matches a policy pattern.\n * Matching is case-insensitive. The pattern may contain `*` as a wildcard\n * (matches any sequence of characters).\n */\nfunction matchesPattern(license: string, pattern: string): boolean {\n const lowerLicense = license.toLowerCase();\n const lowerPattern = pattern.toLowerCase();\n\n if (!lowerPattern.includes('*')) {\n return lowerLicense === lowerPattern;\n }\n\n // Convert wildcard pattern to regex\n // Escape regex special chars except *, then replace * with .*\n const regexStr = lowerPattern\n .replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&')\n .replace(/\\*/g, '.*');\n const regex = new RegExp(`^${regexStr}$`);\n return regex.test(lowerLicense);\n}\n\n/**\n * Test whether a license matches any pattern in the list.\n */\nfunction matchesAny(license: string, patterns: string[]): boolean {\n return patterns.some(p => matchesPattern(license, p));\n}\n\n// \u2500\u2500 Main check function \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\n/**\n * Check a list of dependencies against a license policy.\n *\n * Dependencies with no license are skipped (no violation).\n * A license matched in `deny` produces a 'deny' violation.\n * A license matched in `warn` (and not in `deny`) produces a 'warn' violation.\n *\n * @param deps - Array of dependency rows from sec_dependencies\n * @param policy - The license policy with deny and warn lists\n * @returns Array of violations sorted by severity (deny first) then package name\n */\nexport function checkLicensePolicy(\n deps: Array<{ package_name: string; ecosystem: string; license: string | null }>,\n policy: { deny: string[]; warn: string[] },\n): LicenseViolation[] {\n const violations: LicenseViolation[] = [];\n\n for (const dep of deps) {\n if (!dep.license) continue;\n\n const license = dep.license;\n\n if (policy.deny.length > 0 && matchesAny(license, policy.deny)) {\n violations.push({\n packageName: dep.package_name,\n ecosystem: dep.ecosystem,\n license,\n severity: 'deny',\n });\n } else if (policy.warn.length > 0 && matchesAny(license, policy.warn)) {\n violations.push({\n packageName: dep.package_name,\n ecosystem: dep.ecosystem,\n license,\n severity: 'warn',\n });\n }\n }\n\n // Sort: deny first, then warn; within each group sort by package name\n violations.sort((a, b) => {\n if (a.severity !== b.severity) {\n return a.severity === 'deny' ? -1 : 1;\n }\n return a.packageName.localeCompare(b.packageName);\n });\n\n return violations;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,SAAS,eAAe,SAAiB,SAA0B;AACjE,QAAM,eAAe,QAAQ,YAAY;AACzC,QAAM,eAAe,QAAQ,YAAY;AAEzC,MAAI,CAAC,aAAa,SAAS,GAAG,GAAG;AAC/B,WAAO,iBAAiB;AAAA,EAC1B;AAIA,QAAM,WAAW,aACd,QAAQ,sBAAsB,MAAM,EACpC,QAAQ,OAAO,IAAI;AACtB,QAAM,QAAQ,IAAI,OAAO,IAAI,QAAQ,GAAG;AACxC,SAAO,MAAM,KAAK,YAAY;AAChC;AAKA,SAAS,WAAW,SAAiB,UAA6B;AAChE,SAAO,SAAS,KAAK,OAAK,eAAe,SAAS,CAAC,CAAC;AACtD;AAeO,SAAS,mBACd,MACA,QACoB;AACpB,QAAM,aAAiC,CAAC;AAExC,aAAW,OAAO,MAAM;AACtB,QAAI,CAAC,IAAI,QAAS;AAElB,UAAM,UAAU,IAAI;AAEpB,QAAI,OAAO,KAAK,SAAS,KAAK,WAAW,SAAS,OAAO,IAAI,GAAG;AAC9D,iBAAW,KAAK;AAAA,QACd,aAAa,IAAI;AAAA,QACjB,WAAW,IAAI;AAAA,QACf;AAAA,QACA,UAAU;AAAA,MACZ,CAAC;AAAA,IACH,WAAW,OAAO,KAAK,SAAS,KAAK,WAAW,SAAS,OAAO,IAAI,GAAG;AACrE,iBAAW,KAAK;AAAA,QACd,aAAa,IAAI;AAAA,QACjB,WAAW,IAAI;AAAA,QACf;AAAA,QACA,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAGA,aAAW,KAAK,CAAC,GAAG,MAAM;AACxB,QAAI,EAAE,aAAa,EAAE,UAAU;AAC7B,aAAO,EAAE,aAAa,SAAS,KAAK;AAAA,IACtC;AACA,WAAO,EAAE,YAAY,cAAc,EAAE,WAAW;AAAA,EAClD,CAAC;AAED,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { ManifestParser as ArchManifestParser } from '../../architecture/types';
|
|
2
|
+
import type { ParsedDependency, ManifestParseResult } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* A version extraction plugin provides ecosystem-specific logic to extract
|
|
5
|
+
* version constraints and scopes from manifest files. Each plugin corresponds
|
|
6
|
+
* to one or more architecture parsers and enhances their output with security-
|
|
7
|
+
* relevant metadata.
|
|
8
|
+
*/
|
|
9
|
+
export interface VersionExtractionPlugin {
|
|
10
|
+
/** Ecosystem identifier matching the architecture parser name (e.g. 'npm', 'maven', 'go') */
|
|
11
|
+
ecosystem: string;
|
|
12
|
+
/** Manifest filenames this plugin handles (should match the architecture parser's manifestFiles) */
|
|
13
|
+
manifestFiles: string[];
|
|
14
|
+
/** Returns true if this plugin can handle the given manifest file path */
|
|
15
|
+
canExtract(manifestPath: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Extract version constraints and scopes from a manifest file.
|
|
18
|
+
* This is called AFTER the architecture parser has already discovered the manifest.
|
|
19
|
+
* The plugin receives the manifest path and project root, and returns detailed
|
|
20
|
+
* dependency information including versions and scopes.
|
|
21
|
+
*/
|
|
22
|
+
extract(manifestPath: string, projectRoot: string): Promise<ParsedDependency[]>;
|
|
23
|
+
}
|
|
24
|
+
export declare class SecurityManifestAdapter {
|
|
25
|
+
private readonly archParsers;
|
|
26
|
+
private readonly plugins;
|
|
27
|
+
/** Standalone plugins have no corresponding architecture parser — they own their own discovery. */
|
|
28
|
+
private readonly standalonePlugins;
|
|
29
|
+
private readonly projectRoot;
|
|
30
|
+
constructor(projectRoot: string);
|
|
31
|
+
/**
|
|
32
|
+
* Register a version extraction plugin for an ecosystem that has a
|
|
33
|
+
* corresponding architecture parser. The plugin's `ecosystem` field
|
|
34
|
+
* must equal the architecture parser's `name` for the lookup to work.
|
|
35
|
+
*/
|
|
36
|
+
registerPlugin(plugin: VersionExtractionPlugin): void;
|
|
37
|
+
/**
|
|
38
|
+
* Register a standalone version extraction plugin for an ecosystem that
|
|
39
|
+
* has NO corresponding architecture parser. The plugin's `manifestFiles`
|
|
40
|
+
* list drives discovery — the adapter will scan for those filenames and
|
|
41
|
+
* invoke the plugin directly when found.
|
|
42
|
+
*/
|
|
43
|
+
registerStandalonePlugin(plugin: VersionExtractionPlugin): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get all registered version extraction plugins (wrapped + standalone).
|
|
46
|
+
*/
|
|
47
|
+
getPlugins(): VersionExtractionPlugin[];
|
|
48
|
+
/**
|
|
49
|
+
* Get the architecture parsers being wrapped.
|
|
50
|
+
*/
|
|
51
|
+
getArchParsers(): ArchManifestParser[];
|
|
52
|
+
/**
|
|
53
|
+
* Discover all manifest files in the project tree.
|
|
54
|
+
* Includes files known to architecture parsers AND files from standalone plugins.
|
|
55
|
+
* Returns absolute paths.
|
|
56
|
+
*/
|
|
57
|
+
discoverManifests(): string[];
|
|
58
|
+
/**
|
|
59
|
+
* Run full discovery and extraction:
|
|
60
|
+
* 1. Discover manifest files (reusing architecture's SKIP_DIRS logic)
|
|
61
|
+
* 2. For each manifest, find the matching architecture parser
|
|
62
|
+
* 3. If a version extraction plugin is registered for that ecosystem,
|
|
63
|
+
* use it to extract detailed version/scope information
|
|
64
|
+
* 4. Otherwise, fall back to basic extraction from the architecture parser's
|
|
65
|
+
* ArchPackage.externalDeps (names only, no version info)
|
|
66
|
+
*/
|
|
67
|
+
extractAll(): Promise<ManifestParseResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Extract dependencies for a single manifest file.
|
|
70
|
+
* Tries standalone plugins first (when there is no arch parser), then
|
|
71
|
+
* wrapped plugins, then falls back to arch parser output.
|
|
72
|
+
*/
|
|
73
|
+
extractFromManifest(manifestPath: string): Promise<ParsedDependency[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Get the ecosystem name for a given manifest file path.
|
|
76
|
+
* Returns undefined if no parser handles this file.
|
|
77
|
+
*/
|
|
78
|
+
getEcosystem(manifestPath: string): string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Fallback extraction: converts ArchPackage.externalDeps (names only) into
|
|
81
|
+
* ParsedDependency records with empty version constraints and default scope.
|
|
82
|
+
*/
|
|
83
|
+
private _fallbackExtract;
|
|
84
|
+
/**
|
|
85
|
+
* Walk the project directory tree looking for manifest files.
|
|
86
|
+
* Mirrors the architecture module's _findManifests() logic, respecting SKIP_DIRS.
|
|
87
|
+
* Includes manifest filenames from standalone plugins in addition to arch parsers.
|
|
88
|
+
*/
|
|
89
|
+
private _findManifests;
|
|
90
|
+
private _walkDir;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/security/manifest/adapter.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAe,MAAM,0BAA0B,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAItE;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,6FAA6F;IAC7F,SAAS,EAAE,MAAM,CAAC;IAClB,oGAAoG;IACpG,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,0EAA0E;IAC1E,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C;;;;;OAKG;IACH,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;CACjF;AAYD,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmD;IAC3E,mGAAmG;IACnG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmD;IACrF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,WAAW,EAAE,MAAM;IAK/B;;;;OAIG;IACH,cAAc,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAIrD;;;;;OAKG;IACH,wBAAwB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAI/D;;OAEG;IACH,UAAU,IAAI,uBAAuB,EAAE;IAIvC;;OAEG;IACH,cAAc,IAAI,kBAAkB,EAAE;IAItC;;;;OAIG;IACH,iBAAiB,IAAI,MAAM,EAAE;IAI7B;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAqDhD;;;;OAIG;IACG,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAyB5E;;;OAGG;IACH,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAOtD;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAqBxB;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,QAAQ;CAsBjB"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var adapter_exports = {};
|
|
30
|
+
__export(adapter_exports, {
|
|
31
|
+
SecurityManifestAdapter: () => SecurityManifestAdapter
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(adapter_exports);
|
|
34
|
+
var fs = __toESM(require("fs"));
|
|
35
|
+
var path = __toESM(require("path"));
|
|
36
|
+
var import_manifest = require("../../architecture/manifest/index");
|
|
37
|
+
const SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
38
|
+
"node_modules",
|
|
39
|
+
".git",
|
|
40
|
+
"dist",
|
|
41
|
+
"build",
|
|
42
|
+
"target",
|
|
43
|
+
".gradle",
|
|
44
|
+
"__pycache__",
|
|
45
|
+
".kirograph",
|
|
46
|
+
"vendor",
|
|
47
|
+
".cache",
|
|
48
|
+
"coverage",
|
|
49
|
+
".nyc_output",
|
|
50
|
+
"_build",
|
|
51
|
+
"_opam",
|
|
52
|
+
"elm-stuff",
|
|
53
|
+
"zig-cache",
|
|
54
|
+
"zig-out"
|
|
55
|
+
]);
|
|
56
|
+
class SecurityManifestAdapter {
|
|
57
|
+
constructor(projectRoot) {
|
|
58
|
+
this.plugins = /* @__PURE__ */ new Map();
|
|
59
|
+
/** Standalone plugins have no corresponding architecture parser — they own their own discovery. */
|
|
60
|
+
this.standalonePlugins = /* @__PURE__ */ new Map();
|
|
61
|
+
this.projectRoot = projectRoot;
|
|
62
|
+
this.archParsers = (0, import_manifest.getAllManifestParsers)();
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Register a version extraction plugin for an ecosystem that has a
|
|
66
|
+
* corresponding architecture parser. The plugin's `ecosystem` field
|
|
67
|
+
* must equal the architecture parser's `name` for the lookup to work.
|
|
68
|
+
*/
|
|
69
|
+
registerPlugin(plugin) {
|
|
70
|
+
this.plugins.set(plugin.ecosystem, plugin);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Register a standalone version extraction plugin for an ecosystem that
|
|
74
|
+
* has NO corresponding architecture parser. The plugin's `manifestFiles`
|
|
75
|
+
* list drives discovery — the adapter will scan for those filenames and
|
|
76
|
+
* invoke the plugin directly when found.
|
|
77
|
+
*/
|
|
78
|
+
registerStandalonePlugin(plugin) {
|
|
79
|
+
this.standalonePlugins.set(plugin.ecosystem, plugin);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get all registered version extraction plugins (wrapped + standalone).
|
|
83
|
+
*/
|
|
84
|
+
getPlugins() {
|
|
85
|
+
return [...this.plugins.values(), ...this.standalonePlugins.values()];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get the architecture parsers being wrapped.
|
|
89
|
+
*/
|
|
90
|
+
getArchParsers() {
|
|
91
|
+
return this.archParsers;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Discover all manifest files in the project tree.
|
|
95
|
+
* Includes files known to architecture parsers AND files from standalone plugins.
|
|
96
|
+
* Returns absolute paths.
|
|
97
|
+
*/
|
|
98
|
+
discoverManifests() {
|
|
99
|
+
return this._findManifests(this.projectRoot);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Run full discovery and extraction:
|
|
103
|
+
* 1. Discover manifest files (reusing architecture's SKIP_DIRS logic)
|
|
104
|
+
* 2. For each manifest, find the matching architecture parser
|
|
105
|
+
* 3. If a version extraction plugin is registered for that ecosystem,
|
|
106
|
+
* use it to extract detailed version/scope information
|
|
107
|
+
* 4. Otherwise, fall back to basic extraction from the architecture parser's
|
|
108
|
+
* ArchPackage.externalDeps (names only, no version info)
|
|
109
|
+
*/
|
|
110
|
+
async extractAll() {
|
|
111
|
+
const manifestPaths = this.discoverManifests();
|
|
112
|
+
const allDeps = [];
|
|
113
|
+
const warnings = [];
|
|
114
|
+
const errors = [];
|
|
115
|
+
let manifestsParsed = 0;
|
|
116
|
+
for (const manifestPath of manifestPaths) {
|
|
117
|
+
const archParser = this.archParsers.find((p) => p.canParse(manifestPath));
|
|
118
|
+
if (!archParser) continue;
|
|
119
|
+
const relManifest = path.relative(this.projectRoot, manifestPath).replace(/\\/g, "/");
|
|
120
|
+
const plugin = this.plugins.get(archParser.name);
|
|
121
|
+
if (plugin && plugin.canExtract(manifestPath)) {
|
|
122
|
+
try {
|
|
123
|
+
const deps = await plugin.extract(manifestPath, this.projectRoot);
|
|
124
|
+
allDeps.push(...deps);
|
|
125
|
+
manifestsParsed++;
|
|
126
|
+
} catch (err) {
|
|
127
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
128
|
+
errors.push({ file: relManifest, message });
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
try {
|
|
132
|
+
const packages = await archParser.parse(manifestPath, this.projectRoot);
|
|
133
|
+
const deps = this._fallbackExtract(packages, archParser.name, relManifest);
|
|
134
|
+
allDeps.push(...deps);
|
|
135
|
+
manifestsParsed++;
|
|
136
|
+
if (!plugin) {
|
|
137
|
+
warnings.push({
|
|
138
|
+
file: relManifest,
|
|
139
|
+
message: `No version extraction plugin registered for ecosystem '${archParser.name}'; dependency names extracted without version constraints`
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
} catch (err) {
|
|
143
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
144
|
+
errors.push({ file: relManifest, message });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
dependenciesCreated: allDeps.length,
|
|
150
|
+
manifestsParsed,
|
|
151
|
+
warnings,
|
|
152
|
+
errors
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Extract dependencies for a single manifest file.
|
|
157
|
+
* Tries standalone plugins first (when there is no arch parser), then
|
|
158
|
+
* wrapped plugins, then falls back to arch parser output.
|
|
159
|
+
*/
|
|
160
|
+
async extractFromManifest(manifestPath) {
|
|
161
|
+
const archParser = this.archParsers.find((p) => p.canParse(manifestPath));
|
|
162
|
+
if (!archParser) {
|
|
163
|
+
const standalonePlugin = [...this.standalonePlugins.values()].find((p) => p.canExtract(manifestPath));
|
|
164
|
+
if (standalonePlugin) {
|
|
165
|
+
return standalonePlugin.extract(manifestPath, this.projectRoot);
|
|
166
|
+
}
|
|
167
|
+
return [];
|
|
168
|
+
}
|
|
169
|
+
const plugin = this.plugins.get(archParser.name);
|
|
170
|
+
if (plugin && plugin.canExtract(manifestPath)) {
|
|
171
|
+
return plugin.extract(manifestPath, this.projectRoot);
|
|
172
|
+
}
|
|
173
|
+
const packages = await archParser.parse(manifestPath, this.projectRoot);
|
|
174
|
+
const relManifest = path.relative(this.projectRoot, manifestPath).replace(/\\/g, "/");
|
|
175
|
+
return this._fallbackExtract(packages, archParser.name, relManifest);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Get the ecosystem name for a given manifest file path.
|
|
179
|
+
* Returns undefined if no parser handles this file.
|
|
180
|
+
*/
|
|
181
|
+
getEcosystem(manifestPath) {
|
|
182
|
+
const parser = this.archParsers.find((p) => p.canParse(manifestPath));
|
|
183
|
+
return parser?.name;
|
|
184
|
+
}
|
|
185
|
+
// ── Private helpers ───────────────────────────────────────────────────────
|
|
186
|
+
/**
|
|
187
|
+
* Fallback extraction: converts ArchPackage.externalDeps (names only) into
|
|
188
|
+
* ParsedDependency records with empty version constraints and default scope.
|
|
189
|
+
*/
|
|
190
|
+
_fallbackExtract(packages, ecosystem, sourceManifest) {
|
|
191
|
+
const deps = [];
|
|
192
|
+
for (const pkg of packages) {
|
|
193
|
+
if (!pkg.externalDeps) continue;
|
|
194
|
+
for (const depName of pkg.externalDeps) {
|
|
195
|
+
deps.push({
|
|
196
|
+
name: depName,
|
|
197
|
+
declaredConstraint: "*",
|
|
198
|
+
scope: "production",
|
|
199
|
+
ecosystem,
|
|
200
|
+
sourceManifest
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return deps;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Walk the project directory tree looking for manifest files.
|
|
208
|
+
* Mirrors the architecture module's _findManifests() logic, respecting SKIP_DIRS.
|
|
209
|
+
* Includes manifest filenames from standalone plugins in addition to arch parsers.
|
|
210
|
+
*/
|
|
211
|
+
_findManifests(dir, results = []) {
|
|
212
|
+
const manifestFilenames = /* @__PURE__ */ new Set([
|
|
213
|
+
...this.archParsers.flatMap((p) => p.manifestFiles),
|
|
214
|
+
...Array.from(this.standalonePlugins.values()).flatMap((p) => p.manifestFiles)
|
|
215
|
+
]);
|
|
216
|
+
return this._walkDir(dir, manifestFilenames, results);
|
|
217
|
+
}
|
|
218
|
+
_walkDir(dir, manifestFilenames, results) {
|
|
219
|
+
let entries;
|
|
220
|
+
try {
|
|
221
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
222
|
+
} catch {
|
|
223
|
+
return results;
|
|
224
|
+
}
|
|
225
|
+
for (const entry of entries) {
|
|
226
|
+
if (entry.isDirectory()) {
|
|
227
|
+
if (!SKIP_DIRS.has(entry.name)) {
|
|
228
|
+
this._walkDir(path.join(dir, entry.name), manifestFilenames, results);
|
|
229
|
+
}
|
|
230
|
+
} else if (entry.isFile()) {
|
|
231
|
+
if (manifestFilenames.has(entry.name) || entry.name.endsWith(".csproj")) {
|
|
232
|
+
results.push(path.join(dir, entry.name));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return results;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
240
|
+
0 && (module.exports = {
|
|
241
|
+
SecurityManifestAdapter
|
|
242
|
+
});
|
|
243
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/security/manifest/adapter.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * SecurityManifestAdapter\n *\n * Wraps the existing architecture manifest parsers (11 parsers: npm, cargo, go,\n * gradle, maven, csproj, python, scala, elm, ocaml) to additionally extract\n * version constraints and dependency scopes that the architecture module does\n * not capture.\n *\n * The architecture parsers discover manifest files and extract package names into\n * `ArchPackage.externalDeps`. This adapter reuses that discovery infrastructure\n * and layers version/scope extraction on top via ecosystem-specific plugins.\n */\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { getAllManifestParsers } from '../../architecture/manifest/index';\nimport type { ManifestParser as ArchManifestParser, ArchPackage } from '../../architecture/types';\nimport type { ParsedDependency, ManifestParseResult } from '../types';\n\n// \u2500\u2500 Plugin Interface \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\n/**\n * A version extraction plugin provides ecosystem-specific logic to extract\n * version constraints and scopes from manifest files. Each plugin corresponds\n * to one or more architecture parsers and enhances their output with security-\n * relevant metadata.\n */\nexport interface VersionExtractionPlugin {\n /** Ecosystem identifier matching the architecture parser name (e.g. 'npm', 'maven', 'go') */\n ecosystem: string;\n /** Manifest filenames this plugin handles (should match the architecture parser's manifestFiles) */\n manifestFiles: string[];\n /** Returns true if this plugin can handle the given manifest file path */\n canExtract(manifestPath: string): boolean;\n /**\n * Extract version constraints and scopes from a manifest file.\n * This is called AFTER the architecture parser has already discovered the manifest.\n * The plugin receives the manifest path and project root, and returns detailed\n * dependency information including versions and scopes.\n */\n extract(manifestPath: string, projectRoot: string): Promise<ParsedDependency[]>;\n}\n\n// \u2500\u2500 Directories to skip (mirrors architecture module's SKIP_DIRS) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst SKIP_DIRS = new Set([\n 'node_modules', '.git', 'dist', 'build', 'target', '.gradle', '__pycache__',\n '.kirograph', 'vendor', '.cache', 'coverage', '.nyc_output', '_build', '_opam',\n 'elm-stuff', 'zig-cache', 'zig-out',\n]);\n\n// \u2500\u2500 SecurityManifestAdapter \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 class SecurityManifestAdapter {\n private readonly archParsers: ArchManifestParser[];\n private readonly plugins: Map<string, VersionExtractionPlugin> = new Map();\n /** Standalone plugins have no corresponding architecture parser \u2014 they own their own discovery. */\n private readonly standalonePlugins: Map<string, VersionExtractionPlugin> = new Map();\n private readonly projectRoot: string;\n\n constructor(projectRoot: string) {\n this.projectRoot = projectRoot;\n this.archParsers = getAllManifestParsers();\n }\n\n /**\n * Register a version extraction plugin for an ecosystem that has a\n * corresponding architecture parser. The plugin's `ecosystem` field\n * must equal the architecture parser's `name` for the lookup to work.\n */\n registerPlugin(plugin: VersionExtractionPlugin): void {\n this.plugins.set(plugin.ecosystem, plugin);\n }\n\n /**\n * Register a standalone version extraction plugin for an ecosystem that\n * has NO corresponding architecture parser. The plugin's `manifestFiles`\n * list drives discovery \u2014 the adapter will scan for those filenames and\n * invoke the plugin directly when found.\n */\n registerStandalonePlugin(plugin: VersionExtractionPlugin): void {\n this.standalonePlugins.set(plugin.ecosystem, plugin);\n }\n\n /**\n * Get all registered version extraction plugins (wrapped + standalone).\n */\n getPlugins(): VersionExtractionPlugin[] {\n return [...this.plugins.values(), ...this.standalonePlugins.values()];\n }\n\n /**\n * Get the architecture parsers being wrapped.\n */\n getArchParsers(): ArchManifestParser[] {\n return this.archParsers;\n }\n\n /**\n * Discover all manifest files in the project tree.\n * Includes files known to architecture parsers AND files from standalone plugins.\n * Returns absolute paths.\n */\n discoverManifests(): string[] {\n return this._findManifests(this.projectRoot);\n }\n\n /**\n * Run full discovery and extraction:\n * 1. Discover manifest files (reusing architecture's SKIP_DIRS logic)\n * 2. For each manifest, find the matching architecture parser\n * 3. If a version extraction plugin is registered for that ecosystem,\n * use it to extract detailed version/scope information\n * 4. Otherwise, fall back to basic extraction from the architecture parser's\n * ArchPackage.externalDeps (names only, no version info)\n */\n async extractAll(): Promise<ManifestParseResult> {\n const manifestPaths = this.discoverManifests();\n const allDeps: ParsedDependency[] = [];\n const warnings: Array<{ file: string; line?: number; message: string }> = [];\n const errors: Array<{ file: string; message: string }> = [];\n let manifestsParsed = 0;\n\n for (const manifestPath of manifestPaths) {\n const archParser = this.archParsers.find(p => p.canParse(manifestPath));\n if (!archParser) continue;\n\n const relManifest = path.relative(this.projectRoot, manifestPath).replace(/\\\\/g, '/');\n const plugin = this.plugins.get(archParser.name);\n\n if (plugin && plugin.canExtract(manifestPath)) {\n // Use the version extraction plugin for detailed parsing\n try {\n const deps = await plugin.extract(manifestPath, this.projectRoot);\n allDeps.push(...deps);\n manifestsParsed++;\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n errors.push({ file: relManifest, message });\n }\n } else {\n // Fallback: use architecture parser output (names only, no versions)\n try {\n const packages = await archParser.parse(manifestPath, this.projectRoot);\n const deps = this._fallbackExtract(packages, archParser.name, relManifest);\n allDeps.push(...deps);\n manifestsParsed++;\n\n if (!plugin) {\n warnings.push({\n file: relManifest,\n message: `No version extraction plugin registered for ecosystem '${archParser.name}'; dependency names extracted without version constraints`,\n });\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n errors.push({ file: relManifest, message });\n }\n }\n }\n\n return {\n dependenciesCreated: allDeps.length,\n manifestsParsed,\n warnings,\n errors,\n };\n }\n\n /**\n * Extract dependencies for a single manifest file.\n * Tries standalone plugins first (when there is no arch parser), then\n * wrapped plugins, then falls back to arch parser output.\n */\n async extractFromManifest(manifestPath: string): Promise<ParsedDependency[]> {\n const archParser = this.archParsers.find(p => p.canParse(manifestPath));\n\n if (!archParser) {\n // No arch parser \u2014 try standalone plugins\n const standalonePlugin = [...this.standalonePlugins.values()]\n .find(p => p.canExtract(manifestPath));\n if (standalonePlugin) {\n return standalonePlugin.extract(manifestPath, this.projectRoot);\n }\n return [];\n }\n\n const plugin = this.plugins.get(archParser.name);\n\n if (plugin && plugin.canExtract(manifestPath)) {\n return plugin.extract(manifestPath, this.projectRoot);\n }\n\n // Fallback: architecture parser output (names only)\n const packages = await archParser.parse(manifestPath, this.projectRoot);\n const relManifest = path.relative(this.projectRoot, manifestPath).replace(/\\\\/g, '/');\n return this._fallbackExtract(packages, archParser.name, relManifest);\n }\n\n /**\n * Get the ecosystem name for a given manifest file path.\n * Returns undefined if no parser handles this file.\n */\n getEcosystem(manifestPath: string): string | undefined {\n const parser = this.archParsers.find(p => p.canParse(manifestPath));\n return parser?.name;\n }\n\n // \u2500\u2500 Private 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\n\n /**\n * Fallback extraction: converts ArchPackage.externalDeps (names only) into\n * ParsedDependency records with empty version constraints and default scope.\n */\n private _fallbackExtract(\n packages: ArchPackage[],\n ecosystem: string,\n sourceManifest: string,\n ): ParsedDependency[] {\n const deps: ParsedDependency[] = [];\n for (const pkg of packages) {\n if (!pkg.externalDeps) continue;\n for (const depName of pkg.externalDeps) {\n deps.push({\n name: depName,\n declaredConstraint: '*',\n scope: 'production',\n ecosystem,\n sourceManifest,\n });\n }\n }\n return deps;\n }\n\n /**\n * Walk the project directory tree looking for manifest files.\n * Mirrors the architecture module's _findManifests() logic, respecting SKIP_DIRS.\n * Includes manifest filenames from standalone plugins in addition to arch parsers.\n */\n private _findManifests(dir: string, results: string[] = []): string[] {\n const manifestFilenames = new Set([\n ...this.archParsers.flatMap(p => p.manifestFiles),\n ...Array.from(this.standalonePlugins.values()).flatMap(p => p.manifestFiles),\n ]);\n\n return this._walkDir(dir, manifestFilenames, results);\n }\n\n private _walkDir(dir: string, manifestFilenames: Set<string>, results: string[]): string[] {\n let entries: fs.Dirent[];\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch {\n return results;\n }\n\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (!SKIP_DIRS.has(entry.name)) {\n this._walkDir(path.join(dir, entry.name), manifestFilenames, results);\n }\n } else if (entry.isFile()) {\n if (manifestFilenames.has(entry.name) || entry.name.endsWith('.csproj')) {\n results.push(path.join(dir, entry.name));\n }\n }\n }\n\n return results;\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ManifestParser Orchestrator
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates manifest discovery, version extraction, deduplication, and
|
|
5
|
+
* database persistence. Uses the SecurityManifestAdapter for discovery and
|
|
6
|
+
* extraction, registers all 12 version extraction plugins:
|
|
7
|
+
* Wrapped (arch parser exists): npm, maven, go, pip, cargo, nuget, gradle
|
|
8
|
+
* Standalone (no arch parser): rubygems, composer, swift, pubspec, hex
|
|
9
|
+
*
|
|
10
|
+
* Node ID format: `dep:<ecosystem>:<name>` (e.g. `dep:npm:express`)
|
|
11
|
+
*/
|
|
12
|
+
import { SecurityManifestAdapter } from './adapter';
|
|
13
|
+
import type { GraphDatabase } from '../../db/database';
|
|
14
|
+
import type { ParsedDependency, ManifestParseResult } from '../types';
|
|
15
|
+
/**
|
|
16
|
+
* Compare two version strings. Returns:
|
|
17
|
+
* - positive if a > b
|
|
18
|
+
* - negative if a < b
|
|
19
|
+
* - 0 if equal
|
|
20
|
+
*
|
|
21
|
+
* Handles semver-like versions (1.2.3), Go pseudo-versions, and constraint
|
|
22
|
+
* strings. Falls back to lexicographic comparison for non-numeric versions.
|
|
23
|
+
*/
|
|
24
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
25
|
+
/**
|
|
26
|
+
* A deduplicated dependency entry combining data from multiple manifests.
|
|
27
|
+
*/
|
|
28
|
+
interface DeduplicatedDependency {
|
|
29
|
+
name: string;
|
|
30
|
+
ecosystem: string;
|
|
31
|
+
/** The highest declared constraint across all manifests */
|
|
32
|
+
declaredConstraint: string;
|
|
33
|
+
/** The highest resolved version across all manifests (if any) */
|
|
34
|
+
resolvedVersion?: string;
|
|
35
|
+
/** Scope from the manifest with the highest version */
|
|
36
|
+
scope: ParsedDependency['scope'];
|
|
37
|
+
/** All source manifests that declared this dependency */
|
|
38
|
+
sourceManifests: string[];
|
|
39
|
+
/** License from manifest, if available */
|
|
40
|
+
license?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Deduplicate dependencies by (name, ecosystem) pair, keeping the entry
|
|
44
|
+
* with the highest version and collecting all source manifests.
|
|
45
|
+
*/
|
|
46
|
+
export declare function deduplicateDependencies(deps: ParsedDependency[]): DeduplicatedDependency[];
|
|
47
|
+
/**
|
|
48
|
+
* ManifestParser orchestrates manifest discovery, parsing, deduplication,
|
|
49
|
+
* and database persistence for the security module.
|
|
50
|
+
*/
|
|
51
|
+
export declare class ManifestParser {
|
|
52
|
+
private readonly adapter;
|
|
53
|
+
private readonly db;
|
|
54
|
+
private readonly projectRoot;
|
|
55
|
+
constructor(db: GraphDatabase, projectRoot: string);
|
|
56
|
+
/**
|
|
57
|
+
* Get the underlying adapter (useful for testing).
|
|
58
|
+
*/
|
|
59
|
+
getAdapter(): SecurityManifestAdapter;
|
|
60
|
+
/**
|
|
61
|
+
* Run full manifest discovery, parsing, deduplication, and database persistence.
|
|
62
|
+
*
|
|
63
|
+
* Steps:
|
|
64
|
+
* 1. Discover manifest files via the adapter (reuses architecture parsers)
|
|
65
|
+
* 2. Extract dependencies with version/scope data via registered plugins
|
|
66
|
+
* 3. Deduplicate: same (name, ecosystem) → single entry with highest version
|
|
67
|
+
* 4. Create Dependency_Nodes in the database (nodes + sec_dependencies tables)
|
|
68
|
+
* 5. Create `declared_in` edges linking dependencies to their source manifests
|
|
69
|
+
*/
|
|
70
|
+
parseAll(): Promise<ManifestParseResult>;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/security/manifest/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,uBAAuB,EAAgC,MAAM,WAAW,CAAC;AAclF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAiLtE;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAyC5D;AAYD;;GAEG;AACH,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjC,yDAAyD;IACzD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,EAAE,CA2C1F;AAID;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAClD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAgB;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM;IAuBlD;;OAEG;IACH,UAAU,IAAI,uBAAuB;IAIrC;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAkH/C"}
|