claude-flow-novice 2.0.4 → 2.0.5

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 (496) hide show
  1. package/dist/src/cli/commands/guidance.js +668 -487
  2. package/dist/src/cli/commands/index-validate.js +29 -18
  3. package/dist/src/cli/commands/mcp-troubleshoot.js +282 -230
  4. package/dist/src/cli/commands/neural-goal-init.js +125 -92
  5. package/dist/src/cli/commands/swarm-exec.js +393 -317
  6. package/dist/src/cli/commands/validate-framework.js +1100 -983
  7. package/dist/src/cli/commands/validate.js +223 -144
  8. package/dist/src/cli/main.js +1 -1
  9. package/dist/src/cli/simple-commands/__tests__/agent.test.js +277 -265
  10. package/dist/src/cli/simple-commands/__tests__/memory.test.js +7 -6
  11. package/dist/src/cli/simple-commands/__tests__/swarm.test.js +356 -373
  12. package/dist/src/cli/simple-commands/__tests__/task.test.js +7 -6
  13. package/dist/src/cli/simple-commands/agent.js +193 -157
  14. package/dist/src/cli/simple-commands/analysis.js +446 -336
  15. package/dist/src/cli/simple-commands/automation-executor.js +1339 -1095
  16. package/dist/src/cli/simple-commands/automation.js +469 -481
  17. package/dist/src/cli/simple-commands/batch-manager.js +313 -261
  18. package/dist/src/cli/simple-commands/claude-telemetry.js +267 -241
  19. package/dist/src/cli/simple-commands/claude-track.js +90 -68
  20. package/dist/src/cli/simple-commands/concurrent-display.js +320 -266
  21. package/dist/src/cli/simple-commands/config.js +290 -245
  22. package/dist/src/cli/simple-commands/coordination.js +234 -182
  23. package/dist/src/cli/simple-commands/enhanced-ui-views.js +615 -812
  24. package/dist/src/cli/simple-commands/enhanced-webui-complete.js +981 -922
  25. package/dist/src/cli/simple-commands/fix-hook-variables.js +294 -274
  26. package/dist/src/cli/simple-commands/github/gh-coordinator.js +457 -378
  27. package/dist/src/cli/simple-commands/github/github-api.js +574 -535
  28. package/dist/src/cli/simple-commands/github/init.js +303 -276
  29. package/dist/src/cli/simple-commands/github.js +247 -222
  30. package/dist/src/cli/simple-commands/goal.js +63 -51
  31. package/dist/src/cli/simple-commands/hive-mind/auto-save-middleware.js +278 -208
  32. package/dist/src/cli/simple-commands/hive-mind/communication.js +696 -601
  33. package/dist/src/cli/simple-commands/hive-mind/core.js +979 -907
  34. package/dist/src/cli/simple-commands/hive-mind/db-optimizer.js +655 -406
  35. package/dist/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1245 -1125
  36. package/dist/src/cli/simple-commands/hive-mind/memory.js +1090 -854
  37. package/dist/src/cli/simple-commands/hive-mind/performance-optimizer.js +574 -459
  38. package/dist/src/cli/simple-commands/hive-mind/performance-test.js +347 -263
  39. package/dist/src/cli/simple-commands/hive-mind/queen.js +768 -727
  40. package/dist/src/cli/simple-commands/hive-mind/session-manager.js +1049 -745
  41. package/dist/src/cli/simple-commands/hive-mind-optimize.js +283 -227
  42. package/dist/src/cli/simple-commands/hive-mind-wizard.js +217 -174
  43. package/dist/src/cli/simple-commands/hive-mind.js +2282 -1841
  44. package/dist/src/cli/simple-commands/hive.js +79 -90
  45. package/dist/src/cli/simple-commands/hook-safety.js +521 -431
  46. package/dist/src/cli/simple-commands/hooks/session-start-soul.js +254 -203
  47. package/dist/src/cli/simple-commands/hooks.js +1204 -1064
  48. package/dist/src/cli/simple-commands/init/agent-copier.js +319 -294
  49. package/dist/src/cli/simple-commands/init/batch-init.js +562 -496
  50. package/dist/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +19 -13
  51. package/dist/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +19 -13
  52. package/dist/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +88 -61
  53. package/dist/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +150 -125
  54. package/dist/src/cli/simple-commands/init/claude-commands/slash-commands.js +49 -42
  55. package/dist/src/cli/simple-commands/init/claude-commands/sparc-commands.js +61 -43
  56. package/dist/src/cli/simple-commands/init/copy-revised-templates.js +147 -141
  57. package/dist/src/cli/simple-commands/init/executable-wrapper.js +44 -31
  58. package/dist/src/cli/simple-commands/init/gitignore-updater.js +90 -64
  59. package/dist/src/cli/simple-commands/init/help.js +107 -104
  60. package/dist/src/cli/simple-commands/init/hive-mind-init.js +528 -509
  61. package/dist/src/cli/simple-commands/init/index.js +1759 -1510
  62. package/dist/src/cli/simple-commands/init/performance-monitor.js +317 -234
  63. package/dist/src/cli/simple-commands/init/rollback/backup-manager.js +504 -441
  64. package/dist/src/cli/simple-commands/init/rollback/index.js +364 -289
  65. package/dist/src/cli/simple-commands/init/rollback/recovery-manager.js +728 -652
  66. package/dist/src/cli/simple-commands/init/rollback/rollback-executor.js +481 -416
  67. package/dist/src/cli/simple-commands/init/rollback/state-tracker.js +448 -369
  68. package/dist/src/cli/simple-commands/init/sparc/roo-readme.js +2 -1
  69. package/dist/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -122
  70. package/dist/src/cli/simple-commands/init/sparc/workflows.js +37 -32
  71. package/dist/src/cli/simple-commands/init/sparc-structure.js +62 -55
  72. package/dist/src/cli/simple-commands/init/template-copier.js +533 -421
  73. package/dist/src/cli/simple-commands/init/templates/coordination-md.js +6 -3
  74. package/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +318 -344
  75. package/dist/src/cli/simple-commands/init/templates/github-safe-enhanced.js +218 -173
  76. package/dist/src/cli/simple-commands/init/templates/github-safe.js +75 -65
  77. package/dist/src/cli/simple-commands/init/templates/memory-bank-md.js +6 -3
  78. package/dist/src/cli/simple-commands/init/templates/readme-files.js +4 -2
  79. package/dist/src/cli/simple-commands/init/templates/safe-hook-patterns.js +230 -187
  80. package/dist/src/cli/simple-commands/init/templates/sparc-modes.js +80 -53
  81. package/dist/src/cli/simple-commands/init/templates/verification-claude-md.js +85 -101
  82. package/dist/src/cli/simple-commands/init/validation/config-validator.js +330 -283
  83. package/dist/src/cli/simple-commands/init/validation/health-checker.js +561 -495
  84. package/dist/src/cli/simple-commands/init/validation/index.js +358 -302
  85. package/dist/src/cli/simple-commands/init/validation/mode-validator.js +359 -308
  86. package/dist/src/cli/simple-commands/init/validation/post-init-validator.js +366 -389
  87. package/dist/src/cli/simple-commands/init/validation/pre-init-validator.js +268 -270
  88. package/dist/src/cli/simple-commands/init/validation/test-runner.js +447 -427
  89. package/dist/src/cli/simple-commands/init.js +2 -1
  90. package/dist/src/cli/simple-commands/mcp-health.js +158 -131
  91. package/dist/src/cli/simple-commands/mcp-integration-layer.js +634 -533
  92. package/dist/src/cli/simple-commands/mcp.js +400 -345
  93. package/dist/src/cli/simple-commands/memory-consolidation.js +537 -426
  94. package/dist/src/cli/simple-commands/memory.js +311 -247
  95. package/dist/src/cli/simple-commands/migrate-hooks.js +46 -39
  96. package/dist/src/cli/simple-commands/monitor.js +363 -294
  97. package/dist/src/cli/simple-commands/neural.js +65 -51
  98. package/dist/src/cli/simple-commands/pair-autofix-only.js +662 -538
  99. package/dist/src/cli/simple-commands/pair-basic.js +656 -528
  100. package/dist/src/cli/simple-commands/pair-old.js +543 -430
  101. package/dist/src/cli/simple-commands/pair-working.js +751 -615
  102. package/dist/src/cli/simple-commands/pair.js +751 -615
  103. package/dist/src/cli/simple-commands/performance-hooks.js +111 -83
  104. package/dist/src/cli/simple-commands/performance-metrics.js +433 -348
  105. package/dist/src/cli/simple-commands/process-ui-enhanced.js +787 -708
  106. package/dist/src/cli/simple-commands/process-ui.js +254 -230
  107. package/dist/src/cli/simple-commands/realtime-update-system.js +611 -525
  108. package/dist/src/cli/simple-commands/sparc/architecture.js +1530 -1704
  109. package/dist/src/cli/simple-commands/sparc/commands.js +516 -438
  110. package/dist/src/cli/simple-commands/sparc/completion.js +1481 -1224
  111. package/dist/src/cli/simple-commands/sparc/coordinator.js +978 -913
  112. package/dist/src/cli/simple-commands/sparc/index.js +298 -241
  113. package/dist/src/cli/simple-commands/sparc/phase-base.js +390 -314
  114. package/dist/src/cli/simple-commands/sparc/pseudocode.js +869 -965
  115. package/dist/src/cli/simple-commands/sparc/refinement.js +1273 -980
  116. package/dist/src/cli/simple-commands/sparc/specification.js +645 -559
  117. package/dist/src/cli/simple-commands/sparc-modes/architect.js +1 -1
  118. package/dist/src/cli/simple-commands/sparc-modes/ask.js +1 -1
  119. package/dist/src/cli/simple-commands/sparc-modes/code.js +1 -1
  120. package/dist/src/cli/simple-commands/sparc-modes/debug.js +1 -1
  121. package/dist/src/cli/simple-commands/sparc-modes/devops.js +1 -1
  122. package/dist/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
  123. package/dist/src/cli/simple-commands/sparc-modes/generic.js +1 -1
  124. package/dist/src/cli/simple-commands/sparc-modes/index.js +55 -47
  125. package/dist/src/cli/simple-commands/sparc-modes/integration.js +1 -1
  126. package/dist/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
  127. package/dist/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
  128. package/dist/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
  129. package/dist/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
  130. package/dist/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
  131. package/dist/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
  132. package/dist/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
  133. package/dist/src/cli/simple-commands/sparc-modes/swarm.js +87 -101
  134. package/dist/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
  135. package/dist/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
  136. package/dist/src/cli/simple-commands/sparc.js +493 -465
  137. package/dist/src/cli/simple-commands/start-ui.js +132 -108
  138. package/dist/src/cli/simple-commands/start-wrapper.js +268 -240
  139. package/dist/src/cli/simple-commands/start.js +1 -1
  140. package/dist/src/cli/simple-commands/status.js +275 -254
  141. package/dist/src/cli/simple-commands/stream-chain-clean.js +171 -128
  142. package/dist/src/cli/simple-commands/stream-chain-fixed.js +82 -61
  143. package/dist/src/cli/simple-commands/stream-chain-real.js +331 -267
  144. package/dist/src/cli/simple-commands/stream-chain-working.js +263 -211
  145. package/dist/src/cli/simple-commands/stream-chain.js +318 -260
  146. package/dist/src/cli/simple-commands/stream-processor.js +315 -290
  147. package/dist/src/cli/simple-commands/swarm-executor.js +222 -189
  148. package/dist/src/cli/simple-commands/swarm-metrics-integration.js +300 -208
  149. package/dist/src/cli/simple-commands/swarm-ui.js +703 -623
  150. package/dist/src/cli/simple-commands/swarm-webui-integration.js +286 -258
  151. package/dist/src/cli/simple-commands/swarm.js +1082 -887
  152. package/dist/src/cli/simple-commands/task.js +206 -161
  153. package/dist/src/cli/simple-commands/timestamp-fix.js +89 -59
  154. package/dist/src/cli/simple-commands/token-tracker.js +316 -258
  155. package/dist/src/cli/simple-commands/tool-execution-framework.js +519 -433
  156. package/dist/src/cli/simple-commands/train-and-stream.js +331 -275
  157. package/dist/src/cli/simple-commands/training-pipeline.js +725 -619
  158. package/dist/src/cli/simple-commands/training.js +227 -170
  159. package/dist/src/cli/simple-commands/verification-hooks.js +284 -261
  160. package/dist/src/cli/simple-commands/verification-integration.js +417 -389
  161. package/dist/src/cli/simple-commands/verification-training-integration.js +606 -486
  162. package/dist/src/cli/simple-commands/verification.js +513 -493
  163. package/dist/src/cli/simple-commands/web-server.js +836 -766
  164. package/dist/src/cli/simple-commands/webui-validator.js +124 -106
  165. package/dist/src/coordination/byzantine-memory-channels.js +25 -1
  166. package/dist/src/coordination/event-bus/demo-wasm-integration.js +251 -212
  167. package/dist/src/coordination/event-bus/qe-event-bus.js +748 -608
  168. package/dist/src/coordination/event-bus/qe-event-bus.test.js +454 -379
  169. package/dist/src/coordination/iteration-tracker.js +454 -363
  170. package/dist/src/index.js +384 -35
  171. package/dist/src/mcp/DEPRECATED.js +60 -46
  172. package/dist/src/mcp/fixes/mcp-error-fixes.js +134 -115
  173. package/dist/src/mcp/implementations/agent-tracker.js +128 -114
  174. package/dist/src/mcp/implementations/daa-tools.js +350 -292
  175. package/dist/src/mcp/implementations/workflow-tools.js +361 -329
  176. package/dist/src/mcp/mcp-config-manager.js +1331 -1183
  177. package/dist/src/mcp/mcp-server-novice-simplified.js +17 -11
  178. package/dist/src/mcp/mcp-server-novice.js +17 -11
  179. package/dist/src/mcp/mcp-server-sdk.js +17 -11
  180. package/dist/src/mcp/mcp-server.js +1484 -1620
  181. package/dist/src/mcp/ruv-swarm-wrapper.js +239 -209
  182. package/dist/src/memory/advanced-serializer.js +589 -609
  183. package/dist/src/memory/enhanced-examples.js +305 -220
  184. package/dist/src/memory/enhanced-memory.js +336 -295
  185. package/dist/src/memory/enhanced-session-serializer.js +492 -408
  186. package/dist/src/memory/fallback-memory-system.js +1021 -900
  187. package/dist/src/memory/fallback-store.js +131 -93
  188. package/dist/src/memory/high-performance-serialization.js +730 -592
  189. package/dist/src/memory/in-memory-store.js +213 -161
  190. package/dist/src/memory/index.js +157 -123
  191. package/dist/src/memory/lock-free-structures.js +764 -578
  192. package/dist/src/memory/memory-mapped-persistence.js +766 -585
  193. package/dist/src/memory/memory-pressure-manager.js +707 -569
  194. package/dist/src/memory/migration.js +445 -358
  195. package/dist/src/memory/shared-memory.js +768 -641
  196. package/dist/src/memory/sqlite-store.js +325 -245
  197. package/dist/src/memory/sqlite-wrapper.js +151 -122
  198. package/dist/src/memory/swarm-memory.js +603 -470
  199. package/dist/src/memory/test-example.js +134 -126
  200. package/dist/src/memory/ultra-fast-memory-store.js +821 -622
  201. package/dist/src/memory/unified-memory-manager.js +437 -356
  202. package/dist/src/swarm/CodeRefactoringSwarm.js +952 -777
  203. package/dist/src/utils/__tests__/github-cli-safety-wrapper.test.js +400 -332
  204. package/dist/src/utils/error-handler.js +2 -36
  205. package/dist/src/utils/github-cli-safe.js +64 -56
  206. package/dist/src/utils/github-cli-safety-wrapper.js +546 -451
  207. package/dist/src/utils/npx-isolated-cache.js +119 -104
  208. package/dist/src/utils/preference-manager.js +652 -622
  209. package/dist/src/utils/timezone-utils.js +105 -86
  210. package/dist/src/web/api/apm-routes.js +353 -0
  211. package/dist/src/web/api/config/api-config.js +184 -0
  212. package/dist/src/web/api/middleware/auth.js +203 -0
  213. package/dist/src/web/api/middleware/cache.js +273 -0
  214. package/dist/src/web/api/middleware/error-handler.js +257 -0
  215. package/dist/src/web/api/middleware/request-logger.js +215 -0
  216. package/dist/src/web/api/middleware/validation.js +323 -0
  217. package/dist/src/web/api/routes/events.js +463 -0
  218. package/dist/src/web/api/routes/hierarchy.js +300 -0
  219. package/dist/src/web/api/routes/index.js +12 -0
  220. package/dist/src/web/api/routes/metrics.js +559 -0
  221. package/dist/src/web/api/routes/parallel-status.js +359 -0
  222. package/dist/src/web/api/routes/status.js +448 -0
  223. package/dist/src/web/api/server.js +462 -0
  224. package/dist/src/web/dashboard/hooks/useWebSocket.js +383 -0
  225. package/dist/src/web/dashboard/index.js +85 -0
  226. package/dist/src/web/dashboard/realtime/CustomSyncManager.js +439 -0
  227. package/dist/src/web/dashboard/realtime/NativeWebSocketManager.js +323 -0
  228. package/dist/src/web/dashboard/realtime/PerformanceBenchmark.js +527 -0
  229. package/dist/src/web/dashboard/realtime/RealtimeCommunicationManager.js +474 -0
  230. package/dist/src/web/dashboard/realtime/RealtimeServer.js +666 -0
  231. package/dist/src/web/dashboard/realtime/SSEManager.js +426 -0
  232. package/dist/src/web/dashboard/types.js +4 -0
  233. package/dist/src/web/messaging/agent-status-tracker.js +453 -0
  234. package/dist/src/web/messaging/human-intervention-system.js +305 -0
  235. package/dist/src/web/messaging/message-filter.js +302 -0
  236. package/dist/src/web/messaging/swarm-message-router.js +324 -0
  237. package/dist/src/web/messaging/transparency-logger.js +421 -0
  238. package/dist/src/web/portal-server.js +460 -0
  239. package/dist/src/web/server.js +322 -0
  240. package/dist/src/web/websocket/apm-websocket-handler.js +453 -0
  241. package/dist/src/web/websocket/websocket-manager.js +780 -0
  242. package/package.json +5 -3
  243. package/dist/src/cli/minimal-main.js +0 -22
  244. package/dist/src/enterprise/analytics-manager.js +0 -1135
  245. package/dist/src/enterprise/audit-manager.js +0 -1115
  246. package/dist/src/enterprise/cloud-manager.js +0 -891
  247. package/dist/src/enterprise/deployment-manager.js +0 -966
  248. package/dist/src/enterprise/index.js +0 -6
  249. package/dist/src/enterprise/project-manager.js +0 -584
  250. package/dist/src/enterprise/security-manager.js +0 -991
  251. package/dist/src/migration/index.js +0 -92
  252. package/dist/src/migration/logger.js +0 -121
  253. package/dist/src/migration/migration-analyzer.js +0 -268
  254. package/dist/src/migration/migration-runner.js +0 -522
  255. package/dist/src/migration/migration-validator.js +0 -285
  256. package/dist/src/migration/progress-reporter.js +0 -150
  257. package/dist/src/migration/rollback-manager.js +0 -321
  258. package/dist/src/migration/tests/migration-system.test.js +0 -7
  259. package/dist/src/migration/types.js +0 -3
  260. package/dist/src/swarm/__tests__/integration.test.js +0 -227
  261. package/dist/src/swarm/__tests__/prompt-copier.test.js +0 -344
  262. package/dist/src/swarm/advanced-orchestrator.js +0 -1095
  263. package/dist/src/swarm/claude-code-interface.js +0 -961
  264. package/dist/src/swarm/claude-flow-executor.js +0 -229
  265. package/dist/src/swarm/consensus-coordinator.js +0 -475
  266. package/dist/src/swarm/coordinator.js +0 -2993
  267. package/dist/src/swarm/direct-executor.js +0 -1180
  268. package/dist/src/swarm/error-recovery/advanced-error-detection.js +0 -691
  269. package/dist/src/swarm/error-recovery/automated-recovery-workflows.js +0 -998
  270. package/dist/src/swarm/error-recovery/error-recovery-coordinator.js +0 -1197
  271. package/dist/src/swarm/error-recovery/recovery-monitoring.js +0 -772
  272. package/dist/src/swarm/error-recovery/resilience-architecture.js +0 -714
  273. package/dist/src/swarm/error-recovery/self-healing-mechanisms.js +0 -1319
  274. package/dist/src/swarm/error-recovery/test-error-recovery-effectiveness.js +0 -808
  275. package/dist/src/swarm/executor-v2.js +0 -322
  276. package/dist/src/swarm/executor.js +0 -815
  277. package/dist/src/swarm/hive-mind-integration.js +0 -703
  278. package/dist/src/swarm/index.js +0 -41
  279. package/dist/src/swarm/json-output-aggregator.js +0 -267
  280. package/dist/src/swarm/large-scale-coordinator.js +0 -542
  281. package/dist/src/swarm/mcp-integration-wrapper.js +0 -628
  282. package/dist/src/swarm/memory.js +0 -1117
  283. package/dist/src/swarm/optimizations/__tests__/optimization.test.js +0 -348
  284. package/dist/src/swarm/optimizations/async-file-manager.js +0 -285
  285. package/dist/src/swarm/optimizations/circular-buffer.js +0 -162
  286. package/dist/src/swarm/optimizations/connection-pool.js +0 -244
  287. package/dist/src/swarm/optimizations/index.js +0 -28
  288. package/dist/src/swarm/optimizations/optimized-executor.js +0 -320
  289. package/dist/src/swarm/optimizations/ttl-map.js +0 -234
  290. package/dist/src/swarm/prompt-cli.js +0 -200
  291. package/dist/src/swarm/prompt-copier-enhanced.js +0 -202
  292. package/dist/src/swarm/prompt-copier.js +0 -381
  293. package/dist/src/swarm/prompt-manager.js +0 -295
  294. package/dist/src/swarm/prompt-utils.js +0 -310
  295. package/dist/src/swarm/result-aggregator.js +0 -718
  296. package/dist/src/swarm/sparc-executor.js +0 -1568
  297. package/dist/src/swarm/strategies/auto.js +0 -758
  298. package/dist/src/swarm/strategies/base.js +0 -128
  299. package/dist/src/swarm/strategies/research.js +0 -914
  300. package/dist/src/swarm/strategies/strategy-metrics-patch.js +0 -2
  301. package/dist/src/swarm/types.js +0 -52
  302. package/dist/src/swarm/workers/copy-worker.js +0 -56
  303. package/dist/src/validators/epic-config-schema.js +0 -214
  304. package/dist/src/validators/index.js +0 -10
  305. package/dist/src/validators/swarm-init-validator.js +0 -259
  306. package/dist/src/validators/todowrite-batching-validator.js +0 -215
  307. package/dist/src/validators/todowrite-integration.js +0 -187
  308. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/documentSymbols/browser/documentSymbols.js +0 -23
  309. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +0 -57
  310. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +0 -401
  311. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +0 -181
  312. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js +0 -44
  313. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +0 -157
  314. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/edit.js +0 -71
  315. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/editorState/browser/editorState.js +0 -112
  316. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findController.js +0 -990
  317. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findDecorations.js +0 -296
  318. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findModel.js +0 -488
  319. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findOptionsWidget.js +0 -138
  320. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findState.js +0 -243
  321. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findWidget.js +0 -1177
  322. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/folding.js +0 -1093
  323. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +0 -133
  324. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingModel.js +0 -538
  325. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingRanges.js +0 -351
  326. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +0 -49
  327. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/format.js +0 -360
  328. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/formatActions.js +0 -263
  329. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/formattingEdit.js +0 -54
  330. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +0 -149
  331. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/hover/browser/contentHover.js +0 -874
  332. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/inlineCompletions/browser/commandIds.js +0 -7
  333. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/inlineCompletions/browser/commands.js +0 -199
  334. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/linesOperations/browser/copyLinesCommand.js +0 -70
  335. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +0 -26
  336. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +0 -153
  337. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +0 -33
  338. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +0 -354
  339. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/smartSelect/browser/bracketSelections.js +0 -146
  340. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/suggest/browser/completionModel.js +0 -224
  341. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +0 -119
  342. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/edcore.main.js +0 -14
  343. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.all.js +0 -63
  344. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.api.js +0 -55
  345. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.main.js +0 -7
  346. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.worker.js +0 -25
  347. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/standalone/browser/colorizer.js +0 -118
  348. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/language/css/css.worker.js +0 -36869
  349. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/language/css/cssMode.js +0 -2035
  350. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/browser/accessibilityService.js +0 -88
  351. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/common/accessibility.js +0 -9
  352. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/action.js +0 -7
  353. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/actionCommonCategories.js +0 -13
  354. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionList.js +0 -276
  355. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionWidget.js +0 -248
  356. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/common/actionWidget.js +0 -5
  357. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actions/common/actions.js +0 -409
  358. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/audioCues/browser/audioCueService.js +0 -176
  359. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/browser/clipboardService.js +0 -141
  360. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/common/clipboardService.js +0 -6
  361. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/commands/common/commands.js +0 -80
  362. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configuration.js +0 -86
  363. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationModels.js +0 -554
  364. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationRegistry.js +0 -317
  365. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurations.js +0 -41
  366. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/browser/contextKeyService.js +0 -432
  367. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkey.js +0 -1547
  368. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkeys.js +0 -18
  369. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuHandler.js +0 -124
  370. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuService.js +0 -101
  371. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextView.js +0 -7
  372. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextViewService.js +0 -72
  373. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dialogs/common/dialogs.js +0 -2
  374. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dnd/browser/dnd.js +0 -36
  375. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/editor/common/editor.js +0 -17
  376. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/environment/common/environment.js +0 -2
  377. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/extensions/common/extensions.js +0 -47
  378. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/files/common/files.js +0 -9
  379. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +0 -105
  380. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/descriptors.js +0 -11
  381. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/extensions.js +0 -15
  382. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/abstractKeybindingService.js +0 -277
  383. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -53
  384. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -354
  385. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/browser/defaultStyles.js +0 -162
  386. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/common/colorRegistry.js +0 -482
  387. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/abap/abap.js +0 -10
  388. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/apex/apex.js +0 -10
  389. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/azcli/azcli.js +0 -10
  390. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bat/bat.js +0 -10
  391. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bicep/bicep.js +0 -11
  392. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cameligo/cameligo.js +0 -10
  393. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/clojure/clojure.js +0 -10
  394. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/coffee/coffee.js +0 -10
  395. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cpp/cpp.js +0 -10
  396. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/csharp/csharp.js +0 -10
  397. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/csp/csp.js +0 -10
  398. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/css/css.js +0 -12
  399. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cypher/cypher.js +0 -10
  400. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/dart/dart.js +0 -10
  401. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/dockerfile/dockerfile.js +0 -10
  402. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/ecl/ecl.js +0 -10
  403. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/elixir/elixir.js +0 -10
  404. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/flow9/flow9.js +0 -10
  405. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.js +0 -745
  406. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.de.js +0 -31
  407. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.es.js +0 -31
  408. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.fr.js +0 -29
  409. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.it.js +0 -29
  410. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ja.js +0 -31
  411. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.js +0 -29
  412. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ko.js +0 -29
  413. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ru.js +0 -31
  414. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.zh-cn.js +0 -31
  415. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.zh-tw.js +0 -29
  416. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/language/css/cssMode.js +0 -13
  417. package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/language/css/cssWorker.js +0 -81
  418. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/cli.js +0 -64
  419. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/example.js +0 -36
  420. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/index.js +0 -205
  421. package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/test.js +0 -260
  422. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.browser.js +0 -34
  423. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.js +0 -35
  424. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.native.js +0 -26
  425. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/index.browser.js +0 -34
  426. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/index.js +0 -45
  427. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/nanoid.js +0 -1
  428. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/non-secure/index.js +0 -21
  429. package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/url-alphabet/index.js +0 -3
  430. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/bin/nodemon.js +0 -16
  431. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/cli/index.js +0 -49
  432. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/cli/parse.js +0 -230
  433. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/command.js +0 -43
  434. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/defaults.js +0 -34
  435. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/exec.js +0 -234
  436. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/index.js +0 -93
  437. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/load.js +0 -225
  438. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/help/index.js +0 -27
  439. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/index.js +0 -1
  440. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/index.js +0 -4
  441. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/match.js +0 -287
  442. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/run.js +0 -562
  443. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/signals.js +0 -34
  444. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/watch.js +0 -244
  445. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/nodemon.js +0 -317
  446. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/add.js +0 -89
  447. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/index.js +0 -53
  448. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/parse.js +0 -43
  449. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/spawn.js +0 -74
  450. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/bus.js +0 -44
  451. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/clone.js +0 -40
  452. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/colour.js +0 -26
  453. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/index.js +0 -103
  454. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/log.js +0 -82
  455. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/merge.js +0 -47
  456. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/version.js +0 -100
  457. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/brace-expansion/index.js +0 -201
  458. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/has-flag/index.js +0 -8
  459. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/minimatch/minimatch.js +0 -947
  460. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/supports-color/browser.js +0 -5
  461. package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/supports-color/index.js +0 -131
  462. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/bin/pidtree.js +0 -128
  463. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/index.js +0 -49
  464. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/bin.js +0 -61
  465. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/get.js +0 -45
  466. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/pidtree.js +0 -104
  467. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/ps.js +0 -47
  468. package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/wmic.js +0 -49
  469. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/doc.js +0 -1270
  470. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/acorn.js +0 -15
  471. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/angular.js +0 -2
  472. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/babel.js +0 -15
  473. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/estree.js +0 -36
  474. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/flow.js +0 -19
  475. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/glimmer.js +0 -29
  476. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/graphql.js +0 -29
  477. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/html.js +0 -22
  478. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/markdown.js +0 -63
  479. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/meriyah.js +0 -4
  480. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/postcss.js +0 -54
  481. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/typescript.js +0 -20
  482. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/yaml.js +0 -160
  483. package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/standalone.js +0 -34
  484. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/bin/react-scripts.js +0 -58
  485. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/env.js +0 -112
  486. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/getHttpsConfig.js +0 -74
  487. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/babelTransform.js +0 -37
  488. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/cssTransform.js +0 -22
  489. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/fileTransform.js +0 -40
  490. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/modules.js +0 -142
  491. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/paths.js +0 -153
  492. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
  493. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpack.config.js +0 -796
  494. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpackDevServer.config.js +0 -135
  495. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/scripts/build.js +0 -225
  496. package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/scripts/eject.js +0 -340
