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,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,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,EAAE,SAAiB;QAChD,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACjC,KAAK,MAAM,OAAO,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;gBACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC9B,OAAO,EAAE,CAAC,IAAI,CAAC;gBACjB,CAAC;YACH,CAAC;YACD,KAAK,MAAM,OAAO,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;gBACxC,IAAI,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,MAAM,EAChB,QAAQ,EAAE,iBAAiB,GAC1B,MAAM,GAAG,IAAI,CAIf;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,iBAAiB,EAAE,CAE3D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAI9E"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Strategies Index
|
|
3
|
+
*
|
|
4
|
+
* Exports all language strategy providers and utilities.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies
|
|
7
|
+
*/
|
|
8
|
+
import { CATEGORY_KEYWORDS } from './types.js';
|
|
9
|
+
import { typescriptStrategyProvider } from './typescript-strategies.js';
|
|
10
|
+
import { pythonStrategyProvider } from './python-strategies.js';
|
|
11
|
+
import { javaStrategyProvider } from './java-strategies.js';
|
|
12
|
+
import { csharpStrategyProvider } from './csharp-strategies.js';
|
|
13
|
+
import { phpStrategyProvider } from './php-strategies.js';
|
|
14
|
+
// Re-export types
|
|
15
|
+
export * from './types.js';
|
|
16
|
+
// Re-export providers
|
|
17
|
+
export { typescriptStrategyProvider } from './typescript-strategies.js';
|
|
18
|
+
export { pythonStrategyProvider } from './python-strategies.js';
|
|
19
|
+
export { javaStrategyProvider } from './java-strategies.js';
|
|
20
|
+
export { csharpStrategyProvider } from './csharp-strategies.js';
|
|
21
|
+
export { phpStrategyProvider } from './php-strategies.js';
|
|
22
|
+
/** All language strategy providers */
|
|
23
|
+
const PROVIDERS = new Map();
|
|
24
|
+
PROVIDERS.set('typescript', typescriptStrategyProvider);
|
|
25
|
+
PROVIDERS.set('javascript', typescriptStrategyProvider); // JS uses same strategies as TS
|
|
26
|
+
PROVIDERS.set('python', pythonStrategyProvider);
|
|
27
|
+
PROVIDERS.set('java', javaStrategyProvider);
|
|
28
|
+
PROVIDERS.set('csharp', csharpStrategyProvider);
|
|
29
|
+
PROVIDERS.set('php', phpStrategyProvider);
|
|
30
|
+
/**
|
|
31
|
+
* Get strategy provider for a language
|
|
32
|
+
*/
|
|
33
|
+
export function getStrategyProvider(language) {
|
|
34
|
+
return PROVIDERS.get(language) ?? null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get strategies for a language and task category
|
|
38
|
+
*/
|
|
39
|
+
export function getStrategiesForTask(language, category, framework) {
|
|
40
|
+
const provider = PROVIDERS.get(language);
|
|
41
|
+
if (!provider)
|
|
42
|
+
return [];
|
|
43
|
+
return provider.getStrategies(category, framework);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Detect task category from description
|
|
47
|
+
*/
|
|
48
|
+
export function detectTaskCategory(description) {
|
|
49
|
+
const descLower = description.toLowerCase();
|
|
50
|
+
let bestMatch = {
|
|
51
|
+
category: 'generic',
|
|
52
|
+
score: 0,
|
|
53
|
+
};
|
|
54
|
+
for (const { category, keywords, weight } of CATEGORY_KEYWORDS) {
|
|
55
|
+
let matchCount = 0;
|
|
56
|
+
for (const keyword of keywords) {
|
|
57
|
+
if (descLower.includes(keyword)) {
|
|
58
|
+
matchCount++;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const score = matchCount * weight;
|
|
62
|
+
if (score > bestMatch.score) {
|
|
63
|
+
bestMatch = { category, score };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return bestMatch.category;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Detect framework from file content
|
|
70
|
+
*/
|
|
71
|
+
export function detectFramework(content, filePath, language) {
|
|
72
|
+
const provider = PROVIDERS.get(language);
|
|
73
|
+
if (!provider)
|
|
74
|
+
return null;
|
|
75
|
+
return provider.detectFramework(content, filePath);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get all supported languages
|
|
79
|
+
*/
|
|
80
|
+
export function getSupportedLanguages() {
|
|
81
|
+
return Array.from(PROVIDERS.keys());
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get all frameworks for a language
|
|
85
|
+
*/
|
|
86
|
+
export function getFrameworksForLanguage(language) {
|
|
87
|
+
const provider = PROVIDERS.get(language);
|
|
88
|
+
if (!provider)
|
|
89
|
+
return [];
|
|
90
|
+
return provider.frameworks.map(f => f.name);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simulation/language-strategies/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,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;AAE1D,kBAAkB;AAClB,cAAc,YAAY,CAAC;AAE3B,sBAAsB;AACtB,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,EA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|
6
|
+
* @module simulation/language-strategies/java-strategies
|
|
7
|
+
*/
|
|
8
|
+
import type { TaskCategory } from '../types.js';
|
|
9
|
+
import type { FrameworkDefinition, LanguageStrategyProvider, StrategyTemplate } from './types.js';
|
|
10
|
+
export declare class JavaStrategyProvider implements LanguageStrategyProvider {
|
|
11
|
+
readonly language: "java";
|
|
12
|
+
readonly frameworks: FrameworkDefinition[];
|
|
13
|
+
getStrategies(category: TaskCategory, framework?: string): StrategyTemplate[];
|
|
14
|
+
detectFramework(content: string, _filePath: string): string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const javaStrategyProvider: JavaStrategyProvider;
|
|
17
|
+
//# sourceMappingURL=java-strategies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-strategies.d.ts","sourceRoot":"","sources":["../../../src/simulation/language-strategies/java-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;AAwFlG,qBAAa,oBAAqB,YAAW,wBAAwB;IACnE,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAU;IACpC,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,oBAAoB,sBAA6B,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java Language Strategies
|
|
3
|
+
*
|
|
4
|
+
* Strategies for Spring Boot framework.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies/java-strategies
|
|
7
|
+
*/
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Spring Boot Strategies
|
|
10
|
+
// ============================================================================
|
|
11
|
+
const SPRING_STRATEGIES = [
|
|
12
|
+
{
|
|
13
|
+
strategy: 'aspect',
|
|
14
|
+
name: 'Spring AOP Aspect',
|
|
15
|
+
description: 'Implement as an aspect using Spring AOP',
|
|
16
|
+
applicableCategories: ['logging', 'caching', 'rate-limiting', 'authorization'],
|
|
17
|
+
filePatterns: ['aspect', 'aspects', 'aop'],
|
|
18
|
+
pros: ['Non-invasive', 'Powerful pointcut expressions', 'Separation of concerns'],
|
|
19
|
+
cons: ['Can be "magical"', 'Debugging complexity', 'Learning curve'],
|
|
20
|
+
estimatedLines: 45,
|
|
21
|
+
template: `@Aspect\n@Component\npublic class {{Name}}Aspect {\n @Around("@annotation({{name}})")\n public Object around(ProceedingJoinPoint pjp) throws Throwable {\n return pjp.proceed();\n }\n}`,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
strategy: 'filter',
|
|
25
|
+
name: 'Servlet Filter',
|
|
26
|
+
description: 'Implement as a servlet filter',
|
|
27
|
+
applicableCategories: ['authentication', 'logging', 'rate-limiting'],
|
|
28
|
+
filePatterns: ['filter', 'filters', 'security'],
|
|
29
|
+
pros: ['Low-level access', 'Standard Java EE', 'Runs before Spring'],
|
|
30
|
+
cons: ['No Spring context by default', 'More boilerplate'],
|
|
31
|
+
estimatedLines: 50,
|
|
32
|
+
template: `@Component\npublic class {{Name}}Filter implements Filter {\n @Override\n public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) {\n chain.doFilter(req, res);\n }\n}`,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
strategy: 'interceptor',
|
|
36
|
+
name: 'Spring Interceptor',
|
|
37
|
+
description: 'Implement as a Spring HandlerInterceptor',
|
|
38
|
+
applicableCategories: ['logging', 'authentication', 'rate-limiting'],
|
|
39
|
+
filePatterns: ['interceptor', 'interceptors'],
|
|
40
|
+
pros: ['Spring-aware', 'Access to handler info', 'Pre/post processing'],
|
|
41
|
+
cons: ['Only for Spring MVC', 'After filters'],
|
|
42
|
+
estimatedLines: 40,
|
|
43
|
+
template: `@Component\npublic class {{Name}}Interceptor implements HandlerInterceptor {\n @Override\n public boolean preHandle(HttpServletRequest req, HttpServletResponse res, Object handler) {\n return true;\n }\n}`,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
strategy: 'decorator',
|
|
47
|
+
name: 'Custom Annotation',
|
|
48
|
+
description: 'Create a custom annotation with AOP or argument resolver',
|
|
49
|
+
applicableCategories: ['authorization', 'caching', 'rate-limiting', 'validation'],
|
|
50
|
+
filePatterns: ['annotation', 'annotations'],
|
|
51
|
+
pros: ['Declarative', 'Self-documenting', 'Reusable'],
|
|
52
|
+
cons: ['Requires AOP or resolver setup'],
|
|
53
|
+
estimatedLines: 35,
|
|
54
|
+
template: `@Target(ElementType.METHOD)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface {{Name}} {\n String value() default "";\n}`,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
strategy: 'centralized',
|
|
58
|
+
name: 'Spring Service',
|
|
59
|
+
description: 'Create a dedicated @Service class',
|
|
60
|
+
applicableCategories: ['authentication', 'data-access', 'caching'],
|
|
61
|
+
filePatterns: ['service', 'services'],
|
|
62
|
+
pros: ['Spring standard', 'Dependency injection', 'Testable'],
|
|
63
|
+
cons: ['Manual invocation required'],
|
|
64
|
+
estimatedLines: 60,
|
|
65
|
+
template: `@Service\npublic class {{Name}}Service {\n public void process() {\n // Implementation\n }\n}`,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
strategy: 'guard',
|
|
69
|
+
name: '@PreAuthorize / Method Security',
|
|
70
|
+
description: 'Use Spring Security method-level annotations',
|
|
71
|
+
applicableCategories: ['authorization'],
|
|
72
|
+
filePatterns: ['controller', 'service'],
|
|
73
|
+
pros: ['Declarative', 'SpEL expressions', 'Built-in'],
|
|
74
|
+
cons: ['Requires Spring Security', 'Can be complex'],
|
|
75
|
+
estimatedLines: 5,
|
|
76
|
+
frameworkNotes: 'Requires @EnableMethodSecurity',
|
|
77
|
+
template: `@PreAuthorize("hasRole('ADMIN')")\npublic void adminOnly() { }`,
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
const SPRING_FRAMEWORK = {
|
|
81
|
+
name: 'spring',
|
|
82
|
+
language: 'java',
|
|
83
|
+
detectPatterns: ['@SpringBootApplication', '@RestController', '@Service', '@Autowired', '@GetMapping', '@PostMapping'],
|
|
84
|
+
importPatterns: ['org.springframework', 'import org.springframework'],
|
|
85
|
+
strategies: SPRING_STRATEGIES,
|
|
86
|
+
};
|
|
87
|
+
// ============================================================================
|
|
88
|
+
// Java Strategy Provider
|
|
89
|
+
// ============================================================================
|
|
90
|
+
export class JavaStrategyProvider {
|
|
91
|
+
language = 'java';
|
|
92
|
+
frameworks = [SPRING_FRAMEWORK];
|
|
93
|
+
getStrategies(category, framework) {
|
|
94
|
+
const fw = framework
|
|
95
|
+
? this.frameworks.find(f => f.name === framework)
|
|
96
|
+
: this.frameworks[0];
|
|
97
|
+
if (!fw)
|
|
98
|
+
return [];
|
|
99
|
+
return fw.strategies.filter(s => s.applicableCategories.includes(category) ||
|
|
100
|
+
s.applicableCategories.includes('generic'));
|
|
101
|
+
}
|
|
102
|
+
detectFramework(content, _filePath) {
|
|
103
|
+
for (const fw of this.frameworks) {
|
|
104
|
+
for (const pattern of fw.importPatterns) {
|
|
105
|
+
if (content.includes(pattern)) {
|
|
106
|
+
return fw.name;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
for (const pattern of fw.detectPatterns) {
|
|
110
|
+
if (content.includes(pattern)) {
|
|
111
|
+
return fw.name;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export const javaStrategyProvider = new JavaStrategyProvider();
|
|
119
|
+
//# sourceMappingURL=java-strategies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-strategies.js","sourceRoot":"","sources":["../../../src/simulation/language-strategies/java-strategies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E,MAAM,iBAAiB,GAAuB;IAC5C;QACE,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,yCAAyC;QACtD,oBAAoB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,CAAC;QAC9E,YAAY,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC;QAC1C,IAAI,EAAE,CAAC,cAAc,EAAE,+BAA+B,EAAE,wBAAwB,CAAC;QACjF,IAAI,EAAE,CAAC,kBAAkB,EAAE,sBAAsB,EAAE,gBAAgB,CAAC;QACpE,cAAc,EAAE,EAAE;QAClB,QAAQ,EAAE,yMAAyM;KACpN;IACD;QACE,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,+BAA+B;QAC5C,oBAAoB,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,eAAe,CAAC;QACpE,YAAY,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;QAC/C,IAAI,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,CAAC;QACpE,IAAI,EAAE,CAAC,8BAA8B,EAAE,kBAAkB,CAAC;QAC1D,cAAc,EAAE,EAAE;QAClB,QAAQ,EAAE,iNAAiN;KAC5N;IACD;QACE,QAAQ,EAAE,aAAa;QACvB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,0CAA0C;QACvD,oBAAoB,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACpE,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,CAA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AC;gBACjB,CAAC;YACH,CAAC;YACD,KAAK,MAAM,OAAO,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;gBACxC,IAAI,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,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PHP Language Strategies
|
|
3
|
+
*
|
|
4
|
+
* Strategies for Laravel framework.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies/php-strategies
|
|
7
|
+
*/
|
|
8
|
+
import type { TaskCategory } from '../types.js';
|
|
9
|
+
import type { FrameworkDefinition, LanguageStrategyProvider, StrategyTemplate } from './types.js';
|
|
10
|
+
export declare class PHPStrategyProvider implements LanguageStrategyProvider {
|
|
11
|
+
readonly language: "php";
|
|
12
|
+
readonly frameworks: FrameworkDefinition[];
|
|
13
|
+
getStrategies(category: TaskCategory, framework?: string): StrategyTemplate[];
|
|
14
|
+
detectFramework(content: string, _filePath: string): string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const phpStrategyProvider: PHPStrategyProvider;
|
|
17
|
+
//# sourceMappingURL=php-strategies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"php-strategies.d.ts","sourceRoot":"","sources":["../../../src/simulation/language-strategies/php-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;AAkGlG,qBAAa,mBAAoB,YAAW,wBAAwB;IAClE,QAAQ,CAAC,QAAQ,EAAG,KAAK,CAAU;IACnC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,EAAE,CAAuB;IAEjE,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,mBAAmB,qBAA4B,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PHP Language Strategies
|
|
3
|
+
*
|
|
4
|
+
* Strategies for Laravel framework.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies/php-strategies
|
|
7
|
+
*/
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Laravel Strategies
|
|
10
|
+
// ============================================================================
|
|
11
|
+
const LARAVEL_STRATEGIES = [
|
|
12
|
+
{
|
|
13
|
+
strategy: 'middleware',
|
|
14
|
+
name: 'Laravel Middleware',
|
|
15
|
+
description: 'Implement as Laravel HTTP middleware',
|
|
16
|
+
applicableCategories: ['authentication', 'authorization', 'rate-limiting', 'logging'],
|
|
17
|
+
filePatterns: ['Middleware', 'Http/Middleware'],
|
|
18
|
+
pros: ['Laravel standard', 'Route-assignable', 'Terminable'],
|
|
19
|
+
cons: ['Order matters', 'Global vs route middleware'],
|
|
20
|
+
estimatedLines: 30,
|
|
21
|
+
template: `class {{Name}}Middleware\n{\n public function handle(Request $request, Closure $next)\n {\n return $next($request);\n }\n}`,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
strategy: 'policy',
|
|
25
|
+
name: 'Laravel Policy',
|
|
26
|
+
description: 'Create an authorization policy',
|
|
27
|
+
applicableCategories: ['authorization'],
|
|
28
|
+
filePatterns: ['Policies', 'Policy'],
|
|
29
|
+
pros: ['Model-centric', 'Built-in pattern', 'Gate integration'],
|
|
30
|
+
cons: ['Only for authorization'],
|
|
31
|
+
estimatedLines: 40,
|
|
32
|
+
template: `class {{Name}}Policy\n{\n public function view(User $user, Model $model): bool\n {\n return true;\n }\n}`,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
strategy: 'guard',
|
|
36
|
+
name: 'Laravel Gate',
|
|
37
|
+
description: 'Define authorization gates',
|
|
38
|
+
applicableCategories: ['authorization'],
|
|
39
|
+
filePatterns: ['Providers', 'AuthServiceProvider'],
|
|
40
|
+
pros: ['Simple', 'Closure-based', 'Global'],
|
|
41
|
+
cons: ['Can become messy at scale'],
|
|
42
|
+
estimatedLines: 15,
|
|
43
|
+
template: `Gate::define('{{name}}', function (User $user) {\n return true;\n});`,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
strategy: 'centralized',
|
|
47
|
+
name: 'Laravel Service',
|
|
48
|
+
description: 'Create a service class with DI',
|
|
49
|
+
applicableCategories: ['authentication', 'data-access', 'caching'],
|
|
50
|
+
filePatterns: ['Services', 'Service'],
|
|
51
|
+
pros: ['Clean architecture', 'Testable', 'DI-friendly'],
|
|
52
|
+
cons: ['Not a Laravel convention'],
|
|
53
|
+
estimatedLines: 50,
|
|
54
|
+
template: `class {{Name}}Service\n{\n public function process(): void\n {\n // Implementation\n }\n}`,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
strategy: 'decorator',
|
|
58
|
+
name: 'Form Request',
|
|
59
|
+
description: 'Create a Form Request for validation',
|
|
60
|
+
applicableCategories: ['validation'],
|
|
61
|
+
filePatterns: ['Requests', 'Http/Requests'],
|
|
62
|
+
pros: ['Laravel standard', 'Authorization + validation', 'Reusable'],
|
|
63
|
+
cons: ['Only for validation'],
|
|
64
|
+
estimatedLines: 25,
|
|
65
|
+
template: `class {{Name}}Request extends FormRequest\n{\n public function authorize(): bool { return true; }\n public function rules(): array { return []; }\n}`,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
strategy: 'wrapper',
|
|
69
|
+
name: 'Laravel Observer',
|
|
70
|
+
description: 'Create a model observer for lifecycle events',
|
|
71
|
+
applicableCategories: ['logging', 'data-access', 'caching'],
|
|
72
|
+
filePatterns: ['Observers', 'Observer'],
|
|
73
|
+
pros: ['Model lifecycle hooks', 'Decoupled', 'Automatic'],
|
|
74
|
+
cons: ['Only for Eloquent events'],
|
|
75
|
+
estimatedLines: 35,
|
|
76
|
+
template: `class {{Name}}Observer\n{\n public function created(Model $model): void { }\n public function updated(Model $model): void { }\n}`,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
strategy: 'aspect',
|
|
80
|
+
name: 'Event Listener',
|
|
81
|
+
description: 'Create event listeners for cross-cutting concerns',
|
|
82
|
+
applicableCategories: ['logging', 'caching', 'error-handling'],
|
|
83
|
+
filePatterns: ['Listeners', 'Events'],
|
|
84
|
+
pros: ['Decoupled', 'Async-capable', 'Queued'],
|
|
85
|
+
cons: ['Event dispatch required'],
|
|
86
|
+
estimatedLines: 30,
|
|
87
|
+
template: `class {{Name}}Listener\n{\n public function handle(Event $event): void\n {\n // Implementation\n }\n}`,
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
const LARAVEL_FRAMEWORK = {
|
|
91
|
+
name: 'laravel',
|
|
92
|
+
language: 'php',
|
|
93
|
+
detectPatterns: ['Illuminate\\', 'extends Controller', 'Route::', 'Eloquent', 'artisan'],
|
|
94
|
+
importPatterns: ['use Illuminate\\', 'use App\\'],
|
|
95
|
+
strategies: LARAVEL_STRATEGIES,
|
|
96
|
+
};
|
|
97
|
+
// ============================================================================
|
|
98
|
+
// PHP Strategy Provider
|
|
99
|
+
// ============================================================================
|
|
100
|
+
export class PHPStrategyProvider {
|
|
101
|
+
language = 'php';
|
|
102
|
+
frameworks = [LARAVEL_FRAMEWORK];
|
|
103
|
+
getStrategies(category, framework) {
|
|
104
|
+
const fw = framework
|
|
105
|
+
? this.frameworks.find(f => f.name === framework)
|
|
106
|
+
: this.frameworks[0];
|
|
107
|
+
if (!fw)
|
|
108
|
+
return [];
|
|
109
|
+
return fw.strategies.filter(s => s.applicableCategories.includes(category) ||
|
|
110
|
+
s.applicableCategories.includes('generic'));
|
|
111
|
+
}
|
|
112
|
+
detectFramework(content, _filePath) {
|
|
113
|
+
for (const fw of this.frameworks) {
|
|
114
|
+
for (const pattern of fw.importPatterns) {
|
|
115
|
+
if (content.includes(pattern)) {
|
|
116
|
+
return fw.name;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
for (const pattern of fw.detectPatterns) {
|
|
120
|
+
if (content.includes(pattern)) {
|
|
121
|
+
return fw.name;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export const phpStrategyProvider = new PHPStrategyProvider();
|
|
129
|
+
//# sourceMappingURL=php-strategies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"php-strategies.js","sourceRoot":"","sources":["../../../src/simulation/language-strategies/php-strategies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,MAAM,kBAAkB,GAAuB;IAC7C;QACE,QAAQ,EAAE,YAAY;QACtB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,sCAAsC;QACnD,oBAAoB,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,CAAC;QACrF,YAAY,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;QAC/C,IAAI,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,CAAC;QAC5D,IAAI,EAAE,CAAC,eAAe,EAAE,4BAA4B,CAAC;QACrD,cAAc,EAAE,EAAE;QAClB,QAAQ,EAAE,4IAA4I;KACvJ;IACD;QACE,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,gCAAgC;QAC7C,oBAAoB,EAAE,CAAC,eAAe,CAAC;QAC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I,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;YACjD,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAEvB,IAAI,CAAC,EAAE;YAAE,OAAO,EAAE,CAAC;QAEnB,OAAO,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAC9B,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACzC,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,SAAyB,CAAC,CAC3D,CAAC;IACJ,CAAC;IAED,eAAe,CAAC,OAAe,EAAE,SAAiB;QAChD,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACjC,KAAK,MAAM,OAAO,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;gBACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC9B,OAAO,EAAE,CAAC,IAAI,CAAC;gBACjB,CAAC;YACH,CAAC;YACD,KAAK,MAAM,OAAO,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;gBACxC,IAAI,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,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python Language Strategies
|
|
3
|
+
*
|
|
4
|
+
* Strategies for FastAPI, Django, and Flask frameworks.
|
|
5
|
+
*
|
|
6
|
+
* @module simulation/language-strategies/python-strategies
|
|
7
|
+
*/
|
|
8
|
+
import type { TaskCategory } from '../types.js';
|
|
9
|
+
import type { FrameworkDefinition, LanguageStrategyProvider, StrategyTemplate } from './types.js';
|
|
10
|
+
export declare class PythonStrategyProvider implements LanguageStrategyProvider {
|
|
11
|
+
readonly language: "python";
|
|
12
|
+
readonly frameworks: FrameworkDefinition[];
|
|
13
|
+
getStrategies(category: TaskCategory, framework?: string): StrategyTemplate[];
|
|
14
|
+
detectFramework(content: string, _filePath: string): string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const pythonStrategyProvider: PythonStrategyProvider;
|
|
17
|
+
//# sourceMappingURL=python-strategies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python-strategies.d.ts","sourceRoot":"","sources":["../../../src/simulation/language-strategies/python-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;AAoLlG,qBAAa,sBAAuB,YAAW,wBAAwB;IACrE,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAU;IACtC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,EAAE,CAIxC;IAEF,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"}
|