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,1033 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WidgetUIUXAgent = void 0;
4
- /**
5
- * Widget UI/UX Agent - UI/UX Design Specialist
6
- * Focuses on user experience design, accessibility, and design system compliance
7
- */
8
- const base_team_1 = require("../base-team");
9
- class WidgetUIUXAgent extends base_team_1.BaseSnowAgent {
10
- constructor(config) {
11
- const capabilities = [
12
- {
13
- name: 'ux_design',
14
- description: 'Design optimal user experiences and workflows',
15
- proficiency: 0.95,
16
- tools: ['user_research', 'wireframing', 'prototyping', 'user_journey_mapping']
17
- },
18
- {
19
- name: 'accessibility_design',
20
- description: 'Ensure compliance with accessibility standards',
21
- proficiency: 0.9,
22
- tools: ['wcag_guidelines', 'screen_reader_testing', 'keyboard_navigation']
23
- },
24
- {
25
- name: 'design_systems',
26
- description: 'Apply and maintain design system consistency',
27
- proficiency: 0.88,
28
- tools: ['servicenow_design_system', 'component_libraries', 'style_guides']
29
- },
30
- {
31
- name: 'visual_design',
32
- description: 'Create visually appealing and functional interfaces',
33
- proficiency: 0.85,
34
- tools: ['color_theory', 'typography', 'layout_design', 'iconography']
35
- },
36
- {
37
- name: 'usability_testing',
38
- description: 'Test and validate user interface designs',
39
- proficiency: 0.8,
40
- tools: ['usability_testing', 'heuristic_evaluation', 'accessibility_testing']
41
- }
42
- ];
43
- const specialization = {
44
- primary: ['ux_design', 'accessibility', 'design_systems'],
45
- secondary: ['visual_design', 'usability_testing', 'interaction_design'],
46
- tools: ['ServiceNow Design System', 'WCAG Guidelines', 'Figma', 'Accessibility Tools'],
47
- experience: 0.88
48
- };
49
- super('widget-uiux-001', 'Widget UI/UX Specialist', 'uiux_designer', capabilities, specialization, config);
50
- }
51
- /**
52
- * Analyze design requirements and create UX strategy
53
- */
54
- async analyzeRequirements(requirements) {
55
- try {
56
- this.setStatus('busy');
57
- console.log('UI/UX Agent: Analyzing design requirements...');
58
- const analysis = {
59
- userExperienceStrategy: this.analyzeUserExperience(requirements),
60
- accessibilityStrategy: this.analyzeAccessibilityNeeds(requirements),
61
- designSystemAlignment: this.analyzeDesignSystemNeeds(requirements),
62
- interactionDesign: this.analyzeInteractionNeeds(requirements),
63
- usabilityConsiderations: this.analyzeUsabilityFactors(requirements)
64
- };
65
- console.log('UI/UX Agent: Design analysis complete');
66
- return analysis;
67
- }
68
- catch (error) {
69
- console.error('UI/UX Agent: Error analyzing requirements:', error);
70
- throw error;
71
- }
72
- finally {
73
- this.setStatus('available');
74
- }
75
- }
76
- /**
77
- * Execute UI/UX design tasks
78
- */
79
- async execute(requirements) {
80
- try {
81
- this.setStatus('busy');
82
- console.log('UI/UX Agent: Starting UI/UX design process...');
83
- // Create design system specification
84
- const designSpec = await this.createDesignSystem(requirements);
85
- // Create user experience guidelines
86
- const uxGuidelines = await this.createUXGuidelines(requirements);
87
- // Create accessibility specifications
88
- const accessibilitySpec = await this.createAccessibilitySpec(requirements);
89
- // Create interaction patterns
90
- const interactionPatterns = await this.createInteractionPatterns(requirements);
91
- // Create visual design guidelines
92
- const visualGuidelines = await this.createVisualGuidelines(requirements);
93
- // Validate design against usability heuristics
94
- const usabilityValidation = await this.validateUsability({
95
- designSpec,
96
- uxGuidelines,
97
- accessibilitySpec,
98
- requirements
99
- });
100
- console.log('UI/UX Agent: Design process completed');
101
- return {
102
- success: true,
103
- artifact: {
104
- designSpec,
105
- uxGuidelines,
106
- accessibilitySpec,
107
- interactionPatterns,
108
- visualGuidelines,
109
- usabilityValidation
110
- },
111
- metadata: {
112
- duration: 0,
113
- performance: {
114
- design_consistency: this.assessDesignConsistency(designSpec),
115
- accessibility_compliance: this.assessAccessibilityCompliance(accessibilitySpec),
116
- user_experience_score: this.assessUserExperience(uxGuidelines)
117
- },
118
- quality: {
119
- usability_score: usabilityValidation.overallScore,
120
- accessibility_score: usabilityValidation.accessibilityScore,
121
- design_system_adherence: usabilityValidation.designSystemScore
122
- }
123
- }
124
- };
125
- }
126
- catch (error) {
127
- console.error('UI/UX Agent: Error in design process:', error);
128
- return this.handleError(error);
129
- }
130
- finally {
131
- this.setStatus('available');
132
- }
133
- }
134
- /**
135
- * Create comprehensive design system specification
136
- */
137
- async createDesignSystem(requirements) {
138
- console.log('UI/UX Agent: Creating design system specification...');
139
- const designSpec = {
140
- colorScheme: this.createColorScheme(requirements),
141
- typography: this.createTypographySystem(requirements),
142
- layout: this.createLayoutSystem(requirements),
143
- interactions: this.createInteractionSystem(requirements),
144
- accessibility: this.createAccessibilityGuidelines(requirements)
145
- };
146
- return designSpec;
147
- }
148
- /**
149
- * Create user experience guidelines
150
- */
151
- async createUXGuidelines(requirements) {
152
- console.log('UI/UX Agent: Creating UX guidelines...');
153
- return {
154
- userFlows: this.createUserFlows(requirements),
155
- informationArchitecture: this.createInformationArchitecture(requirements),
156
- contentStrategy: this.createContentStrategy(requirements),
157
- errorHandling: this.createErrorHandlingUX(requirements),
158
- feedbackSystems: this.createFeedbackSystems(requirements),
159
- performanceUX: this.createPerformanceUXGuidelines(requirements)
160
- };
161
- }
162
- /**
163
- * Create accessibility specification
164
- */
165
- async createAccessibilitySpec(requirements) {
166
- console.log('UI/UX Agent: Creating accessibility specification...');
167
- const wcagLevel = requirements.accessibility.wcag || 'AA';
168
- return {
169
- wcagCompliance: {
170
- level: wcagLevel,
171
- guidelines: this.getWCAGGuidelines(wcagLevel),
172
- testingCriteria: this.getAccessibilityTestingCriteria(wcagLevel)
173
- },
174
- keyboardNavigation: {
175
- tabOrder: this.defineTabOrder(requirements),
176
- shortcuts: this.defineKeyboardShortcuts(requirements),
177
- focusManagement: this.defineFocusManagement(requirements)
178
- },
179
- screenReaderSupport: {
180
- ariaLabels: this.defineAriaLabels(requirements),
181
- landmarks: this.defineLandmarks(requirements),
182
- announcements: this.defineScreenReaderAnnouncements(requirements)
183
- },
184
- visualAccessibility: {
185
- colorContrast: this.defineColorContrast(requirements),
186
- textScaling: this.defineTextScaling(requirements),
187
- motionPreferences: this.defineMotionPreferences(requirements)
188
- },
189
- cognitiveAccessibility: {
190
- errorPrevention: this.defineErrorPrevention(requirements),
191
- helpSystems: this.defineHelpSystems(requirements),
192
- timeouts: this.defineTimeoutHandling(requirements)
193
- }
194
- };
195
- }
196
- /**
197
- * Create interaction patterns
198
- */
199
- async createInteractionPatterns(requirements) {
200
- console.log('UI/UX Agent: Creating interaction patterns...');
201
- return {
202
- gestureInteractions: this.defineGestureInteractions(requirements),
203
- mouseInteractions: this.defineMouseInteractions(requirements),
204
- touchInteractions: this.defineTouchInteractions(requirements),
205
- voiceInteractions: this.defineVoiceInteractions(requirements),
206
- stateTransitions: this.defineStateTransitions(requirements),
207
- animations: this.defineAnimations(requirements),
208
- microInteractions: this.defineMicroInteractions(requirements)
209
- };
210
- }
211
- /**
212
- * Create visual design guidelines
213
- */
214
- async createVisualGuidelines(requirements) {
215
- console.log('UI/UX Agent: Creating visual guidelines...');
216
- return {
217
- brandAlignment: this.createBrandAlignment(requirements),
218
- iconography: this.createIconographySystem(requirements),
219
- imagery: this.createImageryGuidelines(requirements),
220
- spacing: this.createSpacingSystem(requirements),
221
- elevation: this.createElevationSystem(requirements),
222
- responsiveDesign: this.createResponsiveGuidelines(requirements)
223
- };
224
- }
225
- // Design system creation methods
226
- createColorScheme(requirements) {
227
- const pattern = requirements.uiPattern;
228
- const baseColors = {
229
- primary: {
230
- 50: '#e3f2fd',
231
- 100: '#bbdefb',
232
- 500: '#2196f3',
233
- 700: '#1976d2',
234
- 900: '#0d47a1'
235
- },
236
- secondary: {
237
- 50: '#f3e5f5',
238
- 100: '#e1bee7',
239
- 500: '#9c27b0',
240
- 700: '#7b1fa2',
241
- 900: '#4a148c'
242
- },
243
- neutral: {
244
- 50: '#fafafa',
245
- 100: '#f5f5f5',
246
- 200: '#eeeeee',
247
- 300: '#e0e0e0',
248
- 500: '#9e9e9e',
249
- 700: '#616161',
250
- 900: '#212121'
251
- },
252
- semantic: {
253
- success: '#4caf50',
254
- warning: '#ff9800',
255
- error: '#f44336',
256
- info: '#2196f3'
257
- }
258
- };
259
- // Adjust colors based on UI pattern
260
- switch (pattern) {
261
- case 'card_grid':
262
- baseColors.primary[500] = '#1565c0';
263
- break;
264
- case 'data_table':
265
- baseColors.neutral[50] = '#f8f9fa';
266
- break;
267
- case 'visualization':
268
- baseColors.primary[500] = '#6366f1';
269
- break;
270
- }
271
- return baseColors;
272
- }
273
- createTypographySystem(requirements) {
274
- return {
275
- fontFamily: {
276
- primary: "'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
277
- secondary: "'Roboto Mono', 'Courier New', monospace"
278
- },
279
- fontSizes: {
280
- xs: '0.75rem',
281
- sm: '0.875rem',
282
- base: '1rem',
283
- lg: '1.125rem',
284
- xl: '1.25rem',
285
- '2xl': '1.5rem',
286
- '3xl': '1.875rem',
287
- '4xl': '2.25rem'
288
- },
289
- fontWeights: {
290
- normal: 400,
291
- medium: 500,
292
- semibold: 600,
293
- bold: 700
294
- },
295
- lineHeights: {
296
- tight: 1.25,
297
- normal: 1.5,
298
- relaxed: 1.75
299
- },
300
- letterSpacing: {
301
- tight: '-0.025em',
302
- normal: '0',
303
- wide: '0.025em'
304
- }
305
- };
306
- }
307
- createLayoutSystem(requirements) {
308
- const pattern = requirements.uiPattern;
309
- const layouts = {
310
- card_grid: {
311
- container: 'grid',
312
- columns: 'repeat(auto-fill, minmax(280px, 1fr))',
313
- gap: '1.5rem',
314
- padding: '1rem'
315
- },
316
- form_layout: {
317
- container: 'flex',
318
- direction: 'column',
319
- gap: '1rem',
320
- maxWidth: '600px'
321
- },
322
- data_table: {
323
- container: 'block',
324
- overflow: 'auto',
325
- width: '100%'
326
- },
327
- visualization: {
328
- container: 'flex',
329
- direction: 'column',
330
- alignItems: 'center',
331
- justifyContent: 'center'
332
- },
333
- flexible_layout: {
334
- container: 'flex',
335
- direction: 'column',
336
- gap: '1rem'
337
- }
338
- };
339
- return layouts[pattern] || layouts.flexible_layout;
340
- }
341
- createInteractionSystem(requirements) {
342
- return {
343
- hoverStates: {
344
- backgroundColor: 'rgba(0, 0, 0, 0.04)',
345
- transform: 'translateY(-1px)',
346
- boxShadow: '0 4px 8px rgba(0, 0, 0, 0.12)',
347
- transition: 'all 0.2s ease'
348
- },
349
- focusStates: {
350
- outline: '2px solid #2196f3',
351
- outlineOffset: '2px',
352
- borderRadius: '4px'
353
- },
354
- activeStates: {
355
- transform: 'translateY(1px)',
356
- boxShadow: '0 2px 4px rgba(0, 0, 0, 0.12)'
357
- },
358
- transitions: {
359
- default: 'all 0.2s ease',
360
- fast: 'all 0.1s ease',
361
- slow: 'all 0.3s ease'
362
- }
363
- };
364
- }
365
- createAccessibilityGuidelines(requirements) {
366
- return {
367
- colorContrast: {
368
- normal: '4.5:1',
369
- large: '3:1',
370
- nonText: '3:1'
371
- },
372
- focusIndicators: {
373
- width: '2px',
374
- style: 'solid',
375
- color: '#2196f3',
376
- offset: '2px'
377
- },
378
- textSizing: {
379
- minimum: '16px',
380
- lineHeight: '1.5',
381
- maxWidth: '80ch'
382
- },
383
- touchTargets: {
384
- minimum: '44px',
385
- recommended: '48px',
386
- spacing: '8px'
387
- }
388
- };
389
- }
390
- // UX Guidelines creation methods
391
- createUserFlows(requirements) {
392
- return {
393
- primaryFlows: requirements.userExperience.workflow.map(flow => ({
394
- name: flow,
395
- steps: this.generateFlowSteps(flow),
396
- decisionPoints: this.generateDecisionPoints(flow),
397
- errorPaths: this.generateErrorPaths(flow)
398
- })),
399
- secondaryFlows: this.generateSecondaryFlows(requirements),
400
- edgeCases: this.generateEdgeCaseFlows(requirements)
401
- };
402
- }
403
- createInformationArchitecture(requirements) {
404
- return {
405
- hierarchy: this.createContentHierarchy(requirements),
406
- navigation: this.createNavigationStructure(requirements),
407
- categorization: this.createCategorization(requirements),
408
- searchability: this.createSearchStrategy(requirements)
409
- };
410
- }
411
- createContentStrategy(requirements) {
412
- return {
413
- messaging: {
414
- primary: 'Clear, concise, and action-oriented',
415
- secondary: 'Helpful and contextual',
416
- error: 'Specific and solution-focused'
417
- },
418
- tone: {
419
- voice: 'Professional yet approachable',
420
- personality: 'Helpful and reliable',
421
- formality: 'Semi-formal'
422
- },
423
- microcopy: this.generateMicrocopy(requirements),
424
- helpContent: this.generateHelpContent(requirements)
425
- };
426
- }
427
- createErrorHandlingUX(requirements) {
428
- return {
429
- prevention: {
430
- validation: 'Real-time with clear indicators',
431
- constraints: 'Progressive disclosure of requirements',
432
- confirmation: 'For destructive actions'
433
- },
434
- recovery: {
435
- errorMessages: 'Specific, actionable, and polite',
436
- helpOptions: 'Context-sensitive assistance',
437
- fallbacks: 'Graceful degradation options'
438
- },
439
- feedback: {
440
- loading: 'Clear progress indicators',
441
- success: 'Confirmation with next steps',
442
- failure: 'Clear explanation and recovery options'
443
- }
444
- };
445
- }
446
- createFeedbackSystems(requirements) {
447
- return requirements.userExperience.feedback.map(feedback => ({
448
- type: feedback,
449
- implementation: this.getFeedbackImplementation(feedback),
450
- timing: this.getFeedbackTiming(feedback),
451
- accessibility: this.getFeedbackAccessibility(feedback)
452
- }));
453
- }
454
- createPerformanceUXGuidelines(requirements) {
455
- return {
456
- loadingStates: {
457
- skeleton: 'For content-heavy sections',
458
- spinner: 'For quick actions',
459
- progressBar: 'For known duration tasks'
460
- },
461
- optimisticUI: {
462
- immediateResponse: 'For common actions',
463
- rollbackStrategy: 'For failed optimistic updates',
464
- conflictResolution: 'For concurrent modifications'
465
- },
466
- caching: {
467
- strategy: 'Cache frequently accessed data',
468
- invalidation: 'Clear cache on data changes',
469
- fallbacks: 'Graceful degradation when cache fails'
470
- }
471
- };
472
- }
473
- // Accessibility specification methods
474
- getWCAGGuidelines(level) {
475
- const guidelines = {
476
- 'A': [
477
- 'Provide text alternatives for images',
478
- 'Provide captions for videos',
479
- 'Ensure keyboard accessibility',
480
- 'Avoid seizure-inducing content'
481
- ],
482
- 'AA': [
483
- 'Ensure sufficient color contrast (4.5:1)',
484
- 'Support text resize up to 200%',
485
- 'Ensure keyboard accessibility',
486
- 'Provide clear headings and labels',
487
- 'Make error identification clear',
488
- 'Ensure focus indicators are visible'
489
- ],
490
- 'AAA': [
491
- 'Ensure higher color contrast (7:1)',
492
- 'Support text resize up to 200% without assistive technology',
493
- 'Provide context and orientation information',
494
- 'Ensure timing is adjustable'
495
- ]
496
- };
497
- return guidelines[level] || guidelines['AA'];
498
- }
499
- getAccessibilityTestingCriteria(level) {
500
- return {
501
- automated: [
502
- 'Color contrast ratios',
503
- 'Missing alt text',
504
- 'Heading structure',
505
- 'Form label associations',
506
- 'Focus order'
507
- ],
508
- manual: [
509
- 'Keyboard navigation',
510
- 'Screen reader compatibility',
511
- 'Logical reading order',
512
- 'Error handling',
513
- 'Time-based content'
514
- ],
515
- userTesting: [
516
- 'Screen reader user testing',
517
- 'Keyboard-only user testing',
518
- 'Cognitive accessibility testing'
519
- ]
520
- };
521
- }
522
- defineTabOrder(requirements) {
523
- return {
524
- strategy: 'Logical and intuitive flow',
525
- skipLinks: 'Provide skip to main content',
526
- focusTraps: 'For modal dialogs and overlays',
527
- customTabIndex: 'Only when necessary, prefer natural order'
528
- };
529
- }
530
- defineKeyboardShortcuts(requirements) {
531
- return {
532
- global: {
533
- 'Alt + M': 'Skip to main content',
534
- 'Alt + N': 'Skip to navigation',
535
- 'Escape': 'Close modals/dropdowns'
536
- },
537
- widget: {
538
- 'Enter': 'Activate primary action',
539
- 'Space': 'Select/toggle items',
540
- 'Arrow Keys': 'Navigate lists/grids'
541
- }
542
- };
543
- }
544
- defineFocusManagement(requirements) {
545
- return {
546
- initialFocus: 'First interactive element or logical starting point',
547
- focusTrapping: 'Keep focus within modals and overlays',
548
- focusRestoration: 'Return focus to trigger element after modal close',
549
- visibleIndicators: 'Clear, high-contrast focus indicators'
550
- };
551
- }
552
- defineAriaLabels(requirements) {
553
- return {
554
- buttons: 'Descriptive action labels',
555
- links: 'Clear destination or purpose',
556
- forms: 'Associated labels and descriptions',
557
- landmarks: 'Page structure identification',
558
- dynamicContent: 'Live region announcements'
559
- };
560
- }
561
- defineLandmarks(requirements) {
562
- return {
563
- banner: 'Site header',
564
- navigation: 'Primary navigation',
565
- main: 'Main content area',
566
- complementary: 'Sidebar content',
567
- contentinfo: 'Site footer',
568
- search: 'Search functionality'
569
- };
570
- }
571
- defineScreenReaderAnnouncements(requirements) {
572
- return {
573
- statusUpdates: 'aria-live="polite" for non-critical updates',
574
- errorMessages: 'aria-live="assertive" for errors',
575
- loadingStates: 'Announce loading start and completion',
576
- dynamicContent: 'Announce content changes'
577
- };
578
- }
579
- defineColorContrast(requirements) {
580
- return {
581
- normalText: '4.5:1 minimum',
582
- largeText: '3:1 minimum',
583
- nonTextElements: '3:1 minimum',
584
- focusIndicators: '3:1 against adjacent colors'
585
- };
586
- }
587
- defineTextScaling(requirements) {
588
- return {
589
- support: 'Up to 200% zoom',
590
- responsive: 'Layout remains functional',
591
- readability: 'Text remains readable',
592
- interaction: 'Interactive elements remain usable'
593
- };
594
- }
595
- defineMotionPreferences(requirements) {
596
- return {
597
- respectPreference: 'Honor prefers-reduced-motion',
598
- alternatives: 'Provide static alternatives to animations',
599
- controls: 'Allow users to disable motion',
600
- essential: 'Keep only essential motion'
601
- };
602
- }
603
- defineErrorPrevention(requirements) {
604
- return {
605
- validation: 'Real-time validation with clear feedback',
606
- confirmation: 'Confirm destructive or irreversible actions',
607
- review: 'Allow review before submission',
608
- recovery: 'Provide clear correction paths'
609
- };
610
- }
611
- defineHelpSystems(requirements) {
612
- return {
613
- contextual: 'Help available where needed',
614
- progressive: 'Information revealed as needed',
615
- multiple: 'Various help formats (text, video, examples)',
616
- accessible: 'Help content follows accessibility guidelines'
617
- };
618
- }
619
- defineTimeoutHandling(requirements) {
620
- return {
621
- warning: 'Warn users before timeout',
622
- extension: 'Allow timeout extension',
623
- saving: 'Auto-save user progress',
624
- recovery: 'Recover work after timeout'
625
- };
626
- }
627
- // Validation methods
628
- async validateUsability(design) {
629
- console.log('UI/UX Agent: Validating usability...');
630
- const heuristics = this.evaluateUsabilityHeuristics(design);
631
- const accessibility = this.evaluateAccessibility(design);
632
- const designSystem = this.evaluateDesignSystemAdherence(design);
633
- const overallScore = (heuristics.score + accessibility.score + designSystem.score) / 3;
634
- return {
635
- score: overallScore,
636
- issues: [...heuristics.issues, ...accessibility.issues, ...designSystem.issues],
637
- recommendations: this.generateRecommendations(design, overallScore)
638
- };
639
- }
640
- evaluateUsabilityHeuristics(design) {
641
- const heuristics = [
642
- { name: 'Visibility of system status', weight: 0.15 },
643
- { name: 'Match between system and real world', weight: 0.1 },
644
- { name: 'User control and freedom', weight: 0.15 },
645
- { name: 'Consistency and standards', weight: 0.15 },
646
- { name: 'Error prevention', weight: 0.1 },
647
- { name: 'Recognition rather than recall', weight: 0.1 },
648
- { name: 'Flexibility and efficiency of use', weight: 0.1 },
649
- { name: 'Aesthetic and minimalist design', weight: 0.05 },
650
- { name: 'Help users recognize and recover from errors', weight: 0.05 },
651
- { name: 'Help and documentation', weight: 0.05 }
652
- ];
653
- let totalScore = 0;
654
- const issues = [];
655
- heuristics.forEach(heuristic => {
656
- const score = this.evaluateHeuristic(design, heuristic.name);
657
- totalScore += score * heuristic.weight;
658
- if (score < 0.7) {
659
- issues.push({
660
- type: 'usability',
661
- heuristic: heuristic.name,
662
- severity: score < 0.5 ? 'high' : 'medium',
663
- description: `Low score for ${heuristic.name}`
664
- });
665
- }
666
- });
667
- return { score: totalScore, issues };
668
- }
669
- evaluateAccessibility(design) {
670
- const criteria = [
671
- 'Color contrast',
672
- 'Keyboard navigation',
673
- 'Screen reader support',
674
- 'Focus management',
675
- 'Error handling',
676
- 'Time-based content'
677
- ];
678
- let totalScore = 0;
679
- const issues = [];
680
- criteria.forEach(criterion => {
681
- const score = this.evaluateAccessibilityCriterion(design, criterion);
682
- totalScore += score / criteria.length;
683
- if (score < 0.8) {
684
- issues.push({
685
- type: 'accessibility',
686
- criterion,
687
- severity: score < 0.6 ? 'high' : 'medium',
688
- description: `Accessibility issue with ${criterion}`
689
- });
690
- }
691
- });
692
- return { score: totalScore, issues };
693
- }
694
- evaluateDesignSystemAdherence(design) {
695
- const aspects = [
696
- 'Color usage',
697
- 'Typography consistency',
698
- 'Spacing consistency',
699
- 'Component usage',
700
- 'Interaction patterns'
701
- ];
702
- let totalScore = 0;
703
- const issues = [];
704
- aspects.forEach(aspect => {
705
- const score = this.evaluateDesignSystemAspect(design, aspect);
706
- totalScore += score / aspects.length;
707
- if (score < 0.75) {
708
- issues.push({
709
- type: 'design_system',
710
- aspect,
711
- severity: score < 0.5 ? 'high' : 'medium',
712
- description: `Design system inconsistency in ${aspect}`
713
- });
714
- }
715
- });
716
- return { score: totalScore, issues };
717
- }
718
- generateRecommendations(design, score) {
719
- const recommendations = [];
720
- if (score < 0.7) {
721
- recommendations.push('Consider a comprehensive usability review');
722
- recommendations.push('Conduct user testing with representative users');
723
- }
724
- if (score < 0.5) {
725
- recommendations.push('Major usability improvements needed');
726
- recommendations.push('Consider design iteration with user feedback');
727
- }
728
- // Add specific recommendations based on design analysis
729
- recommendations.push('Ensure all interactive elements have clear affordances');
730
- recommendations.push('Validate color contrast meets WCAG AA standards');
731
- recommendations.push('Test keyboard navigation thoroughly');
732
- return recommendations;
733
- }
734
- // Helper evaluation methods
735
- evaluateHeuristic(design, heuristicName) {
736
- // Simplified evaluation - in real implementation, this would be more sophisticated
737
- const baseScore = 0.7;
738
- // Add evaluation logic based on design properties
739
- if (design.uxGuidelines && design.uxGuidelines.errorHandling) {
740
- return Math.min(baseScore + 0.2, 1.0);
741
- }
742
- return baseScore;
743
- }
744
- evaluateAccessibilityCriterion(design, criterion) {
745
- // Simplified evaluation
746
- const baseScore = 0.8;
747
- if (design.accessibilitySpec && design.accessibilitySpec.wcagCompliance) {
748
- return Math.min(baseScore + 0.1, 1.0);
749
- }
750
- return baseScore;
751
- }
752
- evaluateDesignSystemAspect(design, aspect) {
753
- // Simplified evaluation
754
- const baseScore = 0.75;
755
- if (design.designSpec && design.designSpec.colorScheme) {
756
- return Math.min(baseScore + 0.15, 1.0);
757
- }
758
- return baseScore;
759
- }
760
- // Assessment methods
761
- assessDesignConsistency(designSpec) {
762
- // Check if design spec has consistent color and typography usage
763
- const hasColorScheme = !!designSpec.colorScheme;
764
- const hasTypography = !!designSpec.typography;
765
- const hasLayout = !!designSpec.layout;
766
- let score = 0.3;
767
- if (hasColorScheme)
768
- score += 0.25;
769
- if (hasTypography)
770
- score += 0.25;
771
- if (hasLayout)
772
- score += 0.2;
773
- return Math.min(score, 1.0);
774
- }
775
- assessAccessibilityCompliance(accessibilitySpec) {
776
- // Check accessibility specification completeness
777
- const hasWCAG = !!accessibilitySpec.wcagCompliance;
778
- const hasKeyboard = !!accessibilitySpec.keyboardNavigation;
779
- const hasScreenReader = !!accessibilitySpec.screenReaderSupport;
780
- let score = 0.4;
781
- if (hasWCAG)
782
- score += 0.25;
783
- if (hasKeyboard)
784
- score += 0.2;
785
- if (hasScreenReader)
786
- score += 0.15;
787
- return Math.min(score, 1.0);
788
- }
789
- assessUserExperience(uxGuidelines) {
790
- // Check UX guidelines completeness
791
- const hasUserFlows = !!uxGuidelines.userFlows;
792
- const hasErrorHandling = !!uxGuidelines.errorHandling;
793
- const hasFeedback = !!uxGuidelines.feedbackSystems;
794
- let score = 0.4;
795
- if (hasUserFlows)
796
- score += 0.25;
797
- if (hasErrorHandling)
798
- score += 0.2;
799
- if (hasFeedback)
800
- score += 0.15;
801
- return Math.min(score, 1.0);
802
- }
803
- // Helper methods for generating content
804
- generateFlowSteps(flow) {
805
- const flows = {
806
- 'load_data': ['Initialize', 'Validate permissions', 'Fetch data', 'Process data', 'Display results'],
807
- 'user_interaction': ['Detect interaction', 'Validate input', 'Process action', 'Update UI', 'Provide feedback'],
808
- 'error_handling': ['Detect error', 'Log error', 'Display user message', 'Provide recovery options']
809
- };
810
- return flows[flow] || ['Start', 'Process', 'Complete'];
811
- }
812
- generateDecisionPoints(flow) {
813
- return ['User permissions check', 'Data availability check', 'Error condition check'];
814
- }
815
- generateErrorPaths(flow) {
816
- return ['Permission denied path', 'Data unavailable path', 'System error path'];
817
- }
818
- generateSecondaryFlows(requirements) {
819
- return [
820
- { name: 'Settings configuration', priority: 'low' },
821
- { name: 'Help access', priority: 'medium' },
822
- { name: 'Refresh data', priority: 'medium' }
823
- ];
824
- }
825
- generateEdgeCaseFlows(requirements) {
826
- return [
827
- { name: 'Network offline', recovery: 'Show cached data with notice' },
828
- { name: 'No data available', recovery: 'Show empty state with guidance' },
829
- { name: 'Timeout error', recovery: 'Offer retry option' }
830
- ];
831
- }
832
- // Analysis methods
833
- analyzeUserExperience(requirements) {
834
- return {
835
- complexity: requirements.userExperience.workflow.length > 3 ? 'high' : 'medium',
836
- workflows: requirements.userExperience.workflow,
837
- feedbackNeeds: requirements.userExperience.feedback
838
- };
839
- }
840
- analyzeAccessibilityNeeds(requirements) {
841
- return {
842
- wcagLevel: requirements.accessibility.wcag,
843
- screenReaderSupport: requirements.accessibility.screenReader,
844
- keyboardNavigation: requirements.accessibility.keyboard,
845
- priority: 'high'
846
- };
847
- }
848
- analyzeDesignSystemNeeds(requirements) {
849
- return {
850
- pattern: requirements.uiPattern,
851
- consistency: 'high',
852
- customization: 'medium'
853
- };
854
- }
855
- analyzeInteractionNeeds(requirements) {
856
- return {
857
- complexity: 'medium',
858
- types: ['click', 'hover', 'keyboard', 'touch'],
859
- responsiveness: 'required'
860
- };
861
- }
862
- analyzeUsabilityFactors(requirements) {
863
- return {
864
- testing: 'recommended',
865
- heuristics: 'apply_all',
866
- iteration: 'expected'
867
- };
868
- }
869
- // Content generation helpers
870
- createContentHierarchy(requirements) {
871
- return {
872
- primary: 'Widget title and main content',
873
- secondary: 'Actions and controls',
874
- tertiary: 'Metadata and support information'
875
- };
876
- }
877
- createNavigationStructure(requirements) {
878
- return {
879
- type: 'inline',
880
- patterns: ['breadcrumbs', 'tabs', 'pagination'],
881
- accessibility: 'full keyboard support'
882
- };
883
- }
884
- createCategorization(requirements) {
885
- return {
886
- method: 'logical grouping',
887
- labels: 'clear and descriptive',
888
- hierarchy: 'shallow preferred'
889
- };
890
- }
891
- createSearchStrategy(requirements) {
892
- return {
893
- type: 'inline filtering',
894
- scope: 'current data set',
895
- feedback: 'real-time results'
896
- };
897
- }
898
- generateMicrocopy(requirements) {
899
- return {
900
- buttons: 'Action-oriented verbs',
901
- labels: 'Clear and concise',
902
- errors: 'Specific and helpful',
903
- success: 'Encouraging and next-step focused'
904
- };
905
- }
906
- generateHelpContent(requirements) {
907
- return {
908
- contextual: 'Tooltips and inline help',
909
- comprehensive: 'Help documentation',
910
- interactive: 'Guided tours and tutorials'
911
- };
912
- }
913
- getFeedbackImplementation(feedback) {
914
- const implementations = {
915
- 'loading_indicators': 'Spinners, progress bars, skeleton screens',
916
- 'error_messages': 'Inline alerts with clear messaging',
917
- 'success_notifications': 'Toast notifications with success icons'
918
- };
919
- return implementations[feedback] || 'Standard UI feedback pattern';
920
- }
921
- getFeedbackTiming(feedback) {
922
- const timings = {
923
- 'loading_indicators': 'Immediate on action initiation',
924
- 'error_messages': 'Real-time validation',
925
- 'success_notifications': 'Immediate on successful completion'
926
- };
927
- return timings[feedback] || 'Context-appropriate timing';
928
- }
929
- getFeedbackAccessibility(feedback) {
930
- return 'Screen reader announcements, high contrast, keyboard accessible';
931
- }
932
- // Additional helper methods for completeness
933
- defineGestureInteractions(requirements) {
934
- return {
935
- swipe: 'Navigate between items',
936
- pinch: 'Zoom content',
937
- tap: 'Primary interaction',
938
- longPress: 'Context menu'
939
- };
940
- }
941
- defineMouseInteractions(requirements) {
942
- return {
943
- click: 'Primary action',
944
- doubleClick: 'Quick action',
945
- rightClick: 'Context menu',
946
- hover: 'Preview information'
947
- };
948
- }
949
- defineTouchInteractions(requirements) {
950
- return {
951
- tap: 'Primary interaction',
952
- swipe: 'Navigation',
953
- pinch: 'Zoom',
954
- twoFinger: 'Secondary actions'
955
- };
956
- }
957
- defineVoiceInteractions(requirements) {
958
- return {
959
- commands: ['refresh', 'filter', 'select'],
960
- feedback: 'Audio confirmation',
961
- fallback: 'Visual alternative always available'
962
- };
963
- }
964
- defineStateTransitions(requirements) {
965
- return {
966
- loading: 'Fade in with spinner',
967
- error: 'Slide in error message',
968
- success: 'Smooth content update',
969
- empty: 'Fade to empty state'
970
- };
971
- }
972
- defineAnimations(requirements) {
973
- return {
974
- duration: '0.2s for UI, 0.3s for content',
975
- easing: 'ease-out for entrances, ease-in for exits',
976
- reducedMotion: 'Respect user preferences'
977
- };
978
- }
979
- defineMicroInteractions(requirements) {
980
- return {
981
- buttonPress: 'Subtle scale down',
982
- hoverFeedback: 'Color change and elevation',
983
- focusFeedback: 'Clear outline indicator',
984
- errorShake: 'Gentle horizontal shake'
985
- };
986
- }
987
- createBrandAlignment(requirements) {
988
- return {
989
- serviceNowBrand: 'Follow ServiceNow design system',
990
- consistency: 'Maintain brand consistency',
991
- flexibility: 'Allow for customization within guidelines'
992
- };
993
- }
994
- createIconographySystem(requirements) {
995
- return {
996
- style: 'Outline icons from ServiceNow icon library',
997
- size: '16px, 20px, 24px',
998
- usage: 'Consistent meaning across contexts',
999
- accessibility: 'Always paired with text labels'
1000
- };
1001
- }
1002
- createImageryGuidelines(requirements) {
1003
- return {
1004
- style: 'Professional and purposeful',
1005
- quality: 'High resolution for all screen densities',
1006
- accessibility: 'Meaningful alt text for all images',
1007
- optimization: 'Optimized for web performance'
1008
- };
1009
- }
1010
- createSpacingSystem(requirements) {
1011
- return {
1012
- scale: '4px, 8px, 12px, 16px, 24px, 32px, 48px, 64px',
1013
- usage: 'Consistent spacing between elements',
1014
- responsive: 'Adjust spacing for different screen sizes'
1015
- };
1016
- }
1017
- createElevationSystem(requirements) {
1018
- return {
1019
- levels: '0, 1, 2, 3, 4',
1020
- shadows: 'Consistent shadow definitions',
1021
- usage: 'Indicate hierarchy and interactivity'
1022
- };
1023
- }
1024
- createResponsiveGuidelines(requirements) {
1025
- return {
1026
- breakpoints: '320px, 768px, 1024px, 1200px',
1027
- approach: 'Mobile-first design',
1028
- testing: 'Test on multiple devices and screen sizes'
1029
- };
1030
- }
1031
- }
1032
- exports.WidgetUIUXAgent = WidgetUIUXAgent;
1033
- //# sourceMappingURL=widget-uiux.agent.js.map