driftdetect-core 0.5.0 → 0.6.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/dist/boundaries/types.d.ts +1 -1
- package/dist/boundaries/types.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.js +1 -0
- package/dist/call-graph/analysis/graph-builder.js.map +1 -1
- package/dist/call-graph/extractors/go-data-access-extractor.d.ts +80 -0
- package/dist/call-graph/extractors/go-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js +457 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-extractor.d.ts +103 -0
- package/dist/call-graph/extractors/go-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-extractor.js +509 -0
- package/dist/call-graph/extractors/go-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts +97 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.js +496 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/go-regex.d.ts +51 -0
- package/dist/call-graph/extractors/regex/go-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/go-regex.js +435 -0
- package/dist/call-graph/extractors/regex/go-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts.map +1 -1
- package/dist/call-graph/extractors/regex/index.js +8 -0
- package/dist/call-graph/extractors/regex/index.js.map +1 -1
- package/dist/call-graph/index.d.ts +3 -0
- package/dist/call-graph/index.d.ts.map +1 -1
- package/dist/call-graph/index.js +5 -0
- package/dist/call-graph/index.js.map +1 -1
- package/dist/call-graph/types.d.ts +1 -1
- package/dist/call-graph/types.d.ts.map +1 -1
- package/dist/constraints/extraction/constraint-synthesizer.d.ts +72 -0
- package/dist/constraints/extraction/constraint-synthesizer.d.ts.map +1 -0
- package/dist/constraints/extraction/constraint-synthesizer.js +336 -0
- package/dist/constraints/extraction/constraint-synthesizer.js.map +1 -0
- package/dist/constraints/extraction/index.d.ts +10 -0
- package/dist/constraints/extraction/index.d.ts.map +1 -0
- package/dist/constraints/extraction/index.js +10 -0
- package/dist/constraints/extraction/index.js.map +1 -0
- package/dist/constraints/extraction/invariant-detector.d.ts +109 -0
- package/dist/constraints/extraction/invariant-detector.d.ts.map +1 -0
- package/dist/constraints/extraction/invariant-detector.js +979 -0
- package/dist/constraints/extraction/invariant-detector.js.map +1 -0
- package/dist/constraints/index.d.ts +15 -0
- package/dist/constraints/index.d.ts.map +1 -0
- package/dist/constraints/index.js +16 -0
- package/dist/constraints/index.js.map +1 -0
- package/dist/constraints/store/constraint-store.d.ts +110 -0
- package/dist/constraints/store/constraint-store.d.ts.map +1 -0
- package/dist/constraints/store/constraint-store.js +584 -0
- package/dist/constraints/store/constraint-store.js.map +1 -0
- package/dist/constraints/types.d.ts +605 -0
- package/dist/constraints/types.d.ts.map +1 -0
- package/dist/constraints/types.js +57 -0
- package/dist/constraints/types.js.map +1 -0
- package/dist/constraints/verification/constraint-verifier.d.ts +100 -0
- package/dist/constraints/verification/constraint-verifier.d.ts.map +1 -0
- package/dist/constraints/verification/constraint-verifier.js +638 -0
- package/dist/constraints/verification/constraint-verifier.js.map +1 -0
- package/dist/constraints/verification/index.d.ts +8 -0
- package/dist/constraints/verification/index.d.ts.map +1 -0
- package/dist/constraints/verification/index.js +8 -0
- package/dist/constraints/verification/index.js.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts +121 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js +904 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js.map +1 -0
- package/dist/decisions/analyzer/index.d.ts +5 -0
- package/dist/decisions/analyzer/index.d.ts.map +1 -0
- package/dist/decisions/analyzer/index.js +5 -0
- package/dist/decisions/analyzer/index.js.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts +104 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.js +305 -0
- package/dist/decisions/extractors/base-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js +281 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/index.d.ts +31 -0
- package/dist/decisions/extractors/index.d.ts.map +1 -0
- package/dist/decisions/extractors/index.js +63 -0
- package/dist/decisions/extractors/index.js.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.js +248 -0
- package/dist/decisions/extractors/java-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.js +280 -0
- package/dist/decisions/extractors/php-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.js +248 -0
- package/dist/decisions/extractors/python-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts +37 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js +229 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js.map +1 -0
- package/dist/decisions/git/commit-parser.d.ts +58 -0
- package/dist/decisions/git/commit-parser.d.ts.map +1 -0
- package/dist/decisions/git/commit-parser.js +344 -0
- package/dist/decisions/git/commit-parser.js.map +1 -0
- package/dist/decisions/git/diff-analyzer.d.ts +30 -0
- package/dist/decisions/git/diff-analyzer.d.ts.map +1 -0
- package/dist/decisions/git/diff-analyzer.js +492 -0
- package/dist/decisions/git/diff-analyzer.js.map +1 -0
- package/dist/decisions/git/git-walker.d.ts +64 -0
- package/dist/decisions/git/git-walker.d.ts.map +1 -0
- package/dist/decisions/git/git-walker.js +441 -0
- package/dist/decisions/git/git-walker.js.map +1 -0
- package/dist/decisions/git/index.d.ts +11 -0
- package/dist/decisions/git/index.d.ts.map +1 -0
- package/dist/decisions/git/index.js +13 -0
- package/dist/decisions/git/index.js.map +1 -0
- package/dist/decisions/git/types.d.ts +223 -0
- package/dist/decisions/git/types.d.ts.map +1 -0
- package/dist/decisions/git/types.js +7 -0
- package/dist/decisions/git/types.js.map +1 -0
- package/dist/decisions/index.d.ts +27 -0
- package/dist/decisions/index.d.ts.map +1 -0
- package/dist/decisions/index.js +45 -0
- package/dist/decisions/index.js.map +1 -0
- package/dist/decisions/types.d.ts +530 -0
- package/dist/decisions/types.d.ts.map +1 -0
- package/dist/decisions/types.js +8 -0
- package/dist/decisions/types.js.map +1 -0
- package/dist/go/go-analyzer.d.ts +203 -0
- package/dist/go/go-analyzer.d.ts.map +1 -0
- package/dist/go/go-analyzer.js +509 -0
- package/dist/go/go-analyzer.js.map +1 -0
- package/dist/go/index.d.ts +7 -0
- package/dist/go/index.d.ts.map +1 -0
- package/dist/go/index.js +8 -0
- package/dist/go/index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -1
- package/dist/parsers/tree-sitter/go-loader.d.ts +50 -0
- package/dist/parsers/tree-sitter/go-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/go-loader.js +161 -0
- package/dist/parsers/tree-sitter/go-loader.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts +250 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js +707 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js.map +1 -0
- package/dist/parsers/types.d.ts +1 -1
- package/dist/parsers/types.d.ts.map +1 -1
- package/dist/simulation/approach-generator.d.ts +73 -0
- package/dist/simulation/approach-generator.d.ts.map +1 -0
- package/dist/simulation/approach-generator.js +371 -0
- package/dist/simulation/approach-generator.js.map +1 -0
- package/dist/simulation/index.d.ts +14 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +19 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.js +118 -0
- package/dist/simulation/language-strategies/csharp-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/index.d.ts +41 -0
- package/dist/simulation/language-strategies/index.d.ts.map +1 -0
- package/dist/simulation/language-strategies/index.js +92 -0
- package/dist/simulation/language-strategies/index.js.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.js +119 -0
- package/dist/simulation/language-strategies/java-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.js +129 -0
- package/dist/simulation/language-strategies/php-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.js +208 -0
- package/dist/simulation/language-strategies/python-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/types.d.ts +67 -0
- package/dist/simulation/language-strategies/types.d.ts.map +1 -0
- package/dist/simulation/language-strategies/types.js +23 -0
- package/dist/simulation/language-strategies/types.js.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.js +251 -0
- package/dist/simulation/language-strategies/typescript-strategies.js.map +1 -0
- package/dist/simulation/scorers/friction-scorer.d.ts +45 -0
- package/dist/simulation/scorers/friction-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/friction-scorer.js +336 -0
- package/dist/simulation/scorers/friction-scorer.js.map +1 -0
- package/dist/simulation/scorers/impact-scorer.d.ts +56 -0
- package/dist/simulation/scorers/impact-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/impact-scorer.js +273 -0
- package/dist/simulation/scorers/impact-scorer.js.map +1 -0
- package/dist/simulation/scorers/index.d.ts +12 -0
- package/dist/simulation/scorers/index.d.ts.map +1 -0
- package/dist/simulation/scorers/index.js +12 -0
- package/dist/simulation/scorers/index.js.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts +83 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js +367 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js.map +1 -0
- package/dist/simulation/scorers/security-scorer.d.ts +63 -0
- package/dist/simulation/scorers/security-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/security-scorer.js +346 -0
- package/dist/simulation/scorers/security-scorer.js.map +1 -0
- package/dist/simulation/simulation-engine.d.ts +89 -0
- package/dist/simulation/simulation-engine.d.ts.map +1 -0
- package/dist/simulation/simulation-engine.js +480 -0
- package/dist/simulation/simulation-engine.js.map +1 -0
- package/dist/simulation/types.d.ts +200 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +23 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/speculative/approach-generator.d.ts +2 -0
- package/dist/speculative/approach-generator.d.ts.map +1 -0
- package/dist/speculative/approach-generator.js +2 -0
- package/dist/speculative/approach-generator.js.map +1 -0
- package/dist/speculative/templates/types.d.ts +133 -0
- package/dist/speculative/templates/types.d.ts.map +1 -0
- package/dist/speculative/templates/types.js +208 -0
- package/dist/speculative/templates/types.js.map +1 -0
- package/dist/speculative/types.d.ts +523 -0
- package/dist/speculative/types.d.ts.map +1 -0
- package/dist/speculative/types.js +71 -0
- package/dist/speculative/types.js.map +1 -0
- package/dist/test-topology/extractors/base-test-extractor.d.ts +1 -1
- package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -1
- package/dist/test-topology/extractors/base-test-extractor.js.map +1 -1
- package/dist/test-topology/extractors/go-test-extractor.d.ts +33 -0
- package/dist/test-topology/extractors/go-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/go-test-extractor.js +436 -0
- package/dist/test-topology/extractors/go-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/index.d.ts +1 -0
- package/dist/test-topology/extractors/index.d.ts.map +1 -1
- package/dist/test-topology/extractors/index.js +1 -0
- package/dist/test-topology/extractors/index.js.map +1 -1
- package/dist/test-topology/extractors/regex/go-test-regex.d.ts +62 -0
- package/dist/test-topology/extractors/regex/go-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js +528 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts.map +1 -1
- package/dist/test-topology/extractors/regex/index.js +4 -0
- package/dist/test-topology/extractors/regex/index.js.map +1 -1
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -1
- package/dist/test-topology/hybrid-test-topology-analyzer.js +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -1
- package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -1
- package/dist/test-topology/test-topology-analyzer.js +1 -0
- package/dist/test-topology/test-topology-analyzer.js.map +1 -1
- package/dist/test-topology/types.d.ts +2 -2
- package/dist/test-topology/types.d.ts.map +1 -1
- package/dist/unified-provider/matching/database-sql-matcher.d.ts +42 -0
- package/dist/unified-provider/matching/database-sql-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/database-sql-matcher.js +282 -0
- package/dist/unified-provider/matching/database-sql-matcher.js.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts +41 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.js +222 -0
- package/dist/unified-provider/matching/gorm-matcher.js.map +1 -0
- package/dist/unified-provider/matching/index.d.ts +3 -0
- package/dist/unified-provider/matching/index.d.ts.map +1 -1
- package/dist/unified-provider/matching/index.js +4 -0
- package/dist/unified-provider/matching/index.js.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.js +7 -0
- package/dist/unified-provider/matching/matcher-registry.js.map +1 -1
- package/dist/unified-provider/matching/sqlx-matcher.d.ts +40 -0
- package/dist/unified-provider/matching/sqlx-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/sqlx-matcher.js +214 -0
- package/dist/unified-provider/matching/sqlx-matcher.js.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts +62 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.js +608 -0
- package/dist/unified-provider/normalization/go-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/index.d.ts +1 -0
- package/dist/unified-provider/normalization/index.d.ts.map +1 -1
- package/dist/unified-provider/normalization/index.js +6 -1
- package/dist/unified-provider/normalization/index.js.map +1 -1
- package/dist/unified-provider/types.d.ts +1 -1
- package/dist/unified-provider/types.d.ts.map +1 -1
- package/dist/wpf/extractors/binding-error-detector.d.ts +75 -0
- package/dist/wpf/extractors/binding-error-detector.d.ts.map +1 -0
- package/dist/wpf/extractors/binding-error-detector.js +290 -0
- package/dist/wpf/extractors/binding-error-detector.js.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts +70 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.js +172 -0
- package/dist/wpf/extractors/code-behind-linker.js.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts +61 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.js +201 -0
- package/dist/wpf/extractors/dependency-property-extractor.js.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts +82 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js +412 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts +77 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.js +353 -0
- package/dist/wpf/extractors/regex/xaml-regex.js.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts +103 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js +296 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts +128 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.js +312 -0
- package/dist/wpf/extractors/value-converter-extractor.js.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts +104 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js +513 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts +98 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js +444 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js.map +1 -0
- package/dist/wpf/index.d.ts +25 -0
- package/dist/wpf/index.d.ts.map +1 -0
- package/dist/wpf/index.js +31 -0
- package/dist/wpf/index.js.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts +82 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js +311 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts +129 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js +367 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts +66 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.js +240 -0
- package/dist/wpf/linkers/datacontext-resolver.js.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts +71 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.js +268 -0
- package/dist/wpf/linkers/viewmodel-linker.js.map +1 -0
- package/dist/wpf/types.d.ts +451 -0
- package/dist/wpf/types.d.ts.map +1 -0
- package/dist/wpf/types.js +8 -0
- package/dist/wpf/types.js.map +1 -0
- package/dist/wpf/wpf-analyzer.d.ts +114 -0
- package/dist/wpf/wpf-analyzer.d.ts.map +1 -0
- package/dist/wpf/wpf-analyzer.js +332 -0
- package/dist/wpf/wpf-analyzer.js.map +1 -0
- package/dist/wrappers/integration/adapter.d.ts.map +1 -1
- package/dist/wrappers/integration/adapter.js +1 -0
- package/dist/wrappers/integration/adapter.js.map +1 -1
- package/package.json +29 -18
- package/LICENSE +0 -21
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scorer
|
|
3
|
+
*
|
|
4
|
+
* Calculates security metrics for an approach using reachability analysis:
|
|
5
|
+
* - Security risk score
|
|
6
|
+
* - Data access implications
|
|
7
|
+
* - Auth implications
|
|
8
|
+
* - Security warnings
|
|
9
|
+
*
|
|
10
|
+
* @module simulation/scorers/security-scorer
|
|
11
|
+
*/
|
|
12
|
+
import { ReachabilityEngine } from '../../call-graph/analysis/reachability.js';
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Security Scorer
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Scores the security implications of an approach
|
|
18
|
+
*/
|
|
19
|
+
export class SecurityScorer {
|
|
20
|
+
config;
|
|
21
|
+
reachabilityEngine = null;
|
|
22
|
+
constructor(config) {
|
|
23
|
+
this.config = config;
|
|
24
|
+
if (config.callGraph) {
|
|
25
|
+
this.reachabilityEngine = new ReachabilityEngine(config.callGraph);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Calculate security metrics for an approach
|
|
30
|
+
*/
|
|
31
|
+
async score(approach) {
|
|
32
|
+
// If no call graph, estimate from approach metadata
|
|
33
|
+
if (!this.reachabilityEngine || !this.config.callGraph) {
|
|
34
|
+
return this.estimateSecurity(approach);
|
|
35
|
+
}
|
|
36
|
+
// Analyze data access implications
|
|
37
|
+
const dataAccessImplications = this.analyzeDataAccess(approach);
|
|
38
|
+
// Analyze auth implications
|
|
39
|
+
const authImplications = this.analyzeAuthImplications(approach);
|
|
40
|
+
// Generate security warnings
|
|
41
|
+
const warnings = this.generateWarnings(approach, dataAccessImplications, authImplications);
|
|
42
|
+
// Calculate security risk score
|
|
43
|
+
const securityRisk = this.calculateSecurityRisk(dataAccessImplications, authImplications, warnings);
|
|
44
|
+
return {
|
|
45
|
+
securityRisk,
|
|
46
|
+
dataAccessImplications,
|
|
47
|
+
authImplications,
|
|
48
|
+
warnings,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// ==========================================================================
|
|
52
|
+
// Data Access Analysis
|
|
53
|
+
// ==========================================================================
|
|
54
|
+
/**
|
|
55
|
+
* Analyze data access implications of the approach
|
|
56
|
+
*/
|
|
57
|
+
analyzeDataAccess(approach) {
|
|
58
|
+
if (!this.reachabilityEngine) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
const implications = [];
|
|
62
|
+
const seenAccess = new Set();
|
|
63
|
+
// For each target file, find reachable data
|
|
64
|
+
for (const file of approach.targetFiles) {
|
|
65
|
+
// Find functions in this file
|
|
66
|
+
const functions = this.getFunctionsInFile(file);
|
|
67
|
+
for (const funcId of functions) {
|
|
68
|
+
const result = this.reachabilityEngine.getReachableDataFromFunction(funcId, {
|
|
69
|
+
maxDepth: this.config.maxDepth ?? 10,
|
|
70
|
+
sensitiveOnly: false,
|
|
71
|
+
});
|
|
72
|
+
// Collect data access
|
|
73
|
+
for (const access of result.reachableAccess) {
|
|
74
|
+
const key = `${access.access.table}:${access.access.fields.join(',')}:${access.access.operation}`;
|
|
75
|
+
if (seenAccess.has(key))
|
|
76
|
+
continue;
|
|
77
|
+
seenAccess.add(key);
|
|
78
|
+
const sensitivity = this.classifySensitivity(access.access.table, access.access.fields);
|
|
79
|
+
const implication = {
|
|
80
|
+
table: access.access.table,
|
|
81
|
+
fields: access.access.fields,
|
|
82
|
+
operation: access.access.operation,
|
|
83
|
+
sensitivity,
|
|
84
|
+
};
|
|
85
|
+
const throughFunc = access.path[access.path.length - 1]?.functionName;
|
|
86
|
+
if (throughFunc) {
|
|
87
|
+
implication.throughFunction = throughFunc;
|
|
88
|
+
}
|
|
89
|
+
implications.push(implication);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return implications;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get function IDs in a file
|
|
97
|
+
*/
|
|
98
|
+
getFunctionsInFile(file) {
|
|
99
|
+
if (!this.config.callGraph)
|
|
100
|
+
return [];
|
|
101
|
+
const functions = [];
|
|
102
|
+
for (const [id, func] of this.config.callGraph.functions) {
|
|
103
|
+
if (func.file === file) {
|
|
104
|
+
functions.push(id);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return functions;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Classify sensitivity of data access
|
|
111
|
+
*/
|
|
112
|
+
classifySensitivity(table, fields) {
|
|
113
|
+
const text = `${table} ${fields.join(' ')}`.toLowerCase();
|
|
114
|
+
if (/password|secret|token|api_key|private_key|auth_token|refresh_token/.test(text)) {
|
|
115
|
+
return 'credentials';
|
|
116
|
+
}
|
|
117
|
+
if (/credit_card|card_number|cvv|bank|account_number|salary|income|payment|billing|stripe/.test(text)) {
|
|
118
|
+
return 'financial';
|
|
119
|
+
}
|
|
120
|
+
if (/diagnosis|medical|health|prescription|insurance|hipaa|patient/.test(text)) {
|
|
121
|
+
return 'health';
|
|
122
|
+
}
|
|
123
|
+
if (/ssn|social_security|email|phone|address|dob|birth|name|user/.test(text)) {
|
|
124
|
+
return 'pii';
|
|
125
|
+
}
|
|
126
|
+
return 'unknown';
|
|
127
|
+
}
|
|
128
|
+
// ==========================================================================
|
|
129
|
+
// Auth Analysis
|
|
130
|
+
// ==========================================================================
|
|
131
|
+
/**
|
|
132
|
+
* Analyze authentication/authorization implications
|
|
133
|
+
*/
|
|
134
|
+
analyzeAuthImplications(approach) {
|
|
135
|
+
const implications = [];
|
|
136
|
+
// Check if approach affects auth-related code
|
|
137
|
+
const authKeywords = ['auth', 'login', 'session', 'token', 'jwt', 'permission', 'role', 'guard'];
|
|
138
|
+
for (const file of approach.targetFiles) {
|
|
139
|
+
const fileLower = file.toLowerCase();
|
|
140
|
+
for (const keyword of authKeywords) {
|
|
141
|
+
if (fileLower.includes(keyword)) {
|
|
142
|
+
implications.push(`Modifies auth-related file: ${file}`);
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// Check strategy-specific auth implications
|
|
148
|
+
if (approach.strategy === 'guard' || approach.strategy === 'policy') {
|
|
149
|
+
implications.push('Implements authorization logic');
|
|
150
|
+
}
|
|
151
|
+
if (approach.strategy === 'middleware') {
|
|
152
|
+
implications.push('May intercept requests before auth checks');
|
|
153
|
+
}
|
|
154
|
+
// Check if approach is for auth-related task
|
|
155
|
+
if (approach.followsPatterns?.some(p => p.toLowerCase().includes('auth'))) {
|
|
156
|
+
implications.push('Follows authentication/authorization patterns');
|
|
157
|
+
}
|
|
158
|
+
return implications;
|
|
159
|
+
}
|
|
160
|
+
// ==========================================================================
|
|
161
|
+
// Warning Generation
|
|
162
|
+
// ==========================================================================
|
|
163
|
+
/**
|
|
164
|
+
* Generate security warnings
|
|
165
|
+
*/
|
|
166
|
+
generateWarnings(approach, dataAccess, authImplications) {
|
|
167
|
+
const warnings = [];
|
|
168
|
+
// Warn about credential access
|
|
169
|
+
const credentialAccess = dataAccess.filter(d => d.sensitivity === 'credentials');
|
|
170
|
+
if (credentialAccess.length > 0) {
|
|
171
|
+
warnings.push({
|
|
172
|
+
type: 'credential-access',
|
|
173
|
+
message: `Approach may access ${credentialAccess.length} credential field(s)`,
|
|
174
|
+
severity: 'critical',
|
|
175
|
+
recommendation: 'Ensure proper encryption and access controls',
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
// Warn about financial data
|
|
179
|
+
const financialAccess = dataAccess.filter(d => d.sensitivity === 'financial');
|
|
180
|
+
if (financialAccess.length > 0) {
|
|
181
|
+
warnings.push({
|
|
182
|
+
type: 'financial-data',
|
|
183
|
+
message: `Approach may access ${financialAccess.length} financial field(s)`,
|
|
184
|
+
severity: 'high',
|
|
185
|
+
recommendation: 'Ensure PCI-DSS compliance',
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Warn about health data
|
|
189
|
+
const healthAccess = dataAccess.filter(d => d.sensitivity === 'health');
|
|
190
|
+
if (healthAccess.length > 0) {
|
|
191
|
+
warnings.push({
|
|
192
|
+
type: 'health-data',
|
|
193
|
+
message: `Approach may access ${healthAccess.length} health-related field(s)`,
|
|
194
|
+
severity: 'high',
|
|
195
|
+
recommendation: 'Ensure HIPAA compliance',
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// Warn about PII
|
|
199
|
+
const piiAccess = dataAccess.filter(d => d.sensitivity === 'pii');
|
|
200
|
+
if (piiAccess.length > 0) {
|
|
201
|
+
warnings.push({
|
|
202
|
+
type: 'pii-access',
|
|
203
|
+
message: `Approach may access ${piiAccess.length} PII field(s)`,
|
|
204
|
+
severity: 'medium',
|
|
205
|
+
recommendation: 'Ensure GDPR/privacy compliance',
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
// Warn about auth modifications
|
|
209
|
+
if (authImplications.length > 0) {
|
|
210
|
+
warnings.push({
|
|
211
|
+
type: 'auth-modification',
|
|
212
|
+
message: 'Approach modifies authentication/authorization code',
|
|
213
|
+
severity: 'high',
|
|
214
|
+
recommendation: 'Review security implications carefully',
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
// Warn about distributed changes
|
|
218
|
+
if (approach.strategy === 'distributed' || approach.strategy === 'per-function') {
|
|
219
|
+
warnings.push({
|
|
220
|
+
type: 'distributed-security',
|
|
221
|
+
message: 'Distributed approach may have inconsistent security enforcement',
|
|
222
|
+
severity: 'medium',
|
|
223
|
+
recommendation: 'Consider centralized security checks',
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
// Warn about write operations
|
|
227
|
+
const writeOps = dataAccess.filter(d => d.operation === 'write' || d.operation === 'delete');
|
|
228
|
+
if (writeOps.length > 0) {
|
|
229
|
+
warnings.push({
|
|
230
|
+
type: 'data-modification',
|
|
231
|
+
message: `Approach may modify/delete data in ${writeOps.length} location(s)`,
|
|
232
|
+
severity: 'medium',
|
|
233
|
+
recommendation: 'Ensure proper validation and audit logging',
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return warnings;
|
|
237
|
+
}
|
|
238
|
+
// ==========================================================================
|
|
239
|
+
// Risk Calculation
|
|
240
|
+
// ==========================================================================
|
|
241
|
+
/**
|
|
242
|
+
* Calculate overall security risk score (0-100)
|
|
243
|
+
*/
|
|
244
|
+
calculateSecurityRisk(dataAccess, authImplications, warnings) {
|
|
245
|
+
let score = 0;
|
|
246
|
+
// Score based on data sensitivity
|
|
247
|
+
for (const access of dataAccess) {
|
|
248
|
+
switch (access.sensitivity) {
|
|
249
|
+
case 'credentials':
|
|
250
|
+
score += 25;
|
|
251
|
+
break;
|
|
252
|
+
case 'financial':
|
|
253
|
+
score += 20;
|
|
254
|
+
break;
|
|
255
|
+
case 'health':
|
|
256
|
+
score += 18;
|
|
257
|
+
break;
|
|
258
|
+
case 'pii':
|
|
259
|
+
score += 10;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Score based on auth implications
|
|
264
|
+
score += authImplications.length * 10;
|
|
265
|
+
// Score based on warnings
|
|
266
|
+
for (const warning of warnings) {
|
|
267
|
+
switch (warning.severity) {
|
|
268
|
+
case 'critical':
|
|
269
|
+
score += 15;
|
|
270
|
+
break;
|
|
271
|
+
case 'high':
|
|
272
|
+
score += 10;
|
|
273
|
+
break;
|
|
274
|
+
case 'medium':
|
|
275
|
+
score += 5;
|
|
276
|
+
break;
|
|
277
|
+
case 'low':
|
|
278
|
+
score += 2;
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return Math.min(100, Math.round(score));
|
|
283
|
+
}
|
|
284
|
+
// ==========================================================================
|
|
285
|
+
// Estimation (when no call graph)
|
|
286
|
+
// ==========================================================================
|
|
287
|
+
/**
|
|
288
|
+
* Estimate security when call graph is not available
|
|
289
|
+
*/
|
|
290
|
+
estimateSecurity(approach) {
|
|
291
|
+
const warnings = [];
|
|
292
|
+
const authImplications = [];
|
|
293
|
+
// Check file names for security-related code
|
|
294
|
+
const securityKeywords = ['auth', 'security', 'password', 'token', 'session', 'permission'];
|
|
295
|
+
for (const file of approach.targetFiles) {
|
|
296
|
+
const fileLower = file.toLowerCase();
|
|
297
|
+
for (const keyword of securityKeywords) {
|
|
298
|
+
if (fileLower.includes(keyword)) {
|
|
299
|
+
authImplications.push(`May affect security-related file: ${file}`);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// Add general warning
|
|
305
|
+
if (authImplications.length > 0) {
|
|
306
|
+
warnings.push({
|
|
307
|
+
type: 'security-files',
|
|
308
|
+
message: 'Approach affects security-related files',
|
|
309
|
+
severity: 'medium',
|
|
310
|
+
recommendation: 'Review security implications (call graph not available for detailed analysis)',
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
// Calculate basic risk score
|
|
314
|
+
let securityRisk = 0;
|
|
315
|
+
securityRisk += authImplications.length * 15;
|
|
316
|
+
securityRisk += approach.targetFiles.length * 2;
|
|
317
|
+
// Strategy-based risk
|
|
318
|
+
const strategyRisk = {
|
|
319
|
+
guard: 20,
|
|
320
|
+
policy: 20,
|
|
321
|
+
middleware: 15,
|
|
322
|
+
interceptor: 15,
|
|
323
|
+
filter: 10,
|
|
324
|
+
decorator: 10,
|
|
325
|
+
wrapper: 10,
|
|
326
|
+
custom: 15,
|
|
327
|
+
};
|
|
328
|
+
securityRisk += strategyRisk[approach.strategy] ?? 5;
|
|
329
|
+
return {
|
|
330
|
+
securityRisk: Math.min(100, securityRisk),
|
|
331
|
+
dataAccessImplications: [],
|
|
332
|
+
authImplications,
|
|
333
|
+
warnings,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// ============================================================================
|
|
338
|
+
// Factory Function
|
|
339
|
+
// ============================================================================
|
|
340
|
+
/**
|
|
341
|
+
* Create a security scorer
|
|
342
|
+
*/
|
|
343
|
+
export function createSecurityScorer(config) {
|
|
344
|
+
return new SecurityScorer(config);
|
|
345
|
+
}
|
|
346
|
+
//# sourceMappingURL=security-scorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-scorer.js","sourceRoot":"","sources":["../../../src/simulation/scorers/security-scorer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAkB/E,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,OAAO,cAAc;IACR,MAAM,CAAuB;IACtC,kBAAkB,GAA8B,IAAI,CAAC;IAE7D,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,QAA4B;QACtC,oDAAoD;QACpD,IAAI,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QAED,mCAAmC;QACnC,MAAM,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAEhE,4BAA4B;QAC5B,MAAM,gBAAgB,GAAG,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;QAEhE,6BAA6B;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,sBAAsB,EAAE,gBAAgB,CAAC,CAAC;QAE3F,gCAAgC;QAChC,MAAM,YAAY,GAAG,IAA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QAED,6BAA6B;QAC7B,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,YAAY,IAAI,gBAAgB,CAAC,MAAM,GAAG,EAAE,CAAC;QAC7C,YAAY,IAAI,QAAQ,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;QAEhD,sBAAsB;QACtB,MAAM,YAAY,GAA2B;YAC3C,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,EAAE;YACb,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,EAAE;SACX,CAAC;QACF,YAAY,IAAI,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAErD,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC;YACzC,sBAAsB,EAAE,EAAE;YAC1B,gBAAgB;YAChB,QAAQ;SACT,CAAC;IACJ,CAAC;CACF;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA4B;IAC/D,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simulation Engine
|
|
3
|
+
*
|
|
4
|
+
* Main orchestrator for the Speculative Execution Engine.
|
|
5
|
+
* Coordinates approach generation, scoring, and ranking.
|
|
6
|
+
*
|
|
7
|
+
* @module simulation/simulation-engine
|
|
8
|
+
*/
|
|
9
|
+
import type { CallGraph } from '../call-graph/types.js';
|
|
10
|
+
import type { IPatternService } from '../patterns/service.js';
|
|
11
|
+
import type { SimulationTask, SimulationResult, SimulationOptions, ScoringWeights } from './types.js';
|
|
12
|
+
export interface SimulationEngineConfig {
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
callGraph?: CallGraph | undefined;
|
|
15
|
+
patternService?: IPatternService | undefined;
|
|
16
|
+
weights?: Partial<ScoringWeights> | undefined;
|
|
17
|
+
options?: Partial<SimulationOptions> | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Main simulation engine that orchestrates the speculative execution
|
|
21
|
+
*/
|
|
22
|
+
export declare class SimulationEngine {
|
|
23
|
+
private readonly config;
|
|
24
|
+
private readonly weights;
|
|
25
|
+
private readonly options;
|
|
26
|
+
private readonly approachGenerator;
|
|
27
|
+
private readonly frictionScorer;
|
|
28
|
+
private readonly impactScorer;
|
|
29
|
+
private readonly patternAlignmentScorer;
|
|
30
|
+
private readonly securityScorer;
|
|
31
|
+
constructor(config: SimulationEngineConfig);
|
|
32
|
+
/**
|
|
33
|
+
* Run simulation for a task
|
|
34
|
+
*/
|
|
35
|
+
simulate(task: SimulationTask): Promise<SimulationResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Score a single approach
|
|
38
|
+
*/
|
|
39
|
+
private scoreApproach;
|
|
40
|
+
/**
|
|
41
|
+
* Rank approaches by score
|
|
42
|
+
*/
|
|
43
|
+
private rankApproaches;
|
|
44
|
+
/**
|
|
45
|
+
* Generate tradeoff comparisons between approaches
|
|
46
|
+
*/
|
|
47
|
+
private generateTradeoffs;
|
|
48
|
+
/**
|
|
49
|
+
* Generate comparison text
|
|
50
|
+
*/
|
|
51
|
+
private generateComparisonText;
|
|
52
|
+
/**
|
|
53
|
+
* Generate reasoning for an approach
|
|
54
|
+
*/
|
|
55
|
+
private generateReasoning;
|
|
56
|
+
/**
|
|
57
|
+
* Generate pros and cons
|
|
58
|
+
*/
|
|
59
|
+
private generateProsAndCons;
|
|
60
|
+
/**
|
|
61
|
+
* Collect warnings from scorers
|
|
62
|
+
*/
|
|
63
|
+
private collectWarnings;
|
|
64
|
+
/**
|
|
65
|
+
* Generate next steps
|
|
66
|
+
*/
|
|
67
|
+
private generateNextSteps;
|
|
68
|
+
/**
|
|
69
|
+
* Check constraints satisfaction
|
|
70
|
+
*/
|
|
71
|
+
private checkConstraints;
|
|
72
|
+
/**
|
|
73
|
+
* Generate summary
|
|
74
|
+
*/
|
|
75
|
+
private generateSummary;
|
|
76
|
+
/**
|
|
77
|
+
* Calculate confidence
|
|
78
|
+
*/
|
|
79
|
+
private calculateConfidence;
|
|
80
|
+
/**
|
|
81
|
+
* Create a fallback approach when no strategies are available
|
|
82
|
+
*/
|
|
83
|
+
private createFallbackApproach;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a simulation engine
|
|
87
|
+
*/
|
|
88
|
+
export declare function createSimulationEngine(config: SimulationEngineConfig): SimulationEngine;
|
|
89
|
+
//# sourceMappingURL=simulation-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation-engine.d.ts","sourceRoot":"","sources":["../../src/simulation/simulation-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EACV,cAAc,EAGd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EAGf,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,cAAc,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC;CAClD;AAMD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,C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