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,1153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdaptiveTeam = void 0;
|
|
4
|
-
const base_team_js_1 = require("./base-team.js");
|
|
5
|
-
// Import all available specialists
|
|
6
|
-
const widget_specialists_js_1 = require("../specialists/widget-specialists.js");
|
|
7
|
-
const flow_specialists_js_1 = require("../specialists/flow-specialists.js");
|
|
8
|
-
const app_specialists_js_1 = require("../specialists/app-specialists.js");
|
|
9
|
-
class AdaptiveTeam extends base_team_js_1.BaseTeam {
|
|
10
|
-
constructor(options = { sharedMemory: true, validation: true, parallel: false, monitor: false }) {
|
|
11
|
-
super(options);
|
|
12
|
-
this.availableSpecialists = [];
|
|
13
|
-
this.selectedSpecialists = [];
|
|
14
|
-
this.taskAnalysis = {};
|
|
15
|
-
this.initializeSpecialistRegistry();
|
|
16
|
-
}
|
|
17
|
-
initializeTeam() {
|
|
18
|
-
// Team members will be dynamically assembled based on task analysis
|
|
19
|
-
this.members = [];
|
|
20
|
-
// Initialize adaptive quality gates
|
|
21
|
-
this.initializeAdaptiveQualityGates();
|
|
22
|
-
}
|
|
23
|
-
async execute(task) {
|
|
24
|
-
console.log(`\n🤖 Adaptive Development Team Activated`);
|
|
25
|
-
console.log(`📋 Mission: ${task}`);
|
|
26
|
-
console.log(`🔍 Analyzing task to assemble optimal specialist team...`);
|
|
27
|
-
// Analyze task and dynamically assemble team
|
|
28
|
-
await this.analyzeTaskAndAssembleTeam(task);
|
|
29
|
-
return await this.executeWithCoordination(task);
|
|
30
|
-
}
|
|
31
|
-
async analyzeRequirements(task) {
|
|
32
|
-
console.log(`\n🔍 Adaptive Team: Deep task analysis...`);
|
|
33
|
-
// Comprehensive task analysis
|
|
34
|
-
this.taskAnalysis = {
|
|
35
|
-
task,
|
|
36
|
-
domain: this.identifyDomain(task),
|
|
37
|
-
complexity: this.assessComplexity(task),
|
|
38
|
-
components: this.identifyComponents(task),
|
|
39
|
-
technologies: this.identifyTechnologies(task),
|
|
40
|
-
requirements: this.extractRequirements(task),
|
|
41
|
-
constraints: this.identifyConstraints(task),
|
|
42
|
-
deliverables: this.identifyDeliverables(task),
|
|
43
|
-
riskFactors: this.identifyRiskFactors(task),
|
|
44
|
-
specialistNeeds: this.analyzeSpecialistNeeds(task)
|
|
45
|
-
};
|
|
46
|
-
const requirements = {
|
|
47
|
-
...this.taskAnalysis,
|
|
48
|
-
coordination: this.determineCoordinationPattern(this.taskAnalysis),
|
|
49
|
-
estimatedTime: this.estimateProjectTime(this.taskAnalysis),
|
|
50
|
-
teamSize: this.selectedSpecialists.length,
|
|
51
|
-
dependencies: this.findDependencies(task)
|
|
52
|
-
};
|
|
53
|
-
console.log(` Domain: ${requirements.domain}`);
|
|
54
|
-
console.log(` Complexity: ${requirements.complexity}`);
|
|
55
|
-
console.log(` Team Size: ${requirements.teamSize} specialists`);
|
|
56
|
-
console.log(` Technologies: ${requirements.technologies.join(', ')}`);
|
|
57
|
-
console.log(` Coordination: ${requirements.coordination}`);
|
|
58
|
-
return requirements;
|
|
59
|
-
}
|
|
60
|
-
async createTaskBreakdown(requirements) {
|
|
61
|
-
console.log(`\n📋 Adaptive Team: Creating dynamic task breakdown...`);
|
|
62
|
-
const tasks = [];
|
|
63
|
-
// Create tasks based on selected specialists and their dependencies
|
|
64
|
-
const specialistTasks = this.createSpecialistTasks(requirements);
|
|
65
|
-
const dependencyMap = this.buildDependencyMap(specialistTasks);
|
|
66
|
-
const prioritizedTasks = this.prioritizeTasks(specialistTasks, dependencyMap);
|
|
67
|
-
tasks.push(...prioritizedTasks);
|
|
68
|
-
// Add integration task if multiple specialists
|
|
69
|
-
if (this.selectedSpecialists.length > 1) {
|
|
70
|
-
tasks.push({
|
|
71
|
-
id: 'adaptive_integration',
|
|
72
|
-
description: `Integrate all specialist deliverables into cohesive solution`,
|
|
73
|
-
assignedTo: this.selectIntegrationLead(),
|
|
74
|
-
dependencies: tasks.map(t => t.id),
|
|
75
|
-
priority: 'medium',
|
|
76
|
-
estimatedTime: this.estimateIntegrationTime(requirements)
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
console.log(` Created ${tasks.length} adaptive tasks`);
|
|
80
|
-
tasks.forEach(task => {
|
|
81
|
-
console.log(` ${task.assignedTo.role}: ${task.description} (${task.estimatedTime})`);
|
|
82
|
-
});
|
|
83
|
-
return tasks;
|
|
84
|
-
}
|
|
85
|
-
async integrateResults(results) {
|
|
86
|
-
console.log(`\n🔗 Adaptive Team: Intelligent result integration...`);
|
|
87
|
-
const integration = {
|
|
88
|
-
teamType: 'Adaptive Development Team',
|
|
89
|
-
task: this.sharedContext.get('task'),
|
|
90
|
-
timestamp: new Date(),
|
|
91
|
-
assembledTeam: this.getTeamComposition(),
|
|
92
|
-
specialists: {},
|
|
93
|
-
finalDeliverable: {},
|
|
94
|
-
qualityMetrics: {},
|
|
95
|
-
deploymentPackage: {},
|
|
96
|
-
adaptiveInsights: {}
|
|
97
|
-
};
|
|
98
|
-
// Organize results by specialist role
|
|
99
|
-
for (const result of results) {
|
|
100
|
-
if (result.status === 'success' && result.result) {
|
|
101
|
-
const specialist = result.result.specialist;
|
|
102
|
-
integration.specialists[specialist] = result.result;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// Create adaptive integration based on domain and deliverables
|
|
106
|
-
integration.finalDeliverable = await this.createAdaptiveDeliverable(integration.specialists);
|
|
107
|
-
// Calculate adaptive quality metrics
|
|
108
|
-
integration.qualityMetrics = await this.calculateAdaptiveQualityMetrics(results);
|
|
109
|
-
// Prepare deployment package
|
|
110
|
-
integration.deploymentPackage = await this.prepareAdaptiveDeploymentPackage(integration.finalDeliverable);
|
|
111
|
-
// Generate adaptive insights
|
|
112
|
-
integration.adaptiveInsights = await this.generateAdaptiveInsights(integration);
|
|
113
|
-
console.log(`✅ Adaptive integration completed successfully`);
|
|
114
|
-
console.log(` Team Composition: ${integration.assembledTeam.map(s => s.role).join(', ')}`);
|
|
115
|
-
console.log(` Quality Score: ${integration.qualityMetrics.overallScore}/100`);
|
|
116
|
-
console.log(` Adaptive Efficiency: ${integration.adaptiveInsights.efficiency}%`);
|
|
117
|
-
return integration;
|
|
118
|
-
}
|
|
119
|
-
initializeSpecialistRegistry() {
|
|
120
|
-
this.availableSpecialists = [
|
|
121
|
-
// Widget Specialists
|
|
122
|
-
{
|
|
123
|
-
name: 'Alex Frontend',
|
|
124
|
-
role: 'Frontend Developer',
|
|
125
|
-
expertise: ['HTML', 'CSS', 'JavaScript', 'Responsive Design', 'Accessibility'],
|
|
126
|
-
category: 'frontend',
|
|
127
|
-
applicability: ['widget', 'ui', 'interface', 'web', 'responsive', 'mobile'],
|
|
128
|
-
priority: 90,
|
|
129
|
-
createInstance: (options) => new widget_specialists_js_1.FrontendSpecialist(options)
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: 'Sam Backend',
|
|
133
|
-
role: 'Backend Developer',
|
|
134
|
-
expertise: ['Server Scripts', 'GlideRecord', 'REST APIs', 'Performance', 'Caching'],
|
|
135
|
-
category: 'backend',
|
|
136
|
-
applicability: ['server', 'api', 'data', 'performance', 'caching', 'integration'],
|
|
137
|
-
priority: 85,
|
|
138
|
-
createInstance: (options) => new widget_specialists_js_1.BackendSpecialist(options)
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: 'Jordan UX',
|
|
142
|
-
role: 'UI/UX Designer',
|
|
143
|
-
expertise: ['User Experience', 'Design Systems', 'Accessibility', 'Usability'],
|
|
144
|
-
category: 'design',
|
|
145
|
-
applicability: ['ux', 'design', 'user', 'interface', 'accessibility', 'usability'],
|
|
146
|
-
priority: 75,
|
|
147
|
-
createInstance: (options) => new widget_specialists_js_1.UIUXSpecialist(options)
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: 'Casey QA',
|
|
151
|
-
role: 'QA Specialist',
|
|
152
|
-
expertise: ['Testing', 'Quality Assurance', 'Automation', 'Validation'],
|
|
153
|
-
category: 'quality',
|
|
154
|
-
applicability: ['test', 'quality', 'validation', 'automation', 'qa'],
|
|
155
|
-
priority: 70,
|
|
156
|
-
createInstance: (options) => new widget_specialists_js_1.QASpecialist(options)
|
|
157
|
-
},
|
|
158
|
-
// Flow Specialists
|
|
159
|
-
{
|
|
160
|
-
name: 'Morgan Process',
|
|
161
|
-
role: 'Process Designer',
|
|
162
|
-
expertise: ['Business Logic', 'Workflow Design', 'Process Optimization'],
|
|
163
|
-
category: 'process',
|
|
164
|
-
applicability: ['flow', 'workflow', 'process', 'automation', 'business'],
|
|
165
|
-
priority: 95,
|
|
166
|
-
createInstance: (options) => new flow_specialists_js_1.ProcessSpecialist(options)
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: 'Riley Trigger',
|
|
170
|
-
role: 'Trigger Specialist',
|
|
171
|
-
expertise: ['Event Handling', 'Conditions', 'Automation', 'Real-time Processing'],
|
|
172
|
-
category: 'events',
|
|
173
|
-
applicability: ['trigger', 'event', 'condition', 'realtime', 'automation'],
|
|
174
|
-
priority: 80,
|
|
175
|
-
createInstance: (options) => new flow_specialists_js_1.TriggerSpecialist(options)
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: 'Avery Data',
|
|
179
|
-
role: 'Data Specialist',
|
|
180
|
-
expertise: ['Data Modeling', 'Variable Management', 'Data Transformation'],
|
|
181
|
-
category: 'data',
|
|
182
|
-
applicability: ['data', 'variable', 'transformation', 'modeling'],
|
|
183
|
-
priority: 85,
|
|
184
|
-
createInstance: (options) => new flow_specialists_js_1.DataSpecialist(options)
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
name: 'Cameron Integration',
|
|
188
|
-
role: 'Integration Specialist',
|
|
189
|
-
expertise: ['API Integration', 'External Systems', 'Data Synchronization'],
|
|
190
|
-
category: 'integration',
|
|
191
|
-
applicability: ['integration', 'api', 'external', 'sync', 'middleware'],
|
|
192
|
-
priority: 75,
|
|
193
|
-
createInstance: (options) => new flow_specialists_js_1.IntegrationSpecialist(options)
|
|
194
|
-
},
|
|
195
|
-
// Application Specialists
|
|
196
|
-
{
|
|
197
|
-
name: 'Dana Database',
|
|
198
|
-
role: 'Database Designer',
|
|
199
|
-
expertise: ['Table Design', 'Relationships', 'Indexing', 'Performance'],
|
|
200
|
-
category: 'database',
|
|
201
|
-
applicability: ['database', 'table', 'schema', 'relationship', 'index'],
|
|
202
|
-
priority: 90,
|
|
203
|
-
createInstance: (options) => new app_specialists_js_1.DatabaseSpecialist(options)
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
name: 'Logan Logic',
|
|
207
|
-
role: 'Business Logic Developer',
|
|
208
|
-
expertise: ['Business Rules', 'Script Includes', 'Workflows', 'Validations'],
|
|
209
|
-
category: 'business_logic',
|
|
210
|
-
applicability: ['business', 'rule', 'script', 'validation', 'calculation'],
|
|
211
|
-
priority: 85,
|
|
212
|
-
createInstance: (options) => new app_specialists_js_1.BusinessLogicSpecialist(options)
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
name: 'Sage Interface',
|
|
216
|
-
role: 'Interface Designer',
|
|
217
|
-
expertise: ['Forms', 'Lists', 'UI Policies', 'Client Scripts'],
|
|
218
|
-
category: 'interface',
|
|
219
|
-
applicability: ['form', 'list', 'ui', 'client', 'interface', 'navigation'],
|
|
220
|
-
priority: 80,
|
|
221
|
-
createInstance: (options) => new app_specialists_js_1.InterfaceSpecialist(options)
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: 'Phoenix Performance',
|
|
225
|
-
role: 'Performance Specialist',
|
|
226
|
-
expertise: ['Query Optimization', 'Caching', 'Indexing', 'Load Testing'],
|
|
227
|
-
category: 'performance',
|
|
228
|
-
applicability: ['performance', 'optimization', 'caching', 'load', 'scale'],
|
|
229
|
-
priority: 70,
|
|
230
|
-
createInstance: (options) => new app_specialists_js_1.PerformanceSpecialist(options)
|
|
231
|
-
},
|
|
232
|
-
// Cross-cutting Specialists
|
|
233
|
-
{
|
|
234
|
-
name: 'Taylor Platform',
|
|
235
|
-
role: 'ServiceNow Specialist',
|
|
236
|
-
expertise: ['Platform Integration', 'Best Practices', 'Update Sets'],
|
|
237
|
-
category: 'platform',
|
|
238
|
-
applicability: ['platform', 'servicenow', 'update', 'deployment', 'best'],
|
|
239
|
-
priority: 95,
|
|
240
|
-
createInstance: (options) => new widget_specialists_js_1.ServiceNowSpecialist(options)
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
name: 'Quinn Security',
|
|
244
|
-
role: 'Security Specialist',
|
|
245
|
-
expertise: ['Security Analysis', 'Access Control', 'Compliance'],
|
|
246
|
-
category: 'security',
|
|
247
|
-
applicability: ['security', 'access', 'compliance', 'audit', 'vulnerability'],
|
|
248
|
-
priority: 85,
|
|
249
|
-
createInstance: (options) => new flow_specialists_js_1.SecuritySpecialist(options)
|
|
250
|
-
}
|
|
251
|
-
];
|
|
252
|
-
}
|
|
253
|
-
async analyzeTaskAndAssembleTeam(task) {
|
|
254
|
-
console.log(`\n🧠 Analyzing task characteristics...`);
|
|
255
|
-
// Score each specialist based on task relevance
|
|
256
|
-
const specialistScores = this.scoreSpecialists(task);
|
|
257
|
-
// Select optimal team composition
|
|
258
|
-
this.selectedSpecialists = this.selectOptimalTeam(specialistScores, task);
|
|
259
|
-
// Create team members from selected specialists
|
|
260
|
-
this.members = this.createTeamMembers(this.selectedSpecialists);
|
|
261
|
-
console.log(`\n✅ Team assembled with ${this.selectedSpecialists.length} specialists:`);
|
|
262
|
-
this.selectedSpecialists.forEach(specialist => {
|
|
263
|
-
console.log(` • ${specialist.role} (${specialist.category})`);
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
scoreSpecialists(task) {
|
|
267
|
-
const scores = new Map();
|
|
268
|
-
const lowerTask = task.toLowerCase();
|
|
269
|
-
this.availableSpecialists.forEach(specialist => {
|
|
270
|
-
let score = 0;
|
|
271
|
-
// Base priority score
|
|
272
|
-
score += specialist.priority;
|
|
273
|
-
// Applicability matching
|
|
274
|
-
const applicabilityMatches = specialist.applicability.filter(term => lowerTask.includes(term)).length;
|
|
275
|
-
score += applicabilityMatches * 20;
|
|
276
|
-
// Expertise matching (fuzzy)
|
|
277
|
-
const expertiseMatches = specialist.expertise.filter(expertise => lowerTask.includes(expertise.toLowerCase()) ||
|
|
278
|
-
this.fuzzyMatch(lowerTask, expertise.toLowerCase())).length;
|
|
279
|
-
score += expertiseMatches * 15;
|
|
280
|
-
// Domain-specific bonuses
|
|
281
|
-
score += this.calculateDomainBonus(specialist, task);
|
|
282
|
-
scores.set(specialist.role, score);
|
|
283
|
-
});
|
|
284
|
-
return scores;
|
|
285
|
-
}
|
|
286
|
-
fuzzyMatch(text, pattern) {
|
|
287
|
-
const words = pattern.split(' ');
|
|
288
|
-
return words.some(word => text.includes(word.toLowerCase()));
|
|
289
|
-
}
|
|
290
|
-
calculateDomainBonus(specialist, task) {
|
|
291
|
-
const lowerTask = task.toLowerCase();
|
|
292
|
-
let bonus = 0;
|
|
293
|
-
// Widget/UI development bonus
|
|
294
|
-
if ((lowerTask.includes('widget') || lowerTask.includes('ui')) &&
|
|
295
|
-
['frontend', 'design', 'platform'].includes(specialist.category)) {
|
|
296
|
-
bonus += 30;
|
|
297
|
-
}
|
|
298
|
-
// Flow development bonus
|
|
299
|
-
if ((lowerTask.includes('flow') || lowerTask.includes('workflow')) &&
|
|
300
|
-
['process', 'events', 'data', 'platform'].includes(specialist.category)) {
|
|
301
|
-
bonus += 30;
|
|
302
|
-
}
|
|
303
|
-
// Application development bonus
|
|
304
|
-
if ((lowerTask.includes('application') || lowerTask.includes('app')) &&
|
|
305
|
-
['database', 'business_logic', 'interface', 'platform'].includes(specialist.category)) {
|
|
306
|
-
bonus += 30;
|
|
307
|
-
}
|
|
308
|
-
// Integration bonus
|
|
309
|
-
if (lowerTask.includes('integration') && specialist.category === 'integration') {
|
|
310
|
-
bonus += 40;
|
|
311
|
-
}
|
|
312
|
-
// Performance/scalability bonus
|
|
313
|
-
if ((lowerTask.includes('performance') || lowerTask.includes('scale')) &&
|
|
314
|
-
specialist.category === 'performance') {
|
|
315
|
-
bonus += 35;
|
|
316
|
-
}
|
|
317
|
-
// Security bonus
|
|
318
|
-
if ((lowerTask.includes('security') || lowerTask.includes('compliance')) &&
|
|
319
|
-
specialist.category === 'security') {
|
|
320
|
-
bonus += 35;
|
|
321
|
-
}
|
|
322
|
-
return bonus;
|
|
323
|
-
}
|
|
324
|
-
selectOptimalTeam(scores, task) {
|
|
325
|
-
const sortedSpecialists = this.availableSpecialists
|
|
326
|
-
.map(specialist => ({
|
|
327
|
-
specialist,
|
|
328
|
-
score: scores.get(specialist.role) || 0
|
|
329
|
-
}))
|
|
330
|
-
.sort((a, b) => b.score - a.score);
|
|
331
|
-
const selected = [];
|
|
332
|
-
const maxTeamSize = this.determineMaxTeamSize(task);
|
|
333
|
-
const minScore = 50; // Minimum relevance threshold
|
|
334
|
-
// Always include ServiceNow platform specialist if score is reasonable
|
|
335
|
-
const platformSpecialist = sortedSpecialists.find(s => s.specialist.role === 'ServiceNow Specialist');
|
|
336
|
-
if (platformSpecialist && platformSpecialist.score >= minScore) {
|
|
337
|
-
selected.push(platformSpecialist.specialist);
|
|
338
|
-
}
|
|
339
|
-
// Select top scoring specialists up to team size limit
|
|
340
|
-
for (const item of sortedSpecialists) {
|
|
341
|
-
if (selected.length >= maxTeamSize)
|
|
342
|
-
break;
|
|
343
|
-
if (item.score < minScore)
|
|
344
|
-
break;
|
|
345
|
-
if (selected.includes(item.specialist))
|
|
346
|
-
continue;
|
|
347
|
-
// Avoid redundancy - don't select multiple specialists from same category unless high relevance
|
|
348
|
-
const categoryConflict = selected.find(s => s.category === item.specialist.category);
|
|
349
|
-
if (categoryConflict && item.score < 120)
|
|
350
|
-
continue;
|
|
351
|
-
selected.push(item.specialist);
|
|
352
|
-
}
|
|
353
|
-
return selected;
|
|
354
|
-
}
|
|
355
|
-
determineMaxTeamSize(task) {
|
|
356
|
-
const lowerTask = task.toLowerCase();
|
|
357
|
-
if (lowerTask.includes('simple') || lowerTask.includes('basic')) {
|
|
358
|
-
return 3;
|
|
359
|
-
}
|
|
360
|
-
else if (lowerTask.includes('complex') || lowerTask.includes('enterprise')) {
|
|
361
|
-
return 6;
|
|
362
|
-
}
|
|
363
|
-
else if (lowerTask.includes('integration') || lowerTask.includes('multi')) {
|
|
364
|
-
return 5;
|
|
365
|
-
}
|
|
366
|
-
return 4; // Default team size
|
|
367
|
-
}
|
|
368
|
-
createTeamMembers(specialists) {
|
|
369
|
-
return specialists.map(specialist => ({
|
|
370
|
-
name: specialist.name,
|
|
371
|
-
role: specialist.role,
|
|
372
|
-
expertise: specialist.expertise,
|
|
373
|
-
execute: async (task, context) => {
|
|
374
|
-
const instance = specialist.createInstance(this.options);
|
|
375
|
-
return await instance.execute(task.description, context);
|
|
376
|
-
}
|
|
377
|
-
}));
|
|
378
|
-
}
|
|
379
|
-
identifyDomain(task) {
|
|
380
|
-
const lowerTask = task.toLowerCase();
|
|
381
|
-
if (lowerTask.includes('widget') || (lowerTask.includes('ui') && !lowerTask.includes('flow'))) {
|
|
382
|
-
return 'widget_development';
|
|
383
|
-
}
|
|
384
|
-
else if (lowerTask.includes('flow') || lowerTask.includes('workflow')) {
|
|
385
|
-
return 'flow_development';
|
|
386
|
-
}
|
|
387
|
-
else if (lowerTask.includes('application') || lowerTask.includes('app')) {
|
|
388
|
-
return 'application_development';
|
|
389
|
-
}
|
|
390
|
-
else if (lowerTask.includes('integration')) {
|
|
391
|
-
return 'integration_development';
|
|
392
|
-
}
|
|
393
|
-
else if (lowerTask.includes('database') || lowerTask.includes('table')) {
|
|
394
|
-
return 'database_development';
|
|
395
|
-
}
|
|
396
|
-
else if (lowerTask.includes('report') || lowerTask.includes('dashboard')) {
|
|
397
|
-
return 'reporting_development';
|
|
398
|
-
}
|
|
399
|
-
return 'general_development';
|
|
400
|
-
}
|
|
401
|
-
identifyTechnologies(task) {
|
|
402
|
-
const technologies = [];
|
|
403
|
-
const lowerTask = task.toLowerCase();
|
|
404
|
-
if (lowerTask.includes('html') || lowerTask.includes('css') || lowerTask.includes('javascript')) {
|
|
405
|
-
technologies.push('web_technologies');
|
|
406
|
-
}
|
|
407
|
-
if (lowerTask.includes('rest') || lowerTask.includes('api')) {
|
|
408
|
-
technologies.push('rest_api');
|
|
409
|
-
}
|
|
410
|
-
if (lowerTask.includes('soap')) {
|
|
411
|
-
technologies.push('soap_api');
|
|
412
|
-
}
|
|
413
|
-
if (lowerTask.includes('json') || lowerTask.includes('xml')) {
|
|
414
|
-
technologies.push('data_formats');
|
|
415
|
-
}
|
|
416
|
-
if (lowerTask.includes('oauth') || lowerTask.includes('saml')) {
|
|
417
|
-
technologies.push('authentication');
|
|
418
|
-
}
|
|
419
|
-
if (lowerTask.includes('ldap')) {
|
|
420
|
-
technologies.push('directory_services');
|
|
421
|
-
}
|
|
422
|
-
if (lowerTask.includes('email') || lowerTask.includes('smtp')) {
|
|
423
|
-
technologies.push('email_systems');
|
|
424
|
-
}
|
|
425
|
-
return technologies;
|
|
426
|
-
}
|
|
427
|
-
extractRequirements(task) {
|
|
428
|
-
const lowerTask = task.toLowerCase();
|
|
429
|
-
return {
|
|
430
|
-
functional: this.extractFunctionalRequirements(task),
|
|
431
|
-
nonFunctional: this.extractNonFunctionalRequirements(task),
|
|
432
|
-
technical: this.extractTechnicalRequirements(task),
|
|
433
|
-
business: this.extractBusinessRequirements(task)
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
extractFunctionalRequirements(task) {
|
|
437
|
-
const requirements = [];
|
|
438
|
-
const lowerTask = task.toLowerCase();
|
|
439
|
-
if (lowerTask.includes('create'))
|
|
440
|
-
requirements.push('creation_capability');
|
|
441
|
-
if (lowerTask.includes('update'))
|
|
442
|
-
requirements.push('update_capability');
|
|
443
|
-
if (lowerTask.includes('delete'))
|
|
444
|
-
requirements.push('deletion_capability');
|
|
445
|
-
if (lowerTask.includes('search'))
|
|
446
|
-
requirements.push('search_capability');
|
|
447
|
-
if (lowerTask.includes('filter'))
|
|
448
|
-
requirements.push('filtering_capability');
|
|
449
|
-
if (lowerTask.includes('approval'))
|
|
450
|
-
requirements.push('approval_process');
|
|
451
|
-
if (lowerTask.includes('notification'))
|
|
452
|
-
requirements.push('notification_system');
|
|
453
|
-
if (lowerTask.includes('report'))
|
|
454
|
-
requirements.push('reporting_capability');
|
|
455
|
-
return requirements;
|
|
456
|
-
}
|
|
457
|
-
extractNonFunctionalRequirements(task) {
|
|
458
|
-
const requirements = [];
|
|
459
|
-
const lowerTask = task.toLowerCase();
|
|
460
|
-
if (lowerTask.includes('performance'))
|
|
461
|
-
requirements.push('performance_optimization');
|
|
462
|
-
if (lowerTask.includes('security'))
|
|
463
|
-
requirements.push('security_compliance');
|
|
464
|
-
if (lowerTask.includes('scalable'))
|
|
465
|
-
requirements.push('scalability');
|
|
466
|
-
if (lowerTask.includes('responsive'))
|
|
467
|
-
requirements.push('responsive_design');
|
|
468
|
-
if (lowerTask.includes('accessible'))
|
|
469
|
-
requirements.push('accessibility');
|
|
470
|
-
if (lowerTask.includes('reliable'))
|
|
471
|
-
requirements.push('reliability');
|
|
472
|
-
return requirements;
|
|
473
|
-
}
|
|
474
|
-
extractTechnicalRequirements(task) {
|
|
475
|
-
const requirements = [];
|
|
476
|
-
const lowerTask = task.toLowerCase();
|
|
477
|
-
if (lowerTask.includes('database'))
|
|
478
|
-
requirements.push('database_integration');
|
|
479
|
-
if (lowerTask.includes('api'))
|
|
480
|
-
requirements.push('api_integration');
|
|
481
|
-
if (lowerTask.includes('mobile'))
|
|
482
|
-
requirements.push('mobile_compatibility');
|
|
483
|
-
if (lowerTask.includes('real'))
|
|
484
|
-
requirements.push('real_time_processing');
|
|
485
|
-
if (lowerTask.includes('cache'))
|
|
486
|
-
requirements.push('caching_mechanism');
|
|
487
|
-
return requirements;
|
|
488
|
-
}
|
|
489
|
-
extractBusinessRequirements(task) {
|
|
490
|
-
const requirements = [];
|
|
491
|
-
const lowerTask = task.toLowerCase();
|
|
492
|
-
if (lowerTask.includes('compliance'))
|
|
493
|
-
requirements.push('regulatory_compliance');
|
|
494
|
-
if (lowerTask.includes('audit'))
|
|
495
|
-
requirements.push('audit_trail');
|
|
496
|
-
if (lowerTask.includes('cost'))
|
|
497
|
-
requirements.push('cost_optimization');
|
|
498
|
-
if (lowerTask.includes('efficiency'))
|
|
499
|
-
requirements.push('process_efficiency');
|
|
500
|
-
return requirements;
|
|
501
|
-
}
|
|
502
|
-
identifyConstraints(task) {
|
|
503
|
-
const constraints = [];
|
|
504
|
-
const lowerTask = task.toLowerCase();
|
|
505
|
-
if (lowerTask.includes('budget'))
|
|
506
|
-
constraints.push('budget_constraint');
|
|
507
|
-
if (lowerTask.includes('time'))
|
|
508
|
-
constraints.push('time_constraint');
|
|
509
|
-
if (lowerTask.includes('legacy'))
|
|
510
|
-
constraints.push('legacy_system_constraint');
|
|
511
|
-
if (lowerTask.includes('regulation'))
|
|
512
|
-
constraints.push('regulatory_constraint');
|
|
513
|
-
if (lowerTask.includes('resource'))
|
|
514
|
-
constraints.push('resource_constraint');
|
|
515
|
-
return constraints;
|
|
516
|
-
}
|
|
517
|
-
identifyDeliverables(task) {
|
|
518
|
-
const deliverables = [];
|
|
519
|
-
const lowerTask = task.toLowerCase();
|
|
520
|
-
if (lowerTask.includes('widget'))
|
|
521
|
-
deliverables.push('service_portal_widget');
|
|
522
|
-
if (lowerTask.includes('flow'))
|
|
523
|
-
deliverables.push('flow_designer_flow');
|
|
524
|
-
if (lowerTask.includes('application'))
|
|
525
|
-
deliverables.push('scoped_application');
|
|
526
|
-
if (lowerTask.includes('report'))
|
|
527
|
-
deliverables.push('report_dashboard');
|
|
528
|
-
if (lowerTask.includes('integration'))
|
|
529
|
-
deliverables.push('integration_solution');
|
|
530
|
-
if (lowerTask.includes('table'))
|
|
531
|
-
deliverables.push('database_tables');
|
|
532
|
-
if (lowerTask.includes('form'))
|
|
533
|
-
deliverables.push('user_interfaces');
|
|
534
|
-
return deliverables;
|
|
535
|
-
}
|
|
536
|
-
identifyRiskFactors(task) {
|
|
537
|
-
const risks = [];
|
|
538
|
-
const lowerTask = task.toLowerCase();
|
|
539
|
-
if (lowerTask.includes('complex'))
|
|
540
|
-
risks.push('complexity_risk');
|
|
541
|
-
if (lowerTask.includes('integration'))
|
|
542
|
-
risks.push('integration_risk');
|
|
543
|
-
if (lowerTask.includes('performance'))
|
|
544
|
-
risks.push('performance_risk');
|
|
545
|
-
if (lowerTask.includes('security'))
|
|
546
|
-
risks.push('security_risk');
|
|
547
|
-
if (lowerTask.includes('new') || lowerTask.includes('novel'))
|
|
548
|
-
risks.push('technology_risk');
|
|
549
|
-
return risks;
|
|
550
|
-
}
|
|
551
|
-
analyzeSpecialistNeeds(task) {
|
|
552
|
-
const needs = {
|
|
553
|
-
required: [],
|
|
554
|
-
optional: [],
|
|
555
|
-
priorities: new Map()
|
|
556
|
-
};
|
|
557
|
-
const lowerTask = task.toLowerCase();
|
|
558
|
-
// Always need platform specialist
|
|
559
|
-
needs.required.push('platform');
|
|
560
|
-
needs.priorities.set('platform', 100);
|
|
561
|
-
// Domain-specific needs
|
|
562
|
-
if (lowerTask.includes('widget') || lowerTask.includes('ui')) {
|
|
563
|
-
needs.required.push('frontend', 'backend');
|
|
564
|
-
needs.optional.push('design', 'quality');
|
|
565
|
-
needs.priorities.set('frontend', 95);
|
|
566
|
-
needs.priorities.set('backend', 90);
|
|
567
|
-
}
|
|
568
|
-
if (lowerTask.includes('flow') || lowerTask.includes('workflow')) {
|
|
569
|
-
needs.required.push('process');
|
|
570
|
-
needs.optional.push('events', 'data', 'integration');
|
|
571
|
-
needs.priorities.set('process', 95);
|
|
572
|
-
}
|
|
573
|
-
if (lowerTask.includes('application') || lowerTask.includes('app')) {
|
|
574
|
-
needs.required.push('database', 'business_logic');
|
|
575
|
-
needs.optional.push('interface', 'performance');
|
|
576
|
-
needs.priorities.set('database', 95);
|
|
577
|
-
needs.priorities.set('business_logic', 90);
|
|
578
|
-
}
|
|
579
|
-
// Cross-cutting concerns
|
|
580
|
-
if (lowerTask.includes('security') || lowerTask.includes('compliance')) {
|
|
581
|
-
needs.required.push('security');
|
|
582
|
-
needs.priorities.set('security', 95);
|
|
583
|
-
}
|
|
584
|
-
if (lowerTask.includes('performance') || lowerTask.includes('scale')) {
|
|
585
|
-
needs.optional.push('performance');
|
|
586
|
-
needs.priorities.set('performance', 85);
|
|
587
|
-
}
|
|
588
|
-
return needs;
|
|
589
|
-
}
|
|
590
|
-
determineCoordinationPattern(analysis) {
|
|
591
|
-
const teamSize = this.selectedSpecialists.length;
|
|
592
|
-
const complexity = analysis.complexity;
|
|
593
|
-
const riskFactors = analysis.riskFactors.length;
|
|
594
|
-
if (complexity === 'complex' || riskFactors > 2) {
|
|
595
|
-
return 'sequential_with_reviews';
|
|
596
|
-
}
|
|
597
|
-
else if (teamSize > 4) {
|
|
598
|
-
return 'hybrid_parallel_sequential';
|
|
599
|
-
}
|
|
600
|
-
else if (teamSize > 2) {
|
|
601
|
-
return 'parallel_with_sync';
|
|
602
|
-
}
|
|
603
|
-
return 'sequential';
|
|
604
|
-
}
|
|
605
|
-
estimateProjectTime(analysis) {
|
|
606
|
-
const baseTime = {
|
|
607
|
-
'simple': 120,
|
|
608
|
-
'moderate': 240,
|
|
609
|
-
'complex': 420
|
|
610
|
-
};
|
|
611
|
-
const teamSize = this.selectedSpecialists.length;
|
|
612
|
-
const parallelEfficiency = Math.min(1.8, 1 + (teamSize - 1) * 0.2); // Diminishing returns
|
|
613
|
-
const adjustedTime = baseTime[analysis.complexity] / parallelEfficiency;
|
|
614
|
-
const constraintPenalty = analysis.constraints.length * 30;
|
|
615
|
-
const riskPenalty = analysis.riskFactors.length * 20;
|
|
616
|
-
const totalMinutes = adjustedTime + constraintPenalty + riskPenalty;
|
|
617
|
-
if (totalMinutes < 60) {
|
|
618
|
-
return `${Math.round(totalMinutes)} minutes`;
|
|
619
|
-
}
|
|
620
|
-
else {
|
|
621
|
-
const hours = Math.floor(totalMinutes / 60);
|
|
622
|
-
const minutes = Math.round(totalMinutes % 60);
|
|
623
|
-
return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
createSpecialistTasks(requirements) {
|
|
627
|
-
const tasks = [];
|
|
628
|
-
this.selectedSpecialists.forEach((specialist, index) => {
|
|
629
|
-
const taskId = `specialist_task_${index + 1}`;
|
|
630
|
-
const member = this.members.find(m => m.role === specialist.role);
|
|
631
|
-
if (member) {
|
|
632
|
-
tasks.push({
|
|
633
|
-
id: taskId,
|
|
634
|
-
description: this.generateSpecialistTaskDescription(specialist, requirements),
|
|
635
|
-
assignedTo: member,
|
|
636
|
-
dependencies: this.determineSpecialistDependencies(specialist, tasks),
|
|
637
|
-
priority: this.determineSpecialistPriority(specialist, requirements),
|
|
638
|
-
estimatedTime: this.estimateSpecialistTime(specialist, requirements)
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
return tasks;
|
|
643
|
-
}
|
|
644
|
-
generateSpecialistTaskDescription(specialist, requirements) {
|
|
645
|
-
const domain = requirements.domain.replace('_', ' ');
|
|
646
|
-
const role = specialist.role.toLowerCase();
|
|
647
|
-
return `Execute ${role} responsibilities for ${domain} - ${specialist.expertise.slice(0, 2).join(' and ')}`;
|
|
648
|
-
}
|
|
649
|
-
determineSpecialistDependencies(specialist, existingTasks) {
|
|
650
|
-
const dependencies = [];
|
|
651
|
-
// Database and process design typically come first
|
|
652
|
-
if (!['Database Designer', 'Process Designer', 'ServiceNow Specialist'].includes(specialist.role)) {
|
|
653
|
-
const foundationTask = existingTasks.find(t => ['Database Designer', 'Process Designer'].includes(t.assignedTo.role));
|
|
654
|
-
if (foundationTask) {
|
|
655
|
-
dependencies.push(foundationTask.id);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
// Interface depends on business logic
|
|
659
|
-
if (specialist.role === 'Interface Designer') {
|
|
660
|
-
const logicTask = existingTasks.find(t => t.assignedTo.role === 'Business Logic Developer');
|
|
661
|
-
if (logicTask) {
|
|
662
|
-
dependencies.push(logicTask.id);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
// Performance optimization comes after core components
|
|
666
|
-
if (specialist.role === 'Performance Specialist') {
|
|
667
|
-
const coreTask = existingTasks.find(t => ['Backend Developer', 'Business Logic Developer'].includes(t.assignedTo.role));
|
|
668
|
-
if (coreTask) {
|
|
669
|
-
dependencies.push(coreTask.id);
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
return dependencies;
|
|
673
|
-
}
|
|
674
|
-
determineSpecialistPriority(specialist, requirements) {
|
|
675
|
-
if (['Database Designer', 'Process Designer', 'ServiceNow Specialist'].includes(specialist.role)) {
|
|
676
|
-
return 'high';
|
|
677
|
-
}
|
|
678
|
-
if (['Frontend Developer', 'Backend Developer', 'Business Logic Developer'].includes(specialist.role)) {
|
|
679
|
-
return 'high';
|
|
680
|
-
}
|
|
681
|
-
if (['Security Specialist', 'Integration Specialist'].includes(specialist.role)) {
|
|
682
|
-
return 'medium';
|
|
683
|
-
}
|
|
684
|
-
return 'medium';
|
|
685
|
-
}
|
|
686
|
-
estimateSpecialistTime(specialist, requirements) {
|
|
687
|
-
const baseTime = {
|
|
688
|
-
'Database Designer': 60,
|
|
689
|
-
'Process Designer': 50,
|
|
690
|
-
'Frontend Developer': 45,
|
|
691
|
-
'Backend Developer': 40,
|
|
692
|
-
'Business Logic Developer': 55,
|
|
693
|
-
'Interface Designer': 45,
|
|
694
|
-
'Security Specialist': 35,
|
|
695
|
-
'Performance Specialist': 40,
|
|
696
|
-
'Integration Specialist': 45,
|
|
697
|
-
'ServiceNow Specialist': 30,
|
|
698
|
-
'UI/UX Designer': 35,
|
|
699
|
-
'QA Specialist': 30
|
|
700
|
-
};
|
|
701
|
-
const base = baseTime[specialist.role] || 30;
|
|
702
|
-
const complexityMultiplier = requirements.complexity === 'complex' ? 1.5 :
|
|
703
|
-
requirements.complexity === 'moderate' ? 1.2 : 1.0;
|
|
704
|
-
const adjustedTime = base * complexityMultiplier;
|
|
705
|
-
return `${Math.round(adjustedTime)} min`;
|
|
706
|
-
}
|
|
707
|
-
buildDependencyMap(tasks) {
|
|
708
|
-
const dependencyMap = new Map();
|
|
709
|
-
tasks.forEach(task => {
|
|
710
|
-
dependencyMap.set(task.id, task.dependencies);
|
|
711
|
-
});
|
|
712
|
-
return dependencyMap;
|
|
713
|
-
}
|
|
714
|
-
prioritizeTasks(tasks, dependencyMap) {
|
|
715
|
-
// Topological sort based on dependencies and priorities
|
|
716
|
-
const sorted = [];
|
|
717
|
-
const visited = new Set();
|
|
718
|
-
const visiting = new Set();
|
|
719
|
-
const visit = (taskId) => {
|
|
720
|
-
if (visiting.has(taskId)) {
|
|
721
|
-
throw new Error(`Circular dependency detected involving task ${taskId}`);
|
|
722
|
-
}
|
|
723
|
-
if (visited.has(taskId))
|
|
724
|
-
return;
|
|
725
|
-
visiting.add(taskId);
|
|
726
|
-
const dependencies = dependencyMap.get(taskId) || [];
|
|
727
|
-
dependencies.forEach(depId => visit(depId));
|
|
728
|
-
visiting.delete(taskId);
|
|
729
|
-
visited.add(taskId);
|
|
730
|
-
const task = tasks.find(t => t.id === taskId);
|
|
731
|
-
if (task)
|
|
732
|
-
sorted.push(task);
|
|
733
|
-
};
|
|
734
|
-
tasks.forEach(task => visit(task.id));
|
|
735
|
-
return sorted;
|
|
736
|
-
}
|
|
737
|
-
selectIntegrationLead() {
|
|
738
|
-
// Select the most senior specialist as integration lead
|
|
739
|
-
const priorities = ['ServiceNow Specialist', 'Database Designer', 'Process Designer'];
|
|
740
|
-
for (const role of priorities) {
|
|
741
|
-
const member = this.members.find(m => m.role === role);
|
|
742
|
-
if (member)
|
|
743
|
-
return member;
|
|
744
|
-
}
|
|
745
|
-
return this.members[0]; // Fallback to first member
|
|
746
|
-
}
|
|
747
|
-
estimateIntegrationTime(requirements) {
|
|
748
|
-
const teamSize = this.selectedSpecialists.length;
|
|
749
|
-
const baseTime = 20 + (teamSize * 5); // 5 minutes per additional specialist
|
|
750
|
-
const complexityBonus = requirements.complexity === 'complex' ? 15 :
|
|
751
|
-
requirements.complexity === 'moderate' ? 10 : 0;
|
|
752
|
-
return `${baseTime + complexityBonus} min`;
|
|
753
|
-
}
|
|
754
|
-
getTeamComposition() {
|
|
755
|
-
return this.selectedSpecialists.map(specialist => ({
|
|
756
|
-
role: specialist.role,
|
|
757
|
-
category: specialist.category,
|
|
758
|
-
expertise: specialist.expertise
|
|
759
|
-
}));
|
|
760
|
-
}
|
|
761
|
-
async createAdaptiveDeliverable(specialists) {
|
|
762
|
-
const deliverable = {
|
|
763
|
-
type: `Adaptive ${this.taskAnalysis.domain.replace('_', ' ')}`,
|
|
764
|
-
timestamp: new Date(),
|
|
765
|
-
domain: this.taskAnalysis.domain,
|
|
766
|
-
assembledTeam: this.getTeamComposition(),
|
|
767
|
-
components: {}
|
|
768
|
-
};
|
|
769
|
-
// Dynamically organize deliverables based on available specialists
|
|
770
|
-
Object.keys(specialists).forEach(specialistType => {
|
|
771
|
-
const specialist = specialists[specialistType];
|
|
772
|
-
if (specialist.deliverables) {
|
|
773
|
-
deliverable.components[specialistType] = specialist.deliverables;
|
|
774
|
-
}
|
|
775
|
-
});
|
|
776
|
-
// Create domain-specific integration
|
|
777
|
-
deliverable.integratedSolution = await this.createDomainSpecificIntegration(deliverable.components);
|
|
778
|
-
return deliverable;
|
|
779
|
-
}
|
|
780
|
-
async createDomainSpecificIntegration(components) {
|
|
781
|
-
const integration = {
|
|
782
|
-
timestamp: new Date(),
|
|
783
|
-
components: Object.keys(components),
|
|
784
|
-
integration_type: this.taskAnalysis.domain
|
|
785
|
-
};
|
|
786
|
-
// Domain-specific integration logic
|
|
787
|
-
switch (this.taskAnalysis.domain) {
|
|
788
|
-
case 'widget_development':
|
|
789
|
-
integration.widget_package = this.integrateWidgetComponents(components);
|
|
790
|
-
break;
|
|
791
|
-
case 'flow_development':
|
|
792
|
-
integration.flow_package = this.integrateFlowComponents(components);
|
|
793
|
-
break;
|
|
794
|
-
case 'application_development':
|
|
795
|
-
integration.application_package = this.integrateApplicationComponents(components);
|
|
796
|
-
break;
|
|
797
|
-
default:
|
|
798
|
-
integration.generic_package = this.integrateGenericComponents(components);
|
|
799
|
-
}
|
|
800
|
-
return integration;
|
|
801
|
-
}
|
|
802
|
-
integrateWidgetComponents(components) {
|
|
803
|
-
return {
|
|
804
|
-
frontend: components['Frontend Developer'] || {},
|
|
805
|
-
backend: components['Backend Developer'] || {},
|
|
806
|
-
design: components['UI/UX Designer'] || {},
|
|
807
|
-
platform: components['ServiceNow Specialist'] || {},
|
|
808
|
-
quality: components['QA Specialist'] || {}
|
|
809
|
-
};
|
|
810
|
-
}
|
|
811
|
-
integrateFlowComponents(components) {
|
|
812
|
-
return {
|
|
813
|
-
process: components['Process Designer'] || {},
|
|
814
|
-
triggers: components['Trigger Specialist'] || {},
|
|
815
|
-
data: components['Data Specialist'] || {},
|
|
816
|
-
integration: components['Integration Specialist'] || {},
|
|
817
|
-
security: components['Security Specialist'] || {},
|
|
818
|
-
platform: components['ServiceNow Specialist'] || {}
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
integrateApplicationComponents(components) {
|
|
822
|
-
return {
|
|
823
|
-
database: components['Database Designer'] || {},
|
|
824
|
-
businessLogic: components['Business Logic Developer'] || {},
|
|
825
|
-
interface: components['Interface Designer'] || {},
|
|
826
|
-
security: components['Security Specialist'] || {},
|
|
827
|
-
performance: components['Performance Specialist'] || {},
|
|
828
|
-
platform: components['ServiceNow Specialist'] || {}
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
integrateGenericComponents(components) {
|
|
832
|
-
return components;
|
|
833
|
-
}
|
|
834
|
-
async calculateAdaptiveQualityMetrics(results) {
|
|
835
|
-
const successfulTasks = results.filter(r => r.status === 'success').length;
|
|
836
|
-
const totalTasks = results.length;
|
|
837
|
-
const completionRate = (successfulTasks / totalTasks) * 100;
|
|
838
|
-
// Calculate adaptive quality factors
|
|
839
|
-
const qualityFactors = {
|
|
840
|
-
completeness: completionRate,
|
|
841
|
-
teamComposition: this.calculateTeamCompositionScore(),
|
|
842
|
-
adaptiveEfficiency: this.calculateAdaptiveEfficiency(),
|
|
843
|
-
specialistPerformance: this.calculateSpecialistPerformance(results),
|
|
844
|
-
integrationQuality: this.calculateIntegrationQuality(results),
|
|
845
|
-
domainOptimization: this.calculateDomainOptimization()
|
|
846
|
-
};
|
|
847
|
-
const overallScore = Object.values(qualityFactors).reduce((sum, score) => sum + score, 0) / Object.keys(qualityFactors).length;
|
|
848
|
-
return {
|
|
849
|
-
overallScore: Math.round(overallScore),
|
|
850
|
-
factors: qualityFactors,
|
|
851
|
-
completionRate,
|
|
852
|
-
recommendations: this.generateAdaptiveRecommendations(qualityFactors)
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
calculateTeamCompositionScore() {
|
|
856
|
-
const optimalSize = this.determineOptimalTeamSize();
|
|
857
|
-
const actualSize = this.selectedSpecialists.length;
|
|
858
|
-
const sizePenalty = Math.abs(actualSize - optimalSize) * 5;
|
|
859
|
-
const diversityScore = this.calculateTeamDiversity();
|
|
860
|
-
const relevanceScore = this.calculateTeamRelevance();
|
|
861
|
-
return Math.max(50, 100 - sizePenalty + diversityScore + relevanceScore);
|
|
862
|
-
}
|
|
863
|
-
determineOptimalTeamSize() {
|
|
864
|
-
switch (this.taskAnalysis.complexity) {
|
|
865
|
-
case 'simple': return 3;
|
|
866
|
-
case 'moderate': return 4;
|
|
867
|
-
case 'complex': return 5;
|
|
868
|
-
default: return 4;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
calculateTeamDiversity() {
|
|
872
|
-
const categories = new Set(this.selectedSpecialists.map(s => s.category));
|
|
873
|
-
return Math.min(20, categories.size * 4);
|
|
874
|
-
}
|
|
875
|
-
calculateTeamRelevance() {
|
|
876
|
-
const relevantSpecialists = this.selectedSpecialists.filter(s => s.applicability.some(term => this.taskAnalysis.task.toLowerCase().includes(term)));
|
|
877
|
-
return (relevantSpecialists.length / this.selectedSpecialists.length) * 20;
|
|
878
|
-
}
|
|
879
|
-
calculateAdaptiveEfficiency() {
|
|
880
|
-
const timeEstimate = this.taskAnalysis.estimatedTime;
|
|
881
|
-
const baselineTime = this.calculateBaselineTime();
|
|
882
|
-
const efficiency = (baselineTime / this.parseTimeToMinutes(timeEstimate)) * 100;
|
|
883
|
-
return Math.min(100, efficiency);
|
|
884
|
-
}
|
|
885
|
-
calculateBaselineTime() {
|
|
886
|
-
// Baseline time for single specialist
|
|
887
|
-
return this.taskAnalysis.complexity === 'complex' ? 480 :
|
|
888
|
-
this.taskAnalysis.complexity === 'moderate' ? 300 : 180;
|
|
889
|
-
}
|
|
890
|
-
parseTimeToMinutes(timeString) {
|
|
891
|
-
const hours = timeString.includes('h') ? parseInt(timeString.split('h')[0]) * 60 : 0;
|
|
892
|
-
const minutes = timeString.includes('m') ? parseInt(timeString.match(/(\d+)m/)?.[1] || '0') : 0;
|
|
893
|
-
return hours + minutes;
|
|
894
|
-
}
|
|
895
|
-
calculateSpecialistPerformance(results) {
|
|
896
|
-
const performances = results.map(result => result.status === 'success' ? 100 : 0);
|
|
897
|
-
return performances.reduce((sum, perf) => sum + perf, 0) / performances.length;
|
|
898
|
-
}
|
|
899
|
-
calculateIntegrationQuality(results) {
|
|
900
|
-
// Simplified integration quality metric
|
|
901
|
-
const hasIntegrationConflicts = results.some(r => r.error?.includes('integration'));
|
|
902
|
-
return hasIntegrationConflicts ? 70 : 90;
|
|
903
|
-
}
|
|
904
|
-
calculateDomainOptimization() {
|
|
905
|
-
const domainRelevantSpecialists = this.selectedSpecialists.filter(s => this.isDomainRelevant(s, this.taskAnalysis.domain));
|
|
906
|
-
return (domainRelevantSpecialists.length / this.selectedSpecialists.length) * 100;
|
|
907
|
-
}
|
|
908
|
-
isDomainRelevant(specialist, domain) {
|
|
909
|
-
const domainMapping = {
|
|
910
|
-
'widget_development': ['frontend', 'backend', 'design', 'platform'],
|
|
911
|
-
'flow_development': ['process', 'events', 'data', 'integration', 'platform'],
|
|
912
|
-
'application_development': ['database', 'business_logic', 'interface', 'platform']
|
|
913
|
-
};
|
|
914
|
-
const relevantCategories = domainMapping[domain] || [];
|
|
915
|
-
return relevantCategories.includes(specialist.category);
|
|
916
|
-
}
|
|
917
|
-
generateAdaptiveRecommendations(factors) {
|
|
918
|
-
const recommendations = [];
|
|
919
|
-
if (factors.teamComposition < 80) {
|
|
920
|
-
recommendations.push('Optimize team composition for better task coverage');
|
|
921
|
-
}
|
|
922
|
-
if (factors.adaptiveEfficiency < 75) {
|
|
923
|
-
recommendations.push('Consider alternative specialist combinations for better efficiency');
|
|
924
|
-
}
|
|
925
|
-
if (factors.specialistPerformance < 85) {
|
|
926
|
-
recommendations.push('Review specialist task assignments and dependencies');
|
|
927
|
-
}
|
|
928
|
-
if (factors.domainOptimization < 70) {
|
|
929
|
-
recommendations.push('Include more domain-specific specialists');
|
|
930
|
-
}
|
|
931
|
-
return recommendations;
|
|
932
|
-
}
|
|
933
|
-
async prepareAdaptiveDeploymentPackage(deliverable) {
|
|
934
|
-
return {
|
|
935
|
-
packageType: `Adaptive ${this.taskAnalysis.domain}`,
|
|
936
|
-
teamComposition: this.getTeamComposition(),
|
|
937
|
-
deliverables: this.summarizeDeliverables(deliverable),
|
|
938
|
-
deploymentStrategy: this.createAdaptiveDeploymentStrategy(),
|
|
939
|
-
qualityAssurance: this.createAdaptiveQAChecklist(),
|
|
940
|
-
adaptiveInsights: await this.generateAdaptiveInsights(deliverable)
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
summarizeDeliverables(deliverable) {
|
|
944
|
-
return {
|
|
945
|
-
totalComponents: Object.keys(deliverable.components || {}).length,
|
|
946
|
-
specialistContributions: Object.keys(deliverable.components || {}),
|
|
947
|
-
integrationType: deliverable.integratedSolution?.integration_type || 'generic',
|
|
948
|
-
complexity: this.taskAnalysis.complexity
|
|
949
|
-
};
|
|
950
|
-
}
|
|
951
|
-
createAdaptiveDeploymentStrategy() {
|
|
952
|
-
return {
|
|
953
|
-
approach: 'adaptive_deployment',
|
|
954
|
-
phases: this.createAdaptivePhases(),
|
|
955
|
-
rollback: 'automatic_rollback_enabled',
|
|
956
|
-
monitoring: 'real_time_monitoring',
|
|
957
|
-
validation: 'multi_specialist_validation'
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
createAdaptivePhases() {
|
|
961
|
-
const phases = [
|
|
962
|
-
{
|
|
963
|
-
name: 'Foundation Phase',
|
|
964
|
-
specialists: ['ServiceNow Specialist', 'Database Designer', 'Process Designer'],
|
|
965
|
-
description: 'Establish core platform and foundation components'
|
|
966
|
-
},
|
|
967
|
-
{
|
|
968
|
-
name: 'Implementation Phase',
|
|
969
|
-
specialists: ['Frontend Developer', 'Backend Developer', 'Business Logic Developer'],
|
|
970
|
-
description: 'Implement core functionality and business logic'
|
|
971
|
-
},
|
|
972
|
-
{
|
|
973
|
-
name: 'Integration Phase',
|
|
974
|
-
specialists: ['Integration Specialist', 'Interface Designer'],
|
|
975
|
-
description: 'Integrate components and design user interfaces'
|
|
976
|
-
},
|
|
977
|
-
{
|
|
978
|
-
name: 'Optimization Phase',
|
|
979
|
-
specialists: ['Performance Specialist', 'Security Specialist', 'QA Specialist'],
|
|
980
|
-
description: 'Optimize performance, ensure security, and validate quality'
|
|
981
|
-
}
|
|
982
|
-
];
|
|
983
|
-
// Filter phases based on selected specialists
|
|
984
|
-
return phases.filter(phase => phase.specialists.some(role => this.selectedSpecialists.find(s => s.role === role)));
|
|
985
|
-
}
|
|
986
|
-
createAdaptiveQAChecklist() {
|
|
987
|
-
const checklist = [
|
|
988
|
-
'Team composition optimized for task requirements',
|
|
989
|
-
'All specialist deliverables completed successfully',
|
|
990
|
-
'Integration between components validated',
|
|
991
|
-
'Domain-specific requirements addressed'
|
|
992
|
-
];
|
|
993
|
-
// Add specialist-specific checks
|
|
994
|
-
this.selectedSpecialists.forEach(specialist => {
|
|
995
|
-
checklist.push(`${specialist.role} deliverables meet quality standards`);
|
|
996
|
-
});
|
|
997
|
-
return checklist;
|
|
998
|
-
}
|
|
999
|
-
async generateAdaptiveInsights(integration) {
|
|
1000
|
-
return {
|
|
1001
|
-
efficiency: this.calculateAdaptiveEfficiency(),
|
|
1002
|
-
teamOptimization: this.analyzeTeamOptimization(),
|
|
1003
|
-
learningInsights: this.generateLearningInsights(),
|
|
1004
|
-
recommendations: this.generateFutureRecommendations()
|
|
1005
|
-
};
|
|
1006
|
-
}
|
|
1007
|
-
analyzeTeamOptimization() {
|
|
1008
|
-
return {
|
|
1009
|
-
optimalSize: this.determineOptimalTeamSize(),
|
|
1010
|
-
actualSize: this.selectedSpecialists.length,
|
|
1011
|
-
diversityScore: this.calculateTeamDiversity(),
|
|
1012
|
-
relevanceScore: this.calculateTeamRelevance(),
|
|
1013
|
-
improvement: this.suggestTeamImprovements()
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
suggestTeamImprovements() {
|
|
1017
|
-
const improvements = [];
|
|
1018
|
-
const optimalSize = this.determineOptimalTeamSize();
|
|
1019
|
-
const actualSize = this.selectedSpecialists.length;
|
|
1020
|
-
if (actualSize > optimalSize) {
|
|
1021
|
-
improvements.push('Consider reducing team size for better coordination');
|
|
1022
|
-
}
|
|
1023
|
-
else if (actualSize < optimalSize) {
|
|
1024
|
-
improvements.push('Consider adding specialists for better coverage');
|
|
1025
|
-
}
|
|
1026
|
-
const categories = new Set(this.selectedSpecialists.map(s => s.category));
|
|
1027
|
-
if (categories.size < 3) {
|
|
1028
|
-
improvements.push('Increase specialist diversity for better perspective');
|
|
1029
|
-
}
|
|
1030
|
-
return improvements;
|
|
1031
|
-
}
|
|
1032
|
-
generateLearningInsights() {
|
|
1033
|
-
return {
|
|
1034
|
-
taskPatterns: this.identifyTaskPatterns(),
|
|
1035
|
-
specialistEffectiveness: this.assessSpecialistEffectiveness(),
|
|
1036
|
-
coordinationPatterns: this.analyzeCoordinationPatterns()
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
identifyTaskPatterns() {
|
|
1040
|
-
return {
|
|
1041
|
-
domain: this.taskAnalysis.domain,
|
|
1042
|
-
complexity: this.taskAnalysis.complexity,
|
|
1043
|
-
technologies: this.taskAnalysis.technologies,
|
|
1044
|
-
commonPatterns: this.identifyCommonPatterns()
|
|
1045
|
-
};
|
|
1046
|
-
}
|
|
1047
|
-
identifyCommonPatterns() {
|
|
1048
|
-
const patterns = [];
|
|
1049
|
-
if (this.taskAnalysis.task.toLowerCase().includes('create') &&
|
|
1050
|
-
this.taskAnalysis.task.toLowerCase().includes('with')) {
|
|
1051
|
-
patterns.push('creation_with_requirements');
|
|
1052
|
-
}
|
|
1053
|
-
if (this.taskAnalysis.technologies.length > 2) {
|
|
1054
|
-
patterns.push('multi_technology_integration');
|
|
1055
|
-
}
|
|
1056
|
-
return patterns;
|
|
1057
|
-
}
|
|
1058
|
-
assessSpecialistEffectiveness() {
|
|
1059
|
-
return {
|
|
1060
|
-
highPerformers: this.selectedSpecialists.filter(s => s.priority > 85).map(s => s.role),
|
|
1061
|
-
criticalRoles: this.selectedSpecialists.filter(s => s.category === 'platform').map(s => s.role),
|
|
1062
|
-
synergies: this.identifySpecialistSynergies()
|
|
1063
|
-
};
|
|
1064
|
-
}
|
|
1065
|
-
identifySpecialistSynergies() {
|
|
1066
|
-
const synergies = [];
|
|
1067
|
-
const hasRoles = (roles) => roles.every(role => this.selectedSpecialists.find(s => s.role === role));
|
|
1068
|
-
if (hasRoles(['Frontend Developer', 'Backend Developer'])) {
|
|
1069
|
-
synergies.push('full_stack_coverage');
|
|
1070
|
-
}
|
|
1071
|
-
if (hasRoles(['Database Designer', 'Performance Specialist'])) {
|
|
1072
|
-
synergies.push('data_optimization_synergy');
|
|
1073
|
-
}
|
|
1074
|
-
if (hasRoles(['Security Specialist', 'Integration Specialist'])) {
|
|
1075
|
-
synergies.push('secure_integration_synergy');
|
|
1076
|
-
}
|
|
1077
|
-
return synergies;
|
|
1078
|
-
}
|
|
1079
|
-
analyzeCoordinationPatterns() {
|
|
1080
|
-
return {
|
|
1081
|
-
pattern: this.taskAnalysis.coordination,
|
|
1082
|
-
effectiveness: this.assessCoordinationEffectiveness(),
|
|
1083
|
-
bottlenecks: this.identifyCoordinationBottlenecks()
|
|
1084
|
-
};
|
|
1085
|
-
}
|
|
1086
|
-
assessCoordinationEffectiveness() {
|
|
1087
|
-
// Simplified coordination effectiveness assessment
|
|
1088
|
-
const teamSize = this.selectedSpecialists.length;
|
|
1089
|
-
const complexity = this.taskAnalysis.complexity;
|
|
1090
|
-
if (complexity === 'complex' && teamSize > 5) {
|
|
1091
|
-
return 75; // Complex coordination
|
|
1092
|
-
}
|
|
1093
|
-
else if (complexity === 'moderate' && teamSize <= 4) {
|
|
1094
|
-
return 90; // Good balance
|
|
1095
|
-
}
|
|
1096
|
-
else if (complexity === 'simple' && teamSize <= 3) {
|
|
1097
|
-
return 95; // Optimal
|
|
1098
|
-
}
|
|
1099
|
-
return 80; // Default
|
|
1100
|
-
}
|
|
1101
|
-
identifyCoordinationBottlenecks() {
|
|
1102
|
-
const bottlenecks = [];
|
|
1103
|
-
if (this.selectedSpecialists.length > 5) {
|
|
1104
|
-
bottlenecks.push('team_size_coordination_overhead');
|
|
1105
|
-
}
|
|
1106
|
-
const platformSpecialists = this.selectedSpecialists.filter(s => s.category === 'platform');
|
|
1107
|
-
if (platformSpecialists.length > 1) {
|
|
1108
|
-
bottlenecks.push('multiple_platform_specialists');
|
|
1109
|
-
}
|
|
1110
|
-
return bottlenecks;
|
|
1111
|
-
}
|
|
1112
|
-
generateFutureRecommendations() {
|
|
1113
|
-
const recommendations = [];
|
|
1114
|
-
recommendations.push('Maintain current team composition pattern for similar tasks');
|
|
1115
|
-
if (this.calculateAdaptiveEfficiency() > 85) {
|
|
1116
|
-
recommendations.push('Consider this team configuration as template for similar projects');
|
|
1117
|
-
}
|
|
1118
|
-
if (this.selectedSpecialists.length > 4) {
|
|
1119
|
-
recommendations.push('Explore sub-team coordination patterns for large teams');
|
|
1120
|
-
}
|
|
1121
|
-
return recommendations;
|
|
1122
|
-
}
|
|
1123
|
-
initializeAdaptiveQualityGates() {
|
|
1124
|
-
// Add adaptive quality gates that adjust based on team composition
|
|
1125
|
-
this.qualityGates.push({
|
|
1126
|
-
name: 'Team composition validation',
|
|
1127
|
-
check: async (results) => {
|
|
1128
|
-
const relevantSpecialists = this.selectedSpecialists.filter(s => s.applicability.some(term => this.taskAnalysis.task.toLowerCase().includes(term)));
|
|
1129
|
-
return relevantSpecialists.length >= Math.ceil(this.selectedSpecialists.length * 0.6);
|
|
1130
|
-
},
|
|
1131
|
-
onFailure: async (results) => {
|
|
1132
|
-
console.log('❌ Team composition validation failed - insufficient relevant specialists');
|
|
1133
|
-
}
|
|
1134
|
-
}, {
|
|
1135
|
-
name: 'Adaptive integration validation',
|
|
1136
|
-
check: async (results) => {
|
|
1137
|
-
const successfulResults = results.filter(r => r.status === 'success');
|
|
1138
|
-
return successfulResults.length >= Math.ceil(results.length * 0.8);
|
|
1139
|
-
},
|
|
1140
|
-
onFailure: async (results) => {
|
|
1141
|
-
console.log('❌ Adaptive integration validation failed - too many specialist failures');
|
|
1142
|
-
}
|
|
1143
|
-
}, {
|
|
1144
|
-
name: 'Domain optimization validation',
|
|
1145
|
-
check: async (results) => {
|
|
1146
|
-
const domainRelevantCount = this.selectedSpecialists.filter(s => this.isDomainRelevant(s, this.taskAnalysis.domain)).length;
|
|
1147
|
-
return domainRelevantCount >= Math.ceil(this.selectedSpecialists.length * 0.5);
|
|
1148
|
-
}
|
|
1149
|
-
});
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
exports.AdaptiveTeam = AdaptiveTeam;
|
|
1153
|
-
//# sourceMappingURL=adaptive-team.js.map
|