@@ -1,1722 +1,1493 @@
1
1
  // SPARC Architecture Phase
2
2
  // Design system architecture and component planning
3
- import { SparcPhase } from "./phase-base.js";
3
+
4
+ import { SparcPhase } from './phase-base.js';
5
+
4
6
  export class SparcArchitecture extends SparcPhase {
5
- /**
7
+ constructor(taskDescription, options) {
8
+ super('architecture', taskDescription, options);
9
+ this.components = [];
10
+ this.designPatterns = [];
11
+ this.systemDesign = null;
12
+ this.dataModel = null;
13
+ this.apiDesign = null;
14
+ }
15
+
16
+ /**
6
17
  * Execute architecture phase
7
- */ async execute() {
8
- console.log('🏗️ Starting Architecture Phase');
9
- await this.initializePhase();
10
- const result = {
11
- systemDesign: null,
12
- components: [],
13
- designPatterns: [],
14
- dataModel: null,
15
- apiDesign: null,
16
- deploymentArchitecture: null,
17
- securityArchitecture: null,
18
- scalabilityPlan: null,
19
- integrationPoints: [],
20
- qualityAttributes: {},
21
- architecturalDecisions: [],
22
- riskAssessment: []
23
- };
24
- try {
25
- // Load previous phases
26
- const specification = await this.retrieveFromMemory('specification_complete');
27
- const pseudocode = await this.retrieveFromMemory('pseudocode_complete');
28
- if (!specification || !pseudocode) {
29
- throw new Error('Specification and Pseudocode phases must be completed first');
30
- }
31
- // Design system architecture
32
- result.systemDesign = await this.designSystemArchitecture(specification, pseudocode);
33
- // Define components
34
- result.components = await this.defineComponents(specification, pseudocode);
35
- // Select design patterns
36
- result.designPatterns = await this.selectDesignPatterns(specification, pseudocode);
37
- // Design data model
38
- result.dataModel = await this.designDataModel(specification);
39
- // Design API structure
40
- result.apiDesign = await this.designApiStructure(specification);
41
- // Plan deployment architecture
42
- result.deploymentArchitecture = await this.planDeploymentArchitecture(specification);
43
- // Design security architecture
44
- result.securityArchitecture = await this.designSecurityArchitecture(specification);
45
- // Plan scalability
46
- result.scalabilityPlan = await this.planScalability(specification);
47
- // Identify integration points
48
- result.integrationPoints = await this.identifyIntegrationPoints(specification);
49
- // Define quality attributes
50
- result.qualityAttributes = await this.defineQualityAttributes(specification);
51
- // Document architectural decisions
52
- result.architecturalDecisions = await this.documentArchitecturalDecisions(result);
53
- // Assess risks
54
- result.riskAssessment = await this.assessArchitecturalRisks(result);
55
- // Generate architecture document
56
- await this.generateArchitectureDocument(result);
57
- // Store in memory
58
- await this.storeInMemory('architecture_complete', result);
59
- console.log('✅ Architecture phase completed');
60
- return result;
61
- } catch (error) {
62
- console.error('❌ Architecture phase failed:', error.message);
63
- throw error;
64
- }
18
+ */
19
+ async execute() {
20
+ console.log('🏗️ Starting Architecture Phase');
21
+
22
+ await this.initializePhase();
23
+
24
+ const result = {
25
+ systemDesign: null,
26
+ components: [],
27
+ designPatterns: [],
28
+ dataModel: null,
29
+ apiDesign: null,
30
+ deploymentArchitecture: null,
31
+ securityArchitecture: null,
32
+ scalabilityPlan: null,
33
+ integrationPoints: [],
34
+ qualityAttributes: {},
35
+ architecturalDecisions: [],
36
+ riskAssessment: [],
37
+ };
38
+
39
+ try {
40
+ // Load previous phases
41
+ const specification = await this.retrieveFromMemory('specification_complete');
42
+ const pseudocode = await this.retrieveFromMemory('pseudocode_complete');
43
+
44
+ if (!specification || !pseudocode) {
45
+ throw new Error('Specification and Pseudocode phases must be completed first');
46
+ }
47
+
48
+ // Design system architecture
49
+ result.systemDesign = await this.designSystemArchitecture(specification, pseudocode);
50
+
51
+ // Define components
52
+ result.components = await this.defineComponents(specification, pseudocode);
53
+
54
+ // Select design patterns
55
+ result.designPatterns = await this.selectDesignPatterns(specification, pseudocode);
56
+
57
+ // Design data model
58
+ result.dataModel = await this.designDataModel(specification);
59
+
60
+ // Design API structure
61
+ result.apiDesign = await this.designApiStructure(specification);
62
+
63
+ // Plan deployment architecture
64
+ result.deploymentArchitecture = await this.planDeploymentArchitecture(specification);
65
+
66
+ // Design security architecture
67
+ result.securityArchitecture = await this.designSecurityArchitecture(specification);
68
+
69
+ // Plan scalability
70
+ result.scalabilityPlan = await this.planScalability(specification);
71
+
72
+ // Identify integration points
73
+ result.integrationPoints = await this.identifyIntegrationPoints(specification);
74
+
75
+ // Define quality attributes
76
+ result.qualityAttributes = await this.defineQualityAttributes(specification);
77
+
78
+ // Document architectural decisions
79
+ result.architecturalDecisions = await this.documentArchitecturalDecisions(result);
80
+
81
+ // Assess risks
82
+ result.riskAssessment = await this.assessArchitecturalRisks(result);
83
+
84
+ // Generate architecture document
85
+ await this.generateArchitectureDocument(result);
86
+
87
+ // Store in memory
88
+ await this.storeInMemory('architecture_complete', result);
89
+
90
+ console.log('✅ Architecture phase completed');
91
+ return result;
92
+ } catch (error) {
93
+ console.error('❌ Architecture phase failed:', error.message);
94
+ throw error;
65
95
  }
66
- /**
96
+ }
97
+
98
+ /**
67
99
  * Design system architecture
68
- */ async designSystemArchitecture(specification, pseudocode) {
69
- const architecture = {
70
- style: 'layered',
71
- layers: [],
72
- components: [],
73
- dataFlow: [],
74
- controlFlow: [],
75
- boundaries: []
76
- };
77
- // Determine architecture style based on requirements
78
- const requirements = specification.requirements || [];
79
- const hasApiRequirements = requirements.some((req)=>req.toLowerCase().includes('api'));
80
- const hasUiRequirements = requirements.some((req)=>req.toLowerCase().includes('ui'));
81
- const hasDataRequirements = requirements.some((req)=>req.toLowerCase().includes('data'));
82
- const hasDistributedRequirements = requirements.some((req)=>req.toLowerCase().includes('distributed') || req.toLowerCase().includes('microservice'));
83
- if (hasDistributedRequirements) {
84
- architecture.style = 'microservices';
85
- architecture.layers = [
86
- {
87
- name: 'API Gateway',
88
- responsibility: 'Request routing and authentication'
89
- },
90
- {
91
- name: 'Service Layer',
92
- responsibility: 'Business logic microservices'
93
- },
94
- {
95
- name: 'Data Layer',
96
- responsibility: 'Database and storage services'
97
- },
98
- {
99
- name: 'Infrastructure Layer',
100
- responsibility: 'Monitoring and deployment'
101
- }
102
- ];
103
- } else if (hasApiRequirements && hasUiRequirements) {
104
- architecture.style = 'mvc';
105
- architecture.layers = [
106
- {
107
- name: 'Presentation Layer',
108
- responsibility: 'User interface and user experience'
109
- },
110
- {
111
- name: 'Controller Layer',
112
- responsibility: 'Request handling and routing'
113
- },
114
- {
115
- name: 'Service Layer',
116
- responsibility: 'Business logic and processing'
117
- },
118
- {
119
- name: 'Data Access Layer',
120
- responsibility: 'Database operations'
121
- },
122
- {
123
- name: 'Infrastructure Layer',
124
- responsibility: 'Cross-cutting concerns'
125
- }
126
- ];
127
- } else if (hasApiRequirements) {
128
- architecture.style = 'layered';
129
- architecture.layers = [
130
- {
131
- name: 'API Layer',
132
- responsibility: 'External interface and contracts'
133
- },
134
- {
135
- name: 'Business Layer',
136
- responsibility: 'Core business logic'
137
- },
138
- {
139
- name: 'Data Layer',
140
- responsibility: 'Data persistence and retrieval'
141
- },
142
- {
143
- name: 'Infrastructure Layer',
144
- responsibility: 'Logging, monitoring, security'
145
- }
146
- ];
147
- } else {
148
- architecture.style = 'modular';
149
- architecture.layers = [
150
- {
151
- name: 'Interface Layer',
152
- responsibility: 'External interactions'
153
- },
154
- {
155
- name: 'Processing Layer',
156
- responsibility: 'Core processing logic'
157
- },
158
- {
159
- name: 'Storage Layer',
160
- responsibility: 'Data management'
161
- },
162
- {
163
- name: 'Utility Layer',
164
- responsibility: 'Common utilities and helpers'
165
- }
166
- ];
167
- }
168
- // Define data flow
169
- architecture.dataFlow = this.defineDataFlow(architecture.layers);
170
- // Define control flow
171
- architecture.controlFlow = this.defineControlFlow(architecture.layers);
172
- // Define boundaries
173
- architecture.boundaries = this.defineBoundaries(architecture.layers);
174
- return architecture;
100
+ */
101
+ async designSystemArchitecture(specification, pseudocode) {
102
+ const architecture = {
103
+ style: 'layered',
104
+ layers: [],
105
+ components: [],
106
+ dataFlow: [],
107
+ controlFlow: [],
108
+ boundaries: [],
109
+ };
110
+
111
+ // Determine architecture style based on requirements
112
+ const requirements = specification.requirements || [];
113
+ const hasApiRequirements = requirements.some((req) => req.toLowerCase().includes('api'));
114
+ const hasUiRequirements = requirements.some((req) => req.toLowerCase().includes('ui'));
115
+ const hasDataRequirements = requirements.some((req) => req.toLowerCase().includes('data'));
116
+ const hasDistributedRequirements = requirements.some(
117
+ (req) =>
118
+ req.toLowerCase().includes('distributed') || req.toLowerCase().includes('microservice'),
119
+ );
120
+
121
+ if (hasDistributedRequirements) {
122
+ architecture.style = 'microservices';
123
+ architecture.layers = [
124
+ { name: 'API Gateway', responsibility: 'Request routing and authentication' },
125
+ { name: 'Service Layer', responsibility: 'Business logic microservices' },
126
+ { name: 'Data Layer', responsibility: 'Database and storage services' },
127
+ { name: 'Infrastructure Layer', responsibility: 'Monitoring and deployment' },
128
+ ];
129
+ } else if (hasApiRequirements && hasUiRequirements) {
130
+ architecture.style = 'mvc';
131
+ architecture.layers = [
132
+ { name: 'Presentation Layer', responsibility: 'User interface and user experience' },
133
+ { name: 'Controller Layer', responsibility: 'Request handling and routing' },
134
+ { name: 'Service Layer', responsibility: 'Business logic and processing' },
135
+ { name: 'Data Access Layer', responsibility: 'Database operations' },
136
+ { name: 'Infrastructure Layer', responsibility: 'Cross-cutting concerns' },
137
+ ];
138
+ } else if (hasApiRequirements) {
139
+ architecture.style = 'layered';
140
+ architecture.layers = [
141
+ { name: 'API Layer', responsibility: 'External interface and contracts' },
142
+ { name: 'Business Layer', responsibility: 'Core business logic' },
143
+ { name: 'Data Layer', responsibility: 'Data persistence and retrieval' },
144
+ { name: 'Infrastructure Layer', responsibility: 'Logging, monitoring, security' },
145
+ ];
146
+ } else {
147
+ architecture.style = 'modular';
148
+ architecture.layers = [
149
+ { name: 'Interface Layer', responsibility: 'External interactions' },
150
+ { name: 'Processing Layer', responsibility: 'Core processing logic' },
151
+ { name: 'Storage Layer', responsibility: 'Data management' },
152
+ { name: 'Utility Layer', responsibility: 'Common utilities and helpers' },
153
+ ];
175
154
  }
176
- /**
155
+
156
+ // Define data flow
157
+ architecture.dataFlow = this.defineDataFlow(architecture.layers);
158
+
159
+ // Define control flow
160
+ architecture.controlFlow = this.defineControlFlow(architecture.layers);
161
+
162
+ // Define boundaries
163
+ architecture.boundaries = this.defineBoundaries(architecture.layers);
164
+
165
+ return architecture;
166
+ }
167
+
168
+ /**
177
169
  * Define data flow
178
- */ defineDataFlow(layers) {
179
- const dataFlow = [];
180
- for(let i = 0; i < layers.length - 1; i++){
181
- dataFlow.push({
182
- from: layers[i].name,
183
- to: layers[i + 1].name,
184
- direction: 'downstream',
185
- dataType: 'processed data'
186
- });
187
- dataFlow.push({
188
- from: layers[i + 1].name,
189
- to: layers[i].name,
190
- direction: 'upstream',
191
- dataType: 'results/responses'
192
- });
193
- }
194
- return dataFlow;
170
+ */
171
+ defineDataFlow(layers) {
172
+ const dataFlow = [];
173
+
174
+ for (let i = 0; i < layers.length - 1; i++) {
175
+ dataFlow.push({
176
+ from: layers[i].name,
177
+ to: layers[i + 1].name,
178
+ direction: 'downstream',
179
+ dataType: 'processed data',
180
+ });
181
+
182
+ dataFlow.push({
183
+ from: layers[i + 1].name,
184
+ to: layers[i].name,
185
+ direction: 'upstream',
186
+ dataType: 'results/responses',
187
+ });
195
188
  }
196
- /**
189
+
190
+ return dataFlow;
191
+ }
192
+
193
+ /**
197
194
  * Define control flow
198
- */ defineControlFlow(layers) {
199
- return layers.map((layer, index)=>({
200
- layer: layer.name,
201
- order: index + 1,
202
- triggers: index === 0 ? [
203
- 'external request'
204
- ] : [
205
- `${layers[index - 1].name} completion`
206
- ],
207
- actions: [
208
- 'process',
209
- 'validate',
210
- 'transform',
211
- 'forward'
212
- ],
213
- outcomes: index === layers.length - 1 ? [
214
- 'final response'
215
- ] : [
216
- `trigger ${layers[index + 1].name}`
217
- ]
218
- }));
219
- }
220
- /**
195
+ */
196
+ defineControlFlow(layers) {
197
+ return layers.map((layer, index) => ({
198
+ layer: layer.name,
199
+ order: index + 1,
200
+ triggers: index === 0 ? ['external request'] : [`${layers[index - 1].name} completion`],
201
+ actions: ['process', 'validate', 'transform', 'forward'],
202
+ outcomes:
203
+ index === layers.length - 1 ? ['final response'] : [`trigger ${layers[index + 1].name}`],
204
+ }));
205
+ }
206
+
207
+ /**
221
208
  * Define boundaries
222
- */ defineBoundaries(layers) {
223
- return layers.map((layer)=>({
224
- layer: layer.name,
225
- type: 'logical',
226
- encapsulation: 'interface-based',
227
- dependencies: 'unidirectional',
228
- contracts: 'well-defined APIs'
229
- }));
230
- }
231
- /**
209
+ */
210
+ defineBoundaries(layers) {
211
+ return layers.map((layer) => ({
212
+ layer: layer.name,
213
+ type: 'logical',
214
+ encapsulation: 'interface-based',
215
+ dependencies: 'unidirectional',
216
+ contracts: 'well-defined APIs',
217
+ }));
218
+ }
219
+
220
+ /**
232
221
  * Define components
233
- */ async defineComponents(specification, pseudocode) {
234
- const components = [];
235
- const requirements = specification.requirements || [];
236
- const functions = pseudocode.pseudocode || [];
237
- // Create components based on functional requirements
238
- for (const requirement of requirements){
239
- const component = this.createComponentFromRequirement(requirement);
240
- components.push(component);
241
- }
242
- // Create components based on pseudocode functions
243
- for (const func of functions){
244
- const component = this.createComponentFromFunction(func);
245
- components.push(component);
246
- }
247
- // Add infrastructure components
248
- components.push(...this.createInfrastructureComponents());
249
- // Remove duplicates and merge similar components
250
- const uniqueComponents = this.mergeComponents(components);
251
- return uniqueComponents;
222
+ */
223
+ async defineComponents(specification, pseudocode) {
224
+ const components = [];
225
+ const requirements = specification.requirements || [];
226
+ const functions = pseudocode.pseudocode || [];
227
+
228
+ // Create components based on functional requirements
229
+ for (const requirement of requirements) {
230
+ const component = this.createComponentFromRequirement(requirement);
231
+ components.push(component);
232
+ }
233
+
234
+ // Create components based on pseudocode functions
235
+ for (const func of functions) {
236
+ const component = this.createComponentFromFunction(func);
237
+ components.push(component);
252
238
  }
253
- /**
239
+
240
+ // Add infrastructure components
241
+ components.push(...this.createInfrastructureComponents());
242
+
243
+ // Remove duplicates and merge similar components
244
+ const uniqueComponents = this.mergeComponents(components);
245
+
246
+ return uniqueComponents;
247
+ }
248
+
249
+ /**
254
250
  * Create component from requirement
255
- */ createComponentFromRequirement(requirement) {
256
- const reqLower = requirement.toLowerCase();
257
- if (reqLower.includes('api')) {
258
- return {
259
- name: 'APIController',
260
- type: 'controller',
261
- responsibility: 'Handle API requests and responses',
262
- interfaces: [
263
- 'HTTP',
264
- 'REST'
265
- ],
266
- dependencies: [
267
- 'AuthenticationService',
268
- 'ValidationService'
269
- ],
270
- patterns: [
271
- 'Controller',
272
- 'Facade'
273
- ],
274
- complexity: 'medium'
275
- };
276
- } else if (reqLower.includes('authenticate')) {
277
- return {
278
- name: 'AuthenticationService',
279
- type: 'service',
280
- responsibility: 'Manage user authentication and authorization',
281
- interfaces: [
282
- 'IAuthenticationService'
283
- ],
284
- dependencies: [
285
- 'UserRepository',
286
- 'TokenManager'
287
- ],
288
- patterns: [
289
- 'Service',
290
- 'Strategy'
291
- ],
292
- complexity: 'high'
293
- };
294
- } else if (reqLower.includes('data')) {
295
- return {
296
- name: 'DataRepository',
297
- type: 'repository',
298
- responsibility: 'Manage data persistence and retrieval',
299
- interfaces: [
300
- 'IRepository'
301
- ],
302
- dependencies: [
303
- 'DatabaseConnection',
304
- 'DataMapper'
305
- ],
306
- patterns: [
307
- 'Repository',
308
- 'Unit of Work'
309
- ],
310
- complexity: 'medium'
311
- };
312
- } else if (reqLower.includes('validate')) {
313
- return {
314
- name: 'ValidationService',
315
- type: 'service',
316
- responsibility: 'Validate input data and business rules',
317
- interfaces: [
318
- 'IValidationService'
319
- ],
320
- dependencies: [
321
- 'ValidationRules',
322
- 'ErrorHandler'
323
- ],
324
- patterns: [
325
- 'Strategy',
326
- 'Chain of Responsibility'
327
- ],
328
- complexity: 'low'
329
- };
330
- } else {
331
- return {
332
- name: 'GenericService',
333
- type: 'service',
334
- responsibility: 'Handle general business logic',
335
- interfaces: [
336
- 'IService'
337
- ],
338
- dependencies: [
339
- 'CommonUtilities'
340
- ],
341
- patterns: [
342
- 'Service'
343
- ],
344
- complexity: 'low'
345
- };
346
- }
251
+ */
252
+ createComponentFromRequirement(requirement) {
253
+ const reqLower = requirement.toLowerCase();
254
+
255
+ if (reqLower.includes('api')) {
256
+ return {
257
+ name: 'APIController',
258
+ type: 'controller',
259
+ responsibility: 'Handle API requests and responses',
260
+ interfaces: ['HTTP', 'REST'],
261
+ dependencies: ['AuthenticationService', 'ValidationService'],
262
+ patterns: ['Controller', 'Facade'],
263
+ complexity: 'medium',
264
+ };
265
+ } else if (reqLower.includes('authenticate')) {
266
+ return {
267
+ name: 'AuthenticationService',
268
+ type: 'service',
269
+ responsibility: 'Manage user authentication and authorization',
270
+ interfaces: ['IAuthenticationService'],
271
+ dependencies: ['UserRepository', 'TokenManager'],
272
+ patterns: ['Service', 'Strategy'],
273
+ complexity: 'high',
274
+ };
275
+ } else if (reqLower.includes('data')) {
276
+ return {
277
+ name: 'DataRepository',
278
+ type: 'repository',
279
+ responsibility: 'Manage data persistence and retrieval',
280
+ interfaces: ['IRepository'],
281
+ dependencies: ['DatabaseConnection', 'DataMapper'],
282
+ patterns: ['Repository', 'Unit of Work'],
283
+ complexity: 'medium',
284
+ };
285
+ } else if (reqLower.includes('validate')) {
286
+ return {
287
+ name: 'ValidationService',
288
+ type: 'service',
289
+ responsibility: 'Validate input data and business rules',
290
+ interfaces: ['IValidationService'],
291
+ dependencies: ['ValidationRules', 'ErrorHandler'],
292
+ patterns: ['Strategy', 'Chain of Responsibility'],
293
+ complexity: 'low',
294
+ };
295
+ } else {
296
+ return {
297
+ name: 'GenericService',
298
+ type: 'service',
299
+ responsibility: 'Handle general business logic',
300
+ interfaces: ['IService'],
301
+ dependencies: ['CommonUtilities'],
302
+ patterns: ['Service'],
303
+ complexity: 'low',
304
+ };
347
305
  }
348
- /**
306
+ }
307
+
308
+ /**
349
309
  * Create component from function
350
- */ createComponentFromFunction(func) {
351
- return {
352
- name: this.toPascalCase(func.function) + 'Component',
353
- type: 'component',
354
- responsibility: func.description,
355
- interfaces: [
356
- `I${this.toPascalCase(func.function)}`
357
- ],
358
- dependencies: this.extractDependencies(func.steps),
359
- patterns: this.inferPatterns(func.steps),
360
- complexity: func.complexity ? func.complexity.level : 'medium'
361
- };
362
- }
363
- /**
310
+ */
311
+ createComponentFromFunction(func) {
312
+ return {
313
+ name: this.toPascalCase(func.function) + 'Component',
314
+ type: 'component',
315
+ responsibility: func.description,
316
+ interfaces: [`I${this.toPascalCase(func.function)}`],
317
+ dependencies: this.extractDependencies(func.steps),
318
+ patterns: this.inferPatterns(func.steps),
319
+ complexity: func.complexity ? func.complexity.level : 'medium',
320
+ };
321
+ }
322
+
323
+ /**
364
324
  * Create infrastructure components
365
- */ createInfrastructureComponents() {
366
- return [
367
- {
368
- name: 'Logger',
369
- type: 'utility',
370
- responsibility: 'Centralized logging and monitoring',
371
- interfaces: [
372
- 'ILogger'
373
- ],
374
- dependencies: [
375
- 'LoggingProvider'
376
- ],
377
- patterns: [
378
- 'Singleton',
379
- 'Factory'
380
- ],
381
- complexity: 'low'
382
- },
383
- {
384
- name: 'ConfigurationManager',
385
- type: 'utility',
386
- responsibility: 'Manage application configuration',
387
- interfaces: [
388
- 'IConfigurationManager'
389
- ],
390
- dependencies: [
391
- 'EnvironmentProvider'
392
- ],
393
- patterns: [
394
- 'Singleton'
395
- ],
396
- complexity: 'low'
397
- },
398
- {
399
- name: 'ErrorHandler',
400
- type: 'utility',
401
- responsibility: 'Global error handling and reporting',
402
- interfaces: [
403
- 'IErrorHandler'
404
- ],
405
- dependencies: [
406
- 'Logger'
407
- ],
408
- patterns: [
409
- 'Strategy',
410
- 'Chain of Responsibility'
411
- ],
412
- complexity: 'medium'
413
- },
414
- {
415
- name: 'CacheManager',
416
- type: 'utility',
417
- responsibility: 'Caching and performance optimization',
418
- interfaces: [
419
- 'ICacheManager'
420
- ],
421
- dependencies: [
422
- 'CacheProvider'
423
- ],
424
- patterns: [
425
- 'Proxy',
426
- 'Decorator'
427
- ],
428
- complexity: 'medium'
429
- }
430
- ];
431
- }
432
- /**
325
+ */
326
+ createInfrastructureComponents() {
327
+ return [
328
+ {
329
+ name: 'Logger',
330
+ type: 'utility',
331
+ responsibility: 'Centralized logging and monitoring',
332
+ interfaces: ['ILogger'],
333
+ dependencies: ['LoggingProvider'],
334
+ patterns: ['Singleton', 'Factory'],
335
+ complexity: 'low',
336
+ },
337
+ {
338
+ name: 'ConfigurationManager',
339
+ type: 'utility',
340
+ responsibility: 'Manage application configuration',
341
+ interfaces: ['IConfigurationManager'],
342
+ dependencies: ['EnvironmentProvider'],
343
+ patterns: ['Singleton'],
344
+ complexity: 'low',
345
+ },
346
+ {
347
+ name: 'ErrorHandler',
348
+ type: 'utility',
349
+ responsibility: 'Global error handling and reporting',
350
+ interfaces: ['IErrorHandler'],
351
+ dependencies: ['Logger'],
352
+ patterns: ['Strategy', 'Chain of Responsibility'],
353
+ complexity: 'medium',
354
+ },
355
+ {
356
+ name: 'CacheManager',
357
+ type: 'utility',
358
+ responsibility: 'Caching and performance optimization',
359
+ interfaces: ['ICacheManager'],
360
+ dependencies: ['CacheProvider'],
361
+ patterns: ['Proxy', 'Decorator'],
362
+ complexity: 'medium',
363
+ },
364
+ ];
365
+ }
366
+
367
+ /**
433
368
  * Merge similar components
434
- */ mergeComponents(components) {
435
- const componentMap = new Map();
436
- for (const component of components){
437
- const key = component.name;
438
- if (componentMap.has(key)) {
439
- const existing = componentMap.get(key);
440
- // Merge dependencies and interfaces
441
- existing.dependencies = [
442
- ...new Set([
443
- ...existing.dependencies,
444
- ...component.dependencies
445
- ])
446
- ];
447
- existing.interfaces = [
448
- ...new Set([
449
- ...existing.interfaces,
450
- ...component.interfaces
451
- ])
452
- ];
453
- existing.patterns = [
454
- ...new Set([
455
- ...existing.patterns,
456
- ...component.patterns
457
- ])
458
- ];
459
- } else {
460
- componentMap.set(key, component);
461
- }
462
- }
463
- return Array.from(componentMap.values());
369
+ */
370
+ mergeComponents(components) {
371
+ const componentMap = new Map();
372
+
373
+ for (const component of components) {
374
+ const key = component.name;
375
+
376
+ if (componentMap.has(key)) {
377
+ const existing = componentMap.get(key);
378
+ // Merge dependencies and interfaces
379
+ existing.dependencies = [...new Set([...existing.dependencies, ...component.dependencies])];
380
+ existing.interfaces = [...new Set([...existing.interfaces, ...component.interfaces])];
381
+ existing.patterns = [...new Set([...existing.patterns, ...component.patterns])];
382
+ } else {
383
+ componentMap.set(key, component);
384
+ }
464
385
  }
465
- /**
386
+
387
+ return Array.from(componentMap.values());
388
+ }
389
+
390
+ /**
466
391
  * Convert to PascalCase
467
- */ toPascalCase(str) {
468
- return str.replace(/_([a-z])/g, (match, letter)=>letter.toUpperCase()).replace(/^([a-z])/, (match, letter)=>letter.toUpperCase());
469
- }
470
- /**
392
+ */
393
+ toPascalCase(str) {
394
+ return str
395
+ .replace(/_([a-z])/g, (match, letter) => letter.toUpperCase())
396
+ .replace(/^([a-z])/, (match, letter) => letter.toUpperCase());
397
+ }
398
+
399
+ /**
471
400
  * Extract dependencies from steps
472
- */ extractDependencies(steps) {
473
- const dependencies = [];
474
- for (const step of steps){
475
- if (step.includes('database')) dependencies.push('DatabaseConnection');
476
- if (step.includes('authenticate')) dependencies.push('AuthenticationService');
477
- if (step.includes('validate')) dependencies.push('ValidationService');
478
- if (step.includes('log')) dependencies.push('Logger');
479
- if (step.includes('cache')) dependencies.push('CacheManager');
480
- }
481
- return [
482
- ...new Set(dependencies)
483
- ];
401
+ */
402
+ extractDependencies(steps) {
403
+ const dependencies = [];
404
+
405
+ for (const step of steps) {
406
+ if (step.includes('database')) dependencies.push('DatabaseConnection');
407
+ if (step.includes('authenticate')) dependencies.push('AuthenticationService');
408
+ if (step.includes('validate')) dependencies.push('ValidationService');
409
+ if (step.includes('log')) dependencies.push('Logger');
410
+ if (step.includes('cache')) dependencies.push('CacheManager');
484
411
  }
485
- /**
412
+
413
+ return [...new Set(dependencies)];
414
+ }
415
+
416
+ /**
486
417
  * Infer patterns from steps
487
- */ inferPatterns(steps) {
488
- const patterns = [];
489
- if (steps.some((step)=>step.includes('CALL'))) patterns.push('Command');
490
- if (steps.some((step)=>step.includes('IF'))) patterns.push('Strategy');
491
- if (steps.some((step)=>step.includes('VALIDATE'))) patterns.push('Chain of Responsibility');
492
- if (steps.some((step)=>step.includes('RETURN'))) patterns.push('Factory');
493
- return patterns.length > 0 ? patterns : [
494
- 'Service'
495
- ];
496
- }
497
- /**
418
+ */
419
+ inferPatterns(steps) {
420
+ const patterns = [];
421
+
422
+ if (steps.some((step) => step.includes('CALL'))) patterns.push('Command');
423
+ if (steps.some((step) => step.includes('IF'))) patterns.push('Strategy');
424
+ if (steps.some((step) => step.includes('VALIDATE'))) patterns.push('Chain of Responsibility');
425
+ if (steps.some((step) => step.includes('RETURN'))) patterns.push('Factory');
426
+
427
+ return patterns.length > 0 ? patterns : ['Service'];
428
+ }
429
+
430
+ /**
498
431
  * Select design patterns
499
- */ async selectDesignPatterns(specification, pseudocode) {
500
- const patterns = [];
501
- const requirements = specification.requirements || [];
502
- // Creational patterns
503
- if (requirements.some((req)=>req.toLowerCase().includes('create') || req.toLowerCase().includes('instantiate'))) {
504
- patterns.push({
505
- name: 'Factory Pattern',
506
- type: 'creational',
507
- purpose: 'Create objects without specifying exact classes',
508
- applicability: 'Object creation with varying configurations',
509
- implementation: 'Factory classes with creation methods',
510
- benefits: [
511
- 'Loose coupling',
512
- 'Easy extensibility',
513
- 'Centralized creation logic'
514
- ]
515
- });
516
- }
517
- // Structural patterns
518
- if (requirements.some((req)=>req.toLowerCase().includes('interface') || req.toLowerCase().includes('adapt'))) {
519
- patterns.push({
520
- name: 'Adapter Pattern',
521
- type: 'structural',
522
- purpose: 'Allow incompatible interfaces to work together',
523
- applicability: 'Integration with external systems',
524
- implementation: 'Wrapper classes implementing target interfaces',
525
- benefits: [
526
- 'Code reuse',
527
- 'Separation of concerns',
528
- 'Easy integration'
529
- ]
530
- });
531
- }
532
- // Behavioral patterns
533
- if (requirements.some((req)=>req.toLowerCase().includes('strategy') || req.toLowerCase().includes('algorithm'))) {
534
- patterns.push({
535
- name: 'Strategy Pattern',
536
- type: 'behavioral',
537
- purpose: 'Define family of algorithms and make them interchangeable',
538
- applicability: 'Multiple ways to perform operations',
539
- implementation: 'Strategy interfaces with concrete implementations',
540
- benefits: [
541
- 'Flexibility',
542
- 'Open/closed principle',
543
- 'Runtime selection'
544
- ]
545
- });
546
- }
547
- // Common patterns for all systems
548
- patterns.push({
549
- name: 'Repository Pattern',
550
- type: 'architectural',
551
- purpose: 'Separate data access logic from business logic',
552
- applicability: 'Data persistence operations',
553
- implementation: 'Repository interfaces with concrete implementations',
554
- benefits: [
555
- 'Testability',
556
- 'Loose coupling',
557
- 'Centralized data access'
558
- ]
559
- });
560
- patterns.push({
561
- name: 'Dependency Injection',
562
- type: 'architectural',
563
- purpose: 'Manage dependencies between objects',
564
- applicability: 'All components requiring external dependencies',
565
- implementation: 'Constructor injection with DI container',
566
- benefits: [
567
- 'Testability',
568
- 'Loose coupling',
569
- 'Flexibility'
570
- ]
571
- });
572
- patterns.push({
573
- name: 'Observer Pattern',
574
- type: 'behavioral',
575
- purpose: 'Notify multiple objects about state changes',
576
- applicability: 'Event-driven communication',
577
- implementation: 'Subject-observer relationships with event notifications',
578
- benefits: [
579
- 'Loose coupling',
580
- 'Dynamic relationships',
581
- 'Broadcast communication'
582
- ]
583
- });
584
- return patterns;
432
+ */
433
+ async selectDesignPatterns(specification, pseudocode) {
434
+ const patterns = [];
435
+ const requirements = specification.requirements || [];
436
+
437
+ // Creational patterns
438
+ if (
439
+ requirements.some(
440
+ (req) => req.toLowerCase().includes('create') || req.toLowerCase().includes('instantiate'),
441
+ )
442
+ ) {
443
+ patterns.push({
444
+ name: 'Factory Pattern',
445
+ type: 'creational',
446
+ purpose: 'Create objects without specifying exact classes',
447
+ applicability: 'Object creation with varying configurations',
448
+ implementation: 'Factory classes with creation methods',
449
+ benefits: ['Loose coupling', 'Easy extensibility', 'Centralized creation logic'],
450
+ });
585
451
  }
586
- /**
452
+
453
+ // Structural patterns
454
+ if (
455
+ requirements.some(
456
+ (req) => req.toLowerCase().includes('interface') || req.toLowerCase().includes('adapt'),
457
+ )
458
+ ) {
459
+ patterns.push({
460
+ name: 'Adapter Pattern',
461
+ type: 'structural',
462
+ purpose: 'Allow incompatible interfaces to work together',
463
+ applicability: 'Integration with external systems',
464
+ implementation: 'Wrapper classes implementing target interfaces',
465
+ benefits: ['Code reuse', 'Separation of concerns', 'Easy integration'],
466
+ });
467
+ }
468
+
469
+ // Behavioral patterns
470
+ if (
471
+ requirements.some(
472
+ (req) => req.toLowerCase().includes('strategy') || req.toLowerCase().includes('algorithm'),
473
+ )
474
+ ) {
475
+ patterns.push({
476
+ name: 'Strategy Pattern',
477
+ type: 'behavioral',
478
+ purpose: 'Define family of algorithms and make them interchangeable',
479
+ applicability: 'Multiple ways to perform operations',
480
+ implementation: 'Strategy interfaces with concrete implementations',
481
+ benefits: ['Flexibility', 'Open/closed principle', 'Runtime selection'],
482
+ });
483
+ }
484
+
485
+ // Common patterns for all systems
486
+ patterns.push({
487
+ name: 'Repository Pattern',
488
+ type: 'architectural',
489
+ purpose: 'Separate data access logic from business logic',
490
+ applicability: 'Data persistence operations',
491
+ implementation: 'Repository interfaces with concrete implementations',
492
+ benefits: ['Testability', 'Loose coupling', 'Centralized data access'],
493
+ });
494
+
495
+ patterns.push({
496
+ name: 'Dependency Injection',
497
+ type: 'architectural',
498
+ purpose: 'Manage dependencies between objects',
499
+ applicability: 'All components requiring external dependencies',
500
+ implementation: 'Constructor injection with DI container',
501
+ benefits: ['Testability', 'Loose coupling', 'Flexibility'],
502
+ });
503
+
504
+ patterns.push({
505
+ name: 'Observer Pattern',
506
+ type: 'behavioral',
507
+ purpose: 'Notify multiple objects about state changes',
508
+ applicability: 'Event-driven communication',
509
+ implementation: 'Subject-observer relationships with event notifications',
510
+ benefits: ['Loose coupling', 'Dynamic relationships', 'Broadcast communication'],
511
+ });
512
+
513
+ return patterns;
514
+ }
515
+
516
+ /**
587
517
  * Design data model
588
- */ async designDataModel(specification) {
589
- const dataModel = {
590
- entities: [],
591
- relationships: [],
592
- constraints: [],
593
- indexes: [],
594
- views: []
595
- };
596
- // Extract entities from requirements
597
- const requirements = specification.requirements || [];
598
- const entities = this.extractEntities(requirements);
599
- for (const entityName of entities){
600
- const entity = {
601
- name: entityName,
602
- attributes: this.generateAttributes(entityName),
603
- primaryKey: 'id',
604
- foreignKeys: [],
605
- constraints: this.generateConstraints(entityName),
606
- indexes: this.generateIndexes(entityName)
607
- };
608
- dataModel.entities.push(entity);
609
- }
610
- // Define relationships
611
- dataModel.relationships = this.defineRelationships(dataModel.entities);
612
- // Define global constraints
613
- dataModel.constraints = this.defineGlobalConstraints();
614
- // Define indexes
615
- dataModel.indexes = this.defineGlobalIndexes(dataModel.entities);
616
- // Define views
617
- dataModel.views = this.defineViews(dataModel.entities);
618
- return dataModel;
518
+ */
519
+ async designDataModel(specification) {
520
+ const dataModel = {
521
+ entities: [],
522
+ relationships: [],
523
+ constraints: [],
524
+ indexes: [],
525
+ views: [],
526
+ };
527
+
528
+ // Extract entities from requirements
529
+ const requirements = specification.requirements || [];
530
+ const entities = this.extractEntities(requirements);
531
+
532
+ for (const entityName of entities) {
533
+ const entity = {
534
+ name: entityName,
535
+ attributes: this.generateAttributes(entityName),
536
+ primaryKey: 'id',
537
+ foreignKeys: [],
538
+ constraints: this.generateConstraints(entityName),
539
+ indexes: this.generateIndexes(entityName),
540
+ };
541
+
542
+ dataModel.entities.push(entity);
619
543
  }
620
- /**
544
+
545
+ // Define relationships
546
+ dataModel.relationships = this.defineRelationships(dataModel.entities);
547
+
548
+ // Define global constraints
549
+ dataModel.constraints = this.defineGlobalConstraints();
550
+
551
+ // Define indexes
552
+ dataModel.indexes = this.defineGlobalIndexes(dataModel.entities);
553
+
554
+ // Define views
555
+ dataModel.views = this.defineViews(dataModel.entities);
556
+
557
+ return dataModel;
558
+ }
559
+
560
+ /**
621
561
  * Extract entities from requirements
622
- */ extractEntities(requirements) {
623
- const entities = new Set();
624
- for (const requirement of requirements){
625
- const words = requirement.split(' ');
626
- for (const word of words){
627
- // Look for nouns that could be entities
628
- if (word.length > 3 && ![
629
- 'system',
630
- 'must',
631
- 'should',
632
- 'will',
633
- 'data',
634
- 'user',
635
- 'interface'
636
- ].includes(word.toLowerCase())) {
637
- if (word[0] === word[0].toUpperCase()) {
638
- entities.add(word);
639
- }
640
- }
641
- }
642
- }
643
- // Add default entities if none found
644
- if (entities.size === 0) {
645
- entities.add('User');
646
- entities.add('Session');
647
- entities.add('Configuration');
562
+ */
563
+ extractEntities(requirements) {
564
+ const entities = new Set();
565
+
566
+ for (const requirement of requirements) {
567
+ const words = requirement.split(' ');
568
+
569
+ for (const word of words) {
570
+ // Look for nouns that could be entities
571
+ if (
572
+ word.length > 3 &&
573
+ !['system', 'must', 'should', 'will', 'data', 'user', 'interface'].includes(
574
+ word.toLowerCase(),
575
+ )
576
+ ) {
577
+ if (word[0] === word[0].toUpperCase()) {
578
+ entities.add(word);
579
+ }
648
580
  }
649
- return Array.from(entities);
581
+ }
582
+ }
583
+
584
+ // Add default entities if none found
585
+ if (entities.size === 0) {
586
+ entities.add('User');
587
+ entities.add('Session');
588
+ entities.add('Configuration');
650
589
  }
651
- /**
590
+
591
+ return Array.from(entities);
592
+ }
593
+
594
+ /**
652
595
  * Generate attributes for entity
653
- */ generateAttributes(entityName) {
654
- const commonAttributes = [
655
- {
656
- name: 'id',
657
- type: 'UUID',
658
- nullable: false,
659
- unique: true
660
- },
661
- {
662
- name: 'created_at',
663
- type: 'TIMESTAMP',
664
- nullable: false,
665
- default: 'CURRENT_TIMESTAMP'
666
- },
667
- {
668
- name: 'updated_at',
669
- type: 'TIMESTAMP',
670
- nullable: false,
671
- default: 'CURRENT_TIMESTAMP'
672
- },
673
- {
674
- name: 'version',
675
- type: 'INTEGER',
676
- nullable: false,
677
- default: '1'
678
- }
679
- ];
680
- const specificAttributes = [];
681
- const entityLower = entityName.toLowerCase();
682
- if (entityLower.includes('user')) {
683
- specificAttributes.push({
684
- name: 'username',
685
- type: 'VARCHAR(50)',
686
- nullable: false,
687
- unique: true
688
- }, {
689
- name: 'email',
690
- type: 'VARCHAR(255)',
691
- nullable: false,
692
- unique: true
693
- }, {
694
- name: 'password_hash',
695
- type: 'VARCHAR(255)',
696
- nullable: false
697
- }, {
698
- name: 'is_active',
699
- type: 'BOOLEAN',
700
- nullable: false,
701
- default: 'true'
702
- }, {
703
- name: 'last_login',
704
- type: 'TIMESTAMP',
705
- nullable: true
706
- });
707
- } else if (entityLower.includes('session')) {
708
- specificAttributes.push({
709
- name: 'user_id',
710
- type: 'UUID',
711
- nullable: false
712
- }, {
713
- name: 'token',
714
- type: 'VARCHAR(255)',
715
- nullable: false,
716
- unique: true
717
- }, {
718
- name: 'expires_at',
719
- type: 'TIMESTAMP',
720
- nullable: false
721
- }, {
722
- name: 'ip_address',
723
- type: 'INET',
724
- nullable: true
725
- }, {
726
- name: 'user_agent',
727
- type: 'TEXT',
728
- nullable: true
729
- });
730
- } else {
731
- specificAttributes.push({
732
- name: 'name',
733
- type: 'VARCHAR(255)',
734
- nullable: false
735
- }, {
736
- name: 'description',
737
- type: 'TEXT',
738
- nullable: true
739
- }, {
740
- name: 'status',
741
- type: 'VARCHAR(50)',
742
- nullable: false,
743
- default: "'active'"
744
- });
745
- }
746
- return [
747
- ...commonAttributes,
748
- ...specificAttributes
749
- ];
596
+ */
597
+ generateAttributes(entityName) {
598
+ const commonAttributes = [
599
+ { name: 'id', type: 'UUID', nullable: false, unique: true },
600
+ { name: 'created_at', type: 'TIMESTAMP', nullable: false, default: 'CURRENT_TIMESTAMP' },
601
+ { name: 'updated_at', type: 'TIMESTAMP', nullable: false, default: 'CURRENT_TIMESTAMP' },
602
+ { name: 'version', type: 'INTEGER', nullable: false, default: '1' },
603
+ ];
604
+
605
+ const specificAttributes = [];
606
+ const entityLower = entityName.toLowerCase();
607
+
608
+ if (entityLower.includes('user')) {
609
+ specificAttributes.push(
610
+ { name: 'username', type: 'VARCHAR(50)', nullable: false, unique: true },
611
+ { name: 'email', type: 'VARCHAR(255)', nullable: false, unique: true },
612
+ { name: 'password_hash', type: 'VARCHAR(255)', nullable: false },
613
+ { name: 'is_active', type: 'BOOLEAN', nullable: false, default: 'true' },
614
+ { name: 'last_login', type: 'TIMESTAMP', nullable: true },
615
+ );
616
+ } else if (entityLower.includes('session')) {
617
+ specificAttributes.push(
618
+ { name: 'user_id', type: 'UUID', nullable: false },
619
+ { name: 'token', type: 'VARCHAR(255)', nullable: false, unique: true },
620
+ { name: 'expires_at', type: 'TIMESTAMP', nullable: false },
621
+ { name: 'ip_address', type: 'INET', nullable: true },
622
+ { name: 'user_agent', type: 'TEXT', nullable: true },
623
+ );
624
+ } else {
625
+ specificAttributes.push(
626
+ { name: 'name', type: 'VARCHAR(255)', nullable: false },
627
+ { name: 'description', type: 'TEXT', nullable: true },
628
+ { name: 'status', type: 'VARCHAR(50)', nullable: false, default: "'active'" },
629
+ );
750
630
  }
751
- /**
631
+
632
+ return [...commonAttributes, ...specificAttributes];
633
+ }
634
+
635
+ /**
752
636
  * Generate constraints for entity
753
- */ generateConstraints(entityName) {
754
- const constraints = [
755
- {
756
- name: `${entityName.toLowerCase()}_id_pk`,
757
- type: 'PRIMARY KEY',
758
- column: 'id'
759
- },
760
- {
761
- name: `${entityName.toLowerCase()}_version_positive`,
762
- type: 'CHECK',
763
- condition: 'version > 0'
764
- },
765
- {
766
- name: `${entityName.toLowerCase()}_created_before_updated`,
767
- type: 'CHECK',
768
- condition: 'created_at <= updated_at'
769
- }
770
- ];
771
- const entityLower = entityName.toLowerCase();
772
- if (entityLower.includes('user')) {
773
- constraints.push({
774
- name: 'user_email_format',
775
- type: 'CHECK',
776
- condition: "email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$'"
777
- }, {
778
- name: 'user_username_length',
779
- type: 'CHECK',
780
- condition: 'length(username) >= 3'
781
- });
782
- }
783
- return constraints;
637
+ */
638
+ generateConstraints(entityName) {
639
+ const constraints = [
640
+ { name: `${entityName.toLowerCase()}_id_pk`, type: 'PRIMARY KEY', column: 'id' },
641
+ {
642
+ name: `${entityName.toLowerCase()}_version_positive`,
643
+ type: 'CHECK',
644
+ condition: 'version > 0',
645
+ },
646
+ {
647
+ name: `${entityName.toLowerCase()}_created_before_updated`,
648
+ type: 'CHECK',
649
+ condition: 'created_at <= updated_at',
650
+ },
651
+ ];
652
+
653
+ const entityLower = entityName.toLowerCase();
654
+
655
+ if (entityLower.includes('user')) {
656
+ constraints.push(
657
+ {
658
+ name: 'user_email_format',
659
+ type: 'CHECK',
660
+ condition: "email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$'",
661
+ },
662
+ { name: 'user_username_length', type: 'CHECK', condition: 'length(username) >= 3' },
663
+ );
784
664
  }
785
- /**
665
+
666
+ return constraints;
667
+ }
668
+
669
+ /**
786
670
  * Generate indexes for entity
787
- */ generateIndexes(entityName) {
788
- const indexes = [
789
- {
790
- name: `idx_${entityName.toLowerCase()}_created_at`,
791
- type: 'BTREE',
792
- columns: [
793
- 'created_at'
794
- ]
795
- },
796
- {
797
- name: `idx_${entityName.toLowerCase()}_updated_at`,
798
- type: 'BTREE',
799
- columns: [
800
- 'updated_at'
801
- ]
802
- }
803
- ];
804
- const entityLower = entityName.toLowerCase();
805
- if (entityLower.includes('user')) {
806
- indexes.push({
807
- name: 'idx_user_email',
808
- type: 'BTREE',
809
- columns: [
810
- 'email'
811
- ]
812
- }, {
813
- name: 'idx_user_username',
814
- type: 'BTREE',
815
- columns: [
816
- 'username'
817
- ]
818
- }, {
819
- name: 'idx_user_active',
820
- type: 'BTREE',
821
- columns: [
822
- 'is_active'
823
- ]
824
- });
825
- }
826
- return indexes;
671
+ */
672
+ generateIndexes(entityName) {
673
+ const indexes = [
674
+ {
675
+ name: `idx_${entityName.toLowerCase()}_created_at`,
676
+ type: 'BTREE',
677
+ columns: ['created_at'],
678
+ },
679
+ {
680
+ name: `idx_${entityName.toLowerCase()}_updated_at`,
681
+ type: 'BTREE',
682
+ columns: ['updated_at'],
683
+ },
684
+ ];
685
+
686
+ const entityLower = entityName.toLowerCase();
687
+
688
+ if (entityLower.includes('user')) {
689
+ indexes.push(
690
+ { name: 'idx_user_email', type: 'BTREE', columns: ['email'] },
691
+ { name: 'idx_user_username', type: 'BTREE', columns: ['username'] },
692
+ { name: 'idx_user_active', type: 'BTREE', columns: ['is_active'] },
693
+ );
827
694
  }
828
- /**
695
+
696
+ return indexes;
697
+ }
698
+
699
+ /**
829
700
  * Define relationships between entities
830
- */ defineRelationships(entities) {
831
- const relationships = [];
832
- // Look for entities that could have relationships
833
- const userEntity = entities.find((e)=>e.name.toLowerCase().includes('user'));
834
- const sessionEntity = entities.find((e)=>e.name.toLowerCase().includes('session'));
835
- if (userEntity && sessionEntity) {
836
- relationships.push({
837
- name: 'user_sessions',
838
- type: 'one-to-many',
839
- parent: userEntity.name,
840
- child: sessionEntity.name,
841
- parentKey: 'id',
842
- childKey: 'user_id',
843
- onDelete: 'CASCADE',
844
- onUpdate: 'RESTRICT'
845
- });
846
- }
847
- return relationships;
701
+ */
702
+ defineRelationships(entities) {
703
+ const relationships = [];
704
+
705
+ // Look for entities that could have relationships
706
+ const userEntity = entities.find((e) => e.name.toLowerCase().includes('user'));
707
+ const sessionEntity = entities.find((e) => e.name.toLowerCase().includes('session'));
708
+
709
+ if (userEntity && sessionEntity) {
710
+ relationships.push({
711
+ name: 'user_sessions',
712
+ type: 'one-to-many',
713
+ parent: userEntity.name,
714
+ child: sessionEntity.name,
715
+ parentKey: 'id',
716
+ childKey: 'user_id',
717
+ onDelete: 'CASCADE',
718
+ onUpdate: 'RESTRICT',
719
+ });
848
720
  }
849
- /**
721
+
722
+ return relationships;
723
+ }
724
+
725
+ /**
850
726
  * Define global constraints
851
- */ defineGlobalConstraints() {
852
- return [
853
- {
854
- name: 'no_future_created_at',
855
- type: 'CHECK',
856
- condition: 'created_at <= CURRENT_TIMESTAMP'
857
- },
858
- {
859
- name: 'no_future_updated_at',
860
- type: 'CHECK',
861
- condition: 'updated_at <= CURRENT_TIMESTAMP'
862
- }
863
- ];
864
- }
865
- /**
727
+ */
728
+ defineGlobalConstraints() {
729
+ return [
730
+ { name: 'no_future_created_at', type: 'CHECK', condition: 'created_at <= CURRENT_TIMESTAMP' },
731
+ { name: 'no_future_updated_at', type: 'CHECK', condition: 'updated_at <= CURRENT_TIMESTAMP' },
732
+ ];
733
+ }
734
+
735
+ /**
866
736
  * Define global indexes
867
- */ defineGlobalIndexes(entities) {
868
- const indexes = [];
869
- // Add composite indexes for common query patterns
870
- for (const entity of entities){
871
- indexes.push({
872
- name: `idx_${entity.name.toLowerCase()}_status_created`,
873
- type: 'BTREE',
874
- table: entity.name,
875
- columns: [
876
- 'status',
877
- 'created_at'
878
- ]
879
- });
880
- }
881
- return indexes;
737
+ */
738
+ defineGlobalIndexes(entities) {
739
+ const indexes = [];
740
+
741
+ // Add composite indexes for common query patterns
742
+ for (const entity of entities) {
743
+ indexes.push({
744
+ name: `idx_${entity.name.toLowerCase()}_status_created`,
745
+ type: 'BTREE',
746
+ table: entity.name,
747
+ columns: ['status', 'created_at'],
748
+ });
882
749
  }
883
- /**
750
+
751
+ return indexes;
752
+ }
753
+
754
+ /**
884
755
  * Define views
885
- */ defineViews(entities) {
886
- const views = [];
887
- // Create a view for active entities
888
- for (const entity of entities){
889
- if (entity.attributes.some((attr)=>attr.name === 'is_active' || attr.name === 'status')) {
890
- views.push({
891
- name: `active_${entity.name.toLowerCase()}s`,
892
- definition: `SELECT * FROM ${entity.name} WHERE ${entity.attributes.some((attr)=>attr.name === 'is_active') ? 'is_active = true' : "status = 'active'"}`,
893
- purpose: `Show only active ${entity.name.toLowerCase()} records`
894
- });
895
- }
896
- }
897
- return views;
756
+ */
757
+ defineViews(entities) {
758
+ const views = [];
759
+
760
+ // Create a view for active entities
761
+ for (const entity of entities) {
762
+ if (entity.attributes.some((attr) => attr.name === 'is_active' || attr.name === 'status')) {
763
+ views.push({
764
+ name: `active_${entity.name.toLowerCase()}s`,
765
+ definition: `SELECT * FROM ${entity.name} WHERE ${entity.attributes.some((attr) => attr.name === 'is_active') ? 'is_active = true' : "status = 'active'"}`,
766
+ purpose: `Show only active ${entity.name.toLowerCase()} records`,
767
+ });
768
+ }
898
769
  }
899
- /**
770
+
771
+ return views;
772
+ }
773
+
774
+ /**
900
775
  * Design API structure
901
- */ async designApiStructure(specification) {
902
- const apiDesign = {
903
- version: 'v1',
904
- baseUrl: '/api/v1',
905
- authentication: 'Bearer Token',
906
- endpoints: [],
907
- schemas: [],
908
- errorHandling: {},
909
- rateLimiting: {},
910
- versioning: {}
911
- };
912
- // Generate endpoints based on requirements
913
- const requirements = specification.requirements || [];
914
- for (const requirement of requirements){
915
- if (requirement.toLowerCase().includes('api')) {
916
- const endpoints = this.generateEndpoints(requirement);
917
- apiDesign.endpoints.push(...endpoints);
918
- }
919
- }
920
- // Generate schemas
921
- apiDesign.schemas = this.generateApiSchemas(apiDesign.endpoints);
922
- // Define error handling
923
- apiDesign.errorHandling = this.defineApiErrorHandling();
924
- // Define rate limiting
925
- apiDesign.rateLimiting = this.defineApiRateLimiting();
926
- // Define versioning strategy
927
- apiDesign.versioning = this.defineApiVersioning();
928
- return apiDesign;
776
+ */
777
+ async designApiStructure(specification) {
778
+ const apiDesign = {
779
+ version: 'v1',
780
+ baseUrl: '/api/v1',
781
+ authentication: 'Bearer Token',
782
+ endpoints: [],
783
+ schemas: [],
784
+ errorHandling: {},
785
+ rateLimiting: {},
786
+ versioning: {},
787
+ };
788
+
789
+ // Generate endpoints based on requirements
790
+ const requirements = specification.requirements || [];
791
+
792
+ for (const requirement of requirements) {
793
+ if (requirement.toLowerCase().includes('api')) {
794
+ const endpoints = this.generateEndpoints(requirement);
795
+ apiDesign.endpoints.push(...endpoints);
796
+ }
929
797
  }
930
- /**
798
+
799
+ // Generate schemas
800
+ apiDesign.schemas = this.generateApiSchemas(apiDesign.endpoints);
801
+
802
+ // Define error handling
803
+ apiDesign.errorHandling = this.defineApiErrorHandling();
804
+
805
+ // Define rate limiting
806
+ apiDesign.rateLimiting = this.defineApiRateLimiting();
807
+
808
+ // Define versioning strategy
809
+ apiDesign.versioning = this.defineApiVersioning();
810
+
811
+ return apiDesign;
812
+ }
813
+
814
+ /**
931
815
  * Generate endpoints from requirement
932
- */ generateEndpoints(requirement) {
933
- const endpoints = [];
934
- // Basic CRUD endpoints
935
- endpoints.push({
936
- path: '/resources',
937
- method: 'GET',
938
- summary: 'List all resources',
939
- parameters: [
940
- {
941
- name: 'page',
942
- type: 'integer',
943
- description: 'Page number'
944
- },
945
- {
946
- name: 'limit',
947
- type: 'integer',
948
- description: 'Items per page'
949
- },
950
- {
951
- name: 'sort',
952
- type: 'string',
953
- description: 'Sort field'
954
- }
955
- ],
956
- responses: {
957
- 200: {
958
- description: 'Success',
959
- schema: 'ResourceList'
960
- },
961
- 400: {
962
- description: 'Bad Request',
963
- schema: 'Error'
964
- },
965
- 401: {
966
- description: 'Unauthorized',
967
- schema: 'Error'
968
- }
969
- }
970
- }, {
971
- path: '/resources/{id}',
972
- method: 'GET',
973
- summary: 'Get resource by ID',
974
- parameters: [
975
- {
976
- name: 'id',
977
- type: 'string',
978
- description: 'Resource ID',
979
- required: true
980
- }
981
- ],
982
- responses: {
983
- 200: {
984
- description: 'Success',
985
- schema: 'Resource'
986
- },
987
- 404: {
988
- description: 'Not Found',
989
- schema: 'Error'
990
- },
991
- 401: {
992
- description: 'Unauthorized',
993
- schema: 'Error'
994
- }
995
- }
996
- }, {
997
- path: '/resources',
998
- method: 'POST',
999
- summary: 'Create new resource',
1000
- requestBody: {
1001
- schema: 'CreateResourceRequest'
1002
- },
1003
- responses: {
1004
- 201: {
1005
- description: 'Created',
1006
- schema: 'Resource'
1007
- },
1008
- 400: {
1009
- description: 'Bad Request',
1010
- schema: 'Error'
1011
- },
1012
- 401: {
1013
- description: 'Unauthorized',
1014
- schema: 'Error'
1015
- }
1016
- }
1017
- }, {
1018
- path: '/resources/{id}',
1019
- method: 'PUT',
1020
- summary: 'Update resource',
1021
- parameters: [
1022
- {
1023
- name: 'id',
1024
- type: 'string',
1025
- description: 'Resource ID',
1026
- required: true
1027
- }
1028
- ],
1029
- requestBody: {
1030
- schema: 'UpdateResourceRequest'
1031
- },
1032
- responses: {
1033
- 200: {
1034
- description: 'Updated',
1035
- schema: 'Resource'
1036
- },
1037
- 404: {
1038
- description: 'Not Found',
1039
- schema: 'Error'
1040
- },
1041
- 400: {
1042
- description: 'Bad Request',
1043
- schema: 'Error'
1044
- },
1045
- 401: {
1046
- description: 'Unauthorized',
1047
- schema: 'Error'
1048
- }
1049
- }
1050
- }, {
1051
- path: '/resources/{id}',
1052
- method: 'DELETE',
1053
- summary: 'Delete resource',
1054
- parameters: [
1055
- {
1056
- name: 'id',
1057
- type: 'string',
1058
- description: 'Resource ID',
1059
- required: true
1060
- }
1061
- ],
1062
- responses: {
1063
- 204: {
1064
- description: 'Deleted'
1065
- },
1066
- 404: {
1067
- description: 'Not Found',
1068
- schema: 'Error'
1069
- },
1070
- 401: {
1071
- description: 'Unauthorized',
1072
- schema: 'Error'
1073
- }
1074
- }
1075
- });
1076
- return endpoints;
1077
- }
1078
- /**
816
+ */
817
+ generateEndpoints(requirement) {
818
+ const endpoints = [];
819
+
820
+ // Basic CRUD endpoints
821
+ endpoints.push(
822
+ {
823
+ path: '/resources',
824
+ method: 'GET',
825
+ summary: 'List all resources',
826
+ parameters: [
827
+ { name: 'page', type: 'integer', description: 'Page number' },
828
+ { name: 'limit', type: 'integer', description: 'Items per page' },
829
+ { name: 'sort', type: 'string', description: 'Sort field' },
830
+ ],
831
+ responses: {
832
+ 200: { description: 'Success', schema: 'ResourceList' },
833
+ 400: { description: 'Bad Request', schema: 'Error' },
834
+ 401: { description: 'Unauthorized', schema: 'Error' },
835
+ },
836
+ },
837
+ {
838
+ path: '/resources/{id}',
839
+ method: 'GET',
840
+ summary: 'Get resource by ID',
841
+ parameters: [{ name: 'id', type: 'string', description: 'Resource ID', required: true }],
842
+ responses: {
843
+ 200: { description: 'Success', schema: 'Resource' },
844
+ 404: { description: 'Not Found', schema: 'Error' },
845
+ 401: { description: 'Unauthorized', schema: 'Error' },
846
+ },
847
+ },
848
+ {
849
+ path: '/resources',
850
+ method: 'POST',
851
+ summary: 'Create new resource',
852
+ requestBody: { schema: 'CreateResourceRequest' },
853
+ responses: {
854
+ 201: { description: 'Created', schema: 'Resource' },
855
+ 400: { description: 'Bad Request', schema: 'Error' },
856
+ 401: { description: 'Unauthorized', schema: 'Error' },
857
+ },
858
+ },
859
+ {
860
+ path: '/resources/{id}',
861
+ method: 'PUT',
862
+ summary: 'Update resource',
863
+ parameters: [{ name: 'id', type: 'string', description: 'Resource ID', required: true }],
864
+ requestBody: { schema: 'UpdateResourceRequest' },
865
+ responses: {
866
+ 200: { description: 'Updated', schema: 'Resource' },
867
+ 404: { description: 'Not Found', schema: 'Error' },
868
+ 400: { description: 'Bad Request', schema: 'Error' },
869
+ 401: { description: 'Unauthorized', schema: 'Error' },
870
+ },
871
+ },
872
+ {
873
+ path: '/resources/{id}',
874
+ method: 'DELETE',
875
+ summary: 'Delete resource',
876
+ parameters: [{ name: 'id', type: 'string', description: 'Resource ID', required: true }],
877
+ responses: {
878
+ 204: { description: 'Deleted' },
879
+ 404: { description: 'Not Found', schema: 'Error' },
880
+ 401: { description: 'Unauthorized', schema: 'Error' },
881
+ },
882
+ },
883
+ );
884
+
885
+ return endpoints;
886
+ }
887
+
888
+ /**
1079
889
  * Generate API schemas
1080
- */ generateApiSchemas(endpoints) {
1081
- const schemas = [];
1082
- // Basic resource schema
1083
- schemas.push({
1084
- name: 'Resource',
1085
- type: 'object',
1086
- properties: {
1087
- id: {
1088
- type: 'string',
1089
- format: 'uuid'
1090
- },
1091
- name: {
1092
- type: 'string'
1093
- },
1094
- description: {
1095
- type: 'string'
1096
- },
1097
- status: {
1098
- type: 'string',
1099
- enum: [
1100
- 'active',
1101
- 'inactive'
1102
- ]
1103
- },
1104
- created_at: {
1105
- type: 'string',
1106
- format: 'date-time'
1107
- },
1108
- updated_at: {
1109
- type: 'string',
1110
- format: 'date-time'
1111
- }
1112
- },
1113
- required: [
1114
- 'id',
1115
- 'name',
1116
- 'status'
1117
- ]
1118
- });
1119
- // Resource list schema
1120
- schemas.push({
1121
- name: 'ResourceList',
1122
- type: 'object',
1123
- properties: {
1124
- data: {
1125
- type: 'array',
1126
- items: {
1127
- $ref: '#/schemas/Resource'
1128
- }
1129
- },
1130
- pagination: {
1131
- type: 'object',
1132
- properties: {
1133
- page: {
1134
- type: 'integer'
1135
- },
1136
- limit: {
1137
- type: 'integer'
1138
- },
1139
- total: {
1140
- type: 'integer'
1141
- },
1142
- pages: {
1143
- type: 'integer'
1144
- }
1145
- }
1146
- }
1147
- }
1148
- });
1149
- // Error schema
1150
- schemas.push({
1151
- name: 'Error',
1152
- type: 'object',
1153
- properties: {
1154
- error: {
1155
- type: 'string'
1156
- },
1157
- message: {
1158
- type: 'string'
1159
- },
1160
- details: {
1161
- type: 'array',
1162
- items: {
1163
- type: 'string'
1164
- }
1165
- },
1166
- timestamp: {
1167
- type: 'string',
1168
- format: 'date-time'
1169
- }
1170
- },
1171
- required: [
1172
- 'error',
1173
- 'message'
1174
- ]
1175
- });
1176
- return schemas;
1177
- }
1178
- /**
890
+ */
891
+ generateApiSchemas(endpoints) {
892
+ const schemas = [];
893
+
894
+ // Basic resource schema
895
+ schemas.push({
896
+ name: 'Resource',
897
+ type: 'object',
898
+ properties: {
899
+ id: { type: 'string', format: 'uuid' },
900
+ name: { type: 'string' },
901
+ description: { type: 'string' },
902
+ status: { type: 'string', enum: ['active', 'inactive'] },
903
+ created_at: { type: 'string', format: 'date-time' },
904
+ updated_at: { type: 'string', format: 'date-time' },
905
+ },
906
+ required: ['id', 'name', 'status'],
907
+ });
908
+
909
+ // Resource list schema
910
+ schemas.push({
911
+ name: 'ResourceList',
912
+ type: 'object',
913
+ properties: {
914
+ data: { type: 'array', items: { $ref: '#/schemas/Resource' } },
915
+ pagination: {
916
+ type: 'object',
917
+ properties: {
918
+ page: { type: 'integer' },
919
+ limit: { type: 'integer' },
920
+ total: { type: 'integer' },
921
+ pages: { type: 'integer' },
922
+ },
923
+ },
924
+ },
925
+ });
926
+
927
+ // Error schema
928
+ schemas.push({
929
+ name: 'Error',
930
+ type: 'object',
931
+ properties: {
932
+ error: { type: 'string' },
933
+ message: { type: 'string' },
934
+ details: { type: 'array', items: { type: 'string' } },
935
+ timestamp: { type: 'string', format: 'date-time' },
936
+ },
937
+ required: ['error', 'message'],
938
+ });
939
+
940
+ return schemas;
941
+ }
942
+
943
+ /**
1179
944
  * Define API error handling
1180
- */ defineApiErrorHandling() {
1181
- return {
1182
- strategy: 'Consistent error responses with proper HTTP status codes',
1183
- errorCodes: {
1184
- 400: 'Bad Request - Invalid input data',
1185
- 401: 'Unauthorized - Authentication required',
1186
- 403: 'Forbidden - Insufficient permissions',
1187
- 404: 'Not Found - Resource not found',
1188
- 409: 'Conflict - Resource already exists',
1189
- 422: 'Unprocessable Entity - Validation errors',
1190
- 429: 'Too Many Requests - Rate limit exceeded',
1191
- 500: 'Internal Server Error - Server error',
1192
- 503: 'Service Unavailable - Service temporarily unavailable'
1193
- },
1194
- errorFormat: {
1195
- error: 'Error type',
1196
- message: 'Human-readable error message',
1197
- details: 'Array of specific error details',
1198
- timestamp: 'ISO 8601 timestamp'
1199
- },
1200
- logging: 'All errors logged with request ID and stack trace'
1201
- };
1202
- }
1203
- /**
945
+ */
946
+ defineApiErrorHandling() {
947
+ return {
948
+ strategy: 'Consistent error responses with proper HTTP status codes',
949
+ errorCodes: {
950
+ 400: 'Bad Request - Invalid input data',
951
+ 401: 'Unauthorized - Authentication required',
952
+ 403: 'Forbidden - Insufficient permissions',
953
+ 404: 'Not Found - Resource not found',
954
+ 409: 'Conflict - Resource already exists',
955
+ 422: 'Unprocessable Entity - Validation errors',
956
+ 429: 'Too Many Requests - Rate limit exceeded',
957
+ 500: 'Internal Server Error - Server error',
958
+ 503: 'Service Unavailable - Service temporarily unavailable',
959
+ },
960
+ errorFormat: {
961
+ error: 'Error type',
962
+ message: 'Human-readable error message',
963
+ details: 'Array of specific error details',
964
+ timestamp: 'ISO 8601 timestamp',
965
+ },
966
+ logging: 'All errors logged with request ID and stack trace',
967
+ };
968
+ }
969
+
970
+ /**
1204
971
  * Define API rate limiting
1205
- */ defineApiRateLimiting() {
1206
- return {
1207
- strategy: 'Token bucket algorithm with per-user and per-IP limits',
1208
- limits: {
1209
- authenticated: {
1210
- requests: 1000,
1211
- window: '1 hour'
1212
- },
1213
- anonymous: {
1214
- requests: 100,
1215
- window: '1 hour'
1216
- },
1217
- burst: {
1218
- requests: 10,
1219
- window: '1 minute'
1220
- }
1221
- },
1222
- headers: {
1223
- 'X-RateLimit-Limit': 'Request limit for current window',
1224
- 'X-RateLimit-Remaining': 'Remaining requests in current window',
1225
- 'X-RateLimit-Reset': 'Unix timestamp when limit resets'
1226
- },
1227
- handling: 'Return 429 status with retry-after header'
1228
- };
1229
- }
1230
- /**
972
+ */
973
+ defineApiRateLimiting() {
974
+ return {
975
+ strategy: 'Token bucket algorithm with per-user and per-IP limits',
976
+ limits: {
977
+ authenticated: { requests: 1000, window: '1 hour' },
978
+ anonymous: { requests: 100, window: '1 hour' },
979
+ burst: { requests: 10, window: '1 minute' },
980
+ },
981
+ headers: {
982
+ 'X-RateLimit-Limit': 'Request limit for current window',
983
+ 'X-RateLimit-Remaining': 'Remaining requests in current window',
984
+ 'X-RateLimit-Reset': 'Unix timestamp when limit resets',
985
+ },
986
+ handling: 'Return 429 status with retry-after header',
987
+ };
988
+ }
989
+
990
+ /**
1231
991
  * Define API versioning
1232
- */ defineApiVersioning() {
1233
- return {
1234
- strategy: 'URL path versioning with backward compatibility',
1235
- format: '/api/v{major}',
1236
- lifecycle: {
1237
- development: 'Active development with breaking changes',
1238
- stable: 'Stable API with backward compatibility',
1239
- deprecated: 'Deprecated with migration guide',
1240
- retired: 'No longer supported'
1241
- },
1242
- migration: 'Gradual migration with parallel support periods'
1243
- };
1244
- }
1245
- /**
992
+ */
993
+ defineApiVersioning() {
994
+ return {
995
+ strategy: 'URL path versioning with backward compatibility',
996
+ format: '/api/v{major}',
997
+ lifecycle: {
998
+ development: 'Active development with breaking changes',
999
+ stable: 'Stable API with backward compatibility',
1000
+ deprecated: 'Deprecated with migration guide',
1001
+ retired: 'No longer supported',
1002
+ },
1003
+ migration: 'Gradual migration with parallel support periods',
1004
+ };
1005
+ }
1006
+
1007
+ /**
1246
1008
  * Plan deployment architecture
1247
- */ async planDeploymentArchitecture(specification) {
1248
- const deployment = {
1249
- strategy: 'containerized',
1250
- environments: [],
1251
- infrastructure: {},
1252
- monitoring: {},
1253
- security: {},
1254
- scalability: {}
1255
- };
1256
- // Define environments
1257
- deployment.environments = [
1258
- {
1259
- name: 'development',
1260
- purpose: 'Development and testing',
1261
- resources: 'Single node with shared resources',
1262
- database: 'SQLite or embedded database',
1263
- monitoring: 'Basic logging'
1264
- },
1265
- {
1266
- name: 'staging',
1267
- purpose: 'Pre-production testing',
1268
- resources: 'Production-like environment with reduced capacity',
1269
- database: 'Managed database service',
1270
- monitoring: 'Full monitoring stack'
1271
- },
1272
- {
1273
- name: 'production',
1274
- purpose: 'Live application serving users',
1275
- resources: 'Multiple nodes with load balancing',
1276
- database: 'High-availability managed database',
1277
- monitoring: 'Comprehensive monitoring and alerting'
1278
- }
1279
- ];
1280
- // Define infrastructure
1281
- deployment.infrastructure = {
1282
- platform: 'Container orchestration (Kubernetes/Docker Swarm)',
1283
- compute: 'Auto-scaling container instances',
1284
- storage: 'Persistent volumes with backup',
1285
- networking: 'Load balancer with SSL termination',
1286
- dns: 'Managed DNS with health checks'
1287
- };
1288
- // Define monitoring
1289
- deployment.monitoring = {
1290
- metrics: 'Application and infrastructure metrics',
1291
- logging: 'Centralized logging with log aggregation',
1292
- tracing: 'Distributed tracing for request flow',
1293
- alerting: 'Multi-channel alerting for critical issues',
1294
- dashboards: 'Real-time dashboards for system health'
1295
- };
1296
- // Define security
1297
- deployment.security = {
1298
- secrets: 'Encrypted secrets management',
1299
- network: 'Network policies and firewall rules',
1300
- access: 'Role-based access control',
1301
- scanning: 'Container and dependency vulnerability scanning',
1302
- compliance: 'Security compliance monitoring'
1303
- };
1304
- // Define scalability
1305
- deployment.scalability = {
1306
- horizontal: 'Auto-scaling based on CPU/memory/requests',
1307
- vertical: 'Resource limits and requests optimization',
1308
- database: 'Database scaling with read replicas',
1309
- caching: 'Multi-layer caching strategy',
1310
- cdn: 'Content delivery network for static assets'
1311
- };
1312
- return deployment;
1313
- }
1314
- /**
1009
+ */
1010
+ async planDeploymentArchitecture(specification) {
1011
+ const deployment = {
1012
+ strategy: 'containerized',
1013
+ environments: [],
1014
+ infrastructure: {},
1015
+ monitoring: {},
1016
+ security: {},
1017
+ scalability: {},
1018
+ };
1019
+
1020
+ // Define environments
1021
+ deployment.environments = [
1022
+ {
1023
+ name: 'development',
1024
+ purpose: 'Development and testing',
1025
+ resources: 'Single node with shared resources',
1026
+ database: 'SQLite or embedded database',
1027
+ monitoring: 'Basic logging',
1028
+ },
1029
+ {
1030
+ name: 'staging',
1031
+ purpose: 'Pre-production testing',
1032
+ resources: 'Production-like environment with reduced capacity',
1033
+ database: 'Managed database service',
1034
+ monitoring: 'Full monitoring stack',
1035
+ },
1036
+ {
1037
+ name: 'production',
1038
+ purpose: 'Live application serving users',
1039
+ resources: 'Multiple nodes with load balancing',
1040
+ database: 'High-availability managed database',
1041
+ monitoring: 'Comprehensive monitoring and alerting',
1042
+ },
1043
+ ];
1044
+
1045
+ // Define infrastructure
1046
+ deployment.infrastructure = {
1047
+ platform: 'Container orchestration (Kubernetes/Docker Swarm)',
1048
+ compute: 'Auto-scaling container instances',
1049
+ storage: 'Persistent volumes with backup',
1050
+ networking: 'Load balancer with SSL termination',
1051
+ dns: 'Managed DNS with health checks',
1052
+ };
1053
+
1054
+ // Define monitoring
1055
+ deployment.monitoring = {
1056
+ metrics: 'Application and infrastructure metrics',
1057
+ logging: 'Centralized logging with log aggregation',
1058
+ tracing: 'Distributed tracing for request flow',
1059
+ alerting: 'Multi-channel alerting for critical issues',
1060
+ dashboards: 'Real-time dashboards for system health',
1061
+ };
1062
+
1063
+ // Define security
1064
+ deployment.security = {
1065
+ secrets: 'Encrypted secrets management',
1066
+ network: 'Network policies and firewall rules',
1067
+ access: 'Role-based access control',
1068
+ scanning: 'Container and dependency vulnerability scanning',
1069
+ compliance: 'Security compliance monitoring',
1070
+ };
1071
+
1072
+ // Define scalability
1073
+ deployment.scalability = {
1074
+ horizontal: 'Auto-scaling based on CPU/memory/requests',
1075
+ vertical: 'Resource limits and requests optimization',
1076
+ database: 'Database scaling with read replicas',
1077
+ caching: 'Multi-layer caching strategy',
1078
+ cdn: 'Content delivery network for static assets',
1079
+ };
1080
+
1081
+ return deployment;
1082
+ }
1083
+
1084
+ /**
1315
1085
  * Design security architecture
1316
- */ async designSecurityArchitecture(specification) {
1317
- const security = {
1318
- authentication: {},
1319
- authorization: {},
1320
- dataProtection: {},
1321
- networkSecurity: {},
1322
- monitoring: {},
1323
- compliance: {}
1324
- };
1325
- // Authentication design
1326
- security.authentication = {
1327
- mechanism: 'JWT tokens with refresh token rotation',
1328
- providers: [
1329
- 'Local credentials',
1330
- 'OAuth2/OpenID Connect'
1331
- ],
1332
- session: 'Stateless with secure token storage',
1333
- mfa: 'Multi-factor authentication for sensitive operations',
1334
- passwordPolicy: 'Strong password requirements with complexity rules'
1335
- };
1336
- // Authorization design
1337
- security.authorization = {
1338
- model: 'Role-based access control (RBAC)',
1339
- permissions: 'Fine-grained permissions with resource-level access',
1340
- policies: 'Attribute-based access control for complex rules',
1341
- delegation: 'Secure delegation with time-limited tokens',
1342
- auditing: 'Complete audit trail of access decisions'
1343
- };
1344
- // Data protection design
1345
- security.dataProtection = {
1346
- encryption: {
1347
- atRest: 'AES-256 encryption for stored data',
1348
- inTransit: 'TLS 1.3 for all network communication',
1349
- keys: 'Hardware security module or managed key service'
1350
- },
1351
- privacy: {
1352
- pii: 'Personal information identification and protection',
1353
- anonymization: 'Data anonymization for analytics',
1354
- retention: 'Data retention policies with automatic deletion'
1355
- },
1356
- backup: {
1357
- encryption: 'Encrypted backups with separate key management',
1358
- testing: 'Regular backup restoration testing',
1359
- offsite: 'Geographically distributed backup storage'
1360
- }
1361
- };
1362
- // Network security design
1363
- security.networkSecurity = {
1364
- firewall: 'Web application firewall with DDoS protection',
1365
- segmentation: 'Network segmentation with micro-segmentation',
1366
- monitoring: 'Network traffic monitoring and analysis',
1367
- vpn: 'VPN access for administrative operations',
1368
- certificates: 'Automated certificate management and renewal'
1369
- };
1370
- // Security monitoring design
1371
- security.monitoring = {
1372
- siem: 'Security information and event management',
1373
- ids: 'Intrusion detection and prevention systems',
1374
- behavior: 'User and entity behavior analytics',
1375
- threat: 'Threat intelligence integration',
1376
- incident: 'Automated incident response workflows'
1377
- };
1378
- // Compliance design
1379
- security.compliance = {
1380
- frameworks: [
1381
- 'GDPR',
1382
- 'SOC 2',
1383
- 'ISO 27001'
1384
- ],
1385
- auditing: 'Regular security audits and penetration testing',
1386
- documentation: 'Security policies and procedures documentation',
1387
- training: 'Security awareness training for all personnel',
1388
- reporting: 'Compliance reporting and evidence collection'
1389
- };
1390
- return security;
1391
- }
1392
- /**
1086
+ */
1087
+ async designSecurityArchitecture(specification) {
1088
+ const security = {
1089
+ authentication: {},
1090
+ authorization: {},
1091
+ dataProtection: {},
1092
+ networkSecurity: {},
1093
+ monitoring: {},
1094
+ compliance: {},
1095
+ };
1096
+
1097
+ // Authentication design
1098
+ security.authentication = {
1099
+ mechanism: 'JWT tokens with refresh token rotation',
1100
+ providers: ['Local credentials', 'OAuth2/OpenID Connect'],
1101
+ session: 'Stateless with secure token storage',
1102
+ mfa: 'Multi-factor authentication for sensitive operations',
1103
+ passwordPolicy: 'Strong password requirements with complexity rules',
1104
+ };
1105
+
1106
+ // Authorization design
1107
+ security.authorization = {
1108
+ model: 'Role-based access control (RBAC)',
1109
+ permissions: 'Fine-grained permissions with resource-level access',
1110
+ policies: 'Attribute-based access control for complex rules',
1111
+ delegation: 'Secure delegation with time-limited tokens',
1112
+ auditing: 'Complete audit trail of access decisions',
1113
+ };
1114
+
1115
+ // Data protection design
1116
+ security.dataProtection = {
1117
+ encryption: {
1118
+ atRest: 'AES-256 encryption for stored data',
1119
+ inTransit: 'TLS 1.3 for all network communication',
1120
+ keys: 'Hardware security module or managed key service',
1121
+ },
1122
+ privacy: {
1123
+ pii: 'Personal information identification and protection',
1124
+ anonymization: 'Data anonymization for analytics',
1125
+ retention: 'Data retention policies with automatic deletion',
1126
+ },
1127
+ backup: {
1128
+ encryption: 'Encrypted backups with separate key management',
1129
+ testing: 'Regular backup restoration testing',
1130
+ offsite: 'Geographically distributed backup storage',
1131
+ },
1132
+ };
1133
+
1134
+ // Network security design
1135
+ security.networkSecurity = {
1136
+ firewall: 'Web application firewall with DDoS protection',
1137
+ segmentation: 'Network segmentation with micro-segmentation',
1138
+ monitoring: 'Network traffic monitoring and analysis',
1139
+ vpn: 'VPN access for administrative operations',
1140
+ certificates: 'Automated certificate management and renewal',
1141
+ };
1142
+
1143
+ // Security monitoring design
1144
+ security.monitoring = {
1145
+ siem: 'Security information and event management',
1146
+ ids: 'Intrusion detection and prevention systems',
1147
+ behavior: 'User and entity behavior analytics',
1148
+ threat: 'Threat intelligence integration',
1149
+ incident: 'Automated incident response workflows',
1150
+ };
1151
+
1152
+ // Compliance design
1153
+ security.compliance = {
1154
+ frameworks: ['GDPR', 'SOC 2', 'ISO 27001'],
1155
+ auditing: 'Regular security audits and penetration testing',
1156
+ documentation: 'Security policies and procedures documentation',
1157
+ training: 'Security awareness training for all personnel',
1158
+ reporting: 'Compliance reporting and evidence collection',
1159
+ };
1160
+
1161
+ return security;
1162
+ }
1163
+
1164
+ /**
1393
1165
  * Plan scalability
1394
- */ async planScalability(specification) {
1395
- const scalability = {
1396
- horizontalScaling: {},
1397
- verticalScaling: {},
1398
- dataScaling: {},
1399
- performanceOptimization: {},
1400
- monitoring: {}
1401
- };
1402
- // Horizontal scaling plan
1403
- scalability.horizontalScaling = {
1404
- strategy: 'Auto-scaling based on demand metrics',
1405
- triggers: [
1406
- 'CPU utilization > 70%',
1407
- 'Memory utilization > 80%',
1408
- 'Request queue length > 10'
1409
- ],
1410
- limits: {
1411
- minimum: 2,
1412
- maximum: 20,
1413
- scaleUpRate: 2,
1414
- scaleDownRate: 1
1415
- },
1416
- loadBalancing: 'Round-robin with health checks',
1417
- sessionAffinity: 'Stateless design with external session storage'
1418
- };
1419
- // Vertical scaling plan
1420
- scalability.verticalScaling = {
1421
- strategy: 'Resource optimization based on usage patterns',
1422
- monitoring: 'Continuous resource utilization monitoring',
1423
- recommendations: 'Automated resource recommendation engine',
1424
- limits: 'Resource limits to prevent resource exhaustion',
1425
- optimization: 'Container resource optimization'
1426
- };
1427
- // Data scaling plan
1428
- scalability.dataScaling = {
1429
- database: {
1430
- readReplicas: 'Read replicas for read-heavy workloads',
1431
- sharding: 'Database sharding for large datasets',
1432
- caching: 'Multi-layer caching with Redis/Memcached',
1433
- indexing: 'Optimized indexing strategies'
1434
- },
1435
- storage: {
1436
- tiering: 'Storage tiering based on access patterns',
1437
- compression: 'Data compression for storage efficiency',
1438
- archiving: 'Automatic archiving of old data',
1439
- partitioning: 'Data partitioning for improved performance'
1440
- }
1441
- };
1442
- // Performance optimization plan
1443
- scalability.performanceOptimization = {
1444
- caching: {
1445
- application: 'In-memory application caching',
1446
- database: 'Database query result caching',
1447
- cdn: 'Content delivery network for static assets',
1448
- browser: 'Browser caching with appropriate headers'
1449
- },
1450
- optimization: {
1451
- queries: 'Database query optimization',
1452
- algorithms: 'Algorithm complexity optimization',
1453
- resources: 'Resource usage optimization',
1454
- networking: 'Network latency optimization'
1455
- }
1456
- };
1457
- // Monitoring plan
1458
- scalability.monitoring = {
1459
- metrics: [
1460
- 'Response time and latency',
1461
- 'Throughput and requests per second',
1462
- 'Error rates and success rates',
1463
- 'Resource utilization (CPU, memory, disk)',
1464
- 'Database performance metrics'
1465
- ],
1466
- alerting: 'Proactive alerting for performance degradation',
1467
- capacity: 'Capacity planning based on growth projections',
1468
- testing: 'Regular performance testing and load testing'
1469
- };
1470
- return scalability;
1471
- }
1472
- /**
1166
+ */
1167
+ async planScalability(specification) {
1168
+ const scalability = {
1169
+ horizontalScaling: {},
1170
+ verticalScaling: {},
1171
+ dataScaling: {},
1172
+ performanceOptimization: {},
1173
+ monitoring: {},
1174
+ };
1175
+
1176
+ // Horizontal scaling plan
1177
+ scalability.horizontalScaling = {
1178
+ strategy: 'Auto-scaling based on demand metrics',
1179
+ triggers: ['CPU utilization > 70%', 'Memory utilization > 80%', 'Request queue length > 10'],
1180
+ limits: { minimum: 2, maximum: 20, scaleUpRate: 2, scaleDownRate: 1 },
1181
+ loadBalancing: 'Round-robin with health checks',
1182
+ sessionAffinity: 'Stateless design with external session storage',
1183
+ };
1184
+
1185
+ // Vertical scaling plan
1186
+ scalability.verticalScaling = {
1187
+ strategy: 'Resource optimization based on usage patterns',
1188
+ monitoring: 'Continuous resource utilization monitoring',
1189
+ recommendations: 'Automated resource recommendation engine',
1190
+ limits: 'Resource limits to prevent resource exhaustion',
1191
+ optimization: 'Container resource optimization',
1192
+ };
1193
+
1194
+ // Data scaling plan
1195
+ scalability.dataScaling = {
1196
+ database: {
1197
+ readReplicas: 'Read replicas for read-heavy workloads',
1198
+ sharding: 'Database sharding for large datasets',
1199
+ caching: 'Multi-layer caching with Redis/Memcached',
1200
+ indexing: 'Optimized indexing strategies',
1201
+ },
1202
+ storage: {
1203
+ tiering: 'Storage tiering based on access patterns',
1204
+ compression: 'Data compression for storage efficiency',
1205
+ archiving: 'Automatic archiving of old data',
1206
+ partitioning: 'Data partitioning for improved performance',
1207
+ },
1208
+ };
1209
+
1210
+ // Performance optimization plan
1211
+ scalability.performanceOptimization = {
1212
+ caching: {
1213
+ application: 'In-memory application caching',
1214
+ database: 'Database query result caching',
1215
+ cdn: 'Content delivery network for static assets',
1216
+ browser: 'Browser caching with appropriate headers',
1217
+ },
1218
+ optimization: {
1219
+ queries: 'Database query optimization',
1220
+ algorithms: 'Algorithm complexity optimization',
1221
+ resources: 'Resource usage optimization',
1222
+ networking: 'Network latency optimization',
1223
+ },
1224
+ };
1225
+
1226
+ // Monitoring plan
1227
+ scalability.monitoring = {
1228
+ metrics: [
1229
+ 'Response time and latency',
1230
+ 'Throughput and requests per second',
1231
+ 'Error rates and success rates',
1232
+ 'Resource utilization (CPU, memory, disk)',
1233
+ 'Database performance metrics',
1234
+ ],
1235
+ alerting: 'Proactive alerting for performance degradation',
1236
+ capacity: 'Capacity planning based on growth projections',
1237
+ testing: 'Regular performance testing and load testing',
1238
+ };
1239
+
1240
+ return scalability;
1241
+ }
1242
+
1243
+ /**
1473
1244
  * Identify integration points
1474
- */ async identifyIntegrationPoints(specification) {
1475
- const integrations = [];
1476
- const requirements = specification.requirements || [];
1477
- // Analyze requirements for integration needs
1478
- for (const requirement of requirements){
1479
- const reqLower = requirement.toLowerCase();
1480
- if (reqLower.includes('external') || reqLower.includes('third-party')) {
1481
- integrations.push({
1482
- name: 'External API Integration',
1483
- type: 'REST API',
1484
- purpose: 'Integrate with external services',
1485
- protocol: 'HTTPS',
1486
- authentication: 'API Key or OAuth2',
1487
- dataFormat: 'JSON',
1488
- errorHandling: 'Retry with exponential backoff',
1489
- monitoring: 'API health checks and response time monitoring'
1490
- });
1491
- }
1492
- if (reqLower.includes('database') || reqLower.includes('data')) {
1493
- integrations.push({
1494
- name: 'Database Integration',
1495
- type: 'Database',
1496
- purpose: 'Data persistence and retrieval',
1497
- protocol: 'Database-specific protocol',
1498
- authentication: 'Connection string with credentials',
1499
- dataFormat: 'SQL or NoSQL',
1500
- errorHandling: 'Connection pooling and retry logic',
1501
- monitoring: 'Database performance and connection monitoring'
1502
- });
1503
- }
1504
- if (reqLower.includes('message') || reqLower.includes('event')) {
1505
- integrations.push({
1506
- name: 'Message Queue Integration',
1507
- type: 'Message Queue',
1508
- purpose: 'Asynchronous communication',
1509
- protocol: 'AMQP or proprietary',
1510
- authentication: 'Queue-specific authentication',
1511
- dataFormat: 'JSON or Binary',
1512
- errorHandling: 'Dead letter queues and retry policies',
1513
- monitoring: 'Queue depth and processing time monitoring'
1514
- });
1515
- }
1516
- }
1517
- // Add common integrations
1245
+ */
1246
+ async identifyIntegrationPoints(specification) {
1247
+ const integrations = [];
1248
+ const requirements = specification.requirements || [];
1249
+
1250
+ // Analyze requirements for integration needs
1251
+ for (const requirement of requirements) {
1252
+ const reqLower = requirement.toLowerCase();
1253
+
1254
+ if (reqLower.includes('external') || reqLower.includes('third-party')) {
1518
1255
  integrations.push({
1519
- name: 'Logging Integration',
1520
- type: 'Logging Service',
1521
- purpose: 'Centralized logging and monitoring',
1522
- protocol: 'HTTP/HTTPS',
1523
- authentication: 'API Key',
1524
- dataFormat: 'Structured logs (JSON)',
1525
- errorHandling: 'Local buffering with batch sending',
1526
- monitoring: 'Log ingestion and processing monitoring'
1256
+ name: 'External API Integration',
1257
+ type: 'REST API',
1258
+ purpose: 'Integrate with external services',
1259
+ protocol: 'HTTPS',
1260
+ authentication: 'API Key or OAuth2',
1261
+ dataFormat: 'JSON',
1262
+ errorHandling: 'Retry with exponential backoff',
1263
+ monitoring: 'API health checks and response time monitoring',
1527
1264
  });
1528
- return integrations;
1529
- }
1530
- /**
1531
- * Define quality attributes
1532
- */ async defineQualityAttributes(specification) {
1533
- return {
1534
- performance: {
1535
- responseTime: 'API responses under 200ms for 95th percentile',
1536
- throughput: 'Handle 1000+ requests per second',
1537
- scalability: 'Scale horizontally to handle load increases',
1538
- efficiency: 'Optimize resource usage and minimize waste'
1539
- },
1540
- reliability: {
1541
- availability: '99.9% uptime with planned maintenance windows',
1542
- faultTolerance: 'Graceful degradation when components fail',
1543
- recoverability: 'Automatic recovery from transient failures',
1544
- durability: 'Data persistence with backup and recovery'
1545
- },
1546
- security: {
1547
- confidentiality: 'Protect sensitive data with encryption',
1548
- integrity: 'Ensure data accuracy and prevent tampering',
1549
- authentication: 'Verify user identity before access',
1550
- authorization: 'Control access based on user permissions'
1551
- },
1552
- usability: {
1553
- learnability: 'Intuitive interfaces requiring minimal training',
1554
- efficiency: 'Allow experienced users to work efficiently',
1555
- memorability: 'Easy to remember after periods of non-use',
1556
- errors: 'Minimize user errors and provide clear error messages'
1557
- },
1558
- maintainability: {
1559
- modifiability: 'Easy to modify and extend functionality',
1560
- testability: 'Comprehensive test coverage and automated testing',
1561
- reusability: 'Modular design with reusable components',
1562
- analyzability: 'Clear code structure and documentation'
1563
- }
1564
- };
1565
- }
1566
- /**
1567
- * Document architectural decisions
1568
- */ async documentArchitecturalDecisions(result) {
1569
- const decisions = [];
1570
- // Architecture style decision
1571
- decisions.push({
1572
- id: 'AD-001',
1573
- title: `Use ${result.systemDesign.style} Architecture`,
1574
- status: 'Accepted',
1575
- context: 'Need to choose appropriate architectural style for the system',
1576
- decision: `Implement ${result.systemDesign.style} architecture with ${result.systemDesign.layers.length} layers`,
1577
- consequences: {
1578
- positive: [
1579
- 'Clear separation of concerns',
1580
- 'Maintainable code structure',
1581
- 'Scalable design'
1582
- ],
1583
- negative: [
1584
- 'Potential performance overhead',
1585
- 'Added complexity for simple operations'
1586
- ]
1587
- },
1588
- alternatives: [
1589
- 'Monolithic',
1590
- 'Microservices',
1591
- 'Event-driven'
1592
- ],
1593
- date: new Date().toISOString()
1594
- });
1595
- // Design patterns decision
1596
- decisions.push({
1597
- id: 'AD-002',
1598
- title: 'Apply Standard Design Patterns',
1599
- status: 'Accepted',
1600
- context: 'Need to ensure consistent and well-understood design patterns',
1601
- decision: `Implement ${result.designPatterns.length} design patterns including Repository, Factory, and Strategy patterns`,
1602
- consequences: {
1603
- positive: [
1604
- 'Improved code maintainability',
1605
- 'Better testability',
1606
- 'Consistent design approach'
1607
- ],
1608
- negative: [
1609
- 'Learning curve for developers',
1610
- 'Potential over-engineering'
1611
- ]
1612
- },
1613
- alternatives: [
1614
- 'Ad-hoc design',
1615
- 'Framework-specific patterns'
1616
- ],
1617
- date: new Date().toISOString()
1265
+ }
1266
+
1267
+ if (reqLower.includes('database') || reqLower.includes('data')) {
1268
+ integrations.push({
1269
+ name: 'Database Integration',
1270
+ type: 'Database',
1271
+ purpose: 'Data persistence and retrieval',
1272
+ protocol: 'Database-specific protocol',
1273
+ authentication: 'Connection string with credentials',
1274
+ dataFormat: 'SQL or NoSQL',
1275
+ errorHandling: 'Connection pooling and retry logic',
1276
+ monitoring: 'Database performance and connection monitoring',
1618
1277
  });
1619
- // Data model decision
1620
- decisions.push({
1621
- id: 'AD-003',
1622
- title: 'Relational Database Design',
1623
- status: 'Accepted',
1624
- context: 'Need to choose appropriate data storage and modeling approach',
1625
- decision: `Use relational database with ${result.dataModel.entities.length} entities and normalized schema`,
1626
- consequences: {
1627
- positive: [
1628
- 'ACID compliance',
1629
- 'Strong consistency',
1630
- 'Mature ecosystem'
1631
- ],
1632
- negative: [
1633
- 'Potential scalability limitations',
1634
- 'Schema migration complexity'
1635
- ]
1636
- },
1637
- alternatives: [
1638
- 'NoSQL database',
1639
- 'Document database',
1640
- 'Graph database'
1641
- ],
1642
- date: new Date().toISOString()
1278
+ }
1279
+
1280
+ if (reqLower.includes('message') || reqLower.includes('event')) {
1281
+ integrations.push({
1282
+ name: 'Message Queue Integration',
1283
+ type: 'Message Queue',
1284
+ purpose: 'Asynchronous communication',
1285
+ protocol: 'AMQP or proprietary',
1286
+ authentication: 'Queue-specific authentication',
1287
+ dataFormat: 'JSON or Binary',
1288
+ errorHandling: 'Dead letter queues and retry policies',
1289
+ monitoring: 'Queue depth and processing time monitoring',
1643
1290
  });
1644
- return decisions;
1291
+ }
1645
1292
  }
1646
- /**
1293
+
1294
+ // Add common integrations
1295
+ integrations.push({
1296
+ name: 'Logging Integration',
1297
+ type: 'Logging Service',
1298
+ purpose: 'Centralized logging and monitoring',
1299
+ protocol: 'HTTP/HTTPS',
1300
+ authentication: 'API Key',
1301
+ dataFormat: 'Structured logs (JSON)',
1302
+ errorHandling: 'Local buffering with batch sending',
1303
+ monitoring: 'Log ingestion and processing monitoring',
1304
+ });
1305
+
1306
+ return integrations;
1307
+ }
1308
+
1309
+ /**
1310
+ * Define quality attributes
1311
+ */
1312
+ async defineQualityAttributes(specification) {
1313
+ return {
1314
+ performance: {
1315
+ responseTime: 'API responses under 200ms for 95th percentile',
1316
+ throughput: 'Handle 1000+ requests per second',
1317
+ scalability: 'Scale horizontally to handle load increases',
1318
+ efficiency: 'Optimize resource usage and minimize waste',
1319
+ },
1320
+ reliability: {
1321
+ availability: '99.9% uptime with planned maintenance windows',
1322
+ faultTolerance: 'Graceful degradation when components fail',
1323
+ recoverability: 'Automatic recovery from transient failures',
1324
+ durability: 'Data persistence with backup and recovery',
1325
+ },
1326
+ security: {
1327
+ confidentiality: 'Protect sensitive data with encryption',
1328
+ integrity: 'Ensure data accuracy and prevent tampering',
1329
+ authentication: 'Verify user identity before access',
1330
+ authorization: 'Control access based on user permissions',
1331
+ },
1332
+ usability: {
1333
+ learnability: 'Intuitive interfaces requiring minimal training',
1334
+ efficiency: 'Allow experienced users to work efficiently',
1335
+ memorability: 'Easy to remember after periods of non-use',
1336
+ errors: 'Minimize user errors and provide clear error messages',
1337
+ },
1338
+ maintainability: {
1339
+ modifiability: 'Easy to modify and extend functionality',
1340
+ testability: 'Comprehensive test coverage and automated testing',
1341
+ reusability: 'Modular design with reusable components',
1342
+ analyzability: 'Clear code structure and documentation',
1343
+ },
1344
+ };
1345
+ }
1346
+
1347
+ /**
1348
+ * Document architectural decisions
1349
+ */
1350
+ async documentArchitecturalDecisions(result) {
1351
+ const decisions = [];
1352
+
1353
+ // Architecture style decision
1354
+ decisions.push({
1355
+ id: 'AD-001',
1356
+ title: `Use ${result.systemDesign.style} Architecture`,
1357
+ status: 'Accepted',
1358
+ context: 'Need to choose appropriate architectural style for the system',
1359
+ decision: `Implement ${result.systemDesign.style} architecture with ${result.systemDesign.layers.length} layers`,
1360
+ consequences: {
1361
+ positive: [
1362
+ 'Clear separation of concerns',
1363
+ 'Maintainable code structure',
1364
+ 'Scalable design',
1365
+ ],
1366
+ negative: ['Potential performance overhead', 'Added complexity for simple operations'],
1367
+ },
1368
+ alternatives: ['Monolithic', 'Microservices', 'Event-driven'],
1369
+ date: new Date().toISOString(),
1370
+ });
1371
+
1372
+ // Design patterns decision
1373
+ decisions.push({
1374
+ id: 'AD-002',
1375
+ title: 'Apply Standard Design Patterns',
1376
+ status: 'Accepted',
1377
+ context: 'Need to ensure consistent and well-understood design patterns',
1378
+ decision: `Implement ${result.designPatterns.length} design patterns including Repository, Factory, and Strategy patterns`,
1379
+ consequences: {
1380
+ positive: [
1381
+ 'Improved code maintainability',
1382
+ 'Better testability',
1383
+ 'Consistent design approach',
1384
+ ],
1385
+ negative: ['Learning curve for developers', 'Potential over-engineering'],
1386
+ },
1387
+ alternatives: ['Ad-hoc design', 'Framework-specific patterns'],
1388
+ date: new Date().toISOString(),
1389
+ });
1390
+
1391
+ // Data model decision
1392
+ decisions.push({
1393
+ id: 'AD-003',
1394
+ title: 'Relational Database Design',
1395
+ status: 'Accepted',
1396
+ context: 'Need to choose appropriate data storage and modeling approach',
1397
+ decision: `Use relational database with ${result.dataModel.entities.length} entities and normalized schema`,
1398
+ consequences: {
1399
+ positive: ['ACID compliance', 'Strong consistency', 'Mature ecosystem'],
1400
+ negative: ['Potential scalability limitations', 'Schema migration complexity'],
1401
+ },
1402
+ alternatives: ['NoSQL database', 'Document database', 'Graph database'],
1403
+ date: new Date().toISOString(),
1404
+ });
1405
+
1406
+ return decisions;
1407
+ }
1408
+
1409
+ /**
1647
1410
  * Assess architectural risks
1648
- */ async assessArchitecturalRisks(result) {
1649
- const risks = [];
1650
- // Complexity risk
1651
- risks.push({
1652
- id: 'AR-001',
1653
- category: 'Complexity',
1654
- description: 'System complexity may lead to maintenance challenges',
1655
- probability: 'Medium',
1656
- impact: 'High',
1657
- riskLevel: 'High',
1658
- mitigation: [
1659
- 'Implement comprehensive documentation',
1660
- 'Provide developer training',
1661
- 'Establish coding standards',
1662
- 'Regular code reviews'
1663
- ],
1664
- monitoring: 'Code complexity metrics and maintainability index'
1665
- });
1666
- // Performance risk
1667
- risks.push({
1668
- id: 'AR-002',
1669
- category: 'Performance',
1670
- description: 'Layered architecture may introduce performance overhead',
1671
- probability: 'Low',
1672
- impact: 'Medium',
1673
- riskLevel: 'Medium',
1674
- mitigation: [
1675
- 'Performance testing and profiling',
1676
- 'Caching strategies',
1677
- 'Database optimization',
1678
- 'Load balancing'
1679
- ],
1680
- monitoring: 'Response time and throughput monitoring'
1681
- });
1682
- // Security risk
1683
- risks.push({
1684
- id: 'AR-003',
1685
- category: 'Security',
1686
- description: 'Multiple integration points increase attack surface',
1687
- probability: 'Medium',
1688
- impact: 'High',
1689
- riskLevel: 'High',
1690
- mitigation: [
1691
- 'Security architecture review',
1692
- 'Regular security testing',
1693
- 'Input validation and sanitization',
1694
- 'Secure communication protocols'
1695
- ],
1696
- monitoring: 'Security event monitoring and alerting'
1697
- });
1698
- // Scalability risk
1699
- risks.push({
1700
- id: 'AR-004',
1701
- category: 'Scalability',
1702
- description: 'Database may become bottleneck under high load',
1703
- probability: 'Medium',
1704
- impact: 'High',
1705
- riskLevel: 'High',
1706
- mitigation: [
1707
- 'Database optimization',
1708
- 'Read replicas and caching',
1709
- 'Connection pooling',
1710
- 'Horizontal scaling strategies'
1711
- ],
1712
- monitoring: 'Database performance and connection monitoring'
1713
- });
1714
- return risks;
1715
- }
1716
- /**
1411
+ */
1412
+ async assessArchitecturalRisks(result) {
1413
+ const risks = [];
1414
+
1415
+ // Complexity risk
1416
+ risks.push({
1417
+ id: 'AR-001',
1418
+ category: 'Complexity',
1419
+ description: 'System complexity may lead to maintenance challenges',
1420
+ probability: 'Medium',
1421
+ impact: 'High',
1422
+ riskLevel: 'High',
1423
+ mitigation: [
1424
+ 'Implement comprehensive documentation',
1425
+ 'Provide developer training',
1426
+ 'Establish coding standards',
1427
+ 'Regular code reviews',
1428
+ ],
1429
+ monitoring: 'Code complexity metrics and maintainability index',
1430
+ });
1431
+
1432
+ // Performance risk
1433
+ risks.push({
1434
+ id: 'AR-002',
1435
+ category: 'Performance',
1436
+ description: 'Layered architecture may introduce performance overhead',
1437
+ probability: 'Low',
1438
+ impact: 'Medium',
1439
+ riskLevel: 'Medium',
1440
+ mitigation: [
1441
+ 'Performance testing and profiling',
1442
+ 'Caching strategies',
1443
+ 'Database optimization',
1444
+ 'Load balancing',
1445
+ ],
1446
+ monitoring: 'Response time and throughput monitoring',
1447
+ });
1448
+
1449
+ // Security risk
1450
+ risks.push({
1451
+ id: 'AR-003',
1452
+ category: 'Security',
1453
+ description: 'Multiple integration points increase attack surface',
1454
+ probability: 'Medium',
1455
+ impact: 'High',
1456
+ riskLevel: 'High',
1457
+ mitigation: [
1458
+ 'Security architecture review',
1459
+ 'Regular security testing',
1460
+ 'Input validation and sanitization',
1461
+ 'Secure communication protocols',
1462
+ ],
1463
+ monitoring: 'Security event monitoring and alerting',
1464
+ });
1465
+
1466
+ // Scalability risk
1467
+ risks.push({
1468
+ id: 'AR-004',
1469
+ category: 'Scalability',
1470
+ description: 'Database may become bottleneck under high load',
1471
+ probability: 'Medium',
1472
+ impact: 'High',
1473
+ riskLevel: 'High',
1474
+ mitigation: [
1475
+ 'Database optimization',
1476
+ 'Read replicas and caching',
1477
+ 'Connection pooling',
1478
+ 'Horizontal scaling strategies',
1479
+ ],
1480
+ monitoring: 'Database performance and connection monitoring',
1481
+ });
1482
+
1483
+ return risks;
1484
+ }
1485
+
1486
+ /**
1717
1487
  * Generate architecture document
1718
- */ async generateArchitectureDocument(result) {
1719
- const document = `# ${this.taskDescription} - Architecture Design
1488
+ */
1489
+ async generateArchitectureDocument(result) {
1490
+ const document = `# ${this.taskDescription} - Architecture Design
1720
1491
 
1721
1492
  ## System Architecture
1722
1493
 
@@ -1724,26 +1495,36 @@ export class SparcArchitecture extends SparcPhase {
1724
1495
  **Style**: ${result.systemDesign.style}
1725
1496
  **Layers**: ${result.systemDesign.layers.length}
1726
1497
 
1727
- ${result.systemDesign.layers.map((layer, index)=>`
1498
+ ${result.systemDesign.layers
1499
+ .map(
1500
+ (layer, index) => `
1728
1501
  #### ${index + 1}. ${layer.name}
1729
1502
  **Responsibility**: ${layer.responsibility}
1730
- `).join('\n')}
1503
+ `,
1504
+ )
1505
+ .join('\n')}
1731
1506
 
1732
1507
  ### Data Flow
1733
- ${result.systemDesign.dataFlow.map((flow)=>`- ${flow.from} → ${flow.to} (${flow.direction}): ${flow.dataType}`).join('\n')}
1508
+ ${result.systemDesign.dataFlow.map((flow) => `- ${flow.from} → ${flow.to} (${flow.direction}): ${flow.dataType}`).join('\n')}
1734
1509
 
1735
1510
  ### Control Flow
1736
- ${result.systemDesign.controlFlow.map((flow)=>`
1511
+ ${result.systemDesign.controlFlow
1512
+ .map(
1513
+ (flow) => `
1737
1514
  #### ${flow.layer}
1738
1515
  - **Order**: ${flow.order}
1739
1516
  - **Triggers**: ${flow.triggers.join(', ')}
1740
1517
  - **Actions**: ${flow.actions.join(', ')}
1741
1518
  - **Outcomes**: ${flow.outcomes.join(', ')}
1742
- `).join('\n')}
1519
+ `,
1520
+ )
1521
+ .join('\n')}
1743
1522
 
1744
1523
  ## Components
1745
1524
 
1746
- ${result.components.map((component, index)=>`
1525
+ ${result.components
1526
+ .map(
1527
+ (component, index) => `
1747
1528
  ### ${index + 1}. ${component.name}
1748
1529
  **Type**: ${component.type}
1749
1530
  **Responsibility**: ${component.responsibility}
@@ -1751,44 +1532,58 @@ ${result.components.map((component, index)=>`
1751
1532
  **Dependencies**: ${component.dependencies.join(', ')}
1752
1533
  **Patterns**: ${component.patterns.join(', ')}
1753
1534
  **Complexity**: ${component.complexity}
1754
- `).join('\n')}
1535
+ `,
1536
+ )
1537
+ .join('\n')}
1755
1538
 
1756
1539
  ## Design Patterns
1757
1540
 
1758
- ${result.designPatterns.map((pattern, index)=>`
1541
+ ${result.designPatterns
1542
+ .map(
1543
+ (pattern, index) => `
1759
1544
  ### ${index + 1}. ${pattern.name}
1760
1545
  **Type**: ${pattern.type}
1761
1546
  **Purpose**: ${pattern.purpose}
1762
1547
  **Applicability**: ${pattern.applicability}
1763
1548
  **Implementation**: ${pattern.implementation}
1764
1549
  **Benefits**: ${pattern.benefits.join(', ')}
1765
- `).join('\n')}
1550
+ `,
1551
+ )
1552
+ .join('\n')}
1766
1553
 
1767
1554
  ## Data Model
1768
1555
 
1769
1556
  ### Entities
1770
- ${result.dataModel.entities.map((entity, index)=>`
1557
+ ${result.dataModel.entities
1558
+ .map(
1559
+ (entity, index) => `
1771
1560
  #### ${index + 1}. ${entity.name}
1772
1561
  **Primary Key**: ${entity.primaryKey}
1773
1562
  **Attributes**:
1774
- ${entity.attributes.map((attr)=>`- ${attr.name}: ${attr.type}${attr.nullable ? '' : ' NOT NULL'}${attr.unique ? ' UNIQUE' : ''}${attr.default ? ` DEFAULT ${attr.default}` : ''}`).join('\n')}
1563
+ ${entity.attributes.map((attr) => `- ${attr.name}: ${attr.type}${attr.nullable ? '' : ' NOT NULL'}${attr.unique ? ' UNIQUE' : ''}${attr.default ? ` DEFAULT ${attr.default}` : ''}`).join('\n')}
1775
1564
 
1776
1565
  **Constraints**:
1777
- ${entity.constraints.map((constraint)=>`- ${constraint.name}: ${constraint.type}${constraint.condition ? ` (${constraint.condition})` : ''}`).join('\n')}
1566
+ ${entity.constraints.map((constraint) => `- ${constraint.name}: ${constraint.type}${constraint.condition ? ` (${constraint.condition})` : ''}`).join('\n')}
1778
1567
 
1779
1568
  **Indexes**:
1780
- ${entity.indexes.map((index)=>`- ${index.name}: ${index.type} (${index.columns.join(', ')})`).join('\n')}
1781
- `).join('\n')}
1569
+ ${entity.indexes.map((index) => `- ${index.name}: ${index.type} (${index.columns.join(', ')})`).join('\n')}
1570
+ `,
1571
+ )
1572
+ .join('\n')}
1782
1573
 
1783
1574
  ### Relationships
1784
- ${result.dataModel.relationships.map((rel, index)=>`
1575
+ ${result.dataModel.relationships
1576
+ .map(
1577
+ (rel, index) => `
1785
1578
  #### ${index + 1}. ${rel.name}
1786
1579
  **Type**: ${rel.type}
1787
1580
  **Parent**: ${rel.parent} (${rel.parentKey})
1788
1581
  **Child**: ${rel.child} (${rel.childKey})
1789
1582
  **On Delete**: ${rel.onDelete}
1790
1583
  **On Update**: ${rel.onUpdate}
1791
- `).join('\n')}
1584
+ `,
1585
+ )
1586
+ .join('\n')}
1792
1587
 
1793
1588
  ## API Design
1794
1589
 
@@ -1798,33 +1593,52 @@ ${result.dataModel.relationships.map((rel, index)=>`
1798
1593
  **Authentication**: ${result.apiDesign.authentication}
1799
1594
 
1800
1595
  ### Endpoints
1801
- ${result.apiDesign.endpoints.map((endpoint, index)=>`
1596
+ ${result.apiDesign.endpoints
1597
+ .map(
1598
+ (endpoint, index) => `
1802
1599
  #### ${index + 1}. ${endpoint.method} ${endpoint.path}
1803
1600
  **Summary**: ${endpoint.summary}
1804
- **Parameters**: ${endpoint.parameters ? endpoint.parameters.map((p)=>`${p.name} (${p.type})`).join(', ') : 'None'}
1601
+ **Parameters**: ${endpoint.parameters ? endpoint.parameters.map((p) => `${p.name} (${p.type})`).join(', ') : 'None'}
1805
1602
  **Request Body**: ${endpoint.requestBody ? endpoint.requestBody.schema : 'None'}
1806
- **Responses**: ${Object.entries(endpoint.responses).map(([code, resp])=>`${code}: ${resp.description}`).join(', ')}
1807
- `).join('\n')}
1603
+ **Responses**: ${Object.entries(endpoint.responses)
1604
+ .map(([code, resp]) => `${code}: ${resp.description}`)
1605
+ .join(', ')}
1606
+ `,
1607
+ )
1608
+ .join('\n')}
1808
1609
 
1809
1610
  ### Schemas
1810
- ${result.apiDesign.schemas.map((schema, index)=>`
1611
+ ${result.apiDesign.schemas
1612
+ .map(
1613
+ (schema, index) => `
1811
1614
  #### ${index + 1}. ${schema.name}
1812
1615
  **Type**: ${schema.type}
1813
1616
  **Properties**:
1814
- ${Object.entries(schema.properties).map(([name, prop])=>`- ${name}: ${prop.type}${prop.format ? ` (${prop.format})` : ''}${prop.enum ? ` [${prop.enum.join(', ')}]` : ''}`).join('\n')}
1617
+ ${Object.entries(schema.properties)
1618
+ .map(
1619
+ ([name, prop]) =>
1620
+ `- ${name}: ${prop.type}${prop.format ? ` (${prop.format})` : ''}${prop.enum ? ` [${prop.enum.join(', ')}]` : ''}`,
1621
+ )
1622
+ .join('\n')}
1815
1623
  **Required**: ${schema.required ? schema.required.join(', ') : 'None'}
1816
- `).join('\n')}
1624
+ `,
1625
+ )
1626
+ .join('\n')}
1817
1627
 
1818
1628
  ## Deployment Architecture
1819
1629
 
1820
1630
  ### Environments
1821
- ${result.deploymentArchitecture.environments.map((env, index)=>`
1631
+ ${result.deploymentArchitecture.environments
1632
+ .map(
1633
+ (env, index) => `
1822
1634
  #### ${index + 1}. ${env.name}
1823
1635
  **Purpose**: ${env.purpose}
1824
1636
  **Resources**: ${env.resources}
1825
1637
  **Database**: ${env.database}
1826
1638
  **Monitoring**: ${env.monitoring}
1827
- `).join('\n')}
1639
+ `,
1640
+ )
1641
+ .join('\n')}
1828
1642
 
1829
1643
  ### Infrastructure
1830
1644
  **Platform**: ${result.deploymentArchitecture.infrastructure.platform}
@@ -1865,14 +1679,22 @@ ${result.deploymentArchitecture.environments.map((env, index)=>`
1865
1679
 
1866
1680
  ## Quality Attributes
1867
1681
 
1868
- ${Object.entries(result.qualityAttributes).map(([category, attributes])=>`
1682
+ ${Object.entries(result.qualityAttributes)
1683
+ .map(
1684
+ ([category, attributes]) => `
1869
1685
  ### ${category.charAt(0).toUpperCase() + category.slice(1)}
1870
- ${Object.entries(attributes).map(([attr, desc])=>`- **${attr}**: ${desc}`).join('\n')}
1871
- `).join('\n')}
1686
+ ${Object.entries(attributes)
1687
+ .map(([attr, desc]) => `- **${attr}**: ${desc}`)
1688
+ .join('\n')}
1689
+ `,
1690
+ )
1691
+ .join('\n')}
1872
1692
 
1873
1693
  ## Architectural Decisions
1874
1694
 
1875
- ${result.architecturalDecisions.map((decision, index)=>`
1695
+ ${result.architecturalDecisions
1696
+ .map(
1697
+ (decision, index) => `
1876
1698
  ### ${decision.id}: ${decision.title}
1877
1699
  **Status**: ${decision.status}
1878
1700
  **Context**: ${decision.context}
@@ -1881,11 +1703,15 @@ ${result.architecturalDecisions.map((decision, index)=>`
1881
1703
  **Negative Consequences**: ${decision.consequences.negative.join(', ')}
1882
1704
  **Alternatives Considered**: ${decision.alternatives.join(', ')}
1883
1705
  **Date**: ${decision.date}
1884
- `).join('\n')}
1706
+ `,
1707
+ )
1708
+ .join('\n')}
1885
1709
 
1886
1710
  ## Risk Assessment
1887
1711
 
1888
- ${result.riskAssessment.map((risk, index)=>`
1712
+ ${result.riskAssessment
1713
+ .map(
1714
+ (risk, index) => `
1889
1715
  ### ${risk.id}: ${risk.category}
1890
1716
  **Description**: ${risk.description}
1891
1717
  **Probability**: ${risk.probability}
@@ -1893,11 +1719,15 @@ ${result.riskAssessment.map((risk, index)=>`
1893
1719
  **Risk Level**: ${risk.riskLevel}
1894
1720
  **Mitigation**: ${risk.mitigation.join(', ')}
1895
1721
  **Monitoring**: ${risk.monitoring}
1896
- `).join('\n')}
1722
+ `,
1723
+ )
1724
+ .join('\n')}
1897
1725
 
1898
1726
  ## Integration Points
1899
1727
 
1900
- ${result.integrationPoints.map((integration, index)=>`
1728
+ ${result.integrationPoints
1729
+ .map(
1730
+ (integration, index) => `
1901
1731
  ### ${index + 1}. ${integration.name}
1902
1732
  **Type**: ${integration.type}
1903
1733
  **Purpose**: ${integration.purpose}
@@ -1906,19 +1736,15 @@ ${result.integrationPoints.map((integration, index)=>`
1906
1736
  **Data Format**: ${integration.dataFormat}
1907
1737
  **Error Handling**: ${integration.errorHandling}
1908
1738
  **Monitoring**: ${integration.monitoring}
1909
- `).join('\n')}
1739
+ `,
1740
+ )
1741
+ .join('\n')}
1910
1742
  `;
1911
- // Save document
1912
- await this.saveArtifact('architecture.md', document);
1913
- return document;
1914
- }
1915
- constructor(taskDescription, options){
1916
- super('architecture', taskDescription, options);
1917
- this.components = [];
1918
- this.designPatterns = [];
1919
- this.systemDesign = null;
1920
- this.dataModel = null;
1921
- this.apiDesign = null;
1922
- }
1743
+
1744
+ // Save document
1745
+ await this.saveArtifact('architecture.md', document);
1746
+ return document;
1747
+ }
1923
1748
  }
1749
+
1924
1750
  export default SparcArchitecture;