snow-flow 3.4.13 → 3.4.15
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/.mcp.json.template +91 -31
- package/README.md +597 -96
- package/dist/cli.js +23 -51
- package/dist/mcp/servicenow-automation-mcp.js +65 -29
- package/dist/mcp/servicenow-change-virtualagent-pa-mcp.js +51 -21
- package/dist/mcp/servicenow-cmdb-event-hr-csm-devops-mcp.js +59 -25
- package/dist/mcp/servicenow-deployment-mcp.js +38 -16
- package/dist/mcp/servicenow-development-assistant-mcp.js +67 -31
- package/dist/mcp/servicenow-flow-workspace-mobile-mcp.js +53 -22
- package/dist/mcp/servicenow-integration-mcp.js +48 -12
- package/dist/mcp/servicenow-knowledge-catalog-mcp.js +42 -16
- package/dist/mcp/servicenow-machine-learning-mcp.js +44 -17
- package/dist/mcp/servicenow-operations-mcp.d.ts +1 -0
- package/dist/mcp/servicenow-operations-mcp.js +108 -79
- package/dist/mcp/servicenow-platform-development-mcp.js +42 -11
- package/dist/mcp/servicenow-reporting-analytics-mcp.js +36 -13
- package/dist/mcp/servicenow-security-compliance-mcp.js +35 -13
- package/dist/mcp/servicenow-system-properties-mcp.d.ts +1 -0
- package/dist/mcp/servicenow-system-properties-mcp.js +66 -42
- package/dist/mcp/servicenow-update-set-mcp.js +35 -11
- package/package.json +2 -2
- package/website/README.md +152 -0
- package/website/css/api-docs.css +366 -0
- package/website/css/style.css +809 -0
- package/website/index.html +750 -0
- package/website/js/main.js +323 -0
- package/website/netlify.toml +37 -0
- package/website/package.json +49 -0
- package/website/vercel.json +54 -0
package/README.md
CHANGED
|
@@ -1,164 +1,665 @@
|
|
|
1
|
-
# Snow-Flow
|
|
1
|
+
# 🏔️❄️ Snow-Flow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/snow-flow)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
[](https://www.servicenow.com)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
**Advanced ServiceNow Development Framework with AI-Powered Automation**
|
|
6
9
|
|
|
7
|
-
Snow-Flow
|
|
8
|
-
- 12 MCP servers for ServiceNow operations
|
|
9
|
-
- Command-line interface for task orchestration
|
|
10
|
-
- Multi-agent coordination system
|
|
11
|
-
- OAuth authentication for ServiceNow instances
|
|
12
|
-
- Background script execution with ES5 JavaScript only
|
|
10
|
+
Snow-Flow revolutionizes ServiceNow development by combining the power of Claude AI, multi-agent orchestration, and the Model Context Protocol (MCP) to create a comprehensive development environment that actually understands ServiceNow.
|
|
13
11
|
|
|
14
|
-
##
|
|
12
|
+
## 🎯 What Makes Snow-Flow Different
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
14
|
+
### The Problem
|
|
15
|
+
ServiceNow development is complex. You're juggling:
|
|
16
|
+
- ES5 JavaScript restrictions (no modern JS features)
|
|
17
|
+
- Widget coherence between server/client/HTML
|
|
18
|
+
- Complex table relationships and dependencies
|
|
19
|
+
- Manual deployment processes
|
|
20
|
+
- Limited debugging capabilities
|
|
21
|
+
- Repetitive coding tasks
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
### The Solution
|
|
24
|
+
Snow-Flow provides an intelligent development framework that:
|
|
25
|
+
- **Understands ServiceNow's ES5 limitations** - Automatically converts modern JavaScript to ES5-compatible code
|
|
26
|
+
- **Validates widget coherence** - Ensures server script, client script, and HTML template work together perfectly
|
|
27
|
+
- **Executes scripts with full output capture** - See all gs.print, gs.info, gs.warn, and gs.error messages
|
|
28
|
+
- **Deploys directly to ServiceNow** - No manual copying and pasting
|
|
29
|
+
- **Coordinates multiple AI agents** - Research, code, test, and deploy in parallel
|
|
30
|
+
- **Uses 100% real data** - Never mock data, always your actual ServiceNow instance
|
|
22
31
|
|
|
32
|
+
## 🚀 Quick Start
|
|
33
|
+
|
|
34
|
+
### Installation
|
|
23
35
|
```bash
|
|
36
|
+
# Install globally via NPM
|
|
24
37
|
npm install -g snow-flow
|
|
38
|
+
|
|
39
|
+
# Initialize in your project
|
|
40
|
+
snow-flow init
|
|
41
|
+
|
|
42
|
+
# Authenticate with ServiceNow
|
|
43
|
+
snow-flow auth login
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Your First Snow-Flow Command
|
|
47
|
+
```bash
|
|
48
|
+
# Create a complete incident dashboard with one command
|
|
49
|
+
snow-flow swarm "Create an incident dashboard with real-time updates, SLA tracking, and automated assignment"
|
|
50
|
+
|
|
51
|
+
# Snow-Flow will:
|
|
52
|
+
# 1. Research best practices
|
|
53
|
+
# 2. Design the architecture
|
|
54
|
+
# 3. Create the widget with perfect coherence
|
|
55
|
+
# 4. Test everything
|
|
56
|
+
# 5. Deploy to your instance
|
|
57
|
+
# 6. Provide the widget URL
|
|
25
58
|
```
|
|
26
59
|
|
|
27
|
-
##
|
|
60
|
+
## 💡 Core Features
|
|
28
61
|
|
|
29
|
-
|
|
62
|
+
### 🤖 AI-Powered Development
|
|
63
|
+
Snow-Flow integrates Claude AI to understand your requirements and generate production-ready ServiceNow code:
|
|
30
64
|
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
65
|
+
```bash
|
|
66
|
+
# Natural language to ServiceNow artifacts
|
|
67
|
+
snow-flow sparc "Create a business rule that auto-assigns incidents based on category"
|
|
68
|
+
|
|
69
|
+
# The AI understands ServiceNow context and generates ES5-compatible code
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 📊 Real Script Execution with Output
|
|
73
|
+
Execute background scripts and actually see what happens:
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
const result = await snow_execute_script_with_output({
|
|
77
|
+
script: `
|
|
78
|
+
gs.info('Analyzing incidents...');
|
|
79
|
+
var stats = {};
|
|
80
|
+
var gr = new GlideRecord('incident');
|
|
81
|
+
gr.addActiveQuery();
|
|
82
|
+
gr.query();
|
|
83
|
+
stats.total = gr.getRowCount();
|
|
84
|
+
gs.print('Found ' + stats.total + ' active incidents');
|
|
85
|
+
|
|
86
|
+
// Get priority breakdown
|
|
87
|
+
var agg = new GlideAggregate('incident');
|
|
88
|
+
agg.addActiveQuery();
|
|
89
|
+
agg.groupBy('priority');
|
|
90
|
+
agg.addAggregate('COUNT');
|
|
91
|
+
agg.query();
|
|
92
|
+
|
|
93
|
+
stats.byPriority = {};
|
|
94
|
+
while(agg.next()) {
|
|
95
|
+
var p = agg.getValue('priority');
|
|
96
|
+
stats.byPriority[p] = agg.getAggregate('COUNT');
|
|
97
|
+
gs.info('Priority ' + p + ': ' + agg.getAggregate('COUNT'));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return stats;
|
|
101
|
+
`
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Output:
|
|
105
|
+
// [INFO] Analyzing incidents...
|
|
106
|
+
// Found 42 active incidents
|
|
107
|
+
// [INFO] Priority 1: 5
|
|
108
|
+
// [INFO] Priority 2: 12
|
|
109
|
+
// [INFO] Priority 3: 25
|
|
110
|
+
// Return value: { total: 42, byPriority: { "1": 5, "2": 12, "3": 25 } }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 🎯 Widget Deployment with Coherence Validation
|
|
114
|
+
Deploy widgets that actually work - Snow-Flow validates the communication between all components:
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
await snow_deploy_widget({
|
|
118
|
+
name: "Incident Monitor",
|
|
119
|
+
template: `
|
|
120
|
+
<div class="incident-list">
|
|
121
|
+
<div ng-repeat="inc in data.incidents" ng-click="openIncident(inc.sys_id)">
|
|
122
|
+
<h3>{{inc.number}}</h3>
|
|
123
|
+
<p>{{inc.short_description}}</p>
|
|
124
|
+
<span class="priority-{{inc.priority}}">P{{inc.priority}}</span>
|
|
125
|
+
</div>
|
|
126
|
+
<button ng-click="refreshData()" class="btn btn-primary">Refresh</button>
|
|
127
|
+
</div>
|
|
128
|
+
`,
|
|
129
|
+
server_script: `
|
|
130
|
+
(function() {
|
|
131
|
+
// Server provides data that HTML uses
|
|
132
|
+
data.incidents = [];
|
|
133
|
+
|
|
134
|
+
var gr = new GlideRecord('incident');
|
|
135
|
+
gr.addActiveQuery();
|
|
136
|
+
gr.orderByDesc('sys_created_on');
|
|
137
|
+
gr.setLimit(10);
|
|
138
|
+
gr.query();
|
|
139
|
+
|
|
140
|
+
while(gr.next()) {
|
|
141
|
+
data.incidents.push({
|
|
142
|
+
sys_id: gr.getUniqueValue(),
|
|
143
|
+
number: gr.getValue('number'),
|
|
144
|
+
short_description: gr.getValue('short_description'),
|
|
145
|
+
priority: gr.getValue('priority')
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Handle client actions
|
|
150
|
+
if (input.action === 'refresh') {
|
|
151
|
+
// Refresh logic here
|
|
152
|
+
data.refreshed = true;
|
|
153
|
+
}
|
|
154
|
+
})();
|
|
155
|
+
`,
|
|
156
|
+
client_script: `
|
|
157
|
+
function($scope, spUtil) {
|
|
158
|
+
var c = this;
|
|
159
|
+
|
|
160
|
+
// Implement methods that HTML calls
|
|
161
|
+
$scope.openIncident = function(sysId) {
|
|
162
|
+
window.open('/incident.do?sys_id=' + sysId, '_blank');
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
$scope.refreshData = function() {
|
|
166
|
+
// Call server action
|
|
167
|
+
c.server.get({action: 'refresh'}).then(function(response) {
|
|
168
|
+
c.data.incidents = response.data.incidents;
|
|
169
|
+
spUtil.addInfoMessage("Data refreshed!");
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
`
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// Snow-Flow validates:
|
|
177
|
+
// ✅ data.incidents exists in server and is used in HTML
|
|
178
|
+
// ✅ openIncident() in HTML has implementation in client
|
|
179
|
+
// ✅ refreshData() in HTML has implementation in client
|
|
180
|
+
// ✅ action: 'refresh' in client has handler in server
|
|
35
181
|
```
|
|
36
182
|
|
|
37
|
-
|
|
183
|
+
### 🐝 Multi-Agent Swarm Coordination
|
|
184
|
+
Coordinate multiple specialized agents working in parallel:
|
|
38
185
|
|
|
39
|
-
|
|
186
|
+
```bash
|
|
187
|
+
# Development swarm with automatic coordination
|
|
188
|
+
snow-flow swarm "Build complete change management system" \
|
|
189
|
+
--strategy development \
|
|
190
|
+
--mode hierarchical \
|
|
191
|
+
--max-agents 8 \
|
|
192
|
+
--monitor
|
|
193
|
+
|
|
194
|
+
# Agents work simultaneously:
|
|
195
|
+
# - Researcher: Analyzes requirements and best practices
|
|
196
|
+
# - Architect: Designs system architecture
|
|
197
|
+
# - Coder Team: Develops components in parallel
|
|
198
|
+
# - Tester: Creates and runs tests
|
|
199
|
+
# - Deployer: Handles deployment
|
|
200
|
+
# - Documenter: Generates documentation
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 🧠 Machine Learning Integration
|
|
204
|
+
Built-in TensorFlow.js for intelligent automation:
|
|
205
|
+
|
|
206
|
+
```javascript
|
|
207
|
+
// Train incident classifier
|
|
208
|
+
const model = await snow_train_classifier({
|
|
209
|
+
type: 'incident_category',
|
|
210
|
+
training_data: {
|
|
211
|
+
table: 'incident',
|
|
212
|
+
fields: ['short_description', 'description'],
|
|
213
|
+
label: 'category',
|
|
214
|
+
limit: 1000
|
|
215
|
+
},
|
|
216
|
+
model_config: {
|
|
217
|
+
type: 'lstm',
|
|
218
|
+
epochs: 50,
|
|
219
|
+
batch_size: 32
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
// Use for predictions
|
|
224
|
+
const prediction = await snow_predict({
|
|
225
|
+
model_id: model.id,
|
|
226
|
+
input: {
|
|
227
|
+
short_description: "Email not working",
|
|
228
|
+
description: "Cannot connect to Exchange server"
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
// Result: { category: "Email", confidence: 0.94 }
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## 🔧 16+ Specialized MCP Servers
|
|
235
|
+
|
|
236
|
+
Snow-Flow includes 16+ MCP servers, each providing specialized tools for different aspects of ServiceNow development:
|
|
237
|
+
|
|
238
|
+
### 1. 🚀 **Deployment Server** (40+ tools)
|
|
239
|
+
Deploy artifacts with automatic validation and rollback capabilities
|
|
240
|
+
- `snow_deploy_widget` - Widgets with coherence validation
|
|
241
|
+
- `snow_deploy_flow` - Flow Designer flows
|
|
242
|
+
- `snow_deploy_portal_page` - Service Portal pages
|
|
243
|
+
- `snow_create_update_set` - Update set management
|
|
244
|
+
|
|
245
|
+
### 2. ⚙️ **Operations Server** (30+ tools)
|
|
246
|
+
Core CRUD operations and data management
|
|
247
|
+
- `snow_query_table` - Advanced table queries
|
|
248
|
+
- `snow_discover_table_fields` - Schema discovery
|
|
249
|
+
- `snow_batch_api` - Batch operations (80% API reduction)
|
|
250
|
+
- `snow_cmdb_search` - CMDB exploration
|
|
251
|
+
|
|
252
|
+
### 3. 🤖 **Automation Server** (25+ tools)
|
|
253
|
+
Script execution and automation
|
|
254
|
+
- `snow_execute_script_with_output` - Full output capture
|
|
255
|
+
- `snow_get_logs` - System log access
|
|
256
|
+
- `snow_trace_execution` - Performance tracing
|
|
257
|
+
- `snow_test_rest_connection` - REST testing
|
|
258
|
+
|
|
259
|
+
### 4. 🧠 **Machine Learning Server** (20+ tools)
|
|
260
|
+
AI/ML capabilities with TensorFlow.js
|
|
261
|
+
- `snow_train_classifier` - Train custom models
|
|
262
|
+
- `snow_detect_anomalies` - Anomaly detection
|
|
263
|
+
- `snow_forecast_incidents` - Predictive analytics
|
|
264
|
+
- `snow_sentiment_analysis` - Text analysis
|
|
265
|
+
|
|
266
|
+
### 5. 💻 **Platform Development Server** (20+ tools)
|
|
267
|
+
Create platform artifacts
|
|
268
|
+
- `snow_create_script_include` - Script Includes
|
|
269
|
+
- `snow_create_business_rule` - Business Rules
|
|
270
|
+
- `snow_create_ui_policy` - UI Policies
|
|
271
|
+
- `snow_create_client_script` - Client Scripts
|
|
272
|
+
|
|
273
|
+
### 6. 🔗 **Integration Server** (15+ tools)
|
|
274
|
+
External integrations and data import
|
|
275
|
+
- `snow_create_rest_message` - REST integrations
|
|
276
|
+
- `snow_create_transform_map` - Data transformations
|
|
277
|
+
- `snow_test_web_service` - Service testing
|
|
278
|
+
- `snow_configure_oauth` - OAuth setup
|
|
279
|
+
|
|
280
|
+
### 7. ⚙️ **System Properties Server** (10+ tools)
|
|
281
|
+
Configuration management
|
|
282
|
+
- `snow_property_get/set` - Property CRUD
|
|
283
|
+
- `snow_property_bulk_update` - Bulk operations
|
|
284
|
+
- `snow_property_export/import` - Configuration backup
|
|
285
|
+
|
|
286
|
+
### 8. 📦 **Update Set Server** (10+ tools)
|
|
287
|
+
Change management
|
|
288
|
+
- `snow_create_update_set` - Create sets
|
|
289
|
+
- `snow_preview_update_set` - Preview changes
|
|
290
|
+
- `snow_export_update_set` - Export as XML
|
|
291
|
+
|
|
292
|
+
### 9. 🎯 **Development Assistant Server** (15+ tools)
|
|
293
|
+
Code generation and optimization
|
|
294
|
+
- `snow_generate_code` - AI code generation
|
|
295
|
+
- `snow_suggest_pattern` - Design patterns
|
|
296
|
+
- `snow_convert_to_es5` - ES5 conversion
|
|
297
|
+
- `snow_optimize_performance` - Performance tips
|
|
298
|
+
|
|
299
|
+
### 10. 🔒 **Security & Compliance Server** (15+ tools)
|
|
300
|
+
Security and compliance management
|
|
301
|
+
- `snow_scan_vulnerabilities` - Security scanning
|
|
302
|
+
- `snow_audit_compliance` - SOX/GDPR/HIPAA
|
|
303
|
+
- `snow_review_access_control` - ACL analysis
|
|
304
|
+
|
|
305
|
+
### 11. 📊 **Reporting & Analytics Server** (20+ tools)
|
|
306
|
+
Advanced reporting and visualization
|
|
307
|
+
- `snow_create_dashboard` - Dashboard builder
|
|
308
|
+
- `snow_define_kpi` - KPI management
|
|
309
|
+
- `snow_analyze_data_quality` - Data validation
|
|
310
|
+
|
|
311
|
+
### 12. 👑 **Orchestration Server** (25+ tools)
|
|
312
|
+
Multi-agent coordination
|
|
313
|
+
- `snow_swarm_init` - Initialize swarms
|
|
314
|
+
- `snow_agent_spawn` - Create agents
|
|
315
|
+
- `snow_memory_store` - Persistent memory
|
|
316
|
+
- `snow_task_orchestrate` - Task management
|
|
317
|
+
|
|
318
|
+
## 📝 ES5 JavaScript - The ServiceNow Reality
|
|
319
|
+
|
|
320
|
+
ServiceNow uses the Rhino JavaScript engine which only supports ES5. Snow-Flow handles this automatically:
|
|
321
|
+
|
|
322
|
+
### ❌ What Doesn't Work in ServiceNow:
|
|
323
|
+
```javascript
|
|
324
|
+
// Modern JavaScript that WILL FAIL in ServiceNow:
|
|
325
|
+
const name = 'John'; // const/let not supported
|
|
326
|
+
let items = []; // use var instead
|
|
327
|
+
const add = (a, b) => a + b; // arrow functions fail
|
|
328
|
+
var msg = `Hello ${name}`; // template literals fail
|
|
329
|
+
var {x, y} = point; // destructuring fails
|
|
330
|
+
for (let item of items) { } // for...of fails
|
|
331
|
+
async function getData() { } // async/await fails
|
|
332
|
+
items.map(x => x * 2); // array methods limited
|
|
333
|
+
class Widget { } // classes not supported
|
|
334
|
+
enum Status { ACTIVE, INACTIVE } // enums not supported
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### ✅ What Snow-Flow Converts To:
|
|
338
|
+
```javascript
|
|
339
|
+
// ES5-compatible code that WORKS:
|
|
340
|
+
var name = 'John';
|
|
341
|
+
var items = [];
|
|
342
|
+
function add(a, b) { return a + b; }
|
|
343
|
+
var msg = 'Hello ' + name;
|
|
344
|
+
var x = point.x, y = point.y;
|
|
345
|
+
for (var i = 0; i < items.length; i++) { }
|
|
346
|
+
function getData(callback) { }
|
|
347
|
+
var doubled = [];
|
|
348
|
+
for (var i = 0; i < items.length; i++) {
|
|
349
|
+
doubled.push(items[i] * 2);
|
|
350
|
+
}
|
|
351
|
+
function Widget() { }
|
|
352
|
+
var Status = { ACTIVE: 'active', INACTIVE: 'inactive' };
|
|
353
|
+
```
|
|
40
354
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
10. **servicenow-reporting-analytics** - Reports and dashboards
|
|
51
|
-
11. **servicenow-machine-learning** - ML model training
|
|
52
|
-
12. **snow-flow** - Orchestration and memory management
|
|
355
|
+
## 🎮 Command Line Interface
|
|
356
|
+
|
|
357
|
+
### Core Commands
|
|
358
|
+
```bash
|
|
359
|
+
snow-flow init # Initialize project
|
|
360
|
+
snow-flow auth login # Authenticate with ServiceNow
|
|
361
|
+
snow-flow start # Start orchestration system
|
|
362
|
+
snow-flow status # Check system status
|
|
363
|
+
```
|
|
53
364
|
|
|
54
|
-
|
|
365
|
+
### Agent Management
|
|
366
|
+
```bash
|
|
367
|
+
snow-flow agent spawn researcher # Create research agent
|
|
368
|
+
snow-flow agent spawn coder # Create coding agent
|
|
369
|
+
snow-flow agent list # List active agents
|
|
370
|
+
```
|
|
55
371
|
|
|
56
|
-
|
|
372
|
+
### Task Execution
|
|
57
373
|
```bash
|
|
58
|
-
snow-flow
|
|
374
|
+
snow-flow task create "Build user management portal"
|
|
375
|
+
snow-flow task list # View task queue
|
|
376
|
+
snow-flow task status # Check task progress
|
|
59
377
|
```
|
|
60
378
|
|
|
61
|
-
|
|
379
|
+
### SPARC Development Modes
|
|
62
380
|
```bash
|
|
63
|
-
snow-flow
|
|
381
|
+
snow-flow sparc "Create incident workflow" # Orchestrator mode
|
|
382
|
+
snow-flow sparc run coder "Generate REST API" # Specific mode
|
|
383
|
+
snow-flow sparc tdd "User authentication" # Test-driven development
|
|
384
|
+
snow-flow sparc modes # List all 17 modes
|
|
64
385
|
```
|
|
65
386
|
|
|
66
|
-
|
|
387
|
+
### Memory Management
|
|
67
388
|
```bash
|
|
68
|
-
snow-flow
|
|
389
|
+
snow-flow memory store "api_key" "sk-..." # Store data
|
|
390
|
+
snow-flow memory get "api_key" # Retrieve data
|
|
391
|
+
snow-flow memory list # List all keys
|
|
392
|
+
snow-flow memory export backup.json # Export memory
|
|
69
393
|
```
|
|
70
394
|
|
|
71
|
-
|
|
395
|
+
### Swarm Coordination
|
|
72
396
|
```bash
|
|
73
|
-
snow-flow swarm "
|
|
397
|
+
snow-flow swarm "Build complete ITSM solution" \
|
|
398
|
+
--strategy development \
|
|
399
|
+
--mode hierarchical \
|
|
400
|
+
--max-agents 10 \
|
|
401
|
+
--parallel \
|
|
402
|
+
--monitor \
|
|
403
|
+
--auto-deploy
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## 🔌 Integration with ServiceNow
|
|
407
|
+
|
|
408
|
+
### OAuth Configuration
|
|
409
|
+
1. In ServiceNow, navigate to **System OAuth > Application Registry**
|
|
410
|
+
2. Click **New** > **Create an OAuth API endpoint for external clients**
|
|
411
|
+
3. Fill in:
|
|
412
|
+
- Name: `Snow-Flow Integration`
|
|
413
|
+
- Client ID: (auto-generated)
|
|
414
|
+
- Client Secret: (set your secret)
|
|
415
|
+
- Redirect URL: `http://localhost:3000/oauth/callback`
|
|
416
|
+
4. Save and copy the Client ID and Secret
|
|
417
|
+
|
|
418
|
+
### Environment Setup
|
|
419
|
+
Create a `.env` file:
|
|
420
|
+
```env
|
|
421
|
+
SNOW_INSTANCE=your-instance.service-now.com
|
|
422
|
+
SNOW_CLIENT_ID=your-client-id
|
|
423
|
+
SNOW_CLIENT_SECRET=your-client-secret
|
|
424
|
+
SNOW_USERNAME=admin
|
|
425
|
+
SNOW_PASSWORD=your-password
|
|
74
426
|
```
|
|
75
427
|
|
|
76
|
-
|
|
428
|
+
### First Authentication
|
|
77
429
|
```bash
|
|
78
|
-
snow-flow
|
|
430
|
+
snow-flow auth login
|
|
431
|
+
# Opens browser for OAuth flow
|
|
432
|
+
# Tokens are stored securely and refreshed automatically
|
|
79
433
|
```
|
|
80
434
|
|
|
81
|
-
##
|
|
435
|
+
## 📚 Real-World Examples
|
|
82
436
|
|
|
83
|
-
|
|
437
|
+
### Example 1: Create a Complete Dashboard
|
|
438
|
+
```bash
|
|
439
|
+
snow-flow swarm "Create executive dashboard showing:
|
|
440
|
+
- Real-time incident metrics
|
|
441
|
+
- SLA performance
|
|
442
|
+
- Team workload distribution
|
|
443
|
+
- Trend analysis
|
|
444
|
+
- Automated report generation"
|
|
445
|
+
|
|
446
|
+
# Snow-Flow will create, test, and deploy everything
|
|
447
|
+
```
|
|
84
448
|
|
|
449
|
+
### Example 2: Automate Incident Management
|
|
85
450
|
```javascript
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
451
|
+
// Use Snow-Flow to create automation
|
|
452
|
+
await snow_create_business_rule({
|
|
453
|
+
name: "Auto Assign Critical Incidents",
|
|
454
|
+
table: "incident",
|
|
455
|
+
when: "before",
|
|
456
|
+
condition: "current.priority == 1",
|
|
457
|
+
script: `
|
|
458
|
+
(function executeRule(current, previous) {
|
|
459
|
+
// Get on-call engineer
|
|
460
|
+
var oncall = new GlideRecord('cmn_rota_member');
|
|
461
|
+
oncall.addQuery('rota', 'critical_response_team');
|
|
462
|
+
oncall.addQuery('active', true);
|
|
463
|
+
oncall.query();
|
|
464
|
+
|
|
465
|
+
if (oncall.next()) {
|
|
466
|
+
current.assigned_to = oncall.getValue('user');
|
|
467
|
+
gs.addInfoMessage('Critical incident assigned to on-call engineer');
|
|
468
|
+
}
|
|
469
|
+
})(current, previous);
|
|
470
|
+
`
|
|
471
|
+
});
|
|
472
|
+
```
|
|
92
473
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
474
|
+
### Example 3: Build Custom Application
|
|
475
|
+
```bash
|
|
476
|
+
# Create complete application with single command
|
|
477
|
+
snow-flow sparc tdd "Employee onboarding application with:
|
|
478
|
+
- Request form with approval workflow
|
|
479
|
+
- Automated account provisioning
|
|
480
|
+
- Task assignments to IT, HR, Facilities
|
|
481
|
+
- Progress tracking dashboard
|
|
482
|
+
- Email notifications at each step"
|
|
97
483
|
```
|
|
98
484
|
|
|
99
|
-
##
|
|
485
|
+
## 🛠️ Advanced Features
|
|
100
486
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
487
|
+
### Batch API Operations
|
|
488
|
+
Reduce API calls by 80% with intelligent batching:
|
|
489
|
+
```javascript
|
|
490
|
+
const results = await snow_batch_api({
|
|
491
|
+
operations: [
|
|
492
|
+
{ action: 'query', table: 'incident', query: 'active=true' },
|
|
493
|
+
{ action: 'query', table: 'problem', query: 'active=true' },
|
|
494
|
+
{ action: 'query', table: 'change_request', query: 'state=implement' }
|
|
495
|
+
],
|
|
496
|
+
parallel: true
|
|
497
|
+
});
|
|
498
|
+
```
|
|
105
499
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
500
|
+
### Process Mining
|
|
501
|
+
Discover actual vs designed processes:
|
|
502
|
+
```javascript
|
|
503
|
+
const process = await snow_discover_process({
|
|
504
|
+
table: 'incident',
|
|
505
|
+
start_field: 'sys_created_on',
|
|
506
|
+
end_field: 'resolved_at',
|
|
507
|
+
state_field: 'state',
|
|
508
|
+
analyze_variants: true
|
|
509
|
+
});
|
|
510
|
+
// Returns process flow, bottlenecks, and optimization opportunities
|
|
511
|
+
```
|
|
110
512
|
|
|
111
|
-
|
|
513
|
+
### Predictive Analytics
|
|
514
|
+
```javascript
|
|
515
|
+
const forecast = await snow_forecast_incidents({
|
|
516
|
+
historical_days: 90,
|
|
517
|
+
forecast_days: 30,
|
|
518
|
+
factors: ['day_of_week', 'category', 'priority'],
|
|
519
|
+
confidence_interval: 0.95
|
|
520
|
+
});
|
|
521
|
+
```
|
|
112
522
|
|
|
113
|
-
|
|
114
|
-
1. Configure OAuth provider in ServiceNow
|
|
115
|
-
2. Set client credentials in .env
|
|
116
|
-
3. Snow-Flow handles token refresh automatically
|
|
523
|
+
## 🏗️ Architecture
|
|
117
524
|
|
|
118
|
-
|
|
525
|
+
Snow-Flow is built with:
|
|
526
|
+
- **TypeScript** - Type-safe development
|
|
527
|
+
- **Node.js 18+** - Modern JavaScript runtime
|
|
528
|
+
- **MCP (Model Context Protocol)** - Standardized AI-tool communication
|
|
529
|
+
- **TensorFlow.js** - Machine learning capabilities
|
|
530
|
+
- **OAuth 2.0** - Secure authentication
|
|
531
|
+
- **WebSocket** - Real-time communication
|
|
119
532
|
|
|
533
|
+
### Directory Structure
|
|
120
534
|
```
|
|
121
535
|
snow-flow/
|
|
122
536
|
├── src/
|
|
123
|
-
│ ├── mcp/
|
|
124
|
-
│ ├──
|
|
125
|
-
│
|
|
126
|
-
│
|
|
127
|
-
├──
|
|
128
|
-
|
|
537
|
+
│ ├── mcp/ # 16+ MCP server implementations
|
|
538
|
+
│ │ ├── servicenow-*.ts # Individual MCP servers
|
|
539
|
+
│ │ └── shared/ # Shared utilities
|
|
540
|
+
│ ├── agents/ # AI agent implementations
|
|
541
|
+
│ ├── queen/ # Orchestration system
|
|
542
|
+
│ ├── utils/ # Utilities and helpers
|
|
543
|
+
│ └── types/ # TypeScript definitions
|
|
544
|
+
├── website/ # Documentation website
|
|
545
|
+
├── memory/ # Persistent storage
|
|
546
|
+
└── dist/ # Compiled output
|
|
129
547
|
```
|
|
130
548
|
|
|
131
|
-
##
|
|
549
|
+
## 🔍 Debugging & Troubleshooting
|
|
550
|
+
|
|
551
|
+
### Enable Debug Mode
|
|
552
|
+
```bash
|
|
553
|
+
export SNOW_FLOW_DEBUG=true
|
|
554
|
+
snow-flow start --verbose
|
|
555
|
+
```
|
|
132
556
|
|
|
133
|
-
|
|
134
|
-
- Automatic retry on network failures
|
|
135
|
-
- Token refresh on authentication errors
|
|
136
|
-
- Timeout protection (5 seconds default)
|
|
137
|
-
- Error logging with context
|
|
557
|
+
### Common Issues
|
|
138
558
|
|
|
139
|
-
|
|
559
|
+
**Issue**: "ES6 syntax error in ServiceNow"
|
|
560
|
+
```bash
|
|
561
|
+
# Snow-Flow automatically converts to ES5, but you can test:
|
|
562
|
+
snow-flow validate-es5 myScript.js
|
|
563
|
+
```
|
|
140
564
|
|
|
141
|
-
|
|
565
|
+
**Issue**: "Widget not working"
|
|
142
566
|
```bash
|
|
143
|
-
|
|
567
|
+
# Validate widget coherence:
|
|
568
|
+
snow-flow validate-widget myWidget.js
|
|
144
569
|
```
|
|
145
570
|
|
|
146
|
-
|
|
571
|
+
**Issue**: "Authentication failed"
|
|
147
572
|
```bash
|
|
148
|
-
|
|
573
|
+
# Refresh OAuth token:
|
|
574
|
+
snow-flow auth refresh
|
|
149
575
|
```
|
|
150
576
|
|
|
151
|
-
##
|
|
577
|
+
## 📈 Performance
|
|
578
|
+
|
|
579
|
+
Snow-Flow optimizations:
|
|
580
|
+
- **80% API call reduction** through intelligent batching
|
|
581
|
+
- **5-second timeout protection** on all operations
|
|
582
|
+
- **Automatic retry** with exponential backoff
|
|
583
|
+
- **Connection pooling** for optimal performance
|
|
584
|
+
- **Parallel execution** where possible
|
|
585
|
+
- **Smart caching** of frequently accessed data
|
|
586
|
+
|
|
587
|
+
## 🤝 Contributing
|
|
588
|
+
|
|
589
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
152
590
|
|
|
153
|
-
|
|
591
|
+
### Development Setup
|
|
154
592
|
```bash
|
|
593
|
+
git clone https://github.com/groeimetai/snow-flow.git
|
|
594
|
+
cd snow-flow
|
|
595
|
+
npm install
|
|
155
596
|
npm run build
|
|
597
|
+
npm link # Use local version globally
|
|
156
598
|
```
|
|
157
599
|
|
|
158
|
-
|
|
600
|
+
### Running Tests
|
|
601
|
+
```bash
|
|
602
|
+
npm test # Run all tests
|
|
603
|
+
npm run test:unit # Unit tests only
|
|
604
|
+
npm run test:integration # Integration tests
|
|
605
|
+
npm run typecheck # TypeScript validation
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
## 📝 Documentation
|
|
609
|
+
|
|
610
|
+
- **Website**: [Coming Soon - snow-flow.dev]
|
|
611
|
+
- **API Docs**: See `/website/docs/api-full.html`
|
|
612
|
+
- **Examples**: Check `/examples` directory
|
|
613
|
+
- **CLAUDE.md**: Detailed configuration guide
|
|
614
|
+
|
|
615
|
+
## 🎯 Roadmap
|
|
616
|
+
|
|
617
|
+
### Coming Soon
|
|
618
|
+
- [ ] Visual Studio Code extension
|
|
619
|
+
- [ ] Web-based dashboard
|
|
620
|
+
- [ ] GitHub Actions integration
|
|
621
|
+
- [ ] Terraform provider for ServiceNow
|
|
622
|
+
- [ ] GraphQL API support
|
|
623
|
+
- [ ] Real-time collaboration features
|
|
624
|
+
|
|
625
|
+
### In Progress
|
|
626
|
+
- [x] Widget coherence validation
|
|
627
|
+
- [x] ES5 automatic conversion
|
|
628
|
+
- [x] Full output capture for scripts
|
|
629
|
+
- [x] Machine learning integration
|
|
630
|
+
- [ ] Visual workflow designer
|
|
631
|
+
- [ ] Performance profiler
|
|
632
|
+
|
|
633
|
+
## 💬 Support
|
|
634
|
+
|
|
635
|
+
- **GitHub Issues**: [Report bugs or request features](https://github.com/groeimetai/snow-flow/issues)
|
|
636
|
+
- **Discussions**: [Ask questions and share ideas](https://github.com/groeimetai/snow-flow/discussions)
|
|
637
|
+
- **Email**: snow-flow@example.com
|
|
638
|
+
|
|
639
|
+
## ⭐ Why Snow-Flow?
|
|
640
|
+
|
|
641
|
+
1. **It Actually Understands ServiceNow** - Not just another generic tool
|
|
642
|
+
2. **Real Data, Real Results** - No mock data, ever
|
|
643
|
+
3. **ES5 Compliance Built-In** - Never worry about syntax errors again
|
|
644
|
+
4. **Intelligent Automation** - AI that knows ServiceNow best practices
|
|
645
|
+
5. **Complete Toolchain** - Everything from development to deployment
|
|
646
|
+
6. **Active Development** - Regular updates and new features
|
|
647
|
+
7. **Open Source** - MIT licensed, free forever
|
|
648
|
+
|
|
649
|
+
## 📄 License
|
|
650
|
+
|
|
651
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
652
|
+
|
|
653
|
+
## 🙏 Acknowledgments
|
|
654
|
+
|
|
655
|
+
Special thanks to:
|
|
656
|
+
- The ServiceNow developer community
|
|
657
|
+
- Anthropic for Claude AI
|
|
658
|
+
- Contributors and early adopters
|
|
659
|
+
- Everyone who reported bugs and suggested features
|
|
159
660
|
|
|
160
|
-
|
|
661
|
+
---
|
|
161
662
|
|
|
162
|
-
|
|
663
|
+
**Built with ❤️ for ServiceNow developers by developers who understand the struggle.**
|
|
163
664
|
|
|
164
|
-
|
|
665
|
+
*Snow-Flow - Where ServiceNow development meets artificial intelligence.* 🏔️❄️
|