snow-flow 2.10.0 → 3.0.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.
Files changed (64) hide show
  1. package/.mcp.json +13 -141
  2. package/.mcp.json.template +11 -25
  3. package/README.md +18 -0
  4. package/claude-flow +81 -0
  5. package/claude-flow.bat +18 -0
  6. package/claude-flow.config.json +20 -0
  7. package/claude-flow.ps1 +24 -0
  8. package/dist/agents/index.d.ts +3 -10
  9. package/dist/agents/index.js +10 -50
  10. package/dist/agents/queen-agent.d.ts +0 -2
  11. package/dist/agents/queen-agent.js +25 -42
  12. package/dist/cli.js +1 -1
  13. package/dist/mcp/servicenow-automation-mcp.js +10 -10
  14. package/dist/mcp/servicenow-deployment-mcp.js +1050 -169
  15. package/dist/mcp/servicenow-development-assistant-mcp.js +13 -65
  16. package/dist/mcp/servicenow-integration-mcp.js +10 -10
  17. package/dist/mcp/servicenow-machine-learning-mcp.js +15 -15
  18. package/dist/mcp/servicenow-operations-mcp.js +23 -23
  19. package/dist/mcp/servicenow-platform-development-mcp.js +9 -9
  20. package/dist/mcp/servicenow-reporting-analytics-mcp.js +11 -11
  21. package/dist/mcp/servicenow-security-compliance-mcp.js +11 -11
  22. package/dist/mcp/servicenow-update-set-mcp.js +9 -9
  23. package/dist/mcp/shared/reliable-memory-manager.d.ts +78 -0
  24. package/dist/mcp/shared/reliable-memory-manager.js +268 -0
  25. package/dist/mcp/snow-flow-mcp.js +341 -87
  26. package/dist/queen/agent-factory.d.ts +4 -2
  27. package/dist/queen/agent-factory.js +72 -25
  28. package/dist/services/tensorflow-ml-service.d.ts +105 -0
  29. package/dist/services/tensorflow-ml-service.js +456 -0
  30. package/dist/services/widget-deployment-service.d.ts +107 -0
  31. package/dist/services/widget-deployment-service.js +332 -0
  32. package/dist/utils/file-storage-fallback.d.ts +62 -0
  33. package/dist/utils/file-storage-fallback.js +289 -0
  34. package/dist/utils/mcp-server-manager.js +4 -7
  35. package/dist/utils/mcp-singleton-enforcer.d.ts +7 -1
  36. package/dist/utils/mcp-singleton-enforcer.js +28 -4
  37. package/dist/utils/mcp-timeout-fix.d.ts +10 -1
  38. package/dist/utils/mcp-timeout-fix.js +80 -6
  39. package/memory/agents/README.md +31 -0
  40. package/memory/claude-flow-data.json +1 -1
  41. package/memory/sessions/README.md +1 -1
  42. package/package.json +4 -2
  43. package/src/agents/README.md +192 -0
  44. package/src/health/README.md +161 -0
  45. package/src/memory/README.md +240 -0
  46. package/src/queen/README.md +403 -0
  47. package/src/schemas/deployment.schema.json +58 -0
  48. package/src/schemas/flow.schema.json +79 -0
  49. package/src/schemas/widget.schema.json +72 -0
  50. package/src/templates/base/application.template.json +45 -0
  51. package/src/templates/base/business_rule.template.json +33 -0
  52. package/src/templates/base/script_include.template.json +18 -0
  53. package/src/templates/base/table.template.json +64 -0
  54. package/src/templates/base/widget.template.json +25 -0
  55. package/src/templates/patterns/composite.incident-management.template.json +140 -0
  56. package/src/templates/patterns/widget.dashboard.template.json +238 -0
  57. package/src/templates/patterns/widget.datatable.template.json +292 -0
  58. package/dist/mcp/servicenow-graph-memory-mcp.js +0 -728
  59. package/servicenow/widgets/openai_incident_classifier/client_controller.js +0 -284
  60. package/servicenow/widgets/openai_incident_classifier/server_script.js +0 -314
  61. package/servicenow/widgets/openai_incident_classifier/style.css +0 -354
  62. package/servicenow/widgets/openai_incident_classifier/template.html +0 -167
  63. package/servicenow/widgets/openai_incident_classifier/widget.json +0 -86
  64. package/test-ml-improvements.sh +0 -76
