kirograph 0.19.0 → 0.20.1
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/README.md +10 -8
- package/dist/architecture/layers/dart.d.ts +10 -0
- package/dist/architecture/layers/dart.d.ts.map +1 -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/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/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 +7 -0
- package/dist/bin/commands/attack-surface.js.map +2 -2
- package/dist/bin/commands/benchmark.d.ts +9 -0
- package/dist/bin/commands/benchmark.d.ts.map +1 -0
- package/dist/bin/commands/budget.d.ts +6 -0
- package/dist/bin/commands/budget.d.ts.map +1 -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/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/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/flows.d.ts +3 -0
- package/dist/bin/commands/flows.d.ts.map +1 -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 +20 -3
- 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 +3 -3
- 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/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/read.d.ts +6 -0
- package/dist/bin/commands/read.d.ts.map +1 -0
- package/dist/bin/commands/refactor.d.ts +3 -0
- package/dist/bin/commands/refactor.d.ts.map +1 -0
- package/dist/bin/commands/remediation.d.ts +3 -0
- package/dist/bin/commands/remediation.d.ts.map +1 -0
- package/dist/bin/commands/sbom.d.ts +3 -0
- package/dist/bin/commands/sbom.d.ts.map +1 -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-export.d.ts +2 -0
- package/dist/bin/commands/security-export.d.ts.map +1 -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-secrets.d.ts +3 -0
- package/dist/bin/commands/security-secrets.d.ts.map +1 -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 +15 -0
- package/dist/bin/commands/security.js.map +2 -2
- 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/status.d.ts.map +1 -1
- package/dist/bin/commands/status.js +27 -0
- 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/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/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/vuln-suppress.d.ts +3 -0
- package/dist/bin/commands/vuln-suppress.d.ts.map +1 -0
- package/dist/bin/commands/vulns.d.ts +3 -0
- package/dist/bin/commands/vulns.d.ts.map +1 -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/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 +6 -2
- 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 +2 -1
- 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 +74 -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/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 +67 -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 +15 -1
- 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 +81 -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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/bin/installer/targets/copilot-cli.js.map +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 -2
- 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.map +1 -1
- 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 +2 -2
- package/dist/bin/installer/targets/qoder.js.map +2 -2
- 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 +2 -2
- package/dist/bin/installer/targets/qwen.js.map +2 -2
- 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 +3 -3
- 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 +2 -2
- package/dist/bin/installer/targets/windsurf.js.map +2 -2
- package/dist/bin/kirograph.js +3 -1
- 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/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 +55 -1
- 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 +42 -0
- 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 +19 -0
- package/dist/db/database.js.map +2 -2
- package/dist/db/patterns-schema.sql +23 -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 +26 -3
- 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 +1 -0
- package/dist/extraction/grammars.js.map +2 -2
- package/dist/extraction/languages.d.ts.map +1 -1
- package/dist/extraction/languages.js +5 -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/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/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/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/flows.d.ts +55 -0
- package/dist/graph/flows.d.ts.map +1 -0
- package/dist/graph/refactor.d.ts +43 -0
- package/dist/graph/refactor.d.ts.map +1 -0
- package/dist/index.d.ts +36 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/mcp/cache.d.ts +69 -0
- package/dist/mcp/cache.d.ts.map +1 -0
- package/dist/mcp/read-modes.d.ts +31 -0
- package/dist/mcp/read-modes.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +15 -2
- 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 +4 -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 +397 -0
- package/dist/mcp/tools.js.map +2 -2
- 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 +38 -0
- 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/code-eval-elixir.yaml +11 -0
- package/dist/patterns/library/command-injection-c.yaml +11 -0
- package/dist/patterns/library/command-injection-go.yaml +29 -0
- package/dist/patterns/library/command-injection-kotlin.yaml +10 -0
- package/dist/patterns/library/command-injection-php.yaml +11 -0
- package/dist/patterns/library/command-injection-ruby.yaml +11 -0
- package/dist/patterns/library/command-injection-rust.yaml +11 -0
- package/dist/patterns/library/dangerous-eval-bash.yaml +11 -0
- package/dist/patterns/library/dangerous-eval-js.yaml +14 -0
- package/dist/patterns/library/dangerous-eval-php.yaml +11 -0
- package/dist/patterns/library/dangerous-eval-ruby.yaml +11 -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/dynamic-load-lua.yaml +10 -0
- package/dist/patterns/library/os-cmd-elixir.yaml +16 -0
- package/dist/patterns/library/os-execute-lua.yaml +10 -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/process-launch-swift.yaml +11 -0
- package/dist/patterns/library/process-run-dart.yaml +15 -0
- package/dist/patterns/library/prototype-pollution-js.yaml +12 -0
- package/dist/patterns/library/source-injection-bash.yaml +11 -0
- package/dist/patterns/library/sql-injection-concat-js.yaml +12 -0
- package/dist/patterns/library/sql-injection-dart.yaml +9 -0
- package/dist/patterns/library/sql-injection-java.yaml +13 -0
- package/dist/patterns/library/sql-injection-kotlin.yaml +11 -0
- package/dist/patterns/library/sql-injection-php.yaml +9 -0
- package/dist/patterns/library/sql-injection-py.yaml +12 -0
- package/dist/patterns/library/sql-injection-swift.yaml +11 -0
- package/dist/patterns/library/sql-injection-template-js.yaml +13 -0
- package/dist/patterns/library/subshell-injection-ruby.yaml +8 -0
- package/dist/patterns/library/unsafe-block-rust.yaml +8 -0
- package/dist/patterns/library/unsafe-string-c.yaml +11 -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 +295 -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/expo-modules.d.ts +10 -0
- package/dist/resolution/bridges/expo-modules.d.ts.map +1 -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/index.d.ts +40 -0
- package/dist/resolution/bridges/index.d.ts.map +1 -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-views.d.ts +13 -0
- package/dist/resolution/bridges/native-views.d.ts.map +1 -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/swift-objc.d.ts +14 -0
- package/dist/resolution/bridges/swift-objc.d.ts.map +1 -0
- package/dist/resolution/bridges/turbomodules.d.ts +10 -0
- package/dist/resolution/bridges/turbomodules.d.ts.map +1 -0
- package/dist/resolution/index.d.ts +28 -3
- package/dist/resolution/index.d.ts.map +1 -1
- 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 +43 -1
- package/dist/security/attack-surface.js.map +2 -2
- package/dist/security/context-warnings.d.ts +40 -0
- package/dist/security/context-warnings.d.ts.map +1 -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 +65 -7
- package/dist/security/data-flows.js.map +2 -2
- package/dist/security/dep-confusion.d.ts +23 -0
- package/dist/security/dep-confusion.d.ts.map +1 -0
- package/dist/security/errors.d.ts +16 -0
- package/dist/security/errors.d.ts.map +1 -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/sbom.d.ts +33 -0
- package/dist/security/export/sbom.d.ts.map +1 -0
- package/dist/security/export/serialization.d.ts +62 -0
- package/dist/security/export/serialization.d.ts.map +1 -0
- package/dist/security/export/vex.d.ts +58 -0
- package/dist/security/export/vex.d.ts.map +1 -0
- package/dist/security/index.d.ts +21 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/integrator.d.ts +63 -0
- package/dist/security/integrator.d.ts.map +1 -0
- package/dist/security/integrator.js +8 -8
- package/dist/security/integrator.js.map +2 -2
- package/dist/security/license.d.ts +33 -0
- package/dist/security/license.d.ts.map +1 -0
- package/dist/security/manifest/adapter.d.ts +92 -0
- package/dist/security/manifest/adapter.d.ts.map +1 -0
- package/dist/security/manifest/parser.d.ts +73 -0
- package/dist/security/manifest/parser.d.ts.map +1 -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/composer.d.ts +11 -0
- package/dist/security/manifest/plugins/composer.d.ts.map +1 -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/gradle.d.ts +12 -0
- package/dist/security/manifest/plugins/gradle.d.ts.map +1 -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/maven.d.ts +11 -0
- package/dist/security/manifest/plugins/maven.d.ts.map +1 -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/nuget.d.ts +12 -0
- package/dist/security/manifest/plugins/nuget.d.ts.map +1 -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/pubspec.d.ts +11 -0
- package/dist/security/manifest/plugins/pubspec.d.ts.map +1 -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/rubygems.d.ts +11 -0
- package/dist/security/manifest/plugins/rubygems.d.ts.map +1 -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/owasp.d.ts +16 -0
- package/dist/security/owasp.d.ts.map +1 -0
- package/dist/security/pipeline.d.ts +37 -0
- package/dist/security/pipeline.d.ts.map +1 -0
- package/dist/security/reachability.d.ts +67 -0
- package/dist/security/reachability.d.ts.map +1 -0
- package/dist/security/remediation.d.ts +51 -0
- package/dist/security/remediation.d.ts.map +1 -0
- package/dist/security/secrets.d.ts +38 -0
- package/dist/security/secrets.d.ts.map +1 -0
- package/dist/security/staleness.d.ts +43 -0
- package/dist/security/staleness.d.ts.map +1 -0
- package/dist/security/supply-chain.d.ts +34 -0
- package/dist/security/supply-chain.d.ts.map +1 -0
- package/dist/security/suppressions.d.ts +18 -0
- package/dist/security/suppressions.d.ts.map +1 -0
- package/dist/security/types.d.ts +144 -0
- package/dist/security/types.d.ts.map +1 -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.map +2 -2
- 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/index.d.ts +6 -0
- package/dist/security/vuln/index.d.ts.map +1 -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/types.d.ts +29 -0
- package/dist/security/vuln/types.d.ts.map +1 -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/turboquant-index.js +261 -0
- package/dist/vectors/turboquant-index.js.map +7 -0
- 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 +24 -2
- package/dist/security/context-warnings.test.js +0 -300
- package/dist/security/context-warnings.test.js.map +0 -7
- package/dist/security/export/fix-suggestions.test.js +0 -74
- package/dist/security/export/fix-suggestions.test.js.map +0 -7
- package/dist/security/export/sbom.test.js +0 -288
- package/dist/security/export/sbom.test.js.map +0 -7
- package/dist/security/export/serialization.test.js +0 -310
- package/dist/security/export/serialization.test.js.map +0 -7
- package/dist/security/export/vex.test.js +0 -278
- package/dist/security/export/vex.test.js.map +0 -7
- package/dist/security/integrator-transitives.test.js +0 -359
- package/dist/security/integrator-transitives.test.js.map +0 -7
- package/dist/security/integrator.test.js +0 -237
- package/dist/security/integrator.test.js.map +0 -7
- package/dist/security/manifest/adapter.test.js +0 -272
- package/dist/security/manifest/adapter.test.js.map +0 -7
- package/dist/security/manifest/parser.test.js +0 -110
- package/dist/security/manifest/parser.test.js.map +0 -7
- package/dist/security/manifest/plugins/cargo.test.js +0 -304
- package/dist/security/manifest/plugins/cargo.test.js.map +0 -7
- package/dist/security/manifest/plugins/go.test.js +0 -341
- package/dist/security/manifest/plugins/go.test.js.map +0 -7
- package/dist/security/manifest/plugins/maven.test.js +0 -389
- package/dist/security/manifest/plugins/maven.test.js.map +0 -7
- package/dist/security/manifest/plugins/npm.test.js +0 -298
- package/dist/security/manifest/plugins/npm.test.js.map +0 -7
- package/dist/security/manifest/plugins/pip.test.js +0 -208
- package/dist/security/manifest/plugins/pip.test.js.map +0 -7
- package/dist/security/reachability.test.js +0 -394
- package/dist/security/reachability.test.js.map +0 -7
- package/dist/security/vuln/client.test.js +0 -288
- package/dist/security/vuln/client.test.js.map +0 -7
- package/dist/security/vuln/osv-adapter.test.js +0 -391
- package/dist/security/vuln/osv-adapter.test.js.map +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/memory/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC;AACrG,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;CACpE;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAID,MAAM,WAAW,OAAO;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,cAAc,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,WAAW,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC1C;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B"}
|
package/dist/memory/types.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/memory/types.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * KiroGraph Memory \u2014 Type definitions\n */\n\n// \u2500\u2500 Session \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 MemSession {\n id: string;\n ide?: string;\n cwd?: string;\n startedAt: number;\n endedAt?: number;\n}\n\n// \u2500\u2500 Observation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 type ObservationKind = 'decision' | 'error' | 'pattern' | 'architecture' | 'summary' | 'note';\nexport type ObservationSource = 'hook' | 'manual' | 'agent';\n\nexport interface MemObservation {\n id: string;\n sessionId?: string;\n content: string;\n contentRaw?: string;\n contentHash: string;\n kind: ObservationKind;\n source: ObservationSource;\n tags?: string[];\n createdAt: number;\n /** Temporal validity: when this fact became valid (epoch ms). */\n validFrom?: number;\n /** Temporal validity: when this fact expires (epoch ms). Null = no expiry. */\n validUntil?: number;\n /** ID of the observation that supersedes this one. */\n supersededBy?: string;\n /** Fact type for temporal classification. */\n factType?: 'observation' | 'decision' | 'procedure' | 'constraint';\n}\n\nexport interface MemObservationInput {\n content: string;\n kind?: ObservationKind;\n source?: ObservationSource;\n tags?: string[];\n}\n\n// \u2500\u2500 Links \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 MemLink {\n observationId: string;\n qualifiedName: string;\n relevance: number;\n}\n\n// \u2500\u2500 Search \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 ScoredObservation {\n observation: MemObservation;\n score: number;\n /** Source of the score: 'fts', 'vector', or 'hybrid' */\n scoreSource: 'fts' | 'vector' | 'hybrid';\n}\n\nexport interface MemSearchOptions {\n limit?: number;\n kind?: ObservationKind;\n sessionId?: string;\n /** FTS/vector blend: 0 = FTS only, 1 = vector only, 0.5 = equal blend */\n alpha?: number;\n /** Query facts valid at this timestamp (epoch ms). Filters out expired/superseded observations. */\n asOf?: number;\n}\n\nexport interface MemTimelineOptions {\n limit?: number;\n sessionId?: string;\n}\n\n// \u2500\u2500 Stats \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 MemStats {\n sessions: number;\n activeSessions: number;\n observations: number;\n links: number;\n vectors: number;\n embeddableCount: number;\n modelMismatch: boolean;\n currentModel?: string;\n}\n\n// \u2500\u2500 Compress \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 CompressResult {\n compressed: string;\n originalLength: number;\n compressedLength: number;\n detectedSymbols: string[];\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph Memory \u2014 Type definitions\n */\n\n// \u2500\u2500 Session \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 MemSession {\n id: string;\n ide?: string;\n cwd?: string;\n startedAt: number;\n endedAt?: number;\n}\n\n// \u2500\u2500 Observation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 type ObservationKind = 'decision' | 'error' | 'pattern' | 'architecture' | 'summary' | 'note';\nexport type ObservationSource = 'hook' | 'manual' | 'agent';\n\nexport interface MemObservation {\n id: string;\n sessionId?: string;\n content: string;\n contentRaw?: string;\n contentHash: string;\n kind: ObservationKind;\n source: ObservationSource;\n tags?: string[];\n createdAt: number;\n /** Temporal validity: when this fact became valid (epoch ms). */\n validFrom?: number;\n /** Temporal validity: when this fact expires (epoch ms). Null = no expiry. */\n validUntil?: number;\n /** ID of the observation that supersedes this one. */\n supersededBy?: string;\n /** Fact type for temporal classification. */\n factType?: 'observation' | 'decision' | 'procedure' | 'constraint';\n}\n\nexport interface MemObservationInput {\n content: string;\n kind?: ObservationKind;\n source?: ObservationSource;\n tags?: string[];\n}\n\n// \u2500\u2500 Links \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 MemLink {\n observationId: string;\n qualifiedName: string;\n relevance: number;\n}\n\n// \u2500\u2500 Search \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 ScoredObservation {\n observation: MemObservation;\n score: number;\n /** Source of the score: 'fts', 'vector', or 'hybrid' */\n scoreSource: 'fts' | 'vector' | 'hybrid';\n}\n\nexport interface MemSearchOptions {\n limit?: number;\n kind?: ObservationKind;\n sessionId?: string;\n /** FTS/vector blend: 0 = FTS only, 1 = vector only, 0.5 = equal blend */\n alpha?: number;\n /** Query facts valid at this timestamp (epoch ms). Filters out expired/superseded observations. */\n asOf?: number;\n}\n\nexport interface MemTimelineOptions {\n limit?: number;\n sessionId?: string;\n}\n\n// \u2500\u2500 Stats \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 MemStats {\n sessions: number;\n activeSessions: number;\n observations: number;\n links: number;\n vectors: number;\n embeddableCount: number;\n modelMismatch: boolean;\n currentModel?: string;\n}\n\n// \u2500\u2500 Watchmen \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 WatchmenReadyResult {\n id: string;\n watchmenReady: true;\n pendingCount: number;\n /** Synthesis instructions for the active agent. */\n message: string;\n /** Project-relative paths to write the workspace brief to. */\n targetFiles: string[];\n /**\n * Present when Kiro is detected (.kiro/ exists). Path to the steering\n * directory where individual skill files should be written as separate\n * `inclusion: manual` files (e.g. `.kiro/steering/watchmen-<slug>.md`).\n * Absent for all other tools \u2014 embed procedures in the brief instead.\n */\n skillTargetDir?: string;\n}\n\n// \u2500\u2500 Compress \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 CompressResult {\n compressed: string;\n originalLength: number;\n compressedLength: number;\n detectedSymbols: string[];\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KiroGraph Memory — Vector embedding and search
|
|
3
|
+
*
|
|
4
|
+
* Reuses the same embedding model and semantic engine as the code graph,
|
|
5
|
+
* but operates on mem_vectors table independently.
|
|
6
|
+
*/
|
|
7
|
+
import type { KiroGraphConfig } from '../config';
|
|
8
|
+
import type { MemObservation, ScoredObservation } from './types';
|
|
9
|
+
import type { MemoryDatabase } from './database';
|
|
10
|
+
export declare class MemoryVectorManager {
|
|
11
|
+
private config;
|
|
12
|
+
private memDb;
|
|
13
|
+
private modelName;
|
|
14
|
+
private cacheDir;
|
|
15
|
+
constructor(config: KiroGraphConfig, memDb: MemoryDatabase);
|
|
16
|
+
/**
|
|
17
|
+
* Check if embeddings are enabled in config.
|
|
18
|
+
*/
|
|
19
|
+
isEnabled(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Embed a single observation and store in mem_vectors.
|
|
22
|
+
*/
|
|
23
|
+
embedObservation(obs: MemObservation): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Embed multiple observations in batch.
|
|
26
|
+
*/
|
|
27
|
+
embedBatch(observations: MemObservation[]): Promise<number>;
|
|
28
|
+
/**
|
|
29
|
+
* Vector search over memory observations.
|
|
30
|
+
* Falls back to empty results if embeddings are disabled or model mismatches.
|
|
31
|
+
*/
|
|
32
|
+
search(query: string, limit?: number): Promise<ScoredObservation[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Check if there are vectors with a mismatched model.
|
|
35
|
+
*/
|
|
36
|
+
hasModelMismatch(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Re-embed all observations with the current model.
|
|
39
|
+
*/
|
|
40
|
+
reembed(batchSize?: number): Promise<number>;
|
|
41
|
+
private embed;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=vectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vectors.d.ts","sourceRoot":"","sources":["../../src/memory/vectors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAyDjD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAS;gBAEb,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc;IAU1D;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACG,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAe1D;;OAEG;IACG,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAejE;;;OAGG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAuCrE;;OAEG;IACH,gBAAgB,IAAI,OAAO;IAI3B;;OAEG;IACG,OAAO,CAAC,SAAS,SAAK,GAAG,OAAO,CAAC,MAAM,CAAC;YA8BhC,KAAK;CAUpB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KiroGraph Patterns — graph-level helpers for pattern match analysis.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Find all symbol node IDs that have pattern matches, along with caller nodes.
|
|
6
|
+
* Useful for "who calls code with SQL injection patterns?"
|
|
7
|
+
*/
|
|
8
|
+
export declare function findCallersOfPatternMatches(rawDb: any, patternIdFilter?: string): Array<{
|
|
9
|
+
symbolNodeId: string;
|
|
10
|
+
symbolName: string;
|
|
11
|
+
filePath: string;
|
|
12
|
+
patternId: string;
|
|
13
|
+
callerNodeId: string;
|
|
14
|
+
callerName: string;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/patterns/graph.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,GAAG,EACV,eAAe,CAAC,EAAE,MAAM,GACvB,KAAK,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAiBpI"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 graph_exports = {};
|
|
20
|
+
__export(graph_exports, {
|
|
21
|
+
findCallersOfPatternMatches: () => findCallersOfPatternMatches
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(graph_exports);
|
|
24
|
+
function findCallersOfPatternMatches(rawDb, patternIdFilter) {
|
|
25
|
+
const patternClause = patternIdFilter ? `AND pm.pattern_id LIKE ?` : "";
|
|
26
|
+
const params = patternIdFilter ? [`${patternIdFilter}%`] : [];
|
|
27
|
+
return rawDb.all(`
|
|
28
|
+
SELECT DISTINCT
|
|
29
|
+
pm.symbol_node_id, n.name as symbol_name, n.file_path,
|
|
30
|
+
pm.pattern_id,
|
|
31
|
+
e.source as caller_node_id, nc.name as caller_name
|
|
32
|
+
FROM pattern_matches pm
|
|
33
|
+
JOIN nodes n ON n.id = pm.symbol_node_id
|
|
34
|
+
JOIN edges e ON e.target = pm.symbol_node_id AND e.kind = 'calls'
|
|
35
|
+
JOIN nodes nc ON nc.id = e.source
|
|
36
|
+
WHERE pm.symbol_node_id IS NOT NULL
|
|
37
|
+
${patternClause}
|
|
38
|
+
LIMIT 100
|
|
39
|
+
`, params);
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
findCallersOfPatternMatches
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/patterns/graph.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph Patterns \u2014 graph-level helpers for pattern match analysis.\n */\n\n/**\n * Find all symbol node IDs that have pattern matches, along with caller nodes.\n * Useful for \"who calls code with SQL injection patterns?\"\n */\nexport function findCallersOfPatternMatches(\n rawDb: any,\n patternIdFilter?: string // e.g. 'sql-injection' prefix match\n): Array<{ symbolNodeId: string; symbolName: string; filePath: string; patternId: string; callerNodeId: string; callerName: string }> {\n const patternClause = patternIdFilter ? `AND pm.pattern_id LIKE ?` : '';\n const params: any[] = patternIdFilter ? [`${patternIdFilter}%`] : [];\n\n return rawDb.all(`\n SELECT DISTINCT\n pm.symbol_node_id, n.name as symbol_name, n.file_path,\n pm.pattern_id,\n e.source as caller_node_id, nc.name as caller_name\n FROM pattern_matches pm\n JOIN nodes n ON n.id = pm.symbol_node_id\n JOIN edges e ON e.target = pm.symbol_node_id AND e.kind = 'calls'\n JOIN nodes nc ON nc.id = e.source\n WHERE pm.symbol_node_id IS NOT NULL\n ${patternClause}\n LIMIT 100\n `, params);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,4BACd,OACA,iBACoI;AACpI,QAAM,gBAAgB,kBAAkB,6BAA6B;AACrE,QAAM,SAAgB,kBAAkB,CAAC,GAAG,eAAe,GAAG,IAAI,CAAC;AAEnE,SAAO,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAUb,aAAa;AAAA;AAAA,KAEd,MAAM;AACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 patterns_exports = {};
|
|
20
|
+
__export(patterns_exports, {
|
|
21
|
+
PatternLibraryLoader: () => import_loader.PatternLibraryLoader,
|
|
22
|
+
PatternMatch: () => import_types.PatternMatch,
|
|
23
|
+
PatternRule: () => import_types.PatternRule,
|
|
24
|
+
PatternRunner: () => import_runner.PatternRunner,
|
|
25
|
+
SEVERITY_ORDER: () => import_types.SEVERITY_ORDER
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(patterns_exports);
|
|
28
|
+
var import_types = require("./types");
|
|
29
|
+
var import_runner = require("./runner");
|
|
30
|
+
var import_loader = require("./loader");
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
PatternLibraryLoader,
|
|
34
|
+
PatternMatch,
|
|
35
|
+
PatternRule,
|
|
36
|
+
PatternRunner,
|
|
37
|
+
SEVERITY_ORDER
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/patterns/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { PatternRule, PatternMatch, SEVERITY_ORDER } from './types';\nexport { PatternRunner } from './runner';\nexport { PatternLibraryLoader } from './loader';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0D;AAC1D,oBAA8B;AAC9B,oBAAqC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KiroGraph PatternIndexer — indexes pattern matches into the patterns_matches table.
|
|
3
|
+
*/
|
|
4
|
+
import type { KiroGraphConfig } from '../config';
|
|
5
|
+
import { PatternRunner } from './runner';
|
|
6
|
+
import type { PatternRule } from './types';
|
|
7
|
+
export declare class PatternIndexer {
|
|
8
|
+
private readonly rawDb;
|
|
9
|
+
private readonly config;
|
|
10
|
+
private readonly projectRoot;
|
|
11
|
+
constructor(rawDb: any, config: KiroGraphConfig, projectRoot: string);
|
|
12
|
+
indexAll(onProgress?: (phase: string, current: number, total: number) => void): Promise<void>;
|
|
13
|
+
indexFile(filePath: string, language: string, rules: PatternRule[], runner: PatternRunner, threshold: string, now: number): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=indexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/patterns/indexer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM;IAM9D,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B7F,SAAS,CACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,WAAW,EAAE,EACpB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC;CA8BjB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 indexer_exports = {};
|
|
30
|
+
__export(indexer_exports, {
|
|
31
|
+
PatternIndexer: () => PatternIndexer
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(indexer_exports);
|
|
34
|
+
var fs = __toESM(require("fs"));
|
|
35
|
+
var path = __toESM(require("path"));
|
|
36
|
+
var import_loader = require("./loader");
|
|
37
|
+
var import_runner = require("./runner");
|
|
38
|
+
var import_errors = require("../errors");
|
|
39
|
+
class PatternIndexer {
|
|
40
|
+
constructor(rawDb, config, projectRoot) {
|
|
41
|
+
this.rawDb = rawDb;
|
|
42
|
+
this.config = config;
|
|
43
|
+
this.projectRoot = projectRoot;
|
|
44
|
+
}
|
|
45
|
+
async indexAll(onProgress) {
|
|
46
|
+
const runner = new import_runner.PatternRunner();
|
|
47
|
+
if (!runner.isAvailable()) {
|
|
48
|
+
(0, import_errors.logWarn)("[patterns] @ast-grep/napi not installed \u2014 skipping pattern indexing. Run: npm install @ast-grep/napi");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const loader = new import_loader.PatternLibraryLoader();
|
|
52
|
+
const builtinPath = path.join(__dirname, "../patterns/library");
|
|
53
|
+
const customPath = this.config.patternLibraryPath;
|
|
54
|
+
const rules = loader.load(builtinPath, customPath);
|
|
55
|
+
const threshold = this.config.patternSeverityThreshold ?? "low";
|
|
56
|
+
const files = this.rawDb.all(
|
|
57
|
+
"SELECT path, language FROM files WHERE language != ? AND language != ?",
|
|
58
|
+
["unknown", "jupyter"]
|
|
59
|
+
);
|
|
60
|
+
const now = Date.now();
|
|
61
|
+
let processed = 0;
|
|
62
|
+
for (const file of files) {
|
|
63
|
+
onProgress?.("patterns", processed, files.length);
|
|
64
|
+
await this.indexFile(file.path, file.language, rules, runner, threshold, now);
|
|
65
|
+
processed++;
|
|
66
|
+
}
|
|
67
|
+
onProgress?.("patterns", files.length, files.length);
|
|
68
|
+
}
|
|
69
|
+
async indexFile(filePath, language, rules, runner, threshold, now) {
|
|
70
|
+
let content;
|
|
71
|
+
const absPath = path.isAbsolute(filePath) ? filePath : path.join(this.projectRoot, filePath);
|
|
72
|
+
try {
|
|
73
|
+
content = fs.readFileSync(absPath, "utf8");
|
|
74
|
+
} catch {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
this.rawDb.run("DELETE FROM pattern_matches WHERE file_path = ?", [filePath]);
|
|
78
|
+
const matches = await runner.runAllRules(rules, content, language, threshold);
|
|
79
|
+
for (const m of matches) {
|
|
80
|
+
const symbolRow = this.rawDb.get(
|
|
81
|
+
`SELECT id FROM nodes WHERE file_path = ? AND start_line <= ? AND end_line >= ? AND kind IN ('function','method','class') ORDER BY (end_line - start_line) ASC LIMIT 1`,
|
|
82
|
+
[m.filePath || filePath, m.line, m.line]
|
|
83
|
+
);
|
|
84
|
+
const symbolNodeId = symbolRow?.id ?? null;
|
|
85
|
+
this.rawDb.run(
|
|
86
|
+
`INSERT INTO pattern_matches (file_path, pattern_id, line, col, match_text, severity, owasp_category, language, indexed_at, symbol_node_id)
|
|
87
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
88
|
+
[filePath, m.patternId, m.line, m.col, m.matchText.slice(0, 500), m.severity, m.owaspCategory, language, now, symbolNodeId]
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
PatternIndexer
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=indexer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/patterns/indexer.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph PatternIndexer \u2014 indexes pattern matches into the patterns_matches table.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { KiroGraphConfig } from '../config';\nimport { PatternLibraryLoader } from './loader';\nimport { PatternRunner } from './runner';\nimport type { PatternRule } from './types';\nimport { logWarn } from '../errors';\n\nexport class PatternIndexer {\n private readonly rawDb: any;\n private readonly config: KiroGraphConfig;\n private readonly projectRoot: string;\n\n constructor(rawDb: any, config: KiroGraphConfig, projectRoot: string) {\n this.rawDb = rawDb;\n this.config = config;\n this.projectRoot = projectRoot;\n }\n\n async indexAll(onProgress?: (phase: string, current: number, total: number) => void): Promise<void> {\n const runner = new PatternRunner();\n if (!runner.isAvailable()) {\n logWarn('[patterns] @ast-grep/napi not installed \u2014 skipping pattern indexing. Run: npm install @ast-grep/napi');\n return;\n }\n\n const loader = new PatternLibraryLoader();\n const builtinPath = path.join(__dirname, '../patterns/library');\n const customPath = (this.config as any).patternLibraryPath;\n const rules = loader.load(builtinPath, customPath);\n const threshold = (this.config as any).patternSeverityThreshold ?? 'low';\n\n const files: Array<{ path: string; language: string }> = this.rawDb.all(\n 'SELECT path, language FROM files WHERE language != ? AND language != ?',\n ['unknown', 'jupyter']\n );\n\n const now = Date.now();\n let processed = 0;\n\n for (const file of files) {\n onProgress?.('patterns', processed, files.length);\n await this.indexFile(file.path, file.language, rules, runner, threshold, now);\n processed++;\n }\n onProgress?.('patterns', files.length, files.length);\n }\n\n async indexFile(\n filePath: string,\n language: string,\n rules: PatternRule[],\n runner: PatternRunner,\n threshold: string,\n now: number,\n ): Promise<void> {\n let content: string;\n const absPath = path.isAbsolute(filePath)\n ? filePath\n : path.join(this.projectRoot, filePath);\n try {\n content = fs.readFileSync(absPath, 'utf8');\n } catch {\n return; // file deleted between index and now\n }\n\n // Delete existing matches for this file\n this.rawDb.run('DELETE FROM pattern_matches WHERE file_path = ?', [filePath]);\n\n const matches = await runner.runAllRules(rules, content, language, threshold as any);\n\n for (const m of matches) {\n const symbolRow = this.rawDb.get(\n `SELECT id FROM nodes WHERE file_path = ? AND start_line <= ? AND end_line >= ? AND kind IN ('function','method','class') ORDER BY (end_line - start_line) ASC LIMIT 1`,\n [m.filePath || filePath, m.line, m.line]\n ) as { id: string } | undefined;\n const symbolNodeId = symbolRow?.id ?? null;\n\n this.rawDb.run(\n `INSERT INTO pattern_matches (file_path, pattern_id, line, col, match_text, severity, owasp_category, language, indexed_at, symbol_node_id)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,\n [filePath, m.patternId, m.line, m.col, m.matchText.slice(0, 500), m.severity, m.owaspCategory, language, now, symbolNodeId]\n );\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AAEtB,oBAAqC;AACrC,oBAA8B;AAE9B,oBAAwB;AAEjB,MAAM,eAAe;AAAA,EAK1B,YAAY,OAAY,QAAyB,aAAqB;AACpE,SAAK,QAAQ;AACb,SAAK,SAAS;AACd,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,MAAM,SAAS,YAAqF;AAClG,UAAM,SAAS,IAAI,4BAAc;AACjC,QAAI,CAAC,OAAO,YAAY,GAAG;AACzB,iCAAQ,2GAAsG;AAC9G;AAAA,IACF;AAEA,UAAM,SAAS,IAAI,mCAAqB;AACxC,UAAM,cAAc,KAAK,KAAK,WAAW,qBAAqB;AAC9D,UAAM,aAAc,KAAK,OAAe;AACxC,UAAM,QAAQ,OAAO,KAAK,aAAa,UAAU;AACjD,UAAM,YAAa,KAAK,OAAe,4BAA4B;AAEnE,UAAM,QAAmD,KAAK,MAAM;AAAA,MAClE;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AAEA,UAAM,MAAM,KAAK,IAAI;AACrB,QAAI,YAAY;AAEhB,eAAW,QAAQ,OAAO;AACxB,mBAAa,YAAY,WAAW,MAAM,MAAM;AAChD,YAAM,KAAK,UAAU,KAAK,MAAM,KAAK,UAAU,OAAO,QAAQ,WAAW,GAAG;AAC5E;AAAA,IACF;AACA,iBAAa,YAAY,MAAM,QAAQ,MAAM,MAAM;AAAA,EACrD;AAAA,EAEA,MAAM,UACJ,UACA,UACA,OACA,QACA,WACA,KACe;AACf,QAAI;AACJ,UAAM,UAAU,KAAK,WAAW,QAAQ,IACpC,WACA,KAAK,KAAK,KAAK,aAAa,QAAQ;AACxC,QAAI;AACF,gBAAU,GAAG,aAAa,SAAS,MAAM;AAAA,IAC3C,QAAQ;AACN;AAAA,IACF;AAGA,SAAK,MAAM,IAAI,mDAAmD,CAAC,QAAQ,CAAC;AAE5E,UAAM,UAAU,MAAM,OAAO,YAAY,OAAO,SAAS,UAAU,SAAgB;AAEnF,eAAW,KAAK,SAAS;AACvB,YAAM,YAAY,KAAK,MAAM;AAAA,QAC3B;AAAA,QACA,CAAC,EAAE,YAAY,UAAU,EAAE,MAAM,EAAE,IAAI;AAAA,MACzC;AACA,YAAM,eAAe,WAAW,MAAM;AAEtC,WAAK,MAAM;AAAA,QACT;AAAA;AAAA,QAEA,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,MAAM,GAAG,GAAG,GAAG,EAAE,UAAU,EAAE,eAAe,UAAU,KAAK,YAAY;AAAA,MAC5H;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: code-eval-elixir
|
|
2
|
+
language: elixir
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: Code.eval_string() executes arbitrary Elixir code — code injection vector
|
|
6
|
+
fixHint: Remove Code.eval_string/eval_quoted; use pattern matching or a restricted DSL instead. Never evaluate user-controlled strings.
|
|
7
|
+
rule:
|
|
8
|
+
kind: call
|
|
9
|
+
has:
|
|
10
|
+
kind: dot
|
|
11
|
+
regex: '^Code\.eval_string'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: command-injection-c
|
|
2
|
+
language: [c, cpp]
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: system() or popen() with a variable argument — command injection vector
|
|
6
|
+
fixHint: Avoid system()/popen(); use execv/execvp with an array of fixed arguments. Validate all inputs.
|
|
7
|
+
rule:
|
|
8
|
+
kind: call_expression
|
|
9
|
+
has:
|
|
10
|
+
kind: identifier
|
|
11
|
+
regex: '^(system|popen)$'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
id: command-injection-go
|
|
2
|
+
language: go
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: exec.Command() with string concatenation — command injection vector
|
|
6
|
+
fixHint: Use exec.Command() with separate arguments (never shell=true). Validate all inputs.
|
|
7
|
+
rule:
|
|
8
|
+
any:
|
|
9
|
+
- kind: call_expression
|
|
10
|
+
all:
|
|
11
|
+
- has:
|
|
12
|
+
kind: selector_expression
|
|
13
|
+
regex: '^exec\.Command$'
|
|
14
|
+
- has:
|
|
15
|
+
kind: argument_list
|
|
16
|
+
has:
|
|
17
|
+
kind: binary_expression
|
|
18
|
+
- kind: call_expression
|
|
19
|
+
all:
|
|
20
|
+
- has:
|
|
21
|
+
kind: selector_expression
|
|
22
|
+
regex: '^exec\.Command$'
|
|
23
|
+
- has:
|
|
24
|
+
kind: argument_list
|
|
25
|
+
has:
|
|
26
|
+
kind: call_expression
|
|
27
|
+
has:
|
|
28
|
+
kind: selector_expression
|
|
29
|
+
regex: '^fmt\.Sprintf$'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
id: command-injection-kotlin
|
|
2
|
+
language: kotlin
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: Runtime.exec() or ProcessBuilder — command injection vector if arguments are user-controlled
|
|
6
|
+
fixHint: Pass a fixed executable and a validated argument array. Never build command strings from user input.
|
|
7
|
+
rule:
|
|
8
|
+
any:
|
|
9
|
+
- pattern: Runtime.getRuntime().exec($CMD)
|
|
10
|
+
- pattern: ProcessBuilder($CMD).start()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: command-injection-php
|
|
2
|
+
language: php
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: system()/exec()/shell_exec()/passthru() — command injection vector
|
|
6
|
+
fixHint: Use escapeshellarg() on every argument, or replace with a native PHP library that avoids shell invocation entirely.
|
|
7
|
+
rule:
|
|
8
|
+
kind: function_call_expression
|
|
9
|
+
has:
|
|
10
|
+
kind: name
|
|
11
|
+
regex: '^(system|exec|shell_exec|passthru|popen|proc_open)$'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: command-injection-ruby
|
|
2
|
+
language: ruby
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: system()/exec()/spawn() with variable argument — command injection vector
|
|
6
|
+
fixHint: Pass an array of fixed arguments to system/exec to disable shell interpretation. Validate all user input.
|
|
7
|
+
rule:
|
|
8
|
+
kind: call
|
|
9
|
+
has:
|
|
10
|
+
kind: identifier
|
|
11
|
+
regex: '^(system|exec|spawn)$'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: command-injection-rust
|
|
2
|
+
language: rust
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: std::process::Command built with a variable argument — command injection vector
|
|
6
|
+
fixHint: Pass a fixed executable path and validate each argument individually. Never construct commands from user input.
|
|
7
|
+
rule:
|
|
8
|
+
kind: call_expression
|
|
9
|
+
has:
|
|
10
|
+
kind: scoped_identifier
|
|
11
|
+
regex: 'Command::new'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: dangerous-eval-bash
|
|
2
|
+
language: bash
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: eval command executes arbitrary shell code — command injection vector
|
|
6
|
+
fixHint: Remove eval; use explicit variable assignments and function calls. Never evaluate user-controlled strings.
|
|
7
|
+
rule:
|
|
8
|
+
kind: command
|
|
9
|
+
has:
|
|
10
|
+
kind: command_name
|
|
11
|
+
regex: '^eval$'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
id: dangerous-eval-js
|
|
2
|
+
language: [javascript, typescript]
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: eval() with a non-literal argument enables arbitrary code execution
|
|
6
|
+
fixHint: Remove eval(). Use JSON.parse() for data, structured dispatch for dynamic behavior.
|
|
7
|
+
# Only safe if $ARG is JSON data; for dynamic dispatch use a lookup table instead
|
|
8
|
+
fix: "JSON.parse($ARG)"
|
|
9
|
+
rule:
|
|
10
|
+
pattern: eval($ARG)
|
|
11
|
+
not:
|
|
12
|
+
has:
|
|
13
|
+
kind: string
|
|
14
|
+
nthChild: 1
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: dangerous-eval-php
|
|
2
|
+
language: php
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: eval() executes arbitrary PHP code — code injection vector
|
|
6
|
+
fixHint: Remove eval(); parse data with json_decode() or use explicit logic. Never evaluate user-supplied strings.
|
|
7
|
+
rule:
|
|
8
|
+
kind: function_call_expression
|
|
9
|
+
has:
|
|
10
|
+
kind: name
|
|
11
|
+
regex: '^eval$'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: dangerous-eval-ruby
|
|
2
|
+
language: ruby
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: eval() executes arbitrary Ruby code — code injection vector
|
|
6
|
+
fixHint: Remove eval(); use a safe parser (e.g. JSON.parse, Integer()) or explicit case/when logic instead.
|
|
7
|
+
rule:
|
|
8
|
+
kind: call
|
|
9
|
+
has:
|
|
10
|
+
kind: identifier
|
|
11
|
+
regex: '^eval$'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
id: dangerous-exec-py
|
|
2
|
+
language: python
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: os.system() or subprocess with shell=True enables command injection
|
|
6
|
+
fixHint: Use subprocess.run() with a list of arguments and shell=False. Validate all inputs.
|
|
7
|
+
fix: "subprocess.run([$CMD], shell=False, check=True)"
|
|
8
|
+
rule:
|
|
9
|
+
any:
|
|
10
|
+
- pattern: os.system($CMD)
|
|
11
|
+
- pattern: subprocess.call($CMD, shell=True)
|
|
12
|
+
- pattern: subprocess.run($CMD, shell=True)
|
|
13
|
+
- pattern: subprocess.Popen($CMD, shell=True)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
id: dangerous-reflection-java
|
|
2
|
+
language: java
|
|
3
|
+
severity: high
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: Class.forName() with user-controlled input enables arbitrary class loading
|
|
6
|
+
fixHint: Validate the class name against an allowlist before using reflection. Never use user input directly.
|
|
7
|
+
rule:
|
|
8
|
+
pattern: Class.forName($CLASS)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
id: dynamic-load-lua
|
|
2
|
+
language: lua
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: load()/loadstring() executes arbitrary Lua code — code injection vector
|
|
6
|
+
fixHint: Remove dynamic code loading; use explicit functions or a restricted sandbox. Never evaluate user-controlled strings.
|
|
7
|
+
rule:
|
|
8
|
+
any:
|
|
9
|
+
- pattern: load($CODE)()
|
|
10
|
+
- pattern: loadstring($CODE)()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
id: os-cmd-elixir
|
|
2
|
+
language: elixir
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: ':os.cmd() or System.cmd() with a variable argument — command injection vector'
|
|
6
|
+
fixHint: "Use System.cmd/2 with a fixed executable and a list of validated arguments. Never interpolate user input into shell strings."
|
|
7
|
+
rule:
|
|
8
|
+
any:
|
|
9
|
+
- kind: call
|
|
10
|
+
has:
|
|
11
|
+
kind: dot
|
|
12
|
+
regex: '^:os\.cmd'
|
|
13
|
+
- kind: call
|
|
14
|
+
has:
|
|
15
|
+
kind: dot
|
|
16
|
+
regex: '^System\.cmd'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
id: os-execute-lua
|
|
2
|
+
language: lua
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: os.execute() or io.popen() with a variable argument — command injection vector
|
|
6
|
+
fixHint: Avoid shell execution; use Lua native I/O functions. If unavoidable, validate and escape all arguments.
|
|
7
|
+
rule:
|
|
8
|
+
any:
|
|
9
|
+
- pattern: os.execute($CMD)
|
|
10
|
+
- pattern: io.popen($CMD)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: path-traversal-go
|
|
2
|
+
language: go
|
|
3
|
+
severity: high
|
|
4
|
+
owaspCategory: A01
|
|
5
|
+
description: os.Open() or ioutil.ReadFile() with user-controlled path — path traversal vector
|
|
6
|
+
fixHint: Use filepath.Clean() and verify the result is within an allowed base directory.
|
|
7
|
+
rule:
|
|
8
|
+
kind: call_expression
|
|
9
|
+
has:
|
|
10
|
+
kind: selector_expression
|
|
11
|
+
regex: '^(os\.Open|ioutil\.ReadFile|os\.ReadFile)$'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
id: path-traversal-py
|
|
2
|
+
language: python
|
|
3
|
+
severity: high
|
|
4
|
+
owaspCategory: A01
|
|
5
|
+
description: File open with path from request or user input — path traversal vector
|
|
6
|
+
fixHint: Use os.path.realpath() and verify the result is under an allowed base directory.
|
|
7
|
+
fix: "open(os.path.join(allowed_base, os.path.basename(request.$PROP)))"
|
|
8
|
+
rule:
|
|
9
|
+
any:
|
|
10
|
+
- pattern: open(request.$PROP)
|
|
11
|
+
- pattern: open(request.args[$KEY])
|
|
12
|
+
- pattern: open(request.form[$KEY])
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
id: path-traversal-readfile-js
|
|
2
|
+
language: [javascript, typescript]
|
|
3
|
+
severity: high
|
|
4
|
+
owaspCategory: A01
|
|
5
|
+
description: File operation with path from request parameter — path traversal vector
|
|
6
|
+
fixHint: Use path.resolve() and verify the result starts with an allowed base directory. Reject paths containing '..'.
|
|
7
|
+
fix: "/* validate path: use path.resolve() and check it starts with allowedBase */"
|
|
8
|
+
rule:
|
|
9
|
+
any:
|
|
10
|
+
- pattern: fs.readFile(req.$PROP, $$$)
|
|
11
|
+
- pattern: fs.readFileSync(req.$PROP, $$$)
|
|
12
|
+
- pattern: fs.createReadStream(req.$PROP, $$$)
|
|
13
|
+
- pattern: fs.open(req.$PROP, $$$)
|
|
14
|
+
- pattern: fs.openSync(req.$PROP, $$$)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id: process-launch-swift
|
|
2
|
+
language: swift
|
|
3
|
+
severity: critical
|
|
4
|
+
owaspCategory: A03
|
|
5
|
+
description: Process.launch() — command injection vector if launchPath or arguments are user-controlled
|
|
6
|
+
fixHint: Validate executableURL and all arguments against an allowlist before calling run(). Never set launchPath from user input.
|
|
7
|
+
rule:
|
|
8
|
+
kind: call_expression
|
|
9
|
+
has:
|
|
10
|
+
kind: navigation_expression
|
|
11
|
+
regex: '\.launch$'
|