snow-flow 4.5.1 → 4.5.2

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.
@@ -805,31 +805,23 @@ snow-flow sync status ${widget.sys_id}
805
805
  console.log(` ⚠️ sys_metadata query failed: ${error instanceof Error ? error.message : error}`);
806
806
  console.log(` 📋 Falling back to registered table search...`);
807
807
  }
808
- // STEP 2: If sys_metadata fails, try sp_widget FIRST for this specific widget
809
- console.log(`\n🎯 Prioritizing sp_widget table for this sys_id...`);
810
- // Special case: Try sp_widget first with extended debugging
811
- try {
812
- console.log(`🔍 Direct widget check with enhanced debugging...`);
813
- const widgetResponse = await (0, mcp_timeout_config_js_1.withMCPTimeout)(this.client.searchRecords('sp_widget', `sys_id=${sys_id}`, 1), 10000, // 10 seconds for widget check
814
- `Direct widget detection for ${sys_id}`);
815
- console.log(`📊 Widget detection result:`, {
816
- success: widgetResponse.success,
817
- resultCount: widgetResponse.result?.length || 0,
818
- error: widgetResponse.error || 'none'
819
- });
820
- if (widgetResponse.result?.[0]) {
821
- console.log(` ✅ Found widget! Name: ${widgetResponse.result[0].name}`);
822
- return this.pullArtifact('sp_widget', sys_id);
823
- }
824
- }
825
- catch (directWidgetError) {
826
- console.log(` ❌ Direct widget check failed:`, directWidgetError);
827
- }
828
- console.log(`\n📋 Checking ${Object.keys(artifact_registry_1.ARTIFACT_REGISTRY).length} registered tables...`);
808
+ // STEP 2: If sys_metadata fails, try all registered tables with improved strategy
809
+ console.log(`\n📋 Systematically checking ${Object.keys(artifact_registry_1.ARTIFACT_REGISTRY).length} artifact types...`);
829
810
  const allTables = Object.keys(artifact_registry_1.ARTIFACT_REGISTRY);
830
- const commonTables = ['sp_widget', 'sys_script_include', 'sys_script', 'sys_ui_page'];
831
- const otherTables = allTables.filter(t => !commonTables.includes(t));
832
- const tables = [...commonTables, ...otherTables]; // Common tables first
811
+ // Prioritize by most common ServiceNow artifacts
812
+ const priorityTables = [
813
+ 'sp_widget', // Service Portal widgets
814
+ 'sys_script_include', // Script includes
815
+ 'sys_script', // Business rules
816
+ 'sys_ui_page', // UI pages
817
+ 'sys_script_client', // Client scripts
818
+ 'sys_ui_policy', // UI policies
819
+ 'sys_rest_message', // REST messages
820
+ 'sys_transform_map', // Transform maps
821
+ 'sys_hub_flow' // Flow Designer flows
822
+ ];
823
+ const otherTables = allTables.filter(t => !priorityTables.includes(t));
824
+ const tables = [...priorityTables, ...otherTables]; // Priority order
833
825
  const errors = [];
834
826
  for (const table of tables) {
835
827
  // Check if we've exceeded maximum operation time
@@ -839,16 +831,17 @@ snow-flow sync status ${widget.sys_id}
839
831
  }
840
832
  try {
841
833
  console.log(` 🔎 Checking table: ${table}...`);
842
- // Increased timeout for widget detection reliability
843
- const timeoutPerTable = table === 'sp_widget' ? 8000 : 4000; // Longer for widgets
844
- const response = await (0, mcp_timeout_config_js_1.withMCPTimeout)(this.client.searchRecords(table, `sys_id=${sys_id}`, 1), timeoutPerTable, `Detect table for ${sys_id}`);
845
- // Additional debug logging for sp_widget
846
- if (table === 'sp_widget') {
847
- console.log(` 🐛 Widget detection details:`, {
848
- searchQuery: `sys_id=${sys_id}`,
834
+ // Enhanced timeout for all artifact types
835
+ const isPriorityTable = ['sp_widget', 'sys_script_include', 'sys_script', 'sys_ui_page'].includes(table);
836
+ const timeoutPerTable = isPriorityTable ? 6000 : 4000; // Longer for common artifacts
837
+ const response = await (0, mcp_timeout_config_js_1.withMCPTimeout)(this.client.searchRecords(table, `sys_id=${sys_id}`, 1), timeoutPerTable, `Detect ${(0, artifact_registry_1.getTableDisplayName)(table) || table} artifact`);
838
+ // Enhanced logging for all artifact types
839
+ if (isPriorityTable) {
840
+ console.log(` 🔍 ${(0, artifact_registry_1.getTableDisplayName)(table)} detection:`, {
841
+ table,
849
842
  timeout: timeoutPerTable,
850
- responseSuccess: response.success,
851
- resultCount: response.result?.length || 0
843
+ success: response.success,
844
+ found: response.result?.length > 0
852
845
  });
853
846
  }
854
847
  if (response.result?.[0]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.1",
3
+ "version": "4.5.2",
4
4
  "description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 200+ ServiceNow tools for comprehensive platform development.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",