@@ -0,0 +1,240 @@
1
+ # Snow-Flow Memory System
2
+
3
+ The Snow-Flow memory system provides SQLite-based persistent storage for agent coordination, artifact tracking, and performance monitoring. It's designed to meet the requirements specified in MCP_ARCHITECTURE.md with fast queries (<100ms), thread-safe operations, and automatic schema migration.
4
+
5
+ ## Architecture
6
+
7
+ The memory system consists of three main components:
8
+
9
+ ### 1. SwarmMemory (`swarm-memory.ts`)
10
+ - Core SQLite database management
11
+ - Schema creation and migration
12
+ - Performance optimization
13
+ - Thread-safe operations with WAL mode
14
+
15
+ ### 2. MemoryOperations (`memory-operations.ts`)
16
+ - High-level operations for data storage/retrieval
17
+ - Agent coordination management
18
+ - Artifact tracking
19
+ - Performance monitoring
20
+ - Message passing between agents
21
+
22
+ ### 3. MemoryClient (`memory-client.ts`)
23
+ - Simple API for agents
24
+ - Automatic session tracking
25
+ - Performance tracking helpers
26
+ - Simplified context storage
27
+
28
+ ## Database Schema
29
+
30
+ The system implements all tables specified in MCP_ARCHITECTURE.md:
31
+
32
+ - **agent_coordination**: Track agent status and progress
33
+ - **servicenow_artifacts**: Store created artifacts
34
+ - **agent_messages**: Inter-agent communication
35
+ - **shared_context**: Session-wide shared data
36
+ - **deployment_history**: Track deployments
37
+ - **agent_dependencies**: Manage agent dependencies
38
+ - **performance_metrics**: Performance monitoring
39
+
40
+ ## Usage
41
+
42
+ ### Basic Agent Usage
43
+
44
+ ```typescript
45
+ import { MemoryClient } from './memory/index.js';
46
+
47
+ // Create a memory client for an agent
48
+ const memory = MemoryClient.forAgent(
49
+ 'widget_creator_001', // agent ID
50
+ 'widget-creator', // agent type
51
+ 'session_123' // session ID
52
+ );
53
+
54
+ // Register the agent
55
+ await memory.register(['create_dashboard_widget']);
56
+
57
+ // Update progress
58
+ await memory.updateProgress(50, 'creating_template');
59
+
60
+ // Store shared data
61
+ await memory.store({
62
+ key: 'widget_config',
63
+ value: {
64
+ name: 'incident_dashboard',
65
+ features: ['charts', 'filters']
66
+ }
67
+ });
68
+
69
+ // Retrieve shared data
70
+ const config = await memory.retrieve({ key: 'widget_config' });
71
+
72
+ // Track performance
73
+ const tracker = memory.trackOperation('widget_creation');
74
+ // ... do work ...
75
+ await tracker.complete(true);
76
+
77
+ // Mark as completed
78
+ await memory.complete();
79
+ ```
80
+
81
+ ### Artifact Management
82
+
83
+ ```typescript
84
+ // Store artifact information
85
+ await memory.storeArtifact({
86
+ sys_id: 'widget_12345',
87
+ type: 'widget',
88
+ name: 'Incident Dashboard',
89
+ status: 'created',
90
+ metadata: { version: '1.0' }
91
+ });
92
+
93
+ // Update artifact status
94
+ await memory.updateArtifactStatus('widget_12345', 'deployed');
95
+
96
+ // Find artifacts
97
+ const widgets = await memory.findSessionArtifacts('widget');
98
+ ```
99
+
100
+ ### Agent Communication
101
+
102
+ ```typescript
103
+ // Send handoff to another agent
104
+ await memory.handoff({
105
+ to_agent: 'ui_specialist_001',
106
+ artifact_reference: 'widget_12345',
107
+ data: {
108
+ template_ready: true,
109
+ next_steps: ['add_styling', 'test_responsiveness']
110
+ }
111
+ });
112
+
113
+ // Check for incoming handoffs
114
+ const handoffs = await memory.checkHandoffs();
115
+ for (const handoff of handoffs) {
116
+ console.log(`Received from ${handoff.from}:`, handoff.data);
117
+ }
118
+
119
+ // Report dependency ready
120
+ await memory.reportDependencyReady('test_agent_001', 'widget_12345');
121
+ ```
122
+
123
+ ### Performance Monitoring
124
+
125
+ ```typescript
126
+ // Track operation performance
127
+ const tracker = memory.trackOperation('api_call');
128
+ try {
129
+ // ... perform operation ...
130
+ await tracker.complete(true, undefined, {
131
+ response_time: 150,
132
+ records_processed: 100
133
+ });
134
+ } catch (error) {
135
+ await tracker.complete(false, error.message);
136
+ }
137
+
138
+ // Get performance statistics
139
+ const stats = await memory.getPerformanceStats('api_call');
140
+ console.log(`Average duration: ${stats.avgDuration}ms`);
141
+ console.log(`Success rate: ${stats.successRate * 100}%`);
142
+ ```
143
+
144
+ ### Session Management
145
+
146
+ ```typescript
147
+ // Get complete session state
148
+ const state = await memory.getSessionState();
149
+ console.log('Active agents:', state.agents);
150
+ console.log('Created artifacts:', state.artifacts);
151
+ console.log('Performance summary:', state.performanceSummary);
152
+
153
+ // Clean up session when done
154
+ await memory.cleanup();
155
+ ```
156
+
157
+ ## Advanced Usage
158
+
159
+ ### Direct Database Access
160
+
161
+ For custom queries, you can access the underlying database:
162
+
163
+ ```typescript
164
+ const db = memory.getDatabase();
165
+ const results = db.all(`
166
+ SELECT * FROM servicenow_artifacts
167
+ WHERE deployment_status = 'failed'
168
+ ORDER BY updated_at DESC
169
+ `);
170
+ ```
171
+
172
+ ### Custom Operations
173
+
174
+ Access the operations layer for advanced functionality:
175
+
176
+ ```typescript
177
+ const ops = memory.getOperations();
178
+
179
+ // Search messages with custom criteria
180
+ const messages = await ops.searchMessages({
181
+ message_type: 'error',
182
+ processed: false,
183
+ limit: 10
184
+ });
185
+
186
+ // Get deployment history
187
+ const history = await ops.getDeploymentHistory('artifact_123');
188
+ ```
189
+
190
+ ## Performance Optimization
191
+
192
+ The memory system is optimized for performance:
193
+
194
+ 1. **WAL Mode**: Enables concurrent reads
195
+ 2. **Indexes**: Fast queries on common fields
196
+ 3. **Prepared Statements**: Reusable query plans
197
+ 4. **Connection Pooling**: Single shared instance
198
+ 5. **Batch Operations**: Transaction support
199
+
200
+ ## Best Practices
201
+
202
+ 1. **Always register agents** before performing operations
203
+ 2. **Use transactions** for multiple related operations
204
+ 3. **Clean up sessions** when work is complete
205
+ 4. **Track performance** for critical operations
206
+ 5. **Store minimal data** in shared context
207
+ 6. **Use appropriate expiration** for temporary data
208
+ 7. **Handle errors gracefully** with try-catch blocks
209
+
210
+ ## Testing
211
+
212
+ Run the test suite to verify functionality:
213
+
214
+ ```bash
215
+ npm run test:memory
216
+ # or
217
+ node dist/memory/memory-test.js
218
+ ```
219
+
220
+ ## Monitoring
221
+
222
+ Check memory statistics:
223
+
224
+ ```typescript
225
+ const stats = memory.getStats();
226
+ console.log('Database statistics:', stats);
227
+
228
+ // Run cleanup for old data
229
+ await memory.runCleanup();
230
+ ```
231
+
232
+ ## Shutdown
233
+
234
+ Always shutdown the memory system when done:
235
+
236
+ ```typescript
237
+ MemoryClient.shutdown();
238
+ ```
239
+
240
+ This ensures all connections are properly closed and data is flushed to disk.
@@ -0,0 +1,403 @@
1
+ # ServiceNow Queen Agent 🐝
2
+
3
+ > **Hive-Mind Intelligence for ServiceNow Development**
4
+ >
5
+ > A single coordination point that spawns specialized agents dynamically, learns from deployments, and orchestrates complex ServiceNow tasks with elegance through simplicity.
6
+
7
+ ## ⚠️ IMPORTANT: Flow Creation Removed in v1.4.38 ⚠️
8
+
9
+ **Note**: All flow-related functionality has been permanently removed from Snow-Flow. Please use ServiceNow's native Flow Designer interface directly for flow creation. All other agent types and functionality continue to work normally.
10
+
11
+ ## Philosophy: Claude-Flow Principles
12
+
13
+ The ServiceNow Queen Agent follows snow-flow philosophy:
14
+
15
+ - **🎯 Single Coordination Point**: All tasks go through the Queen
16
+ - **⚡ Dynamic Agent Spawning**: Creates agents based on task needs, not pre-defined teams
17
+ - **🧠 Hive-Mind Intelligence**: Coordinates multiple agents seamlessly with shared memory
18
+ - **💾 Simple Memory**: Uses SQLite for persistent learning across sessions
19
+ - **📚 Neural Learning**: Learns from past deployments and adapts patterns
20
+
21
+ ## Architecture
22
+
23
+ ```
24
+ ServiceNow Queen Agent
25
+ ├── 🐝 ServiceNowQueen (Main Coordinator)
26
+ ├── 🏭 AgentFactory (Dynamic Agent Spawning)
27
+ ├── 💾 QueenMemorySystem (SQLite Persistence)
28
+ ├── 🧠 NeuralLearning (Pattern Recognition)
29
+ └── 🔧 Agent Types (8 Specialized Agents)
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ ```typescript
35
+ import { createServiceNowQueen } from './queen';
36
+
37
+ // Create Queen with hive-mind intelligence
38
+ const queen = createServiceNowQueen({
39
+ debugMode: true,
40
+ maxConcurrentAgents: 5
41
+ });
42
+
43
+ // Execute any ServiceNow objective - Queen handles everything
44
+ const result = await queen.executeObjective(
45
+ "create incident dashboard with real-time charts and mobile responsiveness"
46
+ );
47
+
48
+ console.log('✅ Deployment completed:', result);
49
+ ```
50
+
51
+ ## Core Components
52
+
53
+ ### 1. ServiceNow Queen (Main Coordinator)
54
+
55
+ The central intelligence that:
56
+ - Analyzes objectives using neural learning
57
+ - Spawns optimal agent swarms dynamically
58
+ - Coordinates execution with MCP tools
59
+ - Learns from success/failure patterns
60
+
61
+ ```typescript
62
+ const queen = new ServiceNowQueen({
63
+ memoryPath: './.snow-flow/queen-memory.db',
64
+ maxConcurrentAgents: 8,
65
+ learningRate: 0.1,
66
+ debugMode: true
67
+ });
68
+
69
+ // One command does everything
70
+ await queen.executeObjective("create incident dashboard widget with real-time updates");
71
+ ```
72
+
73
+ ### 2. Dynamic Agent Factory
74
+
75
+ Spawns specialized agents on-demand based on task analysis:
76
+
77
+ ```typescript
78
+ // 8 Available Agent Types
79
+ - widget-creator → HTML, CSS, JS, ServiceNow widgets
80
+ - script-writer → Business rules, script includes, client scripts
81
+ - app-architect → System design, table structures, modules
82
+ - integration-specialist → APIs, data sync, external systems
83
+ - catalog-manager → Service catalog, request items, variables
84
+ - researcher → Analysis, discovery, best practices
85
+ - tester → Quality assurance, mock testing, validation
86
+ ```
87
+
88
+ ### 3. Persistent Memory System
89
+
90
+ Simple SQLite-based learning that persists across sessions:
91
+
92
+ ```sql
93
+ -- Stores successful deployment patterns
94
+ CREATE TABLE patterns (
95
+ task_type TEXT,
96
+ success_rate REAL,
97
+ agent_sequence TEXT,
98
+ avg_duration INTEGER
99
+ );
100
+
101
+ -- Remembers created artifacts
102
+ CREATE TABLE artifacts (
103
+ type TEXT,
104
+ name TEXT,
105
+ sys_id TEXT,
106
+ dependencies TEXT
107
+ );
108
+
109
+ -- Learns from experiences
110
+ CREATE TABLE learnings (
111
+ key TEXT,
112
+ value TEXT,
113
+ confidence REAL
114
+ );
115
+ ```
116
+
117
+ ### 4. Neural Learning Engine
118
+
119
+ Pattern recognition that improves over time:
120
+
121
+ - **Task Classification**: Widget vs Script vs Application
122
+ - **Complexity Estimation**: Based on keyword analysis and learned weights
123
+ - **Agent Selection**: Optimal sequence based on successful patterns
124
+ - **Success/Failure Learning**: Adjusts confidence weights dynamically
125
+
126
+ ## Execution Flow
127
+
128
+ ```mermaid
129
+ graph TD
130
+ A[Objective Input] --> B[Neural Analysis]
131
+ B --> C[Task Classification]
132
+ C --> D[Complexity Estimation]
133
+ D --> E[Agent Spawning]
134
+ E --> F[Swarm Coordination]
135
+ F --> G[MCP Tool Execution]
136
+ G --> H[Deployment Result]
137
+ H --> I[Pattern Learning]
138
+ I --> J[Memory Storage]
139
+ ```
140
+
141
+ ## Usage Examples
142
+
143
+ ### Simple Widget Creation
144
+
145
+ ```typescript
146
+ await queen.executeObjective("create incident dashboard");
147
+
148
+ // Queen automatically:
149
+ // 1. Classifies as 'widget' task
150
+ // 2. Spawns: widget-creator → tester
151
+ // 3. Generates HTML, CSS, JS code
152
+ // 4. Deploys using snow_deploy MCP tool
153
+ // 5. Learns from success for future widget tasks
154
+ ```
155
+
156
+ ### Complex Widget with Integration
157
+
158
+ ```typescript
159
+ await queen.executeObjective(
160
+ "create equipment request dashboard with external API integration"
161
+ );
162
+
163
+ // Queen automatically:
164
+ // 1. Classifies as 'widget' task (high complexity)
165
+ // 2. Spawns: researcher → widget-creator → integration-specialist → tester
166
+ // 3. Coordinates sequential execution with agent communication
167
+ // 4. Uses snow_deploy + snow_create_rest_message
168
+ // 5. Learns optimal agent sequence for similar future tasks
169
+ ```
170
+
171
+ ### Application Development
172
+
173
+ ```typescript
174
+ await queen.executeObjective(
175
+ "build complete ITSM solution with custom tables and workflows"
176
+ );
177
+
178
+ // Queen automatically:
179
+ // 1. Classifies as 'application' task (very high complexity)
180
+ // 2. Spawns: researcher → app-architect → script-writer → widget-creator → tester
181
+ // 3. Coordinates with shared memory between agents
182
+ // 4. Uses multiple MCP tools in optimal sequence
183
+ // 5. Stores deployment pattern for future application tasks
184
+ ```
185
+
186
+ ## Learning & Adaptation
187
+
188
+ The Queen learns from every deployment:
189
+
190
+ ### Success Patterns
191
+ ```typescript
192
+ // Queen remembers successful patterns
193
+ {
194
+ taskType: 'widget',
195
+ successRate: 0.92,
196
+ agentSequence: ['widget-creator', 'tester'],
197
+ avgDuration: 45000,
198
+ mcpSequence: ['snow_deploy', 'snow_widget_test']
199
+ }
200
+ ```
201
+
202
+ ### Failure Recovery
203
+ ```typescript
204
+ // Queen learns from failures and adapts
205
+ queen.learnFromFailure(task, 'Permission denied', ['widget-creator']);
206
+ // Next time: adds 'researcher' to check permissions first
207
+ ```
208
+
209
+ ### Neural Weight Adjustment
210
+ ```typescript
211
+ // Adjusts confidence in complexity factors
212
+ {
213
+ factor: 'chart_integration',
214
+ weight: 0.3,
215
+ confidence: 0.9 // High confidence after successful chart deployments
216
+ }
217
+ ```
218
+
219
+ ## Agent Coordination
220
+
221
+ ### Parallel Execution
222
+ Independent agents (researcher, tester, script-writer) run simultaneously:
223
+
224
+ ```typescript
225
+ // Parallel execution for speed
226
+ const results = await Promise.all([
227
+ researcherAgent.execute(),
228
+ testerAgent.execute(),
229
+ scriptAgent.execute()
230
+ ]);
231
+ ```
232
+
233
+ ### Sequential Coordination
234
+ Dependent agents execute in optimal sequence:
235
+
236
+ ```typescript
237
+ // Sequential with shared context
238
+ researcher → widget-creator → tester
239
+ // ↓ shares findings ↓
240
+ // widget-creator uses research
241
+ // ↓ receives widget
242
+ // tester validates
243
+ ```
244
+
245
+ ### Message Passing
246
+ Agents communicate through the Queen:
247
+
248
+ ```typescript
249
+ // Agent coordination
250
+ this.agentFactory.sendAgentMessage(
251
+ fromAgent: 'researcher',
252
+ toAgent: 'widget-creator',
253
+ type: 'result',
254
+ content: { findings: '...', recommendations: '...' }
255
+ );
256
+ ```
257
+
258
+ ## Memory Management
259
+
260
+ ### Artifact Tracking
261
+ ```typescript
262
+ // Stores all created artifacts
263
+ queen.memory.storeArtifact({
264
+ type: 'widget',
265
+ name: 'incident_dashboard_widget',
266
+ sys_id: 'abc123...',
267
+ config: { /* widget config */ },
268
+ dependencies: ['Chart.js library']
269
+ });
270
+ ```
271
+
272
+ ### Pattern Reuse
273
+ ```typescript
274
+ // Reuses successful patterns
275
+ const bestPattern = queen.memory.getBestPattern('widget');
276
+ if (bestPattern.successRate > 0.8) {
277
+ // Use proven agent sequence
278
+ agents = spawnAgents(bestPattern.agentSequence);
279
+ }
280
+ ```
281
+
282
+ ### Cross-Session Learning
283
+ ```typescript
284
+ // Persistent learning across sessions
285
+ queen.memory.storeLearning(
286
+ 'widget_chart_integration',
287
+ 'Always include Chart.js for dashboard widgets',
288
+ confidence: 0.95
289
+ );
290
+ ```
291
+
292
+ ## Status & Monitoring
293
+
294
+ ```typescript
295
+ // Real-time hive-mind status
296
+ const status = queen.getHiveMindStatus();
297
+ console.log(status);
298
+ /*
299
+ {
300
+ activeTasks: 2,
301
+ activeAgents: 5,
302
+ memoryStats: {
303
+ patterns: 24,
304
+ artifacts: 156,
305
+ learnings: 89
306
+ },
307
+ factoryStats: {
308
+ totalActiveAgents: 5,
309
+ agentTypeCounts: { 'widget-creator': 2, 'tester': 1 }
310
+ }
311
+ }
312
+ */
313
+ ```
314
+
315
+ ## Integration with Existing MCP Tools
316
+
317
+ The Queen uses existing MCP servers as "tools" for agents:
318
+
319
+ ```typescript
320
+ // Widget agents use these MCP tools:
321
+ - snow_deploy (unified deployment)
322
+ - snow_preview_widget
323
+ - snow_widget_test
324
+
325
+ // Script agents use these MCP tools:
326
+ - snow_create_script_include
327
+ - snow_create_business_rule
328
+ - snow_create_client_script
329
+
330
+ // All agents coordinate through Queen
331
+ ```
332
+
333
+ ## Advantages Over Team System
334
+
335
+ | Old Team System | New Queen System |
336
+ |-----------------|------------------|
337
+ | 🐌 Pre-defined teams | ⚡ Dynamic agent spawning |
338
+ | 🔧 Fixed capabilities | 🎯 Task-optimized agents |
339
+ | 📋 Manual coordination | 🤖 Autonomous hive-mind |
340
+ | 💾 No learning | 🧠 Continuous adaptation |
341
+ | 🔄 Complex orchestration | ✨ Elegant simplicity |
342
+
343
+ ## Configuration
344
+
345
+ ```typescript
346
+ const queen = new ServiceNowQueen({
347
+ // Memory persistence
348
+ memoryPath: './.snow-flow/queen/memory.db',
349
+
350
+ // Agent management
351
+ maxConcurrentAgents: 8,
352
+
353
+ // Learning parameters
354
+ learningRate: 0.1,
355
+
356
+ // Development mode
357
+ debugMode: process.env.NODE_ENV === 'development'
358
+ });
359
+ ```
360
+
361
+ ## Export & Backup
362
+
363
+ ```typescript
364
+ // Export all learned patterns and memories
365
+ const backup = queen.exportMemory();
366
+ fs.writeFileSync('queen-backup.json', backup);
367
+
368
+ // Queen automatically creates SQLite backups
369
+ // .snow-flow/queen/memory.db
370
+ ```
371
+
372
+ ## Philosophy in Action
373
+
374
+ The Queen embodies **snow-flow principles**:
375
+
376
+ ### 1. Elegance through Simplicity
377
+ - **One entry point**: `queen.executeObjective()`
378
+ - **No complex configuration**: Works out of the box
379
+ - **Natural language**: "create incident dashboard" → complete deployment
380
+
381
+ ### 2. Intelligence through Learning
382
+ - **Remembers what works**: Successful patterns are reused
383
+ - **Adapts to failures**: Learns from errors and adjusts
384
+ - **Improves over time**: Gets better with each deployment
385
+
386
+ ### 3. Coordination through Simplicity
387
+ - **No manual orchestration**: Agents coordinate automatically
388
+ - **Clear responsibilities**: Each agent type has focused capabilities
389
+ - **Simple communication**: Message passing through Queen
390
+
391
+ ## Future Evolution
392
+
393
+ The Queen will evolve while maintaining simplicity:
394
+
395
+ - **🔌 MCP Tool Integration**: Deeper integration with all ServiceNow MCPs
396
+ - **🎯 Specialized Agents**: New agent types for specific ServiceNow domains
397
+ - **🧠 Advanced Learning**: More sophisticated pattern recognition
398
+ - **⚡ Performance Optimization**: Faster agent spawning and coordination
399
+ - **🔐 Security Integration**: Security-aware deployment patterns
400
+
401
+ ---
402
+
403
+ *Built with ❤️ following snow-flow philosophy: Elegance through simplicity, intelligence through learning.*
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ServiceNow Deployment Configuration Schema",
4
+ "description": "Schema for validating ServiceNow artifact deployment configurations",
5
+ "type": "object",
6
+ "required": ["type"],
7
+ "properties": {
8
+ "type": {
9
+ "type": "string",
10
+ "enum": ["widget", "flow", "application", "script", "business_rule", "table"],
11
+ "description": "Type of artifact to deploy"
12
+ },
13
+ "config": {
14
+ "type": "object",
15
+ "description": "Artifact configuration (varies by type)"
16
+ },
17
+ "auto_update_set": {
18
+ "type": "boolean",
19
+ "default": true,
20
+ "description": "Automatically ensure active Update Set session"
21
+ },
22
+ "deployment_context": {
23
+ "type": "string",
24
+ "description": "Context for Update Set naming"
25
+ },
26
+ "fallback_strategy": {
27
+ "type": "string",
28
+ "enum": ["manual_steps", "update_set_only", "none"],
29
+ "default": "manual_steps",
30
+ "description": "Strategy when direct deployment fails"
31
+ },
32
+ "permission_escalation": {
33
+ "type": "string",
34
+ "enum": ["auto_request", "manual", "none"],
35
+ "default": "auto_request",
36
+ "description": "How to handle permission errors"
37
+ },
38
+ "scope_preference": {
39
+ "type": "string",
40
+ "enum": ["global", "application", "auto"],
41
+ "default": "auto",
42
+ "description": "Preferred deployment scope"
43
+ },
44
+ "validation_level": {
45
+ "type": "string",
46
+ "enum": ["basic", "standard", "comprehensive"],
47
+ "default": "standard",
48
+ "description": "Level of validation to perform"
49
+ },
50
+ "environment": {
51
+ "type": "string",
52
+ "enum": ["development", "testing", "production"],
53
+ "default": "development",
54
+ "description": "Target deployment environment"
55
+ }
56
+ },
57
+ "additionalProperties": false
58
+ }