snow-flow 4.4.1 → 4.5.1

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,7 +805,26 @@ 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 common tables first
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
+ }
809
828
  console.log(`\n📋 Checking ${Object.keys(artifact_registry_1.ARTIFACT_REGISTRY).length} registered tables...`);
810
829
  const allTables = Object.keys(artifact_registry_1.ARTIFACT_REGISTRY);
811
830
  const commonTables = ['sp_widget', 'sys_script_include', 'sys_script', 'sys_ui_page'];
@@ -820,9 +839,18 @@ snow-flow sync status ${widget.sys_id}
820
839
  }
821
840
  try {
822
841
  console.log(` 🔎 Checking table: ${table}...`);
823
- // Reduced timeout per table for faster failure
824
- const response = await (0, mcp_timeout_config_js_1.withMCPTimeout)(this.client.searchRecords(table, `sys_id=${sys_id}`, 1), 3000, // 3 second timeout per table
825
- `Detect table for ${sys_id}`);
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}`,
849
+ timeout: timeoutPerTable,
850
+ responseSuccess: response.success,
851
+ resultCount: response.result?.length || 0
852
+ });
853
+ }
826
854
  if (response.result?.[0]) {
827
855
  console.log(` ✅ Found in table: ${table}`);
828
856
  console.log(`🎆 Auto-detection successful! Proceeding with pull...`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.4.1",
3
+ "version": "4.5.1",
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",