driftdetect-core 0.4.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/csharp-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/csharp-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/csharp-extractor.d.ts +35 -0
- package/dist/call-graph/extractors/csharp-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/csharp-extractor.js +362 -4
- package/dist/call-graph/extractors/csharp-extractor.js.map +1 -1
- package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts +37 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.js +408 -0
- package/dist/call-graph/extractors/csharp-hybrid-extractor.js.map +1 -0
- 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/hybrid-extractor-base.d.ts +102 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.d.ts.map +1 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.js +289 -0
- package/dist/call-graph/extractors/hybrid-extractor-base.js.map +1 -0
- package/dist/call-graph/extractors/index.d.ts +17 -13
- package/dist/call-graph/extractors/index.d.ts.map +1 -1
- package/dist/call-graph/extractors/index.js +24 -23
- package/dist/call-graph/extractors/index.js.map +1 -1
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/java-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/java-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/java-extractor.d.ts +15 -0
- package/dist/call-graph/extractors/java-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/java-extractor.js +120 -4
- package/dist/call-graph/extractors/java-extractor.js.map +1 -1
- package/dist/call-graph/extractors/java-hybrid-extractor.d.ts +36 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.js +426 -0
- package/dist/call-graph/extractors/java-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/php-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/php-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/php-extractor.d.ts +48 -1
- package/dist/call-graph/extractors/php-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/php-extractor.js +460 -6
- package/dist/call-graph/extractors/php-extractor.js.map +1 -1
- package/dist/call-graph/extractors/php-hybrid-extractor.d.ts +35 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.js +393 -0
- package/dist/call-graph/extractors/php-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/python-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/python-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/python-hybrid-extractor.d.ts +85 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.js +462 -0
- package/dist/call-graph/extractors/python-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts +154 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.js +346 -0
- package/dist/call-graph/extractors/regex/base-regex-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/csharp-regex.d.ts +34 -0
- package/dist/call-graph/extractors/regex/csharp-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/csharp-regex.js +393 -0
- package/dist/call-graph/extractors/regex/csharp-regex.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 +26 -0
- package/dist/call-graph/extractors/regex/index.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/index.js +74 -0
- package/dist/call-graph/extractors/regex/index.js.map +1 -0
- package/dist/call-graph/extractors/regex/java-regex.d.ts +34 -0
- package/dist/call-graph/extractors/regex/java-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/java-regex.js +327 -0
- package/dist/call-graph/extractors/regex/java-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/php-regex.d.ts +30 -0
- package/dist/call-graph/extractors/regex/php-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/php-regex.js +333 -0
- package/dist/call-graph/extractors/regex/php-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/python-regex.d.ts +46 -0
- package/dist/call-graph/extractors/regex/python-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/python-regex.js +380 -0
- package/dist/call-graph/extractors/regex/python-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/typescript-regex.d.ts +27 -0
- package/dist/call-graph/extractors/regex/typescript-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/typescript-regex.js +349 -0
- package/dist/call-graph/extractors/regex/typescript-regex.js.map +1 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts +7 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts.map +1 -1
- package/dist/call-graph/extractors/semantic-data-access-scanner.js +7 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.js.map +1 -1
- package/dist/call-graph/extractors/types.d.ts +111 -0
- package/dist/call-graph/extractors/types.d.ts.map +1 -0
- package/dist/call-graph/extractors/types.js +68 -0
- package/dist/call-graph/extractors/types.js.map +1 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts +8 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts.map +1 -1
- package/dist/call-graph/extractors/typescript-data-access-extractor.js +8 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.js.map +1 -1
- package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts +116 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.js +635 -0
- package/dist/call-graph/extractors/typescript-hybrid-extractor.js.map +1 -0
- 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/error-handling/error-handling-analyzer.d.ts +73 -0
- package/dist/error-handling/error-handling-analyzer.d.ts.map +1 -0
- package/dist/error-handling/error-handling-analyzer.js +706 -0
- package/dist/error-handling/error-handling-analyzer.js.map +1 -0
- package/dist/error-handling/index.d.ts +8 -0
- package/dist/error-handling/index.d.ts.map +1 -0
- package/dist/error-handling/index.js +8 -0
- package/dist/error-handling/index.js.map +1 -0
- package/dist/error-handling/types.d.ts +307 -0
- package/dist/error-handling/types.d.ts.map +1 -0
- package/dist/error-handling/types.js +7 -0
- package/dist/error-handling/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 +25 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -1
- package/dist/lake/pattern-shard-store.d.ts +6 -0
- package/dist/lake/pattern-shard-store.d.ts.map +1 -1
- package/dist/lake/pattern-shard-store.js +6 -0
- package/dist/lake/pattern-shard-store.js.map +1 -1
- package/dist/module-coupling/coupling-analyzer.d.ts +73 -0
- package/dist/module-coupling/coupling-analyzer.d.ts.map +1 -0
- package/dist/module-coupling/coupling-analyzer.js +668 -0
- package/dist/module-coupling/coupling-analyzer.js.map +1 -0
- package/dist/module-coupling/index.d.ts +9 -0
- package/dist/module-coupling/index.d.ts.map +1 -0
- package/dist/module-coupling/index.js +9 -0
- package/dist/module-coupling/index.js.map +1 -0
- package/dist/module-coupling/types.d.ts +273 -0
- package/dist/module-coupling/types.d.ts.map +1 -0
- package/dist/module-coupling/types.js +8 -0
- package/dist/module-coupling/types.js.map +1 -0
- 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/patterns/adapters/index.d.ts +11 -0
- package/dist/patterns/adapters/index.d.ts.map +1 -0
- package/dist/patterns/adapters/index.js +11 -0
- package/dist/patterns/adapters/index.js.map +1 -0
- package/dist/patterns/adapters/pattern-store-adapter.d.ts +59 -0
- package/dist/patterns/adapters/pattern-store-adapter.d.ts.map +1 -0
- package/dist/patterns/adapters/pattern-store-adapter.js +468 -0
- package/dist/patterns/adapters/pattern-store-adapter.js.map +1 -0
- package/dist/patterns/adapters/service-factory.d.ts +40 -0
- package/dist/patterns/adapters/service-factory.d.ts.map +1 -0
- package/dist/patterns/adapters/service-factory.js +144 -0
- package/dist/patterns/adapters/service-factory.js.map +1 -0
- package/dist/patterns/errors.d.ts +32 -0
- package/dist/patterns/errors.d.ts.map +1 -0
- package/dist/patterns/errors.js +45 -0
- package/dist/patterns/errors.js.map +1 -0
- package/dist/patterns/impl/cached-repository.d.ts +79 -0
- package/dist/patterns/impl/cached-repository.d.ts.map +1 -0
- package/dist/patterns/impl/cached-repository.js +296 -0
- package/dist/patterns/impl/cached-repository.js.map +1 -0
- package/dist/patterns/impl/file-repository.d.ts +75 -0
- package/dist/patterns/impl/file-repository.d.ts.map +1 -0
- package/dist/patterns/impl/file-repository.js +507 -0
- package/dist/patterns/impl/file-repository.js.map +1 -0
- package/dist/patterns/impl/index.d.ts +16 -0
- package/dist/patterns/impl/index.d.ts.map +1 -0
- package/dist/patterns/impl/index.js +21 -0
- package/dist/patterns/impl/index.js.map +1 -0
- package/dist/patterns/impl/memory-repository.d.ts +56 -0
- package/dist/patterns/impl/memory-repository.d.ts.map +1 -0
- package/dist/patterns/impl/memory-repository.js +323 -0
- package/dist/patterns/impl/memory-repository.js.map +1 -0
- package/dist/patterns/impl/pattern-service.d.ts +52 -0
- package/dist/patterns/impl/pattern-service.d.ts.map +1 -0
- package/dist/patterns/impl/pattern-service.js +382 -0
- package/dist/patterns/impl/pattern-service.js.map +1 -0
- package/dist/patterns/impl/repository-factory.d.ts +44 -0
- package/dist/patterns/impl/repository-factory.d.ts.map +1 -0
- package/dist/patterns/impl/repository-factory.js +140 -0
- package/dist/patterns/impl/repository-factory.js.map +1 -0
- package/dist/patterns/impl/unified-file-repository.d.ts +111 -0
- package/dist/patterns/impl/unified-file-repository.d.ts.map +1 -0
- package/dist/patterns/impl/unified-file-repository.js +677 -0
- package/dist/patterns/impl/unified-file-repository.js.map +1 -0
- package/dist/patterns/index.d.ts +23 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +41 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/repository.d.ts +241 -0
- package/dist/patterns/repository.d.ts.map +1 -0
- package/dist/patterns/repository.js +23 -0
- package/dist/patterns/repository.js.map +1 -0
- package/dist/patterns/service.d.ts +245 -0
- package/dist/patterns/service.d.ts.map +1 -0
- package/dist/patterns/service.js +25 -0
- package/dist/patterns/service.js.map +1 -0
- package/dist/patterns/types.d.ts +227 -0
- package/dist/patterns/types.d.ts.map +1 -0
- package/dist/patterns/types.js +117 -0
- package/dist/patterns/types.js.map +1 -0
- 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/store/pattern-store.d.ts +6 -0
- package/dist/store/pattern-store.d.ts.map +1 -1
- package/dist/store/pattern-store.js +6 -0
- package/dist/store/pattern-store.js.map +1 -1
- package/dist/test-topology/extractors/base-test-extractor.d.ts +89 -0
- package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/base-test-extractor.js +187 -0
- package/dist/test-topology/extractors/base-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/csharp-test-extractor.d.ts +23 -0
- package/dist/test-topology/extractors/csharp-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/csharp-test-extractor.js +367 -0
- package/dist/test-topology/extractors/csharp-test-extractor.js.map +1 -0
- 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 +13 -0
- package/dist/test-topology/extractors/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/index.js +13 -0
- package/dist/test-topology/extractors/index.js.map +1 -0
- package/dist/test-topology/extractors/java-test-extractor.d.ts +20 -0
- package/dist/test-topology/extractors/java-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/java-test-extractor.js +275 -0
- package/dist/test-topology/extractors/java-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/php-test-extractor.d.ts +24 -0
- package/dist/test-topology/extractors/php-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/php-test-extractor.js +409 -0
- package/dist/test-topology/extractors/php-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/python-test-extractor.d.ts +23 -0
- package/dist/test-topology/extractors/python-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/python-test-extractor.js +342 -0
- package/dist/test-topology/extractors/python-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts +51 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.js +383 -0
- package/dist/test-topology/extractors/regex/csharp-test-regex.js.map +1 -0
- 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 +19 -0
- package/dist/test-topology/extractors/regex/index.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/index.js +47 -0
- package/dist/test-topology/extractors/regex/index.js.map +1 -0
- package/dist/test-topology/extractors/regex/java-test-regex.d.ts +50 -0
- package/dist/test-topology/extractors/regex/java-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/java-test-regex.js +370 -0
- package/dist/test-topology/extractors/regex/java-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/php-test-regex.d.ts +56 -0
- package/dist/test-topology/extractors/regex/php-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/php-test-regex.js +503 -0
- package/dist/test-topology/extractors/regex/php-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/python-test-regex.d.ts +57 -0
- package/dist/test-topology/extractors/regex/python-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/python-test-regex.js +381 -0
- package/dist/test-topology/extractors/regex/python-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts +60 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.js +368 -0
- package/dist/test-topology/extractors/regex/typescript-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/typescript-test-extractor.d.ts +24 -0
- package/dist/test-topology/extractors/typescript-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/typescript-test-extractor.js +266 -0
- package/dist/test-topology/extractors/typescript-test-extractor.js.map +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts +98 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js +556 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -0
- package/dist/test-topology/index.d.ts +16 -0
- package/dist/test-topology/index.d.ts.map +1 -0
- package/dist/test-topology/index.js +19 -0
- package/dist/test-topology/index.js.map +1 -0
- package/dist/test-topology/test-topology-analyzer.d.ts +85 -0
- package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -0
- package/dist/test-topology/test-topology-analyzer.js +539 -0
- package/dist/test-topology/test-topology-analyzer.js.map +1 -0
- package/dist/test-topology/types.d.ts +300 -0
- package/dist/test-topology/types.d.ts.map +1 -0
- package/dist/test-topology/types.js +7 -0
- package/dist/test-topology/types.js.map +1 -0
- 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/clustering/clusterer.d.ts +43 -0
- package/dist/wrappers/clustering/clusterer.d.ts.map +1 -0
- package/dist/wrappers/clustering/clusterer.js +374 -0
- package/dist/wrappers/clustering/clusterer.js.map +1 -0
- package/dist/wrappers/clustering/exclusions.d.ts +47 -0
- package/dist/wrappers/clustering/exclusions.d.ts.map +1 -0
- package/dist/wrappers/clustering/exclusions.js +318 -0
- package/dist/wrappers/clustering/exclusions.js.map +1 -0
- package/dist/wrappers/clustering/index.d.ts +6 -0
- package/dist/wrappers/clustering/index.d.ts.map +1 -0
- package/dist/wrappers/clustering/index.js +6 -0
- package/dist/wrappers/clustering/index.js.map +1 -0
- package/dist/wrappers/detection/detector.d.ts +69 -0
- package/dist/wrappers/detection/detector.d.ts.map +1 -0
- package/dist/wrappers/detection/detector.js +279 -0
- package/dist/wrappers/detection/detector.js.map +1 -0
- package/dist/wrappers/detection/index.d.ts +5 -0
- package/dist/wrappers/detection/index.d.ts.map +1 -0
- package/dist/wrappers/detection/index.js +5 -0
- package/dist/wrappers/detection/index.js.map +1 -0
- package/dist/wrappers/export/index.d.ts +5 -0
- package/dist/wrappers/export/index.d.ts.map +1 -0
- package/dist/wrappers/export/index.js +5 -0
- package/dist/wrappers/export/index.js.map +1 -0
- package/dist/wrappers/export/json.d.ts +127 -0
- package/dist/wrappers/export/json.d.ts.map +1 -0
- package/dist/wrappers/export/json.js +160 -0
- package/dist/wrappers/export/json.js.map +1 -0
- package/dist/wrappers/index.d.ts +56 -0
- package/dist/wrappers/index.d.ts.map +1 -0
- package/dist/wrappers/index.js +159 -0
- package/dist/wrappers/index.js.map +1 -0
- package/dist/wrappers/integration/adapter.d.ts +52 -0
- package/dist/wrappers/integration/adapter.d.ts.map +1 -0
- package/dist/wrappers/integration/adapter.js +210 -0
- package/dist/wrappers/integration/adapter.js.map +1 -0
- package/dist/wrappers/integration/index.d.ts +9 -0
- package/dist/wrappers/integration/index.d.ts.map +1 -0
- package/dist/wrappers/integration/index.js +12 -0
- package/dist/wrappers/integration/index.js.map +1 -0
- package/dist/wrappers/integration/pattern-adapter.d.ts +52 -0
- package/dist/wrappers/integration/pattern-adapter.d.ts.map +1 -0
- package/dist/wrappers/integration/pattern-adapter.js +192 -0
- package/dist/wrappers/integration/pattern-adapter.js.map +1 -0
- package/dist/wrappers/integration/scanner.d.ts +85 -0
- package/dist/wrappers/integration/scanner.d.ts.map +1 -0
- package/dist/wrappers/integration/scanner.js +367 -0
- package/dist/wrappers/integration/scanner.js.map +1 -0
- package/dist/wrappers/primitives/discovery.d.ts +57 -0
- package/dist/wrappers/primitives/discovery.d.ts.map +1 -0
- package/dist/wrappers/primitives/discovery.js +389 -0
- package/dist/wrappers/primitives/discovery.js.map +1 -0
- package/dist/wrappers/primitives/index.d.ts +6 -0
- package/dist/wrappers/primitives/index.d.ts.map +1 -0
- package/dist/wrappers/primitives/index.js +6 -0
- package/dist/wrappers/primitives/index.js.map +1 -0
- package/dist/wrappers/primitives/registry.d.ts +63 -0
- package/dist/wrappers/primitives/registry.d.ts.map +1 -0
- package/dist/wrappers/primitives/registry.js +447 -0
- package/dist/wrappers/primitives/registry.js.map +1 -0
- package/dist/wrappers/types.d.ts +137 -0
- package/dist/wrappers/types.d.ts.map +1 -0
- package/dist/wrappers/types.js +7 -0
- package/dist/wrappers/types.js.map +1 -0
- package/package.json +33 -18
- package/LICENSE +0 -21
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Approach Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates implementation approaches for a given task by:
|
|
5
|
+
* 1. Detecting the task category from the description
|
|
6
|
+
* 2. Detecting the project language and framework
|
|
7
|
+
* 3. Using language-specific strategies to generate approaches
|
|
8
|
+
* 4. Enriching approaches with target files from the codebase
|
|
9
|
+
*
|
|
10
|
+
* @module simulation/approach-generator
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from 'node:fs/promises';
|
|
13
|
+
import * as path from 'node:path';
|
|
14
|
+
import { getStrategyProvider, detectTaskCategory, detectFramework, } from './language-strategies/index.js';
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Language Detection Helpers
|
|
17
|
+
// ============================================================================
|
|
18
|
+
const LANGUAGE_EXTENSIONS = {
|
|
19
|
+
'.ts': 'typescript',
|
|
20
|
+
'.tsx': 'typescript',
|
|
21
|
+
'.js': 'javascript',
|
|
22
|
+
'.jsx': 'javascript',
|
|
23
|
+
'.py': 'python',
|
|
24
|
+
'.java': 'java',
|
|
25
|
+
'.cs': 'csharp',
|
|
26
|
+
'.php': 'php',
|
|
27
|
+
};
|
|
28
|
+
const FRAMEWORK_INDICATORS = {
|
|
29
|
+
'package.json': { language: 'typescript', framework: 'node' },
|
|
30
|
+
'tsconfig.json': { language: 'typescript', framework: 'node' },
|
|
31
|
+
'requirements.txt': { language: 'python', framework: 'python' },
|
|
32
|
+
'pyproject.toml': { language: 'python', framework: 'python' },
|
|
33
|
+
'pom.xml': { language: 'java', framework: 'maven' },
|
|
34
|
+
'build.gradle': { language: 'java', framework: 'gradle' },
|
|
35
|
+
'composer.json': { language: 'php', framework: 'composer' },
|
|
36
|
+
'*.csproj': { language: 'csharp', framework: 'dotnet' },
|
|
37
|
+
};
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// Approach Generator
|
|
40
|
+
// ============================================================================
|
|
41
|
+
/**
|
|
42
|
+
* Generates implementation approaches for a task
|
|
43
|
+
*/
|
|
44
|
+
export class ApproachGenerator {
|
|
45
|
+
config;
|
|
46
|
+
constructor(config) {
|
|
47
|
+
this.config = config;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generate approaches for a task
|
|
51
|
+
*/
|
|
52
|
+
async generate(task, maxApproaches = 5) {
|
|
53
|
+
// Step 1: Detect category if not provided
|
|
54
|
+
const category = task.category || detectTaskCategory(task.description);
|
|
55
|
+
// Step 2: Detect language and framework from codebase
|
|
56
|
+
const { language, framework } = await this.detectLanguageAndFramework();
|
|
57
|
+
// Step 3: Get strategy provider for the language
|
|
58
|
+
const provider = getStrategyProvider(language);
|
|
59
|
+
if (!provider) {
|
|
60
|
+
return {
|
|
61
|
+
approaches: [this.createFallbackApproach(task, category, language)],
|
|
62
|
+
detectedLanguage: language,
|
|
63
|
+
detectedFramework: framework,
|
|
64
|
+
detectedCategory: category,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// Step 4: Get applicable strategies
|
|
68
|
+
const strategies = provider.getStrategies(category, framework ?? undefined);
|
|
69
|
+
// Step 5: Find relevant files from call graph
|
|
70
|
+
const relevantFiles = this.findRelevantFiles(task, category, language);
|
|
71
|
+
// Step 6: Find relevant patterns
|
|
72
|
+
const relevantPatterns = await this.findRelevantPatterns(category);
|
|
73
|
+
// Step 7: Generate approaches from strategies
|
|
74
|
+
const approaches = [];
|
|
75
|
+
for (const strategy of strategies.slice(0, maxApproaches)) {
|
|
76
|
+
const approach = this.createApproach(strategy, task, category, language, framework, relevantFiles, relevantPatterns);
|
|
77
|
+
approaches.push(approach);
|
|
78
|
+
}
|
|
79
|
+
// Step 8: Add a custom approach if we have room
|
|
80
|
+
if (approaches.length < maxApproaches && approaches.length > 0) {
|
|
81
|
+
approaches.push(this.createCustomApproach(task, category, language, relevantFiles));
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
approaches,
|
|
85
|
+
detectedLanguage: language,
|
|
86
|
+
detectedFramework: framework,
|
|
87
|
+
detectedCategory: category,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// ==========================================================================
|
|
91
|
+
// Language & Framework Detection
|
|
92
|
+
// ==========================================================================
|
|
93
|
+
/**
|
|
94
|
+
* Detect the primary language and framework from the codebase
|
|
95
|
+
*/
|
|
96
|
+
async detectLanguageAndFramework() {
|
|
97
|
+
// If we have a call graph, use its language distribution
|
|
98
|
+
if (this.config.callGraph) {
|
|
99
|
+
const langCounts = new Map();
|
|
100
|
+
for (const [, func] of this.config.callGraph.functions) {
|
|
101
|
+
const ext = path.extname(func.file);
|
|
102
|
+
const lang = LANGUAGE_EXTENSIONS[ext];
|
|
103
|
+
if (lang) {
|
|
104
|
+
langCounts.set(lang, (langCounts.get(lang) ?? 0) + 1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Find dominant language
|
|
108
|
+
let maxCount = 0;
|
|
109
|
+
let dominantLang = 'typescript';
|
|
110
|
+
for (const [lang, count] of langCounts) {
|
|
111
|
+
if (count > maxCount) {
|
|
112
|
+
maxCount = count;
|
|
113
|
+
dominantLang = lang;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Try to detect framework from files
|
|
117
|
+
const framework = await this.detectFrameworkFromFiles(dominantLang);
|
|
118
|
+
return { language: dominantLang, framework };
|
|
119
|
+
}
|
|
120
|
+
// Fallback: scan project root for indicators
|
|
121
|
+
try {
|
|
122
|
+
const files = await fs.readdir(this.config.projectRoot);
|
|
123
|
+
for (const file of files) {
|
|
124
|
+
const indicator = FRAMEWORK_INDICATORS[file];
|
|
125
|
+
if (indicator) {
|
|
126
|
+
const framework = await this.detectFrameworkFromFiles(indicator.language);
|
|
127
|
+
return { language: indicator.language, framework };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
// Ignore errors
|
|
133
|
+
}
|
|
134
|
+
return { language: 'typescript', framework: null };
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Detect specific framework from file contents
|
|
138
|
+
*/
|
|
139
|
+
async detectFrameworkFromFiles(language) {
|
|
140
|
+
const { projectRoot } = this.config;
|
|
141
|
+
try {
|
|
142
|
+
switch (language) {
|
|
143
|
+
case 'typescript':
|
|
144
|
+
case 'javascript': {
|
|
145
|
+
const pkgPath = path.join(projectRoot, 'package.json');
|
|
146
|
+
const content = await fs.readFile(pkgPath, 'utf-8');
|
|
147
|
+
return detectFramework(content, pkgPath, language);
|
|
148
|
+
}
|
|
149
|
+
case 'python': {
|
|
150
|
+
// Check for Django, FastAPI, Flask
|
|
151
|
+
const reqPath = path.join(projectRoot, 'requirements.txt');
|
|
152
|
+
try {
|
|
153
|
+
const content = await fs.readFile(reqPath, 'utf-8');
|
|
154
|
+
return detectFramework(content, reqPath, language);
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
// Try pyproject.toml
|
|
158
|
+
const pyprojectPath = path.join(projectRoot, 'pyproject.toml');
|
|
159
|
+
const content = await fs.readFile(pyprojectPath, 'utf-8');
|
|
160
|
+
return detectFramework(content, pyprojectPath, language);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
case 'java': {
|
|
164
|
+
// Check for Spring Boot
|
|
165
|
+
const pomPath = path.join(projectRoot, 'pom.xml');
|
|
166
|
+
try {
|
|
167
|
+
const content = await fs.readFile(pomPath, 'utf-8');
|
|
168
|
+
return detectFramework(content, pomPath, language);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
const gradlePath = path.join(projectRoot, 'build.gradle');
|
|
172
|
+
const content = await fs.readFile(gradlePath, 'utf-8');
|
|
173
|
+
return detectFramework(content, gradlePath, language);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
case 'csharp': {
|
|
177
|
+
// Check for ASP.NET Core
|
|
178
|
+
const files = await fs.readdir(projectRoot);
|
|
179
|
+
const csproj = files.find(f => f.endsWith('.csproj'));
|
|
180
|
+
if (csproj) {
|
|
181
|
+
const content = await fs.readFile(path.join(projectRoot, csproj), 'utf-8');
|
|
182
|
+
return detectFramework(content, csproj, language);
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case 'php': {
|
|
187
|
+
// Check for Laravel
|
|
188
|
+
const composerPath = path.join(projectRoot, 'composer.json');
|
|
189
|
+
const content = await fs.readFile(composerPath, 'utf-8');
|
|
190
|
+
return detectFramework(content, composerPath, language);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
// Ignore errors
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
// ==========================================================================
|
|
200
|
+
// File Discovery
|
|
201
|
+
// ==========================================================================
|
|
202
|
+
/**
|
|
203
|
+
* Find relevant files for the task from the call graph
|
|
204
|
+
*/
|
|
205
|
+
findRelevantFiles(task, category, _language) {
|
|
206
|
+
const files = [];
|
|
207
|
+
if (!this.config.callGraph) {
|
|
208
|
+
return files;
|
|
209
|
+
}
|
|
210
|
+
// If task has a specific target, find files related to it
|
|
211
|
+
if (task.target) {
|
|
212
|
+
for (const [, func] of this.config.callGraph.functions) {
|
|
213
|
+
if (func.file.includes(task.target) ||
|
|
214
|
+
func.name.toLowerCase().includes(task.target.toLowerCase()) ||
|
|
215
|
+
func.qualifiedName.toLowerCase().includes(task.target.toLowerCase())) {
|
|
216
|
+
if (!files.includes(func.file)) {
|
|
217
|
+
files.push(func.file);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// Find files by category keywords
|
|
223
|
+
const categoryKeywords = this.getCategoryKeywords(category);
|
|
224
|
+
for (const [, func] of this.config.callGraph.functions) {
|
|
225
|
+
const funcText = `${func.file} ${func.name} ${func.qualifiedName}`.toLowerCase();
|
|
226
|
+
for (const keyword of categoryKeywords) {
|
|
227
|
+
if (funcText.includes(keyword) && !files.includes(func.file)) {
|
|
228
|
+
files.push(func.file);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// Limit to reasonable number
|
|
234
|
+
return files.slice(0, 20);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Get keywords for a category
|
|
238
|
+
*/
|
|
239
|
+
getCategoryKeywords(category) {
|
|
240
|
+
const keywords = {
|
|
241
|
+
'rate-limiting': ['rate', 'limit', 'throttle', 'quota'],
|
|
242
|
+
'authentication': ['auth', 'login', 'session', 'token', 'jwt'],
|
|
243
|
+
'authorization': ['permission', 'role', 'access', 'policy', 'guard'],
|
|
244
|
+
'api-endpoint': ['route', 'endpoint', 'controller', 'handler', 'api'],
|
|
245
|
+
'data-access': ['repository', 'dao', 'model', 'entity', 'query'],
|
|
246
|
+
'error-handling': ['error', 'exception', 'catch', 'handler'],
|
|
247
|
+
'caching': ['cache', 'redis', 'memcache', 'store'],
|
|
248
|
+
'logging': ['log', 'logger', 'trace', 'debug'],
|
|
249
|
+
'testing': ['test', 'spec', 'mock', 'stub'],
|
|
250
|
+
'validation': ['valid', 'schema', 'sanitize', 'check'],
|
|
251
|
+
'middleware': ['middleware', 'interceptor', 'filter', 'pipe'],
|
|
252
|
+
'refactoring': [],
|
|
253
|
+
'generic': [],
|
|
254
|
+
};
|
|
255
|
+
return keywords[category] ?? [];
|
|
256
|
+
}
|
|
257
|
+
// ==========================================================================
|
|
258
|
+
// Pattern Discovery
|
|
259
|
+
// ==========================================================================
|
|
260
|
+
/**
|
|
261
|
+
* Find relevant patterns for the category
|
|
262
|
+
*/
|
|
263
|
+
async findRelevantPatterns(category) {
|
|
264
|
+
if (!this.config.patternService) {
|
|
265
|
+
return [];
|
|
266
|
+
}
|
|
267
|
+
try {
|
|
268
|
+
const result = await this.config.patternService.listByCategory(category, {
|
|
269
|
+
limit: 10,
|
|
270
|
+
});
|
|
271
|
+
return result.items.map(p => p.id);
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
return [];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
// ==========================================================================
|
|
278
|
+
// Approach Creation
|
|
279
|
+
// ==========================================================================
|
|
280
|
+
/**
|
|
281
|
+
* Create an approach from a strategy template
|
|
282
|
+
*/
|
|
283
|
+
createApproach(strategy, _task, _category, language, framework, relevantFiles, relevantPatterns) {
|
|
284
|
+
const id = `${strategy.strategy}-${language}-${Date.now()}`;
|
|
285
|
+
// Estimate lines based on strategy complexity
|
|
286
|
+
const complexityMultiplier = {
|
|
287
|
+
middleware: 1.2,
|
|
288
|
+
decorator: 0.8,
|
|
289
|
+
wrapper: 1.0,
|
|
290
|
+
'per-route': 1.5,
|
|
291
|
+
'per-function': 1.8,
|
|
292
|
+
centralized: 0.7,
|
|
293
|
+
distributed: 1.5,
|
|
294
|
+
aspect: 0.9,
|
|
295
|
+
filter: 1.0,
|
|
296
|
+
interceptor: 1.1,
|
|
297
|
+
guard: 0.9,
|
|
298
|
+
policy: 1.0,
|
|
299
|
+
dependency: 0.8,
|
|
300
|
+
mixin: 0.7,
|
|
301
|
+
custom: 1.3,
|
|
302
|
+
};
|
|
303
|
+
const baseLines = 50;
|
|
304
|
+
const multiplier = complexityMultiplier[strategy.strategy] ?? 1.0;
|
|
305
|
+
const estimatedLines = Math.round(baseLines * multiplier);
|
|
306
|
+
const approach = {
|
|
307
|
+
id,
|
|
308
|
+
name: strategy.name,
|
|
309
|
+
description: strategy.description,
|
|
310
|
+
strategy: strategy.strategy,
|
|
311
|
+
language,
|
|
312
|
+
targetFiles: relevantFiles.slice(0, 5),
|
|
313
|
+
followsPatterns: relevantPatterns.slice(0, 3),
|
|
314
|
+
estimatedLinesAdded: estimatedLines,
|
|
315
|
+
estimatedLinesModified: Math.round(relevantFiles.length * 5),
|
|
316
|
+
};
|
|
317
|
+
if (framework) {
|
|
318
|
+
approach.framework = framework;
|
|
319
|
+
}
|
|
320
|
+
if (strategy.newFiles) {
|
|
321
|
+
approach.newFiles = strategy.newFiles;
|
|
322
|
+
}
|
|
323
|
+
if (strategy.template) {
|
|
324
|
+
approach.template = strategy.template;
|
|
325
|
+
}
|
|
326
|
+
if (strategy.frameworkNotes) {
|
|
327
|
+
approach.frameworkNotes = strategy.frameworkNotes;
|
|
328
|
+
}
|
|
329
|
+
return approach;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Create a custom/hybrid approach
|
|
333
|
+
*/
|
|
334
|
+
createCustomApproach(task, _category, language, relevantFiles) {
|
|
335
|
+
return {
|
|
336
|
+
id: `custom-${language}-${Date.now()}`,
|
|
337
|
+
name: 'Custom Implementation',
|
|
338
|
+
description: `A custom implementation tailored to the specific requirements of: ${task.description}`,
|
|
339
|
+
strategy: 'custom',
|
|
340
|
+
language,
|
|
341
|
+
targetFiles: relevantFiles.slice(0, 3),
|
|
342
|
+
estimatedLinesAdded: 80,
|
|
343
|
+
estimatedLinesModified: Math.round(relevantFiles.length * 8),
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Create a fallback approach when no strategies are available
|
|
348
|
+
*/
|
|
349
|
+
createFallbackApproach(_task, category, language) {
|
|
350
|
+
return {
|
|
351
|
+
id: `fallback-${language}-${Date.now()}`,
|
|
352
|
+
name: 'Generic Implementation',
|
|
353
|
+
description: `A generic implementation for ${category} in ${language}. No specific framework strategies available.`,
|
|
354
|
+
strategy: 'custom',
|
|
355
|
+
language,
|
|
356
|
+
targetFiles: [],
|
|
357
|
+
estimatedLinesAdded: 100,
|
|
358
|
+
estimatedLinesModified: 20,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
// ============================================================================
|
|
363
|
+
// Factory Function
|
|
364
|
+
// ============================================================================
|
|
365
|
+
/**
|
|
366
|
+
* Create an approach generator
|
|
367
|
+
*/
|
|
368
|
+
export function createApproachGenerator(config) {
|
|
369
|
+
return new ApproachGenerator(config);
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=approach-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approach-generator.js","sourceRoot":"","sources":["../../src/simulation/approach-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAQlC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GAEhB,MAAM,gCAAgC,CAAC;AAmBxC,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E,MAAM,mBAAmB,GAAsC;IAC7D,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,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AY,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE;YACxC,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EAAE,gCAAgC,QAAQ,OAAO,QAAQ,+CAA+C;YACnH,QAAQ,EAAE,QAAQ;YAClB,QAAQ;YACR,WAAW,EAAE,EAAE;YACf,mBAAmB,EAAE,GAAG;YACxB,sBAAsB,EAAE,EAAE;SAC3B,CAAC;IACJ,CAAC;CACF;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAA+B;IACrE,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Speculative Execution Engine
|
|
3
|
+
*
|
|
4
|
+
* Simulates multiple implementation approaches BEFORE code generation,
|
|
5
|
+
* scoring them by friction, impact, and pattern alignment.
|
|
6
|
+
*
|
|
7
|
+
* @module simulation
|
|
8
|
+
*/
|
|
9
|
+
export * from './types.js';
|
|
10
|
+
export * from './language-strategies/index.js';
|
|
11
|
+
export { ApproachGenerator, createApproachGenerator, type ApproachGeneratorConfig, type GeneratedApproaches, } from './approach-generator.js';
|
|
12
|
+
export * from './scorers/index.js';
|
|
13
|
+
export { SimulationEngine, createSimulationEngine, type SimulationEngineConfig, } from './simulation-engine.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simulation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,gCAAgC,CAAC;AAG/C,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Speculative Execution Engine
|
|
3
|
+
*
|
|
4
|
+
* Simulates multiple implementation approaches BEFORE code generation,
|
|
5
|
+
* scoring them by friction, impact, and pattern alignment.
|
|
6
|
+
*
|
|
7
|
+
* @module simulation
|
|
8
|
+
*/
|
|
9
|
+
// Types
|
|
10
|
+
export * from './types.js';
|
|
11
|
+
// Language Strategies
|
|
12
|
+
export * from './language-strategies/index.js';
|
|
13
|
+
// Approach Generator
|
|
14
|
+
export { ApproachGenerator, createApproachGenerator, } from './approach-generator.js';
|
|
15
|
+
// Scorers
|
|
16
|
+
export * from './scorers/index.js';
|
|
17
|
+
// Simulation Engine
|
|
18
|
+
export { SimulationEngine, createSimulationEngine, } from './simulation-engine.js';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simulation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,QAAQ;AACR,cAAc,YAAY,CAAC;AAE3B,sBAAsB;AACtB,cAAc,gCAAgC,CAAC;AAE/C,qBAAqB;AACrB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GAGxB,MAAM,yBAAyB,CAAC;AAEjC,UAAU;AACV,cAAc,oBAAoB,CAAC;AAEnC,oBAAoB;AACpB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C# Language Strategies
|
|
3
|
+
*
|
|
4
|
+
* Strategies for ASP.NET Core framework.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies/csharp-strategies
|
|
7
|
+
*/
|
|
8
|
+
import type { TaskCategory } from '../types.js';
|
|
9
|
+
import type { FrameworkDefinition, LanguageStrategyProvider, StrategyTemplate } from './types.js';
|
|
10
|
+
export declare class CSharpStrategyProvider implements LanguageStrategyProvider {
|
|
11
|
+
readonly language: "csharp";
|
|
12
|
+
readonly frameworks: FrameworkDefinition[];
|
|
13
|
+
getStrategies(category: TaskCategory, framework?: string): StrategyTemplate[];
|
|
14
|
+
detectFramework(content: string, _filePath: string): string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const csharpStrategyProvider: CSharpStrategyProvider;
|
|
17
|
+
//# sourceMappingURL=csharp-strategies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csharp-strategies.d.ts","sourceRoot":"","sources":["../../../src/simulation/language-strategies/csharp-strategies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAuFlG,qBAAa,sBAAuB,YAAW,wBAAwB;IACrE,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAU;IACtC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,EAAE,CAAsB;IAEhE,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAa7E,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAenE;AAED,eAAO,MAAM,sBAAsB,wBAA+B,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C# Language Strategies
|
|
3
|
+
*
|
|
4
|
+
* Strategies for ASP.NET Core framework.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies/csharp-strategies
|
|
7
|
+
*/
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// ASP.NET Core Strategies
|
|
10
|
+
// ============================================================================
|
|
11
|
+
const ASPNET_STRATEGIES = [
|
|
12
|
+
{
|
|
13
|
+
strategy: 'middleware',
|
|
14
|
+
name: 'ASP.NET Middleware',
|
|
15
|
+
description: 'Implement as ASP.NET Core middleware',
|
|
16
|
+
applicableCategories: ['logging', 'authentication', 'rate-limiting', 'error-handling'],
|
|
17
|
+
filePatterns: ['Middleware', 'Middlewares'],
|
|
18
|
+
pros: ['Pipeline pattern', 'Full request access', 'Standard pattern'],
|
|
19
|
+
cons: ['Order-dependent', 'Global by default'],
|
|
20
|
+
estimatedLines: 40,
|
|
21
|
+
template: `public class {{Name}}Middleware\n{\n private readonly RequestDelegate _next;\n public {{Name}}Middleware(RequestDelegate next) => _next = next;\n public async Task InvokeAsync(HttpContext context)\n {\n await _next(context);\n }\n}`,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
strategy: 'filter',
|
|
25
|
+
name: 'Action Filter',
|
|
26
|
+
description: 'Implement as an MVC action filter',
|
|
27
|
+
applicableCategories: ['logging', 'authorization', 'validation', 'caching'],
|
|
28
|
+
filePatterns: ['Filters', 'Filter'],
|
|
29
|
+
pros: ['MVC-aware', 'Access to action context', 'Attribute-based'],
|
|
30
|
+
cons: ['Only for MVC actions'],
|
|
31
|
+
estimatedLines: 35,
|
|
32
|
+
template: `public class {{Name}}Filter : IActionFilter\n{\n public void OnActionExecuting(ActionExecutingContext context) { }\n public void OnActionExecuted(ActionExecutedContext context) { }\n}`,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
strategy: 'decorator',
|
|
36
|
+
name: 'Custom Attribute',
|
|
37
|
+
description: 'Create a custom attribute for declarative behavior',
|
|
38
|
+
applicableCategories: ['authorization', 'caching', 'rate-limiting', 'validation'],
|
|
39
|
+
filePatterns: ['Attributes', 'Attribute'],
|
|
40
|
+
pros: ['Declarative', 'Self-documenting', 'Reusable'],
|
|
41
|
+
cons: ['Requires filter or middleware support'],
|
|
42
|
+
estimatedLines: 25,
|
|
43
|
+
template: `[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]\npublic class {{Name}}Attribute : Attribute\n{\n public string Value { get; set; }\n}`,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
strategy: 'policy',
|
|
47
|
+
name: 'Authorization Policy',
|
|
48
|
+
description: 'Create an authorization policy with requirements',
|
|
49
|
+
applicableCategories: ['authorization'],
|
|
50
|
+
filePatterns: ['Authorization', 'Policies', 'Requirements'],
|
|
51
|
+
pros: ['Built-in pattern', 'Composable', 'Testable'],
|
|
52
|
+
cons: ['Only for authorization'],
|
|
53
|
+
estimatedLines: 50,
|
|
54
|
+
template: `public class {{Name}}Requirement : IAuthorizationRequirement { }\n\npublic class {{Name}}Handler : AuthorizationHandler<{{Name}}Requirement>\n{\n protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, {{Name}}Requirement requirement)\n {\n context.Succeed(requirement);\n return Task.CompletedTask;\n }\n}`,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
strategy: 'centralized',
|
|
58
|
+
name: 'Service Class',
|
|
59
|
+
description: 'Create a dedicated service with DI',
|
|
60
|
+
applicableCategories: ['authentication', 'data-access', 'caching'],
|
|
61
|
+
filePatterns: ['Services', 'Service'],
|
|
62
|
+
pros: ['Clean architecture', 'DI-friendly', 'Testable'],
|
|
63
|
+
cons: ['Manual invocation'],
|
|
64
|
+
estimatedLines: 55,
|
|
65
|
+
template: `public interface I{{Name}}Service\n{\n Task ProcessAsync();\n}\n\npublic class {{Name}}Service : I{{Name}}Service\n{\n public async Task ProcessAsync() { }\n}`,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
strategy: 'guard',
|
|
69
|
+
name: '[Authorize] Attribute',
|
|
70
|
+
description: 'Use built-in authorization attributes',
|
|
71
|
+
applicableCategories: ['authorization', 'authentication'],
|
|
72
|
+
filePatterns: ['Controllers', 'Controller'],
|
|
73
|
+
pros: ['Built-in', 'Simple', 'Policy-based'],
|
|
74
|
+
cons: ['Limited customization without policies'],
|
|
75
|
+
estimatedLines: 5,
|
|
76
|
+
template: `[Authorize(Policy = "{{Name}}")]\npublic IActionResult SecureAction() => Ok();`,
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
const ASPNET_FRAMEWORK = {
|
|
80
|
+
name: 'aspnet',
|
|
81
|
+
language: 'csharp',
|
|
82
|
+
detectPatterns: ['WebApplication', 'IActionResult', '[ApiController]', '[HttpGet]', '[HttpPost]', 'ControllerBase'],
|
|
83
|
+
importPatterns: ['Microsoft.AspNetCore', 'using Microsoft.AspNetCore'],
|
|
84
|
+
strategies: ASPNET_STRATEGIES,
|
|
85
|
+
};
|
|
86
|
+
// ============================================================================
|
|
87
|
+
// C# Strategy Provider
|
|
88
|
+
// ============================================================================
|
|
89
|
+
export class CSharpStrategyProvider {
|
|
90
|
+
language = 'csharp';
|
|
91
|
+
frameworks = [ASPNET_FRAMEWORK];
|
|
92
|
+
getStrategies(category, framework) {
|
|
93
|
+
const fw = framework
|
|
94
|
+
? this.frameworks.find(f => f.name === framework)
|
|
95
|
+
: this.frameworks[0];
|
|
96
|
+
if (!fw)
|
|
97
|
+
return [];
|
|
98
|
+
return fw.strategies.filter(s => s.applicableCategories.includes(category) ||
|
|
99
|
+
s.applicableCategories.includes('generic'));
|
|
100
|
+
}
|
|
101
|
+
detectFramework(content, _filePath) {
|
|
102
|
+
for (const fw of this.frameworks) {
|
|
103
|
+
for (const pattern of fw.importPatterns) {
|
|
104
|
+
if (content.includes(pattern)) {
|
|
105
|
+
return fw.name;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
for (const pattern of fw.detectPatterns) {
|
|
109
|
+
if (content.includes(pattern)) {
|
|
110
|
+
return fw.name;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export const csharpStrategyProvider = new CSharpStrategyProvider();
|
|
118
|
+
//# sourceMappingURL=csharp-strategies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csharp-strategies.js","sourceRoot":"","sources":["../../../src/simulation/language-strategies/csharp-strategies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E,MAAM,iBAAiB,GAAuB;IAC5C;QACE,QAAQ,EAAE,YAAY;QACtB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,sCAAsC;QACnD,oBAAoB,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,CAAC;QACtF,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;QAC3C,IAAI,EAAE,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,kBAAkB,CAAC;QACrE,IAAI,EAAE,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;QAC9C,cAAc,EAAE,EAAE;QAClB,QAAQ,EAAE,+PAA+P;KAC1Q;IACD;QACE,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,mCAAmC;QAChD,oBAAoB,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,CAAC;QAC3E,YAAY,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;QACnC,IAAI,EAAE,CAAC,WAAW,EAAE,0BAA0B,EAAE,iBAAiB,CAAC;QAClE,IAAI,EAAE,CAAC,sBAAsB,CAAC;QAC9B,cAAc,EAAE,EAAE;QAClB,QAAQ,EAAE,+LAA+L;KAC1M;IACD;QACE,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,oDAAoD;QACjE,oBAAoB,EAAE,CAAC,eAAe,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,CAAC;QACjF,YAAY,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;QACzC,IAAI,EAAE,CAAC,aAAa,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AAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC9B,OAAO,EAAE,CAAC,IAAI,CAAC;gBACjB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Strategies Index
|
|
3
|
+
*
|
|
4
|
+
* Exports all language strategy providers and utilities.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies
|
|
7
|
+
*/
|
|
8
|
+
import type { CallGraphLanguage } from '../../call-graph/types.js';
|
|
9
|
+
import type { TaskCategory } from '../types.js';
|
|
10
|
+
import type { LanguageStrategyProvider, StrategyTemplate } from './types.js';
|
|
11
|
+
export * from './types.js';
|
|
12
|
+
export { typescriptStrategyProvider } from './typescript-strategies.js';
|
|
13
|
+
export { pythonStrategyProvider } from './python-strategies.js';
|
|
14
|
+
export { javaStrategyProvider } from './java-strategies.js';
|
|
15
|
+
export { csharpStrategyProvider } from './csharp-strategies.js';
|
|
16
|
+
export { phpStrategyProvider } from './php-strategies.js';
|
|
17
|
+
/**
|
|
18
|
+
* Get strategy provider for a language
|
|
19
|
+
*/
|
|
20
|
+
export declare function getStrategyProvider(language: CallGraphLanguage): LanguageStrategyProvider | null;
|
|
21
|
+
/**
|
|
22
|
+
* Get strategies for a language and task category
|
|
23
|
+
*/
|
|
24
|
+
export declare function getStrategiesForTask(language: CallGraphLanguage, category: TaskCategory, framework?: string): StrategyTemplate[];
|
|
25
|
+
/**
|
|
26
|
+
* Detect task category from description
|
|
27
|
+
*/
|
|
28
|
+
export declare function detectTaskCategory(description: string): TaskCategory;
|
|
29
|
+
/**
|
|
30
|
+
* Detect framework from file content
|
|
31
|
+
*/
|
|
32
|
+
export declare function detectFramework(content: string, filePath: string, language: CallGraphLanguage): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Get all supported languages
|
|
35
|
+
*/
|
|
36
|
+
export declare function getSupportedLanguages(): CallGraphLanguage[];
|
|
37
|
+
/**
|
|
38
|
+
* Get all frameworks for a language
|
|
39
|
+
*/
|
|
40
|
+
export declare function getFrameworksForLanguage(language: CallGraphLanguage): string[];
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simulation/language-strategies/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAU7E,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAW1D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,wBAAwB,GAAG,IAAI,CAEhG;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,YAAY,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,gBAAgB,EAAE,CAIpB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAuBpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE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