snow-flow 1.1.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/.env.example +49 -0
- package/.mcp.json +106 -0
- package/.mcp.json.template +106 -0
- package/LICENSE +21 -0
- package/README.md +236 -0
- package/bin/snow-flow +4 -0
- package/bin/snow-flow.js +3 -0
- package/claude-flow +79 -0
- package/claude-flow.bat +18 -0
- package/claude-flow.config.json +20 -0
- package/claude-flow.ps1 +24 -0
- package/dist/agents/app-creator.agent.d.ts +55 -0
- package/dist/agents/app-creator.agent.d.ts.map +1 -0
- package/dist/agents/app-creator.agent.js +1292 -0
- package/dist/agents/app-creator.agent.js.map +1 -0
- package/dist/agents/base-snow-agent.d.ts +63 -0
- package/dist/agents/base-snow-agent.d.ts.map +1 -0
- package/dist/agents/base-snow-agent.js +296 -0
- package/dist/agents/base-snow-agent.js.map +1 -0
- package/dist/agents/script-generator.agent.d.ts +32 -0
- package/dist/agents/script-generator.agent.d.ts.map +1 -0
- package/dist/agents/script-generator.agent.js +772 -0
- package/dist/agents/script-generator.agent.js.map +1 -0
- package/dist/agents/ui-builder.agent.d.ts +50 -0
- package/dist/agents/ui-builder.agent.d.ts.map +1 -0
- package/dist/agents/ui-builder.agent.js +1539 -0
- package/dist/agents/ui-builder.agent.js.map +1 -0
- package/dist/agents/widget-builder.agent.d.ts +32 -0
- package/dist/agents/widget-builder.agent.d.ts.map +1 -0
- package/dist/agents/widget-builder.agent.js +439 -0
- package/dist/agents/widget-builder.agent.js.map +1 -0
- package/dist/agents/workflow-designer.agent.d.ts +31 -0
- package/dist/agents/workflow-designer.agent.d.ts.map +1 -0
- package/dist/agents/workflow-designer.agent.js +583 -0
- package/dist/agents/workflow-designer.agent.js.map +1 -0
- package/dist/api/error-handling.d.ts +214 -0
- package/dist/api/error-handling.d.ts.map +1 -0
- package/dist/api/error-handling.js +594 -0
- package/dist/api/error-handling.js.map +1 -0
- package/dist/api/flow-designer-api.d.ts +167 -0
- package/dist/api/flow-designer-api.d.ts.map +1 -0
- package/dist/api/flow-designer-api.js +555 -0
- package/dist/api/flow-designer-api.js.map +1 -0
- package/dist/api/natural-language-mapper.d.ts +126 -0
- package/dist/api/natural-language-mapper.d.ts.map +1 -0
- package/dist/api/natural-language-mapper.js +498 -0
- package/dist/api/natural-language-mapper.js.map +1 -0
- package/dist/api/performance-optimizer.d.ts +240 -0
- package/dist/api/performance-optimizer.d.ts.map +1 -0
- package/dist/api/performance-optimizer.js +701 -0
- package/dist/api/performance-optimizer.js.map +1 -0
- package/dist/api/transaction-manager.d.ts +189 -0
- package/dist/api/transaction-manager.d.ts.map +1 -0
- package/dist/api/transaction-manager.js +576 -0
- package/dist/api/transaction-manager.js.map +1 -0
- package/dist/cli/deploy-artifact.d.ts +7 -0
- package/dist/cli/deploy-artifact.d.ts.map +1 -0
- package/dist/cli/deploy-artifact.js +279 -0
- package/dist/cli/deploy-artifact.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2057 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/managers/scope-manager.d.ts +75 -0
- package/dist/managers/scope-manager.d.ts.map +1 -0
- package/dist/managers/scope-manager.js +448 -0
- package/dist/managers/scope-manager.js.map +1 -0
- package/dist/mcp/mcp-wrapper.d.ts +8 -0
- package/dist/mcp/mcp-wrapper.d.ts.map +1 -0
- package/dist/mcp/mcp-wrapper.js +77 -0
- package/dist/mcp/mcp-wrapper.js.map +1 -0
- package/dist/mcp/servicenow-automation-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-automation-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-automation-mcp.js +683 -0
- package/dist/mcp/servicenow-automation-mcp.js.map +1 -0
- package/dist/mcp/servicenow-deployment-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-deployment-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-deployment-mcp.js +972 -0
- package/dist/mcp/servicenow-deployment-mcp.js.map +1 -0
- package/dist/mcp/servicenow-flow-composer-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-flow-composer-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-flow-composer-mcp.js +1121 -0
- package/dist/mcp/servicenow-flow-composer-mcp.js.map +1 -0
- package/dist/mcp/servicenow-graph-memory-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-graph-memory-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-graph-memory-mcp.js +703 -0
- package/dist/mcp/servicenow-graph-memory-mcp.js.map +1 -0
- package/dist/mcp/servicenow-integration-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-integration-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-integration-mcp.js +689 -0
- package/dist/mcp/servicenow-integration-mcp.js.map +1 -0
- package/dist/mcp/servicenow-intelligent-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-intelligent-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-intelligent-mcp.js +1138 -0
- package/dist/mcp/servicenow-intelligent-mcp.js.map +1 -0
- package/dist/mcp/servicenow-mcp-server.d.ts +37 -0
- package/dist/mcp/servicenow-mcp-server.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-server.js +648 -0
- package/dist/mcp/servicenow-mcp-server.js.map +1 -0
- package/dist/mcp/servicenow-operations-mcp.d.ts +15 -0
- package/dist/mcp/servicenow-operations-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-operations-mcp.js +1287 -0
- package/dist/mcp/servicenow-operations-mcp.js.map +1 -0
- package/dist/mcp/servicenow-platform-development-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-platform-development-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-platform-development-mcp.js +557 -0
- package/dist/mcp/servicenow-platform-development-mcp.js.map +1 -0
- package/dist/mcp/servicenow-progressive-indexer.d.ts +79 -0
- package/dist/mcp/servicenow-progressive-indexer.d.ts.map +1 -0
- package/dist/mcp/servicenow-progressive-indexer.js +320 -0
- package/dist/mcp/servicenow-progressive-indexer.js.map +1 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.js +888 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.js.map +1 -0
- package/dist/mcp/servicenow-security-compliance-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-security-compliance-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-security-compliance-mcp.js +812 -0
- package/dist/mcp/servicenow-security-compliance-mcp.js.map +1 -0
- package/dist/mcp/servicenow-update-set-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-update-set-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-update-set-mcp.js +599 -0
- package/dist/mcp/servicenow-update-set-mcp.js.map +1 -0
- package/dist/mcp/start-all-mcp-servers.d.ts +6 -0
- package/dist/mcp/start-all-mcp-servers.d.ts.map +1 -0
- package/dist/mcp/start-all-mcp-servers.js +65 -0
- package/dist/mcp/start-all-mcp-servers.js.map +1 -0
- package/dist/mcp/start-servicenow-mcp.d.ts +7 -0
- package/dist/mcp/start-servicenow-mcp.d.ts.map +1 -0
- package/dist/mcp/start-servicenow-mcp.js +64 -0
- package/dist/mcp/start-servicenow-mcp.js.map +1 -0
- package/dist/mcp/test-simple-mcp.d.ts +6 -0
- package/dist/mcp/test-simple-mcp.d.ts.map +1 -0
- package/dist/mcp/test-simple-mcp.js +64 -0
- package/dist/mcp/test-simple-mcp.js.map +1 -0
- package/dist/orchestrator/flow-composer.d.ts +269 -0
- package/dist/orchestrator/flow-composer.d.ts.map +1 -0
- package/dist/orchestrator/flow-composer.js +2221 -0
- package/dist/orchestrator/flow-composer.js.map +1 -0
- package/dist/orchestrator/flow-pattern-templates.d.ts +260 -0
- package/dist/orchestrator/flow-pattern-templates.d.ts.map +1 -0
- package/dist/orchestrator/flow-pattern-templates.js +906 -0
- package/dist/orchestrator/flow-pattern-templates.js.map +1 -0
- package/dist/orchestrator/flow-subflow-decision-engine.d.ts +202 -0
- package/dist/orchestrator/flow-subflow-decision-engine.d.ts.map +1 -0
- package/dist/orchestrator/flow-subflow-decision-engine.js +769 -0
- package/dist/orchestrator/flow-subflow-decision-engine.js.map +1 -0
- package/dist/orchestrator/flow-validation-engine.d.ts +145 -0
- package/dist/orchestrator/flow-validation-engine.d.ts.map +1 -0
- package/dist/orchestrator/flow-validation-engine.js +663 -0
- package/dist/orchestrator/flow-validation-engine.js.map +1 -0
- package/dist/orchestrator/snow-orchestrator.d.ts +49 -0
- package/dist/orchestrator/snow-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/snow-orchestrator.js +235 -0
- package/dist/orchestrator/snow-orchestrator.js.map +1 -0
- package/dist/orchestrator/subflow-creation-handler.d.ts +230 -0
- package/dist/orchestrator/subflow-creation-handler.d.ts.map +1 -0
- package/dist/orchestrator/subflow-creation-handler.js +791 -0
- package/dist/orchestrator/subflow-creation-handler.js.map +1 -0
- package/dist/strategies/global-scope-strategy.d.ts +123 -0
- package/dist/strategies/global-scope-strategy.d.ts.map +1 -0
- package/dist/strategies/global-scope-strategy.js +585 -0
- package/dist/strategies/global-scope-strategy.js.map +1 -0
- package/dist/types/index.d.ts +138 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/servicenow.types.d.ts +260 -0
- package/dist/types/servicenow.types.d.ts.map +1 -0
- package/dist/types/servicenow.types.js +3 -0
- package/dist/types/servicenow.types.js.map +1 -0
- package/dist/types/snow-flow.types.d.ts +114 -0
- package/dist/types/snow-flow.types.d.ts.map +1 -0
- package/dist/types/snow-flow.types.js +3 -0
- package/dist/types/snow-flow.types.js.map +1 -0
- package/dist/utils/action-type-cache.d.ts +66 -0
- package/dist/utils/action-type-cache.d.ts.map +1 -0
- package/dist/utils/action-type-cache.js +237 -0
- package/dist/utils/action-type-cache.js.map +1 -0
- package/dist/utils/agent-detector.d.ts +35 -0
- package/dist/utils/agent-detector.d.ts.map +1 -0
- package/dist/utils/agent-detector.js +353 -0
- package/dist/utils/agent-detector.js.map +1 -0
- package/dist/utils/flow-api-discovery.d.ts +151 -0
- package/dist/utils/flow-api-discovery.d.ts.map +1 -0
- package/dist/utils/flow-api-discovery.js +440 -0
- package/dist/utils/flow-api-discovery.js.map +1 -0
- package/dist/utils/flow-xml-generator.d.ts +41 -0
- package/dist/utils/flow-xml-generator.d.ts.map +1 -0
- package/dist/utils/flow-xml-generator.js +258 -0
- package/dist/utils/flow-xml-generator.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +51 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/mcp-auth-middleware.d.ts +58 -0
- package/dist/utils/mcp-auth-middleware.d.ts.map +1 -0
- package/dist/utils/mcp-auth-middleware.js +227 -0
- package/dist/utils/mcp-auth-middleware.js.map +1 -0
- package/dist/utils/mcp-config-manager.d.ts +126 -0
- package/dist/utils/mcp-config-manager.d.ts.map +1 -0
- package/dist/utils/mcp-config-manager.js +209 -0
- package/dist/utils/mcp-config-manager.js.map +1 -0
- package/dist/utils/mcp-server-manager.d.ts +91 -0
- package/dist/utils/mcp-server-manager.d.ts.map +1 -0
- package/dist/utils/mcp-server-manager.js +338 -0
- package/dist/utils/mcp-server-manager.js.map +1 -0
- package/dist/utils/scope-utils.d.ts +72 -0
- package/dist/utils/scope-utils.d.ts.map +1 -0
- package/dist/utils/scope-utils.js +386 -0
- package/dist/utils/scope-utils.js.map +1 -0
- package/dist/utils/servicenow-client.d.ts +233 -0
- package/dist/utils/servicenow-client.d.ts.map +1 -0
- package/dist/utils/servicenow-client.js +1465 -0
- package/dist/utils/servicenow-client.js.map +1 -0
- package/dist/utils/snow-oauth-old.d.ts +65 -0
- package/dist/utils/snow-oauth-old.d.ts.map +1 -0
- package/dist/utils/snow-oauth-old.js +345 -0
- package/dist/utils/snow-oauth-old.js.map +1 -0
- package/dist/utils/snow-oauth.d.ts +85 -0
- package/dist/utils/snow-oauth.d.ts.map +1 -0
- package/dist/utils/snow-oauth.js +512 -0
- package/dist/utils/snow-oauth.js.map +1 -0
- package/dist/utils/template-engine.d.ts +76 -0
- package/dist/utils/template-engine.d.ts.map +1 -0
- package/dist/utils/template-engine.js +391 -0
- package/dist/utils/template-engine.js.map +1 -0
- package/dist/version.d.ts +35 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +72 -0
- package/dist/version.js.map +1 -0
- package/mcp-wrapper.sh +12 -0
- package/package.json +77 -0
- package/reports/swarm-auto-centralized-1752649029776.json +13 -0
- package/scripts/postinstall.js +30 -0
- package/scripts/setup-mcp.js +89 -0
package/.env.example
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ServiceNow OAuth Configuration
|
|
2
|
+
# Replace these values with your actual ServiceNow instance and OAuth credentials
|
|
3
|
+
|
|
4
|
+
# ServiceNow Instance URL (without https://)
|
|
5
|
+
# Example: dev12345.service-now.com
|
|
6
|
+
SNOW_INSTANCE=your-instance.service-now.com
|
|
7
|
+
|
|
8
|
+
# OAuth Client ID from ServiceNow Application Registry
|
|
9
|
+
# How to get: System OAuth > Application Registry > New > Create an OAuth application
|
|
10
|
+
SNOW_CLIENT_ID=your-oauth-client-id
|
|
11
|
+
|
|
12
|
+
# OAuth Client Secret from ServiceNow Application Registry
|
|
13
|
+
SNOW_CLIENT_SECRET=your-oauth-client-secret
|
|
14
|
+
|
|
15
|
+
# Optional: Additional Configuration
|
|
16
|
+
# SNOW_REDIRECT_URI=http://localhost:3000/callback
|
|
17
|
+
|
|
18
|
+
# ===========================================
|
|
19
|
+
# Snow-Flow Configuration
|
|
20
|
+
# ===========================================
|
|
21
|
+
|
|
22
|
+
# Enable debug logging (true/false)
|
|
23
|
+
SNOW_FLOW_DEBUG=false
|
|
24
|
+
|
|
25
|
+
# Default coordination strategy
|
|
26
|
+
SNOW_FLOW_STRATEGY=development
|
|
27
|
+
|
|
28
|
+
# Maximum number of agents
|
|
29
|
+
SNOW_FLOW_MAX_AGENTS=5
|
|
30
|
+
|
|
31
|
+
# Claude Code timeout configuration (in minutes)
|
|
32
|
+
# Set to 0 to disable timeout (infinite execution time)
|
|
33
|
+
# Default: 60 minutes
|
|
34
|
+
SNOW_FLOW_TIMEOUT_MINUTES=0
|
|
35
|
+
|
|
36
|
+
# ===========================================
|
|
37
|
+
# How to Set Up ServiceNow OAuth
|
|
38
|
+
# ===========================================
|
|
39
|
+
# 1. Log into your ServiceNow instance as admin
|
|
40
|
+
# 2. Navigate to: System OAuth > Application Registry
|
|
41
|
+
# 3. Click "New" > "Create an OAuth application"
|
|
42
|
+
# 4. Fill in:
|
|
43
|
+
# - Name: Snow-Flow Development
|
|
44
|
+
# - Client ID: (will be generated)
|
|
45
|
+
# - Client Secret: (will be generated)
|
|
46
|
+
# - Redirect URL: http://localhost:3000/callback
|
|
47
|
+
# - Grant Type: Authorization Code
|
|
48
|
+
# 5. Copy the Client ID and Client Secret to this file
|
|
49
|
+
# 6. Run: snow-flow auth login
|
package/.mcp.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"servicenow-deployment": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-deployment-mcp.js"],
|
|
6
|
+
"env": {
|
|
7
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
8
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
9
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"servicenow-flow-composer": {
|
|
13
|
+
"command": "node",
|
|
14
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-flow-composer-mcp.js"],
|
|
15
|
+
"env": {
|
|
16
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
17
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
18
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"servicenow-update-set": {
|
|
22
|
+
"command": "node",
|
|
23
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-update-set-mcp.js"],
|
|
24
|
+
"env": {
|
|
25
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
26
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
27
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"servicenow-intelligent": {
|
|
31
|
+
"command": "node",
|
|
32
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-intelligent-mcp.js"],
|
|
33
|
+
"env": {
|
|
34
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
35
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
36
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"servicenow-graph-memory": {
|
|
40
|
+
"command": "node",
|
|
41
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-graph-memory-mcp.js"],
|
|
42
|
+
"env": {
|
|
43
|
+
"NEO4J_URI": "bolt://localhost:7687",
|
|
44
|
+
"NEO4J_USER": "neo4j",
|
|
45
|
+
"NEO4J_PASSWORD": "password",
|
|
46
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
47
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
48
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"servicenow-operations": {
|
|
52
|
+
"command": "node",
|
|
53
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-operations-mcp.js"],
|
|
54
|
+
"env": {
|
|
55
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
56
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
57
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"servicenow-platform-development": {
|
|
61
|
+
"command": "node",
|
|
62
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-platform-development-mcp.js"],
|
|
63
|
+
"env": {
|
|
64
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
65
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
66
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"servicenow-integration": {
|
|
70
|
+
"command": "node",
|
|
71
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-integration-mcp.js"],
|
|
72
|
+
"env": {
|
|
73
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
74
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
75
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"servicenow-automation": {
|
|
79
|
+
"command": "node",
|
|
80
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-automation-mcp.js"],
|
|
81
|
+
"env": {
|
|
82
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
83
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
84
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"servicenow-security-compliance": {
|
|
88
|
+
"command": "node",
|
|
89
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-security-compliance-mcp.js"],
|
|
90
|
+
"env": {
|
|
91
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
92
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
93
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"servicenow-reporting-analytics": {
|
|
97
|
+
"command": "node",
|
|
98
|
+
"args": ["/Users/nielsvanderwerf/Projects/servicenow_multiagent/dist/mcp/servicenow-reporting-analytics-mcp.js"],
|
|
99
|
+
"env": {
|
|
100
|
+
"SNOW_INSTANCE": "dev198027.service-now.com/",
|
|
101
|
+
"SNOW_CLIENT_ID": "0664245521cf423ba1989e4c875b18de",
|
|
102
|
+
"SNOW_CLIENT_SECRET": "Welkom123"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"servicenow-deployment": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-deployment-mcp.js"],
|
|
6
|
+
"env": {
|
|
7
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
8
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
9
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"servicenow-flow-composer": {
|
|
13
|
+
"command": "node",
|
|
14
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-flow-composer-mcp.js"],
|
|
15
|
+
"env": {
|
|
16
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
17
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
18
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"servicenow-update-set": {
|
|
22
|
+
"command": "node",
|
|
23
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-update-set-mcp.js"],
|
|
24
|
+
"env": {
|
|
25
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
26
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
27
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"servicenow-intelligent": {
|
|
31
|
+
"command": "node",
|
|
32
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-intelligent-mcp.js"],
|
|
33
|
+
"env": {
|
|
34
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
35
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
36
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"servicenow-graph-memory": {
|
|
40
|
+
"command": "node",
|
|
41
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-graph-memory-mcp.js"],
|
|
42
|
+
"env": {
|
|
43
|
+
"NEO4J_URI": "{{NEO4J_URI}}",
|
|
44
|
+
"NEO4J_USER": "{{NEO4J_USER}}",
|
|
45
|
+
"NEO4J_PASSWORD": "{{NEO4J_PASSWORD}}",
|
|
46
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
47
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
48
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"servicenow-operations": {
|
|
52
|
+
"command": "node",
|
|
53
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-operations-mcp.js"],
|
|
54
|
+
"env": {
|
|
55
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
56
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
57
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"servicenow-platform-development": {
|
|
61
|
+
"command": "node",
|
|
62
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-platform-development-mcp.js"],
|
|
63
|
+
"env": {
|
|
64
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
65
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
66
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"servicenow-integration": {
|
|
70
|
+
"command": "node",
|
|
71
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-integration-mcp.js"],
|
|
72
|
+
"env": {
|
|
73
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
74
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
75
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"servicenow-automation": {
|
|
79
|
+
"command": "node",
|
|
80
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-automation-mcp.js"],
|
|
81
|
+
"env": {
|
|
82
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
83
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
84
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"servicenow-security-compliance": {
|
|
88
|
+
"command": "node",
|
|
89
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-security-compliance-mcp.js"],
|
|
90
|
+
"env": {
|
|
91
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
92
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
93
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"servicenow-reporting-analytics": {
|
|
97
|
+
"command": "node",
|
|
98
|
+
"args": ["{{PROJECT_ROOT}}/dist/mcp/servicenow-reporting-analytics-mcp.js"],
|
|
99
|
+
"env": {
|
|
100
|
+
"SNOW_INSTANCE": "{{SNOW_INSTANCE}}",
|
|
101
|
+
"SNOW_CLIENT_ID": "{{SNOW_CLIENT_ID}}",
|
|
102
|
+
"SNOW_CLIENT_SECRET": "{{SNOW_CLIENT_SECRET}}"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Snow-Flow Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Snow-Flow: Multi-Agent ServiceNow Development Platform 🚀
|
|
2
|
+
|
|
3
|
+
Snow-Flow is a powerful multi-agent AI platform that revolutionizes ServiceNow development through intelligent automation, natural language processing, and autonomous deployment capabilities. Built with 11 specialized MCP (Model Context Protocol) servers, Snow-Flow enables developers to create, manage, and deploy ServiceNow artifacts using simple natural language commands.
|
|
4
|
+
|
|
5
|
+
## 🌟 Key Features
|
|
6
|
+
|
|
7
|
+
### 🤖 11 Specialized MCP Servers
|
|
8
|
+
Each server provides autonomous capabilities for different aspects of ServiceNow development:
|
|
9
|
+
|
|
10
|
+
1. **Deployment MCP** - Autonomous widget, flow, and application deployment
|
|
11
|
+
2. **Flow Composer MCP** - Natural language flow creation with intelligent analysis
|
|
12
|
+
3. **Update Set MCP** - Professional change tracking and deployment management
|
|
13
|
+
4. **Intelligent MCP** - AI-powered artifact discovery and editing
|
|
14
|
+
5. **Graph Memory MCP** - Relationship tracking and impact analysis
|
|
15
|
+
6. **Platform Development MCP** - Development workflow automation
|
|
16
|
+
7. **Integration MCP** - Third-party system integration
|
|
17
|
+
8. **Operations MCP** - Operations and monitoring management
|
|
18
|
+
9. **Automation MCP** - Workflow and process automation
|
|
19
|
+
10. **Security & Compliance MCP** - Security auditing and compliance
|
|
20
|
+
11. **Reporting & Analytics MCP** - Data analysis and reporting
|
|
21
|
+
|
|
22
|
+
### 🎯 Core Capabilities
|
|
23
|
+
|
|
24
|
+
- **Natural Language Processing**: Create complex ServiceNow artifacts using plain English/Dutch commands
|
|
25
|
+
- **Intelligent Decision Making**: Automatically determines optimal architecture (flow vs subflow)
|
|
26
|
+
- **Zero Configuration**: All values dynamically discovered from your ServiceNow instance
|
|
27
|
+
- **Autonomous Deployment**: Direct deployment to ServiceNow with automatic error handling
|
|
28
|
+
- **Update Set Management**: Professional change tracking like ServiceNow pros use
|
|
29
|
+
- **Global Scope Strategy**: Intelligent scope selection with fallback mechanisms
|
|
30
|
+
- **Multi-Agent Coordination**: Parallel execution for complex tasks
|
|
31
|
+
|
|
32
|
+
## 🚀 Quick Start
|
|
33
|
+
|
|
34
|
+
### Prerequisites
|
|
35
|
+
- Node.js 18+ and npm
|
|
36
|
+
- ServiceNow instance with admin access
|
|
37
|
+
- OAuth application configured in ServiceNow
|
|
38
|
+
|
|
39
|
+
### Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Install Snow-Flow globally
|
|
43
|
+
npm install -g snow-flow
|
|
44
|
+
|
|
45
|
+
# Initialize Snow-Flow in your project directory
|
|
46
|
+
snow-flow init --sparc
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Alternative: Install from source
|
|
50
|
+
```bash
|
|
51
|
+
# Clone the repository
|
|
52
|
+
git clone https://github.com/groeimetai/snow-flow.git
|
|
53
|
+
cd snow-flow
|
|
54
|
+
|
|
55
|
+
# Install dependencies
|
|
56
|
+
npm install
|
|
57
|
+
|
|
58
|
+
# Build the project
|
|
59
|
+
npm run build
|
|
60
|
+
|
|
61
|
+
# Link globally (optional)
|
|
62
|
+
npm link
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Configuration
|
|
66
|
+
|
|
67
|
+
1. Create a `.env` file in the project root:
|
|
68
|
+
```env
|
|
69
|
+
SNOW_INSTANCE=your-instance.service-now.com
|
|
70
|
+
SNOW_CLIENT_ID=your-oauth-client-id
|
|
71
|
+
SNOW_CLIENT_SECRET=your-oauth-client-secret
|
|
72
|
+
SNOW_USERNAME=your-username
|
|
73
|
+
SNOW_PASSWORD=your-password
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. Set up OAuth in ServiceNow (see [SERVICENOW-OAUTH-SETUP.md](./SERVICENOW-OAUTH-SETUP.md))
|
|
77
|
+
|
|
78
|
+
3. Authenticate with ServiceNow:
|
|
79
|
+
```bash
|
|
80
|
+
snow-flow auth login
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 💡 Usage Examples
|
|
84
|
+
|
|
85
|
+
### Create a Complex Flow with Natural Language
|
|
86
|
+
```bash
|
|
87
|
+
snow-flow sparc "Create an approval workflow for iPhone 6 orders that notifies managers, creates tasks, and updates inventory"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Deploy a Widget Directly to ServiceNow
|
|
91
|
+
```bash
|
|
92
|
+
snow-flow sparc "Create and deploy a widget that shows all critical incidents with real-time updates"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Start a Multi-Agent Swarm for Complex Projects
|
|
96
|
+
```bash
|
|
97
|
+
snow-flow swarm "Build a complete incident management system with dashboard, workflows, and notifications" --strategy development --parallel
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Intelligent Artifact Discovery
|
|
101
|
+
```bash
|
|
102
|
+
snow-flow sparc "Find and modify the approval workflow to add an extra approval step for orders over $1000"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Create Flows in Dutch
|
|
106
|
+
```bash
|
|
107
|
+
snow-flow sparc "Maak een flow voor het automatisch toewijzen van incidenten aan de juiste groep op basis van categorie"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 🛠️ Advanced Features
|
|
111
|
+
|
|
112
|
+
### Flow vs Subflow Intelligence
|
|
113
|
+
Snow-Flow automatically analyzes your requirements and decides whether to create a main flow or break it into reusable subflows:
|
|
114
|
+
- Complexity analysis
|
|
115
|
+
- Reusability assessment
|
|
116
|
+
- Performance optimization
|
|
117
|
+
- Maintainability considerations
|
|
118
|
+
|
|
119
|
+
### Update Set Management
|
|
120
|
+
Professional change tracking just like ServiceNow developers use:
|
|
121
|
+
```bash
|
|
122
|
+
# Create a new update set for your feature
|
|
123
|
+
snow-flow sparc "Create update set for new approval features"
|
|
124
|
+
|
|
125
|
+
# All subsequent changes are automatically tracked
|
|
126
|
+
snow-flow sparc "Add approval widget to portal"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Global Scope Strategy
|
|
130
|
+
Intelligent deployment scope selection:
|
|
131
|
+
- Automatic permission validation
|
|
132
|
+
- Fallback mechanisms for restricted environments
|
|
133
|
+
- Environment-aware deployment (dev/test/prod)
|
|
134
|
+
|
|
135
|
+
### Template Matching
|
|
136
|
+
Recognizes common patterns and applies best practices:
|
|
137
|
+
- Approval workflows
|
|
138
|
+
- Fulfillment processes
|
|
139
|
+
- Notification systems
|
|
140
|
+
- Integration patterns
|
|
141
|
+
|
|
142
|
+
## 📁 Project Structure
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
snow-flow/
|
|
146
|
+
├── src/
|
|
147
|
+
│ ├── mcp/ # 11 MCP server implementations
|
|
148
|
+
│ ├── orchestrator/ # Flow composition and intelligence
|
|
149
|
+
│ ├── strategies/ # Deployment and scope strategies
|
|
150
|
+
│ ├── api/ # ServiceNow API integration
|
|
151
|
+
│ ├── managers/ # Resource and scope management
|
|
152
|
+
│ └── utils/ # Utilities and helpers
|
|
153
|
+
├── .snow-flow/ # Snow-Flow configuration
|
|
154
|
+
├── .claude/ # Claude configuration
|
|
155
|
+
├── memory/ # Persistent agent memory
|
|
156
|
+
└── coordination/ # Multi-agent coordination
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## 🔧 Development Commands
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Run tests
|
|
163
|
+
npm test
|
|
164
|
+
|
|
165
|
+
# Run linting
|
|
166
|
+
npm run lint
|
|
167
|
+
|
|
168
|
+
# Type checking
|
|
169
|
+
npm run typecheck
|
|
170
|
+
|
|
171
|
+
# Development mode
|
|
172
|
+
npm run dev
|
|
173
|
+
|
|
174
|
+
# Build for production
|
|
175
|
+
npm run build
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## 📚 Documentation
|
|
179
|
+
|
|
180
|
+
- [MCP Server Documentation](./MCP_SERVERS.md) - Detailed info on all 11 MCP servers
|
|
181
|
+
- [OAuth Setup Guide](./SERVICENOW-OAUTH-SETUP.md) - ServiceNow OAuth configuration
|
|
182
|
+
- [Flow Composer Guide](./ENHANCED_FLOW_COMPOSER_DOCUMENTATION.md) - Advanced flow creation
|
|
183
|
+
- [Update Set Guide](./UPDATE_SET_DEPLOYMENT_GUIDE.md) - Professional change management
|
|
184
|
+
- [API Integration Guide](./API_INTEGRATION_GUIDE.md) - ServiceNow API details
|
|
185
|
+
|
|
186
|
+
## 🤝 Contributing
|
|
187
|
+
|
|
188
|
+
We welcome contributions! Please see our contributing guidelines (coming soon).
|
|
189
|
+
|
|
190
|
+
## 🔒 Security
|
|
191
|
+
|
|
192
|
+
- All credentials stored securely in environment variables
|
|
193
|
+
- OAuth 2.0 authentication with ServiceNow
|
|
194
|
+
- No hardcoded values - everything discovered dynamically
|
|
195
|
+
- Secure token management with automatic refresh
|
|
196
|
+
|
|
197
|
+
## 🎯 Use Cases
|
|
198
|
+
|
|
199
|
+
### For ServiceNow Developers
|
|
200
|
+
- Rapidly prototype flows and workflows
|
|
201
|
+
- Automate repetitive development tasks
|
|
202
|
+
- Ensure consistency across implementations
|
|
203
|
+
- Reduce development time by 80%
|
|
204
|
+
|
|
205
|
+
### For ServiceNow Architects
|
|
206
|
+
- Validate architectural decisions
|
|
207
|
+
- Ensure best practices are followed
|
|
208
|
+
- Analyze impact of changes
|
|
209
|
+
- Optimize performance and maintainability
|
|
210
|
+
|
|
211
|
+
### For ServiceNow Administrators
|
|
212
|
+
- Quick deployments and updates
|
|
213
|
+
- Professional change tracking
|
|
214
|
+
- Automated testing and validation
|
|
215
|
+
- Simplified migration between instances
|
|
216
|
+
|
|
217
|
+
## 🚦 Roadmap
|
|
218
|
+
|
|
219
|
+
- [ ] Visual flow designer integration
|
|
220
|
+
- [ ] Enhanced Neo4j graph visualization
|
|
221
|
+
- [ ] Multi-instance synchronization
|
|
222
|
+
- [ ] AI-powered code review
|
|
223
|
+
- [ ] Automated testing framework
|
|
224
|
+
- [ ] Performance optimization recommendations
|
|
225
|
+
|
|
226
|
+
## 📝 License
|
|
227
|
+
|
|
228
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
229
|
+
|
|
230
|
+
## 🙏 Acknowledgments
|
|
231
|
+
|
|
232
|
+
Built with the power of Claude AI and the ServiceNow platform. Special thanks to the ServiceNow developer community for inspiration and best practices.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
**Ready to revolutionize your ServiceNow development?** Start with `snow-flow init --sparc` and experience the future of ServiceNow automation! 🚀
|
package/bin/snow-flow
ADDED
package/bin/snow-flow.js
ADDED
package/claude-flow
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Claude Flow CLI - Universal Wrapper
|
|
5
|
+
* Works in both CommonJS and ES Module projects
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Use dynamic import to work in both CommonJS and ES modules
|
|
9
|
+
(async () => {
|
|
10
|
+
const { spawn } = await import('child_process');
|
|
11
|
+
const { resolve } = await import('path');
|
|
12
|
+
const { fileURLToPath } = await import('url');
|
|
13
|
+
|
|
14
|
+
// Detect if we're running in ES module context
|
|
15
|
+
let __dirname;
|
|
16
|
+
try {
|
|
17
|
+
// Check if import.meta is available (ES modules)
|
|
18
|
+
if (typeof import.meta !== 'undefined' && import.meta.url) {
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
+
__dirname = resolve(__filename, '..');
|
|
21
|
+
} else {
|
|
22
|
+
// Fallback for CommonJS
|
|
23
|
+
__dirname = process.cwd();
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
// Fallback for CommonJS
|
|
27
|
+
__dirname = process.cwd();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Try multiple strategies to find claude-flow
|
|
31
|
+
const strategies = [
|
|
32
|
+
// 1. Local node_modules
|
|
33
|
+
async () => {
|
|
34
|
+
try {
|
|
35
|
+
const localPath = resolve(process.cwd(), 'node_modules/.bin/claude-flow');
|
|
36
|
+
const { existsSync } = await import('fs');
|
|
37
|
+
if (existsSync(localPath)) {
|
|
38
|
+
return spawn(localPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
39
|
+
}
|
|
40
|
+
} catch {}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
// 2. Parent node_modules (monorepo)
|
|
44
|
+
async () => {
|
|
45
|
+
try {
|
|
46
|
+
const parentPath = resolve(process.cwd(), '../node_modules/.bin/claude-flow');
|
|
47
|
+
const { existsSync } = await import('fs');
|
|
48
|
+
if (existsSync(parentPath)) {
|
|
49
|
+
return spawn(parentPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
50
|
+
}
|
|
51
|
+
} catch {}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// 3. NPX with latest alpha version (prioritized over global)
|
|
55
|
+
async () => {
|
|
56
|
+
return spawn('npx', ['claude-flow@2.0.0-alpha.27', ...process.argv.slice(2)], { stdio: 'inherit' });
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
// Try each strategy
|
|
61
|
+
for (const strategy of strategies) {
|
|
62
|
+
try {
|
|
63
|
+
const child = await strategy();
|
|
64
|
+
if (child) {
|
|
65
|
+
child.on('exit', (code) => process.exit(code || 0));
|
|
66
|
+
child.on('error', (err) => {
|
|
67
|
+
if (err.code !== 'ENOENT') {
|
|
68
|
+
console.error('Error:', err);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
} catch {}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
console.error('Could not find claude-flow. Please install it with: npm install claude-flow');
|
|
78
|
+
process.exit(1);
|
|
79
|
+
})();
|
package/claude-flow.bat
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
:: Claude Flow CLI for Windows
|
|
3
|
+
:: AI-Driven Development Toolkit
|
|
4
|
+
|
|
5
|
+
setlocal
|
|
6
|
+
|
|
7
|
+
:: Check if Node.js is installed
|
|
8
|
+
where node >nul 2>nul
|
|
9
|
+
if %errorlevel% neq 0 (
|
|
10
|
+
echo Error: Node.js is not installed or not in PATH
|
|
11
|
+
echo Please install Node.js from https://nodejs.org/
|
|
12
|
+
exit /b 1
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
:: Run Claude Flow CLI
|
|
16
|
+
node "%~dp0claude-flow" %*
|
|
17
|
+
|
|
18
|
+
endlocal
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"features": {
|
|
3
|
+
"autoTopologySelection": true,
|
|
4
|
+
"parallelExecution": true,
|
|
5
|
+
"neuralTraining": true,
|
|
6
|
+
"bottleneckAnalysis": true,
|
|
7
|
+
"smartAutoSpawning": true,
|
|
8
|
+
"selfHealingWorkflows": true,
|
|
9
|
+
"crossSessionMemory": true,
|
|
10
|
+
"githubIntegration": true
|
|
11
|
+
},
|
|
12
|
+
"performance": {
|
|
13
|
+
"maxAgents": 10,
|
|
14
|
+
"defaultTopology": "hierarchical",
|
|
15
|
+
"executionStrategy": "parallel",
|
|
16
|
+
"tokenOptimization": true,
|
|
17
|
+
"cacheEnabled": true,
|
|
18
|
+
"telemetryLevel": "detailed"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/claude-flow.ps1
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
# Claude Flow CLI for PowerShell
|
|
3
|
+
# AI-Driven Development Toolkit
|
|
4
|
+
|
|
5
|
+
param(
|
|
6
|
+
[Parameter(ValueFromRemainingArguments=$true)]
|
|
7
|
+
[string[]]$Arguments
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
# Check if Node.js is installed
|
|
11
|
+
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
|
12
|
+
Write-Error "Node.js is not installed or not in PATH"
|
|
13
|
+
Write-Error "Please install Node.js from https://nodejs.org/"
|
|
14
|
+
exit 1
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Get the script directory
|
|
18
|
+
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
19
|
+
|
|
20
|
+
# Run Claude Flow CLI
|
|
21
|
+
& node "$scriptDir\claude-flow" @Arguments
|
|
22
|
+
|
|
23
|
+
# Forward the exit code
|
|
24
|
+
exit $LASTEXITCODE
|