snow-flow 1.3.1 ā 1.3.2
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/queen/queen-memory.db +0 -0
- package/.env.example +249 -14
- package/CLAUDE.md +185 -24
- package/README.md +55 -5
- package/dist/api/error-handling.js +898 -4
- package/dist/api/performance-optimizer.js +3 -2
- package/dist/cli.js +590 -200
- package/dist/config/snow-flow-config.js +320 -8
- package/dist/health/system-health.js +288 -21
- package/dist/mcp/http-transport-wrapper.js +65 -4
- package/dist/mcp/servicenow-automation-mcp-refactored.js +90 -9
- package/dist/mcp/servicenow-deployment-mcp-refactored.js +151 -2
- package/dist/mcp/servicenow-deployment-mcp.js +828 -15
- package/dist/mcp/servicenow-integration-mcp-refactored.js +100 -9
- package/dist/mcp/servicenow-intelligent-mcp.js +198 -7
- package/dist/mcp/servicenow-memory-mcp.js +2 -1
- package/dist/mcp/servicenow-operations-mcp-refactored.js +3 -2
- package/dist/mcp/servicenow-xml-flow-mcp.js +671 -0
- package/dist/mcp/shared/base-mcp-server.js +1356 -8
- package/dist/mcp/shared/mcp-resource-manager.js +304 -0
- package/dist/queen/parallel-agent-engine.js +26 -8
- package/dist/queen/servicenow-queen.js +47 -44
- package/dist/sparc/sparc-help.js +37 -26
- package/dist/sparc/team-sparc.js +60 -16
- package/dist/utils/action-type-cache.js +2 -1
- package/dist/utils/mcp-config-manager.js +7 -3
- package/dist/utils/mcp-server-manager.js +7 -3
- package/dist/utils/servicenow-client.js +134 -107
- package/dist/utils/servicenow-id-generator.js +171 -0
- package/dist/utils/snow-oauth.js +13 -8
- package/dist/utils/widget-template-generator.js +1690 -0
- package/dist/utils/xml-first-flow-generator.js +473 -0
- package/flow-update-sets/flow_build_automated_approval_flow_with_notifications_flow.xml +203 -0
- package/flow-update-sets/flow_create_approval_flow_for_equipment_requests_flow.xml +206 -0
- package/flow-update-sets/flow_create_equipment_approval_flow_with_manager_approv_flow.xml +254 -0
- package/flow-update-sets/iphone_15_pro_approval_flow.xml +203 -0
- package/flow-update-sets/test_iphone_approval_flow_flow.xml +303 -0
- package/package.json +2 -1
- package/test-config.js +55 -0
- package/test-real-monitoring.js +184 -0
package/dist/sparc/sparc-help.js
CHANGED
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* SPARC Help System -
|
|
4
|
-
* TODO: Implement comprehensive help system for SPARC teams
|
|
3
|
+
* SPARC Help System - Provides guidance to working functionality
|
|
5
4
|
*/
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
exports.displayTeamHelp = displayTeamHelp;
|
|
8
7
|
function displayTeamHelp() {
|
|
9
8
|
console.log(`
|
|
10
|
-
|
|
9
|
+
šÆ SPARC Team Development - Available Now!
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
The SPARC team functionality you're looking for is available through the SWARM system:
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
13
|
+
š” INSTEAD OF SPARC COMMANDS, USE:
|
|
14
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
15
|
+
ā ā
WORKING ALTERNATIVES (Use These!) ā
|
|
16
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
|
|
17
|
+
ā snow-flow swarm "create incident dashboard widget" ā
|
|
18
|
+
ā snow-flow swarm "build approval workflow for equipment" ā
|
|
19
|
+
ā snow-flow swarm "develop mobile app with authentication" ā
|
|
20
|
+
ā snow-flow queen "create ServiceNow integration" ā
|
|
21
|
+
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
-
|
|
23
|
+
š SWARM FEATURES (What you get automatically):
|
|
24
|
+
⢠š§ Multi-Agent Coordination: Automatic spawning of specialized agents
|
|
25
|
+
⢠šÆ Smart Discovery: Finds existing artifacts to prevent duplication
|
|
26
|
+
⢠š Live Testing: Real-time testing on your ServiceNow instance
|
|
27
|
+
⢠š Update Set Management: Automatic change tracking
|
|
28
|
+
⢠š Auto-Deployment: Direct deployment to ServiceNow when ready
|
|
29
|
+
⢠š”ļø Error Recovery: Automatic rollback on failures
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
-
|
|
31
|
+
š§ SWARM OPTIONS:
|
|
32
|
+
⢠--strategy: research, development, analysis, testing, optimization
|
|
33
|
+
⢠--mode: centralized, distributed, hierarchical, mesh, hybrid
|
|
34
|
+
⢠--max-agents: Control team size (default: 5)
|
|
35
|
+
⢠--parallel: Enable parallel execution
|
|
36
|
+
⢠--monitor: Real-time progress monitoring
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
š EXAMPLES:
|
|
39
|
+
⢠Widget Team: snow-flow swarm "create dashboard with charts" --strategy development
|
|
40
|
+
⢠Flow Team: snow-flow swarm "approval workflow with notifications" --mode hierarchical
|
|
41
|
+
⢠Full App: snow-flow swarm "mobile ITSM solution" --max-agents 8 --monitor
|
|
42
|
+
|
|
43
|
+
šÆ GET STARTED:
|
|
44
|
+
1. snow-flow auth login # Authenticate with ServiceNow
|
|
45
|
+
2. snow-flow swarm "your objective" # Everything else is automatic!
|
|
46
|
+
3. snow-flow status # Check system health
|
|
47
|
+
|
|
48
|
+
The swarm system provides all the team coordination, specialist roles, and
|
|
49
|
+
quality gates that SPARC was designed to deliver - and it's working now!
|
|
39
50
|
`);
|
|
40
51
|
}
|
package/dist/sparc/team-sparc.js
CHANGED
|
@@ -1,37 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* SPARC Team Executor -
|
|
4
|
-
*
|
|
3
|
+
* SPARC Team Executor - Redirects to Working Functionality
|
|
4
|
+
* Provides helpful guidance to users who try SPARC commands
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.TeamSparcExecutor = void 0;
|
|
8
8
|
class TeamSparcExecutor {
|
|
9
9
|
static async execute(teamType, task, options = {}) {
|
|
10
|
-
console.log(
|
|
11
|
-
console.log(
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
console.log(`\nšÆ SPARC Team: ${teamType.toUpperCase()}`);
|
|
11
|
+
console.log(`š Task: ${task}\n`);
|
|
12
|
+
// Determine the best swarm strategy based on team type
|
|
13
|
+
const strategyMap = {
|
|
14
|
+
'widget': 'development',
|
|
15
|
+
'flow': 'development',
|
|
16
|
+
'app': 'development',
|
|
17
|
+
'application': 'development',
|
|
18
|
+
'adaptive': 'analysis'
|
|
19
|
+
};
|
|
20
|
+
const strategy = strategyMap[teamType.toLowerCase()] || 'development';
|
|
21
|
+
const swarmCommand = `snow-flow swarm "${task}"${strategy !== 'development' ? ` --strategy ${strategy}` : ''}${options.parallel ? ' --parallel' : ''}${options.monitor ? ' --monitor' : ''}`;
|
|
22
|
+
console.log(`ā
SPARC Team functionality is available through the SWARM system!\n`);
|
|
23
|
+
console.log(`š Run this command instead:\n`);
|
|
24
|
+
console.log(` ${swarmCommand}\n`);
|
|
25
|
+
console.log(`š” The SWARM system provides:`);
|
|
26
|
+
console.log(` ⢠Multi-agent team coordination (what SPARC was designed for)`);
|
|
27
|
+
console.log(` ⢠Specialist role assignment automatically`);
|
|
28
|
+
console.log(` ⢠Real-time progress monitoring`);
|
|
29
|
+
console.log(` ⢠Direct ServiceNow integration\n`);
|
|
30
|
+
console.log(`š For more options: snow-flow swarm --help`);
|
|
31
|
+
console.log(`š For detailed help: snow-flow sparc-help\n`);
|
|
14
32
|
return {
|
|
15
|
-
success:
|
|
16
|
-
message: 'SPARC
|
|
33
|
+
success: true,
|
|
34
|
+
message: 'SPARC functionality redirected to working SWARM system',
|
|
17
35
|
teamType,
|
|
18
36
|
task,
|
|
19
37
|
options,
|
|
20
|
-
|
|
38
|
+
recommendedCommand: swarmCommand,
|
|
39
|
+
redirectedTo: 'swarm'
|
|
21
40
|
};
|
|
22
41
|
}
|
|
23
42
|
static async executeSpecialist(specialistType, task, options = {}) {
|
|
24
|
-
console.log(
|
|
25
|
-
console.log(
|
|
26
|
-
|
|
27
|
-
|
|
43
|
+
console.log(`\nšØāš» SPARC ${specialistType.toUpperCase()} Specialist`);
|
|
44
|
+
console.log(`š Task: ${task}\n`);
|
|
45
|
+
// Map specialist types to swarm strategies
|
|
46
|
+
const specialistStrategyMap = {
|
|
47
|
+
'frontend': 'development',
|
|
48
|
+
'backend': 'development',
|
|
49
|
+
'security': 'analysis',
|
|
50
|
+
'database': 'development',
|
|
51
|
+
'process': 'development',
|
|
52
|
+
'trigger': 'development',
|
|
53
|
+
'data': 'analysis',
|
|
54
|
+
'logic': 'development',
|
|
55
|
+
'interface': 'development',
|
|
56
|
+
'uiux': 'development',
|
|
57
|
+
'platform': 'development'
|
|
58
|
+
};
|
|
59
|
+
const strategy = specialistStrategyMap[specialistType.toLowerCase()] || 'development';
|
|
60
|
+
const swarmCommand = `snow-flow swarm "${task}" --strategy ${strategy}${options.monitor ? ' --monitor' : ''}${options.dryRun ? ' --dry-run' : ''}`;
|
|
61
|
+
console.log(`ā
SPARC Specialist functionality is available through the SWARM system!\n`);
|
|
62
|
+
console.log(`š Run this command instead:\n`);
|
|
63
|
+
console.log(` ${swarmCommand}\n`);
|
|
64
|
+
console.log(`š” The SWARM system automatically:`);
|
|
65
|
+
console.log(` ⢠Spawns ${specialistType} specialists when needed`);
|
|
66
|
+
console.log(` ⢠Coordinates with other specialists automatically`);
|
|
67
|
+
console.log(` ⢠Provides real-time progress monitoring`);
|
|
68
|
+
console.log(` ⢠Integrates directly with ServiceNow\n`);
|
|
69
|
+
console.log(`š For more options: snow-flow swarm --help`);
|
|
70
|
+
console.log(`š For detailed help: snow-flow sparc-help\n`);
|
|
28
71
|
return {
|
|
29
|
-
success:
|
|
30
|
-
message: 'SPARC
|
|
72
|
+
success: true,
|
|
73
|
+
message: 'SPARC specialist functionality redirected to working SWARM system',
|
|
31
74
|
specialistType,
|
|
32
75
|
task,
|
|
33
76
|
options,
|
|
34
|
-
|
|
77
|
+
recommendedCommand: swarmCommand,
|
|
78
|
+
redirectedTo: 'swarm'
|
|
35
79
|
};
|
|
36
80
|
}
|
|
37
81
|
}
|
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.ActionTypeCache = void 0;
|
|
11
11
|
const fs_1 = __importDefault(require("fs"));
|
|
12
12
|
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const os_1 = __importDefault(require("os"));
|
|
13
14
|
const logger_js_1 = require("./logger.js");
|
|
14
15
|
class ActionTypeCache {
|
|
15
16
|
constructor(client) {
|
|
@@ -18,7 +19,7 @@ class ActionTypeCache {
|
|
|
18
19
|
this.cacheLoaded = false;
|
|
19
20
|
this.logger = new logger_js_1.Logger('ActionTypeCache');
|
|
20
21
|
this.client = client;
|
|
21
|
-
this.cacheDir = path_1.default.join(process.
|
|
22
|
+
this.cacheDir = path_1.default.join(process.env.SNOW_FLOW_HOME || path_1.default.join(os_1.default.homedir(), '.snow-flow'), 'cache');
|
|
22
23
|
this.ensureCacheDir();
|
|
23
24
|
}
|
|
24
25
|
ensureCacheDir() {
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
* Centralized MCP Configuration Manager
|
|
4
4
|
* Handles dynamic configuration loading for all MCP servers
|
|
5
5
|
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
6
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
10
|
exports.mcpConfig = exports.MCPConfigManager = void 0;
|
|
8
11
|
const dotenv_1 = require("dotenv");
|
|
9
12
|
const fs_1 = require("fs");
|
|
10
13
|
const path_1 = require("path");
|
|
14
|
+
const os_1 = __importDefault(require("os"));
|
|
11
15
|
const logger_js_1 = require("./logger.js");
|
|
12
16
|
// Load environment variables
|
|
13
17
|
(0, dotenv_1.config)();
|
|
@@ -43,7 +47,7 @@ class MCPConfigManager {
|
|
|
43
47
|
},
|
|
44
48
|
memory: {
|
|
45
49
|
provider: process.env.MEMORY_PROVIDER || 'file',
|
|
46
|
-
path: process.env.MEMORY_PATH || (0, path_1.join)(process.
|
|
50
|
+
path: process.env.MEMORY_PATH || (0, path_1.join)(process.env.SNOW_FLOW_HOME || (0, path_1.join)(os_1.default.homedir(), '.snow-flow'), 'memory'),
|
|
47
51
|
connectionString: process.env.MEMORY_CONNECTION_STRING,
|
|
48
52
|
maxSize: parseInt(process.env.MEMORY_MAX_SIZE || '1000'),
|
|
49
53
|
ttl: parseInt(process.env.MEMORY_TTL || '86400') // 24 hours
|
|
@@ -58,11 +62,11 @@ class MCPConfigManager {
|
|
|
58
62
|
logging: {
|
|
59
63
|
level: process.env.LOG_LEVEL || 'info',
|
|
60
64
|
enableFileLogging: process.env.ENABLE_FILE_LOGGING === 'true',
|
|
61
|
-
logPath: process.env.LOG_PATH || (0, path_1.join)(process.
|
|
65
|
+
logPath: process.env.LOG_PATH || (0, path_1.join)(process.env.SNOW_FLOW_HOME || (0, path_1.join)(os_1.default.homedir(), '.snow-flow'), 'logs')
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
68
|
// Try to load from config file if it exists
|
|
65
|
-
const configPath = (0, path_1.join)(process.
|
|
69
|
+
const configPath = (0, path_1.join)(process.env.SNOW_FLOW_HOME || (0, path_1.join)(os_1.default.homedir(), '.snow-flow'), 'config.json');
|
|
66
70
|
if ((0, fs_1.existsSync)(configPath)) {
|
|
67
71
|
try {
|
|
68
72
|
const fileConfig = JSON.parse((0, fs_1.readFileSync)(configPath, 'utf8'));
|
|
@@ -2,25 +2,29 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* MCP Server Manager - Manages background MCP servers for Claude Code integration
|
|
4
4
|
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
5
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
9
|
exports.MCPServerManager = void 0;
|
|
7
10
|
const child_process_1 = require("child_process");
|
|
8
11
|
const fs_1 = require("fs");
|
|
9
12
|
const path_1 = require("path");
|
|
10
13
|
const events_1 = require("events");
|
|
14
|
+
const os_1 = __importDefault(require("os"));
|
|
11
15
|
class MCPServerManager extends events_1.EventEmitter {
|
|
12
16
|
constructor(configPath) {
|
|
13
17
|
super();
|
|
14
18
|
this.servers = new Map();
|
|
15
|
-
this.configPath = configPath || (0, path_1.join)(process.
|
|
16
|
-
this.logPath = (0, path_1.join)(process.
|
|
19
|
+
this.configPath = configPath || (0, path_1.join)(process.env.SNOW_FLOW_HOME || (0, path_1.join)(os_1.default.homedir(), '.snow-flow'), 'mcp-servers.json');
|
|
20
|
+
this.logPath = (0, path_1.join)(process.env.SNOW_FLOW_HOME || (0, path_1.join)(os_1.default.homedir(), '.snow-flow'), 'logs');
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* Initialize MCP server manager
|
|
20
24
|
*/
|
|
21
25
|
async initialize() {
|
|
22
26
|
// Ensure directories exist
|
|
23
|
-
await fs_1.promises.mkdir((0, path_1.join)(
|
|
27
|
+
await fs_1.promises.mkdir(process.env.SNOW_FLOW_HOME || (0, path_1.join)(os_1.default.homedir(), '.snow-flow'), { recursive: true });
|
|
24
28
|
await fs_1.promises.mkdir(this.logPath, { recursive: true });
|
|
25
29
|
// Load existing configuration
|
|
26
30
|
await this.loadConfiguration();
|