snow-flow 3.4.35 → 3.4.39
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/README.md +412 -287
- package/dist/cli/deploy-artifact.js +2 -2
- package/dist/mcp/servicenow-deployment-mcp.js +1 -1
- package/dist/mcp/servicenow-mcp-server.js +2 -2
- package/dist/mcp/shared/mcp-logger.js +6 -12
- package/dist/queen/agent-factory.js +134 -52
- package/dist/queen/servicenow-queen.d.ts +127 -2
- package/dist/queen/servicenow-queen.js +978 -618
- package/dist/services/widget-deployment-service.d.ts +1 -1
- package/dist/services/widget-deployment-service.js +1 -1
- package/dist/templates/claude-md-template.d.ts +1 -1
- package/dist/templates/claude-md-template.js +2 -2
- package/dist/types/servicenow.types.d.ts +1 -1
- package/dist/utils/dependency-detector.d.ts +1 -1
- package/dist/utils/dependency-detector.js +1 -1
- package/dist/utils/servicenow-client.d.ts +1 -1
- package/dist/utils/servicenow-client.js +4 -8
- package/package.json +1 -1
- package/website/components/README.md +419 -0
- package/website/components/code-display/CodeDisplay.css +583 -0
- package/website/components/code-display/CodeDisplay.html +200 -0
- package/website/components/code-display/CodeDisplay.js +375 -0
- package/website/components/code-display/CodeDisplay.jsx +268 -0
- package/website/components/demo/ComponentLibraryDemo.html +845 -0
- package/website/components/feature-cards/FeatureCards.css +573 -0
- package/website/components/feature-cards/FeatureCards.html +247 -0
- package/website/components/feature-cards/FeatureCards.js +382 -0
- package/website/components/feature-cards/FeatureCards.jsx +235 -0
- package/website/components/hero/Hero.css +558 -0
- package/website/components/hero/Hero.html +98 -0
- package/website/components/hero/Hero.js +415 -0
- package/website/components/hero/Hero.jsx +214 -0
- package/website/components/interactive/InteractiveElements.css +776 -0
- package/website/components/interactive/InteractiveElements.html +283 -0
- package/website/components/interactive/InteractiveElements.js +489 -0
- package/website/components/interactive/InteractiveElements.jsx +444 -0
- package/website/components/layout/LayoutComponents.css +697 -0
- package/website/components/layout/LayoutComponents.html +374 -0
- package/website/components/layout/LayoutComponents.js +447 -0
- package/website/components/layout/LayoutComponents.jsx +379 -0
- package/website/components/navigation/Navigation.css +383 -0
- package/website/components/navigation/Navigation.html +89 -0
- package/website/components/navigation/Navigation.js +248 -0
- package/website/components/navigation/Navigation.jsx +124 -0
- package/website/css/animations.css +854 -0
- package/website/css/style.css +916 -948
- package/website/index.html +394 -424
- package/website/js/animations.js +707 -0
- package/website/js/main.js +310 -383
- package/website/mcp-servers.html +310 -0
|
@@ -87,7 +87,7 @@ async function deployWidget(client, config) {
|
|
|
87
87
|
template: config.config.template || '',
|
|
88
88
|
css: config.config.css || '',
|
|
89
89
|
client_script: config.config.client_script || '',
|
|
90
|
-
|
|
90
|
+
script: config.config.script || '', // ServiceNow uses 'script' field
|
|
91
91
|
option_schema: config.config.option_schema || '[]',
|
|
92
92
|
demo_data: config.config.demo_data || '{}',
|
|
93
93
|
has_preview: config.config.has_preview || false,
|
|
@@ -205,7 +205,7 @@ function getTemplate(type) {
|
|
|
205
205
|
template: '<div>{{c.data.message}}</div>',
|
|
206
206
|
css: '.my-widget { padding: 20px; }',
|
|
207
207
|
client_script: 'function() { var c = this; c.data.message = "Hello World"; }',
|
|
208
|
-
|
|
208
|
+
script: '(function() { data.message = "Server message"; })()', // ServiceNow uses 'script' field
|
|
209
209
|
option_schema: '[]',
|
|
210
210
|
demo_data: '{}'
|
|
211
211
|
}
|
|
@@ -873,7 +873,7 @@ Your widget is deployed and ready for testing in Service Portal.`
|
|
|
873
873
|
template: args.template,
|
|
874
874
|
css: args.css || '',
|
|
875
875
|
client_script: args.client_script || '',
|
|
876
|
-
|
|
876
|
+
script: args.server_script || '', // Map server_script to script field
|
|
877
877
|
option_schema: args.option_schema || '[]',
|
|
878
878
|
demo_data: args.demo_data || '{}',
|
|
879
879
|
has_preview: true,
|
|
@@ -303,7 +303,7 @@ class ServiceNowMCPServer {
|
|
|
303
303
|
template: args.template,
|
|
304
304
|
css: args.css,
|
|
305
305
|
client_script: args.client_script,
|
|
306
|
-
|
|
306
|
+
script: args.server_script, // Map server_script to script field
|
|
307
307
|
category: args.category || 'custom'
|
|
308
308
|
});
|
|
309
309
|
if (result.success) {
|
|
@@ -402,7 +402,7 @@ class ServiceNowMCPServer {
|
|
|
402
402
|
`Template:\n${result.data?.template}\n\n` +
|
|
403
403
|
`CSS:\n${result.data?.css}\n\n` +
|
|
404
404
|
`Client Script:\n${result.data?.client_script}\n\n` +
|
|
405
|
-
`Server Script:\n${result.data?.
|
|
405
|
+
`Server Script:\n${result.data?.script}` // ServiceNow uses 'script' field
|
|
406
406
|
}
|
|
407
407
|
]
|
|
408
408
|
};
|
|
@@ -118,9 +118,8 @@ class MCPLogger {
|
|
|
118
118
|
trackAPICall(operation, table, recordCount) {
|
|
119
119
|
const message = `🔄 API Call: ${operation}${table ? ` on ${table}` : ''}${recordCount ? ` (${recordCount} records)` : ''}`;
|
|
120
120
|
this.info(message);
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
this.addTokens(estimatedTokens, 50);
|
|
121
|
+
// NOTE: Removed automatic token estimation as it was inaccurate
|
|
122
|
+
// Real token usage should come from Claude Code's actual measurements
|
|
124
123
|
}
|
|
125
124
|
/**
|
|
126
125
|
* Add token usage
|
|
@@ -129,8 +128,8 @@ class MCPLogger {
|
|
|
129
128
|
this.tokenUsage.input += input;
|
|
130
129
|
this.tokenUsage.output += output;
|
|
131
130
|
this.tokenUsage.total = this.tokenUsage.input + this.tokenUsage.output;
|
|
132
|
-
//
|
|
133
|
-
if (this.tokenUsage.total > 0) {
|
|
131
|
+
// Only log token usage in debug mode to avoid spam
|
|
132
|
+
if (process.env.MCP_DEBUG === 'true' && this.tokenUsage.total > 0) {
|
|
134
133
|
console.error(`📊 [${this.name}] Tokens used: ${this.tokenUsage.total} (in: ${this.tokenUsage.input}, out: ${this.tokenUsage.output})`);
|
|
135
134
|
}
|
|
136
135
|
}
|
|
@@ -183,13 +182,8 @@ class MCPLogger {
|
|
|
183
182
|
output: tokenUsage.output,
|
|
184
183
|
total: tokenUsage.total
|
|
185
184
|
};
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
const lastContent = result.content[result.content.length - 1];
|
|
189
|
-
if (lastContent && lastContent.type === 'text') {
|
|
190
|
-
lastContent.text += `\n\n📊 Token Usage: ${tokenUsage.total} (Input: ${tokenUsage.input}, Output: ${tokenUsage.output})`;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
185
|
+
// Token usage is available in _meta.tokenUsage for debugging
|
|
186
|
+
// We no longer automatically add it to response text to avoid pollution
|
|
193
187
|
}
|
|
194
188
|
return result;
|
|
195
189
|
}
|
|
@@ -308,72 +308,154 @@ class AgentFactory {
|
|
|
308
308
|
generateExecutionPlan(agentType, instruction) {
|
|
309
309
|
const plans = {
|
|
310
310
|
'widget-creator': (instr) => [
|
|
311
|
-
'
|
|
312
|
-
'
|
|
313
|
-
'
|
|
314
|
-
'
|
|
315
|
-
'
|
|
316
|
-
'
|
|
317
|
-
'
|
|
311
|
+
'DEEP ANALYZE: What is the core business problem this widget solves? What user pain points?',
|
|
312
|
+
'HOLISTIC VIEW: How does this widget fit into the broader ServiceNow ecosystem and user journey?',
|
|
313
|
+
'STRATEGIC QUESTIONS: What are the potential edge cases, scalability concerns, and integration points?',
|
|
314
|
+
'RISK ASSESSMENT: What could go wrong? What are the dependency risks and failure modes?',
|
|
315
|
+
'SOLUTION ARCHITECTURE: Design widget with proper structure, considering performance and maintainability',
|
|
316
|
+
'IMPLEMENTATION: Create HTML template with accessibility, responsiveness, and user experience in mind',
|
|
317
|
+
'ROBUST DEVELOPMENT: Implement client/server scripts with error handling, validation, and edge case coverage',
|
|
318
|
+
'DEPLOYMENT STRATEGY: Deploy using snow_deploy with rollback plan and monitoring',
|
|
319
|
+
'COMPREHENSIVE TESTING: Test functionality, performance, cross-browser compatibility, and user scenarios',
|
|
320
|
+
'REFLECTION: What lessons learned? How can this approach be improved for future widgets?'
|
|
318
321
|
],
|
|
319
322
|
'flow-builder': (instr) => [
|
|
320
|
-
'
|
|
321
|
-
'
|
|
322
|
-
'
|
|
323
|
-
'
|
|
324
|
-
'
|
|
325
|
-
'
|
|
323
|
+
'PROCESS INTELLIGENCE: What is the complete end-to-end business process? Who are all stakeholders?',
|
|
324
|
+
'ROOT CAUSE ANALYSIS: Why does this process need automation? What inefficiencies exist?',
|
|
325
|
+
'ECOSYSTEM MAPPING: How does this flow integrate with existing workflows, approvals, and systems?',
|
|
326
|
+
'FAILURE MODE ANALYSIS: What can go wrong at each step? How do we handle exceptions and edge cases?',
|
|
327
|
+
'STRATEGIC DESIGN: Design flow structure considering scalability, maintainability, and user experience',
|
|
328
|
+
'IMPLEMENTATION: Create flow using best practices, proper error handling, and clear logic paths',
|
|
329
|
+
'INTEGRATION STRATEGY: Configure triggers, conditions, and integrate with catalog/notifications as needed',
|
|
330
|
+
'COMPREHENSIVE TESTING: Test with real data scenarios, edge cases, and failure conditions',
|
|
331
|
+
'PROCESS OPTIMIZATION: Identify improvement opportunities and performance optimizations'
|
|
326
332
|
],
|
|
327
333
|
'script-writer': (instr) => [
|
|
328
|
-
'
|
|
329
|
-
'
|
|
330
|
-
'
|
|
331
|
-
'
|
|
332
|
-
'
|
|
334
|
+
'REQUIREMENTS DEEP DIVE: What is the exact business requirement? Why is custom code needed?',
|
|
335
|
+
'ARCHITECTURE ASSESSMENT: Should this be a business rule, script include, or something else? What\'s the optimal approach?',
|
|
336
|
+
'DEPENDENCY ANALYSIS: What other systems, tables, or processes will this impact? What are the risks?',
|
|
337
|
+
'ERROR SCENARIO PLANNING: What can go wrong? How do we handle failures gracefully?',
|
|
338
|
+
'SOLUTION DESIGN: Design script with proper error handling, logging, and performance considerations',
|
|
339
|
+
'ROBUST IMPLEMENTATION: Implement with ES5 compatibility, proper validation, and edge case handling',
|
|
340
|
+
'DEPLOYMENT STRATEGY: Deploy using appropriate MCP tool with testing and rollback plan',
|
|
341
|
+
'VALIDATION & MONITORING: Validate functionality and establish monitoring for ongoing health'
|
|
333
342
|
],
|
|
334
343
|
'catalog-manager': (instr) => [
|
|
335
|
-
'
|
|
336
|
-
'
|
|
337
|
-
'
|
|
338
|
-
'
|
|
339
|
-
'
|
|
344
|
+
'BUSINESS CONTEXT ANALYSIS: What business need does this catalog item fulfill? Who are the end users?',
|
|
345
|
+
'EXISTING SOLUTION AUDIT: Search for existing catalog items - can we reuse or improve existing?',
|
|
346
|
+
'USER EXPERIENCE DESIGN: What is the optimal user journey from request to fulfillment?',
|
|
347
|
+
'INTEGRATION COMPLEXITY: What backend systems need integration? What are the failure points?',
|
|
348
|
+
'FULFILLMENT STRATEGY: Design efficient fulfillment process with proper approvals and notifications',
|
|
349
|
+
'SOLUTION ARCHITECTURE: Create catalog item with optimal variables, validations, and user guidance',
|
|
350
|
+
'PROCESS IMPLEMENTATION: Implement fulfillment workflow with error handling and monitoring',
|
|
351
|
+
'END-TO-END TESTING: Test complete request flow including approvals, fulfillment, and notifications',
|
|
352
|
+
'CONTINUOUS IMPROVEMENT: Establish feedback mechanisms and optimization opportunities'
|
|
340
353
|
],
|
|
341
354
|
'researcher': (instr) => [
|
|
342
|
-
'Search existing artifacts
|
|
343
|
-
'
|
|
344
|
-
'
|
|
345
|
-
'
|
|
355
|
+
'COMPREHENSIVE DISCOVERY: Search ALL existing artifacts and solutions - what already exists?',
|
|
356
|
+
'PATTERN RECOGNITION: What patterns exist in similar implementations? What can we learn?',
|
|
357
|
+
'GAP ANALYSIS: What gaps exist between current state and desired outcome?',
|
|
358
|
+
'RISK & CONSTRAINT MAPPING: What technical, business, and regulatory constraints must we consider?',
|
|
359
|
+
'STAKEHOLDER IMPACT: Who will be affected by this change? What are their concerns?',
|
|
360
|
+
'SOLUTION OPTIONS: Generate multiple solution approaches with pros/cons analysis',
|
|
361
|
+
'RECOMMENDATION SYNTHESIS: Provide strategic recommendations with rationale and risk assessment',
|
|
362
|
+
'IMPLEMENTATION ROADMAP: Suggest phased implementation approach with milestones and success criteria'
|
|
346
363
|
],
|
|
347
364
|
'tester': (instr) => [
|
|
348
|
-
'
|
|
349
|
-
'
|
|
350
|
-
'
|
|
351
|
-
'
|
|
352
|
-
'
|
|
365
|
+
'TESTING STRATEGY: What are ALL the ways this solution could fail? What are the critical user paths?',
|
|
366
|
+
'RISK-BASED APPROACH: What are the highest risk areas that need thorough testing?',
|
|
367
|
+
'REAL-WORLD SCENARIOS: Design test scenarios based on actual user behavior, not just happy paths',
|
|
368
|
+
'DATA STRATEGY: Generate realistic test data that covers edge cases and boundary conditions',
|
|
369
|
+
'COMPREHENSIVE EXECUTION: Execute tests covering functionality, performance, security, and integration points',
|
|
370
|
+
'FAILURE ANALYSIS: When tests fail, dig deep - is it the test, the requirement, or the implementation?',
|
|
371
|
+
'REGRESSION IMPACT: How do changes affect existing functionality? What regression tests are needed?',
|
|
372
|
+
'QUALITY METRICS: Establish clear quality gates and success criteria for release readiness',
|
|
373
|
+
'CLEANUP & DOCUMENTATION: Clean up test artifacts and document test results for future reference'
|
|
374
|
+
],
|
|
375
|
+
// Enhanced strategic plans for other agent types
|
|
376
|
+
'app-architect': (instr) => [
|
|
377
|
+
'BUSINESS ARCHITECTURE: What business capabilities does this app enable? How does it fit the enterprise strategy?',
|
|
378
|
+
'TECHNICAL ARCHITECTURE: Design scalable, maintainable system structure with proper separation of concerns',
|
|
379
|
+
'INTEGRATION LANDSCAPE: Map all integration points, data flows, and system dependencies',
|
|
380
|
+
'RISK MITIGATION: Identify architectural risks and design mitigation strategies',
|
|
381
|
+
'DEPLOYMENT STRATEGY: Create phased deployment plan with rollback capabilities and monitoring'
|
|
382
|
+
],
|
|
383
|
+
'integration-specialist': (instr) => [
|
|
384
|
+
'INTEGRATION ECOSYSTEM: Map ALL systems involved - what talks to what? What are the data flows?',
|
|
385
|
+
'FAILURE MODE ANALYSIS: What happens when integrations fail? How do we ensure data consistency?',
|
|
386
|
+
'PERFORMANCE IMPACT: How will this integration affect system performance? What are the bottlenecks?',
|
|
387
|
+
'SECURITY CONSIDERATIONS: What are the security implications? How do we secure data in transit?',
|
|
388
|
+
'MONITORING STRATEGY: How do we monitor integration health and detect issues proactively?'
|
|
389
|
+
],
|
|
390
|
+
'ui-ux-specialist': (instr) => [
|
|
391
|
+
'USER JOURNEY MAPPING: What is the complete user experience from start to finish?',
|
|
392
|
+
'ACCESSIBILITY FIRST: Design for ALL users including those with disabilities',
|
|
393
|
+
'PERFORMANCE UX: How do loading times and performance affect user experience?',
|
|
394
|
+
'MOBILE RESPONSIVENESS: Ensure optimal experience across all devices and screen sizes',
|
|
395
|
+
'USABILITY VALIDATION: Test with real users to validate design decisions and identify pain points'
|
|
396
|
+
],
|
|
397
|
+
'approval-specialist': (instr) => [
|
|
398
|
+
'APPROVAL ECOSYSTEM: Who needs to approve what? What are the business rules and exceptions?',
|
|
399
|
+
'DELEGATION PATTERNS: How do approvals work when people are unavailable? What are escalation paths?',
|
|
400
|
+
'COMPLIANCE REQUIREMENTS: What regulatory or policy requirements must the approval process meet?',
|
|
401
|
+
'AUDIT TRAIL: How do we maintain complete audit trail for compliance and troubleshooting?',
|
|
402
|
+
'EXCEPTION HANDLING: What happens when approval processes break down or need emergency overrides?'
|
|
403
|
+
],
|
|
404
|
+
'security-specialist': (instr) => [
|
|
405
|
+
'THREAT MODELING: What are ALL the ways this solution could be compromised or misused?',
|
|
406
|
+
'DATA PROTECTION: How do we protect sensitive data throughout its lifecycle?',
|
|
407
|
+
'ACCESS CONTROLS: Who should have access to what? How do we enforce least privilege?',
|
|
408
|
+
'COMPLIANCE ALIGNMENT: Does this solution meet all regulatory and policy requirements?',
|
|
409
|
+
'INCIDENT RESPONSE: How do we detect, respond to, and recover from security incidents?'
|
|
410
|
+
],
|
|
411
|
+
'css-specialist': (instr) => [
|
|
412
|
+
'DESIGN SYSTEM ALIGNMENT: How does this CSS fit into the broader design system and brand guidelines?',
|
|
413
|
+
'RESPONSIVE STRATEGY: Ensure optimal display across all devices, screen sizes, and orientations',
|
|
414
|
+
'PERFORMANCE OPTIMIZATION: Minimize CSS footprint while maintaining visual quality',
|
|
415
|
+
'ACCESSIBILITY COMPLIANCE: Ensure styles support screen readers and accessibility requirements',
|
|
416
|
+
'MAINTAINABILITY: Structure CSS for easy maintenance and future modifications'
|
|
417
|
+
],
|
|
418
|
+
'backend-specialist': (instr) => [
|
|
419
|
+
'DATA ARCHITECTURE: How should data be structured, stored, and accessed for optimal performance?',
|
|
420
|
+
'API DESIGN: Create robust APIs with proper error handling, validation, and documentation',
|
|
421
|
+
'SCALABILITY PLANNING: How will this backend handle increased load and data growth?',
|
|
422
|
+
'SECURITY HARDENING: Implement proper authentication, authorization, and data protection',
|
|
423
|
+
'MONITORING & LOGGING: Establish comprehensive logging and monitoring for operational health'
|
|
424
|
+
],
|
|
425
|
+
'frontend-specialist': (instr) => [
|
|
426
|
+
'USER EXPERIENCE OPTIMIZATION: Create intuitive, efficient interfaces that users love to use',
|
|
427
|
+
'PERFORMANCE FIRST: Optimize loading times, responsiveness, and smooth interactions',
|
|
428
|
+
'CROSS-BROWSER COMPATIBILITY: Ensure consistent experience across all browsers and versions',
|
|
429
|
+
'PROGRESSIVE ENHANCEMENT: Build robust solutions that work even when things go wrong',
|
|
430
|
+
'ACCESSIBILITY COMPLIANCE: Make interfaces usable by everyone, including assistive technologies'
|
|
431
|
+
],
|
|
432
|
+
'performance-specialist': (instr) => [
|
|
433
|
+
'PERFORMANCE BASELINE: Establish current performance metrics and identify bottlenecks',
|
|
434
|
+
'HOLISTIC OPTIMIZATION: Look at database, network, client-side, and server-side performance',
|
|
435
|
+
'SCALABILITY ANALYSIS: How will performance change as data and users grow?',
|
|
436
|
+
'MONITORING STRATEGY: Implement continuous performance monitoring and alerting',
|
|
437
|
+
'OPTIMIZATION VALIDATION: Measure and validate that optimizations actually improve performance'
|
|
353
438
|
],
|
|
354
|
-
// Default plans for other agent types
|
|
355
|
-
'app-architect': (instr) => ['Analyze architecture requirements', 'Design system structure', 'Create deployment plan'],
|
|
356
|
-
'integration-specialist': (instr) => ['Analyze integration requirements', 'Design data flow', 'Implement integration'],
|
|
357
|
-
'ui-ux-specialist': (instr) => ['Analyze user experience requirements', 'Design interface mockups', 'Implement responsive design'],
|
|
358
|
-
'approval-specialist': (instr) => ['Design approval workflow', 'Configure approval rules', 'Test approval process'],
|
|
359
|
-
'security-specialist': (instr) => ['Analyze security requirements', 'Implement security controls', 'Perform security audit'],
|
|
360
|
-
'css-specialist': (instr) => ['Analyze styling requirements', 'Develop responsive CSS', 'Optimize visual design'],
|
|
361
|
-
'backend-specialist': (instr) => ['Analyze backend requirements', 'Implement server logic', 'Optimize performance'],
|
|
362
|
-
'frontend-specialist': (instr) => ['Analyze frontend requirements', 'Implement user interface', 'Ensure cross-browser compatibility'],
|
|
363
|
-
'performance-specialist': (instr) => ['Analyze performance requirements', 'Identify bottlenecks', 'Implement optimizations'],
|
|
364
439
|
'page-designer': (instr) => [
|
|
365
|
-
'
|
|
366
|
-
'
|
|
367
|
-
'
|
|
368
|
-
'
|
|
369
|
-
'
|
|
370
|
-
'
|
|
371
|
-
'
|
|
372
|
-
'
|
|
373
|
-
'
|
|
440
|
+
'USER JOURNEY ANALYSIS: What is the user trying to accomplish on this page? What is their context and mindset?',
|
|
441
|
+
'INFORMATION ARCHITECTURE: How should information be organized and prioritized for optimal user flow?',
|
|
442
|
+
'PORTAL ECOSYSTEM: How does this page fit into the broader portal navigation and user experience?',
|
|
443
|
+
'RESPONSIVE DESIGN STRATEGY: Ensure optimal experience across desktop, tablet, and mobile devices',
|
|
444
|
+
'ACCESSIBILITY COMPLIANCE: Design for all users including screen readers and keyboard navigation',
|
|
445
|
+
'PERFORMANCE OPTIMIZATION: Balance visual appeal with fast loading times and smooth interactions',
|
|
446
|
+
'CONTENT STRATEGY: Place widgets and content strategically based on user priorities and business goals',
|
|
447
|
+
'NAVIGATION INTEGRATION: Ensure clear navigation paths and consistent user experience',
|
|
448
|
+
'CROSS-BROWSER TESTING: Validate consistent experience across all browsers and device types',
|
|
449
|
+
'USABILITY VALIDATION: Test with real users to ensure the page meets their needs effectively'
|
|
374
450
|
]
|
|
375
451
|
};
|
|
376
|
-
return plans[agentType]?.(instruction) || [
|
|
452
|
+
return plans[agentType]?.(instruction) || [
|
|
453
|
+
'STRATEGIC ANALYSIS: What is the core objective and how does it fit the bigger picture?',
|
|
454
|
+
'STAKEHOLDER MAPPING: Who is affected and what are their needs and constraints?',
|
|
455
|
+
'SOLUTION ARCHITECTURE: Design approach considering scalability, maintainability, and risk',
|
|
456
|
+
'IMPLEMENTATION STRATEGY: Execute with proper error handling, validation, and monitoring',
|
|
457
|
+
'VALIDATION & OPTIMIZATION: Test thoroughly and optimize based on real-world performance'
|
|
458
|
+
];
|
|
377
459
|
}
|
|
378
460
|
// Send message between agents
|
|
379
461
|
sendAgentMessage(from, to, type, content) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* ServiceNow Queen Agent
|
|
3
3
|
* Central coordination point for the ServiceNow hive-mind
|
|
4
4
|
*/
|
|
5
|
+
import { ServiceNowTask } from './types';
|
|
5
6
|
export interface QueenConfig {
|
|
6
7
|
memoryPath?: string;
|
|
7
8
|
maxConcurrentAgents?: number;
|
|
@@ -19,9 +20,133 @@ export declare class ServiceNowQueen {
|
|
|
19
20
|
private logger;
|
|
20
21
|
constructor(config?: QueenConfig);
|
|
21
22
|
/**
|
|
22
|
-
* Main entry point: Execute ServiceNow objective with
|
|
23
|
+
* Main entry point: Execute ServiceNow objective with STRATEGIC ORCHESTRATION
|
|
24
|
+
*
|
|
25
|
+
* This is where the Queen Agent demonstrates true helicopter-view thinking:
|
|
26
|
+
* - Deep problem analysis beyond surface requirements
|
|
27
|
+
* - Strategic risk assessment and mitigation planning
|
|
28
|
+
* - Holistic solution architecture considering all stakeholders
|
|
29
|
+
* - Proactive bottleneck identification and resolution
|
|
30
|
+
* - Comprehensive orchestration of specialized agents
|
|
23
31
|
*/
|
|
24
32
|
executeObjective(objective: string): Promise<any>;
|
|
25
|
-
|
|
33
|
+
private spawnOptimalSwarm;
|
|
34
|
+
private coordinateExecution;
|
|
35
|
+
private shouldExecuteInParallel;
|
|
36
|
+
private executeAgentsInParallel;
|
|
37
|
+
private executeAgentsSequentially;
|
|
38
|
+
private facilitateAgentCoordination;
|
|
39
|
+
private executeFinalDeployment;
|
|
40
|
+
private createDeploymentPlan;
|
|
41
|
+
private extractWidgetConfig;
|
|
42
|
+
private extractScriptConfig;
|
|
43
|
+
private generateArtifactName;
|
|
44
|
+
private generateArtifactTitle;
|
|
45
|
+
private generateWidgetTemplate;
|
|
46
|
+
private generateWidgetCss;
|
|
47
|
+
private generateClientScript;
|
|
48
|
+
private generateServerScript;
|
|
49
|
+
private generateDemoData;
|
|
50
|
+
private generateScriptCode;
|
|
51
|
+
private executeDeploymentPlan;
|
|
52
|
+
private getServerForTool;
|
|
53
|
+
private handleWidgetDependencies;
|
|
54
|
+
private attemptRecovery;
|
|
55
|
+
private learnFromExecution;
|
|
56
|
+
private handleExecutionFailure;
|
|
57
|
+
private cleanupTask;
|
|
58
|
+
private generateTaskId;
|
|
59
|
+
getActiveTaskCount(): number;
|
|
60
|
+
getTaskStatus(taskId: string): ServiceNowTask | null;
|
|
61
|
+
/**
|
|
62
|
+
* Get gap _analysis results for a task
|
|
63
|
+
*/
|
|
64
|
+
getGapAnalysisResults(taskId: string): any | null;
|
|
65
|
+
/**
|
|
66
|
+
* Get all manual guides from gap _analysis for a task
|
|
67
|
+
*/
|
|
68
|
+
getManualConfigurationGuides(taskId: string): any;
|
|
69
|
+
getHiveMindStatus(): any;
|
|
70
|
+
exportMemory(): string;
|
|
71
|
+
importMemory(memoryData: string): void;
|
|
72
|
+
clearMemory(): void;
|
|
73
|
+
getLearningInsights(): any;
|
|
74
|
+
shutdown(): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* STRATEGIC ORCHESTRATION METHODS
|
|
77
|
+
* These methods implement the Queen Agent's strategic thinking capabilities
|
|
78
|
+
*/
|
|
79
|
+
/**
|
|
80
|
+
* Perform deep problem analysis to understand what user ACTUALLY needs
|
|
81
|
+
*/
|
|
82
|
+
private performDeepProblemAnalysis;
|
|
83
|
+
/**
|
|
84
|
+
* Perform comprehensive risk assessment
|
|
85
|
+
*/
|
|
86
|
+
private performRiskAssessment;
|
|
87
|
+
/**
|
|
88
|
+
* Extract the core business problem from user request
|
|
89
|
+
*/
|
|
90
|
+
private extractCoreProblem;
|
|
91
|
+
/**
|
|
92
|
+
* Assess objective complexity
|
|
93
|
+
*/
|
|
94
|
+
private assessObjectiveComplexity;
|
|
95
|
+
/**
|
|
96
|
+
* Assess business impact
|
|
97
|
+
*/
|
|
98
|
+
private assessBusinessImpact;
|
|
99
|
+
/**
|
|
100
|
+
* Identify stakeholders affected by the change
|
|
101
|
+
*/
|
|
102
|
+
private identifyStakeholders;
|
|
103
|
+
/**
|
|
104
|
+
* Identify hidden requirements not explicitly stated
|
|
105
|
+
*/
|
|
106
|
+
private identifyHiddenRequirements;
|
|
107
|
+
/**
|
|
108
|
+
* Define clear success criteria
|
|
109
|
+
*/
|
|
110
|
+
private defineSuccessCriteria;
|
|
111
|
+
/**
|
|
112
|
+
* Identify technical risks
|
|
113
|
+
*/
|
|
114
|
+
private identifyTechnicalRisks;
|
|
115
|
+
/**
|
|
116
|
+
* Identify business risks
|
|
117
|
+
*/
|
|
118
|
+
private identifyBusinessRisks;
|
|
119
|
+
/**
|
|
120
|
+
* Identify operational risks
|
|
121
|
+
*/
|
|
122
|
+
private identifyOperationalRisks;
|
|
123
|
+
/**
|
|
124
|
+
* Identify compliance risks
|
|
125
|
+
*/
|
|
126
|
+
private identifyComplianceRisks;
|
|
127
|
+
/**
|
|
128
|
+
* Calculate overall risk level
|
|
129
|
+
*/
|
|
130
|
+
private calculateOverallRisk;
|
|
131
|
+
/**
|
|
132
|
+
* Develop mitigation strategies for critical risks
|
|
133
|
+
*/
|
|
134
|
+
private developMitigationStrategies;
|
|
135
|
+
/**
|
|
136
|
+
* Design solution architecture based on strategic analysis
|
|
137
|
+
*/
|
|
138
|
+
private designSolutionArchitecture;
|
|
139
|
+
/**
|
|
140
|
+
* Generate implementation steps based on approach
|
|
141
|
+
*/
|
|
142
|
+
private generateImplementationSteps;
|
|
143
|
+
/**
|
|
144
|
+
* Define quality gates based on analysis
|
|
145
|
+
*/
|
|
146
|
+
private defineQualityGates;
|
|
147
|
+
/**
|
|
148
|
+
* Define monitoring strategy
|
|
149
|
+
*/
|
|
150
|
+
private defineMonitoringStrategy;
|
|
26
151
|
}
|
|
27
152
|
//# sourceMappingURL=servicenow-queen.d.ts.map
|