snow-flow 3.4.7 → 3.4.9

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.
@@ -559,6 +559,37 @@ class ServiceNowDeploymentMCP {
559
559
  let updateSetId = null;
560
560
  let updateSetName = 'No Update Set';
561
561
  try {
562
+ // CRITICAL: Validate required fields FIRST for clear error messages
563
+ if (!args.name) {
564
+ return {
565
+ success: false,
566
+ error: 'Widget name is required',
567
+ content: [{
568
+ type: 'text',
569
+ text: `❌ Widget deployment failed: Missing required field\n\n**Error:** Widget name is required\n\n**Required fields for widget deployment:**\n• name: Internal identifier for the widget (e.g., "my_dashboard_widget")\n• title: Display title shown in Service Portal (e.g., "My Dashboard")\n• template: HTML template for the widget\n\n**Example usage:**\n\`\`\`javascript\nsnow_deploy({\n type: "widget",\n config: {\n name: "my_widget",\n title: "My Widget Title",\n template: "<div>{{data.message}}</div>",\n server_script: "data.message = 'Hello World';",\n client_script: "function() { var c = this; }"\n }\n})\n\`\`\``
570
+ }]
571
+ };
572
+ }
573
+ if (!args.title) {
574
+ return {
575
+ success: false,
576
+ error: 'Widget title is required',
577
+ content: [{
578
+ type: 'text',
579
+ text: `❌ Widget deployment failed: Missing required field\n\n**Error:** Widget title is required for display in Service Portal\n\n**Required fields for widget deployment:**\n• name: Internal identifier for the widget\n• title: Display title shown in Service Portal ← MISSING\n• template: HTML template for the widget\n\n**Why title is required:**\nThe title is displayed in Service Portal widget picker and page designer.\nIt's what users see when selecting widgets to add to pages.\n\n**Example:**\n\`\`\`javascript\nconfig: {\n name: "incident_list",\n title: "Active Incidents", // ← This is what users will see\n template: "<div>...</div>"\n}\n\`\`\``
580
+ }]
581
+ };
582
+ }
583
+ if (!args.template && !args.html_template) {
584
+ return {
585
+ success: false,
586
+ error: 'Widget template (HTML) is required',
587
+ content: [{
588
+ type: 'text',
589
+ text: `❌ Widget deployment failed: Missing required field\n\n**Error:** Widget template (HTML) is required\n\n**Required fields for widget deployment:**\n• name: Internal identifier for the widget\n• title: Display title shown in Service Portal\n• template: HTML template for the widget ← MISSING\n\n**Template defines the widget's visual structure:**\n\`\`\`html\n<div class="my-widget">\n <h3>{{data.title}}</h3>\n <ul>\n <li ng-repeat="item in data.items">\n {{item.name}}\n </li>\n </ul>\n</div>\n\`\`\`\n\n**Note:** Use either 'template' or 'html_template' parameter.`
590
+ }]
591
+ };
592
+ }
562
593
  // Enhanced authentication check with token refresh for deployment
563
594
  const authResult = await this.deploymentAuthManager.ensureDeploymentAuth();
564
595
  if (!authResult.isValid) {
@@ -6614,11 +6645,17 @@ Use individual deployment tools like \`snow_deploy_${args.type}\` with manual co
6614
6645
  }
6615
6646
  // For widgets, delegate to widget composer
6616
6647
  if (type === 'widget') {
6648
+ const widgetName = this.extractNameFromInstruction(instruction);
6649
+ // Ensure title is always valid and user-friendly
6650
+ const widgetTitle = widgetName
6651
+ .replace(/_/g, ' ')
6652
+ .replace(/\b\w/g, l => l.toUpperCase())
6653
+ || 'Auto Generated Widget';
6617
6654
  return {
6618
- name: this.extractNameFromInstruction(instruction),
6619
- title: this.extractNameFromInstruction(instruction),
6655
+ name: widgetName,
6656
+ title: widgetTitle, // Always ensure a valid display title
6620
6657
  description: instruction,
6621
- template: this.generateWidgetTemplate(instruction),
6658
+ template: this.generateWidgetTemplate(instruction) || '<div>{{data.message}}</div>', // Ensure template is never empty
6622
6659
  css: this.generateWidgetCss(instruction),
6623
6660
  server_script: this.generateWidgetServerScript(instruction),
6624
6661
  client_script: this.generateWidgetClientScript(instruction),
@@ -6638,8 +6675,9 @@ Use individual deployment tools like \`snow_deploy_${args.type}\` with manual co
6638
6675
  // Simple name extraction - could be enhanced with NLP
6639
6676
  const words = instruction.toLowerCase().split(/\s+/);
6640
6677
  const name = words.filter(word => word.length > 2 &&
6641
- !['the', 'and', 'for', 'with', 'that', 'will', 'can', 'should'].includes(word)).slice(0, 3).join('_');
6642
- return name || 'auto_generated_artifact';
6678
+ !['the', 'and', 'for', 'with', 'that', 'will', 'can', 'should', 'create', 'make', 'build', 'new'].includes(word)).slice(0, 3).join('_');
6679
+ // Ensure we always return a valid name
6680
+ return name || `auto_generated_${Date.now().toString().slice(-6)}`;
6643
6681
  }
6644
6682
  /**
6645
6683
  * Generate HTML template based on widget requirements
@@ -1,2 +1,2 @@
1
- export declare const CLAUDE_MD_TEMPLATE = "# Snow-Flow Configuration & Best Practices\n\nThis document provides comprehensive instructions for Snow-Flow, an advanced ServiceNow development and orchestration framework powered by Claude AI.\n\n## Table of Contents\n1. [Core Philosophy](#core-philosophy)\n2. [Fundamental Rules](#fundamental-rules)\n3. [ServiceNow Development Standards](#servicenow-development-standards)\n4. [MCP Server Capabilities](#mcp-server-capabilities)\n5. [Debugging Best Practices](#debugging-best-practices)\n6. [Command Reference](#command-reference)\n7. [Workflow Guidelines](#workflow-guidelines)\n\n## Core Philosophy\n\n### The Prime Directive: Verify, Don't Assume\n\nSnow-Flow operates on evidence-based development. Never make assumptions about what exists or doesn't exist in a ServiceNow environment. Every environment is unique with custom tables, fields, integrations, and configurations that you cannot predict.\n\n**Cardinal Rules:**\n1. If code references something, it probably exists\n2. Test before declaring something broken\n3. Verify before modifying\n4. Fix only what's confirmed broken\n5. Respect existing configurations\n\n### The Verification-First Approach\n\n```javascript\n// Before claiming anything doesn't work or exist:\n// Step 1: Test the actual implementation\nconst verify = await snow_execute_script_with_output({\n script: `/* Test the exact code or resource */`\n});\n\n// Step 2: Check if resources exist\nconst tableCheck = await snow_discover_table_fields({\n table_name: 'potentially_custom_table'\n});\n\n// Step 3: Validate configurations\nconst propertyCheck = await snow_property_manager({\n action: 'get',\n name: 'system.property'\n});\n\n// Step 4: Only then make informed decisions\n```\n\n## Fundamental Rules\n\n### Rule 1: ES5 JavaScript Only in ServiceNow\n\nServiceNow uses the Rhino JavaScript engine which supports only ES5. Modern JavaScript syntax will fail.\n\n**Never Use:**\n- `const` or `let` - use `var`\n- Arrow functions `() => {}` - use `function() {}`\n- Template literals `` `${var}` `` - use string concatenation\n- Destructuring `{a, b} = obj` - use explicit property access\n- `for...of` loops - use traditional `for` loops\n- Default parameters - use `typeof` checks\n- `async/await` - use callbacks or GlideAjax\n\n**Always Use:**\n```javascript\n// ES5 compatible code\nvar name = 'value';\nfunction processData() {\n return 'result';\n}\nvar message = 'Hello ' + userName;\nfor (var i = 0; i < array.length; i++) {\n var item = array[i];\n}\n```\n\n### Rule 2: Background Scripts as Primary Debug Tool\n\nBackground scripts provide immediate, factual feedback from the actual ServiceNow instance. Use them extensively for verification and debugging.\n\n```javascript\n// Universal verification pattern\nconst verify = await snow_execute_script_with_output({\n script: `\n gs.info('=== VERIFICATION TEST ===');\n \n // Test table existence\n var table = new GlideRecord('table_name');\n gs.info('Table valid: ' + table.isValid());\n \n // Test property existence\n var prop = gs.getProperty('property.name');\n gs.info('Property: ' + (prop || 'NOT SET'));\n \n // Test actual code\n try {\n // User's code here\n gs.info('SUCCESS');\n } catch(e) {\n gs.error('ERROR: ' + e.message);\n }\n `\n});\n```\n\n### Rule 3: Widget Coherence - Critical Client-Server Communication\n\nServiceNow widgets MUST have perfect communication between client and server scripts. This is not optional - widgets fail when these components don't talk to each other correctly.\n\n**The Three-Way Contract:**\n\n**Server Script Must:**\n- Initialize all `data` properties that HTML will reference\n- Handle every `input.action` that client sends\n- Return data in the format client expects\n\n**Client Script Must:**\n- Implement every method that HTML calls via `ng-click`\n- Use `c.server.get({action: 'name'})` for server communication\n- Update `c.data` when server responds\n\n**HTML Template Must:**\n- Only reference `data` properties that server provides\n- Only call methods that client implements\n- Use correct Angular directives and bindings\n\n**Critical Communication Points:**\n\n1. **Server \u2192 Client Data Flow**\n - Server sets `data.property`\n - Client receives via `c.data.property`\n - HTML displays with `{{data.property}}`\n\n2. **Client \u2192 Server Requests**\n - Client sends `c.server.get({action: 'name'})`\n - Server receives via `input.action`\n - Server processes and returns updated `data`\n\n3. **HTML \u2192 Client Method Calls**\n - HTML has `ng-click=\"methodName()\"`\n - Client must have `$scope.methodName = function()`\n - Method typically calls server with `c.server.get()`\n\n**Common Failures to Avoid:**\n- Action name mismatches between client and server\n- Method name mismatches between HTML and client \n- Property name mismatches between server and HTML\n- Missing handlers for client requests\n- Orphaned data properties or methods\n\n**Coherence Validation Checklist:**\n- [ ] Every `data.property` in server is used in HTML/client\n- [ ] Every `ng-click` in HTML has matching `$scope.method` in client\n- [ ] Every `c.server.get({action})` in client has matching `if(input.action)` in server\n- [ ] Data flows correctly: Server \u2192 HTML \u2192 Client \u2192 Server\n- [ ] No orphaned methods or unused data properties\n\n### Rule 4: Evidence-Based Debugging\n\nFollow this systematic approach for all debugging:\n\n1. **Reproduce** - Run the exact failing code\n2. **Inventory** - List all dependencies\n3. **Verify** - Test each dependency exists\n4. **Fix** - Correct only confirmed issues\n\n**Fix only:**\n- \u2705 Confirmed syntax errors\n- \u2705 Verified null references\n- \u2705 Missing dependencies (after verification)\n- \u2705 Real type mismatches\n\n**Never change:**\n- \u274C Unverified resources\n- \u274C Configurations that \"seem wrong\"\n- \u274C APIs you haven't tested\n- \u274C Working code that could be \"better\"\n\n## ServiceNow Development Standards\n\n### Table Operations\n- Always verify table existence before operations\n- Use proper field types and references\n- Check for ACLs and permissions\n- Handle large datasets with pagination\n\n### Script Development\n- Use Script Includes for reusable code\n- Implement proper error handling\n- Add meaningful logging with gs.info/warn/error\n- Test in scoped applications when applicable\n\n### Widget Development\n- Ensure HTML/Client/Server coherence\n- Use Angular providers correctly\n- Implement proper data binding\n- Test across different themes and portals\n\n### Flow Development\n- Use proper trigger conditions\n- Implement error handling paths\n- Add appropriate logging actions\n- Test with various data scenarios\n\n## MCP Server Capabilities\n\nSnow-Flow includes 12 specialized MCP servers, each providing specific ServiceNow capabilities:\n\n### 1. ServiceNow Deployment Server\n**Purpose:** Widget and artifact deployment with coherence validation\n\n**Key Tools:**\n- `snow_deploy_widget` - Deploy widgets with HTML/Client/Server validation\n- `snow_deploy_portal_page` - Deploy portal pages\n- `snow_deploy_flow` - Deploy Flow Designer flows\n- `snow_create_update_set` - Create update sets\n- `snow_validate_deployment` - Validate deployed artifacts\n- `snow_rollback_deployment` - Rollback failed deployments\n\n**Special Features:**\n- Automatic widget coherence validation\n- Data flow contract verification\n- Method implementation checking\n- CSS class validation\n\n### 2. ServiceNow Operations Server\n**Purpose:** Core ServiceNow operations and queries\n\n**Key Tools:**\n- `snow_query_table` - Universal table querying with pagination\n- `snow_create_incident` - Create and manage incidents\n- `snow_update_record` - Update any table record\n- `snow_delete_record` - Delete records with validation\n- `snow_discover_table_fields` - Discover table schema\n- `snow_cmdb_search` - Search Configuration Management Database\n\n**Features:**\n- Full CRUD operations on any table\n- Advanced query capabilities\n- Field discovery and validation\n- Relationship navigation\n\n### 3. ServiceNow Automation Server\n**Purpose:** Script execution and automation\n\n**Key Tools:**\n- `snow_execute_script_with_output` - Execute scripts with output capture\n- `snow_get_script_output` - Retrieve script execution history\n- `snow_execute_script_sync` - Synchronous script execution\n- `snow_get_logs` - Access system logs\n- `snow_test_rest_connection` - Test REST integrations\n- `snow_trace_execution` - Trace script execution\n- `snow_schedule_job` - Create scheduled jobs\n- `snow_create_event` - Trigger system events\n\n**Features:**\n- Full output capture (gs.print/info/warn/error)\n- Execution history tracking\n- System log access\n- REST message testing\n- Performance tracing\n\n### 4. ServiceNow Platform Development Server\n**Purpose:** Platform development artifacts\n\n**Key Tools:**\n- `snow_create_script_include` - Create reusable scripts\n- `snow_create_business_rule` - Create business rules\n- `snow_create_client_script` - Create client-side scripts\n- `snow_create_ui_policy` - Create UI policies\n- `snow_create_ui_action` - Create UI actions\n- `snow_create_ui_page` - Create UI pages\n\n**Features:**\n- Full artifact creation\n- Proper scoping support\n- Condition builder integration\n- Script validation\n\n### 5. ServiceNow Integration Server\n**Purpose:** Integration and data management\n\n**Key Tools:**\n- `snow_create_rest_message` - Create REST integrations\n- `snow_create_transform_map` - Create data transformation maps\n- `snow_create_import_set` - Manage import sets\n- `snow_test_web_service` - Test web services\n- `snow_configure_email` - Configure email settings\n\n**Features:**\n- REST/SOAP integration\n- Data transformation\n- Import/Export capabilities\n- Email configuration\n\n### 6. ServiceNow System Properties Server\n**Purpose:** System property management\n\n**Key Tools:**\n- `snow_property_get` - Retrieve property values\n- `snow_property_set` - Set property values\n- `snow_property_list` - List properties by pattern\n- `snow_property_delete` - Remove properties\n- `snow_property_bulk_update` - Bulk operations\n- `snow_property_export` - Export to JSON\n- `snow_property_import` - Import from JSON\n\n**Features:**\n- Full CRUD on sys_properties\n- Bulk operations\n- Import/Export capabilities\n- Property validation\n\n### 7. ServiceNow Update Set Server\n**Purpose:** Change management and deployment\n\n**Key Tools:**\n- `snow_create_update_set` - Create new update sets\n- `snow_switch_update_set` - Switch active update set\n- `snow_complete_update_set` - Mark as complete\n- `snow_preview_update_set` - Preview changes\n- `snow_export_update_set` - Export as XML\n\n**Features:**\n- Full update set lifecycle\n- Change tracking\n- XML export/import\n- Conflict detection\n\n### 8. ServiceNow Development Assistant Server\n**Purpose:** Code generation and best practices\n\n**Key Tools:**\n- `snow_generate_code` - Generate ServiceNow code\n- `snow_suggest_pattern` - Suggest design patterns\n- `snow_review_code` - Code review and analysis\n- `snow_optimize_performance` - Performance recommendations\n\n**Features:**\n- Pattern-based code generation\n- Best practice enforcement\n- Performance optimization\n- Security review\n\n### 9. ServiceNow Security & Compliance Server\n**Purpose:** Security and compliance management\n\n**Key Tools:**\n- `snow_create_security_policy` - Create security policies\n- `snow_audit_compliance` - Compliance auditing\n- `snow_scan_vulnerabilities` - Vulnerability scanning\n- `snow_assess_risk` - Risk assessment\n- `snow_review_access_control` - ACL review\n\n**Features:**\n- SOX/GDPR/HIPAA compliance\n- Security policy management\n- Vulnerability assessment\n- Access control validation\n\n### 10. ServiceNow Reporting & Analytics Server\n**Purpose:** Reporting and data visualization\n\n**Key Tools:**\n- `snow_create_report` - Create reports\n- `snow_create_dashboard` - Create dashboards\n- `snow_define_kpi` - Define KPIs\n- `snow_schedule_report` - Schedule report delivery\n- `snow_analyze_data_quality` - Data quality analysis\n\n**Features:**\n- Advanced reporting\n- Dashboard creation\n- KPI management\n- Scheduled delivery\n\n### 11. ServiceNow Machine Learning Server\n**Purpose:** AI/ML capabilities\n\n**Key Tools:**\n- `snow_train_classifier` - Train incident classifier\n- `snow_predict_change_risk` - Predict change risks\n- `snow_detect_anomalies` - Anomaly detection\n- `snow_forecast_incidents` - Incident forecasting\n- `snow_optimize_process` - Process optimization\n\n**Features:**\n- Predictive analytics\n- Pattern recognition\n- Anomaly detection\n- Process optimization\n\n### 12. Snow-Flow Orchestration Server\n**Purpose:** Multi-agent coordination and task management\n\n**Key Tools:**\n- `snow_swarm_init` - Initialize agent swarms\n- `snow_agent_spawn` - Create specialized agents\n- `snow_task_orchestrate` - Orchestrate complex tasks\n- `snow_memory_store` - Persistent memory storage\n- `snow_neural_train` - Train neural networks\n- `snow_performance_analyze` - Performance analysis\n\n**Features:**\n- Multi-agent coordination\n- Task orchestration\n- Neural network training (TensorFlow.js)\n- Memory management\n- Performance monitoring\n\n## Debugging Best Practices\n\n### Systematic Debugging Protocol\n\n1. **Reproduce the Issue**\n ```javascript\n // Always use ES5 and test exact code\n const result = await snow_execute_script_with_output({\n script: `/* Exact failing code in ES5 */`\n });\n ```\n\n2. **Verify Dependencies**\n - Check all referenced tables exist\n - Verify all properties are set\n - Confirm all fields are present\n - Test all integrations work\n\n3. **Test in Context**\n - Use same scope and variables\n - Include same imports\n - Test with same data\n\n4. **Apply Evidence-Based Fixes**\n - Fix only confirmed issues\n - Document why changes were made\n - Test fixes thoroughly\n\n### Common Verification Patterns\n\n**Table Verification:**\n```javascript\nvar table = new GlideRecord('table_name');\ngs.info('Table exists: ' + table.isValid());\n```\n\n**Property Verification:**\n```javascript\nvar prop = gs.getProperty('property.name');\ngs.info('Property value: ' + (prop || 'NOT SET'));\n```\n\n**Field Verification:**\n```javascript\nvar gr = new GlideRecord('table');\nvar element = gr.getElement('field_name');\ngs.info('Field exists: ' + (element ? 'Yes' : 'No'));\n```\n\n## Command Reference\n\n### Core Commands\n- `./snow-flow start` - Start orchestration system\n- `./snow-flow status` - System status\n- `./snow-flow monitor` - Real-time monitoring\n\n### Agent Management\n- `./snow-flow agent spawn <type>` - Create agents\n- `./snow-flow agent list` - List active agents\n\n### Task Management\n- `./snow-flow task create` - Create tasks\n- `./snow-flow task list` - View task queue\n\n### Memory Operations\n- `./snow-flow memory store <key> <data>` - Store data\n- `./snow-flow memory get <key>` - Retrieve data\n- `./snow-flow memory list` - List all keys\n\n### SPARC Modes\n- `./snow-flow sparc \"<task>\"` - Orchestrator mode\n- `./snow-flow sparc run <mode> \"<task>\"` - Specific mode\n- `./snow-flow sparc tdd \"<feature>\"` - Test-driven development\n\n### Swarm Coordination\n- `./snow-flow swarm \"<objective>\"` - Multi-agent coordination\n- Options: `--strategy`, `--mode`, `--parallel`, `--monitor`\n\n## Workflow Guidelines\n\n### Development Workflow\n1. **Plan** - Use TodoWrite for task management\n2. **Verify** - Check existing resources\n3. **Develop** - Follow ES5 standards\n4. **Test** - Use background scripts\n5. **Deploy** - Use update sets\n6. **Validate** - Verify deployment\n\n### Testing Workflow\n1. Run unit tests with background scripts\n2. Test integrations with REST tools\n3. Validate UI with widget coherence\n4. Check performance with tracing\n5. Review logs for errors\n\n### Debugging Workflow\n1. Reproduce issue exactly\n2. Gather evidence with scripts\n3. Verify all assumptions\n4. Apply minimal fixes\n5. Test thoroughly\n6. Document changes\n\n## Important Reminders\n\n### Always Remember\n- Every ServiceNow instance is unique\n- Custom implementations exist that you don't know about\n- Preview/beta features may be available\n- Organization-specific configurations are common\n- Test everything before making assumptions\n\n### Never Assume\n- That something doesn't exist without verification\n- That configurations are wrong without testing\n- That APIs aren't available without checking\n- That code won't work without running it\n- That you know better than existing implementations\n\n### Golden Rules\n1. **Verify First** - Test before declaring broken\n2. **ES5 Only** - No modern JavaScript in ServiceNow\n3. **Evidence-Based** - Make decisions on facts, not assumptions\n4. **Minimal Changes** - Fix only what's broken\n5. **Respect Context** - Understand why things exist as they do\n\n## Conclusion\n\nSnow-Flow is a powerful framework for ServiceNow development that emphasizes verification, testing, and evidence-based decision making. By following these guidelines and best practices, you ensure reliable, maintainable, and effective ServiceNow solutions.\n\nRemember: Your job is to solve problems, not to judge implementations. Every environment has its reasons for existing configurations. Verify, test, and respect what you find.";
1
+ export declare const CLAUDE_MD_TEMPLATE = "# Snow-Flow Configuration & Best Practices\n\nThis document provides comprehensive instructions for Snow-Flow, an advanced ServiceNow development and orchestration framework powered by Claude AI.\n\n## Table of Contents\n1. [Core Philosophy](#core-philosophy)\n2. [Fundamental Rules](#fundamental-rules)\n3. [ServiceNow Development Standards](#servicenow-development-standards)\n4. [MCP Server Capabilities](#mcp-server-capabilities)\n5. [Debugging Best Practices](#debugging-best-practices)\n6. [Command Reference](#command-reference)\n7. [Workflow Guidelines](#workflow-guidelines)\n\n## Core Philosophy\n\n### The Prime Directive: Verify, Don't Assume\n\nSnow-Flow operates on evidence-based development. Never make assumptions about what exists or doesn't exist in a ServiceNow environment. Every environment is unique with custom tables, fields, integrations, and configurations that you cannot predict.\n\n**Cardinal Rules:**\n1. If code references something, it probably exists\n2. Test before declaring something broken\n3. Verify before modifying\n4. Fix only what's confirmed broken\n5. Respect existing configurations\n\n### The Verification-First Approach\n\n```javascript\n// Before claiming anything doesn't work or exist:\n// Step 1: Test the actual implementation\nconst verify = await snow_execute_script_with_output({\n script: `/* Test the exact code or resource */`\n});\n\n// Step 2: Check if resources exist\nconst tableCheck = await snow_discover_table_fields({\n table_name: 'potentially_custom_table'\n});\n\n// Step 3: Validate configurations\nconst propertyCheck = await snow_property_manager({\n action: 'get',\n name: 'system.property'\n});\n\n// Step 4: Only then make informed decisions\n```\n\n## Fundamental Rules\n\n### Rule 1: ES5 JavaScript Only in ServiceNow\n\nServiceNow uses the Rhino JavaScript engine which supports only ES5. Modern JavaScript syntax will fail.\n\n**Never Use:**\n- `const` or `let` - use `var`\n- Arrow functions `() => {}` - use `function() {}`\n- Template literals `` `${var}` `` - use string concatenation\n- Destructuring `{a, b} = obj` - use explicit property access\n- `for...of` loops - use traditional `for` loops\n- Default parameters - use `typeof` checks\n- `async/await` - use callbacks or GlideAjax\n\n**Always Use:**\n```javascript\n// ES5 compatible code\nvar name = 'value';\nfunction processData() {\n return 'result';\n}\nvar message = 'Hello ' + userName;\nfor (var i = 0; i < array.length; i++) {\n var item = array[i];\n}\n```\n\n### Rule 2: Background Scripts for Verification Only (Not Widget Updates!)\n\n**CRITICAL DISTINCTION:**\n- \u2705 Use background scripts for TESTING and VERIFICATION\n- \u274C Do NOT use background scripts to UPDATE widget fields\n- \u2705 Use `snow_update` to directly modify widget records\n- \u274C Do NOT try to import server scripts into client scripts via background scripts\n\nBackground scripts are excellent for verification and debugging, but widget updates must go through proper MCP tools:\n\n```javascript\n// Universal verification pattern\nconst verify = await snow_execute_script_with_output({\n script: `\n gs.info('=== VERIFICATION TEST ===');\n \n // Test table existence\n var table = new GlideRecord('table_name');\n gs.info('Table valid: ' + table.isValid());\n \n // Test property existence\n var prop = gs.getProperty('property.name');\n gs.info('Property: ' + (prop || 'NOT SET'));\n \n // Test actual code\n try {\n // User's code here\n gs.info('SUCCESS');\n } catch(e) {\n gs.error('ERROR: ' + e.message);\n }\n `\n});\n```\n\n### Rule 3: Widget Coherence - Critical Client-Server Communication\n\nServiceNow widgets MUST have perfect communication between client and server scripts. This is not optional - widgets fail when these components don't talk to each other correctly.\n\n**The Three-Way Contract:**\n\n**Server Script Must:**\n- Initialize all `data` properties that HTML will reference\n- Handle every `input.action` that client sends\n- Return data in the format client expects\n\n**Client Script Must:**\n- Implement every method that HTML calls via `ng-click`\n- Use `c.server.get({action: 'name'})` for server communication\n- Update `c.data` when server responds\n\n**HTML Template Must:**\n- Only reference `data` properties that server provides\n- Only call methods that client implements\n- Use correct Angular directives and bindings\n\n**Critical Communication Points:**\n\n1. **Server \u2192 Client Data Flow**\n - Server sets `data.property`\n - Client receives via `c.data.property`\n - HTML displays with `{{data.property}}`\n\n2. **Client \u2192 Server Requests**\n - Client sends `c.server.get({action: 'name'})`\n - Server receives via `input.action`\n - Server processes and returns updated `data`\n\n3. **HTML \u2192 Client Method Calls**\n - HTML has `ng-click=\"methodName()\"`\n - Client must have `$scope.methodName = function()`\n - Method typically calls server with `c.server.get()`\n\n**Common Failures to Avoid:**\n- Action name mismatches between client and server\n- Method name mismatches between HTML and client \n- Property name mismatches between server and HTML\n- Missing handlers for client requests\n- Orphaned data properties or methods\n\n**Coherence Validation Checklist:**\n- [ ] Every `data.property` in server is used in HTML/client\n- [ ] Every `ng-click` in HTML has matching `$scope.method` in client\n- [ ] Every `c.server.get({action})` in client has matching `if(input.action)` in server\n- [ ] Data flows correctly: Server \u2192 HTML \u2192 Client \u2192 Server\n- [ ] No orphaned methods or unused data properties\n\n### Rule 4: Evidence-Based Debugging\n\nFollow this systematic approach for all debugging:\n\n1. **Reproduce** - Run the exact failing code\n2. **Inventory** - List all dependencies\n3. **Verify** - Test each dependency exists\n4. **Fix** - Correct only confirmed issues\n\n**Fix only:**\n- \u2705 Confirmed syntax errors\n- \u2705 Verified null references\n- \u2705 Missing dependencies (after verification)\n- \u2705 Real type mismatches\n\n**Never change:**\n- \u274C Unverified resources\n- \u274C Configurations that \"seem wrong\"\n- \u274C APIs you haven't tested\n- \u274C Working code that could be \"better\"\n\n## ServiceNow Development Standards\n\n### Table Operations\n- Always verify table existence before operations\n- Use proper field types and references\n- Check for ACLs and permissions\n- Handle large datasets with pagination\n\n### Script Development\n- Use Script Includes for reusable code\n- Implement proper error handling\n- Add meaningful logging with gs.info/warn/error\n- Test in scoped applications when applicable\n- **NEVER use background scripts to update widget fields - use `snow_update` instead**\n\n### Widget Development\n\n**CRITICAL: Direct Widget Updates (Not Background Scripts!)**\n- Use `snow_update({ type: 'widget', identifier: 'widget_name', config: { /* fields to update */ }})` \n- Updates widget fields DIRECTLY on the widget record\n- Do NOT use background scripts to update widget fields\n- Do NOT try to import server scripts into client scripts\n\n**Widget Coherence Requirements:**\n- Ensure HTML/Client/Server scripts communicate properly\n- Use Angular providers correctly \n- Implement proper data binding\n- Test across different themes and portals\n\n**Creating New Widgets:**\n```javascript\nsnow_deploy({\n type: 'widget',\n config: {\n name: 'my_widget',\n title: 'My Widget', // Required for display\n template: '<div>{{data.message}}</div>', // Required HTML\n server_script: 'data.message = \"Hello\";',\n client_script: 'function($scope) { var c = this; }'\n }\n})\n```\n\n**Updating Existing Widgets:**\n```javascript\nsnow_update({\n type: 'widget',\n identifier: 'my_widget', // Name or sys_id\n config: {\n template: '<div>Updated HTML</div>', // Only update what changes\n server_script: 'data.updated = true;'\n }\n})\n```\n\n### Flow Development\n- Use proper trigger conditions\n- Implement error handling paths\n- Add appropriate logging actions\n- Test with various data scenarios\n\n## MCP Server Capabilities\n\nSnow-Flow includes 16+ specialized MCP servers with over 200 tools for comprehensive ServiceNow integration:\n\n### 1. ServiceNow Deployment Server\n**Purpose:** Widget and artifact deployment with coherence validation\n\n**Key Tools:**\n- `snow_deploy` - Create NEW artifacts (widgets, pages, etc.) - use with `type: 'widget'`\n- `snow_update` - UPDATE existing artifacts - use for widget field updates\n- `snow_validate_deployment` - Validate deployed artifacts\n- `snow_rollback_deployment` - Rollback failed deployments\n- `snow_preview_widget` - Preview widget before deployment\n- `snow_widget_test` - Test widget functionality\n\n**Special Features:**\n- Automatic widget coherence validation\n- Data flow contract verification\n- Method implementation checking\n- CSS class validation\n\n### 2. ServiceNow Operations Server\n**Purpose:** Core ServiceNow operations and queries\n\n**Key Tools:**\n- `snow_query_table` - Universal table querying with pagination\n- `snow_query_incidents` - Query and analyze incidents\n- `snow_cmdb_search` - Search Configuration Management Database\n- `snow_user_lookup` - Find and manage users\n- `snow_operational_metrics` - Get operational metrics\n- `snow_knowledge_search` - Search knowledge base\n\n**Features:**\n- Full CRUD operations on any table\n- Advanced query capabilities\n- Field discovery and validation\n- Relationship navigation\n\n### 3. ServiceNow Automation Server\n**Purpose:** Script execution and automation\n\n**Key Tools:**\n- `snow_execute_script_with_output` - Execute scripts with output capture\n- `snow_get_script_output` - Retrieve script execution history\n- `snow_execute_script_sync` - Synchronous script execution\n- `snow_get_logs` - Access system logs\n- `snow_test_rest_connection` - Test REST integrations\n- `snow_trace_execution` - Trace script execution\n- `snow_schedule_job` - Create scheduled jobs\n- `snow_create_event` - Trigger system events\n\n**Features:**\n- Full output capture (gs.print/info/warn/error)\n- Execution history tracking\n- System log access\n- REST message testing\n- Performance tracing\n\n### 4. ServiceNow Platform Development Server\n**Purpose:** Platform development artifacts\n\n**Key Tools:**\n- `snow_create_ui_page` - Create UI pages\n- `snow_create_script_include` - Create reusable scripts\n- `snow_create_business_rule` - Create business rules\n- `snow_create_client_script` - Create client-side scripts\n- `snow_create_ui_policy` - Create UI policies\n- `snow_create_ui_action` - Create UI actions\n\n**Features:**\n- Full artifact creation\n- Proper scoping support\n- Condition builder integration\n- Script validation\n\n### 5. ServiceNow Integration Server\n**Purpose:** Integration and data management\n\n**Key Tools:**\n- `snow_create_rest_message` - Create REST integrations\n- `snow_create_transform_map` - Create data transformation maps\n- `snow_create_import_set` - Manage import sets\n- `snow_test_web_service` - Test web services\n- `snow_configure_email` - Configure email settings\n\n**Features:**\n- REST/SOAP integration\n- Data transformation\n- Import/Export capabilities\n- Email configuration\n\n### 6. ServiceNow System Properties Server\n**Purpose:** System property management\n\n**Key Tools:**\n- `snow_property_get` - Retrieve property values\n- `snow_property_set` - Set property values\n- `snow_property_list` - List properties by pattern\n- `snow_property_delete` - Remove properties\n- `snow_property_bulk_update` - Bulk operations\n- `snow_property_export` - Export to JSON\n- `snow_property_import` - Import from JSON\n\n**Features:**\n- Full CRUD on sys_properties\n- Bulk operations\n- Import/Export capabilities\n- Property validation\n\n### 7. ServiceNow Update Set Server\n**Purpose:** Change management and deployment\n\n**Key Tools:**\n- `snow_update_set_create` - Create new update sets\n- `snow_update_set_switch` - Switch active update set\n- `snow_update_set_current` - Get current update set\n- `snow_update_set_complete` - Mark as complete\n- `snow_update_set_export` - Export as XML\n- `snow_ensure_active_update_set` - Ensure update set is active\n\n**Features:**\n- Full update set lifecycle\n- Change tracking\n- XML export/import\n- Conflict detection\n\n### 8. ServiceNow Development Assistant Server\n**Purpose:** Intelligent artifact search, editing and development assistance\n\n**Key Tools:**\n- `snow_find_artifact` - Find any ServiceNow artifact by name/type\n- `snow_edit_artifact` - Edit existing artifacts intelligently\n- `snow_get_by_sysid` - Get artifact by sys_id\n- `snow_analyze_artifact` - Analyze artifact structure and dependencies\n- `snow_comprehensive_search` - Deep search across all tables\n- `snow_analyze_requirements` - Analyze development requirements\n\n**Features:**\n- Pattern-based code generation\n- Best practice enforcement\n- Performance optimization\n- Security review\n\n### 9. ServiceNow Security & Compliance Server\n**Purpose:** Security and compliance management\n\n**Key Tools:**\n- `snow_create_security_policy` - Create security policies\n- `snow_audit_compliance` - Compliance auditing\n- `snow_scan_vulnerabilities` - Vulnerability scanning\n- `snow_assess_risk` - Risk assessment\n- `snow_review_access_control` - ACL review\n\n**Features:**\n- SOX/GDPR/HIPAA compliance\n- Security policy management\n- Vulnerability assessment\n- Access control validation\n\n### 10. ServiceNow Reporting & Analytics Server\n**Purpose:** Reporting and data visualization\n\n**Key Tools:**\n- `snow_create_report` - Create reports\n- `snow_create_dashboard` - Create dashboards\n- `snow_define_kpi` - Define KPIs\n- `snow_schedule_report` - Schedule report delivery\n- `snow_analyze_data_quality` - Data quality analysis\n\n**Features:**\n- Advanced reporting\n- Dashboard creation\n- KPI management\n- Scheduled delivery\n\n### 11. ServiceNow Machine Learning Server\n**Purpose:** AI/ML capabilities with TensorFlow.js and native ML integration\n\n**Key Tools:**\n- `ml_train_incident_classifier` - Train incident classifier with LSTM neural networks\n- `ml_predict_change_risk` - Predict change risks\n- `ml_detect_anomalies` - Anomaly detection\n- `ml_forecast_incidents` - Incident forecasting with time series\n- `ml_performance_analytics` - Native Performance Analytics ML\n- `ml_hybrid_recommendation` - Hybrid ML recommendations\n\n**Features:**\n- Predictive analytics\n- Pattern recognition\n- Anomaly detection\n- Process optimization\n\n### 12. Snow-Flow Orchestration Server\n**Purpose:** Multi-agent coordination and task management\n\n**Key Tools:**\n- `swarm_init` - Initialize agent swarms\n- `agent_spawn` - Create specialized agents\n- `task_orchestrate` - Orchestrate complex tasks\n- `memory_search` - Search persistent memory\n- `neural_train` - Train neural networks with TensorFlow.js\n- `performance_report` - Generate performance reports\n\n### Additional Servers:\n\n**ServiceNow CMDB/Event/HR/CSM/DevOps Server** - CI management, event correlation, HR processes, customer service, DevOps pipelines\n\n**ServiceNow Knowledge & Catalog Server** - Knowledge articles, service catalog items, catalog variables and policies\n\n**ServiceNow Change/Virtual Agent/PA Server** - Change management, virtual agent NLU, predictive analytics\n\n**ServiceNow Flow/Workspace/Mobile Server** - Flow Designer, workspace configuration, mobile app management\n\n**Features:**\n- Multi-agent coordination\n- Task orchestration\n- Neural network training (TensorFlow.js)\n- Memory management\n- Performance monitoring\n\n## Debugging Best Practices\n\n### Systematic Debugging Protocol\n\n1. **Reproduce the Issue**\n ```javascript\n // Always use ES5 and test exact code\n const result = await snow_execute_script_with_output({\n script: `/* Exact failing code in ES5 */`\n });\n ```\n\n2. **Verify Dependencies**\n - Check all referenced tables exist\n - Verify all properties are set\n - Confirm all fields are present\n - Test all integrations work\n\n3. **Test in Context**\n - Use same scope and variables\n - Include same imports\n - Test with same data\n\n4. **Apply Evidence-Based Fixes**\n - Fix only confirmed issues\n - Document why changes were made\n - Test fixes thoroughly\n\n### Common Verification Patterns\n\n**Table Verification:**\n```javascript\nvar table = new GlideRecord('table_name');\ngs.info('Table exists: ' + table.isValid());\n```\n\n**Property Verification:**\n```javascript\nvar prop = gs.getProperty('property.name');\ngs.info('Property value: ' + (prop || 'NOT SET'));\n```\n\n**Field Verification:**\n```javascript\nvar gr = new GlideRecord('table');\nvar element = gr.getElement('field_name');\ngs.info('Field exists: ' + (element ? 'Yes' : 'No'));\n```\n\n## Command Reference\n\n### Core Commands\n- `./snow-flow start` - Start orchestration system\n- `./snow-flow status` - System status\n- `./snow-flow monitor` - Real-time monitoring\n\n### Agent Management\n- `./snow-flow agent spawn <type>` - Create agents\n- `./snow-flow agent list` - List active agents\n\n### Task Management\n- `./snow-flow task create` - Create tasks\n- `./snow-flow task list` - View task queue\n\n### Memory Operations\n- `./snow-flow memory store <key> <data>` - Store data\n- `./snow-flow memory get <key>` - Retrieve data\n- `./snow-flow memory list` - List all keys\n\n### SPARC Modes\n- `./snow-flow sparc \"<task>\"` - Orchestrator mode\n- `./snow-flow sparc run <mode> \"<task>\"` - Specific mode\n- `./snow-flow sparc tdd \"<feature>\"` - Test-driven development\n\n### Swarm Coordination\n- `./snow-flow swarm \"<objective>\"` - Multi-agent coordination\n- Options: `--strategy`, `--mode`, `--parallel`, `--monitor`\n\n## Workflow Guidelines\n\n### Development Workflow\n1. **Plan** - Use TodoWrite for task management\n2. **Verify** - Check existing resources\n3. **Develop** - Follow ES5 standards\n4. **Test** - Use background scripts\n5. **Deploy** - Use update sets\n6. **Validate** - Verify deployment\n\n### Testing Workflow\n1. Run unit tests with background scripts\n2. Test integrations with REST tools\n3. Validate UI with widget coherence\n4. Check performance with tracing\n5. Review logs for errors\n\n### Debugging Workflow\n1. Reproduce issue exactly\n2. Gather evidence with scripts\n3. Verify all assumptions\n4. Apply minimal fixes\n5. Test thoroughly\n6. Document changes\n\n## Important Reminders\n\n### Always Remember\n- Every ServiceNow instance is unique\n- Custom implementations exist that you don't know about\n- Preview/beta features may be available\n- Organization-specific configurations are common\n- Test everything before making assumptions\n\n### Never Assume\n- That something doesn't exist without verification\n- That configurations are wrong without testing\n- That APIs aren't available without checking\n- That code won't work without running it\n- That you know better than existing implementations\n\n### Golden Rules\n1. **Verify First** - Test before declaring broken\n2. **ES5 Only** - No modern JavaScript in ServiceNow\n3. **Evidence-Based** - Make decisions on facts, not assumptions\n4. **Minimal Changes** - Fix only what's broken\n5. **Respect Context** - Understand why things exist as they do\n\n## Conclusion\n\nSnow-Flow is a powerful framework for ServiceNow development that emphasizes verification, testing, and evidence-based decision making. By following these guidelines and best practices, you ensure reliable, maintainable, and effective ServiceNow solutions.\n\nRemember: Your job is to solve problems, not to judge implementations. Every environment has its reasons for existing configurations. Verify, test, and respect what you find.";
2
2
  //# sourceMappingURL=claude-md-template.d.ts.map
@@ -78,9 +78,15 @@ for (var i = 0; i < array.length; i++) {
78
78
  }
79
79
  \`\`\`
80
80
 
81
- ### Rule 2: Background Scripts as Primary Debug Tool
81
+ ### Rule 2: Background Scripts for Verification Only (Not Widget Updates!)
82
82
 
83
- Background scripts provide immediate, factual feedback from the actual ServiceNow instance. Use them extensively for verification and debugging.
83
+ **CRITICAL DISTINCTION:**
84
+ - ✅ Use background scripts for TESTING and VERIFICATION
85
+ - ❌ Do NOT use background scripts to UPDATE widget fields
86
+ - ✅ Use \`snow_update\` to directly modify widget records
87
+ - ❌ Do NOT try to import server scripts into client scripts via background scripts
88
+
89
+ Background scripts are excellent for verification and debugging, but widget updates must go through proper MCP tools:
84
90
 
85
91
  \`\`\`javascript
86
92
  // Universal verification pattern
@@ -193,13 +199,48 @@ Follow this systematic approach for all debugging:
193
199
  - Implement proper error handling
194
200
  - Add meaningful logging with gs.info/warn/error
195
201
  - Test in scoped applications when applicable
202
+ - **NEVER use background scripts to update widget fields - use \`snow_update\` instead**
196
203
 
197
204
  ### Widget Development
198
- - Ensure HTML/Client/Server coherence
199
- - Use Angular providers correctly
205
+
206
+ **CRITICAL: Direct Widget Updates (Not Background Scripts!)**
207
+ - Use \`snow_update({ type: 'widget', identifier: 'widget_name', config: { /* fields to update */ }})\`
208
+ - Updates widget fields DIRECTLY on the widget record
209
+ - Do NOT use background scripts to update widget fields
210
+ - Do NOT try to import server scripts into client scripts
211
+
212
+ **Widget Coherence Requirements:**
213
+ - Ensure HTML/Client/Server scripts communicate properly
214
+ - Use Angular providers correctly
200
215
  - Implement proper data binding
201
216
  - Test across different themes and portals
202
217
 
218
+ **Creating New Widgets:**
219
+ \`\`\`javascript
220
+ snow_deploy({
221
+ type: 'widget',
222
+ config: {
223
+ name: 'my_widget',
224
+ title: 'My Widget', // Required for display
225
+ template: '<div>{{data.message}}</div>', // Required HTML
226
+ server_script: 'data.message = "Hello";',
227
+ client_script: 'function($scope) { var c = this; }'
228
+ }
229
+ })
230
+ \`\`\`
231
+
232
+ **Updating Existing Widgets:**
233
+ \`\`\`javascript
234
+ snow_update({
235
+ type: 'widget',
236
+ identifier: 'my_widget', // Name or sys_id
237
+ config: {
238
+ template: '<div>Updated HTML</div>', // Only update what changes
239
+ server_script: 'data.updated = true;'
240
+ }
241
+ })
242
+ \`\`\`
243
+
203
244
  ### Flow Development
204
245
  - Use proper trigger conditions
205
246
  - Implement error handling paths
@@ -208,18 +249,18 @@ Follow this systematic approach for all debugging:
208
249
 
209
250
  ## MCP Server Capabilities
210
251
 
211
- Snow-Flow includes 12 specialized MCP servers, each providing specific ServiceNow capabilities:
252
+ Snow-Flow includes 16+ specialized MCP servers with over 200 tools for comprehensive ServiceNow integration:
212
253
 
213
254
  ### 1. ServiceNow Deployment Server
214
255
  **Purpose:** Widget and artifact deployment with coherence validation
215
256
 
216
257
  **Key Tools:**
217
- - \`snow_deploy_widget\` - Deploy widgets with HTML/Client/Server validation
218
- - \`snow_deploy_portal_page\` - Deploy portal pages
219
- - \`snow_deploy_flow\` - Deploy Flow Designer flows
220
- - \`snow_create_update_set\` - Create update sets
258
+ - \`snow_deploy\` - Create NEW artifacts (widgets, pages, etc.) - use with \`type: 'widget'\`
259
+ - \`snow_update\` - UPDATE existing artifacts - use for widget field updates
221
260
  - \`snow_validate_deployment\` - Validate deployed artifacts
222
261
  - \`snow_rollback_deployment\` - Rollback failed deployments
262
+ - \`snow_preview_widget\` - Preview widget before deployment
263
+ - \`snow_widget_test\` - Test widget functionality
223
264
 
224
265
  **Special Features:**
225
266
  - Automatic widget coherence validation
@@ -232,11 +273,11 @@ Snow-Flow includes 12 specialized MCP servers, each providing specific ServiceNo
232
273
 
233
274
  **Key Tools:**
234
275
  - \`snow_query_table\` - Universal table querying with pagination
235
- - \`snow_create_incident\` - Create and manage incidents
236
- - \`snow_update_record\` - Update any table record
237
- - \`snow_delete_record\` - Delete records with validation
238
- - \`snow_discover_table_fields\` - Discover table schema
276
+ - \`snow_query_incidents\` - Query and analyze incidents
239
277
  - \`snow_cmdb_search\` - Search Configuration Management Database
278
+ - \`snow_user_lookup\` - Find and manage users
279
+ - \`snow_operational_metrics\` - Get operational metrics
280
+ - \`snow_knowledge_search\` - Search knowledge base
240
281
 
241
282
  **Features:**
242
283
  - Full CRUD operations on any table
@@ -268,12 +309,12 @@ Snow-Flow includes 12 specialized MCP servers, each providing specific ServiceNo
268
309
  **Purpose:** Platform development artifacts
269
310
 
270
311
  **Key Tools:**
312
+ - \`snow_create_ui_page\` - Create UI pages
271
313
  - \`snow_create_script_include\` - Create reusable scripts
272
314
  - \`snow_create_business_rule\` - Create business rules
273
315
  - \`snow_create_client_script\` - Create client-side scripts
274
316
  - \`snow_create_ui_policy\` - Create UI policies
275
317
  - \`snow_create_ui_action\` - Create UI actions
276
- - \`snow_create_ui_page\` - Create UI pages
277
318
 
278
319
  **Features:**
279
320
  - Full artifact creation
@@ -319,11 +360,12 @@ Snow-Flow includes 12 specialized MCP servers, each providing specific ServiceNo
319
360
  **Purpose:** Change management and deployment
320
361
 
321
362
  **Key Tools:**
322
- - \`snow_create_update_set\` - Create new update sets
323
- - \`snow_switch_update_set\` - Switch active update set
324
- - \`snow_complete_update_set\` - Mark as complete
325
- - \`snow_preview_update_set\` - Preview changes
326
- - \`snow_export_update_set\` - Export as XML
363
+ - \`snow_update_set_create\` - Create new update sets
364
+ - \`snow_update_set_switch\` - Switch active update set
365
+ - \`snow_update_set_current\` - Get current update set
366
+ - \`snow_update_set_complete\` - Mark as complete
367
+ - \`snow_update_set_export\` - Export as XML
368
+ - \`snow_ensure_active_update_set\` - Ensure update set is active
327
369
 
328
370
  **Features:**
329
371
  - Full update set lifecycle
@@ -332,13 +374,15 @@ Snow-Flow includes 12 specialized MCP servers, each providing specific ServiceNo
332
374
  - Conflict detection
333
375
 
334
376
  ### 8. ServiceNow Development Assistant Server
335
- **Purpose:** Code generation and best practices
377
+ **Purpose:** Intelligent artifact search, editing and development assistance
336
378
 
337
379
  **Key Tools:**
338
- - \`snow_generate_code\` - Generate ServiceNow code
339
- - \`snow_suggest_pattern\` - Suggest design patterns
340
- - \`snow_review_code\` - Code review and analysis
341
- - \`snow_optimize_performance\` - Performance recommendations
380
+ - \`snow_find_artifact\` - Find any ServiceNow artifact by name/type
381
+ - \`snow_edit_artifact\` - Edit existing artifacts intelligently
382
+ - \`snow_get_by_sysid\` - Get artifact by sys_id
383
+ - \`snow_analyze_artifact\` - Analyze artifact structure and dependencies
384
+ - \`snow_comprehensive_search\` - Deep search across all tables
385
+ - \`snow_analyze_requirements\` - Analyze development requirements
342
386
 
343
387
  **Features:**
344
388
  - Pattern-based code generation
@@ -379,14 +423,15 @@ Snow-Flow includes 12 specialized MCP servers, each providing specific ServiceNo
379
423
  - Scheduled delivery
380
424
 
381
425
  ### 11. ServiceNow Machine Learning Server
382
- **Purpose:** AI/ML capabilities
426
+ **Purpose:** AI/ML capabilities with TensorFlow.js and native ML integration
383
427
 
384
428
  **Key Tools:**
385
- - \`snow_train_classifier\` - Train incident classifier
386
- - \`snow_predict_change_risk\` - Predict change risks
387
- - \`snow_detect_anomalies\` - Anomaly detection
388
- - \`snow_forecast_incidents\` - Incident forecasting
389
- - \`snow_optimize_process\` - Process optimization
429
+ - \`ml_train_incident_classifier\` - Train incident classifier with LSTM neural networks
430
+ - \`ml_predict_change_risk\` - Predict change risks
431
+ - \`ml_detect_anomalies\` - Anomaly detection
432
+ - \`ml_forecast_incidents\` - Incident forecasting with time series
433
+ - \`ml_performance_analytics\` - Native Performance Analytics ML
434
+ - \`ml_hybrid_recommendation\` - Hybrid ML recommendations
390
435
 
391
436
  **Features:**
392
437
  - Predictive analytics
@@ -398,12 +443,22 @@ Snow-Flow includes 12 specialized MCP servers, each providing specific ServiceNo
398
443
  **Purpose:** Multi-agent coordination and task management
399
444
 
400
445
  **Key Tools:**
401
- - \`snow_swarm_init\` - Initialize agent swarms
402
- - \`snow_agent_spawn\` - Create specialized agents
403
- - \`snow_task_orchestrate\` - Orchestrate complex tasks
404
- - \`snow_memory_store\` - Persistent memory storage
405
- - \`snow_neural_train\` - Train neural networks
406
- - \`snow_performance_analyze\` - Performance analysis
446
+ - \`swarm_init\` - Initialize agent swarms
447
+ - \`agent_spawn\` - Create specialized agents
448
+ - \`task_orchestrate\` - Orchestrate complex tasks
449
+ - \`memory_search\` - Search persistent memory
450
+ - \`neural_train\` - Train neural networks with TensorFlow.js
451
+ - \`performance_report\` - Generate performance reports
452
+
453
+ ### Additional Servers:
454
+
455
+ **ServiceNow CMDB/Event/HR/CSM/DevOps Server** - CI management, event correlation, HR processes, customer service, DevOps pipelines
456
+
457
+ **ServiceNow Knowledge & Catalog Server** - Knowledge articles, service catalog items, catalog variables and policies
458
+
459
+ **ServiceNow Change/Virtual Agent/PA Server** - Change management, virtual agent NLU, predictive analytics
460
+
461
+ **ServiceNow Flow/Workspace/Mobile Server** - Flow Designer, workspace configuration, mobile app management
407
462
 
408
463
  **Features:**
409
464
  - Multi-agent coordination
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "3.4.7",
3
+ "version": "3.4.9",
4
4
  "description": "ServiceNow development framework with MCP server integration. Executes background scripts using ES5 JavaScript only (ServiceNow Rhino engine requirement). Provides 12 MCP servers for ServiceNow operations including widget deployment with coherence validation, table operations, script execution, and system property management.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",