snow-flow 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.claude/mcp-config.json → .mcp.json} +13 -12
- package/.releaserc.json +47 -0
- package/README.md +6 -0
- package/package.json +1 -1
- package/.claude/claude-settings.json +0 -15
- package/.claude/commands/analysis/README.md +0 -9
- package/.claude/commands/automation/README.md +0 -9
- package/.claude/commands/github/README.md +0 -11
- package/.claude/commands/helpers/standard-checkpoint-hooks.sh +0 -179
- package/.claude/commands/hooks/README.md +0 -11
- package/.claude/commands/monitoring/README.md +0 -9
- package/.claude/commands/optimization/README.md +0 -9
- package/.claude/commands/training/README.md +0 -9
- package/.claude/commands/workflows/README.md +0 -9
- package/.claude/config.json +0 -36
- package/.claude/helpers/github-setup.sh +0 -28
- package/.claude/helpers/quick-start.sh +0 -19
- package/.claude/helpers/setup-mcp.sh +0 -18
- package/.claude/settings.json +0 -114
- package/.claude/settings.local.json +0 -33
- package/.claude-flow/metrics/agent-metrics.json +0 -1
- package/.claude-flow/metrics/performance.json +0 -9
- package/.claude-flow/metrics/system-metrics.json +0 -15986
- package/.claude-flow/metrics/task-metrics.json +0 -10
- package/.roo/README.md +0 -402
- package/.roo/mcp-list.txt +0 -257
- package/.roo/mcp.json +0 -32
- package/.roo/workflows/basic-tdd.json +0 -32
- package/.roomodes +0 -201
- package/CLAUDE.md +0 -393
- package/bin/snow-flow.js +0 -3
- package/dist/cli.js.bak +0 -2052
- package/dist/config/snow-flow-config.d.ts +0 -1492
- package/dist/config/snow-flow-config.js +0 -938
- package/scripts/create-env.js +0 -91
- package/scripts/postinstall.js +0 -30
- package/scripts/register-mcp-servers.js +0 -210
- package/scripts/reset-mcp-servers.js +0 -246
- package/scripts/setup-mcp.js +0 -106
- package/scripts/update-version.js +0 -31
- package/src/agents/README.md +0 -192
- package/src/agents/base-agent.ts +0 -251
- package/src/agents/coordinator.ts +0 -971
- package/src/agents/index.ts +0 -18
- package/src/agents/queen-403-handler.ts +0 -230
- package/src/agents/queen-agent.ts +0 -1399
- package/src/agents/script-writer-agent.ts +0 -769
- package/src/agents/security-agent.ts +0 -726
- package/src/agents/widget-creator-agent.ts +0 -568
- package/src/api/error-handling.ts +0 -1758
- package/src/api/natural-language-mapper.ts +0 -630
- package/src/api/performance-optimizer.ts +0 -891
- package/src/api/transaction-manager.ts +0 -754
- package/src/cli/deploy-artifact.ts +0 -304
- package/src/cli/snow-flow-cli-integration.ts +0 -434
- package/src/cli.ts +0 -4455
- package/src/cli.ts.bak +0 -5616
- package/src/compliance/advanced-compliance-system.ts +0 -1268
- package/src/compliance/index.ts +0 -19
- package/src/config/snow-flow-config.ts +0 -1019
- package/src/documentation/index.ts +0 -16
- package/src/documentation/self-documenting-system.ts +0 -1421
- package/src/dynamic-version.ts +0 -44
- package/src/healing/index.ts +0 -20
- package/src/healing/self-healing-system.ts +0 -1435
- package/src/health/README.md +0 -161
- package/src/health/system-health.ts +0 -995
- package/src/index.ts +0 -60
- package/src/intelligence/acl-analyzer.ts +0 -377
- package/src/intelligence/auto-resolution-engine.ts +0 -643
- package/src/intelligence/gap-analysis-engine.ts +0 -488
- package/src/intelligence/manual-instructions-generator.ts +0 -744
- package/src/intelligence/mcp-coverage-analyzer.ts +0 -708
- package/src/intelligence/multi-pass-requirements-analyzer.ts +0 -603
- package/src/intelligence/performance-recommendations-engine.ts +0 -1223
- package/src/intelligence/requirements-analyzer.ts +0 -1148
- package/src/intelligence/task-analyzer.ts +0 -628
- package/src/managers/scope-manager.ts +0 -555
- package/src/mcp/advanced/servicenow-advanced-features-mcp.ts +0 -16110
- package/src/mcp/base-mcp-server.ts +0 -660
- package/src/mcp/http-transport-wrapper.ts +0 -426
- package/src/mcp/service-discovery-client.ts +0 -312
- package/src/mcp/servicenow-automation-mcp-refactored.ts +0 -678
- package/src/mcp/servicenow-automation-mcp.ts +0 -838
- package/src/mcp/servicenow-deployment-mcp-refactored.ts +0 -1292
- package/src/mcp/servicenow-deployment-mcp.ts +0 -7244
- package/src/mcp/servicenow-graph-memory-mcp-refactored.ts +0 -721
- package/src/mcp/servicenow-graph-memory-mcp.ts +0 -832
- package/src/mcp/servicenow-integration-mcp-refactored.ts +0 -655
- package/src/mcp/servicenow-integration-mcp.ts +0 -819
- package/src/mcp/servicenow-intelligent-mcp-refactored.ts +0 -977
- package/src/mcp/servicenow-intelligent-mcp.ts +0 -4638
- package/src/mcp/servicenow-mcp-server.ts +0 -728
- package/src/mcp/servicenow-memory-mcp.ts +0 -474
- package/src/mcp/servicenow-operations-mcp-refactored.ts +0 -1995
- package/src/mcp/servicenow-operations-mcp.ts +0 -3384
- package/src/mcp/servicenow-platform-development-mcp-refactored.ts +0 -611
- package/src/mcp/servicenow-platform-development-mcp.ts +0 -970
- package/src/mcp/servicenow-progressive-indexer.ts +0 -370
- package/src/mcp/servicenow-reporting-analytics-mcp-refactored.ts +0 -695
- package/src/mcp/servicenow-reporting-analytics-mcp.ts +0 -1123
- package/src/mcp/servicenow-security-compliance-mcp-refactored.ts +0 -642
- package/src/mcp/servicenow-security-compliance-mcp.ts +0 -1157
- package/src/mcp/servicenow-update-set-mcp-refactored.ts +0 -751
- package/src/mcp/servicenow-update-set-mcp.ts +0 -811
- package/src/mcp/shared/agent-context-provider.ts +0 -365
- package/src/mcp/shared/base-mcp-server.ts +0 -2463
- package/src/mcp/shared/mcp-memory-manager.ts +0 -540
- package/src/mcp/shared/mcp-resource-manager.ts +0 -367
- package/src/mcp/snow-flow-mcp.ts +0 -911
- package/src/mcp/start-all-mcp-servers.ts +0 -102
- package/src/mcp/start-servicenow-mcp.ts +0 -67
- package/src/monitoring/enhanced-monitoring-system.ts +0 -1345
- package/src/monitoring/performance-tracker.ts +0 -777
- package/src/optimization/cost-optimization-engine.ts +0 -1125
- package/src/optimization/index.ts +0 -10
- package/src/queen/README.md +0 -403
- package/src/queen/agent-factory.ts +0 -574
- package/src/queen/index.ts +0 -94
- package/src/queen/mcp-execution-bridge.ts +0 -681
- package/src/queen/neural-learning.ts +0 -319
- package/src/queen/parallel-agent-engine.ts +0 -848
- package/src/queen/queen-memory-system.ts +0 -490
- package/src/queen/queen-memory.ts +0 -456
- package/src/queen/servicenow-queen.ts +0 -1029
- package/src/queen/types.ts +0 -87
- package/src/rollback/smart-rollback-system.ts +0 -866
- package/src/schemas/deployment.schema.json +0 -58
- package/src/schemas/flow.schema.json +0 -79
- package/src/schemas/widget.schema.json +0 -72
- package/src/snow-flow-system.ts +0 -541
- package/src/sparc/sparc-help.ts +0 -49
- package/src/sparc/team-sparc.ts +0 -88
- package/src/strategies/global-scope-strategy.ts +0 -736
- package/src/templates/base/application.template.json +0 -45
- package/src/templates/base/business_rule.template.json +0 -33
- package/src/templates/base/script_include.template.json +0 -18
- package/src/templates/base/table.template.json +0 -64
- package/src/templates/base/widget.template.json +0 -25
- package/src/templates/patterns/composite.incident-management.template.json +0 -140
- package/src/templates/patterns/widget.dashboard.template.json +0 -238
- package/src/templates/patterns/widget.datatable.template.json +0 -292
- package/src/testing/integration-test-suite.ts +0 -1276
- package/src/types/index.ts +0 -183
- package/src/types/neo4j-driver.d.ts +0 -23
- package/src/types/servicenow.types.ts +0 -307
- package/src/types/snow-flow.types.ts +0 -186
- package/src/types/todo.types.ts +0 -70
- package/src/utils/action-type-cache.ts +0 -286
- package/src/utils/agent-detector.ts +0 -573
- package/src/utils/artifact-tracker.ts +0 -379
- package/src/utils/dependency-detector.ts +0 -233
- package/src/utils/deployment-metadata-handler.ts +0 -518
- package/src/utils/error-recovery.ts +0 -680
- package/src/utils/logger.ts +0 -60
- package/src/utils/mcp-auth-middleware.ts +0 -262
- package/src/utils/mcp-config-manager.ts +0 -270
- package/src/utils/mcp-server-manager.ts +0 -446
- package/src/utils/mcp-tool-registry.ts +0 -298
- package/src/utils/migrate-snow-flow.ts +0 -98
- package/src/utils/oauth-html-templates.ts +0 -188
- package/src/utils/scope-utils.ts +0 -443
- package/src/utils/servicenow-client.ts +0 -3321
- package/src/utils/servicenow-id-generator.ts +0 -181
- package/src/utils/snow-memory-manager.ts +0 -605
- package/src/utils/snow-oauth.ts +0 -797
- package/src/utils/template-engine.ts +0 -463
- package/src/utils/theme-manager.ts +0 -295
- package/src/utils/unified-auth-store.ts +0 -222
- package/src/utils/update-set-importer.ts +0 -422
- package/src/utils/update-set-xml-packager.ts +0 -371
- package/src/utils/widget-template-generator.ts +0 -1744
- package/src/version.ts +0 -1950
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Optimization Module Exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Flow optimizer removed in v1.4.0
|
|
6
|
-
// export { FlowPerformanceOptimizer } from './flow-performance-optimizer.js';
|
|
7
|
-
export { CostOptimizationEngine } from './cost-optimization-engine.js';
|
|
8
|
-
|
|
9
|
-
// Flow performance optimizer removed in v1.4.0
|
|
10
|
-
// export type { ... } from './flow-performance-optimizer.js';
|
package/src/queen/README.md
DELETED
|
@@ -1,403 +0,0 @@
|
|
|
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.*
|