snow-flow 3.0.8 → 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 (295) 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/dist/utils/snow-oauth.js +53 -16
  16. package/memory/agents/README.md +1 -1
  17. package/memory/claude-flow-data.json +1 -1
  18. package/memory/sessions/README.md +1 -1
  19. package/package.json +2 -2
  20. package/.mcp.json +0 -22
  21. package/claude-flow.config.json +0 -20
  22. package/dist/agents/app-creator.agent.d.ts +0 -55
  23. package/dist/agents/app-creator.agent.js +0 -1292
  24. package/dist/agents/base/base-snow-agent.d.ts +0 -75
  25. package/dist/agents/base/base-snow-agent.js +0 -169
  26. package/dist/agents/base-snow-agent.d.ts +0 -63
  27. package/dist/agents/base-snow-agent.js +0 -296
  28. package/dist/agents/coordinator.d.ts +0 -200
  29. package/dist/agents/coordinator.js +0 -777
  30. package/dist/agents/flow-builder-agent.d.ts +0 -18
  31. package/dist/agents/flow-builder-agent.js +0 -197
  32. package/dist/agents/queen-403-handler.d.ts +0 -47
  33. package/dist/agents/queen-403-handler.js +0 -175
  34. package/dist/agents/queen-agent-example.d.ts +0 -23
  35. package/dist/agents/queen-agent-example.js +0 -240
  36. package/dist/agents/queen-agent.test.d.ts +0 -6
  37. package/dist/agents/script-generator.agent.d.ts +0 -32
  38. package/dist/agents/script-generator.agent.js +0 -772
  39. package/dist/agents/script-writer-agent.d.ts +0 -22
  40. package/dist/agents/script-writer-agent.js +0 -695
  41. package/dist/agents/security-agent.d.ts +0 -23
  42. package/dist/agents/security-agent.js +0 -619
  43. package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
  44. package/dist/agents/specialists/automation-specialist.agent.js +0 -204
  45. package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
  46. package/dist/agents/specialists/data-specialist.agent.js +0 -484
  47. package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
  48. package/dist/agents/specialists/integration-specialist.agent.js +0 -725
  49. package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
  50. package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
  51. package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
  52. package/dist/agents/specialists/security-specialist.agent.js +0 -309
  53. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
  54. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
  55. package/dist/agents/teams/base-team.d.ts +0 -72
  56. package/dist/agents/teams/base-team.js +0 -253
  57. package/dist/agents/teams/team-types.d.ts +0 -265
  58. package/dist/agents/teams/team-types.js +0 -3
  59. package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
  60. package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
  61. package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
  62. package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
  63. package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
  64. package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
  65. package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
  66. package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
  67. package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
  68. package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
  69. package/dist/agents/test-agent.d.ts +0 -26
  70. package/dist/agents/test-agent.js +0 -734
  71. package/dist/agents/test-agents.d.ts +0 -7
  72. package/dist/agents/test-agents.js +0 -64
  73. package/dist/agents/ui-builder.agent.d.ts +0 -50
  74. package/dist/agents/ui-builder.agent.js +0 -1539
  75. package/dist/agents/widget-builder.agent.d.ts +0 -32
  76. package/dist/agents/widget-builder.agent.js +0 -439
  77. package/dist/agents/widget-creator-agent.d.ts +0 -18
  78. package/dist/agents/widget-creator-agent.js +0 -498
  79. package/dist/agents/workflow-designer.agent.d.ts +0 -31
  80. package/dist/agents/workflow-designer.agent.js +0 -583
  81. package/dist/api/error-handling.d.ts +0 -325
  82. package/dist/api/error-handling.js +0 -1488
  83. package/dist/api/flow-designer-api.d.ts +0 -167
  84. package/dist/api/flow-designer-api.js +0 -554
  85. package/dist/api/natural-language-mapper.d.ts +0 -124
  86. package/dist/api/natural-language-mapper.js +0 -501
  87. package/dist/api/performance-optimizer.d.ts +0 -240
  88. package/dist/api/performance-optimizer.js +0 -706
  89. package/dist/api/transaction-manager.d.ts +0 -189
  90. package/dist/api/transaction-manager.js +0 -576
  91. package/dist/assembly/team-assembler.d.ts +0 -140
  92. package/dist/assembly/team-assembler.js +0 -502
  93. package/dist/benchmark-performance.d.ts +0 -41
  94. package/dist/benchmark-performance.js +0 -230
  95. package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
  96. package/dist/cli/snow-flow-cli-integration.js +0 -396
  97. package/dist/coordination/coordination-engine.d.ts +0 -41
  98. package/dist/coordination/coordination-engine.js +0 -324
  99. package/dist/coordination/coordination.test.d.ts +0 -6
  100. package/dist/coordination/example.d.ts +0 -31
  101. package/dist/coordination/example.js +0 -394
  102. package/dist/coordination/execution-patterns.d.ts +0 -43
  103. package/dist/coordination/execution-patterns.js +0 -507
  104. package/dist/coordination/factory.d.ts +0 -94
  105. package/dist/coordination/factory.js +0 -433
  106. package/dist/coordination/index.d.ts +0 -71
  107. package/dist/coordination/index.js +0 -135
  108. package/dist/coordination/progress-monitor.d.ts +0 -71
  109. package/dist/coordination/progress-monitor.js +0 -505
  110. package/dist/coordination/quality-gates.d.ts +0 -124
  111. package/dist/coordination/quality-gates.js +0 -577
  112. package/dist/coordination/shared-memory.d.ts +0 -39
  113. package/dist/coordination/shared-memory.js +0 -289
  114. package/dist/coordination/task-dependencies.d.ts +0 -50
  115. package/dist/coordination/task-dependencies.js +0 -407
  116. package/dist/coordination/team-coordinator.d.ts +0 -59
  117. package/dist/coordination/team-coordinator.js +0 -550
  118. package/dist/coordination/types.d.ts +0 -152
  119. package/dist/coordination/types.js +0 -3
  120. package/dist/mcp/mcp-wrapper.d.ts +0 -8
  121. package/dist/mcp/mcp-wrapper.js +0 -77
  122. package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
  123. package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
  124. package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
  125. package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
  126. package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
  127. package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
  128. package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
  129. package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
  130. package/dist/mcp/singleton-check.js +0 -31
  131. package/dist/mcp/test-simple-mcp.d.ts +0 -6
  132. package/dist/mcp/test-simple-mcp.js +0 -63
  133. package/dist/memory/hierarchical-memory-system.d.ts +0 -90
  134. package/dist/memory/hierarchical-memory-system.js +0 -400
  135. package/dist/memory/index.d.ts +0 -9
  136. package/dist/memory/index.js +0 -20
  137. package/dist/memory/mcp-integration-example.d.ts +0 -6
  138. package/dist/memory/mcp-integration-example.js +0 -281
  139. package/dist/memory/memory-client.d.ts +0 -199
  140. package/dist/memory/memory-client.js +0 -364
  141. package/dist/memory/memory-manager.d.ts +0 -29
  142. package/dist/memory/memory-manager.js +0 -280
  143. package/dist/memory/memory-operations.d.ts +0 -179
  144. package/dist/memory/memory-operations.js +0 -691
  145. package/dist/memory/memory-system.d.ts +0 -153
  146. package/dist/memory/memory-system.js +0 -651
  147. package/dist/memory/memory-test.d.ts +0 -6
  148. package/dist/memory/memory-test.js +0 -161
  149. package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
  150. package/dist/memory/snow-flow-memory-patterns.js +0 -200
  151. package/dist/memory/snow-memory.d.ts +0 -54
  152. package/dist/memory/snow-memory.js +0 -301
  153. package/dist/memory/swarm-memory.d.ts +0 -135
  154. package/dist/memory/swarm-memory.js +0 -378
  155. package/dist/optimization/flow-performance-optimizer.js +0 -723
  156. package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
  157. package/dist/orchestration/discovery/service-discovery.js +0 -808
  158. package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
  159. package/dist/orchestration/distributed-orchestrator.js +0 -712
  160. package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
  161. package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
  162. package/dist/orchestration/flow-update-orchestrator.js +0 -648
  163. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
  164. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
  165. package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
  166. package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
  167. package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
  168. package/dist/orchestration/state/distributed-state-manager.js +0 -716
  169. package/dist/orchestrator/flow-composer.d.ts +0 -105
  170. package/dist/orchestrator/flow-composer.js +0 -404
  171. package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
  172. package/dist/orchestrator/flow-pattern-templates.js +0 -908
  173. package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
  174. package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
  175. package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
  176. package/dist/orchestrator/flow-validation-engine.js +0 -913
  177. package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
  178. package/dist/orchestrator/snow-orchestrator.js +0 -235
  179. package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
  180. package/dist/orchestrator/subflow-creation-handler.js +0 -791
  181. package/dist/patterns/adaptive-patterns.d.ts +0 -140
  182. package/dist/patterns/adaptive-patterns.js +0 -549
  183. package/dist/queen/advanced-integration-test.d.ts +0 -48
  184. package/dist/queen/advanced-integration-test.js +0 -473
  185. package/dist/queen/integration-example.d.ts +0 -82
  186. package/dist/queen/integration-example.js +0 -219
  187. package/dist/queen/integration-test.d.ts +0 -72
  188. package/dist/queen/integration-test.js +0 -563
  189. package/dist/queen/mock-mcp-client.d.ts +0 -71
  190. package/dist/queen/mock-mcp-client.js +0 -317
  191. package/dist/queen/run-integration-tests.d.ts +0 -9
  192. package/dist/queen/run-integration-tests.js +0 -27
  193. package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
  194. package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
  195. package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
  196. package/dist/sparc/coordinators/team-coordinator.js +0 -402
  197. package/dist/sparc/modes/team-modes.d.ts +0 -33
  198. package/dist/sparc/modes/team-modes.js +0 -399
  199. package/dist/sparc/teams/application-team.d.ts +0 -73
  200. package/dist/sparc/teams/application-team.js +0 -463
  201. package/dist/sparc/teams/flow-team.d.ts +0 -67
  202. package/dist/sparc/teams/flow-team.js +0 -373
  203. package/dist/sparc/teams/widget-team.d.ts +0 -61
  204. package/dist/sparc/teams/widget-team.js +0 -280
  205. package/dist/specialists/app-specialists.d.ts +0 -93
  206. package/dist/specialists/app-specialists.js +0 -1639
  207. package/dist/specialists/base-specialist.d.ts +0 -19
  208. package/dist/specialists/base-specialist.js +0 -54
  209. package/dist/specialists/flow-specialists.d.ts +0 -113
  210. package/dist/specialists/flow-specialists.js +0 -1787
  211. package/dist/specialists/individual-specialists.d.ts +0 -67
  212. package/dist/specialists/individual-specialists.js +0 -632
  213. package/dist/specialists/widget-specialists.d.ts +0 -70
  214. package/dist/specialists/widget-specialists.js +0 -1264
  215. package/dist/src/utils/agent-detector.js +0 -655
  216. package/dist/teams/adaptive-team.d.ts +0 -81
  217. package/dist/teams/adaptive-team.js +0 -1153
  218. package/dist/teams/application-team.d.ts +0 -30
  219. package/dist/teams/application-team.js +0 -547
  220. package/dist/teams/base-team.d.ts +0 -55
  221. package/dist/teams/base-team.js +0 -243
  222. package/dist/teams/flow-team.d.ts +0 -28
  223. package/dist/teams/flow-team.js +0 -525
  224. package/dist/teams/widget-team.d.ts +0 -26
  225. package/dist/teams/widget-team.js +0 -459
  226. package/dist/templates/flow-template-system.js +0 -625
  227. package/dist/test-fetch-incidents.d.ts +0 -2
  228. package/dist/test-fetch-incidents.js +0 -84
  229. package/dist/test-incident-access.d.ts +0 -2
  230. package/dist/test-incident-access.js +0 -72
  231. package/dist/test-iphone-flow.js +0 -189
  232. package/dist/test-limit-problem.d.ts +0 -2
  233. package/dist/test-limit-problem.js +0 -60
  234. package/dist/test-ml-batch-fix.d.ts +0 -2
  235. package/dist/test-ml-batch-fix.js +0 -104
  236. package/dist/test-ml-batch.d.ts +0 -2
  237. package/dist/test-ml-batch.js +0 -87
  238. package/dist/test-ml-query.d.ts +0 -2
  239. package/dist/test-ml-query.js +0 -100
  240. package/dist/test-ml-training-fix.d.ts +0 -12
  241. package/dist/test-ml-training-fix.js +0 -113
  242. package/dist/test-ml-training.d.ts +0 -2
  243. package/dist/test-ml-training.js +0 -32
  244. package/dist/test-operations-query.d.ts +0 -2
  245. package/dist/test-operations-query.js +0 -84
  246. package/dist/test-performance-query.d.ts +0 -2
  247. package/dist/test-performance-query.js +0 -52
  248. package/dist/test-singleton-protection.d.ts +0 -8
  249. package/dist/test-singleton-protection.js +0 -110
  250. package/dist/test-smart-limits.d.ts +0 -13
  251. package/dist/test-smart-limits.js +0 -100
  252. package/dist/test-snow-query-incidents.d.ts +0 -2
  253. package/dist/test-snow-query-incidents.js +0 -66
  254. package/dist/test-universal-query.d.ts +0 -2
  255. package/dist/test-universal-query.js +0 -106
  256. package/dist/testing/flow-testing-automation.js +0 -641
  257. package/dist/utils/complete-flow-xml-generator.js +0 -1285
  258. package/dist/utils/file-storage-fallback.d.ts +0 -62
  259. package/dist/utils/file-storage-fallback.js +0 -289
  260. package/dist/utils/flow-api-discovery.d.ts +0 -151
  261. package/dist/utils/flow-api-discovery.js +0 -439
  262. package/dist/utils/flow-examples.js +0 -720
  263. package/dist/utils/flow-structure-builder.js +0 -677
  264. package/dist/utils/flow-xml-generator.d.ts +0 -41
  265. package/dist/utils/flow-xml-generator.js +0 -258
  266. package/dist/utils/improved-flow-xml-generator.js +0 -820
  267. package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
  268. package/dist/utils/mcp-process-manager.backup.js +0 -220
  269. package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
  270. package/dist/utils/mcp-singleton-enforcer.js +0 -201
  271. package/dist/utils/mcp-timeout-fix.d.ts +0 -53
  272. package/dist/utils/mcp-timeout-fix.js +0 -221
  273. package/dist/utils/migrate-claude-flow.d.ts +0 -22
  274. package/dist/utils/migrate-claude-flow.js +0 -120
  275. package/dist/utils/scope-utils.d.ts +0 -72
  276. package/dist/utils/scope-utils.js +0 -386
  277. package/dist/utils/snow-oauth-old.d.ts +0 -65
  278. package/dist/utils/snow-oauth-old.js +0 -345
  279. package/dist/utils/xml-first-flow-generator.js +0 -513
  280. package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
  281. package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
  282. package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
  283. package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
  284. package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
  285. package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
  286. package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
  287. package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
  288. package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
  289. package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
  290. package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
  291. package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
  292. package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
  293. package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
  294. package/reports/swarm-auto-centralized-1752649029776.json +0 -13
  295. package/src/memory/README.md +0 -240
