@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.
Files changed (395) hide show
  1. package/README.md +193 -0
  2. package/lib/ai/agentforce-error-handler.d.ts +81 -0
  3. package/lib/ai/agentforce-error-handler.js +196 -0
  4. package/lib/ai/agentforce-error-handler.js.map +1 -0
  5. package/lib/ai/agentforce-priority-service.d.ts +82 -0
  6. package/lib/ai/agentforce-priority-service.js +257 -0
  7. package/lib/ai/agentforce-priority-service.js.map +1 -0
  8. package/lib/ai/agentforce-service.d.ts +99 -0
  9. package/lib/ai/agentforce-service.js +300 -0
  10. package/lib/ai/agentforce-service.js.map +1 -0
  11. package/lib/ai/circuit-breaker.d.ts +115 -0
  12. package/lib/ai/circuit-breaker.js +277 -0
  13. package/lib/ai/circuit-breaker.js.map +1 -0
  14. package/lib/ai/dependency-inference-service.d.ts +76 -0
  15. package/lib/ai/dependency-inference-service.js +220 -0
  16. package/lib/ai/dependency-inference-service.js.map +1 -0
  17. package/lib/ai/llm-provider-factory.d.ts +15 -0
  18. package/lib/ai/llm-provider-factory.js +36 -0
  19. package/lib/ai/llm-provider-factory.js.map +1 -0
  20. package/lib/ai/llm-provider.d.ts +27 -0
  21. package/lib/ai/llm-provider.js +2 -0
  22. package/lib/ai/llm-provider.js.map +1 -0
  23. package/lib/ai/openai-service.d.ts +20 -0
  24. package/lib/ai/openai-service.js +89 -0
  25. package/lib/ai/openai-service.js.map +1 -0
  26. package/lib/ai/prompt-builder.d.ts +79 -0
  27. package/lib/ai/prompt-builder.js +180 -0
  28. package/lib/ai/prompt-builder.js.map +1 -0
  29. package/lib/ai/response-parser.d.ts +67 -0
  30. package/lib/ai/response-parser.js +234 -0
  31. package/lib/ai/response-parser.js.map +1 -0
  32. package/lib/ai/wave-validation-service.d.ts +111 -0
  33. package/lib/ai/wave-validation-service.js +381 -0
  34. package/lib/ai/wave-validation-service.js.map +1 -0
  35. package/lib/analysis/analysis-reporter.d.ts +56 -0
  36. package/lib/analysis/analysis-reporter.js +170 -0
  37. package/lib/analysis/analysis-reporter.js.map +1 -0
  38. package/lib/analytics/error-analytics.d.ts +80 -0
  39. package/lib/analytics/error-analytics.js +162 -0
  40. package/lib/analytics/error-analytics.js.map +1 -0
  41. package/lib/commands/analyze.d.ts +49 -0
  42. package/lib/commands/analyze.js +232 -0
  43. package/lib/commands/analyze.js.map +1 -0
  44. package/lib/commands/config.d.ts +42 -0
  45. package/lib/commands/config.js +219 -0
  46. package/lib/commands/config.js.map +1 -0
  47. package/lib/commands/resume.d.ts +26 -0
  48. package/lib/commands/resume.js +69 -0
  49. package/lib/commands/resume.js.map +1 -0
  50. package/lib/commands/start.d.ts +70 -0
  51. package/lib/commands/start.js +659 -0
  52. package/lib/commands/start.js.map +1 -0
  53. package/lib/commands/status.d.ts +37 -0
  54. package/lib/commands/status.js +69 -0
  55. package/lib/commands/status.js.map +1 -0
  56. package/lib/commands/validate.d.ts +33 -0
  57. package/lib/commands/validate.js +66 -0
  58. package/lib/commands/validate.js.map +1 -0
  59. package/lib/config/repo-config.d.ts +22 -0
  60. package/lib/config/repo-config.js +31 -0
  61. package/lib/config/repo-config.js.map +1 -0
  62. package/lib/constants/agentforce-limits.d.ts +174 -0
  63. package/lib/constants/agentforce-limits.js +262 -0
  64. package/lib/constants/agentforce-limits.js.map +1 -0
  65. package/lib/constants/api-version.d.ts +70 -0
  66. package/lib/constants/api-version.js +122 -0
  67. package/lib/constants/api-version.js.map +1 -0
  68. package/lib/constants/deployment-order.d.ts +68 -0
  69. package/lib/constants/deployment-order.js +162 -0
  70. package/lib/constants/deployment-order.js.map +1 -0
  71. package/lib/constants/salesforce-limits.d.ts +107 -0
  72. package/lib/constants/salesforce-limits.js +104 -0
  73. package/lib/constants/salesforce-limits.js.map +1 -0
  74. package/lib/dependencies/circular-dependency-detector.d.ts +137 -0
  75. package/lib/dependencies/circular-dependency-detector.js +329 -0
  76. package/lib/dependencies/circular-dependency-detector.js.map +1 -0
  77. package/lib/dependencies/cycle-remediation-planner.d.ts +50 -0
  78. package/lib/dependencies/cycle-remediation-planner.js +192 -0
  79. package/lib/dependencies/cycle-remediation-planner.js.map +1 -0
  80. package/lib/dependencies/dependency-cache.d.ts +134 -0
  81. package/lib/dependencies/dependency-cache.js +303 -0
  82. package/lib/dependencies/dependency-cache.js.map +1 -0
  83. package/lib/dependencies/dependency-depth-calculator.d.ts +145 -0
  84. package/lib/dependencies/dependency-depth-calculator.js +368 -0
  85. package/lib/dependencies/dependency-depth-calculator.js.map +1 -0
  86. package/lib/dependencies/dependency-graph-builder.d.ts +151 -0
  87. package/lib/dependencies/dependency-graph-builder.js +411 -0
  88. package/lib/dependencies/dependency-graph-builder.js.map +1 -0
  89. package/lib/dependencies/dependency-impact-analyzer.d.ts +145 -0
  90. package/lib/dependencies/dependency-impact-analyzer.js +330 -0
  91. package/lib/dependencies/dependency-impact-analyzer.js.map +1 -0
  92. package/lib/dependencies/dependency-merger.d.ts +122 -0
  93. package/lib/dependencies/dependency-merger.js +245 -0
  94. package/lib/dependencies/dependency-merger.js.map +1 -0
  95. package/lib/dependencies/dependency-resolver.d.ts +157 -0
  96. package/lib/dependencies/dependency-resolver.js +298 -0
  97. package/lib/dependencies/dependency-resolver.js.map +1 -0
  98. package/lib/dependencies/dependency-validator.d.ts +123 -0
  99. package/lib/dependencies/dependency-validator.js +291 -0
  100. package/lib/dependencies/dependency-validator.js.map +1 -0
  101. package/lib/dependencies/graph-visualizer.d.ts +110 -0
  102. package/lib/dependencies/graph-visualizer.js +262 -0
  103. package/lib/dependencies/graph-visualizer.js.map +1 -0
  104. package/lib/dependencies/heuristic-inference.d.ts +136 -0
  105. package/lib/dependencies/heuristic-inference.js +430 -0
  106. package/lib/dependencies/heuristic-inference.js.map +1 -0
  107. package/lib/deployment/cycle-source-editor.d.ts +34 -0
  108. package/lib/deployment/cycle-source-editor.js +121 -0
  109. package/lib/deployment/cycle-source-editor.js.map +1 -0
  110. package/lib/deployment/deployment-error-handler.d.ts +38 -0
  111. package/lib/deployment/deployment-error-handler.js +79 -0
  112. package/lib/deployment/deployment-error-handler.js.map +1 -0
  113. package/lib/deployment/deployment-reporter.d.ts +63 -0
  114. package/lib/deployment/deployment-reporter.js +150 -0
  115. package/lib/deployment/deployment-reporter.js.map +1 -0
  116. package/lib/deployment/deployment-state-summary.d.ts +38 -0
  117. package/lib/deployment/deployment-state-summary.js +209 -0
  118. package/lib/deployment/deployment-state-summary.js.map +1 -0
  119. package/lib/deployment/deployment-status-service.d.ts +36 -0
  120. package/lib/deployment/deployment-status-service.js +128 -0
  121. package/lib/deployment/deployment-status-service.js.map +1 -0
  122. package/lib/deployment/deployment-tracker.d.ts +42 -0
  123. package/lib/deployment/deployment-tracker.js +79 -0
  124. package/lib/deployment/deployment-tracker.js.map +1 -0
  125. package/lib/deployment/deployment-validation-service.d.ts +28 -0
  126. package/lib/deployment/deployment-validation-service.js +161 -0
  127. package/lib/deployment/deployment-validation-service.js.map +1 -0
  128. package/lib/deployment/retry-handler.d.ts +37 -0
  129. package/lib/deployment/retry-handler.js +86 -0
  130. package/lib/deployment/retry-handler.js.map +1 -0
  131. package/lib/deployment/sf-cli-integration.d.ts +42 -0
  132. package/lib/deployment/sf-cli-integration.js +105 -0
  133. package/lib/deployment/sf-cli-integration.js.map +1 -0
  134. package/lib/deployment/state-manager.d.ts +61 -0
  135. package/lib/deployment/state-manager.js +83 -0
  136. package/lib/deployment/state-manager.js.map +1 -0
  137. package/lib/deployment/test-executor.d.ts +41 -0
  138. package/lib/deployment/test-executor.js +87 -0
  139. package/lib/deployment/test-executor.js.map +1 -0
  140. package/lib/errors/base-error.d.ts +24 -0
  141. package/lib/errors/base-error.js +66 -0
  142. package/lib/errors/base-error.js.map +1 -0
  143. package/lib/errors/dependency-error.d.ts +37 -0
  144. package/lib/errors/dependency-error.js +76 -0
  145. package/lib/errors/dependency-error.js.map +1 -0
  146. package/lib/errors/deployment-error.d.ts +55 -0
  147. package/lib/errors/deployment-error.js +132 -0
  148. package/lib/errors/deployment-error.js.map +1 -0
  149. package/lib/errors/index.d.ts +45 -0
  150. package/lib/errors/index.js +71 -0
  151. package/lib/errors/index.js.map +1 -0
  152. package/lib/errors/network-error.d.ts +53 -0
  153. package/lib/errors/network-error.js +111 -0
  154. package/lib/errors/network-error.js.map +1 -0
  155. package/lib/errors/parsing-error.d.ts +41 -0
  156. package/lib/errors/parsing-error.js +69 -0
  157. package/lib/errors/parsing-error.js.map +1 -0
  158. package/lib/errors/validation-error-reporter.d.ts +34 -0
  159. package/lib/errors/validation-error-reporter.js +99 -0
  160. package/lib/errors/validation-error-reporter.js.map +1 -0
  161. package/lib/errors/validation-error.d.ts +58 -0
  162. package/lib/errors/validation-error.js +131 -0
  163. package/lib/errors/validation-error.js.map +1 -0
  164. package/lib/index.d.ts +2 -0
  165. package/lib/index.js +2 -0
  166. package/lib/index.js.map +1 -0
  167. package/lib/monitoring/performance-monitor.d.ts +98 -0
  168. package/lib/monitoring/performance-monitor.js +260 -0
  169. package/lib/monitoring/performance-monitor.js.map +1 -0
  170. package/lib/parsers/apex-class-parser.d.ts +47 -0
  171. package/lib/parsers/apex-class-parser.js +368 -0
  172. package/lib/parsers/apex-class-parser.js.map +1 -0
  173. package/lib/parsers/apex-trigger-parser.d.ts +48 -0
  174. package/lib/parsers/apex-trigger-parser.js +229 -0
  175. package/lib/parsers/apex-trigger-parser.js.map +1 -0
  176. package/lib/parsers/aura-parser.d.ts +55 -0
  177. package/lib/parsers/aura-parser.js +229 -0
  178. package/lib/parsers/aura-parser.js.map +1 -0
  179. package/lib/parsers/bot-parser.d.ts +65 -0
  180. package/lib/parsers/bot-parser.js +225 -0
  181. package/lib/parsers/bot-parser.js.map +1 -0
  182. package/lib/parsers/custom-metadata-parser.d.ts +94 -0
  183. package/lib/parsers/custom-metadata-parser.js +199 -0
  184. package/lib/parsers/custom-metadata-parser.js.map +1 -0
  185. package/lib/parsers/custom-object-parser.d.ts +62 -0
  186. package/lib/parsers/custom-object-parser.js +297 -0
  187. package/lib/parsers/custom-object-parser.js.map +1 -0
  188. package/lib/parsers/email-template-parser.d.ts +64 -0
  189. package/lib/parsers/email-template-parser.js +238 -0
  190. package/lib/parsers/email-template-parser.js.map +1 -0
  191. package/lib/parsers/error-resilient-parser.d.ts +110 -0
  192. package/lib/parsers/error-resilient-parser.js +277 -0
  193. package/lib/parsers/error-resilient-parser.js.map +1 -0
  194. package/lib/parsers/flexipage-parser.d.ts +64 -0
  195. package/lib/parsers/flexipage-parser.js +196 -0
  196. package/lib/parsers/flexipage-parser.js.map +1 -0
  197. package/lib/parsers/flow-parser.d.ts +54 -0
  198. package/lib/parsers/flow-parser.js +287 -0
  199. package/lib/parsers/flow-parser.js.map +1 -0
  200. package/lib/parsers/genai-prompt-parser.d.ts +67 -0
  201. package/lib/parsers/genai-prompt-parser.js +160 -0
  202. package/lib/parsers/genai-prompt-parser.js.map +1 -0
  203. package/lib/parsers/layout-parser.d.ts +64 -0
  204. package/lib/parsers/layout-parser.js +267 -0
  205. package/lib/parsers/layout-parser.js.map +1 -0
  206. package/lib/parsers/lwc-parser.d.ts +60 -0
  207. package/lib/parsers/lwc-parser.js +264 -0
  208. package/lib/parsers/lwc-parser.js.map +1 -0
  209. package/lib/parsers/permission-set-parser.d.ts +86 -0
  210. package/lib/parsers/permission-set-parser.js +152 -0
  211. package/lib/parsers/permission-set-parser.js.map +1 -0
  212. package/lib/parsers/profile-parser.d.ts +81 -0
  213. package/lib/parsers/profile-parser.js +141 -0
  214. package/lib/parsers/profile-parser.js.map +1 -0
  215. package/lib/parsers/visualforce-parser.d.ts +47 -0
  216. package/lib/parsers/visualforce-parser.js +180 -0
  217. package/lib/parsers/visualforce-parser.js.map +1 -0
  218. package/lib/provisioning/data-provisioner.d.ts +88 -0
  219. package/lib/provisioning/data-provisioner.js +257 -0
  220. package/lib/provisioning/data-provisioner.js.map +1 -0
  221. package/lib/scanner/custom-structure-scanner.d.ts +66 -0
  222. package/lib/scanner/custom-structure-scanner.js +229 -0
  223. package/lib/scanner/custom-structure-scanner.js.map +1 -0
  224. package/lib/scanner/forceignore-parser.d.ts +69 -0
  225. package/lib/scanner/forceignore-parser.js +195 -0
  226. package/lib/scanner/forceignore-parser.js.map +1 -0
  227. package/lib/scanner/metadata-format-scanner.d.ts +77 -0
  228. package/lib/scanner/metadata-format-scanner.js +282 -0
  229. package/lib/scanner/metadata-format-scanner.js.map +1 -0
  230. package/lib/scanner/monorepo-scanner.d.ts +71 -0
  231. package/lib/scanner/monorepo-scanner.js +225 -0
  232. package/lib/scanner/monorepo-scanner.js.map +1 -0
  233. package/lib/scanner/project-validator.d.ts +55 -0
  234. package/lib/scanner/project-validator.js +235 -0
  235. package/lib/scanner/project-validator.js.map +1 -0
  236. package/lib/scanner/sfdx-project-detector.d.ts +86 -0
  237. package/lib/scanner/sfdx-project-detector.js +240 -0
  238. package/lib/scanner/sfdx-project-detector.js.map +1 -0
  239. package/lib/scanner/structure-validator.d.ts +64 -0
  240. package/lib/scanner/structure-validator.js +296 -0
  241. package/lib/scanner/structure-validator.js.map +1 -0
  242. package/lib/services/metadata-scanner-service.d.ts +64 -0
  243. package/lib/services/metadata-scanner-service.js +651 -0
  244. package/lib/services/metadata-scanner-service.js.map +1 -0
  245. package/lib/types/agentforce.d.ts +157 -0
  246. package/lib/types/agentforce.js +2 -0
  247. package/lib/types/agentforce.js.map +1 -0
  248. package/lib/types/dependency.d.ts +98 -0
  249. package/lib/types/dependency.js +5 -0
  250. package/lib/types/dependency.js.map +1 -0
  251. package/lib/types/deployment-plan.d.ts +81 -0
  252. package/lib/types/deployment-plan.js +6 -0
  253. package/lib/types/deployment-plan.js.map +1 -0
  254. package/lib/types/deployment.d.ts +88 -0
  255. package/lib/types/deployment.js +5 -0
  256. package/lib/types/deployment.js.map +1 -0
  257. package/lib/types/graph.d.ts +35 -0
  258. package/lib/types/graph.js +5 -0
  259. package/lib/types/graph.js.map +1 -0
  260. package/lib/types/index.d.ts +12 -0
  261. package/lib/types/index.js +17 -0
  262. package/lib/types/index.js.map +1 -0
  263. package/lib/types/metadata.d.ts +101 -0
  264. package/lib/types/metadata.js +13 -0
  265. package/lib/types/metadata.js.map +1 -0
  266. package/lib/types/project.d.ts +156 -0
  267. package/lib/types/project.js +56 -0
  268. package/lib/types/project.js.map +1 -0
  269. package/lib/types/salesforce/apex.d.ts +94 -0
  270. package/lib/types/salesforce/apex.js +6 -0
  271. package/lib/types/salesforce/apex.js.map +1 -0
  272. package/lib/types/salesforce/aura.d.ts +150 -0
  273. package/lib/types/salesforce/aura.js +6 -0
  274. package/lib/types/salesforce/aura.js.map +1 -0
  275. package/lib/types/salesforce/bot.d.ts +293 -0
  276. package/lib/types/salesforce/bot.js +6 -0
  277. package/lib/types/salesforce/bot.js.map +1 -0
  278. package/lib/types/salesforce/common.d.ts +15 -0
  279. package/lib/types/salesforce/common.js +5 -0
  280. package/lib/types/salesforce/common.js.map +1 -0
  281. package/lib/types/salesforce/custom-metadata.d.ts +92 -0
  282. package/lib/types/salesforce/custom-metadata.js +6 -0
  283. package/lib/types/salesforce/custom-metadata.js.map +1 -0
  284. package/lib/types/salesforce/email.d.ts +56 -0
  285. package/lib/types/salesforce/email.js +6 -0
  286. package/lib/types/salesforce/email.js.map +1 -0
  287. package/lib/types/salesforce/flexipage.d.ts +149 -0
  288. package/lib/types/salesforce/flexipage.js +6 -0
  289. package/lib/types/salesforce/flexipage.js.map +1 -0
  290. package/lib/types/salesforce/flow.d.ts +516 -0
  291. package/lib/types/salesforce/flow.js +6 -0
  292. package/lib/types/salesforce/flow.js.map +1 -0
  293. package/lib/types/salesforce/genai.d.ts +67 -0
  294. package/lib/types/salesforce/genai.js +6 -0
  295. package/lib/types/salesforce/genai.js.map +1 -0
  296. package/lib/types/salesforce/index.d.ts +27 -0
  297. package/lib/types/salesforce/index.js +43 -0
  298. package/lib/types/salesforce/index.js.map +1 -0
  299. package/lib/types/salesforce/layout.d.ts +236 -0
  300. package/lib/types/salesforce/layout.js +6 -0
  301. package/lib/types/salesforce/layout.js.map +1 -0
  302. package/lib/types/salesforce/lwc.d.ts +123 -0
  303. package/lib/types/salesforce/lwc.js +6 -0
  304. package/lib/types/salesforce/lwc.js.map +1 -0
  305. package/lib/types/salesforce/object.d.ts +427 -0
  306. package/lib/types/salesforce/object.js +6 -0
  307. package/lib/types/salesforce/object.js.map +1 -0
  308. package/lib/types/salesforce/parser-types.d.ts +79 -0
  309. package/lib/types/salesforce/parser-types.js +80 -0
  310. package/lib/types/salesforce/parser-types.js.map +1 -0
  311. package/lib/types/salesforce/permission.d.ts +289 -0
  312. package/lib/types/salesforce/permission.js +6 -0
  313. package/lib/types/salesforce/permission.js.map +1 -0
  314. package/lib/types/salesforce/resource.d.ts +93 -0
  315. package/lib/types/salesforce/resource.js +6 -0
  316. package/lib/types/salesforce/resource.js.map +1 -0
  317. package/lib/types/salesforce/visualforce.d.ts +70 -0
  318. package/lib/types/salesforce/visualforce.js +6 -0
  319. package/lib/types/salesforce/visualforce.js.map +1 -0
  320. package/lib/utils/cache-manager.d.ts +158 -0
  321. package/lib/utils/cache-manager.js +429 -0
  322. package/lib/utils/cache-manager.js.map +1 -0
  323. package/lib/utils/deployment-plan-manager.d.ts +40 -0
  324. package/lib/utils/deployment-plan-manager.js +183 -0
  325. package/lib/utils/deployment-plan-manager.js.map +1 -0
  326. package/lib/utils/error-aggregator.d.ts +117 -0
  327. package/lib/utils/error-aggregator.js +268 -0
  328. package/lib/utils/error-aggregator.js.map +1 -0
  329. package/lib/utils/file-system.d.ts +62 -0
  330. package/lib/utils/file-system.js +167 -0
  331. package/lib/utils/file-system.js.map +1 -0
  332. package/lib/utils/functional.d.ts +52 -0
  333. package/lib/utils/functional.js +61 -0
  334. package/lib/utils/functional.js.map +1 -0
  335. package/lib/utils/graph-algorithms.d.ts +53 -0
  336. package/lib/utils/graph-algorithms.js +177 -0
  337. package/lib/utils/graph-algorithms.js.map +1 -0
  338. package/lib/utils/logger.d.ts +154 -0
  339. package/lib/utils/logger.js +327 -0
  340. package/lib/utils/logger.js.map +1 -0
  341. package/lib/utils/network-handler.d.ts +64 -0
  342. package/lib/utils/network-handler.js +147 -0
  343. package/lib/utils/network-handler.js.map +1 -0
  344. package/lib/utils/performance.d.ts +148 -0
  345. package/lib/utils/performance.js +294 -0
  346. package/lib/utils/performance.js.map +1 -0
  347. package/lib/utils/string.d.ts +197 -0
  348. package/lib/utils/string.js +331 -0
  349. package/lib/utils/string.js.map +1 -0
  350. package/lib/utils/xml.d.ts +97 -0
  351. package/lib/utils/xml.js +227 -0
  352. package/lib/utils/xml.js.map +1 -0
  353. package/lib/validators/xml-metadata-validator.d.ts +106 -0
  354. package/lib/validators/xml-metadata-validator.js +509 -0
  355. package/lib/validators/xml-metadata-validator.js.map +1 -0
  356. package/lib/waves/priority-wave-generator-ai.d.ts +85 -0
  357. package/lib/waves/priority-wave-generator-ai.js +191 -0
  358. package/lib/waves/priority-wave-generator-ai.js.map +1 -0
  359. package/lib/waves/priority-wave-generator.d.ts +47 -0
  360. package/lib/waves/priority-wave-generator.js +88 -0
  361. package/lib/waves/priority-wave-generator.js.map +1 -0
  362. package/lib/waves/test-optimizer.d.ts +155 -0
  363. package/lib/waves/test-optimizer.js +290 -0
  364. package/lib/waves/test-optimizer.js.map +1 -0
  365. package/lib/waves/wave-builder.d.ts +147 -0
  366. package/lib/waves/wave-builder.js +286 -0
  367. package/lib/waves/wave-builder.js.map +1 -0
  368. package/lib/waves/wave-diff-generator.d.ts +17 -0
  369. package/lib/waves/wave-diff-generator.js +6 -0
  370. package/lib/waves/wave-diff-generator.js.map +1 -0
  371. package/lib/waves/wave-executor.d.ts +33 -0
  372. package/lib/waves/wave-executor.js +50 -0
  373. package/lib/waves/wave-executor.js.map +1 -0
  374. package/lib/waves/wave-merger.d.ts +96 -0
  375. package/lib/waves/wave-merger.js +181 -0
  376. package/lib/waves/wave-merger.js.map +1 -0
  377. package/lib/waves/wave-metadata-generator.d.ts +13 -0
  378. package/lib/waves/wave-metadata-generator.js +12 -0
  379. package/lib/waves/wave-metadata-generator.js.map +1 -0
  380. package/lib/waves/wave-splitter.d.ts +154 -0
  381. package/lib/waves/wave-splitter.js +307 -0
  382. package/lib/waves/wave-splitter.js.map +1 -0
  383. package/lib/waves/wave-validator.d.ts +17 -0
  384. package/lib/waves/wave-validator.js +15 -0
  385. package/lib/waves/wave-validator.js.map +1 -0
  386. package/messages/analyze.json +18 -0
  387. package/messages/config.json +29 -0
  388. package/messages/resume.json +9 -0
  389. package/messages/start.json +24 -0
  390. package/messages/status.json +8 -0
  391. package/messages/validate.json +9 -0
  392. package/npm-shrinkwrap.json +25676 -0
  393. package/oclif.lock +11988 -0
  394. package/oclif.manifest.json +589 -0
  395. package/package.json +224 -0
