snow-flow 3.0.9 → 3.0.10

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 (294) hide show
  1. package/claude-flow.bat +0 -0
  2. package/claude-flow.ps1 +0 -0
  3. package/dist/mcp/servicenow-automation-mcp.js +0 -0
  4. package/dist/mcp/servicenow-deployment-mcp.js +0 -0
  5. package/dist/mcp/servicenow-integration-mcp.js +0 -0
  6. package/dist/mcp/servicenow-mcp-server.js +0 -0
  7. package/dist/mcp/servicenow-operations-mcp.js +0 -0
  8. package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
  9. package/dist/mcp/servicenow-progressive-indexer.js +0 -0
  10. package/dist/mcp/servicenow-reporting-analytics-mcp.js +133 -19
  11. package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
  12. package/dist/mcp/servicenow-update-set-mcp.js +0 -0
  13. package/dist/mcp/start-all-mcp-servers.js +0 -0
  14. package/dist/mcp/start-servicenow-mcp.js +0 -0
  15. package/memory/agents/README.md +1 -1
  16. package/memory/claude-flow-data.json +1 -1
  17. package/memory/sessions/README.md +1 -1
  18. package/package.json +2 -2
  19. package/.mcp.json +0 -22
  20. package/claude-flow.config.json +0 -20
  21. package/dist/agents/app-creator.agent.d.ts +0 -55
  22. package/dist/agents/app-creator.agent.js +0 -1292
  23. package/dist/agents/base/base-snow-agent.d.ts +0 -75
  24. package/dist/agents/base/base-snow-agent.js +0 -169
  25. package/dist/agents/base-snow-agent.d.ts +0 -63
  26. package/dist/agents/base-snow-agent.js +0 -296
  27. package/dist/agents/coordinator.d.ts +0 -200
  28. package/dist/agents/coordinator.js +0 -777
  29. package/dist/agents/flow-builder-agent.d.ts +0 -18
  30. package/dist/agents/flow-builder-agent.js +0 -197
  31. package/dist/agents/queen-403-handler.d.ts +0 -47
  32. package/dist/agents/queen-403-handler.js +0 -175
  33. package/dist/agents/queen-agent-example.d.ts +0 -23
  34. package/dist/agents/queen-agent-example.js +0 -240
  35. package/dist/agents/queen-agent.test.d.ts +0 -6
  36. package/dist/agents/script-generator.agent.d.ts +0 -32
  37. package/dist/agents/script-generator.agent.js +0 -772
  38. package/dist/agents/script-writer-agent.d.ts +0 -22
  39. package/dist/agents/script-writer-agent.js +0 -695
  40. package/dist/agents/security-agent.d.ts +0 -23
  41. package/dist/agents/security-agent.js +0 -619
  42. package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
  43. package/dist/agents/specialists/automation-specialist.agent.js +0 -204
  44. package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
  45. package/dist/agents/specialists/data-specialist.agent.js +0 -484
  46. package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
  47. package/dist/agents/specialists/integration-specialist.agent.js +0 -725
  48. package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
  49. package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
  50. package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
  51. package/dist/agents/specialists/security-specialist.agent.js +0 -309
  52. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
  53. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
  54. package/dist/agents/teams/base-team.d.ts +0 -72
  55. package/dist/agents/teams/base-team.js +0 -253
  56. package/dist/agents/teams/team-types.d.ts +0 -265
  57. package/dist/agents/teams/team-types.js +0 -3
  58. package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
  59. package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
  60. package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
  61. package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
  62. package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
  63. package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
  64. package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
  65. package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
  66. package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
  67. package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
  68. package/dist/agents/test-agent.d.ts +0 -26
  69. package/dist/agents/test-agent.js +0 -734
  70. package/dist/agents/test-agents.d.ts +0 -7
  71. package/dist/agents/test-agents.js +0 -64
  72. package/dist/agents/ui-builder.agent.d.ts +0 -50
  73. package/dist/agents/ui-builder.agent.js +0 -1539
  74. package/dist/agents/widget-builder.agent.d.ts +0 -32
  75. package/dist/agents/widget-builder.agent.js +0 -439
  76. package/dist/agents/widget-creator-agent.d.ts +0 -18
  77. package/dist/agents/widget-creator-agent.js +0 -498
  78. package/dist/agents/workflow-designer.agent.d.ts +0 -31
  79. package/dist/agents/workflow-designer.agent.js +0 -583
  80. package/dist/api/error-handling.d.ts +0 -325
  81. package/dist/api/error-handling.js +0 -1488
  82. package/dist/api/flow-designer-api.d.ts +0 -167
  83. package/dist/api/flow-designer-api.js +0 -554
  84. package/dist/api/natural-language-mapper.d.ts +0 -124
  85. package/dist/api/natural-language-mapper.js +0 -501
  86. package/dist/api/performance-optimizer.d.ts +0 -240
  87. package/dist/api/performance-optimizer.js +0 -706
  88. package/dist/api/transaction-manager.d.ts +0 -189
  89. package/dist/api/transaction-manager.js +0 -576
  90. package/dist/assembly/team-assembler.d.ts +0 -140
  91. package/dist/assembly/team-assembler.js +0 -502
  92. package/dist/benchmark-performance.d.ts +0 -41
  93. package/dist/benchmark-performance.js +0 -230
  94. package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
  95. package/dist/cli/snow-flow-cli-integration.js +0 -396
  96. package/dist/coordination/coordination-engine.d.ts +0 -41
  97. package/dist/coordination/coordination-engine.js +0 -324
  98. package/dist/coordination/coordination.test.d.ts +0 -6
  99. package/dist/coordination/example.d.ts +0 -31
  100. package/dist/coordination/example.js +0 -394
  101. package/dist/coordination/execution-patterns.d.ts +0 -43
  102. package/dist/coordination/execution-patterns.js +0 -507
  103. package/dist/coordination/factory.d.ts +0 -94
  104. package/dist/coordination/factory.js +0 -433
  105. package/dist/coordination/index.d.ts +0 -71
  106. package/dist/coordination/index.js +0 -135
  107. package/dist/coordination/progress-monitor.d.ts +0 -71
  108. package/dist/coordination/progress-monitor.js +0 -505
  109. package/dist/coordination/quality-gates.d.ts +0 -124
  110. package/dist/coordination/quality-gates.js +0 -577
  111. package/dist/coordination/shared-memory.d.ts +0 -39
  112. package/dist/coordination/shared-memory.js +0 -289
  113. package/dist/coordination/task-dependencies.d.ts +0 -50
  114. package/dist/coordination/task-dependencies.js +0 -407
  115. package/dist/coordination/team-coordinator.d.ts +0 -59
  116. package/dist/coordination/team-coordinator.js +0 -550
  117. package/dist/coordination/types.d.ts +0 -152
  118. package/dist/coordination/types.js +0 -3
  119. package/dist/mcp/mcp-wrapper.d.ts +0 -8
  120. package/dist/mcp/mcp-wrapper.js +0 -77
  121. package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
  122. package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
  123. package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
  124. package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
  125. package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
  126. package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
  127. package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
  128. package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
  129. package/dist/mcp/singleton-check.js +0 -31
  130. package/dist/mcp/test-simple-mcp.d.ts +0 -6
  131. package/dist/mcp/test-simple-mcp.js +0 -63
  132. package/dist/memory/hierarchical-memory-system.d.ts +0 -90
  133. package/dist/memory/hierarchical-memory-system.js +0 -400
  134. package/dist/memory/index.d.ts +0 -9
  135. package/dist/memory/index.js +0 -20
  136. package/dist/memory/mcp-integration-example.d.ts +0 -6
  137. package/dist/memory/mcp-integration-example.js +0 -281
  138. package/dist/memory/memory-client.d.ts +0 -199
  139. package/dist/memory/memory-client.js +0 -364
  140. package/dist/memory/memory-manager.d.ts +0 -29
  141. package/dist/memory/memory-manager.js +0 -280
  142. package/dist/memory/memory-operations.d.ts +0 -179
  143. package/dist/memory/memory-operations.js +0 -691
  144. package/dist/memory/memory-system.d.ts +0 -153
  145. package/dist/memory/memory-system.js +0 -651
  146. package/dist/memory/memory-test.d.ts +0 -6
  147. package/dist/memory/memory-test.js +0 -161
  148. package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
  149. package/dist/memory/snow-flow-memory-patterns.js +0 -200
  150. package/dist/memory/snow-memory.d.ts +0 -54
  151. package/dist/memory/snow-memory.js +0 -301
  152. package/dist/memory/swarm-memory.d.ts +0 -135
  153. package/dist/memory/swarm-memory.js +0 -378
  154. package/dist/optimization/flow-performance-optimizer.js +0 -723
  155. package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
  156. package/dist/orchestration/discovery/service-discovery.js +0 -808
  157. package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
  158. package/dist/orchestration/distributed-orchestrator.js +0 -712
  159. package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
  160. package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
  161. package/dist/orchestration/flow-update-orchestrator.js +0 -648
  162. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
  163. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
  164. package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
  165. package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
  166. package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
  167. package/dist/orchestration/state/distributed-state-manager.js +0 -716
  168. package/dist/orchestrator/flow-composer.d.ts +0 -105
  169. package/dist/orchestrator/flow-composer.js +0 -404
  170. package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
  171. package/dist/orchestrator/flow-pattern-templates.js +0 -908
  172. package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
  173. package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
  174. package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
  175. package/dist/orchestrator/flow-validation-engine.js +0 -913
  176. package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
  177. package/dist/orchestrator/snow-orchestrator.js +0 -235
  178. package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
  179. package/dist/orchestrator/subflow-creation-handler.js +0 -791
  180. package/dist/patterns/adaptive-patterns.d.ts +0 -140
  181. package/dist/patterns/adaptive-patterns.js +0 -549
  182. package/dist/queen/advanced-integration-test.d.ts +0 -48
  183. package/dist/queen/advanced-integration-test.js +0 -473
  184. package/dist/queen/integration-example.d.ts +0 -82
  185. package/dist/queen/integration-example.js +0 -219
  186. package/dist/queen/integration-test.d.ts +0 -72
  187. package/dist/queen/integration-test.js +0 -563
  188. package/dist/queen/mock-mcp-client.d.ts +0 -71
  189. package/dist/queen/mock-mcp-client.js +0 -317
  190. package/dist/queen/run-integration-tests.d.ts +0 -9
  191. package/dist/queen/run-integration-tests.js +0 -27
  192. package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
  193. package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
  194. package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
  195. package/dist/sparc/coordinators/team-coordinator.js +0 -402
  196. package/dist/sparc/modes/team-modes.d.ts +0 -33
  197. package/dist/sparc/modes/team-modes.js +0 -399
  198. package/dist/sparc/teams/application-team.d.ts +0 -73
  199. package/dist/sparc/teams/application-team.js +0 -463
  200. package/dist/sparc/teams/flow-team.d.ts +0 -67
  201. package/dist/sparc/teams/flow-team.js +0 -373
  202. package/dist/sparc/teams/widget-team.d.ts +0 -61
  203. package/dist/sparc/teams/widget-team.js +0 -280
  204. package/dist/specialists/app-specialists.d.ts +0 -93
  205. package/dist/specialists/app-specialists.js +0 -1639
  206. package/dist/specialists/base-specialist.d.ts +0 -19
  207. package/dist/specialists/base-specialist.js +0 -54
  208. package/dist/specialists/flow-specialists.d.ts +0 -113
  209. package/dist/specialists/flow-specialists.js +0 -1787
  210. package/dist/specialists/individual-specialists.d.ts +0 -67
  211. package/dist/specialists/individual-specialists.js +0 -632
  212. package/dist/specialists/widget-specialists.d.ts +0 -70
  213. package/dist/specialists/widget-specialists.js +0 -1264
  214. package/dist/src/utils/agent-detector.js +0 -655
  215. package/dist/teams/adaptive-team.d.ts +0 -81
  216. package/dist/teams/adaptive-team.js +0 -1153
  217. package/dist/teams/application-team.d.ts +0 -30
  218. package/dist/teams/application-team.js +0 -547
  219. package/dist/teams/base-team.d.ts +0 -55
  220. package/dist/teams/base-team.js +0 -243
  221. package/dist/teams/flow-team.d.ts +0 -28
  222. package/dist/teams/flow-team.js +0 -525
  223. package/dist/teams/widget-team.d.ts +0 -26
  224. package/dist/teams/widget-team.js +0 -459
  225. package/dist/templates/flow-template-system.js +0 -625
  226. package/dist/test-fetch-incidents.d.ts +0 -2
  227. package/dist/test-fetch-incidents.js +0 -84
  228. package/dist/test-incident-access.d.ts +0 -2
  229. package/dist/test-incident-access.js +0 -72
  230. package/dist/test-iphone-flow.js +0 -189
  231. package/dist/test-limit-problem.d.ts +0 -2
  232. package/dist/test-limit-problem.js +0 -60
  233. package/dist/test-ml-batch-fix.d.ts +0 -2
  234. package/dist/test-ml-batch-fix.js +0 -104
  235. package/dist/test-ml-batch.d.ts +0 -2
  236. package/dist/test-ml-batch.js +0 -87
  237. package/dist/test-ml-query.d.ts +0 -2
  238. package/dist/test-ml-query.js +0 -100
  239. package/dist/test-ml-training-fix.d.ts +0 -12
  240. package/dist/test-ml-training-fix.js +0 -113
  241. package/dist/test-ml-training.d.ts +0 -2
  242. package/dist/test-ml-training.js +0 -32
  243. package/dist/test-operations-query.d.ts +0 -2
  244. package/dist/test-operations-query.js +0 -84
  245. package/dist/test-performance-query.d.ts +0 -2
  246. package/dist/test-performance-query.js +0 -52
  247. package/dist/test-singleton-protection.d.ts +0 -8
  248. package/dist/test-singleton-protection.js +0 -110
  249. package/dist/test-smart-limits.d.ts +0 -13
  250. package/dist/test-smart-limits.js +0 -100
  251. package/dist/test-snow-query-incidents.d.ts +0 -2
  252. package/dist/test-snow-query-incidents.js +0 -66
  253. package/dist/test-universal-query.d.ts +0 -2
  254. package/dist/test-universal-query.js +0 -106
  255. package/dist/testing/flow-testing-automation.js +0 -641
  256. package/dist/utils/complete-flow-xml-generator.js +0 -1285
  257. package/dist/utils/file-storage-fallback.d.ts +0 -62
  258. package/dist/utils/file-storage-fallback.js +0 -289
  259. package/dist/utils/flow-api-discovery.d.ts +0 -151
  260. package/dist/utils/flow-api-discovery.js +0 -439
  261. package/dist/utils/flow-examples.js +0 -720
  262. package/dist/utils/flow-structure-builder.js +0 -677
  263. package/dist/utils/flow-xml-generator.d.ts +0 -41
  264. package/dist/utils/flow-xml-generator.js +0 -258
  265. package/dist/utils/improved-flow-xml-generator.js +0 -820
  266. package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
  267. package/dist/utils/mcp-process-manager.backup.js +0 -220
  268. package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
  269. package/dist/utils/mcp-singleton-enforcer.js +0 -201
  270. package/dist/utils/mcp-timeout-fix.d.ts +0 -53
  271. package/dist/utils/mcp-timeout-fix.js +0 -221
  272. package/dist/utils/migrate-claude-flow.d.ts +0 -22
  273. package/dist/utils/migrate-claude-flow.js +0 -120
  274. package/dist/utils/scope-utils.d.ts +0 -72
  275. package/dist/utils/scope-utils.js +0 -386
  276. package/dist/utils/snow-oauth-old.d.ts +0 -65
  277. package/dist/utils/snow-oauth-old.js +0 -345
  278. package/dist/utils/xml-first-flow-generator.js +0 -513
  279. package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
  280. package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
  281. package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
  282. package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
  283. package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
  284. package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
  285. package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
  286. package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
  287. package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
  288. package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
  289. package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
  290. package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
  291. package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
  292. package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
  293. package/reports/swarm-auto-centralized-1752649029776.json +0 -13
  294. package/src/memory/README.md +0 -240
