@jterrats/smart-deployment 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -0
- package/lib/ai/agentforce-error-handler.d.ts +81 -0
- package/lib/ai/agentforce-error-handler.js +196 -0
- package/lib/ai/agentforce-error-handler.js.map +1 -0
- package/lib/ai/agentforce-priority-service.d.ts +82 -0
- package/lib/ai/agentforce-priority-service.js +257 -0
- package/lib/ai/agentforce-priority-service.js.map +1 -0
- package/lib/ai/agentforce-service.d.ts +99 -0
- package/lib/ai/agentforce-service.js +300 -0
- package/lib/ai/agentforce-service.js.map +1 -0
- package/lib/ai/circuit-breaker.d.ts +115 -0
- package/lib/ai/circuit-breaker.js +277 -0
- package/lib/ai/circuit-breaker.js.map +1 -0
- package/lib/ai/dependency-inference-service.d.ts +76 -0
- package/lib/ai/dependency-inference-service.js +220 -0
- package/lib/ai/dependency-inference-service.js.map +1 -0
- package/lib/ai/llm-provider-factory.d.ts +15 -0
- package/lib/ai/llm-provider-factory.js +36 -0
- package/lib/ai/llm-provider-factory.js.map +1 -0
- package/lib/ai/llm-provider.d.ts +27 -0
- package/lib/ai/llm-provider.js +2 -0
- package/lib/ai/llm-provider.js.map +1 -0
- package/lib/ai/openai-service.d.ts +20 -0
- package/lib/ai/openai-service.js +89 -0
- package/lib/ai/openai-service.js.map +1 -0
- package/lib/ai/prompt-builder.d.ts +79 -0
- package/lib/ai/prompt-builder.js +180 -0
- package/lib/ai/prompt-builder.js.map +1 -0
- package/lib/ai/response-parser.d.ts +67 -0
- package/lib/ai/response-parser.js +234 -0
- package/lib/ai/response-parser.js.map +1 -0
- package/lib/ai/wave-validation-service.d.ts +111 -0
- package/lib/ai/wave-validation-service.js +381 -0
- package/lib/ai/wave-validation-service.js.map +1 -0
- package/lib/analysis/analysis-reporter.d.ts +56 -0
- package/lib/analysis/analysis-reporter.js +170 -0
- package/lib/analysis/analysis-reporter.js.map +1 -0
- package/lib/analytics/error-analytics.d.ts +80 -0
- package/lib/analytics/error-analytics.js +162 -0
- package/lib/analytics/error-analytics.js.map +1 -0
- package/lib/commands/analyze.d.ts +49 -0
- package/lib/commands/analyze.js +232 -0
- package/lib/commands/analyze.js.map +1 -0
- package/lib/commands/config.d.ts +42 -0
- package/lib/commands/config.js +219 -0
- package/lib/commands/config.js.map +1 -0
- package/lib/commands/resume.d.ts +26 -0
- package/lib/commands/resume.js +69 -0
- package/lib/commands/resume.js.map +1 -0
- package/lib/commands/start.d.ts +70 -0
- package/lib/commands/start.js +659 -0
- package/lib/commands/start.js.map +1 -0
- package/lib/commands/status.d.ts +37 -0
- package/lib/commands/status.js +69 -0
- package/lib/commands/status.js.map +1 -0
- package/lib/commands/validate.d.ts +33 -0
- package/lib/commands/validate.js +66 -0
- package/lib/commands/validate.js.map +1 -0
- package/lib/config/repo-config.d.ts +22 -0
- package/lib/config/repo-config.js +31 -0
- package/lib/config/repo-config.js.map +1 -0
- package/lib/constants/agentforce-limits.d.ts +174 -0
- package/lib/constants/agentforce-limits.js +262 -0
- package/lib/constants/agentforce-limits.js.map +1 -0
- package/lib/constants/api-version.d.ts +70 -0
- package/lib/constants/api-version.js +122 -0
- package/lib/constants/api-version.js.map +1 -0
- package/lib/constants/deployment-order.d.ts +68 -0
- package/lib/constants/deployment-order.js +162 -0
- package/lib/constants/deployment-order.js.map +1 -0
- package/lib/constants/salesforce-limits.d.ts +107 -0
- package/lib/constants/salesforce-limits.js +104 -0
- package/lib/constants/salesforce-limits.js.map +1 -0
- package/lib/dependencies/circular-dependency-detector.d.ts +137 -0
- package/lib/dependencies/circular-dependency-detector.js +329 -0
- package/lib/dependencies/circular-dependency-detector.js.map +1 -0
- package/lib/dependencies/cycle-remediation-planner.d.ts +50 -0
- package/lib/dependencies/cycle-remediation-planner.js +192 -0
- package/lib/dependencies/cycle-remediation-planner.js.map +1 -0
- package/lib/dependencies/dependency-cache.d.ts +134 -0
- package/lib/dependencies/dependency-cache.js +303 -0
- package/lib/dependencies/dependency-cache.js.map +1 -0
- package/lib/dependencies/dependency-depth-calculator.d.ts +145 -0
- package/lib/dependencies/dependency-depth-calculator.js +368 -0
- package/lib/dependencies/dependency-depth-calculator.js.map +1 -0
- package/lib/dependencies/dependency-graph-builder.d.ts +151 -0
- package/lib/dependencies/dependency-graph-builder.js +411 -0
- package/lib/dependencies/dependency-graph-builder.js.map +1 -0
- package/lib/dependencies/dependency-impact-analyzer.d.ts +145 -0
- package/lib/dependencies/dependency-impact-analyzer.js +330 -0
- package/lib/dependencies/dependency-impact-analyzer.js.map +1 -0
- package/lib/dependencies/dependency-merger.d.ts +122 -0
- package/lib/dependencies/dependency-merger.js +245 -0
- package/lib/dependencies/dependency-merger.js.map +1 -0
- package/lib/dependencies/dependency-resolver.d.ts +157 -0
- package/lib/dependencies/dependency-resolver.js +298 -0
- package/lib/dependencies/dependency-resolver.js.map +1 -0
- package/lib/dependencies/dependency-validator.d.ts +123 -0
- package/lib/dependencies/dependency-validator.js +291 -0
- package/lib/dependencies/dependency-validator.js.map +1 -0
- package/lib/dependencies/graph-visualizer.d.ts +110 -0
- package/lib/dependencies/graph-visualizer.js +262 -0
- package/lib/dependencies/graph-visualizer.js.map +1 -0
- package/lib/dependencies/heuristic-inference.d.ts +136 -0
- package/lib/dependencies/heuristic-inference.js +430 -0
- package/lib/dependencies/heuristic-inference.js.map +1 -0
- package/lib/deployment/cycle-source-editor.d.ts +34 -0
- package/lib/deployment/cycle-source-editor.js +121 -0
- package/lib/deployment/cycle-source-editor.js.map +1 -0
- package/lib/deployment/deployment-error-handler.d.ts +38 -0
- package/lib/deployment/deployment-error-handler.js +79 -0
- package/lib/deployment/deployment-error-handler.js.map +1 -0
- package/lib/deployment/deployment-reporter.d.ts +63 -0
- package/lib/deployment/deployment-reporter.js +150 -0
- package/lib/deployment/deployment-reporter.js.map +1 -0
- package/lib/deployment/deployment-state-summary.d.ts +38 -0
- package/lib/deployment/deployment-state-summary.js +209 -0
- package/lib/deployment/deployment-state-summary.js.map +1 -0
- package/lib/deployment/deployment-status-service.d.ts +36 -0
- package/lib/deployment/deployment-status-service.js +128 -0
- package/lib/deployment/deployment-status-service.js.map +1 -0
- package/lib/deployment/deployment-tracker.d.ts +42 -0
- package/lib/deployment/deployment-tracker.js +79 -0
- package/lib/deployment/deployment-tracker.js.map +1 -0
- package/lib/deployment/deployment-validation-service.d.ts +28 -0
- package/lib/deployment/deployment-validation-service.js +161 -0
- package/lib/deployment/deployment-validation-service.js.map +1 -0
- package/lib/deployment/retry-handler.d.ts +37 -0
- package/lib/deployment/retry-handler.js +86 -0
- package/lib/deployment/retry-handler.js.map +1 -0
- package/lib/deployment/sf-cli-integration.d.ts +42 -0
- package/lib/deployment/sf-cli-integration.js +105 -0
- package/lib/deployment/sf-cli-integration.js.map +1 -0
- package/lib/deployment/state-manager.d.ts +61 -0
- package/lib/deployment/state-manager.js +83 -0
- package/lib/deployment/state-manager.js.map +1 -0
- package/lib/deployment/test-executor.d.ts +41 -0
- package/lib/deployment/test-executor.js +87 -0
- package/lib/deployment/test-executor.js.map +1 -0
- package/lib/errors/base-error.d.ts +24 -0
- package/lib/errors/base-error.js +66 -0
- package/lib/errors/base-error.js.map +1 -0
- package/lib/errors/dependency-error.d.ts +37 -0
- package/lib/errors/dependency-error.js +76 -0
- package/lib/errors/dependency-error.js.map +1 -0
- package/lib/errors/deployment-error.d.ts +55 -0
- package/lib/errors/deployment-error.js +132 -0
- package/lib/errors/deployment-error.js.map +1 -0
- package/lib/errors/index.d.ts +45 -0
- package/lib/errors/index.js +71 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/errors/network-error.d.ts +53 -0
- package/lib/errors/network-error.js +111 -0
- package/lib/errors/network-error.js.map +1 -0
- package/lib/errors/parsing-error.d.ts +41 -0
- package/lib/errors/parsing-error.js +69 -0
- package/lib/errors/parsing-error.js.map +1 -0
- package/lib/errors/validation-error-reporter.d.ts +34 -0
- package/lib/errors/validation-error-reporter.js +99 -0
- package/lib/errors/validation-error-reporter.js.map +1 -0
- package/lib/errors/validation-error.d.ts +58 -0
- package/lib/errors/validation-error.js +131 -0
- package/lib/errors/validation-error.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/monitoring/performance-monitor.d.ts +98 -0
- package/lib/monitoring/performance-monitor.js +260 -0
- package/lib/monitoring/performance-monitor.js.map +1 -0
- package/lib/parsers/apex-class-parser.d.ts +47 -0
- package/lib/parsers/apex-class-parser.js +368 -0
- package/lib/parsers/apex-class-parser.js.map +1 -0
- package/lib/parsers/apex-trigger-parser.d.ts +48 -0
- package/lib/parsers/apex-trigger-parser.js +229 -0
- package/lib/parsers/apex-trigger-parser.js.map +1 -0
- package/lib/parsers/aura-parser.d.ts +55 -0
- package/lib/parsers/aura-parser.js +229 -0
- package/lib/parsers/aura-parser.js.map +1 -0
- package/lib/parsers/bot-parser.d.ts +65 -0
- package/lib/parsers/bot-parser.js +225 -0
- package/lib/parsers/bot-parser.js.map +1 -0
- package/lib/parsers/custom-metadata-parser.d.ts +94 -0
- package/lib/parsers/custom-metadata-parser.js +199 -0
- package/lib/parsers/custom-metadata-parser.js.map +1 -0
- package/lib/parsers/custom-object-parser.d.ts +62 -0
- package/lib/parsers/custom-object-parser.js +297 -0
- package/lib/parsers/custom-object-parser.js.map +1 -0
- package/lib/parsers/email-template-parser.d.ts +64 -0
- package/lib/parsers/email-template-parser.js +238 -0
- package/lib/parsers/email-template-parser.js.map +1 -0
- package/lib/parsers/error-resilient-parser.d.ts +110 -0
- package/lib/parsers/error-resilient-parser.js +277 -0
- package/lib/parsers/error-resilient-parser.js.map +1 -0
- package/lib/parsers/flexipage-parser.d.ts +64 -0
- package/lib/parsers/flexipage-parser.js +196 -0
- package/lib/parsers/flexipage-parser.js.map +1 -0
- package/lib/parsers/flow-parser.d.ts +54 -0
- package/lib/parsers/flow-parser.js +287 -0
- package/lib/parsers/flow-parser.js.map +1 -0
- package/lib/parsers/genai-prompt-parser.d.ts +67 -0
- package/lib/parsers/genai-prompt-parser.js +160 -0
- package/lib/parsers/genai-prompt-parser.js.map +1 -0
- package/lib/parsers/layout-parser.d.ts +64 -0
- package/lib/parsers/layout-parser.js +267 -0
- package/lib/parsers/layout-parser.js.map +1 -0
- package/lib/parsers/lwc-parser.d.ts +60 -0
- package/lib/parsers/lwc-parser.js +264 -0
- package/lib/parsers/lwc-parser.js.map +1 -0
- package/lib/parsers/permission-set-parser.d.ts +86 -0
- package/lib/parsers/permission-set-parser.js +152 -0
- package/lib/parsers/permission-set-parser.js.map +1 -0
- package/lib/parsers/profile-parser.d.ts +81 -0
- package/lib/parsers/profile-parser.js +141 -0
- package/lib/parsers/profile-parser.js.map +1 -0
- package/lib/parsers/visualforce-parser.d.ts +47 -0
- package/lib/parsers/visualforce-parser.js +180 -0
- package/lib/parsers/visualforce-parser.js.map +1 -0
- package/lib/provisioning/data-provisioner.d.ts +88 -0
- package/lib/provisioning/data-provisioner.js +257 -0
- package/lib/provisioning/data-provisioner.js.map +1 -0
- package/lib/scanner/custom-structure-scanner.d.ts +66 -0
- package/lib/scanner/custom-structure-scanner.js +229 -0
- package/lib/scanner/custom-structure-scanner.js.map +1 -0
- package/lib/scanner/forceignore-parser.d.ts +69 -0
- package/lib/scanner/forceignore-parser.js +195 -0
- package/lib/scanner/forceignore-parser.js.map +1 -0
- package/lib/scanner/metadata-format-scanner.d.ts +77 -0
- package/lib/scanner/metadata-format-scanner.js +282 -0
- package/lib/scanner/metadata-format-scanner.js.map +1 -0
- package/lib/scanner/monorepo-scanner.d.ts +71 -0
- package/lib/scanner/monorepo-scanner.js +225 -0
- package/lib/scanner/monorepo-scanner.js.map +1 -0
- package/lib/scanner/project-validator.d.ts +55 -0
- package/lib/scanner/project-validator.js +235 -0
- package/lib/scanner/project-validator.js.map +1 -0
- package/lib/scanner/sfdx-project-detector.d.ts +86 -0
- package/lib/scanner/sfdx-project-detector.js +240 -0
- package/lib/scanner/sfdx-project-detector.js.map +1 -0
- package/lib/scanner/structure-validator.d.ts +64 -0
- package/lib/scanner/structure-validator.js +296 -0
- package/lib/scanner/structure-validator.js.map +1 -0
- package/lib/services/metadata-scanner-service.d.ts +64 -0
- package/lib/services/metadata-scanner-service.js +651 -0
- package/lib/services/metadata-scanner-service.js.map +1 -0
- package/lib/types/agentforce.d.ts +157 -0
- package/lib/types/agentforce.js +2 -0
- package/lib/types/agentforce.js.map +1 -0
- package/lib/types/dependency.d.ts +98 -0
- package/lib/types/dependency.js +5 -0
- package/lib/types/dependency.js.map +1 -0
- package/lib/types/deployment-plan.d.ts +81 -0
- package/lib/types/deployment-plan.js +6 -0
- package/lib/types/deployment-plan.js.map +1 -0
- package/lib/types/deployment.d.ts +88 -0
- package/lib/types/deployment.js +5 -0
- package/lib/types/deployment.js.map +1 -0
- package/lib/types/graph.d.ts +35 -0
- package/lib/types/graph.js +5 -0
- package/lib/types/graph.js.map +1 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/index.js +17 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/metadata.d.ts +101 -0
- package/lib/types/metadata.js +13 -0
- package/lib/types/metadata.js.map +1 -0
- package/lib/types/project.d.ts +156 -0
- package/lib/types/project.js +56 -0
- package/lib/types/project.js.map +1 -0
- package/lib/types/salesforce/apex.d.ts +94 -0
- package/lib/types/salesforce/apex.js +6 -0
- package/lib/types/salesforce/apex.js.map +1 -0
- package/lib/types/salesforce/aura.d.ts +150 -0
- package/lib/types/salesforce/aura.js +6 -0
- package/lib/types/salesforce/aura.js.map +1 -0
- package/lib/types/salesforce/bot.d.ts +293 -0
- package/lib/types/salesforce/bot.js +6 -0
- package/lib/types/salesforce/bot.js.map +1 -0
- package/lib/types/salesforce/common.d.ts +15 -0
- package/lib/types/salesforce/common.js +5 -0
- package/lib/types/salesforce/common.js.map +1 -0
- package/lib/types/salesforce/custom-metadata.d.ts +92 -0
- package/lib/types/salesforce/custom-metadata.js +6 -0
- package/lib/types/salesforce/custom-metadata.js.map +1 -0
- package/lib/types/salesforce/email.d.ts +56 -0
- package/lib/types/salesforce/email.js +6 -0
- package/lib/types/salesforce/email.js.map +1 -0
- package/lib/types/salesforce/flexipage.d.ts +149 -0
- package/lib/types/salesforce/flexipage.js +6 -0
- package/lib/types/salesforce/flexipage.js.map +1 -0
- package/lib/types/salesforce/flow.d.ts +516 -0
- package/lib/types/salesforce/flow.js +6 -0
- package/lib/types/salesforce/flow.js.map +1 -0
- package/lib/types/salesforce/genai.d.ts +67 -0
- package/lib/types/salesforce/genai.js +6 -0
- package/lib/types/salesforce/genai.js.map +1 -0
- package/lib/types/salesforce/index.d.ts +27 -0
- package/lib/types/salesforce/index.js +43 -0
- package/lib/types/salesforce/index.js.map +1 -0
- package/lib/types/salesforce/layout.d.ts +236 -0
- package/lib/types/salesforce/layout.js +6 -0
- package/lib/types/salesforce/layout.js.map +1 -0
- package/lib/types/salesforce/lwc.d.ts +123 -0
- package/lib/types/salesforce/lwc.js +6 -0
- package/lib/types/salesforce/lwc.js.map +1 -0
- package/lib/types/salesforce/object.d.ts +427 -0
- package/lib/types/salesforce/object.js +6 -0
- package/lib/types/salesforce/object.js.map +1 -0
- package/lib/types/salesforce/parser-types.d.ts +79 -0
- package/lib/types/salesforce/parser-types.js +80 -0
- package/lib/types/salesforce/parser-types.js.map +1 -0
- package/lib/types/salesforce/permission.d.ts +289 -0
- package/lib/types/salesforce/permission.js +6 -0
- package/lib/types/salesforce/permission.js.map +1 -0
- package/lib/types/salesforce/resource.d.ts +93 -0
- package/lib/types/salesforce/resource.js +6 -0
- package/lib/types/salesforce/resource.js.map +1 -0
- package/lib/types/salesforce/visualforce.d.ts +70 -0
- package/lib/types/salesforce/visualforce.js +6 -0
- package/lib/types/salesforce/visualforce.js.map +1 -0
- package/lib/utils/cache-manager.d.ts +158 -0
- package/lib/utils/cache-manager.js +429 -0
- package/lib/utils/cache-manager.js.map +1 -0
- package/lib/utils/deployment-plan-manager.d.ts +40 -0
- package/lib/utils/deployment-plan-manager.js +183 -0
- package/lib/utils/deployment-plan-manager.js.map +1 -0
- package/lib/utils/error-aggregator.d.ts +117 -0
- package/lib/utils/error-aggregator.js +268 -0
- package/lib/utils/error-aggregator.js.map +1 -0
- package/lib/utils/file-system.d.ts +62 -0
- package/lib/utils/file-system.js +167 -0
- package/lib/utils/file-system.js.map +1 -0
- package/lib/utils/functional.d.ts +52 -0
- package/lib/utils/functional.js +61 -0
- package/lib/utils/functional.js.map +1 -0
- package/lib/utils/graph-algorithms.d.ts +53 -0
- package/lib/utils/graph-algorithms.js +177 -0
- package/lib/utils/graph-algorithms.js.map +1 -0
- package/lib/utils/logger.d.ts +154 -0
- package/lib/utils/logger.js +327 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/network-handler.d.ts +64 -0
- package/lib/utils/network-handler.js +147 -0
- package/lib/utils/network-handler.js.map +1 -0
- package/lib/utils/performance.d.ts +148 -0
- package/lib/utils/performance.js +294 -0
- package/lib/utils/performance.js.map +1 -0
- package/lib/utils/string.d.ts +197 -0
- package/lib/utils/string.js +331 -0
- package/lib/utils/string.js.map +1 -0
- package/lib/utils/xml.d.ts +97 -0
- package/lib/utils/xml.js +227 -0
- package/lib/utils/xml.js.map +1 -0
- package/lib/validators/xml-metadata-validator.d.ts +106 -0
- package/lib/validators/xml-metadata-validator.js +509 -0
- package/lib/validators/xml-metadata-validator.js.map +1 -0
- package/lib/waves/priority-wave-generator-ai.d.ts +85 -0
- package/lib/waves/priority-wave-generator-ai.js +191 -0
- package/lib/waves/priority-wave-generator-ai.js.map +1 -0
- package/lib/waves/priority-wave-generator.d.ts +47 -0
- package/lib/waves/priority-wave-generator.js +88 -0
- package/lib/waves/priority-wave-generator.js.map +1 -0
- package/lib/waves/test-optimizer.d.ts +155 -0
- package/lib/waves/test-optimizer.js +290 -0
- package/lib/waves/test-optimizer.js.map +1 -0
- package/lib/waves/wave-builder.d.ts +147 -0
- package/lib/waves/wave-builder.js +286 -0
- package/lib/waves/wave-builder.js.map +1 -0
- package/lib/waves/wave-diff-generator.d.ts +17 -0
- package/lib/waves/wave-diff-generator.js +6 -0
- package/lib/waves/wave-diff-generator.js.map +1 -0
- package/lib/waves/wave-executor.d.ts +33 -0
- package/lib/waves/wave-executor.js +50 -0
- package/lib/waves/wave-executor.js.map +1 -0
- package/lib/waves/wave-merger.d.ts +96 -0
- package/lib/waves/wave-merger.js +181 -0
- package/lib/waves/wave-merger.js.map +1 -0
- package/lib/waves/wave-metadata-generator.d.ts +13 -0
- package/lib/waves/wave-metadata-generator.js +12 -0
- package/lib/waves/wave-metadata-generator.js.map +1 -0
- package/lib/waves/wave-splitter.d.ts +154 -0
- package/lib/waves/wave-splitter.js +307 -0
- package/lib/waves/wave-splitter.js.map +1 -0
- package/lib/waves/wave-validator.d.ts +17 -0
- package/lib/waves/wave-validator.js +15 -0
- package/lib/waves/wave-validator.js.map +1 -0
- package/messages/analyze.json +18 -0
- package/messages/config.json +29 -0
- package/messages/resume.json +9 -0
- package/messages/start.json +24 -0
- package/messages/status.json +8 -0
- package/messages/validate.json +9 -0
- package/npm-shrinkwrap.json +25676 -0
- package/oclif.lock +11988 -0
- package/oclif.manifest.json +589 -0
- package/package.json +224 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI-Enhanced Priority Wave Generator - US-042 + US-057
|
|
3
|
+
* Extends priority wave generation with Agentforce AI
|
|
4
|
+
*
|
|
5
|
+
* @ac US-042-AC-1: Use deployment order constants
|
|
6
|
+
* @ac US-042-AC-2: Objects before classes before triggers
|
|
7
|
+
* @ac US-042-AC-3: Break ties using priorities
|
|
8
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
9
|
+
* @ac US-042-AC-5: Report priority decisions
|
|
10
|
+
* @ac US-042-AC-6: Validate no dependency violations
|
|
11
|
+
* @ac US-057-AC-5: Merge with static priorities
|
|
12
|
+
* @ac US-057-AC-6: Report AI decisions
|
|
13
|
+
*
|
|
14
|
+
* @issue #42, #57
|
|
15
|
+
*/
|
|
16
|
+
import type { AgentforcePriorityService } from '../ai/agentforce-priority-service.js';
|
|
17
|
+
import type { NodeId } from '../types/dependency.js';
|
|
18
|
+
import type { PriorityOverride } from '../types/deployment-plan.js';
|
|
19
|
+
import type { MetadataComponent } from '../types/metadata.js';
|
|
20
|
+
import { PriorityWaveGenerator, type PriorityOptions } from './priority-wave-generator.js';
|
|
21
|
+
import type { Wave } from './wave-builder.js';
|
|
22
|
+
export type AIEnhancedOptions = PriorityOptions & {
|
|
23
|
+
agentforceService?: AgentforcePriorityService;
|
|
24
|
+
orgType?: string;
|
|
25
|
+
industry?: string;
|
|
26
|
+
autoAIForUnknown?: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* AI-Enhanced Priority Wave Generator
|
|
30
|
+
*
|
|
31
|
+
* Combines static priority rules with AI-powered recommendations
|
|
32
|
+
* for intelligent deployment ordering.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* const aiService = new AgentforcePriorityService({ apiKey: 'xxx' });
|
|
36
|
+
* const generator = new AIEnhancedPriorityWaveGenerator({
|
|
37
|
+
* agentforceService: aiService,
|
|
38
|
+
* orgType: 'Production',
|
|
39
|
+
* industry: 'Fintech'
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* const waves = await generator.applyPriorityWavesAsync(baseWaves, components);
|
|
43
|
+
*/
|
|
44
|
+
export declare class AIEnhancedPriorityWaveGenerator extends PriorityWaveGenerator {
|
|
45
|
+
private agentforceService?;
|
|
46
|
+
private aiAnalysisResult?;
|
|
47
|
+
private orgType?;
|
|
48
|
+
private industry?;
|
|
49
|
+
private autoAIForUnknown;
|
|
50
|
+
private unknownTypesDetected;
|
|
51
|
+
constructor(options?: AIEnhancedOptions);
|
|
52
|
+
/**
|
|
53
|
+
* @ac US-057-AC-5: Merge with static priorities
|
|
54
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
55
|
+
*/
|
|
56
|
+
applyPriorityWavesAsync(waves: Wave[], components: Map<NodeId, MetadataComponent>): Promise<Wave[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Detect components with unknown metadata types (priority 99 or not in DEPLOYMENT_ORDER)
|
|
59
|
+
*/
|
|
60
|
+
private detectUnknownTypes;
|
|
61
|
+
/**
|
|
62
|
+
* @ac US-057-AC-5: Merge with static priorities
|
|
63
|
+
*/
|
|
64
|
+
private mergeAIPriorities;
|
|
65
|
+
/**
|
|
66
|
+
* @ac US-057-AC-6: Report AI decisions
|
|
67
|
+
*/
|
|
68
|
+
getAIReport(): string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* @ac US-057-AC-6: Report AI decisions
|
|
71
|
+
*/
|
|
72
|
+
getAIStats(): {
|
|
73
|
+
aiAdjustments: number;
|
|
74
|
+
aiExecutionTime: number;
|
|
75
|
+
tokensUsed?: number;
|
|
76
|
+
unknownTypesDetected: number;
|
|
77
|
+
unknownTypes: string[];
|
|
78
|
+
usedFallback: boolean;
|
|
79
|
+
} | undefined;
|
|
80
|
+
getAIPriorityOverrides(components: Map<NodeId, MetadataComponent>): Record<string, PriorityOverride>;
|
|
81
|
+
/**
|
|
82
|
+
* Get warning message if unknown types were detected without AI
|
|
83
|
+
*/
|
|
84
|
+
getUnknownTypesWarning(): string | undefined;
|
|
85
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI-Enhanced Priority Wave Generator - US-042 + US-057
|
|
3
|
+
* Extends priority wave generation with Agentforce AI
|
|
4
|
+
*
|
|
5
|
+
* @ac US-042-AC-1: Use deployment order constants
|
|
6
|
+
* @ac US-042-AC-2: Objects before classes before triggers
|
|
7
|
+
* @ac US-042-AC-3: Break ties using priorities
|
|
8
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
9
|
+
* @ac US-042-AC-5: Report priority decisions
|
|
10
|
+
* @ac US-042-AC-6: Validate no dependency violations
|
|
11
|
+
* @ac US-057-AC-5: Merge with static priorities
|
|
12
|
+
* @ac US-057-AC-6: Report AI decisions
|
|
13
|
+
*
|
|
14
|
+
* @issue #42, #57
|
|
15
|
+
*/
|
|
16
|
+
import { DEPLOYMENT_ORDER } from '../constants/deployment-order.js';
|
|
17
|
+
import { getLogger } from '../utils/logger.js';
|
|
18
|
+
import { PriorityWaveGenerator } from './priority-wave-generator.js';
|
|
19
|
+
const logger = getLogger('AIEnhancedPriorityWaveGenerator');
|
|
20
|
+
/**
|
|
21
|
+
* AI-Enhanced Priority Wave Generator
|
|
22
|
+
*
|
|
23
|
+
* Combines static priority rules with AI-powered recommendations
|
|
24
|
+
* for intelligent deployment ordering.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const aiService = new AgentforcePriorityService({ apiKey: 'xxx' });
|
|
28
|
+
* const generator = new AIEnhancedPriorityWaveGenerator({
|
|
29
|
+
* agentforceService: aiService,
|
|
30
|
+
* orgType: 'Production',
|
|
31
|
+
* industry: 'Fintech'
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* const waves = await generator.applyPriorityWavesAsync(baseWaves, components);
|
|
35
|
+
*/
|
|
36
|
+
export class AIEnhancedPriorityWaveGenerator extends PriorityWaveGenerator {
|
|
37
|
+
agentforceService;
|
|
38
|
+
aiAnalysisResult;
|
|
39
|
+
orgType;
|
|
40
|
+
industry;
|
|
41
|
+
autoAIForUnknown;
|
|
42
|
+
unknownTypesDetected = new Set();
|
|
43
|
+
constructor(options = {}) {
|
|
44
|
+
super(options);
|
|
45
|
+
this.agentforceService = options.agentforceService;
|
|
46
|
+
this.orgType = options.orgType;
|
|
47
|
+
this.industry = options.industry;
|
|
48
|
+
this.autoAIForUnknown = options.autoAIForUnknown ?? true;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @ac US-057-AC-5: Merge with static priorities
|
|
52
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
53
|
+
*/
|
|
54
|
+
async applyPriorityWavesAsync(waves, components) {
|
|
55
|
+
// Detect unknown metadata types
|
|
56
|
+
const unknownComponents = this.detectUnknownTypes(components);
|
|
57
|
+
if (unknownComponents.length > 0) {
|
|
58
|
+
logger.warn('Unknown metadata types detected', {
|
|
59
|
+
count: unknownComponents.length,
|
|
60
|
+
types: Array.from(this.unknownTypesDetected),
|
|
61
|
+
});
|
|
62
|
+
// Auto-enable AI for unknown types if service available
|
|
63
|
+
if (this.agentforceService && this.autoAIForUnknown) {
|
|
64
|
+
logger.info('Auto-enabling AI analysis for unknown types');
|
|
65
|
+
}
|
|
66
|
+
else if (!this.agentforceService && unknownComponents.length > 0) {
|
|
67
|
+
logger.warn('Unknown types found but no AI service configured', {
|
|
68
|
+
types: Array.from(this.unknownTypesDetected),
|
|
69
|
+
suggestion: 'Use --use-ai flag for intelligent prioritization',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Get AI recommendations if available
|
|
74
|
+
if (this.agentforceService) {
|
|
75
|
+
const componentList = Array.from(components.values());
|
|
76
|
+
// Prioritize unknown types in AI analysis
|
|
77
|
+
const componentsToAnalyze = this.autoAIForUnknown && unknownComponents.length > 0
|
|
78
|
+
? unknownComponents // Focus on unknowns first
|
|
79
|
+
: componentList;
|
|
80
|
+
this.aiAnalysisResult = await this.agentforceService.analyzePriorities(componentsToAnalyze, {
|
|
81
|
+
orgType: this.orgType,
|
|
82
|
+
industry: this.industry,
|
|
83
|
+
});
|
|
84
|
+
logger.info('AI analysis complete', {
|
|
85
|
+
adjustments: this.aiAnalysisResult.aiAdjustments,
|
|
86
|
+
executionTime: this.aiAnalysisResult.executionTime,
|
|
87
|
+
unknownTypesAnalyzed: unknownComponents.length,
|
|
88
|
+
});
|
|
89
|
+
// Merge AI recommendations into user priorities
|
|
90
|
+
this.mergeAIPriorities(components);
|
|
91
|
+
}
|
|
92
|
+
// Use base class method with enhanced priorities
|
|
93
|
+
return this.applyPriorityWaves(waves, components);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Detect components with unknown metadata types (priority 99 or not in DEPLOYMENT_ORDER)
|
|
97
|
+
*/
|
|
98
|
+
detectUnknownTypes(components) {
|
|
99
|
+
const unknownComponents = [];
|
|
100
|
+
for (const component of components.values()) {
|
|
101
|
+
const priority = DEPLOYMENT_ORDER[component.type];
|
|
102
|
+
// Unknown if priority is 99 or not defined
|
|
103
|
+
if (!priority || priority === 99) {
|
|
104
|
+
this.unknownTypesDetected.add(component.type);
|
|
105
|
+
unknownComponents.push(component);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return unknownComponents;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @ac US-057-AC-5: Merge with static priorities
|
|
112
|
+
*/
|
|
113
|
+
mergeAIPriorities(components) {
|
|
114
|
+
if (!this.aiAnalysisResult)
|
|
115
|
+
return;
|
|
116
|
+
// Access protected options from base class
|
|
117
|
+
const baseOptions = this.options;
|
|
118
|
+
const userPriorities = baseOptions.userPriorities ?? new Map();
|
|
119
|
+
for (const rec of this.aiAnalysisResult.recommendations) {
|
|
120
|
+
// Find component by name
|
|
121
|
+
const nodeId = Array.from(components.keys()).find((id) => id.endsWith(`:${rec.componentName}`));
|
|
122
|
+
if (nodeId && rec.confidence > 0.8) {
|
|
123
|
+
// Only apply if no user override exists
|
|
124
|
+
if (!userPriorities.has(nodeId)) {
|
|
125
|
+
userPriorities.set(nodeId, rec.priority);
|
|
126
|
+
logger.debug('Applied AI priority', {
|
|
127
|
+
component: nodeId,
|
|
128
|
+
priority: rec.priority,
|
|
129
|
+
reason: rec.reason,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @ac US-057-AC-6: Report AI decisions
|
|
137
|
+
*/
|
|
138
|
+
getAIReport() {
|
|
139
|
+
if (!this.aiAnalysisResult || !this.agentforceService) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
return this.agentforceService.formatDecisionReport(this.aiAnalysisResult);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @ac US-057-AC-6: Report AI decisions
|
|
146
|
+
*/
|
|
147
|
+
getAIStats() {
|
|
148
|
+
if (!this.aiAnalysisResult)
|
|
149
|
+
return undefined;
|
|
150
|
+
return {
|
|
151
|
+
aiAdjustments: this.aiAnalysisResult.aiAdjustments,
|
|
152
|
+
aiExecutionTime: this.aiAnalysisResult.executionTime,
|
|
153
|
+
tokensUsed: this.aiAnalysisResult.tokensUsed,
|
|
154
|
+
unknownTypesDetected: this.unknownTypesDetected.size,
|
|
155
|
+
unknownTypes: Array.from(this.unknownTypesDetected),
|
|
156
|
+
usedFallback: this.aiAnalysisResult.usedFallback,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
getAIPriorityOverrides(components) {
|
|
160
|
+
if (!this.aiAnalysisResult) {
|
|
161
|
+
return {};
|
|
162
|
+
}
|
|
163
|
+
const overrides = {};
|
|
164
|
+
for (const recommendation of this.aiAnalysisResult.recommendations) {
|
|
165
|
+
const nodeId = Array.from(components.keys()).find((id) => id.endsWith(`:${recommendation.componentName}`));
|
|
166
|
+
if (nodeId && recommendation.confidence > 0.8) {
|
|
167
|
+
overrides[nodeId] = {
|
|
168
|
+
priority: recommendation.priority,
|
|
169
|
+
source: 'ai',
|
|
170
|
+
confidence: recommendation.confidence,
|
|
171
|
+
reason: recommendation.reason,
|
|
172
|
+
appliedAt: new Date().toISOString(),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return overrides;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get warning message if unknown types were detected without AI
|
|
180
|
+
*/
|
|
181
|
+
getUnknownTypesWarning() {
|
|
182
|
+
if (this.unknownTypesDetected.size === 0) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
if (!this.agentforceService) {
|
|
186
|
+
return `⚠️ Found ${this.unknownTypesDetected.size} unknown metadata type(s): ${Array.from(this.unknownTypesDetected).join(', ')}\n💡 Tip: Use --use-ai for intelligent prioritization of unknown types`;
|
|
187
|
+
}
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=priority-wave-generator-ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority-wave-generator-ai.js","sourceRoot":"","sources":["../../src/waves/priority-wave-generator-ai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAwB,MAAM,8BAA8B,CAAC;AAG3F,MAAM,MAAM,GAAG,SAAS,CAAC,iCAAiC,CAAC,CAAC;AAS5D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,+BAAgC,SAAQ,qBAAqB;IAChE,iBAAiB,CAA6B;IAC9C,gBAAgB,CAA0B;IAC1C,OAAO,CAAU;IACjB,QAAQ,CAAU;IAClB,gBAAgB,CAAU;IAC1B,oBAAoB,GAAgB,IAAI,GAAG,EAAE,CAAC;IAEtD,YAAmB,UAA6B,EAAE;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,IAAI,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,uBAAuB,CAAC,KAAa,EAAE,UAA0C;QAC5F,gCAAgC;QAChC,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAE9D,IAAI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|
|
3
|
+
* Prioritizes components by importance for wave generation
|
|
4
|
+
*
|
|
5
|
+
* @ac US-042-AC-1: Use deployment order constants
|
|
6
|
+
* @ac US-042-AC-2: Objects before classes before triggers
|
|
7
|
+
* @ac US-042-AC-3: Break ties using priorities
|
|
8
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
9
|
+
* @ac US-042-AC-5: Report priority decisions
|
|
10
|
+
* @ac US-042-AC-6: Validate no dependency violations
|
|
11
|
+
*
|
|
12
|
+
* @issue #42
|
|
13
|
+
*/
|
|
14
|
+
import type { NodeId } from '../types/dependency.js';
|
|
15
|
+
import type { MetadataComponent } from '../types/metadata.js';
|
|
16
|
+
import type { Wave } from './wave-builder.js';
|
|
17
|
+
export type PriorityOptions = {
|
|
18
|
+
userPriorities?: Map<NodeId, number>;
|
|
19
|
+
respectDependencyOrder?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Priority-Based Wave Generator
|
|
23
|
+
*
|
|
24
|
+
* Generates waves with component prioritization:
|
|
25
|
+
* 1. Metadata type priority (Objects → Classes → Triggers)
|
|
26
|
+
* 2. User-defined priorities
|
|
27
|
+
* 3. Dependency order
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const generator = new PriorityWaveGenerator({
|
|
31
|
+
* userPriorities: new Map([['ApexClass:Critical', 100]])
|
|
32
|
+
* });
|
|
33
|
+
*/
|
|
34
|
+
export declare class PriorityWaveGenerator {
|
|
35
|
+
private options;
|
|
36
|
+
constructor(options?: PriorityOptions);
|
|
37
|
+
/**
|
|
38
|
+
* @ac US-042-AC-2: Objects before classes before triggers
|
|
39
|
+
* @ac US-042-AC-3: Break ties using priorities
|
|
40
|
+
*/
|
|
41
|
+
sortComponentsByPriority(components: NodeId[], componentMap: Map<NodeId, MetadataComponent>): NodeId[];
|
|
42
|
+
private calculatePriority;
|
|
43
|
+
/**
|
|
44
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
45
|
+
*/
|
|
46
|
+
applyPriorityWaves(waves: Wave[], components: Map<NodeId, MetadataComponent>): Wave[];
|
|
47
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Priority-Based Wave Generator
|
|
3
|
+
* Prioritizes components by importance for wave generation
|
|
4
|
+
*
|
|
5
|
+
* @ac US-042-AC-1: Use deployment order constants
|
|
6
|
+
* @ac US-042-AC-2: Objects before classes before triggers
|
|
7
|
+
* @ac US-042-AC-3: Break ties using priorities
|
|
8
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
9
|
+
* @ac US-042-AC-5: Report priority decisions
|
|
10
|
+
* @ac US-042-AC-6: Validate no dependency violations
|
|
11
|
+
*
|
|
12
|
+
* @issue #42
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @ac US-042-AC-1: Use deployment order constants
|
|
16
|
+
*/
|
|
17
|
+
const DEPLOYMENT_PRIORITY_ORDER = [
|
|
18
|
+
'CustomObject',
|
|
19
|
+
'CustomField',
|
|
20
|
+
'RecordType',
|
|
21
|
+
'BusinessProcess',
|
|
22
|
+
'CompactLayout',
|
|
23
|
+
'Layout',
|
|
24
|
+
'Profile',
|
|
25
|
+
'PermissionSet',
|
|
26
|
+
'CustomMetadata',
|
|
27
|
+
'ApexClass',
|
|
28
|
+
'ApexTrigger',
|
|
29
|
+
'Flow',
|
|
30
|
+
'ValidationRule',
|
|
31
|
+
'WorkflowRule',
|
|
32
|
+
'EmailTemplate',
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Priority-Based Wave Generator
|
|
36
|
+
*
|
|
37
|
+
* Generates waves with component prioritization:
|
|
38
|
+
* 1. Metadata type priority (Objects → Classes → Triggers)
|
|
39
|
+
* 2. User-defined priorities
|
|
40
|
+
* 3. Dependency order
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const generator = new PriorityWaveGenerator({
|
|
44
|
+
* userPriorities: new Map([['ApexClass:Critical', 100]])
|
|
45
|
+
* });
|
|
46
|
+
*/
|
|
47
|
+
export class PriorityWaveGenerator {
|
|
48
|
+
options;
|
|
49
|
+
constructor(options = {}) {
|
|
50
|
+
this.options = {
|
|
51
|
+
userPriorities: options.userPriorities ?? new Map(),
|
|
52
|
+
respectDependencyOrder: options.respectDependencyOrder ?? true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @ac US-042-AC-2: Objects before classes before triggers
|
|
57
|
+
* @ac US-042-AC-3: Break ties using priorities
|
|
58
|
+
*/
|
|
59
|
+
sortComponentsByPriority(components, componentMap) {
|
|
60
|
+
return components.sort((a, b) => {
|
|
61
|
+
const priorityA = this.calculatePriority(a, componentMap);
|
|
62
|
+
const priorityB = this.calculatePriority(b, componentMap);
|
|
63
|
+
return priorityB - priorityA; // Higher priority first
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
calculatePriority(nodeId, componentMap) {
|
|
67
|
+
const component = componentMap.get(nodeId);
|
|
68
|
+
const type = nodeId.split(':')[0];
|
|
69
|
+
// Type priority (higher = deploy earlier)
|
|
70
|
+
const typeIndex = DEPLOYMENT_PRIORITY_ORDER.indexOf(type);
|
|
71
|
+
const typePriority = typeIndex === -1 ? 0 : (DEPLOYMENT_PRIORITY_ORDER.length - typeIndex) * 100;
|
|
72
|
+
// User priority override
|
|
73
|
+
const userPriority = this.options.userPriorities.get(nodeId) ?? 0;
|
|
74
|
+
// Component boost
|
|
75
|
+
const componentBoost = component?.priorityBoost ?? 0;
|
|
76
|
+
return typePriority + userPriority + componentBoost;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @ac US-042-AC-4: User-defined priority overrides
|
|
80
|
+
*/
|
|
81
|
+
applyPriorityWaves(waves, components) {
|
|
82
|
+
return waves.map((wave) => ({
|
|
83
|
+
...wave,
|
|
84
|
+
components: this.sortComponentsByPriority(wave.components, components),
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=priority-wave-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority-wave-generator.js","sourceRoot":"","sources":["../../src/waves/priority-wave-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH;;GAEG;AACH,MAAM,yBAAyB,GAAmB;IAChD,cAAc;IACd,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,QAAQ;IACR,SAAS;IACT,eAAe;IACf,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,MAAM;IACN,gBAAgB;IAChB,cAAc;IACd,eAAe;CAChB,CAAC;AAOF;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,qBAAqB;IACxB,OAAO,CAA4B;IAE3C,YAAmB,UAA2B,EAAE;QAC9C,IAAI,CAAC,OAAO,GAAG;YACb,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,IAAI,GAAG,EAAkB;YACnE,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,IAAI,IAAI;SAC/D,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,wBAAwB,CAAC,UAAoB,EAAE,YAA4C;QAChG,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;YAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;YAC1D,OAAO,SAAS,GAAG,SAAS,CAAC,CAAC,wBAAwB;QACxD,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,iBAAiB,CAAC,MAAc,EAAE,YAA4C;QACpF,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAiB,CAAC;QAElD,0CAA0C;QAC1C,MAAM,SAAS,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC;QAEjG,yBAAyB;QACzB,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAElE,kBAAkB;QAClB,MAAM,cAAc,GAAG,SAAS,EAAE,aAAa,IAAI,CAAC,CAAC;QAErD,OAAO,YAAY,GAAG,YAAY,GAAG,cAAc,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,kBAAkB,CAAC,KAAa,EAAE,UAA0C;QACjF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,GAAG,IAAI;YACP,UAAU,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;SACvE,CAAC,CAAC,CAAC;IACN,CAAC;CACF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Optimizer
|
|
3
|
+
* Optimizes test execution per wave to reduce deployment time
|
|
4
|
+
*
|
|
5
|
+
* @ac US-040-AC-1: Identify waves with Apex/Trigger changes
|
|
6
|
+
* @ac US-040-AC-2: Include tests only in waves with code
|
|
7
|
+
* @ac US-040-AC-3: Sync test classes with production classes
|
|
8
|
+
* @ac US-040-AC-4: Ensure trigger tests are included
|
|
9
|
+
* @ac US-040-AC-5: Calculate test coverage per wave
|
|
10
|
+
* @ac US-040-AC-6: Report test optimization savings
|
|
11
|
+
*
|
|
12
|
+
* @issue #40
|
|
13
|
+
*/
|
|
14
|
+
import type { NodeId } from '../types/dependency.js';
|
|
15
|
+
import type { Wave } from './wave-builder.js';
|
|
16
|
+
/**
|
|
17
|
+
* Test optimization result
|
|
18
|
+
*/
|
|
19
|
+
export type TestOptimizationResult = {
|
|
20
|
+
/** Original waves */
|
|
21
|
+
originalWaves: Wave[];
|
|
22
|
+
/** Optimized waves with test classes */
|
|
23
|
+
optimizedWaves: OptimizedWave[];
|
|
24
|
+
/** Optimization decisions */
|
|
25
|
+
decisions: OptimizationDecision[];
|
|
26
|
+
/** Statistics */
|
|
27
|
+
stats: OptimizationStats;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Optimized wave with test information
|
|
31
|
+
*/
|
|
32
|
+
export type OptimizedWave = Wave & {
|
|
33
|
+
/** Test classes included in this wave */
|
|
34
|
+
testClasses: NodeId[];
|
|
35
|
+
/** Code classes in this wave */
|
|
36
|
+
codeClasses: NodeId[];
|
|
37
|
+
/** Triggers in this wave */
|
|
38
|
+
triggers: NodeId[];
|
|
39
|
+
/** Needs test execution */
|
|
40
|
+
needsTests: boolean;
|
|
41
|
+
/** Estimated test coverage % */
|
|
42
|
+
estimatedCoverage: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Optimization decision
|
|
46
|
+
*/
|
|
47
|
+
export type OptimizationDecision = {
|
|
48
|
+
/** Wave number */
|
|
49
|
+
waveNumber: number;
|
|
50
|
+
/** Decision type */
|
|
51
|
+
type: 'include-tests' | 'skip-tests' | 'sync-tests';
|
|
52
|
+
/** Reason for decision */
|
|
53
|
+
reason: string;
|
|
54
|
+
/** Tests affected */
|
|
55
|
+
testsAffected: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Optimization statistics
|
|
59
|
+
*/
|
|
60
|
+
export type OptimizationStats = {
|
|
61
|
+
/** Total waves */
|
|
62
|
+
totalWaves: number;
|
|
63
|
+
/** Waves with tests */
|
|
64
|
+
wavesWithTests: number;
|
|
65
|
+
/** Waves without tests */
|
|
66
|
+
wavesWithoutTests: number;
|
|
67
|
+
/** Total test classes added */
|
|
68
|
+
totalTestsAdded: number;
|
|
69
|
+
/** Estimated time saved (seconds) */
|
|
70
|
+
timeSaved: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Optimizer options
|
|
74
|
+
*/
|
|
75
|
+
export type OptimizerOptions = {
|
|
76
|
+
/** Always run all tests (disable optimization) */
|
|
77
|
+
alwaysRunAllTests?: boolean;
|
|
78
|
+
/** Minimum test coverage required (0-100) */
|
|
79
|
+
minCoverageRequired?: number;
|
|
80
|
+
/** Include related tests (not just direct) */
|
|
81
|
+
includeRelatedTests?: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Test Optimizer
|
|
85
|
+
*
|
|
86
|
+
* Optimizes test execution by only including tests in waves
|
|
87
|
+
* that contain Apex classes or triggers.
|
|
88
|
+
*
|
|
89
|
+
* Strategy:
|
|
90
|
+
* 1. Identify waves with code changes (ApexClass, ApexTrigger)
|
|
91
|
+
* 2. Match test classes to production classes
|
|
92
|
+
* 3. Include only relevant tests per wave
|
|
93
|
+
* 4. Skip tests for metadata-only waves
|
|
94
|
+
*
|
|
95
|
+
* Performance: O(V)
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* const optimizer = new TestOptimizer({
|
|
99
|
+
* minCoverageRequired: 75,
|
|
100
|
+
* includeRelatedTests: true
|
|
101
|
+
* });
|
|
102
|
+
*
|
|
103
|
+
* const result = optimizer.optimizeTests(waves);
|
|
104
|
+
* console.log(`Time saved: ${result.stats.timeSaved}s`);
|
|
105
|
+
*/
|
|
106
|
+
export declare class TestOptimizer {
|
|
107
|
+
private options;
|
|
108
|
+
constructor(options?: OptimizerOptions);
|
|
109
|
+
/**
|
|
110
|
+
* @ac US-040-AC-1: Identify waves with Apex/Trigger changes
|
|
111
|
+
* @ac US-040-AC-2: Include tests only in waves with code
|
|
112
|
+
* @ac US-040-AC-3: Sync test classes with production classes
|
|
113
|
+
*/
|
|
114
|
+
optimizeTests(waves: Wave[]): TestOptimizationResult;
|
|
115
|
+
/**
|
|
116
|
+
* Collect all test classes from all waves
|
|
117
|
+
*/
|
|
118
|
+
private collectAllTestClasses;
|
|
119
|
+
/**
|
|
120
|
+
* Get code classes (non-test Apex classes)
|
|
121
|
+
*/
|
|
122
|
+
private getCodeClasses;
|
|
123
|
+
/**
|
|
124
|
+
* @ac US-040-AC-4: Ensure trigger tests are included
|
|
125
|
+
*/
|
|
126
|
+
private getTriggers;
|
|
127
|
+
/**
|
|
128
|
+
* Check if component is a test class
|
|
129
|
+
*/
|
|
130
|
+
private isTestClass;
|
|
131
|
+
/**
|
|
132
|
+
* Sync test classes with production classes
|
|
133
|
+
*/
|
|
134
|
+
private syncTestClasses;
|
|
135
|
+
/**
|
|
136
|
+
* @ac US-040-AC-5: Calculate test coverage per wave
|
|
137
|
+
*/
|
|
138
|
+
private estimateCoverage;
|
|
139
|
+
/**
|
|
140
|
+
* Calculate optimization statistics
|
|
141
|
+
*/
|
|
142
|
+
private calculateStats;
|
|
143
|
+
/**
|
|
144
|
+
* @ac US-040-AC-6: Report test optimization savings
|
|
145
|
+
*/
|
|
146
|
+
generateReport(result: TestOptimizationResult): string;
|
|
147
|
+
/**
|
|
148
|
+
* Get waves that need test execution
|
|
149
|
+
*/
|
|
150
|
+
getWavesNeedingTests(result: TestOptimizationResult): OptimizedWave[];
|
|
151
|
+
/**
|
|
152
|
+
* Get total test count across all waves
|
|
153
|
+
*/
|
|
154
|
+
getTotalTestCount(result: TestOptimizationResult): number;
|
|
155
|
+
}
|