snow-flow 1.3.30 → 1.4.0
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.md +12 -0
- package/README.md +153 -456
- package/dist/agents/base-agent.js +6 -7
- package/dist/agents/index.js +3 -4
- package/dist/agents/queen-agent.js +21 -7
- package/dist/api/natural-language-mapper.js +24 -21
- package/dist/cli/snow-flow-cli-integration.js +2 -1
- package/dist/cli.js +28 -1017
- package/dist/compliance/advanced-compliance-system.js +1 -1
- package/dist/documentation/self-documenting-system.js +10 -41
- package/dist/intelligence/auto-resolution-engine.js +1 -1
- package/dist/mcp/base-mcp-server.js +2 -2
- package/dist/mcp/http-transport-wrapper.js +2 -2
- package/dist/mcp/servicenow-deployment-mcp-refactored.js +1 -1
- package/dist/mcp/servicenow-deployment-mcp.js +16 -3
- package/dist/mcp/servicenow-flow-composer-mcp.js +20 -0
- package/dist/mcp/servicenow-intelligent-mcp-refactored.js +5 -5
- package/dist/mcp/servicenow-intelligent-mcp.js +11 -3
- package/dist/mcp/servicenow-operations-mcp-refactored.js +2 -2
- package/dist/mcp/servicenow-reporting-analytics-mcp-refactored.js +3 -1
- package/dist/mcp/servicenow-xml-flow-mcp.js +16 -9
- package/dist/mcp/shared/base-mcp-server.js +2 -2
- package/dist/memory/hierarchical-memory-system.js +0 -2
- package/dist/memory/memory-system.js +18 -81
- package/dist/memory/snow-flow-memory-patterns.js +41 -41
- package/dist/monitoring/enhanced-monitoring-system.js +6 -6
- package/dist/optimization/index.js +5 -3
- package/dist/orchestrator/flow-composer.js +101 -8
- package/dist/queen/agent-factory.js +8 -1
- package/dist/queen/mcp-execution-bridge.js +7 -0
- package/dist/queen/queen-memory-system.js +27 -1
- package/dist/queen/servicenow-queen.js +25 -17
- package/dist/snow-flow-system.js +36 -37
- package/dist/testing/integration-test-suite.js +31 -30
- package/dist/utils/complete-flow-xml-generator.js +52 -52
- package/dist/utils/servicenow-client.js +15 -8
- package/dist/utils/snow-oauth.js +17 -2
- package/dist/version.js +19 -1
- package/package.json +1 -1
- package/flow-update-sets/flow_build_automated_approval_flow_with_notifications_flow.xml +0 -203
- package/flow-update-sets/flow_create_approval_flow_for_equipment_requests_flow.xml +0 -206
- package/flow-update-sets/flow_create_equipment_approval_flow_with_manager_approv_flow.xml +0 -254
- package/flow-update-sets/iphone_15_pro_approval_flow.xml +0 -203
- package/flow-update-sets/test_iphone_approval_flow_flow.xml +0 -303
|
@@ -179,15 +179,14 @@ class BaseAgent {
|
|
|
179
179
|
*/
|
|
180
180
|
shouldCoordinate(otherAgentType) {
|
|
181
181
|
// Define coordination rules
|
|
182
|
+
// Simplified coordination rules after flow-builder removal
|
|
182
183
|
const coordinationRules = {
|
|
183
|
-
'
|
|
184
|
-
'flow-builder': ['catalog-manager', 'tester', 'integration-specialist'],
|
|
184
|
+
'researcher': ['script-writer', 'researcher'],
|
|
185
185
|
'script-writer': ['tester', 'app-architect'],
|
|
186
|
-
'
|
|
187
|
-
'
|
|
188
|
-
'
|
|
189
|
-
'
|
|
190
|
-
'tester': ['widget-creator', 'flow-builder', 'script-writer']
|
|
186
|
+
'widget-creator': ['researcher', 'ui-ux-specialist'],
|
|
187
|
+
'app-architect': ['script-writer', 'integration-specialist'],
|
|
188
|
+
'tester': ['script-writer', 'security-specialist'],
|
|
189
|
+
'integration-specialist': ['app-architect', 'script-writer']
|
|
191
190
|
};
|
|
192
191
|
return coordinationRules[this.type]?.includes(otherAgentType) || false;
|
|
193
192
|
}
|
package/dist/agents/index.js
CHANGED
|
@@ -37,13 +37,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
};
|
|
38
38
|
})();
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.AGENT_CLASS_MAP = exports.SecurityAgent = exports.ScriptWriterAgent = exports.
|
|
40
|
+
exports.AGENT_CLASS_MAP = exports.SecurityAgent = exports.ScriptWriterAgent = exports.WidgetCreatorAgent = exports.BaseAgent = void 0;
|
|
41
41
|
var base_agent_1 = require("./base-agent");
|
|
42
42
|
Object.defineProperty(exports, "BaseAgent", { enumerable: true, get: function () { return base_agent_1.BaseAgent; } });
|
|
43
43
|
var widget_creator_agent_1 = require("./widget-creator-agent");
|
|
44
44
|
Object.defineProperty(exports, "WidgetCreatorAgent", { enumerable: true, get: function () { return widget_creator_agent_1.WidgetCreatorAgent; } });
|
|
45
|
-
|
|
46
|
-
Object.defineProperty(exports, "FlowBuilderAgent", { enumerable: true, get: function () { return flow_builder_agent_1.FlowBuilderAgent; } });
|
|
45
|
+
// FlowBuilderAgent removed in v1.4.0
|
|
47
46
|
var script_writer_agent_1 = require("./script-writer-agent");
|
|
48
47
|
Object.defineProperty(exports, "ScriptWriterAgent", { enumerable: true, get: function () { return script_writer_agent_1.ScriptWriterAgent; } });
|
|
49
48
|
var security_agent_1 = require("./security-agent");
|
|
@@ -51,7 +50,7 @@ Object.defineProperty(exports, "SecurityAgent", { enumerable: true, get: functio
|
|
|
51
50
|
// Agent type mapping for factory
|
|
52
51
|
exports.AGENT_CLASS_MAP = {
|
|
53
52
|
'widget-creator': () => Promise.resolve().then(() => __importStar(require('./widget-creator-agent'))).then(m => m.WidgetCreatorAgent),
|
|
54
|
-
'flow-builder':
|
|
53
|
+
// 'flow-builder': removed in v1.4.0
|
|
55
54
|
'script-writer': () => Promise.resolve().then(() => __importStar(require('./script-writer-agent'))).then(m => m.ScriptWriterAgent),
|
|
56
55
|
'security': () => Promise.resolve().then(() => __importStar(require('./security-agent'))).then(m => m.SecurityAgent)
|
|
57
56
|
};
|
|
@@ -283,10 +283,17 @@ class QueenAgent extends eventemitter3_1.EventEmitter {
|
|
|
283
283
|
async performObjectiveAnalysis(objective) {
|
|
284
284
|
const description = objective.description.toLowerCase();
|
|
285
285
|
// Determine task type
|
|
286
|
-
let type = '
|
|
286
|
+
let type = 'unknown';
|
|
287
287
|
let requiredAgents = [];
|
|
288
288
|
let estimatedComplexity = 5;
|
|
289
|
-
let suggestedPattern =
|
|
289
|
+
let suggestedPattern = {
|
|
290
|
+
taskType: 'standard',
|
|
291
|
+
successRate: 0.8,
|
|
292
|
+
agentSequence: [],
|
|
293
|
+
mcpSequence: [],
|
|
294
|
+
avgDuration: 300,
|
|
295
|
+
lastUsed: new Date()
|
|
296
|
+
};
|
|
290
297
|
let dependencies = [];
|
|
291
298
|
// Widget development detection
|
|
292
299
|
if (description.includes('widget') || description.includes('portal') || description.includes('ui component')) {
|
|
@@ -311,7 +318,14 @@ class QueenAgent extends eventemitter3_1.EventEmitter {
|
|
|
311
318
|
type = 'application';
|
|
312
319
|
requiredAgents = ['app-architect', 'widget-creator', 'flow-builder', 'script-writer', 'tester'];
|
|
313
320
|
estimatedComplexity = 10;
|
|
314
|
-
suggestedPattern =
|
|
321
|
+
suggestedPattern = {
|
|
322
|
+
taskType: 'modular',
|
|
323
|
+
successRate: 0.8,
|
|
324
|
+
agentSequence: requiredAgents,
|
|
325
|
+
mcpSequence: [],
|
|
326
|
+
avgDuration: 900,
|
|
327
|
+
lastUsed: new Date()
|
|
328
|
+
};
|
|
315
329
|
}
|
|
316
330
|
// Script development
|
|
317
331
|
else if (description.includes('script') || description.includes('business rule') || description.includes('api')) {
|
|
@@ -333,7 +347,7 @@ class QueenAgent extends eventemitter3_1.EventEmitter {
|
|
|
333
347
|
}
|
|
334
348
|
return {
|
|
335
349
|
type,
|
|
336
|
-
complexity: estimatedComplexity,
|
|
350
|
+
complexity: estimatedComplexity.toString(),
|
|
337
351
|
requiredAgents: [...new Set(requiredAgents)], // Remove duplicates
|
|
338
352
|
estimatedComplexity: Math.min(10, Math.max(1, estimatedComplexity)),
|
|
339
353
|
suggestedPattern,
|
|
@@ -920,7 +934,7 @@ class QueenAgent extends eventemitter3_1.EventEmitter {
|
|
|
920
934
|
reasoning: `Based on ${similarPatterns.length} similar past scenarios, "${bestOption}" has a ${(highestRate * 100).toFixed(0)}% success rate.`
|
|
921
935
|
};
|
|
922
936
|
// Store decision for future learning
|
|
923
|
-
await this.memory.storeDecision({
|
|
937
|
+
await this.memory.storeDecision('decision', {
|
|
924
938
|
context,
|
|
925
939
|
decision: decision.decision,
|
|
926
940
|
confidence: decision.confidence,
|
|
@@ -982,8 +996,8 @@ class QueenAgent extends eventemitter3_1.EventEmitter {
|
|
|
982
996
|
*/
|
|
983
997
|
async handleCoordinationError(error, context) {
|
|
984
998
|
console.error('❌ Coordination error:', error);
|
|
985
|
-
// Store error in memory for learning
|
|
986
|
-
await this.memory.
|
|
999
|
+
// Store error in memory for learning - using store method
|
|
1000
|
+
await this.memory.store('error', {
|
|
987
1001
|
error: error.message || error,
|
|
988
1002
|
context,
|
|
989
1003
|
timestamp: new Date().toISOString(),
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.NaturalLanguageMapper = void 0;
|
|
8
|
+
// Flow API Discovery removed in v1.4.0
|
|
8
9
|
const logger_js_1 = require("../utils/logger.js");
|
|
9
10
|
class NaturalLanguageMapper {
|
|
10
|
-
constructor(
|
|
11
|
+
constructor() {
|
|
11
12
|
this.verbMappings = new Map();
|
|
12
13
|
this.objectMappings = new Map();
|
|
13
14
|
this.contextMappings = new Map();
|
|
14
|
-
this.discovery = discovery;
|
|
15
|
+
// this.discovery = discovery; // removed in v1.4.0
|
|
15
16
|
this.logger = new logger_js_1.Logger('NaturalLanguageMapper');
|
|
16
17
|
this.initializeMappings();
|
|
17
18
|
}
|
|
@@ -195,7 +196,8 @@ class NaturalLanguageMapper {
|
|
|
195
196
|
const allResults = [];
|
|
196
197
|
for (const term of searchTerms) {
|
|
197
198
|
try {
|
|
198
|
-
|
|
199
|
+
// Flow discovery removed in v1.4.0 - using fallback logic
|
|
200
|
+
const result = { exact_matches: [], partial_matches: [], suggested_matches: [] };
|
|
199
201
|
allResults.push(result);
|
|
200
202
|
}
|
|
201
203
|
catch (error) {
|
|
@@ -236,21 +238,22 @@ class NaturalLanguageMapper {
|
|
|
236
238
|
if (context) {
|
|
237
239
|
for (const action of allActions) {
|
|
238
240
|
const contextScore = this.scoreByContext(action, context);
|
|
239
|
-
this.addScore(actionScores, action
|
|
241
|
+
this.addScore(actionScores, action, contextScore);
|
|
240
242
|
if (contextScore > 0) {
|
|
241
|
-
this.addReason(actionReasons, action
|
|
243
|
+
this.addReason(actionReasons, action, 'Context match');
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
247
|
// Find best match
|
|
246
248
|
const sortedActions = Array.from(allActions).sort((a, b) => {
|
|
247
|
-
const scoreA = actionScores.get(a
|
|
248
|
-
const scoreB = actionScores.get(b
|
|
249
|
+
const scoreA = actionScores.get(a) || 0;
|
|
250
|
+
const scoreB = actionScores.get(b) || 0;
|
|
249
251
|
return scoreB - scoreA;
|
|
250
252
|
});
|
|
251
253
|
const bestMatch = sortedActions[0];
|
|
252
|
-
const
|
|
253
|
-
const
|
|
254
|
+
const bestMatchId = typeof bestMatch === 'string' ? bestMatch : bestMatch?.sys_id || bestMatch;
|
|
255
|
+
const confidence = actionScores.get(bestMatchId) || 0;
|
|
256
|
+
const reasoning = actionReasons.get(bestMatchId)?.join(', ') || 'No specific reasoning';
|
|
254
257
|
const alternatives = sortedActions.slice(1, 4); // Top 3 alternatives
|
|
255
258
|
return {
|
|
256
259
|
best_match: bestMatch,
|
|
@@ -265,7 +268,8 @@ class NaturalLanguageMapper {
|
|
|
265
268
|
async generateSuggestedInputs(actionType, intent, context) {
|
|
266
269
|
const suggestedInputs = {};
|
|
267
270
|
// Get action type details to understand inputs
|
|
268
|
-
|
|
271
|
+
// Flow discovery removed in v1.4.0 - using fallback
|
|
272
|
+
const actionDetails = null;
|
|
269
273
|
if (!actionDetails) {
|
|
270
274
|
return suggestedInputs;
|
|
271
275
|
}
|
|
@@ -449,19 +453,18 @@ class NaturalLanguageMapper {
|
|
|
449
453
|
*/
|
|
450
454
|
scoreByContext(action, context) {
|
|
451
455
|
let score = 0;
|
|
452
|
-
// Score based on
|
|
453
|
-
if (action
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
if (action.name.toLowerCase().includes(prevAction.toLowerCase())) {
|
|
459
|
-
score += 0.1;
|
|
456
|
+
// Score based on action name matching context
|
|
457
|
+
if (action && context.flow_purpose) {
|
|
458
|
+
const actionLower = action.toLowerCase();
|
|
459
|
+
const purposeLower = context.flow_purpose.toLowerCase();
|
|
460
|
+
if (actionLower.includes(purposeLower) || purposeLower.includes(actionLower)) {
|
|
461
|
+
score += 0.3;
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
|
-
// Score based on
|
|
463
|
-
if (action
|
|
464
|
-
|
|
464
|
+
// Score based on action requirements (if available)
|
|
465
|
+
if (action && context.action_requirements) {
|
|
466
|
+
const matches = context.action_requirements.filter((req) => action.toLowerCase().includes(req.toLowerCase()));
|
|
467
|
+
score += matches.length * 0.1;
|
|
465
468
|
}
|
|
466
469
|
return score;
|
|
467
470
|
}
|
|
@@ -178,7 +178,8 @@ function createMonitorCommand(program) {
|
|
|
178
178
|
console.log(chalk_1.default.gray('='.repeat(50)));
|
|
179
179
|
try {
|
|
180
180
|
// Initialize system if needed
|
|
181
|
-
|
|
181
|
+
const status = snow_flow_system_1.snowFlowSystem.getStatus();
|
|
182
|
+
if (!status.initialized) {
|
|
182
183
|
await snow_flow_system_1.snowFlowSystem.initialize();
|
|
183
184
|
}
|
|
184
185
|
// Set up event listeners
|