@@ -1,769 +0,0 @@
1
- "use strict";
2
- /**
3
- * ServiceNow Flow vs Subflow Decision Engine
4
- *
5
- * This module implements intelligent decision logic to determine when to create
6
- * flows versus subflows in ServiceNow. It analyzes natural language requirements
7
- * and provides recommendations based on complexity, reusability, and best practices.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.FlowSubflowDecisionEngine = exports.FlowContext = exports.ReusabilityLevel = exports.ComplexityLevel = exports.FlowType = void 0;
11
- const logger_js_1 = require("../utils/logger.js");
12
- const servicenow_client_js_1 = require("../utils/servicenow-client.js");
13
- /**
14
- * Enumeration of flow types
15
- */
16
- var FlowType;
17
- (function (FlowType) {
18
- FlowType["MAIN_FLOW"] = "main_flow";
19
- FlowType["SUBFLOW"] = "subflow";
20
- })(FlowType || (exports.FlowType = FlowType = {}));
21
- /**
22
- * Complexity levels for flow analysis
23
- */
24
- var ComplexityLevel;
25
- (function (ComplexityLevel) {
26
- ComplexityLevel["LOW"] = "low";
27
- ComplexityLevel["MEDIUM"] = "medium";
28
- ComplexityLevel["HIGH"] = "high";
29
- ComplexityLevel["VERY_HIGH"] = "very_high";
30
- })(ComplexityLevel || (exports.ComplexityLevel = ComplexityLevel = {}));
31
- /**
32
- * Reusability assessment
33
- */
34
- var ReusabilityLevel;
35
- (function (ReusabilityLevel) {
36
- ReusabilityLevel["NONE"] = "none";
37
- ReusabilityLevel["LOW"] = "low";
38
- ReusabilityLevel["MEDIUM"] = "medium";
39
- ReusabilityLevel["HIGH"] = "high";
40
- })(ReusabilityLevel || (exports.ReusabilityLevel = ReusabilityLevel = {}));
41
- /**
42
- * Flow context types
43
- */
44
- var FlowContext;
45
- (function (FlowContext) {
46
- FlowContext["APPROVAL_WORKFLOW"] = "approval_workflow";
47
- FlowContext["FULFILLMENT_WORKFLOW"] = "fulfillment_workflow";
48
- FlowContext["NOTIFICATION_WORKFLOW"] = "notification_workflow";
49
- FlowContext["INTEGRATION_WORKFLOW"] = "integration_workflow";
50
- FlowContext["UTILITY_WORKFLOW"] = "utility_workflow";
51
- FlowContext["BUSINESS_LOGIC"] = "business_logic";
52
- })(FlowContext || (exports.FlowContext = FlowContext = {}));
53
- /**
54
- * Flow vs Subflow Decision Engine
55
- */
56
- class FlowSubflowDecisionEngine {
57
- constructor() {
58
- this.patterns = [];
59
- this.logger = new logger_js_1.Logger('FlowSubflowDecisionEngine');
60
- this.client = new servicenow_client_js_1.ServiceNowClient();
61
- this.initializePatterns();
62
- }
63
- /**
64
- * Main decision method - analyzes requirements and recommends flow type
65
- */
66
- async analyzeAndRecommend(instruction) {
67
- this.logger.info('Analyzing instruction for flow vs subflow decision', { instruction });
68
- // Parse the instruction to extract requirements
69
- const parsedRequirements = this.parseRequirements(instruction);
70
- // Analyze complexity
71
- const complexity = this.analyzeComplexity(parsedRequirements);
72
- // Analyze reusability
73
- const reusability = this.analyzeReusability(parsedRequirements);
74
- // Determine context
75
- const context = this.determineContext(parsedRequirements);
76
- // Build decision criteria
77
- const criteria = this.buildDecisionCriteria(parsedRequirements, complexity, reusability, context);
78
- // Make the decision
79
- const decision = this.makeDecision(criteria);
80
- // Identify subflow candidates
81
- const subflowCandidates = this.identifySubflowCandidates(parsedRequirements);
82
- // Match patterns
83
- const patterns = this.matchPatterns(parsedRequirements, context);
84
- // Generate alternatives
85
- const alternatives = this.generateAlternatives(criteria);
86
- const result = {
87
- recommendedType: decision.type,
88
- confidence: decision.confidence,
89
- rationale: [decision.rationale],
90
- criteria,
91
- alternatives,
92
- patterns,
93
- subflowCandidates
94
- };
95
- this.logger.info('Flow analysis complete', {
96
- recommendedType: result.recommendedType,
97
- confidence: result.confidence,
98
- subflowCandidates: result.subflowCandidates.length
99
- });
100
- return result;
101
- }
102
- /**
103
- * Parse natural language requirements into structured data
104
- */
105
- parseRequirements(instruction) {
106
- const lowerInstruction = instruction.toLowerCase();
107
- return {
108
- originalInstruction: instruction,
109
- // Action analysis
110
- actions: this.extractActions(lowerInstruction),
111
- // Logical flow analysis
112
- hasConditionalLogic: this.hasConditionalLogic(lowerInstruction),
113
- hasLoops: this.hasLoops(lowerInstruction),
114
- hasParallelActions: this.hasParallelActions(lowerInstruction),
115
- // Integration analysis
116
- hasExternalIntegrations: this.hasExternalIntegrations(lowerInstruction),
117
- hasDataTransformation: this.hasDataTransformation(lowerInstruction),
118
- // Business logic analysis
119
- hasBusinessRules: this.hasBusinessRules(lowerInstruction),
120
- hasApprovalLogic: this.hasApprovalLogic(lowerInstruction),
121
- // Reusability indicators
122
- hasReusableComponents: this.hasReusableComponents(lowerInstruction),
123
- isUtilityFunction: this.isUtilityFunction(lowerInstruction),
124
- // Error handling
125
- hasErrorHandling: this.hasErrorHandling(lowerInstruction),
126
- // Input/Output analysis
127
- inputParameters: this.extractInputParameters(lowerInstruction),
128
- outputParameters: this.extractOutputParameters(lowerInstruction),
129
- // Context indicators
130
- contextIndicators: this.extractContextIndicators(lowerInstruction)
131
- };
132
- }
133
- /**
134
- * Analyze complexity based on parsed requirements
135
- */
136
- analyzeComplexity(requirements) {
137
- let complexityScore = 0;
138
- // Base complexity from action count
139
- complexityScore += Math.min(requirements.actions.length * 0.5, 5);
140
- // Logical complexity
141
- if (requirements.hasConditionalLogic)
142
- complexityScore += 2;
143
- if (requirements.hasLoops)
144
- complexityScore += 3;
145
- if (requirements.hasParallelActions)
146
- complexityScore += 2;
147
- // Integration complexity
148
- if (requirements.hasExternalIntegrations)
149
- complexityScore += 3;
150
- if (requirements.hasDataTransformation)
151
- complexityScore += 2;
152
- // Business logic complexity
153
- if (requirements.hasBusinessRules)
154
- complexityScore += 2;
155
- if (requirements.hasApprovalLogic)
156
- complexityScore += 3;
157
- // Error handling complexity
158
- if (requirements.hasErrorHandling)
159
- complexityScore += 1;
160
- // Parameter complexity
161
- complexityScore += Math.min(requirements.inputParameters.length * 0.3, 3);
162
- complexityScore += Math.min(requirements.outputParameters.length * 0.3, 3);
163
- // Determine complexity level
164
- if (complexityScore >= 15)
165
- return ComplexityLevel.VERY_HIGH;
166
- if (complexityScore >= 10)
167
- return ComplexityLevel.HIGH;
168
- if (complexityScore >= 5)
169
- return ComplexityLevel.MEDIUM;
170
- return ComplexityLevel.LOW;
171
- }
172
- /**
173
- * Analyze reusability potential
174
- */
175
- analyzeReusability(requirements) {
176
- let reusabilityScore = 0;
177
- // Utility function indicators
178
- if (requirements.isUtilityFunction)
179
- reusabilityScore += 5;
180
- // Reusable component indicators
181
- if (requirements.hasReusableComponents)
182
- reusabilityScore += 3;
183
- // Generic patterns
184
- if (this.isGenericPattern(requirements))
185
- reusabilityScore += 4;
186
- // Common business logic
187
- if (requirements.hasBusinessRules && this.isCommonBusinessLogic(requirements))
188
- reusabilityScore += 3;
189
- // Data transformation utilities
190
- if (requirements.hasDataTransformation)
191
- reusabilityScore += 2;
192
- // Multiple context applicability
193
- if (requirements.contextIndicators.length > 1)
194
- reusabilityScore += 2;
195
- // Determine reusability level
196
- if (reusabilityScore >= 12)
197
- return ReusabilityLevel.HIGH;
198
- if (reusabilityScore >= 8)
199
- return ReusabilityLevel.MEDIUM;
200
- if (reusabilityScore >= 4)
201
- return ReusabilityLevel.LOW;
202
- return ReusabilityLevel.NONE;
203
- }
204
- /**
205
- * Determine the flow context
206
- */
207
- determineContext(requirements) {
208
- const contextIndicators = requirements.contextIndicators;
209
- if (contextIndicators.includes('approval') || requirements.hasApprovalLogic) {
210
- return FlowContext.APPROVAL_WORKFLOW;
211
- }
212
- if (contextIndicators.includes('fulfillment') || contextIndicators.includes('order')) {
213
- return FlowContext.FULFILLMENT_WORKFLOW;
214
- }
215
- if (contextIndicators.includes('notification') || contextIndicators.includes('email')) {
216
- return FlowContext.NOTIFICATION_WORKFLOW;
217
- }
218
- if (requirements.hasExternalIntegrations) {
219
- return FlowContext.INTEGRATION_WORKFLOW;
220
- }
221
- if (requirements.isUtilityFunction || requirements.hasReusableComponents) {
222
- return FlowContext.UTILITY_WORKFLOW;
223
- }
224
- if (requirements.hasBusinessRules) {
225
- return FlowContext.BUSINESS_LOGIC;
226
- }
227
- return FlowContext.UTILITY_WORKFLOW;
228
- }
229
- /**
230
- * Build comprehensive decision criteria
231
- */
232
- buildDecisionCriteria(requirements, complexity, reusability, context) {
233
- return {
234
- complexity,
235
- reusability,
236
- context,
237
- actionCount: requirements.actions.length,
238
- inputParameters: requirements.inputParameters.length,
239
- outputParameters: requirements.outputParameters.length,
240
- businessLogicComplexity: this.calculateBusinessLogicComplexity(requirements),
241
- integrationPoints: this.calculateIntegrationPoints(requirements),
242
- errorHandlingComplexity: this.calculateErrorHandlingComplexity(requirements),
243
- testabilityScore: this.calculateTestabilityScore(requirements),
244
- maintainabilityScore: this.calculateMaintainabilityScore(requirements)
245
- };
246
- }
247
- /**
248
- * Make the main decision based on criteria
249
- */
250
- makeDecision(criteria) {
251
- const rationale = [];
252
- let score = 0;
253
- // Complexity scoring (favors subflows for high complexity reusable components)
254
- if (criteria.complexity === ComplexityLevel.HIGH || criteria.complexity === ComplexityLevel.VERY_HIGH) {
255
- if (criteria.reusability === ReusabilityLevel.HIGH || criteria.reusability === ReusabilityLevel.MEDIUM) {
256
- score += 30;
257
- rationale.push('High complexity with high reusability favors subflow creation');
258
- }
259
- else {
260
- score -= 10;
261
- rationale.push('High complexity with low reusability favors main flow');
262
- }
263
- }
264
- // Reusability scoring
265
- if (criteria.reusability === ReusabilityLevel.HIGH) {
266
- score += 25;
267
- rationale.push('High reusability strongly favors subflow');
268
- }
269
- else if (criteria.reusability === ReusabilityLevel.MEDIUM) {
270
- score += 15;
271
- rationale.push('Medium reusability moderately favors subflow');
272
- }
273
- // Context scoring
274
- if (criteria.context === FlowContext.UTILITY_WORKFLOW) {
275
- score += 20;
276
- rationale.push('Utility workflow context favors subflow');
277
- }
278
- else if (criteria.context === FlowContext.BUSINESS_LOGIC) {
279
- score += 15;
280
- rationale.push('Business logic context favors subflow for reusability');
281
- }
282
- // Action count scoring
283
- if (criteria.actionCount >= 10) {
284
- score += 10;
285
- rationale.push('High action count favors subflow for maintainability');
286
- }
287
- else if (criteria.actionCount <= 3) {
288
- score -= 5;
289
- rationale.push('Low action count favors main flow');
290
- }
291
- // Input/Output parameter scoring
292
- if (criteria.inputParameters >= 5 || criteria.outputParameters >= 3) {
293
- score += 10;
294
- rationale.push('High parameter count favors subflow for clarity');
295
- }
296
- // Business logic complexity
297
- if (criteria.businessLogicComplexity >= 8) {
298
- score += 15;
299
- rationale.push('Complex business logic favors subflow for separation of concerns');
300
- }
301
- // Integration points
302
- if (criteria.integrationPoints >= 3) {
303
- score += 10;
304
- rationale.push('Multiple integration points favor subflow for modularity');
305
- }
306
- // Testability score
307
- if (criteria.testabilityScore >= 8) {
308
- score += 10;
309
- rationale.push('High testability requirements favor subflow');
310
- }
311
- // Maintainability score
312
- if (criteria.maintainabilityScore >= 8) {
313
- score += 10;
314
- rationale.push('High maintainability requirements favor subflow');
315
- }
316
- // Determine recommendation based on score
317
- const confidence = Math.min(Math.abs(score) / 100, 0.95);
318
- if (score >= 30) {
319
- return {
320
- type: FlowType.SUBFLOW,
321
- confidence: confidence,
322
- rationale: rationale.join('; '),
323
- pros: [
324
- 'Improved reusability across multiple flows',
325
- 'Better maintainability and testability',
326
- 'Clear separation of concerns',
327
- 'Reduced code duplication'
328
- ],
329
- cons: [
330
- 'Additional complexity in flow design',
331
- 'Potential performance overhead',
332
- 'More artifacts to manage'
333
- ]
334
- };
335
- }
336
- else {
337
- return {
338
- type: FlowType.MAIN_FLOW,
339
- confidence: confidence,
340
- rationale: rationale.join('; ') || 'Simple workflow without complex reusability requirements',
341
- pros: [
342
- 'Simpler flow design',
343
- 'Fewer artifacts to manage',
344
- 'Direct execution path',
345
- 'Easier debugging'
346
- ],
347
- cons: [
348
- 'Potential code duplication',
349
- 'Limited reusability',
350
- 'May become complex over time'
351
- ]
352
- };
353
- }
354
- }
355
- /**
356
- * Identify potential subflow candidates within the requirements
357
- */
358
- identifySubflowCandidates(requirements) {
359
- const candidates = [];
360
- // Approval logic candidate
361
- if (requirements.hasApprovalLogic) {
362
- candidates.push({
363
- name: 'Approval Process',
364
- description: 'Reusable approval workflow with configurable approvers',
365
- reason: 'Approval logic is commonly reused across different workflows',
366
- complexity: ComplexityLevel.MEDIUM,
367
- reusability: ReusabilityLevel.HIGH,
368
- inputs: [
369
- {
370
- name: 'record',
371
- type: 'reference',
372
- required: true,
373
- description: 'Record requiring approval'
374
- },
375
- {
376
- name: 'approvers',
377
- type: 'string',
378
- required: true,
379
- description: 'Comma-separated list of approvers'
380
- },
381
- {
382
- name: 'timeout_hours',
383
- type: 'integer',
384
- required: false,
385
- description: 'Approval timeout in hours',
386
- defaultValue: 48
387
- }
388
- ],
389
- outputs: [
390
- {
391
- name: 'approval_state',
392
- type: 'string',
393
- description: 'Final approval state (approved/rejected/timeout)'
394
- },
395
- {
396
- name: 'approved_by',
397
- type: 'string',
398
- description: 'User who approved the request'
399
- },
400
- {
401
- name: 'approval_comments',
402
- type: 'string',
403
- description: 'Comments from the approver'
404
- }
405
- ],
406
- actions: ['request_approval', 'check_timeout', 'process_response']
407
- });
408
- }
409
- // Notification candidate
410
- if (requirements.contextIndicators.includes('notification') || requirements.contextIndicators.includes('email')) {
411
- candidates.push({
412
- name: 'Notification Handler',
413
- description: 'Reusable notification system with multiple delivery methods',
414
- reason: 'Notification logic is commonly reused across different workflows',
415
- complexity: ComplexityLevel.LOW,
416
- reusability: ReusabilityLevel.HIGH,
417
- inputs: [
418
- {
419
- name: 'recipients',
420
- type: 'string',
421
- required: true,
422
- description: 'Recipients for the notification'
423
- },
424
- {
425
- name: 'message_template',
426
- type: 'string',
427
- required: true,
428
- description: 'Message template to use'
429
- },
430
- {
431
- name: 'notification_type',
432
- type: 'string',
433
- required: false,
434
- description: 'Type of notification (email, sms, push)',
435
- defaultValue: 'email'
436
- }
437
- ],
438
- outputs: [
439
- {
440
- name: 'notification_sent',
441
- type: 'boolean',
442
- description: 'Whether notification was sent successfully'
443
- },
444
- {
445
- name: 'delivery_status',
446
- type: 'string',
447
- description: 'Delivery status details'
448
- }
449
- ],
450
- actions: ['format_message', 'send_notification', 'track_delivery']
451
- });
452
- }
453
- // Data transformation candidate
454
- if (requirements.hasDataTransformation) {
455
- candidates.push({
456
- name: 'Data Transformer',
457
- description: 'Reusable data transformation utility',
458
- reason: 'Data transformation logic can be reused across multiple contexts',
459
- complexity: ComplexityLevel.MEDIUM,
460
- reusability: ReusabilityLevel.MEDIUM,
461
- inputs: [
462
- {
463
- name: 'source_data',
464
- type: 'object',
465
- required: true,
466
- description: 'Source data to transform'
467
- },
468
- {
469
- name: 'transformation_rules',
470
- type: 'object',
471
- required: true,
472
- description: 'Rules for data transformation'
473
- }
474
- ],
475
- outputs: [
476
- {
477
- name: 'transformed_data',
478
- type: 'object',
479
- description: 'Transformed data result'
480
- },
481
- {
482
- name: 'transformation_success',
483
- type: 'boolean',
484
- description: 'Whether transformation was successful'
485
- }
486
- ],
487
- actions: ['validate_input', 'apply_transformation', 'validate_output']
488
- });
489
- }
490
- // Business rule candidate
491
- if (requirements.hasBusinessRules) {
492
- candidates.push({
493
- name: 'Business Rule Processor',
494
- description: 'Reusable business rule evaluation engine',
495
- reason: 'Business rules are often reused across different business processes',
496
- complexity: ComplexityLevel.HIGH,
497
- reusability: ReusabilityLevel.HIGH,
498
- inputs: [
499
- {
500
- name: 'business_object',
501
- type: 'object',
502
- required: true,
503
- description: 'Business object to evaluate'
504
- },
505
- {
506
- name: 'rule_set',
507
- type: 'string',
508
- required: true,
509
- description: 'Rule set identifier'
510
- }
511
- ],
512
- outputs: [
513
- {
514
- name: 'rule_result',
515
- type: 'object',
516
- description: 'Result of rule evaluation'
517
- },
518
- {
519
- name: 'violated_rules',
520
- type: 'array',
521
- description: 'List of violated rules'
522
- }
523
- ],
524
- actions: ['load_rules', 'evaluate_rules', 'format_results']
525
- });
526
- }
527
- return candidates;
528
- }
529
- /**
530
- * Match known patterns to the requirements
531
- */
532
- matchPatterns(requirements, context) {
533
- return this.patterns.filter(pattern => {
534
- // Match by context
535
- if (pattern.context === context)
536
- return true;
537
- // Match by actions
538
- const actionMatch = pattern.commonActions.some(action => requirements.actions.some((reqAction) => reqAction.includes(action)));
539
- return actionMatch;
540
- });
541
- }
542
- /**
543
- * Generate alternative recommendations
544
- */
545
- generateAlternatives(criteria) {
546
- const alternatives = [];
547
- // Always provide the opposite recommendation as an alternative
548
- if (criteria.reusability === ReusabilityLevel.HIGH) {
549
- alternatives.push({
550
- type: FlowType.MAIN_FLOW,
551
- confidence: 0.3,
552
- rationale: 'Direct implementation without subflow abstraction',
553
- pros: ['Simpler initial implementation', 'Fewer dependencies'],
554
- cons: ['Limited reusability', 'Potential duplication']
555
- });
556
- }
557
- else {
558
- alternatives.push({
559
- type: FlowType.SUBFLOW,
560
- confidence: 0.4,
561
- rationale: 'Create subflow for future reusability',
562
- pros: ['Future-proof design', 'Easier to test'],
563
- cons: ['Over-engineering for current needs', 'Additional complexity']
564
- });
565
- }
566
- return alternatives;
567
- }
568
- /**
569
- * Initialize common flow patterns
570
- */
571
- initializePatterns() {
572
- this.patterns = [
573
- {
574
- name: 'Approval Workflow',
575
- description: 'Standard approval process with configurable approvers',
576
- context: FlowContext.APPROVAL_WORKFLOW,
577
- recommendedType: FlowType.SUBFLOW,
578
- commonActions: ['approve', 'reject', 'timeout'],
579
- inputPatterns: ['approvers', 'record', 'timeout'],
580
- outputPatterns: ['approval_state', 'approved_by'],
581
- complexity: ComplexityLevel.MEDIUM
582
- },
583
- {
584
- name: 'Notification Dispatcher',
585
- description: 'Multi-channel notification system',
586
- context: FlowContext.NOTIFICATION_WORKFLOW,
587
- recommendedType: FlowType.SUBFLOW,
588
- commonActions: ['send_email', 'send_sms', 'track_delivery'],
589
- inputPatterns: ['recipients', 'message', 'channel'],
590
- outputPatterns: ['delivery_status', 'sent_count'],
591
- complexity: ComplexityLevel.LOW
592
- },
593
- {
594
- name: 'Order Fulfillment',
595
- description: 'Complete order processing workflow',
596
- context: FlowContext.FULFILLMENT_WORKFLOW,
597
- recommendedType: FlowType.MAIN_FLOW,
598
- commonActions: ['validate_order', 'process_payment', 'ship_order'],
599
- inputPatterns: ['order', 'customer', 'payment_method'],
600
- outputPatterns: ['order_status', 'tracking_number'],
601
- complexity: ComplexityLevel.HIGH
602
- },
603
- {
604
- name: 'Data Validation',
605
- description: 'Reusable data validation utility',
606
- context: FlowContext.UTILITY_WORKFLOW,
607
- recommendedType: FlowType.SUBFLOW,
608
- commonActions: ['validate_format', 'check_constraints', 'sanitize'],
609
- inputPatterns: ['data', 'validation_rules'],
610
- outputPatterns: ['is_valid', 'errors'],
611
- complexity: ComplexityLevel.LOW
612
- },
613
- {
614
- name: 'Integration Connector',
615
- description: 'External system integration pattern',
616
- context: FlowContext.INTEGRATION_WORKFLOW,
617
- recommendedType: FlowType.SUBFLOW,
618
- commonActions: ['authenticate', 'transform_data', 'call_api'],
619
- inputPatterns: ['endpoint', 'credentials', 'payload'],
620
- outputPatterns: ['response', 'status'],
621
- complexity: ComplexityLevel.MEDIUM
622
- }
623
- ];
624
- }
625
- // Helper methods for requirement analysis
626
- extractActions(instruction) {
627
- const actions = [];
628
- const actionKeywords = [
629
- 'approve', 'reject', 'notify', 'send', 'create', 'update', 'delete',
630
- 'validate', 'process', 'transform', 'integrate', 'schedule', 'assign',
631
- 'escalate', 'complete', 'cancel', 'retry', 'log', 'track', 'monitor'
632
- ];
633
- actionKeywords.forEach(keyword => {
634
- if (instruction.includes(keyword)) {
635
- actions.push(keyword);
636
- }
637
- });
638
- return actions;
639
- }
640
- hasConditionalLogic(instruction) {
641
- return /\b(if|when|unless|condition|check|validate|approve|reject)\b/.test(instruction);
642
- }
643
- hasLoops(instruction) {
644
- return /\b(loop|repeat|iterate|foreach|while|until|retry)\b/.test(instruction);
645
- }
646
- hasParallelActions(instruction) {
647
- return /\b(parallel|concurrent|simultaneously|at the same time)\b/.test(instruction);
648
- }
649
- hasExternalIntegrations(instruction) {
650
- return /\b(api|integration|external|third-party|webhook|service)\b/.test(instruction);
651
- }
652
- hasDataTransformation(instruction) {
653
- return /\b(transform|convert|map|format|parse|serialize)\b/.test(instruction);
654
- }
655
- hasBusinessRules(instruction) {
656
- return /\b(business rule|policy|constraint|validation|compliance)\b/.test(instruction);
657
- }
658
- hasApprovalLogic(instruction) {
659
- return /\b(approval|approve|reject|escalate|manager|supervisor)\b/.test(instruction);
660
- }
661
- hasReusableComponents(instruction) {
662
- return /\b(reuse|common|shared|utility|helper|generic)\b/.test(instruction);
663
- }
664
- isUtilityFunction(instruction) {
665
- return /\b(utility|helper|common|shared|library|function)\b/.test(instruction);
666
- }
667
- hasErrorHandling(instruction) {
668
- return /\b(error|exception|fail|retry|fallback|recovery)\b/.test(instruction);
669
- }
670
- extractInputParameters(instruction) {
671
- const parameters = [];
672
- const parameterPatterns = [
673
- /with\s+([a-zA-Z_][a-zA-Z0-9_]*)/g,
674
- /using\s+([a-zA-Z_][a-zA-Z0-9_]*)/g,
675
- /input\s+([a-zA-Z_][a-zA-Z0-9_]*)/g
676
- ];
677
- parameterPatterns.forEach(pattern => {
678
- let match;
679
- while ((match = pattern.exec(instruction)) !== null) {
680
- parameters.push(match[1]);
681
- }
682
- });
683
- return parameters;
684
- }
685
- extractOutputParameters(instruction) {
686
- const parameters = [];
687
- const parameterPatterns = [
688
- /returns?\s+([a-zA-Z_][a-zA-Z0-9_]*)/g,
689
- /output\s+([a-zA-Z_][a-zA-Z0-9_]*)/g,
690
- /result\s+([a-zA-Z_][a-zA-Z0-9_]*)/g
691
- ];
692
- parameterPatterns.forEach(pattern => {
693
- let match;
694
- while ((match = pattern.exec(instruction)) !== null) {
695
- parameters.push(match[1]);
696
- }
697
- });
698
- return parameters;
699
- }
700
- extractContextIndicators(instruction) {
701
- const indicators = [];
702
- const contextKeywords = [
703
- 'approval', 'fulfillment', 'notification', 'integration', 'utility',
704
- 'business', 'order', 'catalog', 'incident', 'problem', 'change'
705
- ];
706
- contextKeywords.forEach(keyword => {
707
- if (instruction.includes(keyword)) {
708
- indicators.push(keyword);
709
- }
710
- });
711
- return indicators;
712
- }
713
- isGenericPattern(requirements) {
714
- return requirements.isUtilityFunction ||
715
- requirements.hasReusableComponents ||
716
- requirements.contextIndicators.length > 2;
717
- }
718
- isCommonBusinessLogic(requirements) {
719
- const commonLogicPatterns = ['approval', 'validation', 'notification', 'assignment'];
720
- return commonLogicPatterns.some(pattern => requirements.contextIndicators.includes(pattern));
721
- }
722
- calculateBusinessLogicComplexity(requirements) {
723
- let complexity = 0;
724
- if (requirements.hasBusinessRules)
725
- complexity += 3;
726
- if (requirements.hasApprovalLogic)
727
- complexity += 2;
728
- if (requirements.hasConditionalLogic)
729
- complexity += 2;
730
- if (requirements.hasLoops)
731
- complexity += 3;
732
- return complexity;
733
- }
734
- calculateIntegrationPoints(requirements) {
735
- let points = 0;
736
- if (requirements.hasExternalIntegrations)
737
- points += 2;
738
- if (requirements.hasDataTransformation)
739
- points += 1;
740
- return points;
741
- }
742
- calculateErrorHandlingComplexity(requirements) {
743
- return requirements.hasErrorHandling ? 3 : 0;
744
- }
745
- calculateTestabilityScore(requirements) {
746
- let score = 5; // Base score
747
- if (requirements.inputParameters.length > 0)
748
- score += 2;
749
- if (requirements.outputParameters.length > 0)
750
- score += 2;
751
- if (requirements.hasBusinessRules)
752
- score += 1;
753
- return Math.min(score, 10);
754
- }
755
- calculateMaintainabilityScore(requirements) {
756
- let score = 5; // Base score
757
- if (requirements.actions.length > 5)
758
- score += 2;
759
- if (requirements.hasBusinessRules)
760
- score += 1;
761
- if (requirements.hasErrorHandling)
762
- score += 1;
763
- if (requirements.hasReusableComponents)
764
- score += 1;
765
- return Math.min(score, 10);
766
- }
767
- }
768
- exports.FlowSubflowDecisionEngine = FlowSubflowDecisionEngine;
769
- //# sourceMappingURL=flow-subflow-decision-engine.js.map