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.
- package/claude-flow.bat +0 -0
- package/claude-flow.ps1 +0 -0
- package/dist/mcp/intelligent-reporting-mcp.d.ts +7 -0
- package/dist/mcp/intelligent-reporting-mcp.js +379 -0
- package/dist/mcp/servicenow-automation-mcp.js +0 -0
- package/dist/mcp/servicenow-deployment-mcp.js +0 -0
- package/dist/mcp/servicenow-integration-mcp.js +0 -0
- package/dist/mcp/servicenow-mcp-server.js +0 -0
- package/dist/mcp/servicenow-operations-mcp.js +0 -0
- package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
- package/dist/mcp/servicenow-progressive-indexer.js +0 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.js +280 -29
- package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
- package/dist/mcp/servicenow-update-set-mcp.js +0 -0
- package/dist/mcp/start-all-mcp-servers.js +0 -0
- package/dist/mcp/start-servicenow-mcp.js +0 -0
- package/dist/services/widget-deployment-service.d.ts +2 -1
- package/dist/services/widget-deployment-service.js +17 -16
- package/dist/utils/anti-mock-data-validator.d.ts +66 -0
- package/dist/utils/anti-mock-data-validator.js +316 -0
- package/dist/utils/servicenow-eventual-consistency.d.ts +120 -0
- package/dist/utils/servicenow-eventual-consistency.js +220 -0
- package/memory/agents/README.md +1 -1
- package/memory/claude-flow-data.json +1 -1
- package/memory/sessions/README.md +1 -1
- package/package.json +4 -3
- package/.mcp.json +0 -22
- package/claude-flow.config.json +0 -20
- package/dist/agents/app-creator.agent.d.ts +0 -55
- package/dist/agents/app-creator.agent.js +0 -1292
- package/dist/agents/base/base-snow-agent.d.ts +0 -75
- package/dist/agents/base/base-snow-agent.js +0 -169
- package/dist/agents/base-snow-agent.d.ts +0 -63
- package/dist/agents/base-snow-agent.js +0 -296
- package/dist/agents/coordinator.d.ts +0 -200
- package/dist/agents/coordinator.js +0 -777
- package/dist/agents/flow-builder-agent.d.ts +0 -18
- package/dist/agents/flow-builder-agent.js +0 -197
- package/dist/agents/queen-403-handler.d.ts +0 -47
- package/dist/agents/queen-403-handler.js +0 -175
- package/dist/agents/queen-agent-example.d.ts +0 -23
- package/dist/agents/queen-agent-example.js +0 -240
- package/dist/agents/queen-agent.test.d.ts +0 -6
- package/dist/agents/script-generator.agent.d.ts +0 -32
- package/dist/agents/script-generator.agent.js +0 -772
- package/dist/agents/script-writer-agent.d.ts +0 -22
- package/dist/agents/script-writer-agent.js +0 -695
- package/dist/agents/security-agent.d.ts +0 -23
- package/dist/agents/security-agent.js +0 -619
- package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
- package/dist/agents/specialists/automation-specialist.agent.js +0 -204
- package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
- package/dist/agents/specialists/data-specialist.agent.js +0 -484
- package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
- package/dist/agents/specialists/integration-specialist.agent.js +0 -725
- package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
- package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
- package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
- package/dist/agents/specialists/security-specialist.agent.js +0 -309
- package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
- package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
- package/dist/agents/teams/base-team.d.ts +0 -72
- package/dist/agents/teams/base-team.js +0 -253
- package/dist/agents/teams/team-types.d.ts +0 -265
- package/dist/agents/teams/team-types.js +0 -3
- package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
- package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
- package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
- package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
- package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
- package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
- package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
- package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
- package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
- package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
- package/dist/agents/test-agent.d.ts +0 -26
- package/dist/agents/test-agent.js +0 -734
- package/dist/agents/test-agents.d.ts +0 -7
- package/dist/agents/test-agents.js +0 -64
- package/dist/agents/ui-builder.agent.d.ts +0 -50
- package/dist/agents/ui-builder.agent.js +0 -1539
- package/dist/agents/widget-builder.agent.d.ts +0 -32
- package/dist/agents/widget-builder.agent.js +0 -439
- package/dist/agents/widget-creator-agent.d.ts +0 -18
- package/dist/agents/widget-creator-agent.js +0 -498
- package/dist/agents/workflow-designer.agent.d.ts +0 -31
- package/dist/agents/workflow-designer.agent.js +0 -583
- package/dist/api/error-handling.d.ts +0 -325
- package/dist/api/error-handling.js +0 -1488
- package/dist/api/flow-designer-api.d.ts +0 -167
- package/dist/api/flow-designer-api.js +0 -554
- package/dist/api/natural-language-mapper.d.ts +0 -124
- package/dist/api/natural-language-mapper.js +0 -501
- package/dist/api/performance-optimizer.d.ts +0 -240
- package/dist/api/performance-optimizer.js +0 -706
- package/dist/api/transaction-manager.d.ts +0 -189
- package/dist/api/transaction-manager.js +0 -576
- package/dist/assembly/team-assembler.d.ts +0 -140
- package/dist/assembly/team-assembler.js +0 -502
- package/dist/benchmark-performance.d.ts +0 -41
- package/dist/benchmark-performance.js +0 -230
- package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
- package/dist/cli/snow-flow-cli-integration.js +0 -396
- package/dist/coordination/coordination-engine.d.ts +0 -41
- package/dist/coordination/coordination-engine.js +0 -324
- package/dist/coordination/coordination.test.d.ts +0 -6
- package/dist/coordination/example.d.ts +0 -31
- package/dist/coordination/example.js +0 -394
- package/dist/coordination/execution-patterns.d.ts +0 -43
- package/dist/coordination/execution-patterns.js +0 -507
- package/dist/coordination/factory.d.ts +0 -94
- package/dist/coordination/factory.js +0 -433
- package/dist/coordination/index.d.ts +0 -71
- package/dist/coordination/index.js +0 -135
- package/dist/coordination/progress-monitor.d.ts +0 -71
- package/dist/coordination/progress-monitor.js +0 -505
- package/dist/coordination/quality-gates.d.ts +0 -124
- package/dist/coordination/quality-gates.js +0 -577
- package/dist/coordination/shared-memory.d.ts +0 -39
- package/dist/coordination/shared-memory.js +0 -289
- package/dist/coordination/task-dependencies.d.ts +0 -50
- package/dist/coordination/task-dependencies.js +0 -407
- package/dist/coordination/team-coordinator.d.ts +0 -59
- package/dist/coordination/team-coordinator.js +0 -550
- package/dist/coordination/types.d.ts +0 -152
- package/dist/coordination/types.js +0 -3
- package/dist/mcp/mcp-wrapper.d.ts +0 -8
- package/dist/mcp/mcp-wrapper.js +0 -77
- package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
- package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
- package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
- package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
- package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
- package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
- package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
- package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
- package/dist/mcp/singleton-check.js +0 -31
- package/dist/mcp/test-simple-mcp.d.ts +0 -6
- package/dist/mcp/test-simple-mcp.js +0 -63
- package/dist/memory/hierarchical-memory-system.d.ts +0 -90
- package/dist/memory/hierarchical-memory-system.js +0 -400
- package/dist/memory/index.d.ts +0 -9
- package/dist/memory/index.js +0 -20
- package/dist/memory/mcp-integration-example.d.ts +0 -6
- package/dist/memory/mcp-integration-example.js +0 -281
- package/dist/memory/memory-client.d.ts +0 -199
- package/dist/memory/memory-client.js +0 -364
- package/dist/memory/memory-manager.d.ts +0 -29
- package/dist/memory/memory-manager.js +0 -280
- package/dist/memory/memory-operations.d.ts +0 -179
- package/dist/memory/memory-operations.js +0 -691
- package/dist/memory/memory-system.d.ts +0 -153
- package/dist/memory/memory-system.js +0 -651
- package/dist/memory/memory-test.d.ts +0 -6
- package/dist/memory/memory-test.js +0 -161
- package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
- package/dist/memory/snow-flow-memory-patterns.js +0 -200
- package/dist/memory/snow-memory.d.ts +0 -54
- package/dist/memory/snow-memory.js +0 -301
- package/dist/memory/swarm-memory.d.ts +0 -135
- package/dist/memory/swarm-memory.js +0 -378
- package/dist/optimization/flow-performance-optimizer.js +0 -723
- package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
- package/dist/orchestration/discovery/service-discovery.js +0 -808
- package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
- package/dist/orchestration/distributed-orchestrator.js +0 -712
- package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
- package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
- package/dist/orchestration/flow-update-orchestrator.js +0 -648
- package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
- package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
- package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
- package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
- package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
- package/dist/orchestration/state/distributed-state-manager.js +0 -716
- package/dist/orchestrator/flow-composer.d.ts +0 -105
- package/dist/orchestrator/flow-composer.js +0 -404
- package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
- package/dist/orchestrator/flow-pattern-templates.js +0 -908
- package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
- package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
- package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
- package/dist/orchestrator/flow-validation-engine.js +0 -913
- package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
- package/dist/orchestrator/snow-orchestrator.js +0 -235
- package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
- package/dist/orchestrator/subflow-creation-handler.js +0 -791
- package/dist/patterns/adaptive-patterns.d.ts +0 -140
- package/dist/patterns/adaptive-patterns.js +0 -549
- package/dist/queen/advanced-integration-test.d.ts +0 -48
- package/dist/queen/advanced-integration-test.js +0 -473
- package/dist/queen/integration-example.d.ts +0 -82
- package/dist/queen/integration-example.js +0 -219
- package/dist/queen/integration-test.d.ts +0 -72
- package/dist/queen/integration-test.js +0 -563
- package/dist/queen/mock-mcp-client.d.ts +0 -71
- package/dist/queen/mock-mcp-client.js +0 -317
- package/dist/queen/run-integration-tests.d.ts +0 -9
- package/dist/queen/run-integration-tests.js +0 -27
- package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
- package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
- package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
- package/dist/sparc/coordinators/team-coordinator.js +0 -402
- package/dist/sparc/modes/team-modes.d.ts +0 -33
- package/dist/sparc/modes/team-modes.js +0 -399
- package/dist/sparc/teams/application-team.d.ts +0 -73
- package/dist/sparc/teams/application-team.js +0 -463
- package/dist/sparc/teams/flow-team.d.ts +0 -67
- package/dist/sparc/teams/flow-team.js +0 -373
- package/dist/sparc/teams/widget-team.d.ts +0 -61
- package/dist/sparc/teams/widget-team.js +0 -280
- package/dist/specialists/app-specialists.d.ts +0 -93
- package/dist/specialists/app-specialists.js +0 -1639
- package/dist/specialists/base-specialist.d.ts +0 -19
- package/dist/specialists/base-specialist.js +0 -54
- package/dist/specialists/flow-specialists.d.ts +0 -113
- package/dist/specialists/flow-specialists.js +0 -1787
- package/dist/specialists/individual-specialists.d.ts +0 -67
- package/dist/specialists/individual-specialists.js +0 -632
- package/dist/specialists/widget-specialists.d.ts +0 -70
- package/dist/specialists/widget-specialists.js +0 -1264
- package/dist/src/utils/agent-detector.js +0 -655
- package/dist/teams/adaptive-team.d.ts +0 -81
- package/dist/teams/adaptive-team.js +0 -1153
- package/dist/teams/application-team.d.ts +0 -30
- package/dist/teams/application-team.js +0 -547
- package/dist/teams/base-team.d.ts +0 -55
- package/dist/teams/base-team.js +0 -243
- package/dist/teams/flow-team.d.ts +0 -28
- package/dist/teams/flow-team.js +0 -525
- package/dist/teams/widget-team.d.ts +0 -26
- package/dist/teams/widget-team.js +0 -459
- package/dist/templates/flow-template-system.js +0 -625
- package/dist/test-fetch-incidents.d.ts +0 -2
- package/dist/test-fetch-incidents.js +0 -84
- package/dist/test-incident-access.d.ts +0 -2
- package/dist/test-incident-access.js +0 -72
- package/dist/test-iphone-flow.js +0 -189
- package/dist/test-limit-problem.d.ts +0 -2
- package/dist/test-limit-problem.js +0 -60
- package/dist/test-ml-batch-fix.d.ts +0 -2
- package/dist/test-ml-batch-fix.js +0 -104
- package/dist/test-ml-batch.d.ts +0 -2
- package/dist/test-ml-batch.js +0 -87
- package/dist/test-ml-query.d.ts +0 -2
- package/dist/test-ml-query.js +0 -100
- package/dist/test-ml-training-fix.d.ts +0 -12
- package/dist/test-ml-training-fix.js +0 -113
- package/dist/test-ml-training.d.ts +0 -2
- package/dist/test-ml-training.js +0 -32
- package/dist/test-operations-query.d.ts +0 -2
- package/dist/test-operations-query.js +0 -84
- package/dist/test-performance-query.d.ts +0 -2
- package/dist/test-performance-query.js +0 -52
- package/dist/test-singleton-protection.d.ts +0 -8
- package/dist/test-singleton-protection.js +0 -110
- package/dist/test-smart-limits.d.ts +0 -13
- package/dist/test-smart-limits.js +0 -100
- package/dist/test-snow-query-incidents.d.ts +0 -2
- package/dist/test-snow-query-incidents.js +0 -66
- package/dist/test-universal-query.d.ts +0 -2
- package/dist/test-universal-query.js +0 -106
- package/dist/testing/flow-testing-automation.js +0 -641
- package/dist/utils/complete-flow-xml-generator.js +0 -1285
- package/dist/utils/file-storage-fallback.d.ts +0 -62
- package/dist/utils/file-storage-fallback.js +0 -289
- package/dist/utils/flow-api-discovery.d.ts +0 -151
- package/dist/utils/flow-api-discovery.js +0 -439
- package/dist/utils/flow-examples.js +0 -720
- package/dist/utils/flow-structure-builder.js +0 -677
- package/dist/utils/flow-xml-generator.d.ts +0 -41
- package/dist/utils/flow-xml-generator.js +0 -258
- package/dist/utils/improved-flow-xml-generator.js +0 -820
- package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
- package/dist/utils/mcp-process-manager.backup.js +0 -220
- package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
- package/dist/utils/mcp-singleton-enforcer.js +0 -201
- package/dist/utils/mcp-timeout-fix.d.ts +0 -53
- package/dist/utils/mcp-timeout-fix.js +0 -221
- package/dist/utils/migrate-claude-flow.d.ts +0 -22
- package/dist/utils/migrate-claude-flow.js +0 -120
- package/dist/utils/scope-utils.d.ts +0 -72
- package/dist/utils/scope-utils.js +0 -386
- package/dist/utils/snow-oauth-old.d.ts +0 -65
- package/dist/utils/snow-oauth-old.js +0 -345
- package/dist/utils/xml-first-flow-generator.js +0 -513
- package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
- package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
- package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
- package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
- package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
- package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
- package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
- package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
- package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
- package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
- package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
- package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
- package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
- package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
- package/reports/swarm-auto-centralized-1752649029776.json +0 -13
- package/src/memory/README.md +0 -240
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { ProgressStatus, ProgressListener, BaseTeam } from './types';
|
|
3
|
-
import { TaskDependencyGraph } from './task-dependencies';
|
|
4
|
-
export declare class ProgressMonitor extends EventEmitter {
|
|
5
|
-
private listeners;
|
|
6
|
-
private monitoringActive;
|
|
7
|
-
private monitoringInterval?;
|
|
8
|
-
private agentHealthInterval?;
|
|
9
|
-
private memoryMonitorInterval?;
|
|
10
|
-
private progressHistory;
|
|
11
|
-
private agentMetrics;
|
|
12
|
-
private bottleneckDetector;
|
|
13
|
-
private performanceAnalyzer;
|
|
14
|
-
constructor();
|
|
15
|
-
startMonitoring(team: BaseTeam, taskGraph: TaskDependencyGraph): Promise<void>;
|
|
16
|
-
stopMonitoring(): Promise<void>;
|
|
17
|
-
private monitorTaskProgress;
|
|
18
|
-
private monitorAgentHealth;
|
|
19
|
-
private monitorSharedMemory;
|
|
20
|
-
private monitorPerformance;
|
|
21
|
-
private detectBottlenecks;
|
|
22
|
-
private getProgressStatus;
|
|
23
|
-
private checkAgentHealth;
|
|
24
|
-
private performAgentHealthCheck;
|
|
25
|
-
private updateAgentMetrics;
|
|
26
|
-
private estimateCompletion;
|
|
27
|
-
private determineCurrentPhase;
|
|
28
|
-
private gatherMetrics;
|
|
29
|
-
private analyzeTrends;
|
|
30
|
-
private calculateProgressRate;
|
|
31
|
-
private calculateErrorRate;
|
|
32
|
-
addListener(listener: ProgressListener): void;
|
|
33
|
-
removeListener(listener: ProgressListener): void;
|
|
34
|
-
private notifyListeners;
|
|
35
|
-
getDetailedReport(): Promise<DetailedProgressReport>;
|
|
36
|
-
private generateTrendSummary;
|
|
37
|
-
private describeTrend;
|
|
38
|
-
private generateRecommendations;
|
|
39
|
-
}
|
|
40
|
-
interface AgentMetrics {
|
|
41
|
-
totalChecks: number;
|
|
42
|
-
healthyChecks: number;
|
|
43
|
-
averageResponseTime: number;
|
|
44
|
-
lastSeen: Date;
|
|
45
|
-
errors: {
|
|
46
|
-
timestamp: Date;
|
|
47
|
-
error: string;
|
|
48
|
-
}[];
|
|
49
|
-
}
|
|
50
|
-
interface OverallPerformanceMetrics {
|
|
51
|
-
averageEfficiency: number;
|
|
52
|
-
averageThroughput: number;
|
|
53
|
-
bestEfficiency: number;
|
|
54
|
-
worstEfficiency: number;
|
|
55
|
-
trend: 'improving' | 'declining' | 'stable' | 'unknown';
|
|
56
|
-
}
|
|
57
|
-
interface DetailedProgressReport {
|
|
58
|
-
overview: ProgressStatus | null;
|
|
59
|
-
agentMetrics: Record<string, AgentMetrics>;
|
|
60
|
-
performanceMetrics: OverallPerformanceMetrics;
|
|
61
|
-
trends: TrendSummary;
|
|
62
|
-
recommendations: string[];
|
|
63
|
-
}
|
|
64
|
-
interface TrendSummary {
|
|
65
|
-
direction: 'improving' | 'declining' | 'stable' | 'unknown';
|
|
66
|
-
confidence: number;
|
|
67
|
-
description: string;
|
|
68
|
-
progressRate?: number;
|
|
69
|
-
}
|
|
70
|
-
export {};
|
|
71
|
-
//# sourceMappingURL=progress-monitor.d.ts.map
|
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProgressMonitor = void 0;
|
|
4
|
-
const eventemitter3_1 = require("eventemitter3");
|
|
5
|
-
const logger_1 = require("../utils/logger");
|
|
6
|
-
class ProgressMonitor extends eventemitter3_1.EventEmitter {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.listeners = new Set();
|
|
10
|
-
this.monitoringActive = false;
|
|
11
|
-
this.progressHistory = [];
|
|
12
|
-
this.agentMetrics = new Map();
|
|
13
|
-
this.bottleneckDetector = new BottleneckDetector();
|
|
14
|
-
this.performanceAnalyzer = new PerformanceAnalyzer();
|
|
15
|
-
logger_1.logger.info('📊 Progress Monitor initialized');
|
|
16
|
-
}
|
|
17
|
-
async startMonitoring(team, taskGraph) {
|
|
18
|
-
if (this.monitoringActive) {
|
|
19
|
-
logger_1.logger.warn('⚠️ Progress monitoring already active');
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
this.monitoringActive = true;
|
|
23
|
-
logger_1.logger.info('📊 Starting comprehensive team progress monitoring');
|
|
24
|
-
// Start different monitoring aspects
|
|
25
|
-
await Promise.all([
|
|
26
|
-
this.monitorTaskProgress(taskGraph),
|
|
27
|
-
this.monitorAgentHealth(team),
|
|
28
|
-
this.monitorSharedMemory(),
|
|
29
|
-
this.monitorPerformance(taskGraph),
|
|
30
|
-
this.detectBottlenecks(taskGraph)
|
|
31
|
-
]);
|
|
32
|
-
this.emit('monitoring:started', {
|
|
33
|
-
teamSize: team.agents.size,
|
|
34
|
-
totalTasks: taskGraph.getTotalTasks()
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async stopMonitoring() {
|
|
38
|
-
this.monitoringActive = false;
|
|
39
|
-
if (this.monitoringInterval) {
|
|
40
|
-
clearInterval(this.monitoringInterval);
|
|
41
|
-
}
|
|
42
|
-
if (this.agentHealthInterval) {
|
|
43
|
-
clearInterval(this.agentHealthInterval);
|
|
44
|
-
}
|
|
45
|
-
if (this.memoryMonitorInterval) {
|
|
46
|
-
clearInterval(this.memoryMonitorInterval);
|
|
47
|
-
}
|
|
48
|
-
logger_1.logger.info('🛑 Progress monitoring stopped');
|
|
49
|
-
this.emit('monitoring:stopped');
|
|
50
|
-
}
|
|
51
|
-
async monitorTaskProgress(taskGraph) {
|
|
52
|
-
this.monitoringInterval = setInterval(async () => {
|
|
53
|
-
try {
|
|
54
|
-
const status = await this.getProgressStatus(taskGraph);
|
|
55
|
-
// Store progress snapshot
|
|
56
|
-
this.progressHistory.push({
|
|
57
|
-
timestamp: new Date(),
|
|
58
|
-
status,
|
|
59
|
-
metrics: await this.gatherMetrics(taskGraph)
|
|
60
|
-
});
|
|
61
|
-
// Keep only last 100 snapshots
|
|
62
|
-
if (this.progressHistory.length > 100) {
|
|
63
|
-
this.progressHistory = this.progressHistory.slice(-100);
|
|
64
|
-
}
|
|
65
|
-
// Notify listeners
|
|
66
|
-
this.notifyListeners('task_progress', status);
|
|
67
|
-
// Check for completion
|
|
68
|
-
if (status.completed) {
|
|
69
|
-
await this.stopMonitoring();
|
|
70
|
-
this.emit('monitoring:completed', status);
|
|
71
|
-
}
|
|
72
|
-
// Analyze trends
|
|
73
|
-
await this.analyzeTrends();
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
logger_1.logger.error('❌ Task progress monitoring error', { error: error.message });
|
|
77
|
-
}
|
|
78
|
-
}, 1000); // Check every second
|
|
79
|
-
}
|
|
80
|
-
async monitorAgentHealth(team) {
|
|
81
|
-
this.agentHealthInterval = setInterval(async () => {
|
|
82
|
-
try {
|
|
83
|
-
const healthReport = await this.checkAgentHealth(team);
|
|
84
|
-
// Update agent metrics
|
|
85
|
-
for (const [agentId, health] of Object.entries(healthReport.agents)) {
|
|
86
|
-
this.updateAgentMetrics(agentId, health);
|
|
87
|
-
}
|
|
88
|
-
this.notifyListeners('agent_health', healthReport);
|
|
89
|
-
// Check for unhealthy agents
|
|
90
|
-
const unhealthyAgents = Object.entries(healthReport.agents)
|
|
91
|
-
.filter(([, health]) => health.status === 'error' || health.responseTime > 30000);
|
|
92
|
-
if (unhealthyAgents.length > 0) {
|
|
93
|
-
this.emit('agents:unhealthy', { agents: unhealthyAgents });
|
|
94
|
-
logger_1.logger.warn('⚠️ Unhealthy agents detected', {
|
|
95
|
-
count: unhealthyAgents.length,
|
|
96
|
-
agents: unhealthyAgents.map(([id]) => id)
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
logger_1.logger.error('❌ Agent health monitoring error', { error: error.message });
|
|
102
|
-
}
|
|
103
|
-
}, 5000); // Check every 5 seconds
|
|
104
|
-
}
|
|
105
|
-
async monitorSharedMemory() {
|
|
106
|
-
this.memoryMonitorInterval = setInterval(async () => {
|
|
107
|
-
try {
|
|
108
|
-
// This would integrate with the SharedMemoryManager
|
|
109
|
-
// For now, we'll simulate memory monitoring
|
|
110
|
-
const memoryStats = {
|
|
111
|
-
usage: Math.random() * 100,
|
|
112
|
-
operations: Math.floor(Math.random() * 50),
|
|
113
|
-
conflicts: Math.floor(Math.random() * 3)
|
|
114
|
-
};
|
|
115
|
-
this.notifyListeners('memory_stats', memoryStats);
|
|
116
|
-
// Check for memory issues
|
|
117
|
-
if (memoryStats.usage > 90) {
|
|
118
|
-
this.emit('memory:high_usage', memoryStats);
|
|
119
|
-
logger_1.logger.warn('⚠️ High memory usage detected', memoryStats);
|
|
120
|
-
}
|
|
121
|
-
if (memoryStats.conflicts > 5) {
|
|
122
|
-
this.emit('memory:conflicts', memoryStats);
|
|
123
|
-
logger_1.logger.warn('⚠️ Memory conflicts detected', memoryStats);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
logger_1.logger.error('❌ Memory monitoring error', { error: error.message });
|
|
128
|
-
}
|
|
129
|
-
}, 3000); // Check every 3 seconds
|
|
130
|
-
}
|
|
131
|
-
async monitorPerformance(taskGraph) {
|
|
132
|
-
const performanceCheck = async () => {
|
|
133
|
-
try {
|
|
134
|
-
const performance = await this.performanceAnalyzer.analyze(taskGraph);
|
|
135
|
-
this.notifyListeners('performance_metrics', performance);
|
|
136
|
-
// Check for performance degradation
|
|
137
|
-
if (performance.efficiency < 0.5) {
|
|
138
|
-
this.emit('performance:degradation', performance);
|
|
139
|
-
logger_1.logger.warn('⚠️ Performance degradation detected', performance);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
logger_1.logger.error('❌ Performance monitoring error', { error: error.message });
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
// Run performance check every 10 seconds
|
|
147
|
-
setInterval(performanceCheck, 10000);
|
|
148
|
-
}
|
|
149
|
-
async detectBottlenecks(taskGraph) {
|
|
150
|
-
const bottleneckCheck = async () => {
|
|
151
|
-
try {
|
|
152
|
-
const bottlenecks = await this.bottleneckDetector.detect(taskGraph);
|
|
153
|
-
if (bottlenecks.length > 0) {
|
|
154
|
-
this.notifyListeners('bottlenecks_detected', bottlenecks);
|
|
155
|
-
this.emit('bottlenecks:detected', { bottlenecks });
|
|
156
|
-
logger_1.logger.warn('🚧 Bottlenecks detected', {
|
|
157
|
-
count: bottlenecks.length,
|
|
158
|
-
types: bottlenecks.map(b => b.type)
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
logger_1.logger.error('❌ Bottleneck detection error', { error: error.message });
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
// Run bottleneck detection every 15 seconds
|
|
167
|
-
setInterval(bottleneckCheck, 15000);
|
|
168
|
-
}
|
|
169
|
-
async getProgressStatus(taskGraph) {
|
|
170
|
-
const totalTasks = taskGraph.getTotalTasks();
|
|
171
|
-
const completedTasks = taskGraph.getCompletedTasks();
|
|
172
|
-
const failedTasks = taskGraph.getFailedTasks();
|
|
173
|
-
const inProgressTasks = taskGraph.getInProgressTasks();
|
|
174
|
-
const percentage = totalTasks > 0 ? Math.round((completedTasks.length / totalTasks) * 100) : 0;
|
|
175
|
-
const estimatedCompletion = this.estimateCompletion(taskGraph);
|
|
176
|
-
const currentPhase = this.determineCurrentPhase(taskGraph);
|
|
177
|
-
const bottlenecks = await this.bottleneckDetector.detect(taskGraph);
|
|
178
|
-
return {
|
|
179
|
-
total: totalTasks,
|
|
180
|
-
completed: completedTasks.length,
|
|
181
|
-
failed: failedTasks.length,
|
|
182
|
-
inProgress: inProgressTasks.length,
|
|
183
|
-
percentage,
|
|
184
|
-
estimated_completion: estimatedCompletion,
|
|
185
|
-
currentPhase,
|
|
186
|
-
bottlenecks: bottlenecks.map(b => b.description)
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
async checkAgentHealth(team) {
|
|
190
|
-
const agents = {};
|
|
191
|
-
let overallHealth = 'healthy';
|
|
192
|
-
for (const [agentId, agent] of team.agents) {
|
|
193
|
-
try {
|
|
194
|
-
const startTime = Date.now();
|
|
195
|
-
// Simulate health check (in real implementation, this would ping the agent)
|
|
196
|
-
const healthCheckResult = await this.performAgentHealthCheck(agent);
|
|
197
|
-
const responseTime = Date.now() - startTime;
|
|
198
|
-
agents[agentId] = {
|
|
199
|
-
status: healthCheckResult.status,
|
|
200
|
-
responseTime,
|
|
201
|
-
lastActivity: agent.lastActivity,
|
|
202
|
-
currentTask: healthCheckResult.currentTask,
|
|
203
|
-
memoryUsage: healthCheckResult.memoryUsage,
|
|
204
|
-
errorCount: healthCheckResult.errorCount
|
|
205
|
-
};
|
|
206
|
-
if (healthCheckResult.status === 'error') {
|
|
207
|
-
overallHealth = 'degraded';
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
agents[agentId] = {
|
|
212
|
-
status: 'error',
|
|
213
|
-
responseTime: 0,
|
|
214
|
-
lastActivity: agent.lastActivity,
|
|
215
|
-
error: error.message
|
|
216
|
-
};
|
|
217
|
-
overallHealth = 'degraded';
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return {
|
|
221
|
-
overall: overallHealth,
|
|
222
|
-
agents,
|
|
223
|
-
timestamp: new Date()
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
async performAgentHealthCheck(agent) {
|
|
227
|
-
// Simulate agent health check
|
|
228
|
-
// In real implementation, this would communicate with the actual agent
|
|
229
|
-
const isHealthy = Math.random() > 0.1; // 90% healthy
|
|
230
|
-
return {
|
|
231
|
-
status: isHealthy ? 'idle' : 'error',
|
|
232
|
-
currentTask: isHealthy ? null : 'stuck_task',
|
|
233
|
-
memoryUsage: Math.random() * 100,
|
|
234
|
-
errorCount: isHealthy ? 0 : Math.floor(Math.random() * 5)
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
updateAgentMetrics(agentId, health) {
|
|
238
|
-
const existing = this.agentMetrics.get(agentId) || {
|
|
239
|
-
totalChecks: 0,
|
|
240
|
-
healthyChecks: 0,
|
|
241
|
-
averageResponseTime: 0,
|
|
242
|
-
lastSeen: new Date(),
|
|
243
|
-
errors: []
|
|
244
|
-
};
|
|
245
|
-
existing.totalChecks++;
|
|
246
|
-
if (health.status !== 'error') {
|
|
247
|
-
existing.healthyChecks++;
|
|
248
|
-
}
|
|
249
|
-
if (health.responseTime) {
|
|
250
|
-
existing.averageResponseTime =
|
|
251
|
-
(existing.averageResponseTime * (existing.totalChecks - 1) + health.responseTime) / existing.totalChecks;
|
|
252
|
-
}
|
|
253
|
-
existing.lastSeen = new Date();
|
|
254
|
-
if (health.error) {
|
|
255
|
-
existing.errors.push({
|
|
256
|
-
timestamp: new Date(),
|
|
257
|
-
error: health.error
|
|
258
|
-
});
|
|
259
|
-
// Keep only last 10 errors
|
|
260
|
-
if (existing.errors.length > 10) {
|
|
261
|
-
existing.errors = existing.errors.slice(-10);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
this.agentMetrics.set(agentId, existing);
|
|
265
|
-
}
|
|
266
|
-
estimateCompletion(taskGraph) {
|
|
267
|
-
const inProgressTasks = taskGraph.getInProgressTasks();
|
|
268
|
-
const pendingTasks = taskGraph.getPendingTasks();
|
|
269
|
-
if (inProgressTasks.length === 0 && pendingTasks.length === 0) {
|
|
270
|
-
return new Date(); // Already completed
|
|
271
|
-
}
|
|
272
|
-
// Calculate average task duration from completed tasks
|
|
273
|
-
const completedTasks = taskGraph.getCompletedTasks();
|
|
274
|
-
const averageDuration = completedTasks.length > 0
|
|
275
|
-
? completedTasks.reduce((sum, task) => {
|
|
276
|
-
const duration = task.endTime && task.startTime
|
|
277
|
-
? task.endTime.getTime() - task.startTime.getTime()
|
|
278
|
-
: 60000;
|
|
279
|
-
return sum + duration;
|
|
280
|
-
}, 0) / completedTasks.length
|
|
281
|
-
: 60000; // Default 1 minute
|
|
282
|
-
// Estimate remaining time
|
|
283
|
-
const estimatedRemainingTime = (inProgressTasks.length + pendingTasks.length) * averageDuration;
|
|
284
|
-
return new Date(Date.now() + estimatedRemainingTime);
|
|
285
|
-
}
|
|
286
|
-
determineCurrentPhase(taskGraph) {
|
|
287
|
-
const totalTasks = taskGraph.getTotalTasks();
|
|
288
|
-
const completedTasks = taskGraph.getCompletedTasks().length;
|
|
289
|
-
const percentage = totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0;
|
|
290
|
-
if (percentage < 25)
|
|
291
|
-
return 'Initialization';
|
|
292
|
-
if (percentage < 50)
|
|
293
|
-
return 'Development';
|
|
294
|
-
if (percentage < 75)
|
|
295
|
-
return 'Integration';
|
|
296
|
-
if (percentage < 90)
|
|
297
|
-
return 'Testing';
|
|
298
|
-
if (percentage < 100)
|
|
299
|
-
return 'Finalization';
|
|
300
|
-
return 'Completed';
|
|
301
|
-
}
|
|
302
|
-
async gatherMetrics(taskGraph) {
|
|
303
|
-
return {
|
|
304
|
-
taskMetrics: await taskGraph.getExecutionStats(),
|
|
305
|
-
agentMetrics: Object.fromEntries(this.agentMetrics),
|
|
306
|
-
systemMetrics: {
|
|
307
|
-
timestamp: new Date(),
|
|
308
|
-
monitoringDuration: this.progressHistory.length * 1000 // milliseconds
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
async analyzeTrends() {
|
|
313
|
-
if (this.progressHistory.length < 10)
|
|
314
|
-
return; // Need enough data
|
|
315
|
-
const recent = this.progressHistory.slice(-10);
|
|
316
|
-
const progressRate = this.calculateProgressRate(recent);
|
|
317
|
-
const errorRate = this.calculateErrorRate(recent);
|
|
318
|
-
// Emit trend analysis
|
|
319
|
-
this.notifyListeners('trend_analysis', {
|
|
320
|
-
progressRate,
|
|
321
|
-
errorRate,
|
|
322
|
-
trend: progressRate > 0 ? 'improving' : progressRate < 0 ? 'declining' : 'stable'
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
calculateProgressRate(snapshots) {
|
|
326
|
-
if (snapshots.length < 2)
|
|
327
|
-
return 0;
|
|
328
|
-
const first = snapshots[0];
|
|
329
|
-
const last = snapshots[snapshots.length - 1];
|
|
330
|
-
const timeDiff = last.timestamp.getTime() - first.timestamp.getTime();
|
|
331
|
-
const progressDiff = last.status.percentage - first.status.percentage;
|
|
332
|
-
return timeDiff > 0 ? progressDiff / (timeDiff / 1000) : 0; // Progress per second
|
|
333
|
-
}
|
|
334
|
-
calculateErrorRate(snapshots) {
|
|
335
|
-
if (snapshots.length < 2)
|
|
336
|
-
return 0;
|
|
337
|
-
const errors = snapshots.reduce((sum, snapshot) => sum + snapshot.status.failed, 0);
|
|
338
|
-
return errors / snapshots.length;
|
|
339
|
-
}
|
|
340
|
-
// Public API methods
|
|
341
|
-
addListener(listener) {
|
|
342
|
-
this.listeners.add(listener);
|
|
343
|
-
logger_1.logger.debug('👂 Progress listener added', { totalListeners: this.listeners.size });
|
|
344
|
-
}
|
|
345
|
-
removeListener(listener) {
|
|
346
|
-
this.listeners.delete(listener);
|
|
347
|
-
logger_1.logger.debug('👂 Progress listener removed', { totalListeners: this.listeners.size });
|
|
348
|
-
}
|
|
349
|
-
notifyListeners(event, data) {
|
|
350
|
-
this.listeners.forEach(listener => {
|
|
351
|
-
try {
|
|
352
|
-
listener.onProgress(event, data);
|
|
353
|
-
}
|
|
354
|
-
catch (error) {
|
|
355
|
-
logger_1.logger.error('❌ Progress listener error', { event, error: error.message });
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
async getDetailedReport() {
|
|
360
|
-
return {
|
|
361
|
-
overview: this.progressHistory.length > 0
|
|
362
|
-
? this.progressHistory[this.progressHistory.length - 1].status
|
|
363
|
-
: null,
|
|
364
|
-
agentMetrics: Object.fromEntries(this.agentMetrics),
|
|
365
|
-
performanceMetrics: await this.performanceAnalyzer.getOverallMetrics(),
|
|
366
|
-
trends: this.generateTrendSummary(),
|
|
367
|
-
recommendations: this.generateRecommendations()
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
generateTrendSummary() {
|
|
371
|
-
if (this.progressHistory.length === 0) {
|
|
372
|
-
return { direction: 'unknown', confidence: 0, description: 'Insufficient data' };
|
|
373
|
-
}
|
|
374
|
-
const recent = this.progressHistory.slice(-20);
|
|
375
|
-
const progressRate = this.calculateProgressRate(recent);
|
|
376
|
-
return {
|
|
377
|
-
direction: progressRate > 0.1 ? 'improving' : progressRate < -0.1 ? 'declining' : 'stable',
|
|
378
|
-
confidence: Math.min(recent.length / 20, 1),
|
|
379
|
-
description: this.describeTrend(progressRate),
|
|
380
|
-
progressRate
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
describeTrend(rate) {
|
|
384
|
-
if (rate > 0.5)
|
|
385
|
-
return 'Excellent progress rate';
|
|
386
|
-
if (rate > 0.1)
|
|
387
|
-
return 'Good progress rate';
|
|
388
|
-
if (rate > -0.1)
|
|
389
|
-
return 'Stable progress';
|
|
390
|
-
if (rate > -0.5)
|
|
391
|
-
return 'Slow progress';
|
|
392
|
-
return 'Progress has stalled';
|
|
393
|
-
}
|
|
394
|
-
generateRecommendations() {
|
|
395
|
-
const recommendations = [];
|
|
396
|
-
// Analyze agent health
|
|
397
|
-
const unhealthyAgents = Array.from(this.agentMetrics.entries())
|
|
398
|
-
.filter(([, metrics]) => metrics.healthyChecks / metrics.totalChecks < 0.8);
|
|
399
|
-
if (unhealthyAgents.length > 0) {
|
|
400
|
-
recommendations.push(`Review ${unhealthyAgents.length} underperforming agent(s)`);
|
|
401
|
-
}
|
|
402
|
-
// Analyze progress rate
|
|
403
|
-
if (this.progressHistory.length > 10) {
|
|
404
|
-
const rate = this.calculateProgressRate(this.progressHistory.slice(-10));
|
|
405
|
-
if (rate < 0.1) {
|
|
406
|
-
recommendations.push('Consider increasing parallelism or reviewing task dependencies');
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
return recommendations;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
exports.ProgressMonitor = ProgressMonitor;
|
|
413
|
-
// Supporting classes
|
|
414
|
-
class BottleneckDetector {
|
|
415
|
-
async detect(taskGraph) {
|
|
416
|
-
const bottlenecks = [];
|
|
417
|
-
// Detect long-running tasks
|
|
418
|
-
const inProgressTasks = taskGraph.getInProgressTasks();
|
|
419
|
-
const longRunningTasks = inProgressTasks.filter(task => {
|
|
420
|
-
const duration = task.startTime ? Date.now() - task.startTime.getTime() : 0;
|
|
421
|
-
return duration > 300000; // 5 minutes
|
|
422
|
-
});
|
|
423
|
-
for (const task of longRunningTasks) {
|
|
424
|
-
bottlenecks.push({
|
|
425
|
-
type: 'long_running_task',
|
|
426
|
-
taskId: task.id,
|
|
427
|
-
description: `Task ${task.id} has been running for over 5 minutes`,
|
|
428
|
-
severity: 'medium',
|
|
429
|
-
suggestion: 'Consider task timeout or agent health check'
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
// Detect dependency chains
|
|
433
|
-
const pendingTasks = taskGraph.getPendingTasks();
|
|
434
|
-
if (pendingTasks.length > inProgressTasks.length * 2) {
|
|
435
|
-
bottlenecks.push({
|
|
436
|
-
type: 'dependency_bottleneck',
|
|
437
|
-
description: 'Many tasks waiting for dependencies to complete',
|
|
438
|
-
severity: 'high',
|
|
439
|
-
suggestion: 'Review task dependencies and consider parallel execution'
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
return bottlenecks;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
class PerformanceAnalyzer {
|
|
446
|
-
constructor() {
|
|
447
|
-
this.metrics = [];
|
|
448
|
-
}
|
|
449
|
-
async analyze(taskGraph) {
|
|
450
|
-
const stats = await taskGraph.getExecutionStats();
|
|
451
|
-
const efficiency = stats.totalTasks > 0
|
|
452
|
-
? stats.completedTasks / stats.totalTasks
|
|
453
|
-
: 0;
|
|
454
|
-
const throughput = stats.averageExecutionTime > 0
|
|
455
|
-
? 1000 / stats.averageExecutionTime
|
|
456
|
-
: 0;
|
|
457
|
-
const metrics = {
|
|
458
|
-
efficiency,
|
|
459
|
-
throughput,
|
|
460
|
-
averageTaskTime: stats.averageExecutionTime,
|
|
461
|
-
retryRate: stats.totalRetries / Math.max(stats.totalTasks, 1),
|
|
462
|
-
timestamp: new Date()
|
|
463
|
-
};
|
|
464
|
-
this.metrics.push(metrics);
|
|
465
|
-
if (this.metrics.length > 100) {
|
|
466
|
-
this.metrics = this.metrics.slice(-100);
|
|
467
|
-
}
|
|
468
|
-
return metrics;
|
|
469
|
-
}
|
|
470
|
-
async getOverallMetrics() {
|
|
471
|
-
if (this.metrics.length === 0) {
|
|
472
|
-
return {
|
|
473
|
-
averageEfficiency: 0,
|
|
474
|
-
averageThroughput: 0,
|
|
475
|
-
bestEfficiency: 0,
|
|
476
|
-
worstEfficiency: 0,
|
|
477
|
-
trend: 'unknown'
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
const efficiencies = this.metrics.map(m => m.efficiency);
|
|
481
|
-
const throughputs = this.metrics.map(m => m.throughput);
|
|
482
|
-
return {
|
|
483
|
-
averageEfficiency: efficiencies.reduce((sum, e) => sum + e, 0) / efficiencies.length,
|
|
484
|
-
averageThroughput: throughputs.reduce((sum, t) => sum + t, 0) / throughputs.length,
|
|
485
|
-
bestEfficiency: Math.max(...efficiencies),
|
|
486
|
-
worstEfficiency: Math.min(...efficiencies),
|
|
487
|
-
trend: this.calculateTrend()
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
calculateTrend() {
|
|
491
|
-
if (this.metrics.length < 10)
|
|
492
|
-
return 'unknown';
|
|
493
|
-
const recent = this.metrics.slice(-5);
|
|
494
|
-
const older = this.metrics.slice(-10, -5);
|
|
495
|
-
const recentAvg = recent.reduce((sum, m) => sum + m.efficiency, 0) / recent.length;
|
|
496
|
-
const olderAvg = older.reduce((sum, m) => sum + m.efficiency, 0) / older.length;
|
|
497
|
-
const diff = recentAvg - olderAvg;
|
|
498
|
-
if (diff > 0.05)
|
|
499
|
-
return 'improving';
|
|
500
|
-
if (diff < -0.05)
|
|
501
|
-
return 'declining';
|
|
502
|
-
return 'stable';
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
//# sourceMappingURL=progress-monitor.js.map
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { QualityGate, ValidationResult, QualityGateResult } from './types';
|
|
3
|
-
export declare class QualityGateManager extends EventEmitter {
|
|
4
|
-
private gates;
|
|
5
|
-
private gateResults;
|
|
6
|
-
private config;
|
|
7
|
-
constructor(config?: Partial<QualityGateConfig>);
|
|
8
|
-
addGate(taskId: string, gate: QualityGate): void;
|
|
9
|
-
validateTask(taskId: string, result: any): Promise<QualityGateResult>;
|
|
10
|
-
private executeGateWithTimeout;
|
|
11
|
-
private calculateOverallScore;
|
|
12
|
-
private createPassingResult;
|
|
13
|
-
getGateStatistics(taskId?: string): Promise<GateStatistics>;
|
|
14
|
-
createCodeQualityGate(options?: CodeQualityOptions): QualityGate;
|
|
15
|
-
createSecurityGate(options?: SecurityGateOptions): QualityGate;
|
|
16
|
-
createPerformanceGate(options?: PerformanceGateOptions): QualityGate;
|
|
17
|
-
createServiceNowGate(options?: ServiceNowGateOptions): QualityGate;
|
|
18
|
-
createBusinessLogicGate(options?: BusinessLogicGateOptions): QualityGate;
|
|
19
|
-
}
|
|
20
|
-
export declare class CodeQualityGate implements QualityGate {
|
|
21
|
-
name: string;
|
|
22
|
-
blocking: boolean;
|
|
23
|
-
private options;
|
|
24
|
-
constructor(options?: CodeQualityOptions);
|
|
25
|
-
validate(result: any): Promise<ValidationResult>;
|
|
26
|
-
private hasDocumentation;
|
|
27
|
-
private generateCodeSuggestions;
|
|
28
|
-
}
|
|
29
|
-
export declare class SecurityGate implements QualityGate {
|
|
30
|
-
name: string;
|
|
31
|
-
blocking: boolean;
|
|
32
|
-
private options;
|
|
33
|
-
constructor(options?: SecurityGateOptions);
|
|
34
|
-
validate(result: any): Promise<ValidationResult>;
|
|
35
|
-
private hasSQLInjectionRisk;
|
|
36
|
-
private hasXSSRisk;
|
|
37
|
-
private hasHardcodedSecrets;
|
|
38
|
-
private hasProperAuthentication;
|
|
39
|
-
private hasProperPermissions;
|
|
40
|
-
private generateSecuritySuggestions;
|
|
41
|
-
}
|
|
42
|
-
export declare class PerformanceGate implements QualityGate {
|
|
43
|
-
name: string;
|
|
44
|
-
blocking: boolean;
|
|
45
|
-
private options;
|
|
46
|
-
constructor(options?: PerformanceGateOptions);
|
|
47
|
-
validate(result: any): Promise<ValidationResult>;
|
|
48
|
-
private generatePerformanceSuggestions;
|
|
49
|
-
}
|
|
50
|
-
export declare class ServiceNowGate implements QualityGate {
|
|
51
|
-
name: string;
|
|
52
|
-
blocking: boolean;
|
|
53
|
-
private options;
|
|
54
|
-
constructor(options?: ServiceNowGateOptions);
|
|
55
|
-
validate(result: any): Promise<ValidationResult>;
|
|
56
|
-
private hasValidScope;
|
|
57
|
-
private hasValidUpdateSet;
|
|
58
|
-
private hasValidNaming;
|
|
59
|
-
private hasValidDependencies;
|
|
60
|
-
private generateServiceNowSuggestions;
|
|
61
|
-
}
|
|
62
|
-
export declare class BusinessLogicGate implements QualityGate {
|
|
63
|
-
name: string;
|
|
64
|
-
blocking: boolean;
|
|
65
|
-
private options;
|
|
66
|
-
constructor(options?: BusinessLogicGateOptions);
|
|
67
|
-
validate(result: any): Promise<ValidationResult>;
|
|
68
|
-
private meetsBusinessRequirements;
|
|
69
|
-
private hasExpectedOutputs;
|
|
70
|
-
private hasProperErrorHandling;
|
|
71
|
-
}
|
|
72
|
-
interface QualityGateConfig {
|
|
73
|
-
enableBlocking: boolean;
|
|
74
|
-
enableScoring: boolean;
|
|
75
|
-
minPassingScore: number;
|
|
76
|
-
enableMetrics: boolean;
|
|
77
|
-
timeoutMs: number;
|
|
78
|
-
}
|
|
79
|
-
interface CodeQualityOptions {
|
|
80
|
-
maxComplexity?: number;
|
|
81
|
-
minCoverage?: number;
|
|
82
|
-
maxLines?: number;
|
|
83
|
-
requireDocumentation?: boolean;
|
|
84
|
-
checkNaming?: boolean;
|
|
85
|
-
blocking?: boolean;
|
|
86
|
-
}
|
|
87
|
-
interface SecurityGateOptions {
|
|
88
|
-
checkInjection?: boolean;
|
|
89
|
-
checkXSS?: boolean;
|
|
90
|
-
checkAuth?: boolean;
|
|
91
|
-
checkSecrets?: boolean;
|
|
92
|
-
checkPermissions?: boolean;
|
|
93
|
-
}
|
|
94
|
-
interface PerformanceGateOptions {
|
|
95
|
-
maxResponseTime?: number;
|
|
96
|
-
maxMemoryUsage?: number;
|
|
97
|
-
minThroughput?: number;
|
|
98
|
-
blocking?: boolean;
|
|
99
|
-
}
|
|
100
|
-
interface ServiceNowGateOptions {
|
|
101
|
-
checkScope?: boolean;
|
|
102
|
-
checkUpdateSet?: boolean;
|
|
103
|
-
checkNaming?: boolean;
|
|
104
|
-
checkDependencies?: boolean;
|
|
105
|
-
blocking?: boolean;
|
|
106
|
-
}
|
|
107
|
-
interface BusinessLogicGateOptions {
|
|
108
|
-
checkRequirements?: boolean;
|
|
109
|
-
checkOutputs?: boolean;
|
|
110
|
-
checkErrorHandling?: boolean;
|
|
111
|
-
blocking?: boolean;
|
|
112
|
-
}
|
|
113
|
-
interface GateStatistics {
|
|
114
|
-
totalExecutions: number;
|
|
115
|
-
passRate: number;
|
|
116
|
-
averageScore: number;
|
|
117
|
-
averageExecutionTime: number;
|
|
118
|
-
mostCommonFailures: {
|
|
119
|
-
error: string;
|
|
120
|
-
count: number;
|
|
121
|
-
}[];
|
|
122
|
-
}
|
|
123
|
-
export {};
|
|
124
|
-
//# sourceMappingURL=quality-gates.d.ts.map
|