snow-flow 2.4.0 → 2.4.1
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/dist/cli.js +39 -0
- package/dist/utils/agent-detector.js +76 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -616,6 +616,24 @@ You are the Queen Agent, master coordinator of the Snow-Flow hive-mind. Your mis
|
|
|
616
616
|
- **Estimated Total Agents**: ${taskAnalysis.estimatedAgentCount}
|
|
617
617
|
- **ServiceNow Artifacts**: ${taskAnalysis.serviceNowArtifacts.join(', ')}
|
|
618
618
|
|
|
619
|
+
## ⚡ CRITICAL: Task Intent Analysis
|
|
620
|
+
**BEFORE PROCEEDING**, analyze the user's ACTUAL intent:
|
|
621
|
+
|
|
622
|
+
1. **Data Generation Request?** (e.g., "create 5000 incidents", "generate test data")
|
|
623
|
+
→ Focus on CREATING DATA, not building systems
|
|
624
|
+
→ Use simple scripts or bulk operations to generate the data
|
|
625
|
+
→ Skip complex architectures unless explicitly asked
|
|
626
|
+
|
|
627
|
+
2. **System Building Request?** (e.g., "build a widget", "create an ML system")
|
|
628
|
+
→ Follow full development workflow
|
|
629
|
+
→ Build proper architecture and components
|
|
630
|
+
|
|
631
|
+
3. **Simple Operation Request?** (e.g., "update field X", "delete records")
|
|
632
|
+
→ Execute the operation directly
|
|
633
|
+
→ Skip unnecessary complexity
|
|
634
|
+
|
|
635
|
+
**For this objective**: Analyze if the user wants data generation, system building, or a simple operation.
|
|
636
|
+
|
|
619
637
|
${isFlowDesignerTask ? `## 🔧 Flow Designer Task Detected - Using ENHANCED XML-First Approach!
|
|
620
638
|
🚀 **FULLY AUTOMATED FLOW DEPLOYMENT v2.0** - ALL features working correctly!
|
|
621
639
|
|
|
@@ -676,6 +694,27 @@ The Queen Agent will automatically discover and validate table schemas based on
|
|
|
676
694
|
|
|
677
695
|
## 👑 Your Queen Agent Responsibilities
|
|
678
696
|
|
|
697
|
+
## 📊 Data Generation Specific Instructions
|
|
698
|
+
If the task is identified as DATA GENERATION (e.g., "create 5000 incidents"):
|
|
699
|
+
|
|
700
|
+
1. **DO NOT** build complex export/import systems
|
|
701
|
+
2. **DO NOT** create APIs, UI Actions, or workflows
|
|
702
|
+
3. **DO** focus on:
|
|
703
|
+
- Creating a simple script to generate the data
|
|
704
|
+
- Using ServiceNow's REST API or direct table operations
|
|
705
|
+
- Ensuring realistic data distribution for ML training
|
|
706
|
+
- Adding variety in categories, priorities, descriptions, etc.
|
|
707
|
+
|
|
708
|
+
**Example approach for "create 5000 incidents":**
|
|
709
|
+
\`\`\`javascript
|
|
710
|
+
// Simple batch creation script
|
|
711
|
+
for (let i = 0; i < 5000; i += 100) {
|
|
712
|
+
// Create 100 incidents at a time to avoid timeouts
|
|
713
|
+
const batch = generateRealisticIncidentBatch(100);
|
|
714
|
+
await createIncidentsBatch(batch);
|
|
715
|
+
}
|
|
716
|
+
\`\`\`
|
|
717
|
+
|
|
679
718
|
### 1. CRITICAL: Initialize Memory FIRST (Before Everything!)
|
|
680
719
|
**THIS MUST BE YOUR VERY FIRST ACTION - Initialize the swarm memory session:**
|
|
681
720
|
\`\`\`javascript
|
|
@@ -9,6 +9,58 @@ class AgentDetector {
|
|
|
9
9
|
static analyzeTask(objective, userMaxAgents) {
|
|
10
10
|
const lowerObjective = objective.toLowerCase();
|
|
11
11
|
const words = lowerObjective.split(/\s+/);
|
|
12
|
+
// Check for data generation FIRST - before any other analysis
|
|
13
|
+
const dataGenerationPatterns = [
|
|
14
|
+
// Pattern for "create/make X incidents/changes" with flexible word order
|
|
15
|
+
/\b(create|generate|make|maak|genereer|aanmaken)\b.*\b\d+\b.*(incident|change|request|problem|task|record|item)/i,
|
|
16
|
+
// Pattern for "data set" with numbers anywhere
|
|
17
|
+
/\bdata\s*set\b.*\b\d{3,}/i, // data set with 3+ digit numbers
|
|
18
|
+
// Pattern for various test/mock/sample data keywords
|
|
19
|
+
/\b(test\s+data|mock\s+data|sample\s+data|training\s+data)\b/i,
|
|
20
|
+
// Pattern for populate/seed/fill operations
|
|
21
|
+
/\b(populate|seed|fill)\s+(with\s+)?(test|sample|random|mock)\s+(data|incident|change|record)/i,
|
|
22
|
+
// Pattern for seed database with numbers
|
|
23
|
+
/\b(seed|populate|fill)\s+(database|db|table)\s+with\s+\d+/i,
|
|
24
|
+
// Pattern for ML training data
|
|
25
|
+
/\b(ML|machine\s+learning|training)\b.*\bdata/i,
|
|
26
|
+
// Pattern for random/test with large numbers
|
|
27
|
+
/\b(random|test|mock|sample)\b.*\b\d{3,}\b.*(incident|change|request|problem)/i,
|
|
28
|
+
// Pattern for Dutch data set creation
|
|
29
|
+
/\bdata\s*set\s+(aan\s+)?van\s+\d+/i
|
|
30
|
+
];
|
|
31
|
+
const isDataGeneration = dataGenerationPatterns.some(pattern => pattern.test(objective));
|
|
32
|
+
if (isDataGeneration) {
|
|
33
|
+
return {
|
|
34
|
+
primaryAgent: 'script-writer',
|
|
35
|
+
supportingAgents: ['tester'], // Minimal support
|
|
36
|
+
complexity: 'simple',
|
|
37
|
+
estimatedAgentCount: 2,
|
|
38
|
+
requiresUpdateSet: false, // Usually no update set needed for data generation
|
|
39
|
+
requiresApplication: false,
|
|
40
|
+
taskType: 'data_generation',
|
|
41
|
+
serviceNowArtifacts: ['script']
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Check for simple operations
|
|
45
|
+
const simpleOperationPatterns = [
|
|
46
|
+
/\b(update|change|modify|delete|remove)\s+(the\s+)?(field|record|value|property)\b/i,
|
|
47
|
+
/\b(wijzig|verander|verwijder|pas\s+aan)\s+(het\s+)?(veld|record|waarde)\b/i
|
|
48
|
+
];
|
|
49
|
+
const isSimpleOperation = simpleOperationPatterns.some(pattern => pattern.test(objective));
|
|
50
|
+
if (isSimpleOperation) {
|
|
51
|
+
return {
|
|
52
|
+
primaryAgent: 'script-writer',
|
|
53
|
+
supportingAgents: ['tester'],
|
|
54
|
+
complexity: 'simple',
|
|
55
|
+
estimatedAgentCount: 2,
|
|
56
|
+
requiresUpdateSet: false,
|
|
57
|
+
requiresApplication: false,
|
|
58
|
+
taskType: 'simple_operation',
|
|
59
|
+
serviceNowArtifacts: ['script']
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// Determine task type for other cases
|
|
63
|
+
const taskType = this.determineTaskType(lowerObjective, this.detectServiceNowArtifacts(lowerObjective));
|
|
12
64
|
// Detect agent capabilities
|
|
13
65
|
const agentCapabilities = this.detectAgentCapabilities(lowerObjective);
|
|
14
66
|
// Determine primary agent
|
|
@@ -23,8 +75,6 @@ class AgentDetector {
|
|
|
23
75
|
const requiresUpdateSet = this.requiresUpdateSet(lowerObjective, serviceNowArtifacts);
|
|
24
76
|
// Determine if new Application is required
|
|
25
77
|
const requiresApplication = this.requiresApplication(lowerObjective, serviceNowArtifacts);
|
|
26
|
-
// Determine task type
|
|
27
|
-
const taskType = this.determineTaskType(lowerObjective, serviceNowArtifacts);
|
|
28
78
|
// 🚀 NEW: Accurate agent count for parallel system
|
|
29
79
|
const isDevelopmentTask = ['widget-creator', 'flow-builder', 'script-writer', 'app-architect'].includes(primaryAgent) ||
|
|
30
80
|
supportingAgents.some(agent => ['css-specialist', 'backend-specialist', 'frontend-specialist'].includes(agent));
|
|
@@ -76,7 +126,8 @@ class AgentDetector {
|
|
|
76
126
|
'database_expert': 'app-architect',
|
|
77
127
|
'coder': 'script-writer',
|
|
78
128
|
'architect': 'app-architect',
|
|
79
|
-
'tester': 'tester'
|
|
129
|
+
'tester': 'tester',
|
|
130
|
+
'data_generator': 'script-writer' // Data generation uses script-writer
|
|
80
131
|
};
|
|
81
132
|
return mapping[detectedType] || detectedType;
|
|
82
133
|
};
|
|
@@ -265,6 +316,26 @@ class AgentDetector {
|
|
|
265
316
|
return hasApplicationKeywords || hasMultipleArtifacts;
|
|
266
317
|
}
|
|
267
318
|
static determineTaskType(objective, artifacts) {
|
|
319
|
+
const lowerObjective = objective.toLowerCase();
|
|
320
|
+
// FIRST: Check for data generation requests
|
|
321
|
+
const dataGenerationPatterns = [
|
|
322
|
+
/\b(create|generate|make|maak)\s+\d+\s+(random\s+)?(incident|change|request|problem|task|record|item)/i,
|
|
323
|
+
/\b(genereer|aanmaken)\s+\d+\s+(willekeurige\s+)?(incident|change|request|problem|task|record|item)/i,
|
|
324
|
+
/\bdata\s*set\s*(van|of|with)\s*\d+/i,
|
|
325
|
+
/\b(test\s+data|mock\s+data|sample\s+data|training\s+data)\b/i,
|
|
326
|
+
/\b(populate|seed|fill)\s+(with\s+)?(test|sample|random)\s+data/i
|
|
327
|
+
];
|
|
328
|
+
const isDataGeneration = dataGenerationPatterns.some(pattern => pattern.test(objective));
|
|
329
|
+
if (isDataGeneration)
|
|
330
|
+
return 'data_generation';
|
|
331
|
+
// Check for simple operations (update, delete, modify single things)
|
|
332
|
+
const simpleOperationPatterns = [
|
|
333
|
+
/\b(update|change|modify|delete|remove)\s+(the\s+)?(field|record|value|property)\b/i,
|
|
334
|
+
/\b(wijzig|verander|verwijder|pas\s+aan)\s+(het\s+)?(veld|record|waarde)\b/i
|
|
335
|
+
];
|
|
336
|
+
const isSimpleOperation = simpleOperationPatterns.some(pattern => pattern.test(objective));
|
|
337
|
+
if (isSimpleOperation)
|
|
338
|
+
return 'simple_operation';
|
|
268
339
|
// Determine based on detected artifacts and keywords
|
|
269
340
|
// Check flow FIRST as it's often confused with widget when both are present
|
|
270
341
|
if (artifacts.includes('flow') || artifacts.includes('workflow'))
|
|
@@ -286,7 +357,7 @@ class AgentDetector {
|
|
|
286
357
|
'create', 'build', 'implement', 'develop', 'make', 'generate',
|
|
287
358
|
'bouw', 'maak', 'schrijf', 'implementeer', 'ontwikkel', 'codeer'
|
|
288
359
|
];
|
|
289
|
-
const hasDevelopmentKeywords = developmentKeywords.some(keyword =>
|
|
360
|
+
const hasDevelopmentKeywords = developmentKeywords.some(keyword => lowerObjective.includes(keyword));
|
|
290
361
|
if (hasDevelopmentKeywords)
|
|
291
362
|
return 'general_development';
|
|
292
363
|
// Research or _analysis tasks
|
|
@@ -294,7 +365,7 @@ class AgentDetector {
|
|
|
294
365
|
'research', 'analyze', 'investigate', 'study', 'explore',
|
|
295
366
|
'onderzoek', 'analyseer', 'bestudeer', 'ontdek'
|
|
296
367
|
];
|
|
297
|
-
const hasResearchKeywords = researchKeywords.some(keyword =>
|
|
368
|
+
const hasResearchKeywords = researchKeywords.some(keyword => lowerObjective.includes(keyword));
|
|
298
369
|
if (hasResearchKeywords)
|
|
299
370
|
return 'research_task';
|
|
300
371
|
return 'orchestration_task';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Snow-Flow: ServiceNow Advanced Intelligence Platform - 100+ real MCP tools with AI-powered swarm orchestration and neural networks. Machine learning for incident classification, change risk prediction, and anomaly detection. Zero Mock Data, 100% Real API Integration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|