snow-flow 3.0.9 → 3.0.13

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 (302) hide show
  1. package/claude-flow.bat +0 -0
  2. package/claude-flow.ps1 +0 -0
  3. package/dist/mcp/intelligent-reporting-mcp.d.ts +7 -0
  4. package/dist/mcp/intelligent-reporting-mcp.js +379 -0
  5. package/dist/mcp/servicenow-automation-mcp.js +0 -0
  6. package/dist/mcp/servicenow-deployment-mcp.js +0 -0
  7. package/dist/mcp/servicenow-integration-mcp.js +0 -0
  8. package/dist/mcp/servicenow-mcp-server.js +0 -0
  9. package/dist/mcp/servicenow-operations-mcp.js +0 -0
  10. package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
  11. package/dist/mcp/servicenow-progressive-indexer.js +0 -0
  12. package/dist/mcp/servicenow-reporting-analytics-mcp.js +280 -29
  13. package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
  14. package/dist/mcp/servicenow-update-set-mcp.js +0 -0
  15. package/dist/mcp/start-all-mcp-servers.js +0 -0
  16. package/dist/mcp/start-servicenow-mcp.js +0 -0
  17. package/dist/services/widget-deployment-service.d.ts +2 -1
  18. package/dist/services/widget-deployment-service.js +17 -16
  19. package/dist/utils/anti-mock-data-validator.d.ts +66 -0
  20. package/dist/utils/anti-mock-data-validator.js +316 -0
  21. package/dist/utils/servicenow-eventual-consistency.d.ts +120 -0
  22. package/dist/utils/servicenow-eventual-consistency.js +220 -0
  23. package/memory/agents/README.md +1 -1
  24. package/memory/claude-flow-data.json +1 -1
  25. package/memory/sessions/README.md +1 -1
  26. package/package.json +4 -3
  27. package/.mcp.json +0 -22
  28. package/claude-flow.config.json +0 -20
  29. package/dist/agents/app-creator.agent.d.ts +0 -55
  30. package/dist/agents/app-creator.agent.js +0 -1292
  31. package/dist/agents/base/base-snow-agent.d.ts +0 -75
  32. package/dist/agents/base/base-snow-agent.js +0 -169
  33. package/dist/agents/base-snow-agent.d.ts +0 -63
  34. package/dist/agents/base-snow-agent.js +0 -296
  35. package/dist/agents/coordinator.d.ts +0 -200
  36. package/dist/agents/coordinator.js +0 -777
  37. package/dist/agents/flow-builder-agent.d.ts +0 -18
  38. package/dist/agents/flow-builder-agent.js +0 -197
  39. package/dist/agents/queen-403-handler.d.ts +0 -47
  40. package/dist/agents/queen-403-handler.js +0 -175
  41. package/dist/agents/queen-agent-example.d.ts +0 -23
  42. package/dist/agents/queen-agent-example.js +0 -240
  43. package/dist/agents/queen-agent.test.d.ts +0 -6
  44. package/dist/agents/script-generator.agent.d.ts +0 -32
  45. package/dist/agents/script-generator.agent.js +0 -772
  46. package/dist/agents/script-writer-agent.d.ts +0 -22
  47. package/dist/agents/script-writer-agent.js +0 -695
  48. package/dist/agents/security-agent.d.ts +0 -23
  49. package/dist/agents/security-agent.js +0 -619
  50. package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
  51. package/dist/agents/specialists/automation-specialist.agent.js +0 -204
  52. package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
  53. package/dist/agents/specialists/data-specialist.agent.js +0 -484
  54. package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
  55. package/dist/agents/specialists/integration-specialist.agent.js +0 -725
  56. package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
  57. package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
  58. package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
  59. package/dist/agents/specialists/security-specialist.agent.js +0 -309
  60. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
  61. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
  62. package/dist/agents/teams/base-team.d.ts +0 -72
  63. package/dist/agents/teams/base-team.js +0 -253
  64. package/dist/agents/teams/team-types.d.ts +0 -265
  65. package/dist/agents/teams/team-types.js +0 -3
  66. package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
  67. package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
  68. package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
  69. package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
  70. package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
  71. package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
  72. package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
  73. package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
  74. package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
  75. package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
  76. package/dist/agents/test-agent.d.ts +0 -26
  77. package/dist/agents/test-agent.js +0 -734
  78. package/dist/agents/test-agents.d.ts +0 -7
  79. package/dist/agents/test-agents.js +0 -64
  80. package/dist/agents/ui-builder.agent.d.ts +0 -50
  81. package/dist/agents/ui-builder.agent.js +0 -1539
  82. package/dist/agents/widget-builder.agent.d.ts +0 -32
  83. package/dist/agents/widget-builder.agent.js +0 -439
  84. package/dist/agents/widget-creator-agent.d.ts +0 -18
  85. package/dist/agents/widget-creator-agent.js +0 -498
  86. package/dist/agents/workflow-designer.agent.d.ts +0 -31
  87. package/dist/agents/workflow-designer.agent.js +0 -583
  88. package/dist/api/error-handling.d.ts +0 -325
  89. package/dist/api/error-handling.js +0 -1488
  90. package/dist/api/flow-designer-api.d.ts +0 -167
  91. package/dist/api/flow-designer-api.js +0 -554
  92. package/dist/api/natural-language-mapper.d.ts +0 -124
  93. package/dist/api/natural-language-mapper.js +0 -501
  94. package/dist/api/performance-optimizer.d.ts +0 -240
  95. package/dist/api/performance-optimizer.js +0 -706
  96. package/dist/api/transaction-manager.d.ts +0 -189
  97. package/dist/api/transaction-manager.js +0 -576
  98. package/dist/assembly/team-assembler.d.ts +0 -140
  99. package/dist/assembly/team-assembler.js +0 -502
  100. package/dist/benchmark-performance.d.ts +0 -41
  101. package/dist/benchmark-performance.js +0 -230
  102. package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
  103. package/dist/cli/snow-flow-cli-integration.js +0 -396
  104. package/dist/coordination/coordination-engine.d.ts +0 -41
  105. package/dist/coordination/coordination-engine.js +0 -324
  106. package/dist/coordination/coordination.test.d.ts +0 -6
  107. package/dist/coordination/example.d.ts +0 -31
  108. package/dist/coordination/example.js +0 -394
  109. package/dist/coordination/execution-patterns.d.ts +0 -43
  110. package/dist/coordination/execution-patterns.js +0 -507
  111. package/dist/coordination/factory.d.ts +0 -94
  112. package/dist/coordination/factory.js +0 -433
  113. package/dist/coordination/index.d.ts +0 -71
  114. package/dist/coordination/index.js +0 -135
  115. package/dist/coordination/progress-monitor.d.ts +0 -71
  116. package/dist/coordination/progress-monitor.js +0 -505
  117. package/dist/coordination/quality-gates.d.ts +0 -124
  118. package/dist/coordination/quality-gates.js +0 -577
  119. package/dist/coordination/shared-memory.d.ts +0 -39
  120. package/dist/coordination/shared-memory.js +0 -289
  121. package/dist/coordination/task-dependencies.d.ts +0 -50
  122. package/dist/coordination/task-dependencies.js +0 -407
  123. package/dist/coordination/team-coordinator.d.ts +0 -59
  124. package/dist/coordination/team-coordinator.js +0 -550
  125. package/dist/coordination/types.d.ts +0 -152
  126. package/dist/coordination/types.js +0 -3
  127. package/dist/mcp/mcp-wrapper.d.ts +0 -8
  128. package/dist/mcp/mcp-wrapper.js +0 -77
  129. package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
  130. package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
  131. package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
  132. package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
  133. package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
  134. package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
  135. package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
  136. package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
  137. package/dist/mcp/singleton-check.js +0 -31
  138. package/dist/mcp/test-simple-mcp.d.ts +0 -6
  139. package/dist/mcp/test-simple-mcp.js +0 -63
  140. package/dist/memory/hierarchical-memory-system.d.ts +0 -90
  141. package/dist/memory/hierarchical-memory-system.js +0 -400
  142. package/dist/memory/index.d.ts +0 -9
  143. package/dist/memory/index.js +0 -20
  144. package/dist/memory/mcp-integration-example.d.ts +0 -6
  145. package/dist/memory/mcp-integration-example.js +0 -281
  146. package/dist/memory/memory-client.d.ts +0 -199
  147. package/dist/memory/memory-client.js +0 -364
  148. package/dist/memory/memory-manager.d.ts +0 -29
  149. package/dist/memory/memory-manager.js +0 -280
  150. package/dist/memory/memory-operations.d.ts +0 -179
  151. package/dist/memory/memory-operations.js +0 -691
  152. package/dist/memory/memory-system.d.ts +0 -153
  153. package/dist/memory/memory-system.js +0 -651
  154. package/dist/memory/memory-test.d.ts +0 -6
  155. package/dist/memory/memory-test.js +0 -161
  156. package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
  157. package/dist/memory/snow-flow-memory-patterns.js +0 -200
  158. package/dist/memory/snow-memory.d.ts +0 -54
  159. package/dist/memory/snow-memory.js +0 -301
  160. package/dist/memory/swarm-memory.d.ts +0 -135
  161. package/dist/memory/swarm-memory.js +0 -378
  162. package/dist/optimization/flow-performance-optimizer.js +0 -723
  163. package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
  164. package/dist/orchestration/discovery/service-discovery.js +0 -808
  165. package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
  166. package/dist/orchestration/distributed-orchestrator.js +0 -712
  167. package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
  168. package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
  169. package/dist/orchestration/flow-update-orchestrator.js +0 -648
  170. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
  171. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
  172. package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
  173. package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
  174. package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
  175. package/dist/orchestration/state/distributed-state-manager.js +0 -716
  176. package/dist/orchestrator/flow-composer.d.ts +0 -105
  177. package/dist/orchestrator/flow-composer.js +0 -404
  178. package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
  179. package/dist/orchestrator/flow-pattern-templates.js +0 -908
  180. package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
  181. package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
  182. package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
  183. package/dist/orchestrator/flow-validation-engine.js +0 -913
  184. package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
  185. package/dist/orchestrator/snow-orchestrator.js +0 -235
  186. package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
  187. package/dist/orchestrator/subflow-creation-handler.js +0 -791
  188. package/dist/patterns/adaptive-patterns.d.ts +0 -140
  189. package/dist/patterns/adaptive-patterns.js +0 -549
  190. package/dist/queen/advanced-integration-test.d.ts +0 -48
  191. package/dist/queen/advanced-integration-test.js +0 -473
  192. package/dist/queen/integration-example.d.ts +0 -82
  193. package/dist/queen/integration-example.js +0 -219
  194. package/dist/queen/integration-test.d.ts +0 -72
  195. package/dist/queen/integration-test.js +0 -563
  196. package/dist/queen/mock-mcp-client.d.ts +0 -71
  197. package/dist/queen/mock-mcp-client.js +0 -317
  198. package/dist/queen/run-integration-tests.d.ts +0 -9
  199. package/dist/queen/run-integration-tests.js +0 -27
  200. package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
  201. package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
  202. package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
  203. package/dist/sparc/coordinators/team-coordinator.js +0 -402
  204. package/dist/sparc/modes/team-modes.d.ts +0 -33
  205. package/dist/sparc/modes/team-modes.js +0 -399
  206. package/dist/sparc/teams/application-team.d.ts +0 -73
  207. package/dist/sparc/teams/application-team.js +0 -463
  208. package/dist/sparc/teams/flow-team.d.ts +0 -67
  209. package/dist/sparc/teams/flow-team.js +0 -373
  210. package/dist/sparc/teams/widget-team.d.ts +0 -61
  211. package/dist/sparc/teams/widget-team.js +0 -280
  212. package/dist/specialists/app-specialists.d.ts +0 -93
  213. package/dist/specialists/app-specialists.js +0 -1639
  214. package/dist/specialists/base-specialist.d.ts +0 -19
  215. package/dist/specialists/base-specialist.js +0 -54
  216. package/dist/specialists/flow-specialists.d.ts +0 -113
  217. package/dist/specialists/flow-specialists.js +0 -1787
  218. package/dist/specialists/individual-specialists.d.ts +0 -67
  219. package/dist/specialists/individual-specialists.js +0 -632
  220. package/dist/specialists/widget-specialists.d.ts +0 -70
  221. package/dist/specialists/widget-specialists.js +0 -1264
  222. package/dist/src/utils/agent-detector.js +0 -655
  223. package/dist/teams/adaptive-team.d.ts +0 -81
  224. package/dist/teams/adaptive-team.js +0 -1153
  225. package/dist/teams/application-team.d.ts +0 -30
  226. package/dist/teams/application-team.js +0 -547
  227. package/dist/teams/base-team.d.ts +0 -55
  228. package/dist/teams/base-team.js +0 -243
  229. package/dist/teams/flow-team.d.ts +0 -28
  230. package/dist/teams/flow-team.js +0 -525
  231. package/dist/teams/widget-team.d.ts +0 -26
  232. package/dist/teams/widget-team.js +0 -459
  233. package/dist/templates/flow-template-system.js +0 -625
  234. package/dist/test-fetch-incidents.d.ts +0 -2
  235. package/dist/test-fetch-incidents.js +0 -84
  236. package/dist/test-incident-access.d.ts +0 -2
  237. package/dist/test-incident-access.js +0 -72
  238. package/dist/test-iphone-flow.js +0 -189
  239. package/dist/test-limit-problem.d.ts +0 -2
  240. package/dist/test-limit-problem.js +0 -60
  241. package/dist/test-ml-batch-fix.d.ts +0 -2
  242. package/dist/test-ml-batch-fix.js +0 -104
  243. package/dist/test-ml-batch.d.ts +0 -2
  244. package/dist/test-ml-batch.js +0 -87
  245. package/dist/test-ml-query.d.ts +0 -2
  246. package/dist/test-ml-query.js +0 -100
  247. package/dist/test-ml-training-fix.d.ts +0 -12
  248. package/dist/test-ml-training-fix.js +0 -113
  249. package/dist/test-ml-training.d.ts +0 -2
  250. package/dist/test-ml-training.js +0 -32
  251. package/dist/test-operations-query.d.ts +0 -2
  252. package/dist/test-operations-query.js +0 -84
  253. package/dist/test-performance-query.d.ts +0 -2
  254. package/dist/test-performance-query.js +0 -52
  255. package/dist/test-singleton-protection.d.ts +0 -8
  256. package/dist/test-singleton-protection.js +0 -110
  257. package/dist/test-smart-limits.d.ts +0 -13
  258. package/dist/test-smart-limits.js +0 -100
  259. package/dist/test-snow-query-incidents.d.ts +0 -2
  260. package/dist/test-snow-query-incidents.js +0 -66
  261. package/dist/test-universal-query.d.ts +0 -2
  262. package/dist/test-universal-query.js +0 -106
  263. package/dist/testing/flow-testing-automation.js +0 -641
  264. package/dist/utils/complete-flow-xml-generator.js +0 -1285
  265. package/dist/utils/file-storage-fallback.d.ts +0 -62
  266. package/dist/utils/file-storage-fallback.js +0 -289
  267. package/dist/utils/flow-api-discovery.d.ts +0 -151
  268. package/dist/utils/flow-api-discovery.js +0 -439
  269. package/dist/utils/flow-examples.js +0 -720
  270. package/dist/utils/flow-structure-builder.js +0 -677
  271. package/dist/utils/flow-xml-generator.d.ts +0 -41
  272. package/dist/utils/flow-xml-generator.js +0 -258
  273. package/dist/utils/improved-flow-xml-generator.js +0 -820
  274. package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
  275. package/dist/utils/mcp-process-manager.backup.js +0 -220
  276. package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
  277. package/dist/utils/mcp-singleton-enforcer.js +0 -201
  278. package/dist/utils/mcp-timeout-fix.d.ts +0 -53
  279. package/dist/utils/mcp-timeout-fix.js +0 -221
  280. package/dist/utils/migrate-claude-flow.d.ts +0 -22
  281. package/dist/utils/migrate-claude-flow.js +0 -120
  282. package/dist/utils/scope-utils.d.ts +0 -72
  283. package/dist/utils/scope-utils.js +0 -386
  284. package/dist/utils/snow-oauth-old.d.ts +0 -65
  285. package/dist/utils/snow-oauth-old.js +0 -345
  286. package/dist/utils/xml-first-flow-generator.js +0 -513
  287. package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
  288. package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
  289. package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
  290. package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
  291. package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
  292. package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
  293. package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
  294. package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
  295. package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
  296. package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
  297. package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
  298. package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
  299. package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
  300. package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
  301. package/reports/swarm-auto-centralized-1752649029776.json +0 -13
  302. package/src/memory/README.md +0 -240
