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,655 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Intelligent Agent Detection System
|
|
4
|
-
* Dynamically determines which agents to spawn based on task analysis
|
|
5
|
-
*
|
|
6
|
-
* NOTE: This system now integrates with the Snow-Flow MCP task_categorize tool
|
|
7
|
-
* for dynamic AI-based categorization instead of static patterns.
|
|
8
|
-
*/
|
|
9
|
-
var __assign = (this && this.__assign) || function () {
|
|
10
|
-
__assign = Object.assign || function(t) {
|
|
11
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
-
s = arguments[i];
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
}
|
|
16
|
-
return t;
|
|
17
|
-
};
|
|
18
|
-
return __assign.apply(this, arguments);
|
|
19
|
-
};
|
|
20
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
30
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
31
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
32
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33
|
-
function step(op) {
|
|
34
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
35
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
36
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
37
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
38
|
-
switch (op[0]) {
|
|
39
|
-
case 0: case 1: t = op; break;
|
|
40
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
41
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
42
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
43
|
-
default:
|
|
44
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
45
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
46
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
47
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
48
|
-
if (t[2]) _.ops.pop();
|
|
49
|
-
_.trys.pop(); continue;
|
|
50
|
-
}
|
|
51
|
-
op = body.call(thisArg, _);
|
|
52
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
53
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
57
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
58
|
-
if (ar || !(i in from)) {
|
|
59
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
60
|
-
ar[i] = from[i];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
64
|
-
};
|
|
65
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
-
exports.AgentDetector = void 0;
|
|
67
|
-
var AgentDetector = /** @class */ (function () {
|
|
68
|
-
function AgentDetector() {
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Set the MCP client for dynamic categorization
|
|
72
|
-
*/
|
|
73
|
-
AgentDetector.setMCPClient = function (client) {
|
|
74
|
-
this.mcpClient = client;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Analyze task using MCP dynamic categorization or fallback to static patterns
|
|
78
|
-
*/
|
|
79
|
-
AgentDetector.analyzeTaskDynamic = function (objective, userMaxAgents) {
|
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
-
var response, result, error_1;
|
|
82
|
-
return __generator(this, function (_a) {
|
|
83
|
-
switch (_a.label) {
|
|
84
|
-
case 0:
|
|
85
|
-
if (!this.mcpClient) return [3 /*break*/, 4];
|
|
86
|
-
_a.label = 1;
|
|
87
|
-
case 1:
|
|
88
|
-
_a.trys.push([1, 3, , 4]);
|
|
89
|
-
return [4 /*yield*/, this.mcpClient.callTool({
|
|
90
|
-
name: 'task_categorize',
|
|
91
|
-
arguments: {
|
|
92
|
-
objective: objective,
|
|
93
|
-
context: {
|
|
94
|
-
language: 'auto',
|
|
95
|
-
maxAgents: userMaxAgents || 8,
|
|
96
|
-
environment: 'development',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
})];
|
|
100
|
-
case 2:
|
|
101
|
-
response = _a.sent();
|
|
102
|
-
if (response && response.content && response.content[0]) {
|
|
103
|
-
result = JSON.parse(response.content[0].text);
|
|
104
|
-
// Map MCP response to TaskAnalysis interface
|
|
105
|
-
return [2 /*return*/, {
|
|
106
|
-
primaryAgent: result.categorization.primary_agent,
|
|
107
|
-
supportingAgents: result.categorization.supporting_agents,
|
|
108
|
-
complexity: result.categorization.complexity,
|
|
109
|
-
estimatedAgentCount: result.categorization.estimated_agent_count,
|
|
110
|
-
requiresUpdateSet: result.categorization.requires_update_set,
|
|
111
|
-
requiresApplication: result.categorization.requires_application,
|
|
112
|
-
taskType: result.categorization.task_type,
|
|
113
|
-
serviceNowArtifacts: result.categorization.service_now_artifacts,
|
|
114
|
-
confidence: result.categorization.confidence_score,
|
|
115
|
-
neuralConfidence: result.metadata.neural_confidence,
|
|
116
|
-
intentAnalysis: result.intent_analysis,
|
|
117
|
-
approach: {
|
|
118
|
-
recommendedStrategy: result.approach.recommended_strategy,
|
|
119
|
-
executionMode: result.approach.execution_mode,
|
|
120
|
-
parallelOpportunities: result.approach.parallel_opportunities,
|
|
121
|
-
riskFactors: result.approach.risk_factors,
|
|
122
|
-
optimizationHints: result.approach.optimization_hints,
|
|
123
|
-
},
|
|
124
|
-
}];
|
|
125
|
-
}
|
|
126
|
-
return [3 /*break*/, 4];
|
|
127
|
-
case 3:
|
|
128
|
-
error_1 = _a.sent();
|
|
129
|
-
console.warn('MCP task_categorize failed, falling back to static patterns:', error_1);
|
|
130
|
-
return [3 /*break*/, 4];
|
|
131
|
-
case 4:
|
|
132
|
-
// Fallback to static analysis
|
|
133
|
-
return [2 /*return*/, this.analyzeTask(objective, userMaxAgents)];
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
AgentDetector.analyzeTask = function (objective, userMaxAgents) {
|
|
139
|
-
var lowerObjective = objective.toLowerCase();
|
|
140
|
-
var words = lowerObjective.split(/\s+/);
|
|
141
|
-
// Check for data generation FIRST - before any other analysis
|
|
142
|
-
var dataGenerationPatterns = [
|
|
143
|
-
// Pattern for "create/make X incidents/changes" with flexible word order
|
|
144
|
-
/\b(create|generate|make|maak|genereer|aanmaken)\b.*\b\d+\b.*(incident|change|request|problem|task|record|item)/i,
|
|
145
|
-
// Pattern for "data set" with numbers anywhere
|
|
146
|
-
/\bdata\s*set\b.*\b\d{3,}/i, // data set with 3+ digit numbers
|
|
147
|
-
// Pattern for various test/mock/sample data keywords
|
|
148
|
-
/\b(test\s+data|mock\s+data|sample\s+data|training\s+data)\b/i,
|
|
149
|
-
// Pattern for populate/seed/fill operations
|
|
150
|
-
/\b(populate|seed|fill)\s+(with\s+)?(test|sample|random|mock)\s+(data|incident|change|record)/i,
|
|
151
|
-
// Pattern for seed database with numbers
|
|
152
|
-
/\b(seed|populate|fill)\s+(database|db|table)\s+with\s+\d+/i,
|
|
153
|
-
// Pattern for ML training data
|
|
154
|
-
/\b(ML|machine\s+learning|training)\b.*\bdata/i,
|
|
155
|
-
// Pattern for random/test with large numbers
|
|
156
|
-
/\b(random|test|mock|sample)\b.*\b\d{3,}\b.*(incident|change|request|problem)/i,
|
|
157
|
-
// Pattern for Dutch data set creation
|
|
158
|
-
/\bdata\s*set\s+(aan\s+)?van\s+\d+/i
|
|
159
|
-
];
|
|
160
|
-
var isDataGeneration = dataGenerationPatterns.some(function (pattern) { return pattern.test(objective); });
|
|
161
|
-
if (isDataGeneration) {
|
|
162
|
-
return {
|
|
163
|
-
primaryAgent: 'script-writer',
|
|
164
|
-
supportingAgents: ['tester'], // Minimal support
|
|
165
|
-
complexity: 'simple',
|
|
166
|
-
estimatedAgentCount: 2,
|
|
167
|
-
requiresUpdateSet: false, // Usually no update set needed for data generation
|
|
168
|
-
requiresApplication: false,
|
|
169
|
-
taskType: 'data_generation',
|
|
170
|
-
serviceNowArtifacts: ['script']
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
// Check for simple operations
|
|
174
|
-
var simpleOperationPatterns = [
|
|
175
|
-
/\b(update|change|modify|delete|remove)\s+(the\s+)?(field|record|value|property)\b/i,
|
|
176
|
-
/\b(wijzig|verander|verwijder|pas\s+aan)\s+(het\s+)?(veld|record|waarde)\b/i
|
|
177
|
-
];
|
|
178
|
-
var isSimpleOperation = simpleOperationPatterns.some(function (pattern) { return pattern.test(objective); });
|
|
179
|
-
if (isSimpleOperation) {
|
|
180
|
-
return {
|
|
181
|
-
primaryAgent: 'script-writer',
|
|
182
|
-
supportingAgents: ['tester'],
|
|
183
|
-
complexity: 'simple',
|
|
184
|
-
estimatedAgentCount: 2,
|
|
185
|
-
requiresUpdateSet: false,
|
|
186
|
-
requiresApplication: false,
|
|
187
|
-
taskType: 'simple_operation',
|
|
188
|
-
serviceNowArtifacts: ['script']
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
// Determine task type for other cases
|
|
192
|
-
var taskType = this.determineTaskType(lowerObjective, this.detectServiceNowArtifacts(lowerObjective));
|
|
193
|
-
// Detect agent capabilities
|
|
194
|
-
var agentCapabilities = this.detectAgentCapabilities(lowerObjective);
|
|
195
|
-
// Determine primary agent
|
|
196
|
-
var primaryAgent = this.determinePrimaryAgent(agentCapabilities);
|
|
197
|
-
// Determine supporting agents
|
|
198
|
-
var supportingAgents = this.determineSupportingAgents(agentCapabilities, primaryAgent, userMaxAgents);
|
|
199
|
-
// Assess complexity
|
|
200
|
-
var complexity = this.assessComplexity(objective, agentCapabilities);
|
|
201
|
-
// Determine ServiceNow artifacts
|
|
202
|
-
var serviceNowArtifacts = this.detectServiceNowArtifacts(lowerObjective);
|
|
203
|
-
// Determine if Update Set is required
|
|
204
|
-
var requiresUpdateSet = this.requiresUpdateSet(lowerObjective, serviceNowArtifacts);
|
|
205
|
-
// Determine if new Application is required
|
|
206
|
-
var requiresApplication = this.requiresApplication(lowerObjective, serviceNowArtifacts);
|
|
207
|
-
// 🚀 NEW: Accurate agent count for parallel system
|
|
208
|
-
var isDevelopmentTask = ['widget-creator', 'flow-builder', 'script-writer', 'app-architect'].includes(primaryAgent) ||
|
|
209
|
-
supportingAgents.some(function (agent) { return ['css-specialist', 'backend-specialist', 'frontend-specialist'].includes(agent); });
|
|
210
|
-
var estimatedAgentCount = isDevelopmentTask
|
|
211
|
-
? Math.max(supportingAgents.length + 1, 6) // 6+ agents for development (1 primary + 5+ specialists)
|
|
212
|
-
: Math.min(Math.max(supportingAgents.length + 1, 2), 8); // Original logic for non-development
|
|
213
|
-
return {
|
|
214
|
-
primaryAgent: primaryAgent,
|
|
215
|
-
supportingAgents: supportingAgents,
|
|
216
|
-
complexity: complexity,
|
|
217
|
-
estimatedAgentCount: estimatedAgentCount,
|
|
218
|
-
requiresUpdateSet: requiresUpdateSet,
|
|
219
|
-
requiresApplication: requiresApplication,
|
|
220
|
-
taskType: taskType,
|
|
221
|
-
serviceNowArtifacts: serviceNowArtifacts
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
AgentDetector.detectAgentCapabilities = function (objective) {
|
|
225
|
-
var capabilities = [];
|
|
226
|
-
for (var _i = 0, _a = Object.entries(this.AGENT_PATTERNS); _i < _a.length; _i++) {
|
|
227
|
-
var _b = _a[_i], agentType = _b[0], config = _b[1];
|
|
228
|
-
var matchCount = 0;
|
|
229
|
-
var totalKeywords = config.keywords.length;
|
|
230
|
-
for (var _c = 0, _d = config.keywords; _c < _d.length; _c++) {
|
|
231
|
-
var keyword = _d[_c];
|
|
232
|
-
if (objective.includes(keyword)) {
|
|
233
|
-
matchCount++;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
if (matchCount > 0) {
|
|
237
|
-
var confidence = (matchCount / totalKeywords) * config.confidence;
|
|
238
|
-
capabilities.push({
|
|
239
|
-
type: agentType,
|
|
240
|
-
confidence: confidence,
|
|
241
|
-
requiredFor: config.requiredFor,
|
|
242
|
-
description: config.description
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return capabilities.sort(function (a, b) { return b.confidence - a.confidence; });
|
|
247
|
-
};
|
|
248
|
-
AgentDetector.determinePrimaryAgent = function (capabilities) {
|
|
249
|
-
if (capabilities.length === 0)
|
|
250
|
-
return 'queen-coordinator';
|
|
251
|
-
// Map detected types to new parallel agent types
|
|
252
|
-
var convertToParallelType = function (detectedType) {
|
|
253
|
-
var mapping = {
|
|
254
|
-
'widget_builder': 'widget-creator',
|
|
255
|
-
'flow_designer': 'flow-builder',
|
|
256
|
-
'integration_specialist': 'integration-specialist',
|
|
257
|
-
'database_expert': 'app-architect',
|
|
258
|
-
'coder': 'script-writer',
|
|
259
|
-
'architect': 'app-architect',
|
|
260
|
-
'tester': 'tester',
|
|
261
|
-
'data_generator': 'script-writer' // Data generation uses script-writer
|
|
262
|
-
};
|
|
263
|
-
return mapping[detectedType] || detectedType;
|
|
264
|
-
};
|
|
265
|
-
// Convert all capability types to parallel agent types
|
|
266
|
-
var parallelCapabilities = capabilities.map(function (c) { return (__assign(__assign({}, c), { type: convertToParallelType(c.type) })); });
|
|
267
|
-
// Special logic for ServiceNow-specific tasks - use new parallel agent types
|
|
268
|
-
var serviceNowAgents = parallelCapabilities.filter(function (c) {
|
|
269
|
-
return ['flow-builder', 'widget-creator', 'integration-specialist', 'app-architect'].includes(c.type);
|
|
270
|
-
});
|
|
271
|
-
if (serviceNowAgents.length > 0) {
|
|
272
|
-
return serviceNowAgents[0].type;
|
|
273
|
-
}
|
|
274
|
-
return parallelCapabilities[0].type;
|
|
275
|
-
};
|
|
276
|
-
AgentDetector.determineSupportingAgents = function (capabilities, primaryAgent, userMaxAgents) {
|
|
277
|
-
// 🚀 NEW: Parallel Agent System - Show 6+ specialized agents for development tasks
|
|
278
|
-
var isWidgetDevelopment = primaryAgent === 'widget-creator' || capabilities.some(function (c) { return c.type === 'widget-creator'; });
|
|
279
|
-
var isFlowDevelopment = primaryAgent === 'flow-builder' || capabilities.some(function (c) { return c.type === 'flow-builder'; });
|
|
280
|
-
var isDevelopmentTask = isWidgetDevelopment || isFlowDevelopment ||
|
|
281
|
-
capabilities.some(function (c) { return ['widget-creator', 'flow-builder', 'script-writer', 'app-architect'].includes(c.type); });
|
|
282
|
-
if (isDevelopmentTask) {
|
|
283
|
-
// 🚀 Widget development gets full specialized team (6+ agents)
|
|
284
|
-
if (isWidgetDevelopment) {
|
|
285
|
-
return ['css-specialist', 'backend-specialist', 'frontend-specialist', 'integration-specialist', 'performance-specialist', 'tester'];
|
|
286
|
-
}
|
|
287
|
-
// 🚀 Flow development gets flow-specific team
|
|
288
|
-
if (isFlowDevelopment) {
|
|
289
|
-
return ['trigger-specialist', 'action-specialist', 'approval-specialist', 'integration-specialist', 'error-handler', 'tester'];
|
|
290
|
-
}
|
|
291
|
-
// 🚀 General development gets adaptive specialized team
|
|
292
|
-
return ['script-writer', 'css-specialist', 'integration-specialist', 'security-specialist', 'performance-specialist', 'tester'];
|
|
293
|
-
}
|
|
294
|
-
// 🚀 For non-development tasks, use smart agent selection based on capabilities
|
|
295
|
-
var requestedSupportingCount = userMaxAgents ? Math.max(userMaxAgents - 1, 1) : 5;
|
|
296
|
-
// Start with high-confidence agents (confidence > 0.3)
|
|
297
|
-
var supportingAgents = capabilities
|
|
298
|
-
.filter(function (c) { return c.type !== primaryAgent && c.confidence > 0.3; })
|
|
299
|
-
.slice(0, requestedSupportingCount)
|
|
300
|
-
.map(function (c) { return c.type; });
|
|
301
|
-
// If we need more agents, add specialized agents based on task context
|
|
302
|
-
if (supportingAgents.length < requestedSupportingCount) {
|
|
303
|
-
var remainingSlots = requestedSupportingCount - supportingAgents.length;
|
|
304
|
-
var specializedAgents = ['integration-specialist', 'security-specialist', 'tester', 'performance-specialist']
|
|
305
|
-
.filter(function (agent) { return !supportingAgents.includes(agent); })
|
|
306
|
-
.slice(0, remainingSlots);
|
|
307
|
-
supportingAgents = __spreadArray(__spreadArray([], supportingAgents, true), specializedAgents, true);
|
|
308
|
-
}
|
|
309
|
-
// Ensure we don't exceed the requested count
|
|
310
|
-
if (userMaxAgents && supportingAgents.length > requestedSupportingCount) {
|
|
311
|
-
supportingAgents = supportingAgents.slice(0, requestedSupportingCount);
|
|
312
|
-
}
|
|
313
|
-
return supportingAgents;
|
|
314
|
-
};
|
|
315
|
-
AgentDetector.assessComplexity = function (objective, capabilities) {
|
|
316
|
-
var wordCount = objective.split(/\s+/).length;
|
|
317
|
-
var agentCount = capabilities.length;
|
|
318
|
-
// Complex indicators
|
|
319
|
-
var complexKeywords = ['integrate', 'multiple', 'complex', 'advanced', 'system', 'architecture', 'enterprise'];
|
|
320
|
-
var hasComplexKeywords = complexKeywords.some(function (keyword) { return objective.toLowerCase().includes(keyword); });
|
|
321
|
-
if (wordCount > 20 || agentCount > 4 || hasComplexKeywords) {
|
|
322
|
-
return 'complex';
|
|
323
|
-
}
|
|
324
|
-
else if (wordCount > 10 || agentCount > 2) {
|
|
325
|
-
return 'medium';
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
return 'simple';
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
AgentDetector.detectServiceNowArtifacts = function (objective) {
|
|
332
|
-
var artifacts = [];
|
|
333
|
-
var lowerObjective = objective.toLowerCase();
|
|
334
|
-
// Enhanced artifact detection with Dutch support and context
|
|
335
|
-
var artifactPatterns = {
|
|
336
|
-
'widget': [
|
|
337
|
-
'widget', 'widgets',
|
|
338
|
-
'service portal', 'portal component', 'dashboard component',
|
|
339
|
-
'ui component', 'interface', 'display', 'homepage'
|
|
340
|
-
],
|
|
341
|
-
'flow': [
|
|
342
|
-
'flow', 'flows', 'workflow', 'workflows',
|
|
343
|
-
'process', 'processes', 'automation', 'automate',
|
|
344
|
-
'approval', 'approvals', 'routing', 'trigger'
|
|
345
|
-
],
|
|
346
|
-
'application': [
|
|
347
|
-
'application', 'applications', 'app', 'apps',
|
|
348
|
-
'applicatie', 'applicaties', 'system', 'systeem',
|
|
349
|
-
'complete', 'comprehensive', 'full solution'
|
|
350
|
-
],
|
|
351
|
-
'script': [
|
|
352
|
-
'script', 'scripts', 'code', 'function', 'functions',
|
|
353
|
-
'business rule', 'business rules', 'client script', 'server script',
|
|
354
|
-
'script include', 'javascript', 'logic', 'programmeer'
|
|
355
|
-
],
|
|
356
|
-
'business_rule': [
|
|
357
|
-
'business rule', 'business rules', 'business_rule',
|
|
358
|
-
'rule', 'rules', 'validation', 'trigger logic',
|
|
359
|
-
'bedrijfsregel', 'regel', 'regels'
|
|
360
|
-
],
|
|
361
|
-
'integration': [
|
|
362
|
-
'integration', 'integrations', 'api', 'apis',
|
|
363
|
-
'rest', 'soap', 'webhook', 'external', 'third party',
|
|
364
|
-
'integratie', 'koppeling', 'verbinding'
|
|
365
|
-
],
|
|
366
|
-
'table': [
|
|
367
|
-
'table', 'tables', 'database', 'data',
|
|
368
|
-
'record', 'records', 'field', 'fields',
|
|
369
|
-
'tabel', 'tabellen', 'gegevens'
|
|
370
|
-
],
|
|
371
|
-
'report': [
|
|
372
|
-
'report', 'reports', 'reporting', 'analytics',
|
|
373
|
-
'dashboard', 'chart', 'graph', 'metrics',
|
|
374
|
-
'rapport', 'rapporten', 'rapportage'
|
|
375
|
-
]
|
|
376
|
-
};
|
|
377
|
-
// Check each artifact type with enhanced patterns
|
|
378
|
-
for (var _i = 0, _a = Object.entries(artifactPatterns); _i < _a.length; _i++) {
|
|
379
|
-
var _b = _a[_i], artifactType = _b[0], patterns = _b[1];
|
|
380
|
-
for (var _c = 0, patterns_1 = patterns; _c < patterns_1.length; _c++) {
|
|
381
|
-
var pattern = patterns_1[_c];
|
|
382
|
-
if (lowerObjective.includes(pattern)) {
|
|
383
|
-
if (!artifacts.includes(artifactType)) {
|
|
384
|
-
artifacts.push(artifactType);
|
|
385
|
-
}
|
|
386
|
-
break; // Found one pattern for this type, move to next type
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
// Context-based detection for common development terms
|
|
391
|
-
var developmentContext = {
|
|
392
|
-
'widget': ['voor', 'voor een', 'show', 'display', 'interface', 'homepage', 'portal'],
|
|
393
|
-
'flow': ['goedkeuring', 'approval', 'proces', 'automatiseer', 'trigger', 'wanneer'],
|
|
394
|
-
'script': ['implementeer', 'implement', 'schrijf', 'write', 'code', 'function'],
|
|
395
|
-
'table': ['opslaan', 'save', 'store', 'data', 'informatie', 'gegevens'],
|
|
396
|
-
'report': ['analyse', 'analyze', 'overview', 'overzicht', 'statistieken', 'metrics']
|
|
397
|
-
};
|
|
398
|
-
// Add context-based detection
|
|
399
|
-
for (var _d = 0, _e = Object.entries(developmentContext); _d < _e.length; _d++) {
|
|
400
|
-
var _f = _e[_d], artifactType = _f[0], contextWords = _f[1];
|
|
401
|
-
for (var _g = 0, contextWords_1 = contextWords; _g < contextWords_1.length; _g++) {
|
|
402
|
-
var contextWord = contextWords_1[_g];
|
|
403
|
-
if (lowerObjective.includes(contextWord) && !artifacts.includes(artifactType)) {
|
|
404
|
-
// Only add if we have creation/development intent
|
|
405
|
-
var creationWords = ['create', 'maak', 'bouw', 'build', 'develop', 'implementeer', 'schrijf', 'write'];
|
|
406
|
-
if (creationWords.some(function (word) { return lowerObjective.includes(word); })) {
|
|
407
|
-
artifacts.push(artifactType);
|
|
408
|
-
break;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
// Remove duplicates and return
|
|
414
|
-
return Array.from(new Set(artifacts));
|
|
415
|
-
};
|
|
416
|
-
AgentDetector.requiresUpdateSet = function (objective, artifacts) {
|
|
417
|
-
var lowerObjective = objective.toLowerCase();
|
|
418
|
-
// Always require Update Set for development tasks
|
|
419
|
-
var developmentKeywords = [
|
|
420
|
-
'create', 'build', 'implement', 'develop', 'make', 'generate', 'add',
|
|
421
|
-
'bouw', 'maak', 'schrijf', 'write', 'update', 'modify', 'change',
|
|
422
|
-
'implementeer', 'ontwikkel', 'codeer', 'programmeer', 'stel', 'wijzig',
|
|
423
|
-
'business rule', 'script', 'flow', 'widget', 'workflow', 'client script',
|
|
424
|
-
'ui action', 'scheduled job', 'transform', 'integration',
|
|
425
|
-
'bedrijfsregel', 'proces', 'goedkeuring', 'automatisering'
|
|
426
|
-
];
|
|
427
|
-
var hasDevelopmentKeywords = developmentKeywords.some(function (keyword) { return lowerObjective.includes(keyword); });
|
|
428
|
-
// Or if ServiceNow artifacts are involved
|
|
429
|
-
var hasServiceNowArtifacts = artifacts.length > 0;
|
|
430
|
-
// Or if task type indicates development
|
|
431
|
-
var developmentTaskTypes = [
|
|
432
|
-
'widget_development', 'flow_development', 'script_development',
|
|
433
|
-
'application_development', 'integration_development', 'database_development',
|
|
434
|
-
'reporting_development', 'general_development'
|
|
435
|
-
];
|
|
436
|
-
var taskType = this.determineTaskType(objective, artifacts);
|
|
437
|
-
var isDevelopmentTask = developmentTaskTypes.includes(taskType);
|
|
438
|
-
return hasDevelopmentKeywords || hasServiceNowArtifacts || isDevelopmentTask;
|
|
439
|
-
};
|
|
440
|
-
AgentDetector.requiresApplication = function (objective, artifacts) {
|
|
441
|
-
// Require new application for comprehensive systems
|
|
442
|
-
var applicationKeywords = [
|
|
443
|
-
'application', 'app', 'system', 'complete', 'full', 'comprehensive',
|
|
444
|
-
'applicatie', 'applicaties', 'systeem', 'volledig', 'compleet',
|
|
445
|
-
'totaal', 'geheel', 'pakket', 'oplossing', 'solution'
|
|
446
|
-
];
|
|
447
|
-
var hasApplicationKeywords = applicationKeywords.some(function (keyword) { return objective.toLowerCase().includes(keyword); });
|
|
448
|
-
// Or if multiple complex artifacts are involved
|
|
449
|
-
var hasMultipleArtifacts = artifacts.length >= 3;
|
|
450
|
-
return hasApplicationKeywords || hasMultipleArtifacts;
|
|
451
|
-
};
|
|
452
|
-
AgentDetector.determineTaskType = function (objective, artifacts) {
|
|
453
|
-
var lowerObjective = objective.toLowerCase();
|
|
454
|
-
// FIRST: Check for data generation requests
|
|
455
|
-
var dataGenerationPatterns = [
|
|
456
|
-
/\b(create|generate|make|maak)\s+\d+\s+(random\s+)?(incident|change|request|problem|task|record|item)/i,
|
|
457
|
-
/\b(genereer|aanmaken)\s+\d+\s+(willekeurige\s+)?(incident|change|request|problem|task|record|item)/i,
|
|
458
|
-
/\bdata\s*set\s*(van|of|with)\s*\d+/i,
|
|
459
|
-
/\b(test\s+data|mock\s+data|sample\s+data|training\s+data)\b/i,
|
|
460
|
-
/\b(populate|seed|fill)\s+(with\s+)?(test|sample|random)\s+data/i
|
|
461
|
-
];
|
|
462
|
-
var isDataGeneration = dataGenerationPatterns.some(function (pattern) { return pattern.test(objective); });
|
|
463
|
-
if (isDataGeneration)
|
|
464
|
-
return 'data_generation';
|
|
465
|
-
// Check for simple operations (update, delete, modify single things)
|
|
466
|
-
var simpleOperationPatterns = [
|
|
467
|
-
/\b(update|change|modify|delete|remove)\s+(the\s+)?(field|record|value|property)\b/i,
|
|
468
|
-
/\b(wijzig|verander|verwijder|pas\s+aan)\s+(het\s+)?(veld|record|waarde)\b/i
|
|
469
|
-
];
|
|
470
|
-
var isSimpleOperation = simpleOperationPatterns.some(function (pattern) { return pattern.test(objective); });
|
|
471
|
-
if (isSimpleOperation)
|
|
472
|
-
return 'simple_operation';
|
|
473
|
-
// Determine based on detected artifacts and keywords
|
|
474
|
-
// Check flow FIRST as it's often confused with widget when both are present
|
|
475
|
-
if (artifacts.includes('flow') || artifacts.includes('workflow'))
|
|
476
|
-
return 'flow_development';
|
|
477
|
-
if (artifacts.includes('widget'))
|
|
478
|
-
return 'widget_development';
|
|
479
|
-
if (artifacts.includes('application'))
|
|
480
|
-
return 'application_development';
|
|
481
|
-
if (artifacts.includes('script') || artifacts.includes('business_rule'))
|
|
482
|
-
return 'script_development';
|
|
483
|
-
if (artifacts.includes('integration') || artifacts.includes('api'))
|
|
484
|
-
return 'integration_development';
|
|
485
|
-
if (artifacts.includes('table') || artifacts.includes('database'))
|
|
486
|
-
return 'database_development';
|
|
487
|
-
if (artifacts.includes('report') || artifacts.includes('dashboard'))
|
|
488
|
-
return 'reporting_development';
|
|
489
|
-
// Fallback to general development
|
|
490
|
-
var developmentKeywords = [
|
|
491
|
-
'create', 'build', 'implement', 'develop', 'make', 'generate',
|
|
492
|
-
'bouw', 'maak', 'schrijf', 'implementeer', 'ontwikkel', 'codeer'
|
|
493
|
-
];
|
|
494
|
-
var hasDevelopmentKeywords = developmentKeywords.some(function (keyword) { return lowerObjective.includes(keyword); });
|
|
495
|
-
if (hasDevelopmentKeywords)
|
|
496
|
-
return 'general_development';
|
|
497
|
-
// Research or _analysis tasks
|
|
498
|
-
var researchKeywords = [
|
|
499
|
-
'research', 'analyze', 'investigate', 'study', 'explore',
|
|
500
|
-
'onderzoek', 'analyseer', 'bestudeer', 'ontdek'
|
|
501
|
-
];
|
|
502
|
-
var hasResearchKeywords = researchKeywords.some(function (keyword) { return lowerObjective.includes(keyword); });
|
|
503
|
-
if (hasResearchKeywords)
|
|
504
|
-
return 'research_task';
|
|
505
|
-
return 'orchestration_task';
|
|
506
|
-
};
|
|
507
|
-
AgentDetector.generateAgentPrompt = function (agentType, objective, _analysis) {
|
|
508
|
-
var agentConfig = this.AGENT_PATTERNS[agentType];
|
|
509
|
-
var basePrompt = "You are a specialized ".concat(agentType, " agent in a ServiceNow multi-agent development swarm.\n\n\uD83C\uDFAF **Your Role**: ").concat((agentConfig === null || agentConfig === void 0 ? void 0 : agentConfig.description) || 'Specialized agent', "\n\n\uD83D\uDD0D **Task Context**: ").concat(objective, "\n\n\uD83C\uDFD7\uFE0F **Project Setup**:\n").concat(_analysis.requiresUpdateSet ? '- ✅ Update Set will be automatically created' : '- ⚠️ No Update Set required', "\n").concat(_analysis.requiresApplication ? '- ✅ New Application will be automatically created' : '- ⚠️ Using existing application context', "\n\n\uD83E\uDD16 **ML Capabilities Available**:\n- \uD83E\uDDE0 Neural Networks: Incident classification, change risk prediction, anomaly detection\n- \uD83D\uDCCA Performance Analytics ML: KPI forecasting, trend analysis (when PA plugin active)\n- \uD83D\uDD2E Predictive Intelligence: Clustering, similarity matching (when PI plugin active)\n- \uD83C\uDFAF Hybrid ML: Combine ServiceNow native ML with custom TensorFlow models\n\n\uD83E\uDD16 **Team Coordination**:\n- Primary Agent: ").concat(_analysis.primaryAgent, "\n- Supporting Agents: ").concat(_analysis.supportingAgents.join(', '), "\n- Task Complexity: ").concat(_analysis.complexity, "\n- ServiceNow Artifacts: ").concat(_analysis.serviceNowArtifacts.join(', '), "\n\n\uD83D\uDCCB **Your Responsibilities**:");
|
|
510
|
-
// Add agent-specific responsibilities
|
|
511
|
-
switch (agentType) {
|
|
512
|
-
case 'architect':
|
|
513
|
-
return basePrompt + "\n- Design system architecture and data models\n- Define relationships between ServiceNow components\n- Create technical specifications\n- Ensure scalability and best practices\n- Coordinate with other agents on implementation approach";
|
|
514
|
-
case 'coder':
|
|
515
|
-
return basePrompt + "\n- Implement code based on architectural designs\n- Write ServiceNow scripts, business rules, and functions\n- Ensure code quality and maintainability\n- Follow ServiceNow development best practices\n- Collaborate with testers on code validation\n- Implement ML-powered features:\n * mcp__servicenow-machine-learning__ml_train_incident_classifier - Train classification models\n * mcp__servicenow-machine-learning__ml_classify_incident - Auto-classify incidents\n * mcp__servicenow-machine-learning__ml_predictive_intelligence - Add PI capabilities";
|
|
516
|
-
case 'flow_designer':
|
|
517
|
-
return basePrompt + "\n- Design and implement ServiceNow flows and workflows\n- Configure approval processes and routing logic\n- Set up triggers and conditions\n- Ensure proper integration with other system components\n- Test flow execution and error handling";
|
|
518
|
-
case 'widget_builder':
|
|
519
|
-
return basePrompt + "\n- Design and implement Service Portal widgets\n- Create HTML templates and CSS styling\n- Develop client-side and server-side scripts\n- Ensure responsive design and accessibility\n- Integrate with ServiceNow APIs and data sources";
|
|
520
|
-
case 'tester':
|
|
521
|
-
return basePrompt + "\n- Develop and execute test plans\n- Validate functionality and performance\n- Identify and report bugs and issues\n- Ensure quality standards are met\n- Coordinate with development agents on fixes";
|
|
522
|
-
case 'researcher':
|
|
523
|
-
return basePrompt + "\n- Research ServiceNow best practices and patterns\n- Analyze requirements and gather information\n- Provide insights and recommendations\n- Study existing implementations and solutions\n- Document findings and share knowledge\n- Use ML for data-driven insights:\n * mcp__servicenow-machine-learning__ml_forecast_incidents - Predict future trends\n * mcp__servicenow-machine-learning__ml_detect_anomalies - Find unusual patterns\n * mcp__servicenow-machine-learning__ml_performance_analytics - Analyze KPIs with ML";
|
|
524
|
-
case 'orchestrator':
|
|
525
|
-
return basePrompt + "\n- Coordinate activities between all agents\n- Manage task priorities and dependencies\n- Ensure project timeline and milestones\n- Facilitate communication and collaboration\n- Monitor progress and address blockers\n- Leverage ML for intelligent orchestration:\n * mcp__servicenow-machine-learning__ml_agent_intelligence - AI work assignment\n * mcp__servicenow-machine-learning__ml_process_optimization - Optimize workflows\n * mcp__servicenow-machine-learning__ml_hybrid_recommendation - Combined ML insights";
|
|
526
|
-
default:
|
|
527
|
-
return basePrompt + "\n- Provide specialized expertise in your domain\n- Collaborate effectively with other agents\n- Ensure quality and best practices\n- Contribute to overall project success";
|
|
528
|
-
}
|
|
529
|
-
};
|
|
530
|
-
// MCP integration for dynamic categorization
|
|
531
|
-
AgentDetector.mcpClient = null;
|
|
532
|
-
AgentDetector.AGENT_PATTERNS = {
|
|
533
|
-
// Development agents
|
|
534
|
-
architect: {
|
|
535
|
-
keywords: ['design', 'architecture', 'structure', 'database', 'schema', 'model', 'entity', 'relationship', 'system'],
|
|
536
|
-
confidence: 0.9,
|
|
537
|
-
description: 'System architecture and design',
|
|
538
|
-
requiredFor: ['applications', 'complex_systems', 'integrations']
|
|
539
|
-
},
|
|
540
|
-
coder: {
|
|
541
|
-
keywords: ['implement', 'code', 'script', 'function', 'api', 'endpoint', 'logic', 'algorithm', 'business_rule', 'schrijf', 'write', 'develop', 'programmeer', 'implementeer', 'maak', 'bouw', 'build', 'create', 'codeer'],
|
|
542
|
-
confidence: 0.8,
|
|
543
|
-
description: 'Code implementation and development',
|
|
544
|
-
requiredFor: ['scripts', 'functions', 'business_rules', 'apis']
|
|
545
|
-
},
|
|
546
|
-
researcher: {
|
|
547
|
-
keywords: ['research', 'analyze', 'investigate', 'study', 'explore', 'understand', 'learn', 'discover', 'onderzoek', 'analyseer', 'bestudeer', 'ontdek', 'begrijp'],
|
|
548
|
-
confidence: 0.7,
|
|
549
|
-
description: 'Research and _analysis',
|
|
550
|
-
requiredFor: ['requirements', 'best_practices', 'patterns']
|
|
551
|
-
},
|
|
552
|
-
tester: {
|
|
553
|
-
keywords: ['test', 'verify', 'validate', 'check', 'ensure', 'quality', 'bug', 'debug', 'controleer', 'valideer', 'kwaliteit', 'testen'],
|
|
554
|
-
confidence: 0.8,
|
|
555
|
-
description: 'Testing and quality assurance',
|
|
556
|
-
requiredFor: ['validation', 'quality_control', 'debugging']
|
|
557
|
-
},
|
|
558
|
-
reviewer: {
|
|
559
|
-
keywords: ['review', 'audit', 'examine', 'evaluate', 'assess', 'approve', 'feedback'],
|
|
560
|
-
confidence: 0.7,
|
|
561
|
-
description: 'Code and process review',
|
|
562
|
-
requiredFor: ['code_review', 'approval_process', 'quality_gates']
|
|
563
|
-
},
|
|
564
|
-
documenter: {
|
|
565
|
-
keywords: ['document', 'documentation', 'guide', 'manual', 'readme', 'help', 'instructions'],
|
|
566
|
-
confidence: 0.6,
|
|
567
|
-
description: 'Documentation and guides',
|
|
568
|
-
requiredFor: ['documentation', 'user_guides', 'api_docs']
|
|
569
|
-
},
|
|
570
|
-
orchestrator: {
|
|
571
|
-
keywords: ['coordinate', 'manage', 'orchestrate', 'organize', 'plan', 'schedule', 'oversee'],
|
|
572
|
-
confidence: 0.9,
|
|
573
|
-
description: 'Task coordination and management',
|
|
574
|
-
requiredFor: ['complex_tasks', 'multi_agent_coordination', 'project_management']
|
|
575
|
-
},
|
|
576
|
-
// ServiceNow specific agents
|
|
577
|
-
flow_designer: {
|
|
578
|
-
keywords: ['flow', 'workflow', 'process', 'automation', 'approval', 'routing', 'trigger', 'proces', 'goedkeuring', 'automatisering', 'automatiseer', 'doorloop', 'stroom'],
|
|
579
|
-
confidence: 0.9,
|
|
580
|
-
description: 'ServiceNow Flow Designer specialist',
|
|
581
|
-
requiredFor: ['flows', 'workflows', 'approvals', 'automation']
|
|
582
|
-
},
|
|
583
|
-
widget_builder: {
|
|
584
|
-
keywords: ['widget', 'portal', 'dashboard', 'ui', 'interface', 'frontend', 'display', 'weergave', 'scherm', 'component', 'homepage'],
|
|
585
|
-
confidence: 0.9,
|
|
586
|
-
description: 'Service Portal widget development',
|
|
587
|
-
requiredFor: ['widgets', 'portals', 'dashboards', 'ui_components']
|
|
588
|
-
},
|
|
589
|
-
integration_specialist: {
|
|
590
|
-
keywords: ['integration', 'api', 'rest', 'soap', 'webhook', 'external', 'third_party'],
|
|
591
|
-
confidence: 0.8,
|
|
592
|
-
description: 'System integration and APIs',
|
|
593
|
-
requiredFor: ['integrations', 'apis', 'webhooks', 'external_systems']
|
|
594
|
-
},
|
|
595
|
-
database_expert: {
|
|
596
|
-
keywords: ['database', 'table', 'field', 'record', 'data', 'schema', 'query', 'report'],
|
|
597
|
-
confidence: 0.8,
|
|
598
|
-
description: 'Database and data management',
|
|
599
|
-
requiredFor: ['tables', 'databases', 'reports', 'data_management']
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
// 🚀 ENHANCED: Updated to use new specialized agents for parallel execution (v1.1.92)
|
|
603
|
-
AgentDetector.SERVICENOW_ARTIFACTS = {
|
|
604
|
-
'widget': [
|
|
605
|
-
'widget-creator', // HTML structure specialist
|
|
606
|
-
'css-specialist', // Styling and responsive design specialist
|
|
607
|
-
'backend-specialist', // Server script specialist
|
|
608
|
-
'frontend-specialist', // Client script specialist
|
|
609
|
-
'integration-specialist', // API integration specialist
|
|
610
|
-
'ui-ux-specialist', // User experience specialist
|
|
611
|
-
'performance-specialist', // Performance optimization
|
|
612
|
-
'tester' // Testing specialist
|
|
613
|
-
],
|
|
614
|
-
'flow': [
|
|
615
|
-
'flow-builder', // Flow structure specialist
|
|
616
|
-
'trigger-specialist', // Trigger configuration specialist
|
|
617
|
-
'action-specialist', // Action development specialist
|
|
618
|
-
'integration-specialist', // External system integration
|
|
619
|
-
'approval-specialist', // Approval process specialist
|
|
620
|
-
'notification-specialist', // Notification configuration
|
|
621
|
-
'error-handler', // Error handling specialist
|
|
622
|
-
'tester' // Flow testing specialist
|
|
623
|
-
],
|
|
624
|
-
'workflow': [
|
|
625
|
-
'flow-builder', 'trigger-specialist', 'action-specialist', 'approval-specialist', 'tester'
|
|
626
|
-
],
|
|
627
|
-
'application': [
|
|
628
|
-
'app-architect', // Application architecture
|
|
629
|
-
'widget-creator', // UI components
|
|
630
|
-
'css-specialist', // Styling specialist
|
|
631
|
-
'flow-builder', // Business logic flows
|
|
632
|
-
'script-writer', // Script includes and business rules
|
|
633
|
-
'security-specialist', // Security implementation
|
|
634
|
-
'integration-specialist', // System integration
|
|
635
|
-
'performance-specialist', // Performance optimization
|
|
636
|
-
'documentation-specialist' // Documentation
|
|
637
|
-
],
|
|
638
|
-
'script': ['script-writer', 'security-specialist', 'tester'],
|
|
639
|
-
'business_rule': ['script-writer', 'security-specialist', 'tester'],
|
|
640
|
-
'integration': [
|
|
641
|
-
'integration-specialist', // API integration specialist
|
|
642
|
-
'api-specialist', // API development specialist
|
|
643
|
-
'transform-specialist', // Data transformation specialist
|
|
644
|
-
'monitoring-specialist', // Integration monitoring
|
|
645
|
-
'security-specialist', // Security implementation
|
|
646
|
-
'tester' // Integration testing
|
|
647
|
-
],
|
|
648
|
-
'api': ['api-specialist', 'integration-specialist', 'security-specialist', 'tester'],
|
|
649
|
-
'table': ['database_expert', 'architect', 'script-writer'],
|
|
650
|
-
'report': ['database_expert', 'analyst', 'performance-specialist'],
|
|
651
|
-
'dashboard': ['widget-creator', 'css-specialist', 'database_expert', 'performance-specialist']
|
|
652
|
-
};
|
|
653
|
-
return AgentDetector;
|
|
654
|
-
}());
|
|
655
|
-
exports.AgentDetector = AgentDetector;
|