@@ -1,908 +0,0 @@
1
- "use strict";
2
- /**
3
- * ServiceNow Flow Pattern Templates
4
- *
5
- * This module provides a comprehensive collection of flow pattern templates
6
- * for common ServiceNow scenarios, helping users create consistent and
7
- * well-structured flows and subflows.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.FlowPatternTemplates = void 0;
11
- const logger_js_1 = require("../utils/logger.js");
12
- const flow_subflow_decision_engine_js_1 = require("./flow-subflow-decision-engine.js");
13
- /**
14
- * Flow Pattern Templates Manager
15
- */
16
- class FlowPatternTemplates {
17
- constructor() {
18
- this.templates = new Map();
19
- this.subflowTemplates = new Map();
20
- this.patterns = [];
21
- this.logger = new logger_js_1.Logger('FlowPatternTemplates');
22
- this.initializeTemplates();
23
- this.initializePatterns();
24
- }
25
- /**
26
- * Find matching templates based on natural language instruction
27
- */
28
- findMatchingTemplates(instruction) {
29
- this.logger.info('Finding matching templates', { instruction });
30
- const results = [];
31
- const lowerInstruction = instruction.toLowerCase();
32
- for (const [id, template] of this.templates) {
33
- const matchResult = this.matchTemplate(template, lowerInstruction, instruction);
34
- if (matchResult.confidence > 0.3) {
35
- results.push(matchResult);
36
- }
37
- }
38
- // Sort by confidence score
39
- results.sort((a, b) => b.confidence - a.confidence);
40
- this.logger.info('Found matching templates', { count: results.length });
41
- return results;
42
- }
43
- /**
44
- * Get template by ID
45
- */
46
- getTemplate(id) {
47
- return this.templates.get(id);
48
- }
49
- /**
50
- * Get all templates by category
51
- */
52
- getTemplatesByCategory(category) {
53
- return Array.from(this.templates.values()).filter(template => template.category === category);
54
- }
55
- /**
56
- * Get all templates by context
57
- */
58
- getTemplatesByContext(context) {
59
- return Array.from(this.templates.values()).filter(template => template.context === context);
60
- }
61
- /**
62
- * Get recommended templates for a specific complexity level
63
- */
64
- getTemplatesByComplexity(complexity) {
65
- return Array.from(this.templates.values()).filter(template => template.complexity === complexity);
66
- }
67
- /**
68
- * Get all available templates
69
- */
70
- getAllTemplates() {
71
- return Array.from(this.templates.values());
72
- }
73
- /**
74
- * Get subflow candidates from a template
75
- */
76
- getSubflowCandidates(template) {
77
- return template.activities.filter(activity => activity.isSubflowCandidate);
78
- }
79
- /**
80
- * Generate flow from template
81
- */
82
- generateFlowFromTemplate(template, customizations = {}) {
83
- this.logger.info('Generating flow from template', {
84
- templateId: template.id,
85
- customizations: Object.keys(customizations)
86
- });
87
- const flowDefinition = {
88
- name: customizations.name || template.name,
89
- description: customizations.description || template.description,
90
- category: template.category,
91
- type: 'flow', // Explicitly set as flow, not subflow
92
- flow_type: 'flow',
93
- active: true,
94
- // Apply trigger template
95
- trigger: this.applyTriggerTemplate(template.triggers[0], customizations),
96
- // Apply activity templates
97
- activities: template.activities.map(activityTemplate => this.applyActivityTemplate(activityTemplate, customizations)),
98
- // Apply connection templates
99
- connections: template.connections.map(connectionTemplate => this.applyConnectionTemplate(connectionTemplate, customizations)),
100
- // Apply variable templates
101
- variables: template.variables.map(variableTemplate => this.applyVariableTemplate(variableTemplate, customizations)),
102
- // Metadata
103
- metadata: {
104
- templateId: template.id,
105
- templateVersion: template.version,
106
- customizations: customizations,
107
- generatedAt: new Date().toISOString()
108
- }
109
- };
110
- return flowDefinition;
111
- }
112
- /**
113
- * Match template against instruction
114
- */
115
- matchTemplate(template, lowerInstruction, originalInstruction) {
116
- let confidence = 0;
117
- const matchingReasons = [];
118
- const customizationSuggestions = [];
119
- const subflowRecommendations = [];
120
- // Keywords matching
121
- const keywordMatches = template.tags.filter(tag => lowerInstruction.includes(tag.toLowerCase()));
122
- if (keywordMatches.length > 0) {
123
- confidence += 0.3 * (keywordMatches.length / template.tags.length);
124
- matchingReasons.push(`Keywords match: ${keywordMatches.join(', ')}`);
125
- }
126
- // Context matching
127
- const contextKeywords = this.getContextKeywords(template.context);
128
- const contextMatches = contextKeywords.filter(keyword => lowerInstruction.includes(keyword));
129
- if (contextMatches.length > 0) {
130
- confidence += 0.4;
131
- matchingReasons.push(`Context match: ${template.context}`);
132
- }
133
- // Use case matching
134
- const useCaseMatches = template.useCases.filter(useCase => lowerInstruction.includes(useCase.toLowerCase()));
135
- if (useCaseMatches.length > 0) {
136
- confidence += 0.2;
137
- matchingReasons.push(`Use case match: ${useCaseMatches.join(', ')}`);
138
- }
139
- // Activity type matching
140
- const activityMatches = template.activities.filter(activity => lowerInstruction.includes(activity.type.toLowerCase()) ||
141
- lowerInstruction.includes(activity.name.toLowerCase()));
142
- if (activityMatches.length > 0) {
143
- confidence += 0.1;
144
- matchingReasons.push(`Activity match: ${activityMatches.map(a => a.name).join(', ')}`);
145
- }
146
- // Generate customization suggestions
147
- if (confidence > 0.5) {
148
- customizationSuggestions.push(...this.generateCustomizationSuggestions(template, originalInstruction));
149
- }
150
- // Generate subflow recommendations
151
- const subflowCandidates = this.getSubflowCandidates(template);
152
- if (subflowCandidates.length > 0) {
153
- subflowRecommendations.push(...subflowCandidates.map(candidate => `Consider creating ${candidate.name} as a reusable subflow`));
154
- }
155
- return {
156
- template,
157
- confidence: Math.min(confidence, 1.0),
158
- matchingReasons,
159
- customizationSuggestions,
160
- subflowRecommendations
161
- };
162
- }
163
- /**
164
- * Get context keywords for matching
165
- */
166
- getContextKeywords(context) {
167
- const keywords = {
168
- [flow_subflow_decision_engine_js_1.FlowContext.APPROVAL_WORKFLOW]: ['approval', 'approve', 'reject', 'escalate'],
169
- [flow_subflow_decision_engine_js_1.FlowContext.FULFILLMENT_WORKFLOW]: ['fulfillment', 'order', 'catalog', 'request'],
170
- [flow_subflow_decision_engine_js_1.FlowContext.NOTIFICATION_WORKFLOW]: ['notification', 'email', 'alert', 'message'],
171
- [flow_subflow_decision_engine_js_1.FlowContext.INTEGRATION_WORKFLOW]: ['integration', 'api', 'external', 'sync'],
172
- [flow_subflow_decision_engine_js_1.FlowContext.UTILITY_WORKFLOW]: ['utility', 'helper', 'common', 'shared'],
173
- [flow_subflow_decision_engine_js_1.FlowContext.BUSINESS_LOGIC]: ['business', 'rule', 'policy', 'validation']
174
- };
175
- return keywords[context] || [];
176
- }
177
- /**
178
- * Generate customization suggestions
179
- */
180
- generateCustomizationSuggestions(template, instruction) {
181
- const suggestions = [];
182
- // Check for specific entities mentioned in instruction
183
- if (instruction.includes('iPhone')) {
184
- suggestions.push('Customize for iPhone-specific catalog items');
185
- }
186
- if (instruction.includes('admin')) {
187
- suggestions.push('Configure admin-specific assignment rules');
188
- }
189
- if (instruction.includes('manager')) {
190
- suggestions.push('Set up manager approval hierarchy');
191
- }
192
- // Check customization points
193
- for (const point of template.customizationPoints) {
194
- if (point.impact === 'high') {
195
- suggestions.push(`Configure ${point.name}: ${point.description}`);
196
- }
197
- }
198
- return suggestions;
199
- }
200
- /**
201
- * Apply trigger template
202
- */
203
- applyTriggerTemplate(triggerTemplate, customizations) {
204
- return {
205
- type: customizations.triggerType || triggerTemplate.type,
206
- table: customizations.table || triggerTemplate.table,
207
- condition: customizations.condition || triggerTemplate.condition,
208
- schedule: customizations.schedule || triggerTemplate.schedule,
209
- configuration: {
210
- ...triggerTemplate.configuration,
211
- ...customizations.triggerConfiguration
212
- }
213
- };
214
- }
215
- /**
216
- * Apply activity template
217
- */
218
- applyActivityTemplate(activityTemplate, customizations) {
219
- const activityCustomizations = customizations.activities?.[activityTemplate.id] || {};
220
- return {
221
- id: activityTemplate.id,
222
- name: activityCustomizations.name || activityTemplate.name,
223
- type: activityCustomizations.type || activityTemplate.type,
224
- label: activityCustomizations.label || activityTemplate.label,
225
- description: activityCustomizations.description || activityTemplate.description,
226
- inputs: activityTemplate.inputs.map(input => ({
227
- name: input.name,
228
- type: input.type,
229
- required: input.required,
230
- value: activityCustomizations.inputs?.[input.name] ||
231
- this.resolveInputValue(input, customizations)
232
- })),
233
- outputs: activityTemplate.outputs.map(output => ({
234
- name: output.name,
235
- type: output.type,
236
- description: output.description
237
- })),
238
- configuration: {
239
- ...activityTemplate.configuration,
240
- ...activityCustomizations.configuration
241
- },
242
- position: activityTemplate.position,
243
- errorHandling: activityTemplate.errorHandling
244
- };
245
- }
246
- /**
247
- * Apply connection template
248
- */
249
- applyConnectionTemplate(connectionTemplate, customizations) {
250
- const connectionCustomizations = customizations.connections?.[connectionTemplate.id] || {};
251
- return {
252
- id: connectionTemplate.id,
253
- from: connectionTemplate.from,
254
- to: connectionTemplate.to,
255
- label: connectionCustomizations.label || connectionTemplate.label,
256
- condition: connectionCustomizations.condition || connectionTemplate.condition,
257
- conditionType: connectionTemplate.conditionType
258
- };
259
- }
260
- /**
261
- * Apply variable template
262
- */
263
- applyVariableTemplate(variableTemplate, customizations) {
264
- const variableCustomizations = customizations.variables?.[variableTemplate.name] || {};
265
- return {
266
- name: variableTemplate.name,
267
- type: variableTemplate.type,
268
- description: variableTemplate.description,
269
- defaultValue: variableCustomizations.defaultValue || variableTemplate.defaultValue,
270
- scope: variableTemplate.scope,
271
- category: variableTemplate.category
272
- };
273
- }
274
- /**
275
- * Resolve input value based on source type
276
- */
277
- resolveInputValue(input, customizations) {
278
- switch (input.sourceType) {
279
- case 'trigger':
280
- return `\${trigger.${input.sourceReference || input.name}}`;
281
- case 'variable':
282
- return `\${flow.${input.sourceReference || input.name}}`;
283
- case 'previous_activity':
284
- return `\${${input.sourceReference}.${input.name}}`;
285
- case 'constant':
286
- return customizations.constants?.[input.name] || input.defaultValue;
287
- default:
288
- return input.defaultValue;
289
- }
290
- }
291
- /**
292
- * Initialize flow templates
293
- */
294
- initializeTemplates() {
295
- // iPhone 6 Approval and Fulfillment Template
296
- this.templates.set('iphone-approval-fulfillment', {
297
- id: 'iphone-approval-fulfillment',
298
- name: 'iPhone 6 Approval and Fulfillment',
299
- description: 'Complete workflow for iPhone 6 catalog requests with approval and fulfillment',
300
- category: 'Catalog Management',
301
- context: flow_subflow_decision_engine_js_1.FlowContext.FULFILLMENT_WORKFLOW,
302
- recommendedType: flow_subflow_decision_engine_js_1.FlowType.MAIN_FLOW,
303
- complexity: flow_subflow_decision_engine_js_1.ComplexityLevel.HIGH,
304
- reusability: flow_subflow_decision_engine_js_1.ReusabilityLevel.MEDIUM,
305
- triggers: [{
306
- id: 'catalog_request_trigger',
307
- type: 'record_created',
308
- table: 'sc_req_item',
309
- condition: 'cat_item.name=iPhone 6',
310
- description: 'Trigger when iPhone 6 catalog item is requested',
311
- configuration: {
312
- filter: 'cat_item.name=iPhone 6',
313
- active: true
314
- }
315
- }],
316
- activities: [
317
- {
318
- id: 'approval_check',
319
- name: 'Manager Approval',
320
- type: 'approval',
321
- label: 'Manager Approval',
322
- description: 'Get manager approval for iPhone 6 request',
323
- category: 'Approval',
324
- isSubflowCandidate: true,
325
- reusabilityScore: 8,
326
- inputs: [
327
- {
328
- name: 'record',
329
- type: 'reference',
330
- required: true,
331
- description: 'Catalog request record',
332
- sourceType: 'trigger',
333
- sourceReference: 'current'
334
- },
335
- {
336
- name: 'approver',
337
- type: 'reference',
338
- required: true,
339
- description: 'Manager to approve request',
340
- sourceType: 'trigger',
341
- sourceReference: 'current.requested_for.manager'
342
- }
343
- ],
344
- outputs: [
345
- {
346
- name: 'approval_state',
347
- type: 'string',
348
- description: 'Approval result (approved/rejected)',
349
- usedByActivities: ['fulfillment_check'],
350
- isFlowOutput: false
351
- }
352
- ],
353
- configuration: {
354
- approval_type: 'manager',
355
- timeout: '48 hours'
356
- },
357
- errorHandling: [{
358
- condition: 'timeout',
359
- action: 'notify',
360
- parameters: { escalation_group: 'catalog_admins' },
361
- description: 'Notify admins on approval timeout'
362
- }],
363
- position: { x: 200, y: 100 },
364
- dependencies: [],
365
- prerequisites: []
366
- },
367
- {
368
- id: 'fulfillment_check',
369
- name: 'Fulfillment Decision',
370
- type: 'condition',
371
- label: 'Check Approval',
372
- description: 'Check if request was approved',
373
- category: 'Decision',
374
- isSubflowCandidate: false,
375
- reusabilityScore: 3,
376
- inputs: [
377
- {
378
- name: 'approval_state',
379
- type: 'string',
380
- required: true,
381
- description: 'Approval state from previous step',
382
- sourceType: 'previous_activity',
383
- sourceReference: 'approval_check'
384
- }
385
- ],
386
- outputs: [
387
- {
388
- name: 'proceed_to_fulfillment',
389
- type: 'boolean',
390
- description: 'Whether to proceed with fulfillment',
391
- usedByActivities: ['admin_task', 'user_task'],
392
- isFlowOutput: false
393
- }
394
- ],
395
- configuration: {
396
- condition: 'approval_state=approved'
397
- },
398
- errorHandling: [],
399
- position: { x: 400, y: 100 },
400
- dependencies: ['approval_check'],
401
- prerequisites: []
402
- },
403
- {
404
- id: 'admin_task',
405
- name: 'Create Admin Task',
406
- type: 'create_task',
407
- label: 'Admin Preparation',
408
- description: 'Create task for admin to prepare iPhone 6',
409
- category: 'Task Management',
410
- isSubflowCandidate: true,
411
- reusabilityScore: 7,
412
- inputs: [
413
- {
414
- name: 'parent_record',
415
- type: 'reference',
416
- required: true,
417
- description: 'Parent catalog request',
418
- sourceType: 'trigger',
419
- sourceReference: 'current'
420
- },
421
- {
422
- name: 'assigned_to',
423
- type: 'reference',
424
- required: true,
425
- description: 'Admin to assign task to',
426
- sourceType: 'constant',
427
- defaultValue: 'admin_group'
428
- }
429
- ],
430
- outputs: [
431
- {
432
- name: 'admin_task_id',
433
- type: 'string',
434
- description: 'Created admin task ID',
435
- usedByActivities: ['user_task'],
436
- isFlowOutput: false
437
- }
438
- ],
439
- configuration: {
440
- task_type: 'admin_pickup',
441
- priority: 'medium',
442
- short_description: 'Prepare iPhone 6 for user pickup'
443
- },
444
- errorHandling: [{
445
- condition: 'creation_failed',
446
- action: 'retry',
447
- parameters: { max_retries: 3 },
448
- description: 'Retry task creation on failure'
449
- }],
450
- position: { x: 600, y: 50 },
451
- dependencies: ['fulfillment_check'],
452
- prerequisites: ['approval_check']
453
- },
454
- {
455
- id: 'user_task',
456
- name: 'Create User Task',
457
- type: 'create_task',
458
- label: 'User Pickup',
459
- description: 'Create task for user to pick up iPhone 6',
460
- category: 'Task Management',
461
- isSubflowCandidate: true,
462
- reusabilityScore: 6,
463
- inputs: [
464
- {
465
- name: 'parent_record',
466
- type: 'reference',
467
- required: true,
468
- description: 'Parent catalog request',
469
- sourceType: 'trigger',
470
- sourceReference: 'current'
471
- },
472
- {
473
- name: 'assigned_to',
474
- type: 'reference',
475
- required: true,
476
- description: 'User to assign task to',
477
- sourceType: 'trigger',
478
- sourceReference: 'current.requested_for'
479
- }
480
- ],
481
- outputs: [
482
- {
483
- name: 'user_task_id',
484
- type: 'string',
485
- description: 'Created user task ID',
486
- usedByActivities: ['notification'],
487
- isFlowOutput: false
488
- }
489
- ],
490
- configuration: {
491
- task_type: 'user_pickup',
492
- priority: 'medium',
493
- short_description: 'Pick up your iPhone 6 from admin desk'
494
- },
495
- errorHandling: [{
496
- condition: 'creation_failed',
497
- action: 'retry',
498
- parameters: { max_retries: 3 },
499
- description: 'Retry task creation on failure'
500
- }],
501
- position: { x: 600, y: 150 },
502
- dependencies: ['fulfillment_check'],
503
- prerequisites: ['approval_check']
504
- },
505
- {
506
- id: 'notification',
507
- name: 'Send Notification',
508
- type: 'notification',
509
- label: 'Notify User',
510
- description: 'Send notification to user about iPhone 6 availability',
511
- category: 'Communication',
512
- isSubflowCandidate: true,
513
- reusabilityScore: 9,
514
- inputs: [
515
- {
516
- name: 'recipient',
517
- type: 'reference',
518
- required: true,
519
- description: 'User to notify',
520
- sourceType: 'trigger',
521
- sourceReference: 'current.requested_for'
522
- },
523
- {
524
- name: 'message',
525
- type: 'string',
526
- required: true,
527
- description: 'Notification message',
528
- sourceType: 'constant',
529
- defaultValue: 'Your iPhone 6 is ready for pickup at the admin desk'
530
- }
531
- ],
532
- outputs: [
533
- {
534
- name: 'notification_sent',
535
- type: 'boolean',
536
- description: 'Whether notification was sent successfully',
537
- usedByActivities: [],
538
- isFlowOutput: true
539
- }
540
- ],
541
- configuration: {
542
- notification_type: 'email',
543
- template: 'catalog_item_ready'
544
- },
545
- errorHandling: [{
546
- condition: 'send_failed',
547
- action: 'retry',
548
- parameters: { max_retries: 2 },
549
- description: 'Retry notification sending on failure'
550
- }],
551
- position: { x: 800, y: 100 },
552
- dependencies: ['admin_task', 'user_task'],
553
- prerequisites: ['fulfillment_check']
554
- }
555
- ],
556
- connections: [
557
- {
558
- id: 'trigger_to_approval',
559
- from: 'trigger',
560
- to: 'approval_check',
561
- label: 'Start Approval',
562
- condition: '',
563
- conditionType: 'always',
564
- description: 'Start approval process'
565
- },
566
- {
567
- id: 'approval_to_decision',
568
- from: 'approval_check',
569
- to: 'fulfillment_check',
570
- label: 'Check Result',
571
- condition: '',
572
- conditionType: 'always',
573
- description: 'Check approval result'
574
- },
575
- {
576
- id: 'decision_to_admin',
577
- from: 'fulfillment_check',
578
- to: 'admin_task',
579
- label: 'Approved',
580
- condition: 'approval_state=approved',
581
- conditionType: 'conditional',
582
- description: 'Proceed if approved'
583
- },
584
- {
585
- id: 'decision_to_user',
586
- from: 'fulfillment_check',
587
- to: 'user_task',
588
- label: 'Approved',
589
- condition: 'approval_state=approved',
590
- conditionType: 'conditional',
591
- description: 'Proceed if approved'
592
- },
593
- {
594
- id: 'admin_to_notification',
595
- from: 'admin_task',
596
- to: 'notification',
597
- label: 'Task Created',
598
- condition: '',
599
- conditionType: 'success',
600
- description: 'Notify after admin task creation'
601
- },
602
- {
603
- id: 'user_to_notification',
604
- from: 'user_task',
605
- to: 'notification',
606
- label: 'Task Created',
607
- condition: '',
608
- conditionType: 'success',
609
- description: 'Notify after user task creation'
610
- }
611
- ],
612
- variables: [
613
- {
614
- name: 'catalog_item',
615
- type: 'reference',
616
- description: 'iPhone 6 catalog item reference',
617
- defaultValue: null,
618
- scope: 'flow',
619
- category: 'Data'
620
- },
621
- {
622
- name: 'approval_timeout',
623
- type: 'integer',
624
- description: 'Approval timeout in hours',
625
- defaultValue: 48,
626
- scope: 'flow',
627
- category: 'Configuration'
628
- }
629
- ],
630
- tags: ['iphone', 'catalog', 'approval', 'fulfillment', 'task', 'notification'],
631
- version: '1.0.0',
632
- author: 'ServiceNow Multi-Agent System',
633
- documentation: 'Complete workflow for iPhone 6 catalog requests with approval and fulfillment tasks',
634
- useCases: [
635
- 'iPhone 6 catalog item requests',
636
- 'Hardware catalog fulfillment',
637
- 'Manager approval workflows',
638
- 'User pickup coordination'
639
- ],
640
- prerequisites: [
641
- 'iPhone 6 catalog item configured',
642
- 'Manager hierarchy defined',
643
- 'Admin group configured',
644
- 'Notification templates available'
645
- ],
646
- bestPractices: [
647
- 'Set appropriate approval timeouts',
648
- 'Configure escalation for timeouts',
649
- 'Use descriptive task names',
650
- 'Test notification delivery'
651
- ],
652
- customizationPoints: [
653
- {
654
- id: 'approval_hierarchy',
655
- name: 'Approval Hierarchy',
656
- description: 'Configure approval hierarchy and rules',
657
- type: 'configuration',
658
- location: 'approval_check',
659
- options: [
660
- {
661
- value: 'manager',
662
- label: 'Manager Only',
663
- description: 'Require only manager approval',
664
- implications: ['Faster approval process']
665
- },
666
- {
667
- value: 'manager_and_admin',
668
- label: 'Manager and Admin',
669
- description: 'Require both manager and admin approval',
670
- implications: ['Longer approval process', 'Higher security']
671
- }
672
- ],
673
- impact: 'high'
674
- },
675
- {
676
- id: 'notification_channels',
677
- name: 'Notification Channels',
678
- description: 'Configure notification delivery methods',
679
- type: 'activity',
680
- location: 'notification',
681
- options: [
682
- {
683
- value: 'email',
684
- label: 'Email Only',
685
- description: 'Send notifications via email',
686
- implications: ['Standard delivery']
687
- },
688
- {
689
- value: 'email_and_sms',
690
- label: 'Email and SMS',
691
- description: 'Send notifications via email and SMS',
692
- implications: ['Faster delivery', 'Higher visibility']
693
- }
694
- ],
695
- impact: 'medium'
696
- }
697
- ],
698
- variations: [
699
- {
700
- id: 'no_approval',
701
- name: 'No Approval Required',
702
- description: 'Skip approval process for low-cost items',
703
- differences: ['Remove approval_check activity', 'Connect trigger directly to fulfillment'],
704
- applicableScenarios: ['Low-cost items', 'Auto-approved requests'],
705
- complexityChange: 'decrease'
706
- },
707
- {
708
- id: 'multi_level_approval',
709
- name: 'Multi-Level Approval',
710
- description: 'Add additional approval levels',
711
- differences: ['Add senior manager approval', 'Add budget approval'],
712
- applicableScenarios: ['High-cost items', 'Executive requests'],
713
- complexityChange: 'increase'
714
- }
715
- ]
716
- });
717
- // Simple Notification Template
718
- this.templates.set('simple-notification', {
719
- id: 'simple-notification',
720
- name: 'Simple Notification',
721
- description: 'Basic notification workflow for sending alerts',
722
- category: 'Communication',
723
- context: flow_subflow_decision_engine_js_1.FlowContext.NOTIFICATION_WORKFLOW,
724
- recommendedType: flow_subflow_decision_engine_js_1.FlowType.SUBFLOW,
725
- complexity: flow_subflow_decision_engine_js_1.ComplexityLevel.LOW,
726
- reusability: flow_subflow_decision_engine_js_1.ReusabilityLevel.HIGH,
727
- triggers: [{
728
- id: 'notification_trigger',
729
- type: 'manual',
730
- table: 'any',
731
- description: 'Manual trigger for notification',
732
- configuration: {
733
- manual_execution: true
734
- }
735
- }],
736
- activities: [
737
- {
738
- id: 'send_notification',
739
- name: 'Send Notification',
740
- type: 'notification',
741
- label: 'Send Alert',
742
- description: 'Send notification to specified recipients',
743
- category: 'Communication',
744
- isSubflowCandidate: false,
745
- reusabilityScore: 10,
746
- inputs: [
747
- {
748
- name: 'recipients',
749
- type: 'string',
750
- required: true,
751
- description: 'Comma-separated list of recipients',
752
- sourceType: 'trigger'
753
- },
754
- {
755
- name: 'subject',
756
- type: 'string',
757
- required: true,
758
- description: 'Email subject line',
759
- sourceType: 'trigger'
760
- },
761
- {
762
- name: 'message',
763
- type: 'string',
764
- required: true,
765
- description: 'Notification message',
766
- sourceType: 'trigger'
767
- }
768
- ],
769
- outputs: [
770
- {
771
- name: 'sent_successfully',
772
- type: 'boolean',
773
- description: 'Whether notification was sent',
774
- usedByActivities: [],
775
- isFlowOutput: true
776
- }
777
- ],
778
- configuration: {
779
- notification_type: 'email'
780
- },
781
- errorHandling: [{
782
- condition: 'send_failed',
783
- action: 'retry',
784
- parameters: { max_retries: 3 },
785
- description: 'Retry sending on failure'
786
- }],
787
- position: { x: 200, y: 100 },
788
- dependencies: [],
789
- prerequisites: []
790
- }
791
- ],
792
- connections: [
793
- {
794
- id: 'trigger_to_send',
795
- from: 'trigger',
796
- to: 'send_notification',
797
- label: 'Send',
798
- condition: '',
799
- conditionType: 'always',
800
- description: 'Send notification'
801
- }
802
- ],
803
- variables: [
804
- {
805
- name: 'delivery_method',
806
- type: 'string',
807
- description: 'Notification delivery method',
808
- defaultValue: 'email',
809
- scope: 'flow',
810
- category: 'Configuration'
811
- }
812
- ],
813
- tags: ['notification', 'email', 'alert', 'communication', 'simple'],
814
- version: '1.0.0',
815
- author: 'ServiceNow Multi-Agent System',
816
- documentation: 'Simple notification workflow for sending alerts via email',
817
- useCases: [
818
- 'Basic email notifications',
819
- 'Alert sending',
820
- 'Status updates',
821
- 'Simple communications'
822
- ],
823
- prerequisites: [
824
- 'Email configuration',
825
- 'Notification templates'
826
- ],
827
- bestPractices: [
828
- 'Use clear subject lines',
829
- 'Keep messages concise',
830
- 'Test delivery before production'
831
- ],
832
- customizationPoints: [
833
- {
834
- id: 'delivery_channels',
835
- name: 'Delivery Channels',
836
- description: 'Configure notification delivery channels',
837
- type: 'configuration',
838
- location: 'send_notification',
839
- options: [
840
- {
841
- value: 'email',
842
- label: 'Email',
843
- description: 'Send via email',
844
- implications: ['Standard delivery']
845
- },
846
- {
847
- value: 'sms',
848
- label: 'SMS',
849
- description: 'Send via SMS',
850
- implications: ['Faster delivery']
851
- }
852
- ],
853
- impact: 'medium'
854
- }
855
- ],
856
- variations: [
857
- {
858
- id: 'rich_notification',
859
- name: 'Rich Notification',
860
- description: 'Add HTML formatting and attachments',
861
- differences: ['Add HTML formatting', 'Add attachment support'],
862
- applicableScenarios: ['Rich content', 'Reports', 'Branded communications'],
863
- complexityChange: 'increase'
864
- }
865
- ]
866
- });
867
- // Additional templates would be added here...
868
- }
869
- /**
870
- * Initialize flow patterns
871
- */
872
- initializePatterns() {
873
- this.patterns = [
874
- {
875
- name: 'Approval Pattern',
876
- description: 'Standard approval workflow with escalation',
877
- context: flow_subflow_decision_engine_js_1.FlowContext.APPROVAL_WORKFLOW,
878
- recommendedType: flow_subflow_decision_engine_js_1.FlowType.SUBFLOW,
879
- commonActions: ['approve', 'reject', 'escalate'],
880
- inputPatterns: ['record', 'approver', 'timeout'],
881
- outputPatterns: ['approval_state', 'approved_by'],
882
- complexity: flow_subflow_decision_engine_js_1.ComplexityLevel.MEDIUM
883
- },
884
- {
885
- name: 'Fulfillment Pattern',
886
- description: 'Complete fulfillment workflow with tasks',
887
- context: flow_subflow_decision_engine_js_1.FlowContext.FULFILLMENT_WORKFLOW,
888
- recommendedType: flow_subflow_decision_engine_js_1.FlowType.MAIN_FLOW,
889
- commonActions: ['validate', 'create_task', 'notify'],
890
- inputPatterns: ['catalog_item', 'requestor', 'approver'],
891
- outputPatterns: ['fulfillment_status', 'task_ids'],
892
- complexity: flow_subflow_decision_engine_js_1.ComplexityLevel.HIGH
893
- },
894
- {
895
- name: 'Notification Pattern',
896
- description: 'Multi-channel notification system',
897
- context: flow_subflow_decision_engine_js_1.FlowContext.NOTIFICATION_WORKFLOW,
898
- recommendedType: flow_subflow_decision_engine_js_1.FlowType.SUBFLOW,
899
- commonActions: ['format_message', 'send_notification'],
900
- inputPatterns: ['recipients', 'message', 'channel'],
901
- outputPatterns: ['sent_successfully', 'delivery_status'],
902
- complexity: flow_subflow_decision_engine_js_1.ComplexityLevel.LOW
903
- }
904
- ];
905
- }
906
- }
907
- exports.FlowPatternTemplates = FlowPatternTemplates;
908
- //# sourceMappingURL=flow-pattern-templates.js.map