@@ -1,23 +0,0 @@
1
- /**
2
- * Security Agent
3
- * Specializes in ServiceNow security, compliance, and vulnerability assessment
4
- */
5
- import { BaseAgent, AgentConfig, AgentResult } from './base-agent';
6
- export declare class SecurityAgent extends BaseAgent {
7
- constructor(config?: Partial<AgentConfig>);
8
- execute(instruction: string, context?: Record<string, any>): Promise<AgentResult>;
9
- private analyzeSecurityRequirements;
10
- private retrieveArtifactsForScan;
11
- private performSecurityScan;
12
- private scanForVulnerabilities;
13
- private scanAccessControls;
14
- private scanAuthentication;
15
- private checkCompliance;
16
- private calculateSecurityScore;
17
- private analyzeSecurityPosture;
18
- private generateRemediationPlan;
19
- private estimateRemediationEffort;
20
- private createSecurityPolicies;
21
- private generateSecurityReport;
22
- }
23
- //# sourceMappingURL=security-agent.d.ts.map
@@ -1,619 +0,0 @@
1
- "use strict";
2
- /**
3
- * Security Agent
4
- * Specializes in ServiceNow security, compliance, and vulnerability assessment
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SecurityAgent = void 0;
8
- const base_agent_1 = require("./base-agent");
9
- class SecurityAgent extends base_agent_1.BaseAgent {
10
- constructor(config) {
11
- super({
12
- type: 'tester', // Using 'tester' type as 'security' is not in AgentType
13
- capabilities: [
14
- 'Security policy enforcement',
15
- 'Vulnerability scanning',
16
- 'Access control validation',
17
- 'Compliance checking',
18
- 'Code security _analysis',
19
- 'Authentication verification',
20
- 'Authorization testing',
21
- 'Data encryption validation',
22
- 'Security best practices'
23
- ],
24
- mcpTools: [
25
- 'snow_create_access_control',
26
- 'snow_security_scan',
27
- 'snow_run_compliance_scan',
28
- 'snow_create_security_policy',
29
- 'snow_create_audit_rule',
30
- 'snow_security_risk_assessment',
31
- 'snow_audit_trail__analysis'
32
- ],
33
- ...config
34
- });
35
- }
36
- async execute(instruction, context) {
37
- try {
38
- this.setStatus('working');
39
- await this.reportProgress('Starting security _analysis', 0);
40
- // Analyze security requirements
41
- const requirements = await this.analyzeSecurityRequirements(instruction, context);
42
- await this.reportProgress('Analyzed security requirements', 15);
43
- // Retrieve artifacts to scan
44
- const artifacts = await this.retrieveArtifactsForScan(requirements);
45
- if (!artifacts || artifacts.length === 0) {
46
- throw new Error('No artifacts found for security scanning');
47
- }
48
- await this.reportProgress('Retrieved artifacts for scanning', 25);
49
- // Perform security scans
50
- const scanResults = [];
51
- let currentProgress = 30;
52
- const progressPerScan = 50 / artifacts.length;
53
- for (const artifact of artifacts) {
54
- const result = await this.performSecurityScan(artifact, requirements);
55
- scanResults.push(result);
56
- currentProgress += progressPerScan;
57
- await this.reportProgress(`Scanned ${artifact.name}`, Math.round(currentProgress));
58
- }
59
- // Analyze collective security posture
60
- const securityAnalysis = await this.analyzeSecurityPosture(scanResults);
61
- await this.reportProgress('Analyzed security posture', 85);
62
- // Generate remediation plan if issues found
63
- let remediationPlan = null;
64
- if (securityAnalysis.totalVulnerabilities > 0 || securityAnalysis.totalComplianceIssues > 0) {
65
- remediationPlan = await this.generateRemediationPlan(scanResults);
66
- await this.reportProgress('Generated remediation plan', 92);
67
- }
68
- // Create security policies if needed
69
- if (requirements.createPolicies) {
70
- await this.createSecurityPolicies(scanResults, artifacts);
71
- await this.reportProgress('Created security policies', 96);
72
- }
73
- // Generate security report
74
- const securityReport = this.generateSecurityReport(scanResults, securityAnalysis, remediationPlan);
75
- await this.reportProgress('Security _analysis completed', 100);
76
- this.setStatus('completed');
77
- const success = securityAnalysis.overallScore >= requirements.minimumScore;
78
- await this.logActivity('security_scan', success, {
79
- artifactsScanned: artifacts.length,
80
- vulnerabilitiesFound: securityAnalysis.totalVulnerabilities,
81
- complianceIssues: securityAnalysis.totalComplianceIssues,
82
- securityScore: securityAnalysis.overallScore
83
- });
84
- return {
85
- success,
86
- message: success ?
87
- `Security scan passed with score ${securityAnalysis.overallScore}/100` :
88
- `Security issues found: ${securityAnalysis.totalVulnerabilities} vulnerabilities, ${securityAnalysis.totalComplianceIssues} compliance issues`,
89
- metadata: {
90
- securityReport,
91
- scanResults,
92
- securityAnalysis,
93
- remediationPlan,
94
- policiesCreated: requirements.createPolicies
95
- }
96
- };
97
- }
98
- catch (error) {
99
- this.setStatus('failed');
100
- await this.logActivity('security_scan', false, { error: error.message });
101
- return {
102
- success: false,
103
- error: error,
104
- message: `Security scan failed: ${error.message}`
105
- };
106
- }
107
- }
108
- async analyzeSecurityRequirements(instruction, context) {
109
- const requirements = {
110
- scanTypes: [],
111
- complianceFrameworks: [],
112
- minimumScore: 70,
113
- createPolicies: false,
114
- autoRemediate: false,
115
- scanDepth: 'standard', // basic, standard, deep
116
- specificArtifacts: []
117
- };
118
- // Detect scan types
119
- if (/vulnerabilit/i.test(instruction)) {
120
- requirements.scanTypes.push('vulnerability');
121
- }
122
- if (/access\s*control|permission|authorization/i.test(instruction)) {
123
- requirements.scanTypes.push('access_control');
124
- }
125
- if (/authentication|login|password/i.test(instruction)) {
126
- requirements.scanTypes.push('authentication');
127
- }
128
- if (/encrypt/i.test(instruction)) {
129
- requirements.scanTypes.push('encryption');
130
- }
131
- if (/audit/i.test(instruction)) {
132
- requirements.scanTypes.push('audit');
133
- }
134
- if (!requirements.scanTypes.length) {
135
- requirements.scanTypes = ['vulnerability', 'access_control', 'authentication'];
136
- }
137
- // Detect compliance frameworks
138
- if (/SOX|sarbanes/i.test(instruction)) {
139
- requirements.complianceFrameworks.push('SOX');
140
- }
141
- if (/GDPR/i.test(instruction)) {
142
- requirements.complianceFrameworks.push('GDPR');
143
- }
144
- if (/HIPAA/i.test(instruction)) {
145
- requirements.complianceFrameworks.push('HIPAA');
146
- }
147
- if (/ISO\s*27001/i.test(instruction)) {
148
- requirements.complianceFrameworks.push('ISO27001');
149
- }
150
- if (/compliance/i.test(instruction) && !requirements.complianceFrameworks.length) {
151
- requirements.complianceFrameworks.push('GENERAL');
152
- }
153
- // Detect additional requirements
154
- if (/create\s*polic/i.test(instruction)) {
155
- requirements.createPolicies = true;
156
- }
157
- if (/auto.*remediate|fix.*automatic/i.test(instruction)) {
158
- requirements.autoRemediate = true;
159
- }
160
- if (/deep|thorough|comprehensive/i.test(instruction)) {
161
- requirements.scanDepth = 'deep';
162
- requirements.minimumScore = 80;
163
- }
164
- if (/basic|quick|minimal/i.test(instruction)) {
165
- requirements.scanDepth = 'basic';
166
- requirements.minimumScore = 60;
167
- }
168
- return requirements;
169
- }
170
- async retrieveArtifactsForScan(requirements) {
171
- // Retrieve artifacts from shared memory
172
- // For now, using placeholder logic
173
- const artifacts = [];
174
- // Get recent artifacts that need security scanning
175
- const artifactTypes = ['widget', 'flow', 'script'];
176
- for (const type of artifactTypes) {
177
- const artifact = await this.getArtifact(type, `recent_${type}`);
178
- if (artifact) {
179
- artifacts.push(artifact);
180
- }
181
- }
182
- return artifacts;
183
- }
184
- async performSecurityScan(artifact, requirements) {
185
- const scanResult = {
186
- artifact: artifact.name,
187
- scanType: requirements.scanTypes.join(', '),
188
- timestamp: new Date(),
189
- vulnerabilities: [],
190
- complianceIssues: [],
191
- securityScore: 100,
192
- passed: true
193
- };
194
- // Perform different types of scans based on artifact type
195
- if (requirements.scanTypes.includes('vulnerability')) {
196
- const vulns = await this.scanForVulnerabilities(artifact);
197
- scanResult.vulnerabilities.push(...vulns);
198
- }
199
- if (requirements.scanTypes.includes('access_control')) {
200
- const accessIssues = await this.scanAccessControls(artifact);
201
- scanResult.vulnerabilities.push(...accessIssues);
202
- }
203
- if (requirements.scanTypes.includes('authentication')) {
204
- const authIssues = await this.scanAuthentication(artifact);
205
- scanResult.vulnerabilities.push(...authIssues);
206
- }
207
- // Check compliance if frameworks specified
208
- for (const framework of requirements.complianceFrameworks) {
209
- const complianceResults = await this.checkCompliance(artifact, framework);
210
- scanResult.complianceIssues.push(...complianceResults);
211
- }
212
- // Calculate security score
213
- scanResult.securityScore = this.calculateSecurityScore(scanResult);
214
- scanResult.passed = scanResult.securityScore >= requirements.minimumScore;
215
- return scanResult;
216
- }
217
- async scanForVulnerabilities(artifact) {
218
- const vulnerabilities = [];
219
- // Check for common security issues based on artifact type
220
- if (artifact.type === 'widget') {
221
- // Check for XSS vulnerabilities
222
- if (artifact.config.template?.includes('<script>') ||
223
- artifact.config.template?.includes('innerHTML')) {
224
- vulnerabilities.push({
225
- severity: 'high',
226
- type: 'XSS',
227
- description: 'Potential Cross-Site Scripting vulnerability',
228
- location: 'Widget template',
229
- recommendation: 'Use ng-bind-html with $sce.trustAsHtml() or sanitize user input'
230
- });
231
- }
232
- // Check for unsanitized user input
233
- if (artifact.config.client_script?.includes('getValue') &&
234
- !artifact.config.client_script?.includes('sanitize')) {
235
- vulnerabilities.push({
236
- severity: 'medium',
237
- type: 'Input Validation',
238
- description: 'User input not properly validated',
239
- location: 'Client script',
240
- recommendation: 'Validate and sanitize all user inputs'
241
- });
242
- }
243
- }
244
- if (artifact.type === 'script') {
245
- // Check for SQL injection
246
- if (artifact.config.script?.includes('addEncodedQuery') &&
247
- artifact.config.script?.includes('getValue')) {
248
- vulnerabilities.push({
249
- severity: 'critical',
250
- type: 'SQL Injection',
251
- description: 'Potential SQL injection vulnerability',
252
- location: 'Script query construction',
253
- recommendation: 'Use parameterized queries or GlideRecord methods'
254
- });
255
- }
256
- // Check for hardcoded credentials
257
- if (artifact.config.script?.match(/password\s*=\s*["'][^"']+["']/i)) {
258
- vulnerabilities.push({
259
- severity: 'critical',
260
- type: 'Hardcoded Credentials',
261
- description: 'Hardcoded password found in script',
262
- location: 'Script',
263
- recommendation: 'Use system properties or credential storage'
264
- });
265
- }
266
- }
267
- if (artifact.type === 'flow') {
268
- // Check for missing error handling
269
- if (!artifact.config.definition?.settings?.error_handling) {
270
- vulnerabilities.push({
271
- severity: 'medium',
272
- type: 'Error Handling',
273
- description: 'Flow lacks proper error handling',
274
- location: 'Flow configuration',
275
- recommendation: 'Add error handling stages to the flow'
276
- });
277
- }
278
- }
279
- return vulnerabilities;
280
- }
281
- async scanAccessControls(artifact) {
282
- const vulnerabilities = [];
283
- // Check for missing access controls
284
- if (!artifact.config.acls || artifact.config.acls?.length === 0) {
285
- vulnerabilities.push({
286
- severity: 'high',
287
- type: 'Access Control',
288
- description: 'No access controls defined for artifact',
289
- location: 'Configuration',
290
- recommendation: 'Define appropriate ACLs for the artifact'
291
- });
292
- }
293
- // Check for overly permissive access
294
- if (artifact.config.public === true || artifact.config.guest_access === true) {
295
- vulnerabilities.push({
296
- severity: 'medium',
297
- type: 'Access Control',
298
- description: 'Artifact allows public or guest access',
299
- location: 'Access configuration',
300
- recommendation: 'Restrict access to authenticated users only'
301
- });
302
- }
303
- // Check for admin-only operations without proper checks
304
- if (artifact.config.script?.includes('gs.hasRole') &&
305
- !artifact.config.script?.includes('admin')) {
306
- vulnerabilities.push({
307
- severity: 'low',
308
- type: 'Authorization',
309
- description: 'Role checks may be insufficient',
310
- location: 'Authorization logic',
311
- recommendation: 'Implement proper role-based access control'
312
- });
313
- }
314
- return vulnerabilities;
315
- }
316
- async scanAuthentication(artifact) {
317
- const vulnerabilities = [];
318
- // Check for authentication bypass
319
- if (artifact.config.script?.includes('setUser') ||
320
- artifact.config.script?.includes('impersonate')) {
321
- vulnerabilities.push({
322
- severity: 'critical',
323
- type: 'Authentication Bypass',
324
- description: 'Code can impersonate users',
325
- location: 'Authentication logic',
326
- recommendation: 'Remove user impersonation unless absolutely necessary with proper controls'
327
- });
328
- }
329
- // Check for weak session management
330
- if (artifact.type === 'widget' &&
331
- artifact.config.client_script?.includes('sessionStorage') &&
332
- !artifact.config.client_script?.includes('secure')) {
333
- vulnerabilities.push({
334
- severity: 'medium',
335
- type: 'Session Management',
336
- description: 'Sensitive data stored in sessionStorage',
337
- location: 'Client script',
338
- recommendation: 'Use secure session management practices'
339
- });
340
- }
341
- return vulnerabilities;
342
- }
343
- async checkCompliance(artifact, framework) {
344
- const issues = [];
345
- switch (framework) {
346
- case 'GDPR':
347
- // Check for personal data handling
348
- if (artifact.config.script?.includes('email') ||
349
- artifact.config.script?.includes('personal')) {
350
- issues.push({
351
- framework: 'GDPR',
352
- requirement: 'Data Protection',
353
- status: 'partially_compliant',
354
- finding: 'Personal data processing detected without privacy controls',
355
- remediation: 'Implement data minimization and consent mechanisms'
356
- });
357
- }
358
- break;
359
- case 'SOX':
360
- // Check for audit trail
361
- if (!artifact.config.audit_enabled) {
362
- issues.push({
363
- framework: 'SOX',
364
- requirement: 'Audit Trail',
365
- status: 'non_compliant',
366
- finding: 'No audit trail configured',
367
- remediation: 'Enable audit logging for all data modifications'
368
- });
369
- }
370
- break;
371
- case 'HIPAA':
372
- // Check for encryption
373
- if (!artifact.config.encryption_enabled) {
374
- issues.push({
375
- framework: 'HIPAA',
376
- requirement: 'Data Encryption',
377
- status: 'non_compliant',
378
- finding: 'PHI data not encrypted',
379
- remediation: 'Enable encryption for data at rest and in transit'
380
- });
381
- }
382
- break;
383
- case 'ISO27001':
384
- // Check for security controls
385
- if (!artifact.config.security_controls) {
386
- issues.push({
387
- framework: 'ISO27001',
388
- requirement: 'Security Controls',
389
- status: 'partially_compliant',
390
- finding: 'Incomplete security control implementation',
391
- remediation: 'Implement full ISO 27001 control set'
392
- });
393
- }
394
- break;
395
- }
396
- return issues;
397
- }
398
- calculateSecurityScore(scanResult) {
399
- let score = 100;
400
- // Deduct points for vulnerabilities based on severity
401
- for (const vuln of scanResult.vulnerabilities) {
402
- switch (vuln.severity) {
403
- case 'critical':
404
- score -= 20;
405
- break;
406
- case 'high':
407
- score -= 15;
408
- break;
409
- case 'medium':
410
- score -= 10;
411
- break;
412
- case 'low':
413
- score -= 5;
414
- break;
415
- }
416
- }
417
- // Deduct points for compliance issues
418
- for (const issue of scanResult.complianceIssues) {
419
- switch (issue.status) {
420
- case 'non_compliant':
421
- score -= 15;
422
- break;
423
- case 'partially_compliant':
424
- score -= 8;
425
- break;
426
- }
427
- }
428
- return Math.max(0, score);
429
- }
430
- async analyzeSecurityPosture(scanResults) {
431
- const _analysis = {
432
- totalArtifacts: scanResults.length,
433
- totalVulnerabilities: 0,
434
- totalComplianceIssues: 0,
435
- criticalVulnerabilities: 0,
436
- highVulnerabilities: 0,
437
- overallScore: 0,
438
- passedScans: 0,
439
- failedScans: 0,
440
- vulnerabilityBreakdown: {},
441
- complianceBreakdown: {}
442
- };
443
- for (const result of scanResults) {
444
- _analysis.totalVulnerabilities += result.vulnerabilities.length;
445
- _analysis.totalComplianceIssues += result.complianceIssues.length;
446
- if (result.passed) {
447
- _analysis.passedScans++;
448
- }
449
- else {
450
- _analysis.failedScans++;
451
- }
452
- // Count vulnerabilities by severity
453
- for (const vuln of result.vulnerabilities) {
454
- if (vuln.severity === 'critical')
455
- _analysis.criticalVulnerabilities++;
456
- if (vuln.severity === 'high')
457
- _analysis.highVulnerabilities++;
458
- // Track vulnerability types
459
- _analysis.vulnerabilityBreakdown[vuln.type] =
460
- (_analysis.vulnerabilityBreakdown[vuln.type] || 0) + 1;
461
- }
462
- // Track compliance issues
463
- for (const issue of result.complianceIssues) {
464
- _analysis.complianceBreakdown[issue.framework] =
465
- (_analysis.complianceBreakdown[issue.framework] || 0) + 1;
466
- }
467
- _analysis.overallScore += result.securityScore;
468
- }
469
- _analysis.overallScore = Math.round(_analysis.overallScore / scanResults.length);
470
- return _analysis;
471
- }
472
- async generateRemediationPlan(scanResults) {
473
- const plan = {
474
- priority: [],
475
- timeline: {
476
- immediate: [],
477
- shortTerm: [],
478
- longTerm: []
479
- },
480
- estimatedEffort: 0
481
- };
482
- // Prioritize critical and high vulnerabilities
483
- for (const result of scanResults) {
484
- for (const vuln of result.vulnerabilities) {
485
- const remediation = {
486
- artifact: result.artifact,
487
- vulnerability: vuln.type,
488
- severity: vuln.severity,
489
- action: vuln.recommendation,
490
- effort: this.estimateRemediationEffort(vuln)
491
- };
492
- if (vuln.severity === 'critical') {
493
- plan.timeline.immediate.push(remediation);
494
- plan.priority.push(remediation);
495
- }
496
- else if (vuln.severity === 'high') {
497
- plan.timeline.shortTerm.push(remediation);
498
- plan.priority.push(remediation);
499
- }
500
- else {
501
- plan.timeline.longTerm.push(remediation);
502
- }
503
- plan.estimatedEffort += remediation.effort;
504
- }
505
- }
506
- // Sort priority by severity and effort
507
- plan.priority.sort((a, b) => {
508
- if (a.severity !== b.severity) {
509
- const severityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
510
- return severityOrder[a.severity] - severityOrder[b.severity];
511
- }
512
- return a.effort - b.effort;
513
- });
514
- return plan;
515
- }
516
- estimateRemediationEffort(vulnerability) {
517
- // Estimate in hours
518
- const baseEffort = {
519
- critical: 8,
520
- high: 4,
521
- medium: 2,
522
- low: 1
523
- };
524
- const typeMultiplier = {
525
- 'SQL Injection': 2,
526
- 'XSS': 1.5,
527
- 'Authentication Bypass': 3,
528
- 'Hardcoded Credentials': 0.5,
529
- 'Access Control': 1.5,
530
- 'Input Validation': 1,
531
- 'Error Handling': 1,
532
- 'Session Management': 2
533
- };
534
- const base = baseEffort[vulnerability.severity] || 2;
535
- const multiplier = typeMultiplier[vulnerability.type] || 1;
536
- return Math.round(base * multiplier);
537
- }
538
- async createSecurityPolicies(scanResults, artifacts) {
539
- // This would use snow_create_security_policy MCP tool
540
- // For now, log the action
541
- await this.logActivity('create_security_policies', true, {
542
- policiesNeeded: scanResults.flatMap(r => r.vulnerabilities).length,
543
- artifacts: artifacts.map(a => a.name)
544
- });
545
- }
546
- generateSecurityReport(scanResults, _analysis, remediationPlan) {
547
- let report = '# Security Scan Report\n\n';
548
- report += `**Date**: ${new Date().toISOString()}\n`;
549
- report += `**Overall Security Score**: ${_analysis.overallScore}/100\n`;
550
- report += `**Status**: ${_analysis.overallScore >= 70 ? 'PASSED' : 'FAILED'}\n\n`;
551
- report += '## Executive Summary\n';
552
- report += `- **Artifacts Scanned**: ${_analysis.totalArtifacts}\n`;
553
- report += `- **Total Vulnerabilities**: ${_analysis.totalVulnerabilities}\n`;
554
- report += `- **Critical Vulnerabilities**: ${_analysis.criticalVulnerabilities}\n`;
555
- report += `- **High Vulnerabilities**: ${_analysis.highVulnerabilities}\n`;
556
- report += `- **Compliance Issues**: ${_analysis.totalComplianceIssues}\n\n`;
557
- report += '## Vulnerability Breakdown\n';
558
- for (const [type, count] of Object.entries(_analysis.vulnerabilityBreakdown)) {
559
- report += `- **${type}**: ${count} instances\n`;
560
- }
561
- report += '\n';
562
- report += '## Detailed Findings\n\n';
563
- for (const result of scanResults) {
564
- report += `### ${result.artifact}\n`;
565
- report += `**Security Score**: ${result.securityScore}/100\n`;
566
- if (result.vulnerabilities.length > 0) {
567
- report += '\n**Vulnerabilities**:\n';
568
- for (const vuln of result.vulnerabilities) {
569
- report += `- **${vuln.severity.toUpperCase()}**: ${vuln.type}\n`;
570
- report += ` - Description: ${vuln.description}\n`;
571
- report += ` - Location: ${vuln.location}\n`;
572
- report += ` - Recommendation: ${vuln.recommendation}\n`;
573
- }
574
- }
575
- if (result.complianceIssues.length > 0) {
576
- report += '\n**Compliance Issues**:\n';
577
- for (const issue of result.complianceIssues) {
578
- report += `- **${issue.framework}** - ${issue.requirement}: ${issue.status}\n`;
579
- report += ` - Finding: ${issue.finding}\n`;
580
- report += ` - Remediation: ${issue.remediation}\n`;
581
- }
582
- }
583
- report += '\n';
584
- }
585
- if (remediationPlan) {
586
- report += '## Remediation Plan\n\n';
587
- report += `**Estimated Total Effort**: ${remediationPlan.estimatedEffort} hours\n\n`;
588
- if (remediationPlan.timeline.immediate.length > 0) {
589
- report += '### Immediate Actions (Critical)\n';
590
- for (const action of remediationPlan.timeline.immediate) {
591
- report += `- ${action.artifact}: ${action.action} (${action.effort}h)\n`;
592
- }
593
- report += '\n';
594
- }
595
- if (remediationPlan.timeline.shortTerm.length > 0) {
596
- report += '### Short Term (1-2 weeks)\n';
597
- for (const action of remediationPlan.timeline.shortTerm) {
598
- report += `- ${action.artifact}: ${action.action} (${action.effort}h)\n`;
599
- }
600
- report += '\n';
601
- }
602
- if (remediationPlan.timeline.longTerm.length > 0) {
603
- report += '### Long Term (1-3 months)\n';
604
- for (const action of remediationPlan.timeline.longTerm) {
605
- report += `- ${action.artifact}: ${action.action} (${action.effort}h)\n`;
606
- }
607
- }
608
- }
609
- report += '\n## Recommendations\n';
610
- report += '1. Address all critical vulnerabilities immediately\n';
611
- report += '2. Implement security policies for all new development\n';
612
- report += '3. Enable audit logging for compliance requirements\n';
613
- report += '4. Conduct regular security scans (weekly for critical systems)\n';
614
- report += '5. Provide security training for development team\n';
615
- return report;
616
- }
617
- }
618
- exports.SecurityAgent = SecurityAgent;
619
- //# sourceMappingURL=security-agent.js.map
@@ -1,44 +0,0 @@
1
- /**
2
- * Automation Specialist Agent - Handles workflow automation, business rules, and scheduled tasks
3
- */
4
- import { BaseSnowAgent } from '../base/base-snow-agent.js';
5
- import { Task } from '../../types/snow-flow.types.js';
6
- export interface AutomationRequirements {
7
- triggerType: 'event' | 'schedule' | 'manual' | 'condition';
8
- targetTable: string;
9
- conditions: string[];
10
- actions: AutomationAction[];
11
- errorHandling: ErrorHandlingStrategy;
12
- monitoring: MonitoringConfig;
13
- }
14
- export interface AutomationAction {
15
- type: 'field_update' | 'record_create' | 'notification' | 'script_execution' | 'approval_request';
16
- configuration: Record<string, any>;
17
- order: number;
18
- conditions?: string[];
19
- }
20
- export interface ErrorHandlingStrategy {
21
- onFailure: 'stop' | 'continue' | 'retry' | 'escalate';
22
- retryAttempts?: number;
23
- notifications?: string[];
24
- }
25
- export interface MonitoringConfig {
26
- trackExecution: boolean;
27
- logLevel: 'minimal' | 'detailed' | 'debug';
28
- performanceMetrics: boolean;
29
- }
30
- export declare class AutomationSpecialistAgent extends BaseSnowAgent {
31
- constructor();
32
- execute(task: Task, input?: any): Promise<any>;
33
- analyzeAutomationRequirements(description: string, context?: any): Promise<AutomationRequirements>;
34
- createWorkflow(requirements: AutomationRequirements): Promise<any>;
35
- setupBusinessRule(config: any): Promise<any>;
36
- createScheduledTask(schedule: any): Promise<any>;
37
- private determineTriggerType;
38
- private extractTargetTable;
39
- private extractConditions;
40
- private identifyActions;
41
- private generateBusinessRuleScript;
42
- private generateScheduledScript;
43
- }
44
- //# sourceMappingURL=automation-specialist.agent.d.ts.map