@@ -0,0 +1,368 @@
1
+ /**
2
+ * Dependency Depth Calculator
3
+ * Calculates dependency depth for each component to identify high-risk components
4
+ *
5
+ * @ac US-031-AC-1: Calculate depth from leaf nodes
6
+ * @ac US-031-AC-2: Identify components with depth > 10 (warning)
7
+ * @ac US-031-AC-3: Generate depth distribution report
8
+ * @ac US-031-AC-4: Highlight critical path components
9
+ * @ac US-031-AC-5: Consider cycle depth as infinite
10
+ *
11
+ * @issue #31
12
+ */
13
+ import { getLogger } from '../utils/logger.js';
14
+ const logger = getLogger('DependencyDepthCalculator');
15
+ /**
16
+ * Dependency Depth Calculator
17
+ *
18
+ * Calculates the dependency depth of each component from leaf nodes.
19
+ * Leaf nodes (no dependencies) have depth 0.
20
+ * Components depending on others have depth = max(dep.depth) + 1.
21
+ *
22
+ * Performance: O(V + E) using topological sort
23
+ *
24
+ * @example
25
+ * const calculator = new DependencyDepthCalculator(graph);
26
+ * const result = calculator.calculate();
27
+ * console.log(`Max depth: ${result.maxDepth}`);
28
+ * console.log(`High-risk: ${result.highRiskComponents.length}`);
29
+ */
30
+ export class DependencyDepthCalculator {
31
+ graph;
32
+ options;
33
+ cyclicNodes;
34
+ constructor(graph, options = {}) {
35
+ this.graph = graph;
36
+ this.options = {
37
+ circularDependencies: options.circularDependencies ?? [],
38
+ highRiskThreshold: options.highRiskThreshold ?? 10,
39
+ };
40
+ // Build set of cyclic nodes for O(1) lookup
41
+ this.cyclicNodes = new Set();
42
+ for (const cycle of this.options.circularDependencies) {
43
+ for (const nodeId of cycle.cycle) {
44
+ this.cyclicNodes.add(nodeId);
45
+ }
46
+ }
47
+ logger.debug('Initialized DependencyDepthCalculator', {
48
+ nodes: this.graph.size,
49
+ cyclicNodes: this.cyclicNodes.size,
50
+ highRiskThreshold: this.options.highRiskThreshold,
51
+ });
52
+ }
53
+ // Private static helper methods (must come before public methods)
54
+ /**
55
+ * @ac US-031-AC-4: Highlight critical path components
56
+ *
57
+ * Find the critical path (longest dependency chain)
58
+ */
59
+ static findCriticalPath(depths) {
60
+ let longestPath = [];
61
+ let maxDepth = 0;
62
+ for (const depth of depths.values()) {
63
+ // Skip cyclic nodes
64
+ if (depth.isInCycle || depth.depth === Number.POSITIVE_INFINITY) {
65
+ continue;
66
+ }
67
+ if (depth.depth > maxDepth) {
68
+ maxDepth = depth.depth;
69
+ longestPath = depth.pathToLeaf;
70
+ }
71
+ }
72
+ // Mark nodes in critical path
73
+ const criticalPathSet = new Set(longestPath);
74
+ for (const [nodeId, depth] of depths.entries()) {
75
+ if (criticalPathSet.has(nodeId)) {
76
+ depth.isCriticalPath = true;
77
+ }
78
+ }
79
+ logger.info('Critical path identified', {
80
+ length: longestPath.length,
81
+ depth: maxDepth,
82
+ });
83
+ return longestPath;
84
+ }
85
+ /**
86
+ * @ac US-031-AC-3: Generate depth distribution report
87
+ */
88
+ static generateDistribution(depths) {
89
+ const ranges = [
90
+ { range: '0-5', min: 0, max: 5 },
91
+ { range: '6-10', min: 6, max: 10 },
92
+ { range: '11-20', min: 11, max: 20 },
93
+ { range: '21-50', min: 21, max: 50 },
94
+ { range: '>50', min: 51, max: Number.POSITIVE_INFINITY },
95
+ ];
96
+ const distribution = [];
97
+ const total = depths.size;
98
+ for (const { range, min, max } of ranges) {
99
+ const components = [];
100
+ for (const depth of depths.values()) {
101
+ // Handle infinite depth (cycles)
102
+ if (depth.depth === Number.POSITIVE_INFINITY && max === Number.POSITIVE_INFINITY) {
103
+ components.push(depth.nodeId);
104
+ }
105
+ else if (depth.depth >= min && depth.depth <= max) {
106
+ components.push(depth.nodeId);
107
+ }
108
+ }
109
+ if (components.length > 0) {
110
+ distribution.push({
111
+ depthRange: range,
112
+ count: components.length,
113
+ percentage: (components.length / total) * 100,
114
+ components,
115
+ });
116
+ }
117
+ }
118
+ return distribution;
119
+ }
120
+ /**
121
+ * Calculate maximum depth
122
+ */
123
+ static calculateMaxDepth(depths) {
124
+ let maxDepth = 0;
125
+ for (const depth of depths.values()) {
126
+ if (depth.depth !== Number.POSITIVE_INFINITY) {
127
+ maxDepth = Math.max(maxDepth, depth.depth);
128
+ }
129
+ }
130
+ return maxDepth;
131
+ }
132
+ /**
133
+ * Calculate average depth (excluding cyclic nodes)
134
+ */
135
+ static calculateAverageDepth(depths) {
136
+ let sum = 0;
137
+ let count = 0;
138
+ for (const depth of depths.values()) {
139
+ if (depth.depth !== Number.POSITIVE_INFINITY) {
140
+ sum += depth.depth;
141
+ count++;
142
+ }
143
+ }
144
+ return count > 0 ? sum / count : 0;
145
+ }
146
+ // Public methods
147
+ /**
148
+ * Calculate depths for all components
149
+ *
150
+ * @ac US-031-AC-1: Calculate depth from leaf nodes
151
+ * @ac US-031-AC-2: Identify components with depth > 10
152
+ * @ac US-031-AC-5: Consider cycle depth as infinite
153
+ */
154
+ calculate() {
155
+ const startTime = Date.now();
156
+ // Calculate depth for each node
157
+ const depths = this.calculateDepths();
158
+ // Find high-risk components
159
+ const highRiskComponents = this.findHighRiskComponents(depths);
160
+ // Find critical path
161
+ const criticalPath = DependencyDepthCalculator.findCriticalPath(depths);
162
+ // Generate distribution
163
+ const distribution = DependencyDepthCalculator.generateDistribution(depths);
164
+ // Calculate statistics
165
+ const maxDepth = DependencyDepthCalculator.calculateMaxDepth(depths);
166
+ const averageDepth = DependencyDepthCalculator.calculateAverageDepth(depths);
167
+ const duration = Date.now() - startTime;
168
+ logger.info('Depth calculation completed', {
169
+ totalNodes: depths.size,
170
+ maxDepth,
171
+ averageDepth: averageDepth.toFixed(2),
172
+ highRisk: highRiskComponents.length,
173
+ cyclicNodes: this.cyclicNodes.size,
174
+ durationMs: duration,
175
+ });
176
+ return {
177
+ depths,
178
+ highRiskComponents,
179
+ criticalPath,
180
+ maxDepth,
181
+ averageDepth,
182
+ distribution,
183
+ cyclicComponents: Array.from(this.cyclicNodes),
184
+ };
185
+ }
186
+ /**
187
+ * Calculate depth for all nodes using BFS from leaf nodes
188
+ */
189
+ calculateDepths() {
190
+ const depths = new Map();
191
+ const inDegree = this.calculateInDegree();
192
+ const queue = this.initializeLeafNodes(depths, inDegree);
193
+ this.processNodesInBFS(depths, queue);
194
+ this.processRemainingNodes(depths);
195
+ return depths;
196
+ }
197
+ /**
198
+ * Calculate in-degree for each node
199
+ */
200
+ calculateInDegree() {
201
+ const inDegree = new Map();
202
+ for (const nodeId of this.graph.keys()) {
203
+ inDegree.set(nodeId, 0);
204
+ }
205
+ for (const deps of this.graph.values()) {
206
+ for (const dep of deps) {
207
+ if (inDegree.has(dep)) {
208
+ inDegree.set(dep, (inDegree.get(dep) ?? 0) + 1);
209
+ }
210
+ else {
211
+ inDegree.set(dep, 1);
212
+ }
213
+ }
214
+ }
215
+ return inDegree;
216
+ }
217
+ /**
218
+ * Initialize leaf nodes in the queue
219
+ */
220
+ initializeLeafNodes(depths, inDegree) {
221
+ const queue = [];
222
+ for (const [nodeId] of inDegree.entries()) {
223
+ const isInCycle = this.cyclicNodes.has(nodeId);
224
+ const isLeaf = (this.graph.get(nodeId)?.size ?? 0) === 0;
225
+ if (isLeaf && !isInCycle) {
226
+ queue.push({ nodeId, depth: 0, path: [nodeId] });
227
+ depths.set(nodeId, {
228
+ nodeId,
229
+ depth: 0,
230
+ isInCycle: false,
231
+ isLeaf: true,
232
+ isHighRisk: false,
233
+ isCriticalPath: false,
234
+ pathToLeaf: [nodeId],
235
+ });
236
+ }
237
+ else if (isInCycle) {
238
+ // Mark cyclic nodes with infinite depth
239
+ depths.set(nodeId, {
240
+ nodeId,
241
+ depth: Number.POSITIVE_INFINITY,
242
+ isInCycle: true,
243
+ isLeaf: false,
244
+ isHighRisk: true,
245
+ isCriticalPath: false,
246
+ pathToLeaf: [],
247
+ });
248
+ }
249
+ }
250
+ return queue;
251
+ }
252
+ /**
253
+ * Process nodes in BFS order
254
+ */
255
+ processNodesInBFS(depths, queue) {
256
+ const processed = new Set();
257
+ while (queue.length > 0) {
258
+ const { nodeId, path } = queue.shift();
259
+ if (processed.has(nodeId)) {
260
+ continue;
261
+ }
262
+ processed.add(nodeId);
263
+ // Find all nodes that depend on this node (reverse edges)
264
+ for (const [candidateId, candidateDeps] of this.graph.entries()) {
265
+ if (candidateDeps.has(nodeId) && !this.cyclicNodes.has(candidateId)) {
266
+ this.updateCandidateDepth(candidateId, path, depths, queue);
267
+ }
268
+ }
269
+ }
270
+ }
271
+ /**
272
+ * Update candidate node depth if this path is longer
273
+ */
274
+ updateCandidateDepth(candidateId, path, depths, queue) {
275
+ const candidateDepth = this.calculateNodeDepth(candidateId, depths);
276
+ // Update if this is a longer path
277
+ const existing = depths.get(candidateId);
278
+ if (!existing || candidateDepth > existing.depth) {
279
+ const newPath = [...path, candidateId];
280
+ depths.set(candidateId, {
281
+ nodeId: candidateId,
282
+ depth: candidateDepth,
283
+ isInCycle: false,
284
+ isLeaf: false,
285
+ isHighRisk: candidateDepth > this.options.highRiskThreshold,
286
+ isCriticalPath: false,
287
+ pathToLeaf: newPath,
288
+ });
289
+ queue.push({ nodeId: candidateId, depth: candidateDepth, path: newPath });
290
+ }
291
+ }
292
+ /**
293
+ * Process remaining nodes not yet in depths map
294
+ */
295
+ processRemainingNodes(depths) {
296
+ for (const nodeId of this.graph.keys()) {
297
+ if (!depths.has(nodeId) && !this.cyclicNodes.has(nodeId)) {
298
+ const nodeDepth = this.calculateNodeDepth(nodeId, depths);
299
+ depths.set(nodeId, {
300
+ nodeId,
301
+ depth: nodeDepth,
302
+ isInCycle: false,
303
+ isLeaf: (this.graph.get(nodeId)?.size ?? 0) === 0,
304
+ isHighRisk: nodeDepth > this.options.highRiskThreshold,
305
+ isCriticalPath: false,
306
+ pathToLeaf: [nodeId],
307
+ });
308
+ }
309
+ }
310
+ }
311
+ /**
312
+ * Calculate depth for a single node based on its dependencies
313
+ */
314
+ calculateNodeDepth(nodeId, depths) {
315
+ const deps = this.graph.get(nodeId);
316
+ if (!deps || deps.size === 0) {
317
+ return 0; // Leaf node
318
+ }
319
+ let maxDepth = 0;
320
+ for (const depId of deps) {
321
+ const depDepth = depths.get(depId);
322
+ if (depDepth) {
323
+ if (depDepth.isInCycle) {
324
+ return Number.POSITIVE_INFINITY; // Depends on cyclic node
325
+ }
326
+ maxDepth = Math.max(maxDepth, depDepth.depth);
327
+ }
328
+ }
329
+ return maxDepth + 1;
330
+ }
331
+ /**
332
+ * @ac US-031-AC-2: Identify components with depth > 10
333
+ */
334
+ findHighRiskComponents(depths) {
335
+ const highRisk = [];
336
+ for (const depth of depths.values()) {
337
+ if (depth.isHighRisk) {
338
+ highRisk.push(depth);
339
+ }
340
+ }
341
+ // Sort by depth (highest first)
342
+ highRisk.sort((a, b) => {
343
+ if (a.depth === Number.POSITIVE_INFINITY && b.depth === Number.POSITIVE_INFINITY) {
344
+ return 0;
345
+ }
346
+ if (a.depth === Number.POSITIVE_INFINITY) {
347
+ return -1;
348
+ }
349
+ if (b.depth === Number.POSITIVE_INFINITY) {
350
+ return 1;
351
+ }
352
+ return b.depth - a.depth;
353
+ });
354
+ logger.info('High-risk components identified', {
355
+ count: highRisk.length,
356
+ threshold: this.options.highRiskThreshold,
357
+ });
358
+ return highRisk;
359
+ }
360
+ /**
361
+ * Get depth for a specific component
362
+ */
363
+ getDepth(nodeId) {
364
+ const depths = this.calculate();
365
+ return depths.depths.get(nodeId);
366
+ }
367
+ }
368
+ //# sourceMappingURL=dependency-depth-calculator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-depth-calculator.js","sourceRoot":"","sources":["../../src/dependencies/dependency-depth-calculator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,MAAM,MAAM,GAAG,SAAS,CAAC,2BAA2B,CAAC,CAAC;AAuDtD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,yBAAyB;IAC5B,KAAK,CAAkB;IACvB,OAAO,CAAoC;IAC3C,WAAW,CAAc;IAEjC,YAAmB,KAAsB,EAAE,UAAmC,EAAE;QAC9E,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,EAAE;YACxD,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE;SACnD,CAAC;QAEF,4CAA4C;QAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;QAC7B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;YACtD,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;gBACjC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,uCAAuC,EAAE;YACpD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACtB,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI;YAClC,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB;SAClD,CAAC,CAAC;IACL,CAAC;IAED,kEAAkE;IAClE;;;;OAIG;IACK,MAAM,CAAC,gBAAgB,CAAC,MAAmC;QACjE,IAAI,WAAW,GAAa,EAAE,CAA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BAAiB,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBACjF,OAAO,CAAC,CAAC;YACX,CAAC;YACD,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBACzC,OAAO,CAAC,CAAC,CAAC;YACZ,CAAC;YACD,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBACzC,OAAO,CAAC,CAAC;YACX,CAAC;YACD,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,iCAAiC,EAAE;YAC7C,KAAK,EAAE,QAAQ,CAAC,MAAM;YACtB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB;SAC1C,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,MAAc;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Dependency Graph Builder
3
+ * Builds a dependency graph from parsed metadata components
4
+ *
5
+ * @ac US-028-AC-1: Add nodes for each component
6
+ * @ac US-028-AC-2: Add edges for each dependency
7
+ * @ac US-028-AC-3: Handle bidirectional dependencies
8
+ * @ac US-028-AC-4: Track dependency types (hard, soft)
9
+ * @ac US-028-AC-5: Support incremental graph building
10
+ * @ac US-028-AC-6: Validate graph structure
11
+ *
12
+ * @issue #28
13
+ */
14
+ import type { MetadataComponent } from '../types/metadata.js';
15
+ import type { NodeId, DependencyAnalysisResult } from '../types/dependency.js';
16
+ /**
17
+ * Dependency types for tracking relationship strength
18
+ */
19
+ export type DependencyType = 'hard' | 'soft' | 'inferred';
20
+ /**
21
+ * Extended edge information
22
+ */
23
+ export type DependencyEdge = {
24
+ from: NodeId;
25
+ to: NodeId;
26
+ type: DependencyType;
27
+ reason?: string;
28
+ };
29
+ /**
30
+ * Options for building the dependency graph
31
+ */
32
+ export type GraphBuilderOptions = {
33
+ /** Track dependency types (hard/soft/inferred) */
34
+ trackDependencyTypes?: boolean;
35
+ /** Validate graph structure during build */
36
+ validateStructure?: boolean;
37
+ /** Max nodes before warning (performance) */
38
+ maxNodes?: number;
39
+ };
40
+ /**
41
+ * Dependency Graph Builder
42
+ *
43
+ * Performance optimized for 10,000+ nodes:
44
+ * - Uses Map/Set for O(1) lookups
45
+ * - Lazy validation
46
+ * - Incremental building support
47
+ *
48
+ * @example
49
+ * const builder = new DependencyGraphBuilder();
50
+ * builder.addComponent(apexClassComponent);
51
+ * builder.addComponent(triggerComponent);
52
+ * const result = builder.build();
53
+ * console.log(result.stats.totalComponents); // 2
54
+ */
55
+ export declare class DependencyGraphBuilder {
56
+ private components;
57
+ private graph;
58
+ private reverseGraph;
59
+ private edges;
60
+ private options;
61
+ constructor(options?: GraphBuilderOptions);
62
+ /**
63
+ * Get current size of the graph
64
+ */
65
+ get size(): number;
66
+ /**
67
+ * Check if graph is empty
68
+ */
69
+ get isEmpty(): boolean;
70
+ /**
71
+ * Create a node ID from type and name
72
+ */
73
+ private static createNodeId;
74
+ /**
75
+ * Add a metadata component to the graph
76
+ *
77
+ * @ac US-028-AC-1: Add nodes for each component
78
+ * @ac US-028-AC-5: Support incremental graph building
79
+ */
80
+ addComponent(component: MetadataComponent): void;
81
+ /**
82
+ * Add multiple components at once
83
+ *
84
+ * @ac US-028-AC-5: Support incremental graph building
85
+ */
86
+ addComponents(components: MetadataComponent[]): void;
87
+ /**
88
+ * Add a dependency edge between two nodes
89
+ *
90
+ * @ac US-028-AC-2: Add edges for each dependency
91
+ * @ac US-028-AC-3: Handle bidirectional dependencies
92
+ * @ac US-028-AC-4: Track dependency types
93
+ */
94
+ addEdge(from: NodeId, to: NodeId, type?: DependencyType, reason?: string): void;
95
+ /**
96
+ * Remove a component and its edges from the graph
97
+ */
98
+ removeComponent(nodeId: NodeId): boolean;
99
+ /**
100
+ * Get all dependencies of a component (outgoing edges)
101
+ */
102
+ getDependencies(nodeId: NodeId): Set<NodeId>;
103
+ /**
104
+ * Get all dependents of a component (incoming edges)
105
+ */
106
+ getDependents(nodeId: NodeId): Set<NodeId>;
107
+ /**
108
+ * Check if there's a direct dependency between two nodes
109
+ */
110
+ hasDependency(from: NodeId, to: NodeId): boolean;
111
+ /**
112
+ * Build the final dependency analysis result
113
+ *
114
+ * @ac US-028-AC-6: Validate graph structure
115
+ */
116
+ build(): DependencyAnalysisResult;
117
+ /**
118
+ * Clear the entire graph
119
+ */
120
+ clear(): void;
121
+ /**
122
+ * Validate graph structure
123
+ *
124
+ * @ac US-028-AC-6: Validate graph structure
125
+ */
126
+ private validate;
127
+ /**
128
+ * Detect circular dependencies using DFS
129
+ */
130
+ private detectCircularDependencies;
131
+ /**
132
+ * Find components with no dependencies or dependents
133
+ */
134
+ private findIsolatedComponents;
135
+ /**
136
+ * Generate graph statistics
137
+ */
138
+ private generateStats;
139
+ /**
140
+ * Calculate maximum dependency depth (simplified BFS)
141
+ */
142
+ private calculateMaxDepth;
143
+ /**
144
+ * BFS to calculate depth from a starting node
145
+ */
146
+ private bfsDepth;
147
+ /**
148
+ * Count total edges in the graph
149
+ */
150
+ private countEdges;
151
+ }