snow-flow 4.5.0 → 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,12 +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 common tables first
809
- 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...`);
810
810
  const allTables = Object.keys(artifact_registry_1.ARTIFACT_REGISTRY);
811
- const commonTables = ['sp_widget', 'sys_script_include', 'sys_script', 'sys_ui_page'];
812
- const otherTables = allTables.filter(t => !commonTables.includes(t));
813
- 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
814
825
  const errors = [];
815
826
  for (const table of tables) {
816
827
  // Check if we've exceeded maximum operation time
@@ -820,9 +831,19 @@ snow-flow sync status ${widget.sys_id}
820
831
  }
821
832
  try {
822
833
  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}`);
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,
842
+ timeout: timeoutPerTable,
843
+ success: response.success,
844
+ found: response.result?.length > 0
845
+ });
846
+ }
826
847
  if (response.result?.[0]) {
827
848
  console.log(` ✅ Found in table: ${table}`);
828
849
  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.5.0",
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",